Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The debugger engine does not work with modern versions of GDB. #1392

Open
AbleBacon opened this issue Mar 29, 2023 · 7 comments
Open

The debugger engine does not work with modern versions of GDB. #1392

AbleBacon opened this issue Mar 29, 2023 · 7 comments

Comments

@AbleBacon
Copy link

It's been the case since about version 9.? of GDB that the MI debugger engine does not work with GDB. I believe that this is because the debugger engine is expecting the wrong output from GDB, but there are numerous posts about this on sites like StackOverflow, and the only solution people have found is to downgrade their version of GDB.

The error from this is:

ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000135.

I mentioned this previously here: microsoft/vscode-cpptools#7706 (comment)

I'm attaching the debugger output with engineLogging and traceResponse enabled, but ultimately I'd suggest simply trying to use the debugging engine with GDB with externalConsole set to false and seeing for yourself. The debugger runs normally until the debugging engine gives up on it because of a perceived invalid output.

Versions I'm using:

C/C++ v1.15.1 Pre-Release
C/C++ Extension Pack v1.3.0
Visual Studio Code 1.76.2
GNU gdb (GDB) 13.1

debugger_output.txt

@WardenGnaw
Copy link
Member

I'm unable to reproduce this with Ubuntu 23.04:

gcc (Ubuntu 12.2.0-17ubuntu1) 12.2.0
GNU gdb (Ubuntu 13.1-2ubuntu2) 13.1
```

I am also unable to reproduce this at MSYS2 on Windows (MinGW64) with `C:\msys64\usr\bin` in my path.
```
gcc (GCC) 11.3.0
GNU gdb (GDB) 13.1
```

@AbleBacon
Copy link
Author

My VS Code is set up to use MSYS2 as the shell instead of PowerShell--does the debugger require a certain shell to be used?

@WardenGnaw
Copy link
Member

On Windows we expect Powershell or Cmd because if you are in the MSYS2 shell, you may not have access to the %USERPROFILE%.vscode folder which contains the extension and its additional tooling needed for it.

@AbleBacon
Copy link
Author

In that case, I think that it would be prudent to emit an error message specific to these circumstances, because there's a substantial body of users on places like StackOverflow who have unsuccessfully attempted to troubleshoot this issue, unaware of the fact that this configuration is not supported.

@Soily
Copy link

Soily commented Apr 20, 2024

2024-04-20_09-02-54_Cross_GDB_Error

I'm getting the same error-code when trying to cross-debug with a yocto generated SDK (for Windows). The strange thing is, that it sometimes (on some other machines) suddenly works, and I couldn't tackle it down over one year now, why. Any other ideas or has it in the meantime be fixed?

@Soily
Copy link

Soily commented Apr 20, 2024

Ok, now I've tried to run the gdb.exe from the commandline and not from within VsCode and I get this error-message:
image
Sorry, it's in german, but it says that python27.dll couldn't be found and re-installation of python could eventually solve the issue. I will check it and come back.

@Soily
Copy link

Soily commented Apr 20, 2024

Ok this didn't help to install the latest version of python2 (.7.18).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants