microsoft / microsoft/vscode-cpptools
gdb debug with sudo privilege can't pause or set new breakpoint
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Issue Type: Bug
User logged in has sudo privilege, and been setted NOPASSWD in /etc/sudoers.
The snippet of launch.json is:
"name": "gdb launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/lib/app",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}/lib",
"environment": [],
"externalConsole": false,
"miDebuggerPath": "${workspaceFolder}/.vscode/gdb.sh",
"MIMode": "gdb",
Where gdb.sh is :
#!/bin/bash
sudo gdb "$@"
When debugging through gdb in remote ssh mode, vscode can't pause or set new breakpoint.
But there is no problem while loginning as root.
Environment:
Linux username-VirtualBox 5.4.0-110-generic #124~18.04.1-Ubuntu SMP Fri Apr 22 12:01:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
VSCode and all extensions are the up to date till this issue.
Extension version: 1.11.4
VS Code version: Code 1.69.2 (3b889b090b5ad5793f524b5d1d39fda662b96a2a, 2022-07-18T16:12:52.460Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-110-generic
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the provided launch.json and .vscode/gdb.sh under remote SSH, then compare behavior with a root login. Start by tracing how the extension communicates with the sudo-launched GDB process, focusing on pause and breakpoint commands. Done means the cause is identified and non-root users with the stated sudo setup can pause and set breakpoints, or the limitation is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100