www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - break on assertion in GDB?

reply "Vlad Levenfeld" <vlevenfeld gmail.com> writes:
Is this possible? I find myself having to set breakpoints up the 
callchain and step through every invocation till I find the one 
that breaks. This is a really bad way to work, but when I fail an 
assertion in GDB, it just reports "program terminated."
Jun 30 2014
parent reply "Dicebot" <public dicebot.lv> writes:
On Monday, 30 June 2014 at 11:56:27 UTC, Vlad Levenfeld wrote:
 Is this possible? I find myself having to set breakpoints up 
 the callchain and step through every invocation till I find the 
 one that breaks. This is a really bad way to work, but when I 
 fail an assertion in GDB, it just reports "program terminated."
b _d_assert b _d_assert_msg (out of my memory)
Jun 30 2014
next sibling parent reply "Vlad Levenfeld" <vlevenfeld gmail.com> writes:
On Monday, 30 June 2014 at 12:08:31 UTC, Dicebot wrote:
 On Monday, 30 June 2014 at 11:56:27 UTC, Vlad Levenfeld wrote:
 Is this possible? I find myself having to set breakpoints up 
 the callchain and step through every invocation till I find 
 the one that breaks. This is a really bad way to work, but 
 when I fail an assertion in GDB, it just reports "program 
 terminated."
b _d_assert b _d_assert_msg (out of my memory)
GDB recognizes both of these and sets the breakpoints, but never actually breaks.
Jun 30 2014
parent "Vlad Levenfeld" <vlevenfeld gmail.com> writes:
I tried it again in a different context and it worked. Odd. 
Anyway, thanks for the information.
Jun 30 2014
prev sibling parent "Vlad Levenfeld" <vlevenfeld gmail.com> writes:
The reason it worked one time and not the other was because the 
other time was an exception, not an assertion. How do I break on 
exceptions?

(ps. is there a guide anywhere to using GDB with D?)
Jul 05 2014