Debugging instructions
This commit is contained in:
parent
80bc6c62c3
commit
70023cb48f
2 changed files with 44 additions and 0 deletions
31
notes/launch.json
Normal file
31
notes/launch.json
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
// 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": "(gdb) Launch",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceFolder}/build/allynone",
|
||||||
|
"args": [],
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"environment": [],
|
||||||
|
"externalConsole": false,
|
||||||
|
"miDebuggerPath": "/home/gamer/gdb",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
13
notes/vscode_debug.md
Normal file
13
notes/vscode_debug.md
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Debug sudo application with vscode
|
||||||
|
|
||||||
|
1. create /home/gamer/gdb with following content:
|
||||||
|
```
|
||||||
|
sudo /usr/bin/gdb "$@"
|
||||||
|
```
|
||||||
|
|
||||||
|
2. add this line to /etc/sudoers
|
||||||
|
```
|
||||||
|
gamer ALL=(ALL) NOPASSWD:/usr/bin/gdb
|
||||||
|
```
|
||||||
|
|
||||||
|
then copy the launch.json in this folder into .vscode folder
|
||||||
Loading…
Add table
Add a link
Reference in a new issue