Jump to content
  • Advertisement
Sign in to follow this  
Servant of the Lord

Unable to break on exception

This topic is 2060 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

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 map.at(), 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
Advertisement
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!