This is an archive of the discontinued LLVM Phabricator instance.

[llvm-symbolizer] Make the output with `-output-style=GNU` closer to addr2line's
ClosedPublic

Authored by ikudrin on Apr 16 2019, 4:55 AM.

Details

Summary

This is an extract from D60067. It addresses two differences in the output of llvm-symbolizer and GNU's addr2line:

  • llvm-symbolizer prints an empty line after the report of each address.
  • With "-f -i=0", llvm-symbolizer replaces the name of an inlined function with the name from the symbol table, i. e., the top caller function in the inlining chain. addr2line preserves the name of the inlined function.

Diff Detail

Event Timeline

ikudrin created this revision.Apr 16 2019, 4:55 AM
jhenderson added inline comments.Apr 16 2019, 5:29 AM
test/tools/llvm-symbolizer/output-style.test
1

This test is getting too big to follow. I wonder if it would be better to add llvm-symbolizer --output-style=GNU/LLVM cases to the existing tests for -i/-p?

ikudrin marked an inline comment as done.Apr 16 2019, 11:53 PM
ikudrin added inline comments.
test/tools/llvm-symbolizer/output-style.test
1

It was my first intention but it looked even worse.

ikudrin updated this revision to Diff 195514.Apr 16 2019, 11:54 PM
  • Simplified tests.
jhenderson accepted this revision.Apr 17 2019, 2:05 AM

LGTM, but I wouldn't mind a second pair of eyes on the new logic (@rupprecht?), as I'm not really familiar with how the DILineInfo class works.

test/tools/llvm-symbolizer/output-style-empty-line.test
18 ↗(On Diff #195514)

Put a {{$}} at the end of this line, if you don't want it matching the column output.

This revision is now accepted and ready to land.Apr 17 2019, 2:05 AM
ikudrin marked an inline comment as done.Apr 17 2019, 2:20 AM
ikudrin added inline comments.
test/tools/llvm-symbolizer/output-style-empty-line.test
18 ↗(On Diff #195514)

I am trying to follow the rule that the test should check only one specific thing, if possible. This very test checks only the presence or absence of an empty line. There is another test, 'output-style-column.test', which checks for the column.

jhenderson added inline comments.Apr 17 2019, 2:36 AM
test/tools/llvm-symbolizer/output-style-empty-line.test
18 ↗(On Diff #195514)

Okay, fair enough.

rupprecht added inline comments.Apr 17 2019, 2:47 AM
test/tools/llvm-symbolizer/output-style-inlined.test
17 ↗(On Diff #195514)

Additionally, GNU-NOT: main?

jhenderson added inline comments.Apr 17 2019, 3:23 AM
test/tools/llvm-symbolizer/output-style-inlined.test
17 ↗(On Diff #195514)

Better would be to use --implicit-check-not=main (to avoid ordering issues).

ikudrin updated this revision to Diff 195536.Apr 17 2019, 4:07 AM
  • Added --implicit-check-not=main and --implicit-check-not=inctwo to the checks in output-style-inlined.test. I added the similar option to the other two checks so that all the checks in the test follow the same pattern.
This revision was automatically updated to reflect the committed changes.