From bc73021064c9bdb7a961b4bfad6b9b26bf30d477 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Thu, 23 Jun 2022 22:27:47 +0700 Subject: [PATCH] Add VSCode launch configuration for debugging tests --- misc/vscode/launch.json | 50 ++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/misc/vscode/launch.json b/misc/vscode/launch.json index 7461f66..b456860 100644 --- a/misc/vscode/launch.json +++ b/misc/vscode/launch.json @@ -5,11 +5,13 @@ "version": "0.2.0", "configurations": [ { - "name": "cpp - Build and debug active file", + "name": "Editor (gdb) Launch", "type": "cppdbg", "request": "launch", "program": "/run/current-system/sw/bin/godot", - "args": [], + "args": [ + "--editor", + ], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], @@ -19,15 +21,41 @@ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", - "ignoreFailures": true + "ignoreFailures": true, + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true, + }, + { + "description": "Debug forked child process", + "text": "-gdb-set follow-fork-mode child", }, - //{ - // "description": "Debug forked child process", - // "text": "-gdb-set follow-fork-mode child", - //} ], - "preLaunchTask": "build", - "miDebuggerPath": "gdb" - } - ] + }, + { + "name": "Test (gdb) Launch", + "type": "cppdbg", + "request": "launch", + "program": "/run/current-system/sw/bin/godot", + "args": [ + "--no-window", + "-s", + "addons/gut/gut_cmdln.gd" + ], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true, + }, + ], + }, + ], } \ No newline at end of file