This is an archive of the discontinued LLVM Phabricator instance.

[Debuginfod] Add BUILD_ID syntax to llvm-symbolizer.
ClosedPublic

Authored by mysterymath on Feb 15 2022, 3:28 PM.

Details

Summary

This adds a BUILD_ID prefix to the llvm-symbolizer stdin and argument
syntax. The prefix causes the given binary name to be interpreted as a
build ID instead of an object file path. The semantics are analagous to
the behavior of --obj and --build-id.

Diff Detail

Event Timeline

mysterymath created this revision.Feb 15 2022, 3:28 PM
mysterymath requested review of this revision.Feb 15 2022, 3:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2022, 3:28 PM

I'm not at all familiar with the debuginfod stuff, so this probably needs a second pair of eyes from someone with more knowledge in this area.

Do you need a test-case where BUILD_ID is used and --obj is specified?

llvm/docs/CommandGuide/llvm-symbolizer.rst
34

I have a marginal preference for BUILDID (withotu the underscore), as I dislike typing underscores. I don't feel strongly about this though, so if you prefer with the underscore, that's fine.

The use of the term "object file" seems a bit unintuitive here though, since a build ID is neither an object file itself, nor a path to one. Perhaps it would be better to rephrase the references to "object file" earlier in this section with "input name" or similar, then here, I'd start this paragraph with something like "By default, input names are interpreted as object file paths. However, prefixing the command with ...". Finally, I'd then put this paragraph second or third in order in this section.

179

It would be good to have a test case that tests the interaction of BUILD_ID and DATA and/or CODE.

llvm/test/tools/llvm-symbolizer/debuginfod.test
60

Add some indentation to make the output line up, as if it were on the command-line.

phosek added inline comments.Feb 16 2022, 10:23 AM
llvm/docs/CommandGuide/llvm-symbolizer.rst
34

Could we reverse the order and instead do something like:

[CODE] [FILE:]<file> <address>
DATA [FILE:]<file> <address>
[CODE] BUILDID:<build ID> <address>
DATA BUILDID:<build ID> <address>

This would avoid the confusion between file and build ID.

mysterymath marked 4 inline comments as done.

Addressed review feedback.

jhenderson added inline comments.Feb 17 2022, 1:10 AM
llvm/docs/CommandGuide/llvm-symbolizer.rst
113–121

Rather than add FILE: prefixes here, I'd instead modify Example 4 to say "BUILDID and FILE prefixes" or similar, like Example 5's "CODE and DATA prefixes".

llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
150–151

This piece of code makes me wonder whether a test case with something like FILE:BUILDID:<hex> and/or BUILDID:FILE:<path> or similar might be useful. Not sure either way.

  • Update docs.
  • The semantics of mixing multiple input name prefixes isn't obvious, so detect all combinations of more than one prefix reject the line as a syntax error.
mysterymath marked 2 inline comments as done.Feb 17 2022, 2:17 PM
This revision is now accepted and ready to land.Feb 18 2022, 12:47 AM
This revision was landed with ongoing or failed builds.Feb 24 2022, 4:39 PM
This revision was automatically updated to reflect the committed changes.