~aleteoryx/muditaos

9d1da4e67812841f24c4cad12cedcfb3fc12bdd5 — Marek Niepieklo 5 years ago 00ef5e6
[EGD-5067] Add VS Code GDB configuration for RT1051 and Linux targets

Added "(gdb) Attach" and "(RT1051) RelWithDebInfo" configurations
Fixed RT1051 target gdb setup for FreeRTOS
2 files changed, 51 insertions(+), 2 deletions(-)

M .gdbinit-1051
M .vscode/launch.json
M .gdbinit-1051 => .gdbinit-1051 +2 -0
@@ 5,6 5,8 @@ monitor halt
monitor memU32 0x401BC000 = 128;
load
eval "monitor exec SetRTTAddr %p", &_SEGGER_RTT
info threads
thread 2
b main
b HardFault_Handler
b MemManage_Handler

M .vscode/launch.json => .vscode/launch.json +49 -2
@@ 2,12 2,12 @@
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "name": "Linux Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build-linux-Debug/PurePhone.elf",
            "args": [],
            "stopAtEntry": false,
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}/build-linux-Debug/",
            "environment": [],
            "externalConsole": false,


@@ 25,6 25,25 @@
            ]
        },
        {
            "name": "Linux Attach",
            "type": "cppdbg",
            "request": "attach",
            "program": "${workspaceFolder}/build-linux-Debug/PurePhone.elf",
            "MIMode": "gdb",
            "processId": "${command:pickProcess}",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "disable SIGUSR1 logs",
                    "text": "handle SIGUSR1 nostop noprint"
                },
            ]
        },
        {
            "name": "Debug (rt1051)",
            "type": "gdb",
            "gdbpath": "arm-none-eabi-gdb",


@@ 40,6 59,34 @@
                "monitor halt",
                "monitor memU32 0x401BC000 = 128;",
                "load",
                "info threads",
                "thread 2",
                "b ResetISR",
                "b main",
                "b HardFault_Handler",
                "b MemManage_Handler",
                "b BusFault_Handler",
                "b UsageFault_Handler",
            ]
        },
        {
            "name": "RelWithDebug (rt1051)",
            "type": "gdb",
            "gdbpath": "arm-none-eabi-gdb",
            "request": "attach",
            "target": ":2331",
            "remote": true,
            "cwd": "${workspaceRoot}",
            "valuesFormatting": "parseText",
            "executable": "${workspaceFolder}/build-rt1051-RelWithDebInfo/PurePhone.elf",
            "autorun": [
                "eval \"monitor exec SetRTTAddr %p\", &_SEGGER_RTT",
                "monitor reset 0",
                "monitor halt",
                "monitor memU32 0x401BC000 = 128;",
                "load",
                "info threads",
                "thread 2",
                "b ResetISR",
                "b main",
                "b HardFault_Handler",