microsoft / vscode-cpptools

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

Compound 2 cpp applications one doesnt start #6613

Open mkgvb opened 3 years ago

mkgvb commented 3 years ago

This is similar to issue #6431 My launch.json is pretty much the same however I see from the log that it is stuck at waiting for connection. One application always starts usually the first one listed in the compound. The issue is intermittent but happens most of the time, sometime changing any argument in launch.json helps mitigate the issue.

Version: 1.51.1 (user setup) Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f Date: 2020-11-10T23:34:32.027Z Electron: 9.3.3 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Windows_NT x64 10.0.19041

Debug Console output from the application that fails to start:

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (251) LaunchOptions{\"name\":\"rendezvous-commander\",\"type\":\"cppdbg\",\"request\":\"launch\",\"program\":\"/workspace/build/rendezvous/rendezvous_commander\",\"args\":[],\"stopAtEntry\":false,\"cwd\":\"/workspace/build\",\"environment\":[],\"externalConsole\":false,\"MIMode\":\"gdb\",\"logging\":{\"engineLogging\":true,\"trace\":true,\"traceResponse\":true},\"setupCommands\":[{\"description\":\"Enable pretty-printing for gdb\",\"text\":\"-enable-pretty-printing\",\"ignoreFailures\":true}],\"__configurationTarget\":5,\"__sessionId\":\"4fe2d8ad-757b-4b04-8ae3-49166ba6c40e\"}\n"},"seq":2}
1: (251) LaunchOptions{"name":"rendezvous-commander","type":"cppdbg","request":"launch","program":"/workspace/build/rendezvous/rendezvous_commander","args":[],"stopAtEntry":false,"cwd":"/workspace/build","environment":[],"externalConsole":false,"MIMode":"gdb","logging":{"engineLogging":true,"trace":true,"traceResponse":true},"setupCommands":[{"description":"Enable pretty-printing for gdb","text":"-enable-pretty-printing","ignoreFailures":true}],"__configurationTarget":5,"__sessionId":"4fe2d8ad-757b-4b04-8ae3-49166ba6c40e"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (365) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-5mqlpb4m.6q4 ; cd \"/workspace/build/rendezvous\" ; DbgTerm=`tty` ; set -o monitor ; trap 'rm \"/tmp/Microsoft-MIEngine-In-q41whu8c.a7k\" \"/tmp/Microsoft-MIEngine-Out-88mxb8ba.369\" \"/tmp/Microsoft-MIEngine-Pid-5mqlpb4m.6q4\" \"/tmp/Microsoft-MIEngine-Cmd-ma8x2tc9.iwd\"' EXIT ; \"/usr/bin/gdb\" --interpreter=mi --tty=$DbgTerm < \"/tmp/Microsoft-MIEngine-In-q41whu8c.a7k\" > \"/tmp/Microsoft-MIEngine-Out-88mxb8ba.369\" & clear; pid=$! ; echo $pid > \"/tmp/Microsoft-MIEngine-Pid-5mqlpb4m.6q4\" ; wait $pid; \n"},"seq":4}
1: (365) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-5mqlpb4m.6q4 ; cd "/workspace/build/rendezvous" ; DbgTerm=`tty` ; set -o monitor ; trap 'rm "/tmp/Microsoft-MIEngine-In-q41whu8c.a7k" "/tmp/Microsoft-MIEngine-Out-88mxb8ba.369" "/tmp/Microsoft-MIEngine-Pid-5mqlpb4m.6q4" "/tmp/Microsoft-MIEngine-Cmd-ma8x2tc9.iwd"' EXIT ; "/usr/bin/gdb" --interpreter=mi --tty=$DbgTerm < "/tmp/Microsoft-MIEngine-In-q41whu8c.a7k" > "/tmp/Microsoft-MIEngine-Out-88mxb8ba.369" & clear; pid=$! ; echo $pid > "/tmp/Microsoft-MIEngine-Pid-5mqlpb4m.6q4" ; wait $pid; 
--> C (runInTerminal-6): {"type":"request","command":"runInTerminal","arguments":{"kind":"integrated","title":"cppdbg: rendezvous_commander","cwd":"","args":["/bin/sh","/tmp/Microsoft-MIEngine-Cmd-ma8x2tc9.iwd"],"env":{}},"seq":6}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (395) Wait for connection completion.\n"},"seq":8}
1: (395) Wait for connection completion.
WardenGnaw commented 3 years ago

Still investigating #6431

From your logs it looks like its hanging on connecting to the integrated terminal. Does configurating your launch.json to "externalConsole":true progress you further?