-
-
Notifications
You must be signed in to change notification settings - Fork 710
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
Fix capstone-disassemble command and documentation #695
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good PR, some stuff to change and we'll merge after. Thanks for updating the doc too.
I think all requested changes have been implemented now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a few comment nitpicks.
Fix capstone-disassemble command and documentation
Description/Motivation/Screenshots
As part of #693 this PR fixes the documentation and help messages for the
capstone-disassemble
command. Furthermore the command was not working in use cases like emulating aarch64 inside qemu. This was due to an uncaught exception caused ingef_get_auxiliary_values
when gdb'sinfo auxv
doesn't return useful results. This bug has been fixed. Also resolving ofLOCATION
s has been fixed.With this PR I also propose changing the syntax for the
location
argument back to how it was before argparse: as a positional argument.During this PR I introduced a new convenience wrapper function around gdb's
parse_and_eval
to specifically resolveLOCATION
s. This way other commands can rely on it without having to handle the different possible cases neccessary (because e.g. gdb resolves registers different from symbols and for symbols a simple conversion toint
does not work directly). This new function does not aim at replacinggef_safe_parse_and_eval
at this point because too many commands rely currently rely on it and there might be use cases that don't resolve locations.I also added a unit test that checks if resolving a symbol (e.g. "main") works for the command.
How Has This Been Tested?
make test
Checklist
dev
branch, notmaster
.