microsoft / microsoft/vscode-cpptools

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

Open
#12,730 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger help wanted
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Windows 10 Pro
  • VS Code: 1.93.1 User Setup
  • C/C++ extension: v1.21.6
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version: 12.0.50 (Cygwin 3.2.0)
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the valid and invalid path screenshots with the launch log, especially the sourceFileMap, cwd, program, and GDB connection settings. Reproduce the intermittent failure on Windows 10 with the listed VS Code C/C++ extension and Cygwin GDB versions. Done means identifying why the path becomes invalid and restoring reliable ICE debugging.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.