From 9d1da4e67812841f24c4cad12cedcfb3fc12bdd5 Mon Sep 17 00:00:00 2001 From: Marek Niepieklo Date: Tue, 22 Dec 2020 16:39:20 +0100 Subject: [PATCH] [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 --- .gdbinit-1051 | 2 ++ .vscode/launch.json | 51 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/.gdbinit-1051 b/.gdbinit-1051 index 66d12498b0b6a6cdc1b25c61fc4bb227cfbb0668..d90e17b402483dccdef7e6159bd625b42292e85b 100644 --- a/.gdbinit-1051 +++ b/.gdbinit-1051 @@ -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 diff --git a/.vscode/launch.json b/.vscode/launch.json index e6ea9875e4bbc01c05296d86ed8a2bea0bc67133..1844276de824989231160d58d3aad0541f9c2e6a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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, @@ -24,6 +24,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", @@ -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",