Open
Conversation
… section table, symbol table and data to STDOUT. Assume data is little endian. Don't print more than one zero in a section full of zeroes. Little Endian
… and 32 bit instructions. Instruction string should end in 16 if the instruction only takes 16 bits to encode.
Contributor
Author
|
Looking at this again, it isn't quite ready to merge. Lines 342 and 347 which use the |
Contributor
Author
|
OK, made the relevant changes, but this should probably be tested before merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been thinking about ways to make debugging a Pydgin simulator a little easier (and by a small coincidence, procrastinating over debugging my own simulator).
This PR adds a
-oor--objdumpoption to a simulator, which loads an ELF file and prints a disassembled version of that ELF file to STDOUT. The idea is to emulate GNU objdump.For example:
Symbol tables and section tables are printed. Headers are not. Mixed 16- and 32-bit instruction widths are catered for, but only if each instruction is decoded to a string which contains its width (e.g.
jalr16andmovimm32above).As a comparison, this is a small section from an ELF file, decompiled with Pydgin:
and GNU objdump displays the same section as: