Fix a regression in macOS-style path remapping.
authorAdrian Prantl <aprantl@apple.com>
Sat, 9 Nov 2019 01:35:52 +0000 (17:35 -0800)
committerAdrian Prantl <aprantl@apple.com>
Mon, 11 Nov 2019 20:21:38 +0000 (12:21 -0800)
commitda83e96273527a137f2ebd77cedb920180eab621
treea1435f312d5c6dafd0bf15a788b277bf457d4740
parentd24bce57c3ca2414ff5e53d8f7f3f007d6a946fe
Fix a regression in macOS-style path remapping.

When we switched to the LLVM .debug_line parser, the .dSYM-style path
remapping logic stopped working for relative paths because of how
RemapSourceFile silently fails for relative paths. This patch both
makes the code more readable and fixes this particular bug.

One interesting thing I learned is that Module::RemapSourceFile() is a
macOS-only code path that operates on on the lldb::Module level and is
completely separate from target.source-map, which operates on a
per-Target level.

Differential Revision: https://reviews.llvm.org/D70037

rdar://problem/56924558
lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/main.c
lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Inputs/relative.c [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/Makefile
lldb/packages/Python/lldbsuite/test/macosx/DBGSourcePathRemapping/TestDSYMSourcePathRemapping.py
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp