Let's start by describing what happens:
I play with the SDL2 library on Windows. I can compile programs using it, and when I run .exe it works fine. Problems arise when I try to debug it using GDB - when the code enters the SDL_Init or SDL_OpenAudio functions (which can create new streams), GDB stops, the message "programmed signal", unknown signal "is displayed, and when I resume execution, the program crashes .
There seems to be a bug in GDB ( https://www.mail-archive.com/ cygwin@cygwin.com /msg149735.html ) related to thread naming, and it should be fixed in version 7.11 of GDB. 1-1.
At first I used GCC 5.1.0 (TDM) with GDB 7.6.1, so I decided to upgrade to a new version. It seems that TDM has not provided any updates since two years ago, so I installed MinGW-w64 (I don’t remember now, but it could be version 7.11 of GDB). It did not help, GDB will work.
Next, I searched for a new version of GDB and found 7.12 (www dot equation dot com / servlet / equation.cmd? Fa = gdb). It does not work, perhaps the fix did not reach this version.
Apparently, this error should only be present in the GDR version on x86, so I installed the x64 version of TDM (GCC 5.1.0 and GDB 7.9.1). The program compiled fine, but GDB still catches an unknown signal and program crashes.
Now I can not debug any program using SDL2. So the question is, what can I do to make it work again?
Possible solutions:
- Visual Studio - Eclipse ( , , ), IDE, .
- GDB - , , Windows , GDB 7.12 .
- Linux - , Visual Studio.
- SDL 1.2 - ...
- -... , GDB. .
- ?
- ?
:
#include <SDL2/SDL.h>
int WinMain(int, char**)
{
SDL_Init(SDL_INIT_EVERYTHING);
return 0;
}
: g++ gdbtest.cpp -lSDL2main -lSDL2
SDL2: 2.0.5 ( Windows, MinGW, 32- )
: a.exe
:
GDB:
: GDB ,