Sign in to follow this  
Servant of the Lord

Unable to break on exception

Recommended Posts

My program was throwing an exception (std::exception: :map::at")

I use MinGW 4.7.2


I can't seem to break where the exception is being thrown to get the stacktrace. I can break where it's caught, but that doesn't get me a stacktrace.


I normally use QtCreator's GUI interface to gdb, but since that wasn't working, I tried using gdb directly from the command-line.


I tried breaking on:

catch throw

break RaiseException

break __raise_exception
break __cxa_throw
break __cxa_raise_exception
break __cxa_raise
(Based off of digging around on Google)
I think I'm not able to break on it because the standard library is tossing it. How can I get gdb to break on a standard library exception throw?
Is it because I might not be linking against a debug version of the standard library? If so, how do I link against it?
I eventually found the source of the exception through 'divide and conquer' methods (actually, I just set a breakpoint on, and kept continuing until it crashed), but the overall problem still remains: How do I set GDB breakpoints on exceptions thrown by the standard library?
Edited by Servant of the Lord

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this