llvm-project/lldb
Jeffrey Tan dc9e6c52f3 Add auto deduce source map setting
This patch adds a new "target.auto-source-map-relative" setting.

    If enabled, this setting may auto deduce a source map entry based on requested
    breakpoint path and the original path stored in debug info for resolved
    breakpoint.

    As an example, if debug info contains "./a/b/c/main.cpp", user sets a source
    breakpoint at "/root/repo/x/y/z/a/b/c/main.cpp". The breakpoint will resolve
    correctly now with Greg's patch https://reviews.llvm.org/D130401. However, the
    resolved breakpoint will use "./a/b/c/main.cpp" to locate source file during
    stop event which would fail most of the time.

    With the new "target.auto-source-map-relative" setting enabled, a auto deduced
    source map entry "." => "/root/repo/x/y/z" will be added. This new mapping will
    help lldb to map resolved breakpoint path "./a/b/c/main.cpp" back to
    "/root/repo/x/y/z/a/b/c/main.cpp" and locate it on disk.

    If an existing source map entry is used the patch also concatenates the auto
    deduced entry with any stripped reverse mapping prefix (see example below).

    As a second example, debug info contains "./a/b/c/main.cpp" and user sets
    breakpoint at "/root/repo/x/y/z/a/b/c/main.cpp". Let's say there is an existing
    source map entry "." => "/root/repo"; this mapping would strip the prefix out of
    "/root/repo/x/y/z/a/b/c/main.cpp" and use "x/y/z/a/b/c/main.cpp" to resolve
    breakpoint. "target.auto-source-map-relative" setting would auto deduce a new
    potential mapping of "." => "x/y/z", then it detects that there is a stripped
    prefix from reverse mapping and concatenates it as the new mapping:
     "." => "/root/repo/x/y/z" which would correct map "./a/b/c/main.cpp" path to
    new path in disk.

    This patches depends on https://reviews.llvm.org/D130401 to use new added
    SBDebugger::GetSetting() API for testing.

Differential Revision: https://reviews.llvm.org/D133042
2022-09-19 13:40:22 -07:00
..
bindings [lldb] Use SWIG_fail in python-typemaps.swig (NFC) 2022-09-16 08:25:01 -07:00
cmake [CMake] Avoid `LLVM_BINARY_DIR` when other more specific variable are better-suited, part 2 2022-09-14 15:48:58 -04:00
docs [lldb] Fixed a number of typos 2022-09-13 10:38:38 -07:00
examples [lldb] Fixed a number of typos 2022-09-13 10:38:38 -07:00
include/lldb Add auto deduce source map setting 2022-09-19 13:40:22 -07:00
packages/Python/lldbsuite [lldb] Improve formatting of skipped categories message (NFC) 2022-09-15 20:39:25 -07:00
resources
scripts
source Add auto deduce source map setting 2022-09-19 13:40:22 -07:00
test Add auto deduce source map setting 2022-09-19 13:40:22 -07:00
third_party/Python/module [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
tools [lldb][fuzz] Allow expression fuzzer to be passed as a flag. 2022-09-13 15:39:15 -07:00
unittests Add auto deduce source map setting 2022-09-19 13:40:22 -07:00
utils Fix a bug in lldb-dotest that was uncovered by setting no value for dotest_args_str. 2022-08-31 18:00:18 -07:00
.clang-format
.clang-tidy [LLDB] Applying clang-tidy modernize-use-override over LLDB 2022-04-22 13:29:47 -07:00
.gitignore
CMakeLists.txt lldb: Disable unittests if llvm_gtest target does not exist 2022-08-10 16:56:08 -07:00
CODE_OWNERS.txt [CODE OWNERS] Add wallace as code owner 2022-01-12 12:36:30 -08:00
LICENSE.TXT
use_lldb_suite_root.py