microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

Sometimes,I get the invalid path error and cannot link the ICE for debugging. #12730

Open dipper8899 opened 1 month ago

dipper8899 commented 1 month ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary:

Sometimes,I get the invalid path error and cannot link the ICE for debugging.

The Valid path: In this case, I can connect normally using ICE. image

The Invalid path: Sometimes the path might be incorrect, as indicated by the red box below. In this case, I cannot link the ICE for debugging. image image

Debugger Configurations

N/A

Debugger Logs

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (79) LaunchOptions{\"name\":\"elf\",\"type\":\"cppdbg\",\"request\":\"launch\",\"program\":\"Q:/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root/objdir/diag_cpu/diag_cpu.elf\",\"args\":[],\"stopAtEntry\":true,\"cwd\":\"Q:\\\\0226_E28_sdk_integrate\\\\icv_sdk_verification\\\\sdk_root\",\"environment\":[],\"externalConsole\":false,\"MIMode\":\"gdb\",\"miDebuggerPath\":\"C:/Nds_openocd_env/nds32le-elf-mculib-v5_12_2_0/bin/riscv32-elf-gdb.exe\",\"logging\":{\"engineLogging\":true,\"trace\":true,\"traceResponse\":true},\"sourceFileMap\":{\"/cygdrive/q/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root\":\"Q:/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root\"},\"setupCommands\":[{\"description\":\"Enable pretty-printing for gdb\",\"text\":\"-enable-pretty-printing\",\"ignoreFailures\":true},{\"description\":\"set architecture riscv:rv32\",\"text\":\"set architecture riscv:rv32\",\"ignoreFailures\":false},{\"description\":\"set substitute-path\",\"text\":\"set substitute-path /cygdrive/d/dipper_chung/Desktop/Build/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root Q:/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root\",\"ignoreFailures\":false},{\"description\":\"Connect to the GDB Server\",\"text\":\"target extended-remote localhost:9902\",\"ignoreFailures\":false},{\"description\":\"Specify file path\",\"text\":\"file Q:/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root/objdir/diag_cpu/diag_cpu.elf\",\"ignoreFailures\":false},{\"description\":\"Load file\",\"text\":\"load\",\"ignoreFailures\":false},{\"description\":\"delete mem\",\"text\":\"delete mem\",\"ignoreFailures\":false},{\"description\":\"set text region\",\"text\":\"mem 0x0 &__text_END rw 32 nocache\",\"ignoreFailures\":false},{\"description\":\"set mem region\",\"text\":\"mem &__rodata_BEGIN 0x100000000 rw 32 nocache\",\"ignoreFailures\":false},{\"description\":\"Stop on main\",\"text\":\"b main\",\"ignoreFailures\":false},{\"text\":\"set output-radix 16\",\"ignoreFailures\":false},{\"text\":\"source Q:\\\\0226_E28_sdk_integrate\\\\icv_sdk_verification\\\\sdk_root/objdir/.gdbinit\",\"ignoreFailures\":true}],\"__configurationTarget\":5,\"__sessionId\":\"2927f672-24db-4f69-9d0d-93fbf30ba46c\"}\r\n"},"seq":2}
1: (79) LaunchOptions{"name":"elf","type":"cppdbg","request":"launch","program":"Q:/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root/objdir/diag_cpu/diag_cpu.elf","args":[],"stopAtEntry":true,"cwd":"Q:\\0226_E28_sdk_integrate\\icv_sdk_verification\\sdk_root","environment":[],"externalConsole":false,"MIMode":"gdb","miDebuggerPath":"C:/Nds_openocd_env/nds32le-elf-mculib-v5_12_2_0/bin/riscv32-elf-gdb.exe","logging":{"engineLogging":true,"trace":true,"traceResponse":true},"sourceFileMap":{"/cygdrive/q/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root":"Q:/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root"},"setupCommands":[{"description":"Enable pretty-printing for gdb","text":"-enable-pretty-printing","ignoreFailures":true},{"description":"set architecture riscv:rv32","text":"set architecture riscv:rv32","ignoreFailures":false},{"description":"set substitute-path","text":"set substitute-path /cygdrive/d/dipper_chung/Desktop/Build/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root Q:/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root","ignoreFailures":false},{"description":"Connect to the GDB Server","text":"target extended-remote localhost:9902","ignoreFailures":false},{"description":"Specify file path","text":"file Q:/0226_E28_sdk_integrate/icv_sdk_verification/sdk_root/objdir/diag_cpu/diag_cpu.elf","ignoreFailures":false},{"description":"Load file","text":"load","ignoreFailures":false},{"description":"delete mem","text":"delete mem","ignoreFailures":false},{"description":"set text region","text":"mem 0x0 &__text_END rw 32 nocache","ignoreFailures":false},{"description":"set mem region","text":"mem &__rodata_BEGIN 0x100000000 rw 32 nocache","ignoreFailures":false},{"description":"Stop on main","text":"b main","ignoreFailures":false},{"text":"set output-radix 16","ignoreFailures":false},{"text":"source Q:\\0226_E28_sdk_integrate\\icv_sdk_verification\\sdk_root/objdir/.gdbinit","ignoreFailures":true}],"__configurationTarget":5,"__sessionId":"2927f672-24db-4f69-9d0d-93fbf30ba46c"}
--> C (runInTerminal-4): {"type":"request","command":"runInTerminal","arguments":{"kind":"integrated","title":"cppdbg: diag_cpu.elf","cwd":"","args":["c:\\Users\\User\\.vscode\\extensions\\ms-vscode.cpptools-1.22.3\\debugAdapters\\bin\\WindowsDebugLauncher.exe","--stdin=Microsoft-MIEngine-In-mnvwtz2y.cvk","--stdout=Microsoft-MIEngine-Out-1ypf5mid.bfj","--stderr=Microsoft-MIEngine-Error-t2eyf1wg.3ba","--pid=Microsoft-MIEngine-Pid-n4f2hhc3.2bo","--dbgExe=C:/Nds_openocd_env/nds32le-elf-mculib-v5_12_2_0/bin/riscv32-elf-gdb.exe","--interpreter=mi"],"env":{}},"seq":4}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (147) Wait for connection completion.\r\n"},"seq":6}
1: (147) Wait for connection completion.
--> E (output): {"type":"event","event":"output","body":{"category":"stderr","output":"\r\n\r\n"},"seq":8}

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (20196) Send Event AD7MessageEvent\r\n"},"seq":10}
1: (20196) Send Event AD7MessageEvent
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"17.8.20302.1","VS.Diagnostics.Debugger.HostVersion":"17.8.20302.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.ErrorCode":1005,"VS.Diagnostics.Debugger.Launch.IsError":true}},"seq":12}
--> R (launch-2): {"type":"response","request_seq":2,"success":false,"command":"launch","message":"Unable to start debugging. Unable to establish a connection to GDB. Debug output may contain more information.","body":{"error":{"id":1005,"format":"Unable to start debugging. Unable to establish a connection to GDB. Debug output may contain more information."}},"seq":14}

Other Extensions

No response

Additional Information

No response