From d0f292e0b375d27a2b8e7efc6d627243b0e657e3 Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Tue, 24 Sep 2024 08:28:49 +0000 Subject: [PATCH] feat(vscode): debug configs Linux/Win/Mac --- .devcontainer/devcontainer.json | 2 +- .vscode/launch.json | 55 +++++++++++++++++++++++++++++++++ .vscode/tasks.json | 23 ++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cf8f969..1d6763d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "name": "Graphs and Algorithmic Complexity", "image": "mcr.microsoft.com/devcontainers/base:alpine", - "postCreateCommand": "sudo apk update && sudo apk add just typst", + "postCreateCommand": "sudo apk update && sudo apk add just typst gdb", "customizations": { "vscode": { diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..7577d80 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,55 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb/Linux) Launch Current File", + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}/${fileBasenameNoExtension}", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "preLaunchTask": "build", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + { + "name": "(MSVC/Windows) Launch", + "type": "cppvsdbg", + "request": "launch", + "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "preLaunchTask": "build" + }, + { + "name": "(lldb/clang) Launch", + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}/${fileBasenameNoExtension}", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "lldb", + "miDebuggerPath": "/usr/bin/lldb", + "preLaunchTask": "build" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..e0c31b7 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "command": "gcc", + "args": [ + "-g", + "${file}", + "-o", + "${fileDirname}/${fileBasenameNoExtension}" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + } + ] +} \ No newline at end of file