gnu addr2line prints DWARF line table discriminators like so:
<file>:<line> (discriminator <Number>)
This matches that behavior.
Add test for new GNU-style discriminator printing.
Differential D73318
Print discriminators when printing .debug_line in GNU style. saugustine on Jan 23 2020, 5:56 PM. Authored by
Details gnu addr2line prints DWARF line table discriminators like so: <file>:<line> (discriminator <Number>) This matches that behavior. Add test for new GNU-style discriminator printing.
Diff Detail
Event TimelineComment Actions Is there a particular reason to restrict this to GNU style? I think it's okay to expand on the LLVM style too, but might be worth getting more opinions on it.
Comment Actions LLVM output style already prints the column number (file:line:column), which tells you the same thing as the discriminator, but at a higher level that is more friendly for users. I'm open to adding it, but it seems a bit redundant. Otherwise updated. Comment Actions So it would print: foo /tmp/discrim.c:5:17 (discriminator 2) It doesn't seem *that* redundant so I'd also consider adding it for llvm style too. But I don't particularly need it. Comment Actions Column information seems like enough to me for now. If we find a use-case for discriminator information as well as column info, then I'm open to adding it in the future though.
Comment Actions Okay code and test looks good. Just needs a documentation change to go with it. I recommend updating the description about column numbers in llvm-symbolizer's command guide's --output-style description to mention the discriminators, ideally with an update to the corresponding example too. (The examples in the guide all use the source at the top of the file). Comment Actions LLVM output style already prints the column number (file:line:column), which tells you the same thing as the discriminator, but at a higher level that is more friendly for users. I'm open to adding it, but it seems a bit redundant. Otherwise updated. I debated whether or not to add the -fdebug-info-for-profiling option to the top compile commands, but it seemed to distract from the main point. Let me know if this is acceptable. Comment Actions LGTM, with the suggested doc changes.
|
I might replace "dwarf" with "debug data" for more generality. I might also change the second sentence to be a little more general (the "only" feels like it could rot easily). How about "One way to produce discriminators is to compile with clang's -fdebug-info-for-profiling"?