PDA

View Full Version : Problem debugging Assert failure.



Doug Broadwell
29th December 2008, 01:16
gdb 6.8, Qt 4.2.3, MinGW environment

I'm getting an Assert failure in qbytearray.h (becausing somewhere I'm doing a .at() with an invalid index). I'm trying to catch it in console based gdb to be able to look at the stack trace to see from whence it has come. The gdb manual recommends breaking on __raise_exception for gnu c++, but gdb couldn't find that symbol; breaking on 'throw' also doesn't work.

Any suggestions on how to break on throwing an Assert error in Qt files?

Thanks, Doug

caduel
29th December 2008, 09:42
Using linux, I just run the program (debug build) in gdb and in case of an assert, it stops right there. Then I just hit "bt" in gdb and know the culprit.

Doug Broadwell
29th December 2008, 18:01
I'm running in Windows and after the assert 'bt' states to the effect that 'there is no stackframe', the app apparantly has already exited when gdb gets control back.

Doug Broadwell
3rd January 2009, 18:39
I finally found a way to do it for anyone else with this problem, I set breakpoints on qFatal(). Worked great.

Doug