This is an archive of the discontinued LLVM Phabricator instance.

Handle non-absolute include dirs properly for both dwarf4 and dwarf5.
ClosedPublic

Authored by saugustine on Jan 28 2020, 2:24 PM.

Details

Summary

Add test case for the same. This test case will also serve as a
starting point for later symbolizer tests.

Diff Detail

Event Timeline

saugustine created this revision.Jan 28 2020, 2:24 PM
Herald added a project: Restricted Project. · View Herald Transcript
jdoerfert resigned from this revision.Jan 28 2020, 2:49 PM
dblaikie accepted this revision.Jan 28 2020, 3:02 PM

Hmm - I would've thought there'd be some specific test coverage for this code already that it could be added to for DWARFv5 - but might be lost in the mists of time & this seems good.

This revision is now accepted and ready to land.Jan 28 2020, 3:02 PM

Hmm - I would've thought there'd be some specific test coverage for this code already that it could be added to for DWARFv5 - but might be lost in the mists of time & this seems good.

The symbolize-directory test right next to it would be perfect (and, in fact, this code derives from that).

Except it deals with the directory entry zero, which is unallowed in dwarf4 and required in dwarf5, which makes sharing the source file between the two a bit of a pain. It's also testing something important, so needs to stay.

I wonder if this is worth unit-testing instead of/in addition to the lit test? The Prologue class should be fairly straightforward to instantiate with the necessary contents, allowing you to test the functionality more directly.

This revision was automatically updated to reflect the committed changes.
MaskRay added inline comments.
llvm/test/DebugInfo/symbolize-paths.s
9

This should look like:

# Absolute include-dirs should not have comp-dir prepended
# CHECK: /absolute{{/|\\}}1.cc:1:0
# Relative include-dirs should have comp-dir prepended	
# CHECK: /comp_dir{{/|\\}}relative{{/|\\}}2.cc:2:1

.file 2 "relative" "2.cc"

The path components are concatenated by \\ on Windows.

thakis has fixed the test.