Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to diff states in dumping symbexec state #1311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sparkyparrot
Copy link

Add possibility to diff states in dump func of symbexec

@ids: display modified ids
@mems: display modified memory
"""

for variable, value in self.modified(None, ids, mems):
for variable, value in self.modified(dict(init_state_engine if init_state_engine is not None else {}), ids, mems):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the patch be better with:

 def dump(self,init_state=None, ids=True, mems=True)
    ...
    if init_state is None:
        init_state ={}
    ...
    for variable, value in self.modified(init_state, ids, mems):
        ....

Is it ok for you ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm just note that modified doesnt take in a state instance as the name implies but a base dictionary as its commented in the source code (so a dict(state) )
@init_state: a base dictionary linking variables to their initial values

So I guess passing dict() of a StateEngine or correcting the modified func as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, as the state is a kind of dictionary, I may keep the dictionary as argument if you are ok with this (the .symbols return a dictionary as well)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All goodie then !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants