This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] Add --build-id flag for debuginfod lookups without binary.
ClosedPublic

Authored by mysterymath on Sep 15 2022, 4:53 PM.

Details

Summary

Adding a --build-id flag allows handling binaries that are referenced in
logs from remote systems, but that aren't necessarily present on the
local machine. These are fetched via debuginfod and handled as if they
were input filenames.

Diff Detail

Event Timeline

mysterymath created this revision.Sep 15 2022, 4:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2022, 4:53 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
mysterymath requested review of this revision.Sep 15 2022, 4:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2022, 4:53 PM

New options need adding to the CommandGuide documentation. Please update the relevant llvm/CommandGuide file.

llvm/tools/llvm-objdump/ObjdumpOpts.td
42

Other options don't have a trailing full stop for their description in this file.

llvm/tools/llvm-objdump/llvm-objdump.cpp
2923–2924

Test case for this error?

3103–3104

Test case?

mysterymath marked 3 inline comments as done.

Add error tests, docs.

jhenderson accepted this revision.Sep 20 2022, 1:01 AM

Two nits, otherwise looks good.

llvm/test/tools/llvm-objdump/debuginfod.test
58

On first glance, it wasn't clear why this one was malformed, and the next one is not found. Perhaps worth extending the comment here explaining how it is malformed (i.e. something like "not a hex string").

llvm/tools/llvm-objdump/llvm-objdump.cpp
3193–3197

Nit: to reduce git blame noise, you should be able to do this move as part of the change which introduces the debuginfod stuff, right?

This revision is now accepted and ready to land.Sep 20 2022, 1:01 AM
mysterymath marked 2 inline comments as done.

Add comment explaining how build ID is malformed.
Move otool ordering to earlier commit in stack.

MaskRay accepted this revision.Sep 20 2022, 7:49 PM

[objdump]

We commonly use [llvm-objdump]. objdump refers to the GNU binutils one.

llvm/test/tools/llvm-objdump/debuginfod.test
52

Optional: The lines in this file appear to be wrapped too aggressively. Two lines seem sufficient if you place --build-id on the previous line.

59

FileCheck line should not be indented.

65

FileCheck line should not be indented.

Address review comments.

mysterymath marked 2 inline comments as done.Sep 27 2022, 4:04 PM
mysterymath retitled this revision from [objdump] Add --build-id flag for debuginfod lookups without binary. to [llvm-objdump] Add --build-id flag for debuginfod lookups without binary..
This revision was landed with ongoing or failed builds.Oct 4 2022, 1:44 PM
This revision was automatically updated to reflect the committed changes.