microsoft / microsoft/vscode-cpptools

Launch started the debug server successfully, but timeout and return a failed to initialize error

Aperta
#13,382 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

debugger
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Environment
  • OS and version: linux manjaro 24.2.1
  • VS Code: 1.98.2
  • C/C++ extension:
    1.23.6
  • OS and version of remote machine (if applicable): ubuntu 22.04 executed in a docker
  • GDB / LLDB version: 14.2

I use an SDK for yocto 5.0, Qemu version is 8.2.2

Bug Summary and Steps to Reproduce

Bug Summary:

cpp tools waits for qemu to start and timeout without trying to connect to it.

Steps to reproduce:

I start the debug.

Error message is displayed Unable to start debugging. Debug server process failed to initialize.

Debugger Configurations
`{
	"name": "Launch with QEMU",
	"type": "cppdbg",
	"request": "launch",
	"program": "${workspaceFolder}/build/my_binary",
	"cwd": "${workspaceFolder}",
	"MIMode": "gdb",
	"miDebuggerPath": "aarch64-poky-linux-gdb",
	"miDebuggerServerAddress": "localhost:1333",
	"stopAtEntry": false,
	"externalConsole": false,
	"debugServerPath": "qemu-aarch64",
	"debugServerArgs": "-L /opt/summitsom-wayland/5.0.3/sysroots/armv8a-poky-linux -g 1333 ${workspaceFolder}/build/my_binary",
	"filterStderr": true,
	"filterStdout": true,
}`
Debugger Logs
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (86) LaunchOptions{\"name\":\"Launch with QEMU\",\"type\":\"cppdbg\",\"request\":\"launch\",\"program\":\"/workspaces/firmware/build/my_binary\",\"cwd\":\"/workspaces/firmware/mpu\",\"MIMode\":\"gdb\",\"miDebuggerPath\":\"aarch64-poky-linux-gdb\",\"miDebuggerServerAddress\":\"localhost:1333\",\"stopAtEntry\":false,\"externalConsole\":false,\"debugServerPath\":\"qemu-aarch64\",\"debugServerArgs\":\"-L /opt/summitsom-wayland/5.0.3/sysroots/armv8a-poky-linux -g 1333 /workspaces/firmware/build/my_binary\",\"filterStderr\":true,\"filterStdout\":true,\"logging\":{\"engineLogging\":true,\"trace\":true,\"traceResponse\":true},\"__configurationTarget\":5,\"__sessionId\":\"7e78a92d-2e2d-49b0-9467-d407ccc367ed\"}\n"},"seq":2}
1: (86) LaunchOptions{"name":"Launch with QEMU","type":"cppdbg","request":"launch","program":"/workspaces/firmware/build/my_binary","cwd":"/workspaces/firmware/mpu","MIMode":"gdb","miDebuggerPath":"aarch64-poky-linux-gdb","miDebuggerServerAddress":"localhost:1333","stopAtEntry":false,"externalConsole":false,"debugServerPath":"qemu-aarch64","debugServerArgs":"-L /opt/summitsom-wayland/5.0.3/sysroots/armv8a-poky-linux -g 1333 /workspaces/firmware/build/my_binary","filterStderr":true,"filterStdout":true,"logging":{"engineLogging":true,"trace":true,"traceResponse":true},"__configurationTarget":5,"__sessionId":"7e78a92d-2e2d-49b0-9467-d407ccc367ed"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (144) Starting: \"qemu-aarch64\" -L /opt/summitsom-wayland/5.0.3/sysroots/armv8a-poky-linux -g 1333 /workspaces/firmware/build/my_binary\n"},"seq":4}
1: (144) Starting: "qemu-aarch64" -L /opt/summitsom-wayland/5.0.3/sysroots/armv8a-poky-linux -g 1333 /workspaces/firmware/build/my_binary
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (10185) <-logout\n"},"seq":6}
1: (10185) <-logout
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (10193) Send Event AD7MessageEvent\n"},"seq":8}
1: (10193) 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.12.21003.1","VS.Diagnostics.Debugger.HostVersion":"17.12.21003.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.ErrorCode":1005,"VS.Diagnostics.Debugger.Launch.IsError":true}},"seq":10}
--> R (launch-2): {"type":"response","request_seq":2,"success":false,"command":"launch","message":"Unable to start debugging. Debug server process failed to initialize.","body":{"error":{"id":1005,"format":"Unable to start debugging. Debug server process failed to initialize."}},"seq":12}
Other Extensions

No response

Additional Information

If I increase the serverLaunchTimeout, the error take more time to occurs. Indicating that the timeout is reached. During the timeout, I verified and quemu was running as expected.

Before trying to do it in one action, I had this configuration:
{ "name": "Launch with QEMU", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/build/my_binary", "cwd": "${workspaceFolder}", "MIMode": "gdb", "miDebuggerPath": "aarch64-poky-linux-gdb", "miDebuggerServerAddress": "localhost:1333", "stopAtEntry": false, }

And I started manually qemu with:
qemu-aarch64 -L /opt/summitsom-wayland/5.0.3/sysroots/armv8a-poky-linux -g 1333 /workspace/firmware/build/my_binary

Then when launching the debug, it worked perfectly.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la configurazione di avvio fornita, concentrandoti su debugServerPath, debugServerArgs, miDebuggerServerAddress e serverLaunchTimeout, quindi riproduci la differenza tra l'avvio manuale di QEMU e l'avvio con una sola azione. Usa i log del debugger per tracciare la sequenza di avvio e connessione; il lavoro è completato quando il server QEMU configurato viene rilevato e il debug si avvia senza il timeout di inizializzazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
linux, typescript
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.