Page MenuHomePhabricator

[DebugLine] Improve path handling.

Authored by JDevlieghere on Aug 14 2019, 9:31 AM.



After switching over LLDB's line table parser to libDebugInfo, we noticed two regressions on the Windows bot. The problem is that when obtaining a file from the line table prologue, we append paths without specifying a path style. This leads to incorrect results on Windows for debug info containing Posix paths:

0x0000000000201000: /tmp\b.c, is_start_of_statement = TRUE

This patch is an attempt to fix that by guessing the path style whenever possible.

Diff Detail


Event Timeline

JDevlieghere created this revision.Aug 14 2019, 9:31 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 14 2019, 9:31 AM

This should fix the following two test failures on the Windows LLDB bot (

LLDB :: SymbolFile/DWARF/debug-line-basic.s
LLDB :: SymbolFile/DWARF/dir-separator-posix.s

Unfortunately I don't have access to a Windows machine, so I'm not able to verify this.

aprantl added inline comments.Aug 14 2019, 9:46 AM
183 ↗(On Diff #215142)

you can just use llvm::Optional::getValueOr(FileSpec::Style::native) instead of this function.

aprantl accepted this revision.Aug 14 2019, 9:48 AM

LGTM with some minor details addressed, thanks!

1044 ↗(On Diff #215142)

/// If this is an absolute path, detect ...

This revision is now accepted and ready to land.Aug 14 2019, 9:48 AM
This revision was automatically updated to reflect the committed changes.