-
Notifications
You must be signed in to change notification settings - Fork 1
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
dap_adapters: add gdb #70
Conversation
Hey, yeah totally agree, thanks for adding this! |
Thank you for implementing this! |
I think it would be similar to lldb {
"label": "LLDB Debug Zed",
"program": "$ZED_WORKTREE_ROOT/target/debug/zed",
"adapter": "gdb",
"request": "launch"
"initialize_args": {
"stopAtBeginningOfMainSubprogram": true
}
} |
Would it be similar to LLDB? I would like to add a default config for debugging Zed with GDB inside the {
"label": "Debug Zed with LLDB",
"adapter": "lldb",
"program": "$ZED_WORKTREE_ROOT/target/debug/zed",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT"
} GDB debug task example?? {
"label": "Debug Zed with GDB",
"adapter": "gdb",
"program": "$ZED_WORKTREE_ROOT/target/debug/zed",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT"
} |
I have this left over in the project where I tested last time: {
"label": "Launch in GDB",
"adapter": "gdb",
"session_type": "launch",
"program": "$ZED_WORKTREE_ROOT/build/main-binary",
"initialize_args": {
"args": [],
"cwd": "$ZED_WORKTREE_ROOT",
"env": {},
"stopAtBeginningOfMainSubprogram": true
}
} But it seems the format has changed since then? Also the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add this to the .zed/debug.json
? I wanted to push this change, but I cannot to your fork.
{
"label": "Debug Zed with GDB",
"adapter": "gdb",
"program": "$ZED_WORKTREE_ROOT/target/debug/zed",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT",
"initialize_args": {
"stopAtBeginningOfMainSubprogram": true
}
}
I also saw that GDB support attach, we might want to implement that as well. Happy to help to make that work, but cannot get GDB to work on my MacBook. |
Attaching to a process with GDB is indeed possible, but requires special permissions (SYS_PTRACE capability or root) so that should probably wait until we have some form of polkit integration for escalating privileges. |
Alright, thanks for the clarification and your contribution! |
We should add a cfg flag to disable gfb on m series macs because there’s no arm port available. That way people can’t select it when it’s bot possible to use |
GDB is apparently perfectly fine on aarch64, just not on macOS. |
Nothing special here, just launching gdb with
-i=dap
. Nicer to have it as a builtin type instead of a custom DAP though.