Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.0.106: Can't launch debugger #111

Closed
XingMicrochip opened this issue Nov 6, 2023 · 11 comments · Fixed by #112
Closed

v0.0.106: Can't launch debugger #111

XingMicrochip opened this issue Nov 6, 2023 · 11 comments · Fixed by #112

Comments

@XingMicrochip
Copy link

XingMicrochip commented Nov 6, 2023

Download source: https://open-vsx.org/api/eclipse-cdt/cdt-gdb-vscode/0.0.106/file/eclipse-cdt.cdt-gdb-vscode-0.0.106.vsix.
Issue: After having a valid launch.json file and clicking "Start Debugging", something appears under "Threads" but quickly disappears. The debug session doesn't start.
image
I don't think this was introduced by the change in v0.0.106 - MI parser fix. The last working version we used in our IDE was v0.0.103. So I think the issue might be introduced by the packaging change or some change between v0.0.103 and v0.0.106.

@XingMicrochip XingMicrochip changed the title v.0.106: Can't launch debugger v0.0.106: Can't launch debugger Nov 6, 2023
@jonahgraham
Copy link
Contributor

Can you start with verbose to launch.json and see if anything shows up in the Debugger Console?

      "verbose": true,

@jonahgraham
Copy link
Contributor

@XingMicrochip do you want to do a call/screen share and maybe we can debug this quicker? If so, send me an email and we can sort that out (jonah at kichwacoders.com)

@XingMicrochip
Copy link
Author

@XingMicrochip do you want to do a call/screen share and maybe we can debug this quicker? If so, send me an email and we can sort that out (jonah at kichwacoders.com)

Sounds good. I sent you an email.

@jonahgraham
Copy link
Contributor

I think I found the issue - there is a problem with the @serialport module which only exists in the target adapter, not the local adapter. So type = gdb works, but type = gdbtarget fails.

The whole adapter fails to start, here is the problem:

jonah@ditto /scratch/debug/git/cdt-gdb-vscode (main) ()
[1995] 15:16:33 $ node dist/debugAdapter.js --server=4711
waiting for debug protocol on port 4711
^C

jonah@ditto /scratch/debug/git/cdt-gdb-vscode (main) ()
[1996] 15:16:37 $ node dist/debugTargetAdapter.js --server=4711
/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:6563
      throw new Error("No native build was found for " + target + "\n    loaded from: " + dir + "\n");
      ^

Error: No native build was found for platform=linux arch=x64 runtime=node abi=93 uv=1 libc=glibc node=16.17.0
    loaded from: /scratch/debug/git/cdt-gdb-vscode

    at Function.load.resolve.load.path (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:6563:13)
    at load (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:6526:34)
    at node_modules/@serialport/bindings-cpp/dist/load-bindings.js (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:6722:48)
    at __require (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:5:50)
    at node_modules/@serialport/bindings-cpp/dist/darwin.js (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:7011:27)
    at __require (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:5:50)
    at node_modules/@serialport/bindings-cpp/dist/index.js (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:7699:20)
    at __require (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:5:50)
    at node_modules/serialport/dist/serialport.js (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:7732:26)
    at __require (/scratch/debug/git/cdt-gdb-vscode/dist/debugTargetAdapter.js:5:50)

as you can see the normal adapter starts fine, but the target one fails.

@jonahgraham
Copy link
Contributor

It looks like the serialport comes with the natives pre-built, but we aren't including that in the dist:

$ find node_modules/ -name \*.node
node_modules/@serialport/bindings-cpp/prebuilds/win32-ia32/node.napi.node
node_modules/@serialport/bindings-cpp/prebuilds/android-arm/node.napi.armv7.node
node_modules/@serialport/bindings-cpp/prebuilds/linux-arm64/node.napi.armv8.node
node_modules/@serialport/bindings-cpp/prebuilds/linux-arm/node.napi.armv6.node
node_modules/@serialport/bindings-cpp/prebuilds/linux-arm/node.napi.armv7.node
node_modules/@serialport/bindings-cpp/prebuilds/android-arm64/node.napi.armv8.node
node_modules/@serialport/bindings-cpp/prebuilds/win32-x64/node.napi.node
node_modules/@serialport/bindings-cpp/prebuilds/linux-x64/node.napi.musl.node
node_modules/@serialport/bindings-cpp/prebuilds/linux-x64/node.napi.glibc.node
node_modules/@serialport/bindings-cpp/prebuilds/darwin-x64+arm64/node.napi.node

@jonahgraham
Copy link
Contributor

@colin-grant-work can advise on this area? Since we released the repackaged extension it hasn't worked for target debugging and I didn't realize because I was testing local debugging in my smoke tests.

@colin-grant-work
Copy link
Contributor

Hm... if we're importing it, it should have been caught, but I'll take a look to see what's necessary.

@colin-grant-work
Copy link
Contributor

It looks like there a number of dynamic require statements, which make bundling that difficult. I'll experiment with how much we need to include to get at least the tests in the adapter working, and make a PR shortly.

@jonahgraham
Copy link
Contributor

Once I merge #113 then v0.0.107 will be good to go and @XingMicrochip this should resolve the issue fully.

@XingMicrochip
Copy link
Author

I tested v0.0.107 fixes this issue. Thanks for everyone's help!

@jonahgraham
Copy link
Contributor

Thank you everyone for fixing this.

Thank you @XingMicrochip for confirming the fix works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants