VSCode GDB Debug Failure - Error: undocumented errno 10061

Rick128
Posts: 1
Joined: Fri Jul 19, 2024 11:30 pm

VSCode GDB Debug Failure - Error: undocumented errno 10061

Postby Rick128 » Sat Jul 20, 2024 12:05 am

Hello,

I am transitioning from Eclipse on Linux to VSCode on Windows.
After some general adjustments, I can compile without any problems on the ESP32S3-N8-R2.

Now, the problem arises with Debugging, which I had already encountered on Linux and solved with an OpenOCD artifact for Linux, but the issue persists on Windows.

Let's start with my configuration in launch.json:

Code: Select all

{
  "version": "0.2.0",
  "configurations": [    
    {
      "type": "gdbtarget",
      "request": "attach",
      "name": "Eclipse CDT GDB Adapter",  
      "initCommands": [
        "set remote hardware-watchpoint-limit {IDF_TARGET_CPU_WATCHPOINT_NUM}",
        "mon reset halt",
        "maintenance flush register-cache",
        "thb app_main"
      ],
      "gdb": "${command:espIdf.getToolchainGdb}",
      "verbose": "true",
      "target": {
        "connectCommands": [
          "set remotetimeout 60",
          "-target-select extended-remote localhost:3333"
        ]
      }
    } 
  ]
}
If the code is a few lines long (for example, a blinking LED), there are no problems during debugging as it starts without issues.
When the code exceeds a certain size, which I can't determine exactly but could say around 3MB, the debug no longer starts, and I always get the error.
If I run the "monitor" function from VSCode, the firmware starts correctly, but in debug mode, the board resets (I have a display), and then after about 40 seconds, I get the error: undocumented errno 10061.

Here is the verbose trace from GDB:

NOT WORKING

Code: Select all

From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"gdbtarget","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsFunctionBreakpoints":true,"supportsDisassembleRequest":true,"supportsReadMemoryRequest":true,"supportsWriteMemoryRequest":true,"supportsSteppingGranularity":true}}
From client: attach({"type":"gdbtarget","request":"attach","name":"Eclipse CDT GDB Adapter","initCommands":["set remote hardware-watchpoint-limit 2","mon reset halt","maintenance flush register-cache","thb app_main"],"gdb":"C:\\Users\\admin\\.espressif\\tools\\xtensa-esp-elf-gdb\\12.1_20231023\\xtensa-esp-elf-gdb\\bin\\xtensa-esp32s3-elf-gdb.exe","verbose":"true","target":{"connectCommands":["set remotetimeout 60","-target-select extended-remote localhost:3333"]},"__configurationTarget":6,"program":"f:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\build\\ESP32_Basic_Project_IDF506_VSCode.elf","__sessionId":"028430a4-c4ba-4d79-82eb-64ee55c8ef09"})
GDB notify async: thread-group-added,id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"GNU gdb (esp-gdb) 12.1_20231023\n"}}
GNU gdb (esp-gdb) 12.1_20231023
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Copyright (C) 2022 Free Software Foundation, Inc.\n"}}
Copyright (C) 2022 Free Software Foundation, Inc.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."}}
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"\nType \"show copying\" and \"show warranty\" for details.\n"}}

Type "show copying" and "show warranty" for details.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"This GDB was configured as \"--host=x86_64-w64-mingw32 --target=xtensa-esp-elf\".\n"}}
This GDB was configured as "--host=x86_64-w64-mingw32 --target=xtensa-esp-elf".
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Type \"show configuration\" for configuration details.\n"}}
Type "show configuration" for configuration details.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"For bug reporting instructions, please see:\n"}}
For bug reporting instructions, please see:
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"<https://www.gnu.org/software/gdb/bugs/>.\n"}}
<https://www.gnu.org/software/gdb/bugs/>.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."}}
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"\n\n"}}

To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"For help, type \"help\".\n"}}
For help, type "help".
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Type \"apropos word\" to search for commands related to \"word\".\n"}}
Type "apropos word" to search for commands related to "word".
GDB command: 0 -gdb-set non-stop off
GDB result: 0 done
GDB command: 1 -gdb-set mi-async on
GDB result: 1 done
GDB command: 2 -file-exec-and-symbols "f:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\build\\ESP32_Basic_Project_IDF506_VSCode.elf"
GDB result: 2 done
GDB command: 3 -enable-pretty-printing
GDB result: 3 done
GDB command: 4 set remotetimeout 60
To client: {"seq":0,"type":"event","event":"output","body":{"category":"log","output":"set remotetimeout 60\n"}}
set remotetimeout 60
GDB notify async: cmd-param-changed,param="remotetimeout",value="60"
GDB result: 4 done
GDB command: 5 -target-select extended-remote localhost:3333
GDB result: 5 error,msg="Remote communication error.  Target disconnected.: (undocumented errno 10061)."
To client: {"seq":0,"type":"response","request_seq":2,"command":"attach","success":false,"message":"Remote communication error.  Target disconnected.: (undocumented errno 10061).","body":{"error":{"id":1,"format":"Remote communication error.  Target disconnected.: [b](undocumented errno 10061)[/b].","showUser":true}}}

Here is the trace of a short code where the debug works with the same configuration.

WORKING.

Code: Select all

From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"gdbtarget","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsFunctionBreakpoints":true,"supportsDisassembleRequest":true,"supportsReadMemoryRequest":true,"supportsWriteMemoryRequest":true,"supportsSteppingGranularity":true}}
From client: attach({"type":"gdbtarget","request":"attach","name":"Eclipse CDT GDB Adapter","initCommands":["set remote hardware-watchpoint-limit 2","mon reset halt","maintenance flush register-cache","thb app_main"],"gdb":"C:\\Users\\admin\\.espressif\\tools\\xtensa-esp-elf-gdb\\12.1_20231023\\xtensa-esp-elf-gdb\\bin\\xtensa-esp32s3-elf-gdb.exe","verbose":"true","target":{"connectCommands":["set remotetimeout 60","-target-select extended-remote localhost:3333"]},"__configurationTarget":6,"program":"f:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\build\\ESP32_Basic_Project_IDF506_VSCode.elf","__sessionId":"996642f3-c901-4f76-90fc-51f3f0808ab9"})
GDB notify async: thread-group-added,id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"GNU gdb (esp-gdb) 12.1_20231023\n"}}
GNU gdb (esp-gdb) 12.1_20231023
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Copyright (C) 2022 Free Software Foundation, Inc.\n"}}
Copyright (C) 2022 Free Software Foundation, Inc.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."}}
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"\nType \"show copying\" and \"show warranty\" for details.\n"}}

Type "show copying" and "show warranty" for details.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"This GDB was configured as \"--host=x86_64-w64-mingw32 --target=xtensa-esp-elf\".\n"}}
This GDB was configured as "--host=x86_64-w64-mingw32 --target=xtensa-esp-elf".
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Type \"show configuration\" for configuration details.\n"}}
Type "show configuration" for configuration details.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"For bug reporting instructions, please see:\n"}}
For bug reporting instructions, please see:
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"<https://www.gnu.org/software/gdb/bugs/>.\n"}}
<https://www.gnu.org/software/gdb/bugs/>.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."}}
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"\n\n"}}

To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"For help, type \"help\".\n"}}
For help, type "help".
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Type \"apropos word\" to search for commands related to \"word\".\n"}}
Type "apropos word" to search for commands related to "word".
GDB command: 0 -gdb-set non-stop off
GDB result: 0 done
GDB command: 1 -gdb-set mi-async on
GDB result: 1 done
GDB command: 2 -file-exec-and-symbols "f:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\build\\ESP32_Basic_Project_IDF506_VSCode.elf"
GDB result: 2 done
GDB command: 3 -enable-pretty-printing
GDB result: 3 done
GDB command: 4 set remotetimeout 60
To client: {"seq":0,"type":"event","event":"output","body":{"category":"log","output":"set remotetimeout 60\n"}}
set remotetimeout 60
GDB notify async: cmd-param-changed,param="remotetimeout",value="60"
GDB result: 4 done
GDB command: 5 -target-select extended-remote localhost:3333
GDB notify async: thread-group-started,id="i1",pid="42000"
GDB notify async: thread-created,id="1",group-id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"0x40000400 in ?? ()\n"}}
0x40000400 in ?? ()
GDB exec async: stopped,frame={addr="0x40000400",func="??",args=[],arch="xtensa"},thread-id="1",stopped-threads="all"
GDB result: 5 connected
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"connected to target using provided connectCommands"}}
connected to target using provided connectCommands
GDB command: 6 set remote hardware-watchpoint-limit 2
To client: {"seq":0,"type":"event","event":"output","body":{"category":"log","output":"set remote hardware-watchpoint-limit 2\n"}}
set remote hardware-watchpoint-limit 2
GDB notify async: cmd-param-changed,param="remote hardware-watchpoint-limit",value="2"
GDB result: 6 done
GDB command: 7 mon reset halt
To client: {"seq":0,"type":"event","event":"output","body":{"category":"log","output":"mon reset halt\n"}}
mon reset halt
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)\n"}}
JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)\n"}}
JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] requesting target halt and executing a soft reset\n"}}
[esp32s3.cpu0] requesting target halt and executing a soft reset
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] Debug controller was reset.\n"}}
[esp32s3.cpu0] Debug controller was reset.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] Core was reset.\n"}}
[esp32s3.cpu0] Core was reset.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] Target halted, PC=0x500000EF, debug_reason=00000000\n"}}
[esp32s3.cpu0] Target halted, PC=0x500000EF, debug_reason=00000000
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] Reset cause (3) - (Software core reset)\n"}}
[esp32s3.cpu0] Reset cause (3) - (Software core reset)
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu1] requesting target halt and executing a soft reset\n"}}
[esp32s3.cpu1] requesting target halt and executing a soft reset
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] Core was reset.\n"}}
[esp32s3.cpu0] Core was reset.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] Target halted, PC=0x40000400, debug_reason=00000000\n"}}
[esp32s3.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu1] Debug controller was reset.\n"}}
[esp32s3.cpu1] Debug controller was reset.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu1] Core was reset.\n"}}
[esp32s3.cpu1] Core was reset.
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu1] Target halted, PC=0x40000400, debug_reason=00000000\n"}}
[esp32s3.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu1] Reset cause (3) - (Software core reset)\n"}}
[esp32s3.cpu1] Reset cause (3) - (Software core reset)
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] Reset cause (3) - (Software core reset)\n"}}
[esp32s3.cpu0] Reset cause (3) - (Software core reset)
GDB result: 7 done
GDB command: 8 maintenance flush register-cache
To client: {"seq":0,"type":"event","event":"output","body":{"category":"log","output":"maintenance flush register-cache\n"}}
maintenance flush register-cache
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Register cache flushed.\n"}}
Register cache flushed.
GDB result: 8 done
GDB command: 9 thb app_main
To client: {"seq":0,"type":"event","event":"output","body":{"category":"log","output":"thb app_main\n"}}
thb app_main
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Hardware assisted breakpoint 1 at 0x42007d4b: file F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c, line 483.\n"}}
Hardware assisted breakpoint 1 at 0x42007d4b: file F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c, line 483.
GDB notify async: breakpoint-created,bkpt={number="1",type="hw breakpoint",disp="del",enabled="y",addr="0x42007d4b",func="app_main",file="F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c",fullname="F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c",line="483",thread-groups=["i1"],times="0",original-location="app_main"}
GDB unhandled notify: breakpoint-created: {"bkpt":{"number":"1","type":"hw breakpoint","disp":"del","enabled":"y","addr":"0x42007d4b","func":"app_main","file":"F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c","fullname":"F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project__IDF506_VSCode\\main\\main.c","line":"483","thread-groups":["i1"],"times":"0","original-location":"app_main"}}
GDB result: 9 done
To client: {"seq":0,"type":"event","event":"initialized"}
To client: {"seq":0,"type":"response","request_seq":2,"command":"attach","success":true}
From client: setBreakpoints({"source":{"name":"main.c","path":"f:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c"},"lines":[490],"breakpoints":[{"line":490}],"sourceModified":false})
GDB command: 10 -break-list
From client: setFunctionBreakpoints({"breakpoints":[]})
GDB command: 11 -break-list
GDB result: 10 done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="hw breakpoint",disp="del",enabled="y",addr="0x42007d4b",func="app_main",file="F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c",fullname="F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project__IDF506_VSCode\\main\\main.c",line="483",thread-groups=["i1"],times="0",original-location="app_main"}]}
GDB command: 12 -break-insert --source "f:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_IDF506_VSCode\\main\\main.c" --line 490
GDB result: 11 done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="hw breakpoint",disp="del",enabled="y",addr="0x42007d4b",func="app_main",file="F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c",fullname="F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c",line="483",thread-groups=["i1"],times="0",original-location="app_main"}]}
To client: {"seq":0,"type":"response","request_seq":4,"command":"setFunctionBreakpoints","success":true,"body":{"breakpoints":[]}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Note: automatically using hardware breakpoints for read-only addresses.\n"}}
Note: automatically using hardware breakpoints for read-only addresses.
GDB result: 12 done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x42007d88",func="app_main",file="F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c",fullname="F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c",line="490",thread-groups=["i1"],times="0",original-location="-source f:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c -line 490"}
To client: {"seq":0,"type":"response","request_seq":3,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"id":2,"line":490,"verified":true}]}}
From client: configurationDone(undefined)
To client: {"seq":0,"type":"event","event":"output","body":{"category":"console","output":"\nIn the Debug Console view you can interact directly with GDB.\nTo display the value of an expression, type that expression which can reference\nvariables that are in scope. For example type '2 + 3' or the name of a variable.\nArbitrary commands can be sent to GDB by prefixing the input with a '>',\nfor example type '>show version' or '>help'.\n\n"}}

In the Debug Console view you can interact directly with GDB.
To display the value of an expression, type that expression which can reference
variables that are in scope. For example type '2 + 3' or the name of a variable.
Arbitrary commands can be sent to GDB by prefixing the input with a '>',
for example type '>show version' or '>help'.
GDB command: 13 -exec-continue
GDB result: 13 running
GDB exec async: running,thread-id="all"
To client: {"seq":0,"type":"response","request_seq":5,"command":"configurationDone","success":true}
From client: threads(undefined)
To client: {"seq":0,"type":"response","request_seq":6,"command":"threads","success":true,"body":{"threads":[{"id":1,"name":"1","running":true}]}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu0] Target halted, PC=0x42007D4B, debug_reason=00000001\n"}}
[esp32s3.cpu0] Target halted, PC=0x42007D4B, debug_reason=00000001
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Set GDB target to 'esp32s3.cpu0'\n"}}
Set GDB target to 'esp32s3.cpu0'
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[esp32s3.cpu1] Target halted, PC=0x40378B5A, debug_reason=00000000\n"}}
[esp32s3.cpu1] Target halted, PC=0x40378B5A, debug_reason=00000000
GDB notify async: thread-created,id="2",group-id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[New Thread 1070170076]\n"}}
[New Thread 1070170076]
GDB notify async: breakpoint-modified,bkpt={number="1",type="hw breakpoint",disp="del",enabled="y",addr="0x42007d4b",func="app_main",file="F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c",fullname="F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c",line="483",thread-groups=["i1"],times="1",original-location="app_main"}
GDB notify async: thread-exited,id="1",group-id="i1"
GDB notify async: thread-created,id="3",group-id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[New Thread 1070173852]\n"}}
[New Thread 1070173852]
GDB notify async: thread-created,id="4",group-id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[New Thread 1070171964]\n"}}
[New Thread 1070171964]
GDB notify async: thread-created,id="5",group-id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[New Thread 1070161116]\n"}}
[New Thread 1070161116]
GDB notify async: thread-created,id="6",group-id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[New Thread 1070165564]\n"}}
[New Thread 1070165564]
GDB notify async: thread-created,id="7",group-id="i1"
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[New Thread 1070159484]\n"}}
[New Thread 1070159484]
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"[Switching to Thread 1070170076]\n"}}
[Switching to Thread 1070170076]
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"\n"}}

To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"Thread 2 \"main\" hit Temporary breakpoint 1, app_main () at F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_0.3.5_IDF506_VSCode/main/main.c:483\n"}}
Thread 2 "main" hit Temporary breakpoint 1, app_main () at F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c:483
To client: {"seq":0,"type":"event","event":"output","body":{"category":"stdout","output":"483\t    esp_reset_reason_t reset_reason = esp_reset_reason();\n"}}
483	    esp_reset_reason_t reset_reason = esp_reset_reason();
GDB exec async: stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x42007d4b",func="app_main",args=[],file="F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c",fullname="F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c",line="483",arch="xtensa"},thread-id="2",stopped-threads="all"
To client: {"seq":0,"type":"event","event":"stopped","body":{"reason":"breakpoint","allThreadsStopped":true,"threadId":2}}
GDB notify async: breakpoint-deleted,id="1"
From client: threads(undefined)
GDB command: 14 -thread-info
GDB result: 14 done,threads=[{id="2",target-id="Thread 1070170076",details="Name: main, State: Running @CPU0",name="main",frame={level="0",addr="0x42007d4b",func="app_main",args=[],file="F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_0.3.5_IDF506_VSCode/main/main.c",fullname="F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_0.3.5_LIDF506_VSCode\\main\\main.c",line="483",arch="xtensa"},state="stopped"},{id="3",target-id="Thread 1070173852",details="Name: IDLE1, State: Running @CPU1",name="IDLE1",frame={level="0",addr="0x40378b5a",func="esp_cpu_wait_for_intr",args=[],file="C:/Users/admin/esp/v5.0.6/esp-idf/components/esp_hw_support/cpu.c",fullname="C:\\Users\\admin\\esp\\v5.0.6\\esp-idf\\components\\esp_hw_support\\cpu.c",line="110",arch="xtensa"},state="stopped"},{id="4",target-id="Thread 1070171964",details="Name: IDLE0",name="IDLE0",frame={level="0",addr="0x40379ec0",func="vPortTaskWrapper",args=[{name="pxCode",value="0x0"},{name="pvParameters",value="0x0"}],
GDB -cont-: 14 file="C:/Users/admin/esp/v5.0.6/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c",fullname="C:\\Users\\admin\\esp\\v5.0.6\\esp-idf\\components\\freertos\\FreeRTOS-Kernel\\portable\\xtensa\\port.c",line="148",arch="xtensa"},state="stopped"},{id="5",target-id="Thread 1070161116",details="Name: ipc1",name="ipc1",frame={level="0",addr="0x4037aeec",func="xQueueSemaphoreTake",args=[{name="xQueue",value="0x3fc92a24 <s_ipc_sem_buffer+84>"},{name="xTicksToWait",value="<optimized out>"}],file="C:/Users/admin/esp/v5.0.6/esp-idf/components/freertos/FreeRTOS-Kernel/queue.c",fullname="C:\\Users\\admin\\esp\\v5.0.6\\esp-idf\\components\\freertos\\FreeRTOS-Kernel\\queue.c",line="1570",arch="xtensa"},state="stopped"},{id="6",target-id="Thread 1070165564",details="Name: esp_timer",name="esp_timer",frame={level="0",addr="0x400559e0",func="??",args=[],arch="xtensa"},state="stopped"},{id="7",target-id="Thread 1070159484",details="Name: ipc0",name="ipc0",frame={level="0",addr="0x4037afd8",
GDB -cont-: 14 func="xQueueSemaphoreTake",args=[{name="xQueue",value="0x3fc929d0 <s_ipc_sem_buffer>"},{name="xTicksToWait",value="<optimized out>"}],file="C:/Users/admin/esp/v5.0.6/esp-idf/components/xtensa/include/xt_utils.h",fullname="C:\\Users\\admin\\esp\\v5.0.6\\esp-idf\\components\\xtensa\\include\\xt_utils.h",line="40",arch="xtensa"},state="stopped"}],current-thread-id="2"
To client: {"seq":0,"type":"response","request_seq":7,"command":"threads","success":true,"body":{"threads":[{"id":2,"name":"main (Name: main, State: Running @CPU0)","running":false},{"id":3,"name":"IDLE1 (Name: IDLE1, State: Running @CPU1)","running":false},{"id":4,"name":"IDLE0 (Name: IDLE0)","running":false},{"id":5,"name":"ipc1 (Name: ipc1)","running":false},{"id":6,"name":"esp_timer (Name: esp_timer)","running":false},{"id":7,"name":"ipc0 (Name: ipc0)","running":false}]}}
From client: stackTrace({"threadId":2,"startFrame":0,"levels":20})
GDB command: 15 -stack-info-depth --thread 2 100
GDB result: 15 done,depth="3"
GDB command: 16 -stack-list-frames --thread 2 0 2
GDB result: 16 done,stack=[frame={level="0",addr="0x42007d4b",func="app_main",file="F:/PRJ/ESP32/FRAMEWORK/ESP32_Basic_Project_IDF506_VSCode/main/main.c",fullname="F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c",line="483",arch="xtensa"},frame={level="1",addr="0x420194be",func="main_task",file="C:/Users/admin/esp/v5.0.6/esp-idf/components/freertos/app_startup.c",fullname="C:\\Users\\admin\\esp\\v5.0.6\\esp-idf\\components\\freertos\\app_startup.c",line="208",arch="xtensa"},frame={level="2",addr="0x40379ec8",func="vPortTaskWrapper",file="C:/Users/admin/esp/v5.0.6/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c",fullname="C:\\Users\\admin\\esp\\v5.0.6\\esp-idf\\components\\freertos\\FreeRTOS-Kernel\\portable\\xtensa\\port.c",line="149",arch="xtensa"}]
To client: {"seq":0,"type":"response","request_seq":8,"command":"stackTrace","success":true,"body":{"stackFrames":[{"id":1000,"source":{"name":"main.c","path":"F:\\PRJ\\ESP32\\FRAMEWORK\\ESP32_Basic_Project_IDF506_VSCode\\main\\main.c","sourceReference":0},"line":483,"column":0,"name":"app_main","instructionPointerReference":"0x42007d4b"},{"id":1001,"source":{"name":"app_startup.c","path":"C:\\Users\\admin\\esp\\v5.0.6\\esp-idf\\components\\freertos\\app_startup.c","sourceReference":0},"line":208,"column":0,"name":"main_task","instructionPointerReference":"0x420194be"},{"id":1002,"source":{"name":"port.c","path":"C:\\Users\\admin\\esp\\v5.0.6\\esp-idf\\components\\freertos\\FreeRTOS-Kernel\\portable\\xtensa\\port.c","sourceReference":0},"line":149,"column":0,"name":"vPortTaskWrapper","instructionPointerReference":"0x40379ec8"}],"totalFrames":3}}
From client: scopes({"frameId":1000})
To client: {"seq":0,"type":"response","request_seq":9,"command":"scopes","success":true,"body":{"scopes":[{"name":"Local","variablesReference":1000,"expensive":false},{"name":"Registers","variablesReference":1001,"expensive":true}]}}
From client: variables({"variablesReference":1000})
GDB command: 17 -stack-info-depth 100
GDB result: 17 done,depth="3"
GDB command: 18 -stack-list-variables --thread 2 --frame 0 --simple-values
GDB result: 18 done,variables=[]
To client: {"seq":0,"type":"response","request_seq":10,"command":"variables","success":true,"body":{"variables":[]}}

In Linux, the working configurations (with the same code) are:

Code: Select all

GDB Port: 3333
Telnet Port: 4444
Pcl Port: 6666


Config  Option:         
-s ${openocd_path}/share/openocd/scripts -f board/esp32s3-builtin.cfg 

Actual Executable:
/root/.espressif/tools/xtensa-esp-elf-gdb/11.2_20220823/xtensa-esp-elf-gdb/bin/xtensa-esp32s3-elf-gdb

Commands:
set mem inaccessible-by-default off
set remotetimeout 20

Initial reset type: init
mon reset halt
flushregs
set remote hardware-watchpoint-limit {IDF_TARGET_CPU_WATCHPOINT_NUM}
General configuration:

Code: Select all

IDF 5.0.1
Version: 1.91.1 (user setup)
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:06:49.809Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.22631

IDF Extension Version: 1.8.0
I'm asking for help, I've been trying to debug for two days, but there's no way! :oops:

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: VSCode GDB Debug Failure - Error: undocumented errno 10061

Postby ESP_bignacio » Mon Jul 22, 2024 7:19 am

Have you tried adding to the launch.json target connectCommands the same you are using in Linux:

["set mem inaccessible-by-default off",
"set remotetimeout 20",
"-target-select extended-remote localhost:3333"]

mo-han
Posts: 1
Joined: Tue Sep 24, 2024 4:35 am

Re: VSCode GDB Debug Failure - Error: undocumented errno 10061

Postby mo-han » Tue Sep 24, 2024 5:00 am

Maybe there's another OpenOCD instance running, stop it and try again.

Who is online

Users browsing this forum: No registered users and 20 guests