llvm/llvm-project

llvm-symbolizer --markup-filter does not adjust addresses without debug info

Open

#63.178 aperta il 7 giu 2023

Vedi su GitHub
 (10 commenti) (0 reazioni) (1 assegnatario)C++ (10.782 fork)batch import
good first issuetools:llvm-symbolizer

Metriche repository

Star
 (26.378 star)
Metriche merge PR
 (Merge medio 1g 2h) (1000 PR mergiate in 30 g)

Descrizione

If a lookup for debug info fails when symbolizing a log containing markup, a raw representation of the element is printed instead of a best effort version of the value. This makes sense for syntactic or semantic errors, but in cases where debug info simply cannot be found, there is still a good deal of information that the filter can print simply through the contextual markup elements. In particular, it can print addresses adjusted by the runtime memory layout of the process, which makes it easier to e.g. objdump the addresses later.

Fixing this should just be a matter of printing something like [[[PC <addr>]]] instead of the current printRawElement. In these cases the correct address has already been computed, so it should be a relatively straightforward change.

Reference: llvm/lib/DebugInfo/Symbolize/MarkupFilter.cpp Symbolizer Markup Format

Guida contributor