-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support ARM assembly. #25
Conversation
Codecov Report
@@ Coverage Diff @@
## main #25 +/- ##
==========================================
+ Coverage 74.27% 74.82% +0.55%
==========================================
Files 4 4
Lines 381 437 +56
==========================================
+ Hits 283 327 +44
- Misses 98 110 +12
Continue to review full report at Codecov.
|
@@ -23,6 +23,7 @@ def escape(instruction): | |||
instruction = instruction.replace('|', r'\|') | |||
instruction = instruction.replace('{', r'\{') | |||
instruction = instruction.replace('}', r'\}') | |||
instruction = instruction.replace(' ', ' ') |
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.
LHS is tabulation character.
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.
Great start! I left few comments that I think should be checked. So this PR will add support for objdump style for ARM, not GDB disassembly support? If so could you add more test cases that test the special cases as well? More so because when other people touch upon this and they don't have ARM platform to test with, then the tests make sure everything is in working order :)
class Instruction: | ||
""" | ||
Represents a single assembly instruction with it operands, location and | ||
optional branch target | ||
""" | ||
def __init__(self, body, text, lineno, address, opcode, ops, target, imm): # pylint: disable=too-many-arguments | ||
def __init__(self, body, text, lineno, address, opcode, ops, target, imm, target_info): # noqa |
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.
Indeed this class start to have too many parameters. I guess it's okay for now but definitely this needs some attention in the future.
Actually I tested with simple GDB disassemblies and it worked. |
As a side note, here's how one can test ARM code on Ubuntu:
|
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.
I tested this locally and works good. Good job on this one! Thanks again and sorry for the late review!
Couple of things that I'll keep in my mind when continue working on this:
- Add instructions how to test arm platform on Ubuntu.
- Add more about arm support to readme.
- Improve error message when wrong target flag is used that maybe you should try other target instead.
- Provide -t flag beside --target flag.
- Split big asm2cfg to other files
No description provided.