openocd -f board/esp32-wrover-kit-3.3v.cfg
and that works fine.
If I create a .gdbinit file with the contents:
Code: Select all
target remote :3333
set remote hardware-watchpoint-limit 2
mon reset halt
flushregs
thb app_main
c
it will correctly debug - it stops at app_main and then I can enter "continue" to run the program and use CTRL-C to break execution.
All fine so far!
If I try to launch a debug session from within vscode instead, I cannot get the same behaviour. It will not stop upon entry to app_main and once running, the pause button will not break execution. I can set a breakpoint before execution and that does hit and pause execution but I cannot then change the breakpoint. It seems there is a problem with the vscode extension but what can I do?
Using this launch.json file:
Code: Select all
{
"version": "0.2.0",
"configurations": [
{
"name": "ESP32 OpenOCD Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/test.elf",
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/home/user/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{ "text": "target remote :3333" },
{ "text": "set remote hardware-watchpoint-limit 2" },
{ "text": "mon reset halt" },
{ "text": "flushregs" },
{ "text": "thb app_main" },
{ "text": "c" }
],
"logging": {
"trace": true,
"traceResponse": true,
"engineLogging": true
},
},
]
}
Code: Select all
Unable to start debugging. Unexpected GDB output from command "-interpreter-exec console "C"". Unexpected ResultClass from MIDebugger. Expected 'done' but received 'running'
If I hit continue, I can no longer pause the execution.
Any suggestions?