From 70023cb48f14b027bd5a5c8d8a691898c3a0d6c8 Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 13 Dec 2023 14:34:17 +0100 Subject: [PATCH] Debugging instructions --- notes/launch.json | 31 +++++++++++++++++++++++++++++++ notes/vscode_debug.md | 13 +++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 notes/launch.json create mode 100644 notes/vscode_debug.md diff --git a/notes/launch.json b/notes/launch.json new file mode 100644 index 0000000..6374a97 --- /dev/null +++ b/notes/launch.json @@ -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 + } + ] + } + + + + ] +} \ No newline at end of file diff --git a/notes/vscode_debug.md b/notes/vscode_debug.md new file mode 100644 index 0000000..50e53d4 --- /dev/null +++ b/notes/vscode_debug.md @@ -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 \ No newline at end of file