0

aosp have a python script lldbclient.py, which can start lldb server, and create a vscode launch configuration setting supported by codelldb extension.

This generated configuration like this:

{
    "name": "(lldbclient.py) Attach surfaceflinger (port: 5039)",
    "type": "lldb",
    "request": "custom",
    "relativePathBase": "/mnt/data/zl/aosp_project",
    "sourceMap": {
        "/b/f/w": "/mnt/data/zl/aosp_project",
        "": "/mnt/data/zl/aosp_project",
        ".": "/mnt/data/zl/aosp_project"
    },
    "initCommands": [
        "settings append target.exec-search-paths /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/system/lib64/ /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/system/lib64/hw /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/system/lib64/ssl/engines /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/system/lib64/drm /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/system/lib64/egl /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/system/lib64/soundfx /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/vendor/lib64/ /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/vendor/lib64/hw /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/vendor/lib64/egl /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/apex/com.android.runtime/bin"
    ],
    "targetCreateCommands": [
        "target create /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/system/bin/surfaceflinger",
        "target modules search-paths add / /mnt/data/zl/aosp_project/out/target/product/emulator_x86_64/symbols/"
    ],
    "processCreateCommands": [
        "gdb-remote 5039"
    ],
},

What does the "/b/f/w" in sourceMap section meaning?

I found this sourceMap item cause vscode codelldb set breakpoints failed. This is because when I set a breakpoint in line 1000 with a file such as SurfaceFlinger.cpp, codelldb will send command "b /b/f/w/framework/native/services/surfaceflinger/SurfaceFlinger.cpp:1000" to lldb, lldb cannot find this file, so this failed.

Currently I just remove "/b/f/w": "/mnt/data/zl/aosp_project" in sourceMap section to work around this.

I can't find any information about "/b/f/w" in lldb documetation.

robot
  • 1

1 Answers1

0

The lldb "source-map" setting is used when for debugging a binary where the sources on the debugging machine are not in the same location as they were when the binary was built. Since the debug info records the source location at build time, lldb needs some help to map those locations to the current location. See settings list target.source-map for more details.

I have no idea why your project generator is adding these seemingly bogus entries.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63