Jump to content
  • Advertisement
Sign in to follow this  
kRogue

gdb + MinGW + SDL = crash at start

This topic is 4564 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone have trouble getting GDB to work with SDL and MinGW enviroment under WinXP: give you an idea the code: int main(int argv, char **argv) { return 0; } will run fine if I _DONT_ use the debugger GDB, upon trying to use the debugger GDB, I get a barf:
Quote:
Starting program: C:\msys\1.0\home\ROGOVIN\code\current/TestFramework.exe gdb: do_initial_child_stuff: process 3504 gdb: kernel event for pid=3504 tid=1256 code=CREATE_PROCESS_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT ) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=EXCEPTION_DEBUG_EVENT) gdb: Target exception EXCEPTION_BREAKPOINT at 0x7c901230 gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=UNLOAD_DLL_DEBUG_EVENT) ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=UNLOAD_DLL_DEBUG_EVENT) ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=UNLOAD_DLL_DEBUG_EVENT) ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=LOAD_DLL_DEBUG_EVENT) gdb: child_resume.SetThreadContext: thread 3504.0x4e8 ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: kernel event for pid=3504 tid=1256 code=EXCEPTION_DEBUG_EVENT) gdb: Target exception EXCEPTION_ACCESS_VIOLATION at 0x7c918fea Program received signal SIGSEGV, Segmentation fault. 0x7c918fea in ntdll!RtlpWaitForCriticalSection () from ntdll.dll (gdb) quit ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); ContinueDebugEvent (cpid=3504, ctid=1256, DBG_CONTINUE); gdb: child_close, inferior_ptid=1256
when I link and comile with SDL (i.e. link with -lmingw32 `sdl-config --libs` -lglu32 -lopengl32 -lSDL_image -lphysfs -lz -mwindows and compile with -Wall -ggdb3 -DDEBUG `sdl-config --cflags`) of course, when I actually try to debug my real program under Windows, it becomes impossible (whereas running the .exe without GDB it goes fine) and under Linux, GDB works like a charm (though the linker is a touch different there: `sdl-config --cflags --libs` -lGLU -lGL -lSDL_image -lphysfs) anyone have a clue to why GDB is barfing so badly? version number that makes the barf: g++.exe (GCC) 3.4.2 (mingw-special) GNU gdb 6.3

Share this post


Link to post
Share on other sites
Advertisement
Have you tried running GDB with a standard compiled application
not linked in with SDL? I'm using Dev-C++ with the SDL Dev-Pack
and I seem to be having no issues compiling my application
using SDL and debugging it using GDB.

If a standard Windows program compiled using just the MingW32
library works with GDB, chances are its SDL and probably
an SDL compile that GDB is not happy with. The SDL library
issue is probably the most logical choice.

C:\Dev-Cpp\bin>gcc.exe -v
Reading specs from ../lib/gcc/mingw32/3.4.2/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable
-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --e
nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-ja
va-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchroniz
ation --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.2 (mingw-special)

C:\Dev-Cpp\bin>gdb -v
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".

According to the package manager in Dev-C++ I've got SDL version 1.2.8.

Share this post


Link to post
Share on other sites
I compiled the SDL package from the sources (i.e. configure, make, make install) from MinGW's shell... GDB will work with programs that don't have SDL...hmm.. now to lookup how to get SDL to compile nicely... errgg...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!