-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Debugging zig in VSCode #7361
Comments
I also founded this one: But no luck either. I don't have the "C++ (GDB/LLDB)" option he is talking about but I do have the GDB option. Hope someone can help. I can place breakpoints, just nothing happend with them. No errors either. |
This is what I can get for debugging Zig. Locals mostly work, watch mostly doesn't and the inline info is usually alright. This is my launch.json:
|
I keep a log here off all the thins I do to try to make this work. I made a new launch.json that looks like this now: {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
// "MIMode": "lldb"
}
]
} When I try to debug now, I get: and: Which I will attempt to fix now, which I will post below. |
Ok, I codesigned gdb using this: https://gcc.gnu.org/onlinedocs/gcc-4.8.1/gnat_ugn_unw/Codesigning-the-Debugger.html The last command was for me Now I get this: (Note that I had this error before, but only no panel for the error, probably because the panel was used for the 'not signed' error). The debug console only shows this now (note that the red line gone is what I get as a the pannel in the image above): The program '/Users/dw/Desktop/zig_learn/main' has exited with code 42 (0x0000002a). |
Ok, I got it working! So this is how my launch.json looks like (I also added a preLaunchTask): "version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"preLaunchTask": "build"
}
]
} I hope this helps someone |
this template can help you debug zig with vscode on macos, 😀 |
I found this post from more then a year ago:
https://www.reddit.com/r/Zig/comments/cl0x6k/debugging_zig_in_vscode/
First off, it's a bit outdated, for example:
Is not needed anymore, cause 'zig' is already in tat file now (nice!).
But the thing is, I can't get the debugger to work.
My task.json looks like this:
And my launch.json looks like this:
I was hoping if someone can help me. Preferred with using ZLS as well (https://github.com/zigtools/zls).
If I manage to get it working I will make a video of how to set it up.
The text was updated successfully, but these errors were encountered: