Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Unable to break on exception


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Servant of the Lord   Crossbones+   -  Reputation: 20965

Like
0Likes
Like

Posted 24 March 2013 - 07:52 PM

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, 24 March 2013 - 09:30 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS