From: richard@curnow.demon.co.uk (Richard Curnow)
Subject: Re: Ada and C++ asserts.
Date: 1996/07/22
Date: 1996-07-22T00:00:00+00:00 [thread overview]
Message-ID: <RICHARD.96Jul22204359@curnow.demon.co.uk> (raw)
In-Reply-To: nh91cle14t.fsf@paralysys
In article <31EE4C88.1AAD@ubs.com> Ian Johnston <ian.johnston@ubs.com> writes:
Ian> On any UNIX, you can look at the core dump with a debugger
Ian> and get a stack trace showing not only where the core dump
Ian> happened, but the chain of function calls leading up to it,
Ian> along with parameter and variable values. Even on VMS, you
Ian> get a stack trace showing how you arrived at the assert.
Ian> What information does Ada supply about the circumstances
Ian> leading to the failed assertion?
With GNAT, the normal behaviour is to stop execution of the program
with a "raised SYSTEM.ASSERTIONS.ASSERT_FAILURE" message. However,
during development, the program can be compiled with "-g" and then run
under a breakpoint debugger such as gdb. If a breakpoint is set on
"system__assertions__raise_assert_failure" a stack trace can be
produced whenever an exception is raised due to an assertion being
failed. A little unwieldy compared to a post-mortem gdb session on a
C or C++ -generated core file, but effective nevertheless.
Cheers
Richard
--
Richard P. Curnow
Stevenage, England
next prev parent reply other threads:[~1996-07-22 0:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-07-15 0:00 Ada and C++ asserts Nasser Abbasi
1996-07-15 0:00 ` Nasser Abbasi
1996-07-16 0:00 ` Robert Dewar
1996-07-18 0:00 ` Ian Johnston
1996-07-22 0:00 ` Richard Curnow [this message]
1996-07-15 0:00 ` Robert Dewar
1996-07-15 0:00 ` Stephen Leake
1996-07-15 0:00 ` Fergus Henderson
1996-07-15 0:00 ` Giuliano Carlini
1996-07-16 0:00 ` Eric Kline
1996-07-16 0:00 ` Jon S Anthony
1996-07-16 0:00 ` Ian Johnston
1996-07-17 0:00 ` James McCallum
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox