This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add proper error message instead of gdb_assert
> From: Michael Snyder <msnyder@specifix.com>
> Date: Mon, 03 Mar 2008 12:28:51 -0800
>
> On Mon, 2008-03-03 at 20:55 +0100, Mark Kettenis wrote:
>
> >
> > Sorry, but I don't see why your error message is "proper". The
> > gdb_assert() should never fail; the fact that it does means that you
> > have a bug elsewhere in gdb.
>
> Isn't that what the "internal error" call is for?
>
> The fact that there's a bug somewhere else in gdb is not
> necessarily a reason to abort the debugging session.
> It COULD be that severe -- but I don't think we necessarily
> need to assume it is.
Sure, that's why we don't use assert(), but have gdb_assert(), which
calls internal_error() instead of abort. It's just that gdb_assert()
results in a slightly different error message (which hopefuly is more
helpful to the poor soul who actually will be fixing the bug).