This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] [debuginfod] Fetch for very-stripped binaries.
ClosedPublic

Authored by mysterymath on Aug 29 2022, 1:57 PM.

Details

Summary

When a binary is missing section headers or symbols, objdump can't
provide as good of a disassembly. This change makes objdump try to fetch
a better verion of the binary by its build ID.

Diff Detail

Event Timeline

mysterymath created this revision.Aug 29 2022, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 1:57 PM
mysterymath requested review of this revision.Aug 29 2022, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 1:57 PM

Correct clang-format formatting.

jhenderson added inline comments.Sep 21 2022, 12:21 AM
llvm/tools/llvm-objdump/llvm-objdump.cpp
1976

There's a lot of if clauses in this new area of code, so I'd expect to see a corresponding number of new test cases, but there's only one. Please make sure there's a test case that exercises each of the different possible code paths.

2096–2098

Might want to hold off on this usage here: there's an active discussion on whether we a) should allow it (due to potential footguns), and b) what the style of the C++17 if with initializer should be. See https://discourse.llvm.org/t/rfc-code-style-of-initializer-in-if-statement/65357/1.

mysterymath marked an inline comment as done.

Add tests; address review comments.

mysterymath retitled this revision from [objdump] [debuginfod] Fetch for very-stripped binaries. to [llvm-objdump] [debuginfod] Fetch for very-stripped binaries..Sep 27 2022, 2:50 PM
mysterymath marked an inline comment as done.
jhenderson accepted this revision.Sep 28 2022, 12:42 AM

LGTM, with small nit.

llvm/test/tools/llvm-objdump/debuginfod.test
87–89

Small nit: I'd reorder these to match the order they're used in.

This revision is now accepted and ready to land.Sep 28 2022, 12:42 AM
mysterymath marked an inline comment as done.

Reorder checks.

Update the no-section dump syntax.

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