Closed dcm684w closed 2 years ago
Can confirm this reproduces on GDB 10.2 in MSYS2,
GDB 9.2 did not experience this problem.
Passing -file-exec-and-symbols /home/project/cpp/main.exe
instead of -file-exec-and-symbols C:\msys2\home\project\cpp\main.exe
resolved the issue.
Investigating.
Working on a fix at: https://github.com/microsoft/MIEngine/pull/1155
Working on a fix at: microsoft/MIEngine#1155
Hello, Sorry,I am new here. But my problem is very similar to this post. I am not sure it is polite to ask here. But I will appreciate it if you have time to help me.
I just begin to use visual studio code to program with C++. And my environment:
OS: Windows 10 VS Code Version: 1.60.1 C/C++ Extension Version: 1.6.0 GDB Version: (Cygwin 10.2-1) 10.2 G++ Version:11.2.0
And I got the following error message when debugging a hello world C++ program.
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Error creating process /usr/bin/d:\Programs\Projects\test/d:\Programs\Projects\test\test.exe, (error 2). The program 'd:\Programs\Projects\test\test.exe' has exited with code 42 (0x0000002a).
I did not post the full message. If I choose the option C++(windows) to create my launch.json file to debug, the program runs correctly but won't stop at breakpoints I set. And I know I should choose C++(GDB/GLLB) according to the official help websites. Then I got the above error message when I tried to debug.
I spent a lot of time on related websites and can not solve the problem on my own. I also updated my GDB to the latest version. The GDB was good because I verified it on the command line. (with "gdb --version")
Working on a fix at: microsoft/MIEngine#1155
Hello, Sorry,I am new here. But my problem is very similar to this post. I am not sure it is polite to ask here. But I will appreciate it if you have time to help me.
I just begin to use visual studio code to program with C++. And my environment:
OS: Windows 10 VS Code Version: 1.60.1 C/C++ Extension Version: 1.6.0 GDB Version: (Cygwin 10.2-1) 10.2 G++ Version:11.2.0
And I got the following error message when debugging a hello world C++ program.
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Error creating process /usr/bin/d:\Programs\Projects\test/d:\Programs\Projects\test\test.exe, (error 2). The program 'd:\Programs\Projects\test\test.exe' has exited with code 42 (0x0000002a).
I did not post the full message. If I choose the option C++(windows) to create my launch.json file to debug, the program runs correctly but won't stop at breakpoints I set. And I know I should choose C++(GDB/GLLB) according to the official help websites. Then I got the above error message when I tried to debug.
I spent a lot of time on related websites and can not solve the problem on my own. I also updated my GDB to the latest version. The GDB was good because I verified it on the command line. (with "gdb --version")
I am having the same issue with cygwin64 on Windows 10 and VSCode 1.61.2, trying to compile a test c program.
Based partially on @WardenGnaw answer in other thread, I got mine working. This is my own answer in another site: Setting up VS Code for C using Cygwin64 Compiler and Debugger on Windows (ERROR: Unable to start debugging) I hope it can help someone.
Based partially on @WardenGnaw answer in other thread, I got mine working. This is my own answer in another site: Setting up VS Code for C using Cygwin64 Compiler and Debugger on Windows (ERROR: Unable to start debugging) I hope it can help someone.
Thank you, it works.
Based partially on @WardenGnaw answer in other thread, I got mine working. This is my own answer in another site: Setting up VS Code for C using Cygwin64 Compiler and Debugger on Windows (ERROR: Unable to start debugging) I hope it can help someone.
It helps, thanks. I run into the same issue when I was trying to use a class from a hpp file on windows. After I checked the recommended launch file from the link, I found that I have missed contents in the "environment" part.
Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.8.0-insiders3 or 1.8.0 (via using VS Code's "Pre-Release Version" UI or https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools&ssr=false#version-history ).
Looks like it's fixed in https://github.com/microsoft/vscode-cpptools/releases/tag/1.8.2 (not 1.8.0).
@sean-mcmanus I am not sure how you managed to make it work, but I still get the same problem both with the 1.8.2 and the pre-release 1.8.3. And I did restart vscode using 1.64.0
_ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000139.
Now that error seems to be program related and happens with the helloworld tutorial I checked. Removing the
https://github.com/microsoft/vscode-cpptools/issues/1372
The last entry in that thread, points to that tutorial as a solution which actually if followed manifests this problem for me. Quite ironic.
@WardenGnaw ?
Please open a new issue with additional information like engineLogging and traceRepsonse enabled in your launch.json.
Right, thanks. Before opening a new issue, I double checked if this problem happens outside vscode. So I ran gdb from the command line and I got the same error. Therefore I won't be opening a new here because it is not relevant.
I can confirm that this issue persists with version v1.10.0 Pre-Release
, using mingw-w64-x86_64-gdb
version 11.2
, but it is not due to Windows vs Unix paths as @WardenGnaw suggested. (In fact, if this fix was applied as @sean-mcmanus suggested, it has since been reverted because the current debugger engine still sends Windows paths to GDB/MI).
However, if you run a GDB/MI session and try sending the same commands that the C++ Extensions debugging engine sends (Windows paths and all)), debugging succeeds (you can try this with the MinGW setup tutorial: https://code.visualstudio.com/docs/cpp/config-mingw). The issue must be with the debugging engine not recognizing whatever output it's expecting from GDB/MI. Perhaps the debugging engine should consider other criteria besides this before prematurely terminating the debugging session?
I'd suggest re-opening this issue, or I can create a new one if that would be more appropriate.
same with GDB 11.2, in vscode gdb ignores my breakpoint
Having the same issue with the latest version of MSYS2/MinGW x64.
Having the same issue on Windows 10 with:
For those still experiencing these issues, Please open a new issue with additional information like engineLogging and traceRepsonse enabled in your launch.json.
Bug Type: Debugger
The Problem
When I try to debug an executable, the debug console has the following error
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Error creating process /usr/bin/C:\\Checked_Out\\PIC_Drivers\\LIN_Master_Slave/C:\Checked_Out\PIC_Drivers\LIN_Master_Slave/test_ceedling/build/test/out/foo.out, (error 2).
Note that the path listed is a concatenation of paths (Msys2 GDB path, workspaceFolder, and the actual path to the executable).
The break point (set on print line in foo.c) is ignored.
To Reproduce
launch.json
C:\Checked_Out\PIC_Drivers\LIN_Master_Slave\test_ceedling\test\drivers_lin\foo.c Compiled via
gcc -g -o .\test_ceedling\build\test\out\foo.out .\test_ceedling\test\drivers_lin\foo.c
Command Printed on Terminal window when starting debug
& 'c:\Users\XXXXX\.vscode\extensions\ms-vscode.cpptools-1.5.0-insiders\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-mjmxer35.qfv' '--stdout=Microsoft-MIEngine-Out-rwzy3jm4.ibe' '--stderr=Microsoft-MIEngine-Error-5sf3fcqh.013' '--pid=Microsoft-MIEngine-Pid-psyrrdnu.5fu' '--dbgExe=C:/msys64/usr/bin/gdb.exe' '--interpreter=mi'
Debug Console Output