Page MenuHomePhabricator

llvm-objdump: Implement --start-address and --stop-address
ClosedPublic

Authored by khemant on Sep 1 2016, 2:53 PM.

Details

Summary

Disassembly only part of the file using address specifiers.

Note: The test is a fully baked executable as relocatables do not have addresses. Test exercises disassembly across symbols, sections and range within a symbol (including data).

Diff Detail

Repository
rL LLVM

Event Timeline

khemant updated this revision to Diff 70073.Sep 1 2016, 2:53 PM
khemant retitled this revision from to llvm-objdump: Implement --start-address and --stop-address.
khemant updated this object.
khemant added reviewers: compnerd, echristo.
khemant set the repository for this revision to rL LLVM.
khemant added subscribers: echristo, compnerd, llvm-commits.
compnerd edited edge metadata.Sep 1 2016, 10:53 PM

Thoughts on using obj2yaml/yaml2obj on the binary?

test/tools/llvm-objdump/X86/start-stop-address.test
29 ↗(On Diff #70073)

Alignment makes reading the output easier, and whitespace is ignored anyways.

tools/llvm-objdump/llvm-objdump.cpp
1529 ↗(On Diff #70073)

Why use goto rather than wrap the bit in the if condition?

khemant added inline comments.Sep 2 2016, 9:37 AM
tools/llvm-objdump/llvm-objdump.cpp
1529 ↗(On Diff #70073)

Yea. Even using this goto should have been merged with above goto. I will invert the if condition for both of those cases.

khemant updated this revision to Diff 70472.Sep 6 2016, 2:37 PM
khemant edited edge metadata.

Made test case a yaml instead of binary.

Addressed few comments.

khemant marked 2 inline comments as done.Sep 6 2016, 2:38 PM
compnerd accepted this revision.Sep 8 2016, 8:06 PM
compnerd edited edge metadata.

Would make it easier to read the test if you aligned the disassembled mnemonics.

This revision is now accepted and ready to land.Sep 8 2016, 8:06 PM
This revision was automatically updated to reflect the committed changes.