PDA

View Full Version : Problem debugging Windows QT App w/ GDB



JDTexas
1st March 2008, 17:11
Hi all,

I'm having problems debugging a very simple Qt app in Windows under gdb. I'm using MinGW to compile it. I have compiled Qt for debugging and gdb seems to load the symbols for my application just fine. If I don't put any breakpoints in there, gdb even runs the application normally in the gdb environment. The problem comes about when I put a breakpoint in my application. Once I do this, I get segmentation faults when I try to run the application under gdb. When I remove the breakpoints, gdb seems to run the app just fine again.

I know this must be something specific to Qt since I tried a very simple "hello world" app (w/o any Qt) and gdb handled this application just fine (breakpoints and all). For some reason it just chokes on breakpoints in my ultra-simple Qt app.

Does anyone have any ideas what could be going wrong here?

Thanks for your help!

wysota
1st March 2008, 18:52
Do you get segmentation faults for the application or for gdb? If the former, try the backtrace (bt) command and see where and why it crashes.

JDTexas
2nd March 2008, 02:10
The seg fault is coming from my application, not gdb. Here's the stack trace... doesn't seem very helpful though.

#0 0x005c0065 in ?? ()
#1 0x7c90eb94 in ntdll!LdrAccessOutOfProcessResource () from C:\WINDOWS\system32\ntdll.dll
#2 0xeb0075fc in ?? ()
#3 0x00007c90 in ?? ()
#4 0x00630000 in ?? ()
#5 0x006e0049 in ?? ()
#6 0x002e006a in ?? ()
#7 0x00000064 in ?? ()
#8 0x07f40000 in ?? ()
#9 0xfc780000 in ?? ()
#10 0x104b0075 in ?? () from C:\Qt\4.3.4\bin\QtGuid4.dll
#11 0xc0d87c90 in ?? ()
#12 0x31dc0197 in ?? ()
#13 0x32127c91 in ?? ()
#14 0x00087c91 in ?? ()
#15 0x0001c015 in ?? ()
#16 0x83b00000 in ?? ()
#17 0xf9cc0000 in ?? ()
#18 0x00010075 in ?? ()
#19 0xff040000 in ?? ()
#20 0xee180075 in ?? ()
#21 0x63a87c90 in ?? ()
#22 0x00007c91 in ?? ()
#23 0xff140000 in ?? ()
#24 0x62da0075 in ?? ()
#25 0x00007c91 in ?? ()
#26 0x69700000 in ?? ()
#27 0xff600025 in ?? ()
#28 0xff400075 in ?? ()
#29 0xff5c0075 in ?? ()
#30 0x00010075 in ?? ()
#31 0x00000000 in ?? ()

JDTexas
2nd March 2008, 02:13
Again, when removing the breakpoints, the program runs fine in gdb. I am stumped :)

wysota
2nd March 2008, 08:02
The trace doesn't make sense. I suggest you try some other version of gdb - it may be conflicting with your mingw or something like that.