From 8f71a7bf9cdb1a71354ed1f39480f700deffb509 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 5 Aug 2025 00:06:58 -0400 Subject: [PATCH] Setup debug for spinning cube --- .vscode/launch.json | 32 +++++++++++++++ .../.vscode/c_cpp_properties.json | 40 +++++++++++++++++++ .../SpinningCube/.vscode/launch.json | 29 ++++++++++++++ .../SpinningCube/.vscode/settings.json | 10 +++++ psxdev_sample/SpinningCube/.vscode/tasks.json | 37 +++++++++++++++++ scripts/psx_debug.ps1 | 7 ++++ 6 files changed, 155 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 psxdev_sample/SpinningCube/.vscode/c_cpp_properties.json create mode 100644 psxdev_sample/SpinningCube/.vscode/launch.json create mode 100644 psxdev_sample/SpinningCube/.vscode/settings.json create mode 100644 psxdev_sample/SpinningCube/.vscode/tasks.json create mode 100644 scripts/psx_debug.ps1 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c2eec91 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + // 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": "Debug: Spinning Cube", + "type": "gdb", + "request": "attach", + "target": "localhost:3333", + "remote": true, + "cwd": "${workspaceRoot}/psxdev_sample/SpinningCube", + "valuesFormatting": "parseText", + "stopAtConnect": true, + "gdbpath": "gdb-multiarch", + "windows": { + "gdbpath": "gdb-multiarch.exe" + }, + "osx": { + "gdbpath": "gdb" + }, + "executable": "${workspaceRoot}/psxdev_sample/SpinningCube/SpinningCube.elf", + "autorun": [ + "monitor reset shellhalt", + "load SpinningCube.elf", + "tbreak main", + "continue" + ] + } + ] +} diff --git a/psxdev_sample/SpinningCube/.vscode/c_cpp_properties.json b/psxdev_sample/SpinningCube/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..03580bf --- /dev/null +++ b/psxdev_sample/SpinningCube/.vscode/c_cpp_properties.json @@ -0,0 +1,40 @@ +{ + "configurations": [ + { + "name": "Win32", + "compilerPath": "${env:AppData}\\mips\\mips\\bin\\mipsel-none-elf-gcc.exe", + "cStandard": "c17", + "cppStandard": "c++20", + "defines": [ + "__STDC_HOSTED__ = 0" + ], + "includePath": [ + "${env:AppData}/mips/mips/include", + "${workspaceFolder}/", + "${workspaceFolder}/third_party/nugget", + "${workspaceFolder}/third_party/psyq-iwyu/include" + ], + "intelliSenseMode": "gcc-x86" + }, + { + "name": "linux", + "compilerPath": "mipsel-linux-gnu-gcc", + "cStandard": "c17", + "cppStandard": "c++20", + "defines": [ + "__STDC_HOSTED__ = 0" + ], + "includePath": [ + "/usr/mipsel-linux-gnu/include", + "/usr/local/mipsel-linux-gnu/include", + "/usr/mipsel-none-elf/include", + "/usr/local/mipsel-none-elf/include", + "${workspaceFolder}/", + "${workspaceFolder}/third_party/nugget", + "${workspaceFolder}/third_party/psyq-iwyu/include" + ], + "intelliSenseMode": "gcc-x86" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/psxdev_sample/SpinningCube/.vscode/launch.json b/psxdev_sample/SpinningCube/.vscode/launch.json new file mode 100644 index 0000000..6edd986 --- /dev/null +++ b/psxdev_sample/SpinningCube/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug", + "type": "gdb", + "request": "attach", + "target": "localhost:3333", + "remote": true, + "cwd": "${workspaceRoot}", + "valuesFormatting": "parseText", + "stopAtConnect": true, + "gdbpath": "gdb-multiarch", + "windows": { + "gdbpath": "gdb-multiarch.exe" + }, + "osx": { + "gdbpath": "gdb" + }, + "executable": "${workspaceRoot}/${workspaceRootFolderName}.elf", + "autorun": [ + "monitor reset shellhalt", + "load ${workspaceRootFolderName}.elf", + "tbreak main", + "continue" + ] + } + ] +} \ No newline at end of file diff --git a/psxdev_sample/SpinningCube/.vscode/settings.json b/psxdev_sample/SpinningCube/.vscode/settings.json new file mode 100644 index 0000000..e7f9a5f --- /dev/null +++ b/psxdev_sample/SpinningCube/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "files.associations": { + "*.rmd": "markdown", + "*.s": "armips", + "stdlib.h": "c", + "libgte.h": "c", + "libgpu.h": "c", + "libetc.h": "c" + } +} \ No newline at end of file diff --git a/psxdev_sample/SpinningCube/.vscode/tasks.json b/psxdev_sample/SpinningCube/.vscode/tasks.json new file mode 100644 index 0000000..b46ac12 --- /dev/null +++ b/psxdev_sample/SpinningCube/.vscode/tasks.json @@ -0,0 +1,37 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build Debug", + "type": "shell", + "command": "make BUILD=Debug", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "Build Release", + "type": "shell", + "command": "make", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "Clean", + "type": "shell", + "command": "make clean", + "group": { + "kind": "build" + } + } + ] +} \ No newline at end of file diff --git a/scripts/psx_debug.ps1 b/scripts/psx_debug.ps1 new file mode 100644 index 0000000..6645203 --- /dev/null +++ b/scripts/psx_debug.ps1 @@ -0,0 +1,7 @@ +$path_root = split-path -Path $PSScriptRoot -Parent +$path_build = join-path $path_root 'build' +$path_code = join-path $path_root 'code' +$path_scripts = join-path $path_root 'scripts' +$path_toolchain = join-path $path_root 'toolchain' + +