This is an archive of the discontinued LLVM Phabricator instance.

[objdump] Support finding --source via --dsym files
ClosedPublic

Authored by radford on Oct 3 2022, 4:38 PM.

Details

Summary

Add support for auto-detecting or specifying dSYM files/directories to allow interleaving source with disassembly.

Diff Detail

Event Timeline

radford created this revision.Oct 3 2022, 4:38 PM
Herald added a reviewer: MaskRay. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
radford requested review of this revision.Oct 3 2022, 4:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 4:38 PM
aprantl accepted this revision.Oct 3 2022, 4:59 PM
This revision is now accepted and ready to land.Oct 3 2022, 4:59 PM
MaskRay added inline comments.Oct 3 2022, 5:14 PM
llvm/tools/llvm-objdump/MachODump.cpp
7395

unneeded blank line

7398

End full sentences with .

7400
MaskRay added inline comments.Oct 3 2022, 5:17 PM
llvm/test/tools/llvm-objdump/MachO/disassemble-source-dsym.test
1

Optional: newer test/tools tests use ## for non-RUN non-CHECK comments. That makes comments stand out and helps possibly future FileCheck's more rigid rule catching unused prefixes.

3

Add a comment if this intentionally tests reading from stdin?

9

The line isn't long enough that needs wrapping...

llvm/tools/llvm-objdump/MachODump.cpp
7457
7484
radford updated this revision to Diff 464868.Oct 3 2022, 6:21 PM
  • Used ## to start comments in the .test
  • Addressed line length / grammar conventions
  • Removed superfluous leading namespace (llvm::)
  • Only stat(2) once when auto-detecting .dSYM files
radford marked 5 inline comments as done.Oct 3 2022, 6:45 PM
radford added inline comments.
llvm/test/tools/llvm-objdump/MachO/disassemble-source-dsym.test
3

I hope the explicit - is enough to make it clear this is intentional.

llvm/tools/llvm-objdump/MachODump.cpp
7400

I don't see any reference escaping here, AFAICT, but I'm new to llvm's string types. Could you offer a suggestion?

7484

These messages are referenced in unrelated tests whose changes would only add noise here. Also, changing just these would make them inconsistent with the rest of the file. :(

radford updated this revision to Diff 464872.Oct 3 2022, 7:06 PM

Merge with another similar patch to detect an alternate location (.build-id) for a debug object:

d033ece0c985d3f89c261d030ff2ff1d9c58bbc6 [llvm-objdump] Find debug information with Build ID/debuginfod
MaskRay accepted this revision.Oct 3 2022, 11:46 PM
MaskRay added inline comments.
llvm/tools/llvm-objdump/llvm-objdump.cpp
1268

Perhaps move DbgObj next to Obj? They are both related to ObjectFile.

radford updated this revision to Diff 465015.Oct 4 2022, 8:00 AM

Update argument order to put DbgObj directly after Obj since they are related and usually equal.

thegameg accepted this revision.Oct 4 2022, 8:05 AM

Thanks Jim!

radford updated this revision to Diff 465083.Oct 4 2022, 11:05 AM
radford marked an inline comment as done.

Put back accidentally dropped tests.

This revision was landed with ongoing or failed builds.Oct 4 2022, 11:15 AM
This revision was automatically updated to reflect the committed changes.