vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.52k stars 245 forks source link

Can't map two sources to same destination #930

Closed gbryant-arm closed 1 year ago

gbryant-arm commented 1 year ago

OS: Ubuntu 20.04 VSCode version: 1.78.0 CodeLLDB version: 1.9.1 Compiler: rustc 1.65.0 VSCode is running in a dev container

I'm trying to set breakpoints on two binaries whose sources are symlinked to the same codebase via different symlinks:

I've followed the troubleshooting guide and configured sourceMap as follows:

"sourceMap": {
    "/work/Veracruz/veracruz/workspaces/linux-host/crates" : "/work/Veracruz/veracruz",
    "/work/Veracruz/veracruz/workspaces/linux-runtime/crates" : "/work/Veracruz/veracruz"
},

Interestingly only the breakpoints associated with */linux-host/* get resolved. Output from breakpoint list --verbose:

Current breakpoints:
1: file = '/work/Veracruz/veracruz/workspaces/linux-host/crates/veracruz-server/src/cli.rs', line = 30, exact_match = 0

    1.1: 
      module = /work/Veracruz/veracruz/workspaces/linux-host/target/debug/veracruz-server
      compile unit = 4b0wvdf3qht5gwlu
      function = veracruz_server::main
      location = /work/Veracruz/veracruz/workspaces/linux-host/crates/veracruz-server/src/cli.rs:30:15
      address = 0x000055555566f327
      resolved = true
      hardware = false
      hit count = 1   

2: file = '/work/Veracruz/veracruz/workspaces/linux-host/crates/execution-engine/src/native_module_manager.rs', line = 235, exact_match = 0

Swapping the mappings (moving the first one below the second) makes the */linux-runtime/* mapping work and the */linux-host/* mapping fail. Output from breakpoint list --verbose:

Current breakpoints:
1: file = '/work/Veracruz/veracruz/workspaces/linux-runtime/crates/veracruz-server/src/cli.rs', line = 30, exact_match = 0

2: file = '/work/Veracruz/veracruz/workspaces/linux-runtime/crates/execution-engine/src/native_module_manager.rs', line = 235, exact_match = 0

    2.1: 
      module = /tmp/.tmp2nFOcW/runtime_enclave_binary
      compile unit = 3cuu6b0f6ua8ejbf
      function = execution_engine::native_module_manager::NativeModuleManager::execute
      location = /work/Veracruz/veracruz/workspaces/linux-runtime/crates/execution-engine/src/native_module_manager.rs:235:9
      address = 0x0000555555bbb535
      resolved = true
      hardware = false
      hit count = 0 

Looks like mappings to an already mapped destination are ignored, or am I missing something?