Debugging instructions

This commit is contained in:
Denis 2023-12-13 14:34:17 +01:00
parent 80bc6c62c3
commit 70023cb48f
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03
2 changed files with 44 additions and 0 deletions

31
notes/launch.json Normal file
View 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
View 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