Re: assert{ 2.0 } - a new kind of assertion
- From: "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 21:51:02 +0100
On 29 Jan 2008 20:00:03 GMT, Martin Vuille wrote:
"Paul E. Black" <p.black@xxxxxxx> wrote in
news:fnnpnk02421@xxxxxxxxxxxxxxxxx:
ASSERT(0 <= linebufp-linebuf && linebufp-linebuf <=
line_width)
Here's comes from the last one when the assertion fails
0 <= linebufp-linebuf && linebufp-linebuf <= line_width false
in format.c, line 110
I've done that too, but what's missing is displaying the
actual value of the variables so you can tell what went wrong.
And also the call stack at the spot, and a message to show.
But a far better debugging technique than fake assertions (the true ones
are strict compile-time invariants) is IMO tracing. Such that you can hang
a handler on it. In Gtk+ there is such. Then you can attach a handler that
stops upon an interesting tracing event and breaks into the debugger, so
that you could inspect the stack and the variables around.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.
- References:
- Re: assert{ 2.0 } - a new kind of assertion
- From: Martin Vuille
- Re: assert{ 2.0 } - a new kind of assertion
- Prev by Date: Re: Why is Object Oriented so successfull
- Next by Date: Re: Why is Object Oriented so successfull
- Previous by thread: Re: assert{ 2.0 } - a new kind of assertion
- Index(es):