vadimcn / codelldb

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

Unable to Debug: Reason: no LC_RPATH's found #1053

Open IVIURRAY opened 11 months ago

IVIURRAY commented 11 months ago

OS: 14.2.1 (23C71) Mac M1 VSCode version: Version: 1.78.2 (Universal) Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435 Date: 2023-05-10T14:44:45.204Z Electron: 22.5.2 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin arm64 23.2.0 Sandboxed: No CodeLLDB version: v1.10.0 Compiler: rustc 1.75.0 (82e1608df 2023-12-21) Debuggee: Running cargo test in rustfmt (below is launch.json)

{
            "type": "lldb",
            "request": "launch",
            "name": "Debug unit tests in executable 'rustfmt'",
            "cargo": {
                "args": [
                    "test",
                    "--no-run",
                    "--bin=rustfmt",
                    "--package=rustfmt-nightly"
                ],
                "filter": {
                    "name": "rustfmt",
                    "kind": "bin"
                }
            },
            "args": [],
            "cwd": "${workspaceFolder}"
        }

I've setup my VS Code as the following...

image

I click the play button in the debugger panel on the side and I get the following issue

image

It complains that...I thought this would be fixed with the extension install.

dyld[11304]: Library not loaded: @rpath/libtest-dba65296c245d91f.dylib Reason: no LC_RPATH's found

This stops me from being able to debug anything.

Verbose log
dyld[11304]: Library not loaded: @rpath/libtest-dba65296c245d91f.dylib
  Referenced from: <27A894BB-B61E-3BC7-A136-750A14F40903> /Users/haydn/Documents/Code/rustfmt/target/debug/deps/rustfmt-589437a9f527c347
  Reason: no LC_RPATH's found
escalopa commented 10 months ago

The same issue here, I using golang, I get the same error when running go test ./...

dyld[19543]: Library not loaded: @rpath/libspdwsprotectorgo.dylib
  Referenced from: <9E52CAE7-50EE-3C06-8AA6-EB905B0A10CB> /private/var/folders/8x/6g60j1fn25n3_qf8sr2vj5yw0000gn/T/go-build3915438515/b1447/kafka_handlers.test
  Reason: no LC_RPATH's found

The package I'm using does exist

❯ ls /usr/local/lib     
libspdwsprotectorgo.dylib
hoppmann commented 7 months ago

I'm facing the same problem also in Rust using vscode and CodeLLDB.

dyld[83681]: Library not loaded: @rpath/libmysqlclient.20.dylib
  Referenced from: <11538107-63C8-32F0-92CA-96579124FA31> /Users/hoppmann/Documents/GitHub/EazyFindings2/EazyFindings/target/debug/deps/Logic-e4a6f1afa0021eb6
  Reason: no LC_RPATH's found

I can't find any good solution via googleing... Hay anyone a solution?

IVIURRAY commented 7 months ago

I managed to debug this by running the command 'rustup show' which pointed out I had the wrong toolchain (x84 instead of aarch) installed.

I then manually set the correct one in VSCode launch.json file and it fixed it for me. Maybe this might help you too.