This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add proper error message instead of gdb_assert


> Date: Mon, 3 Mar 2008 21:35:35 +0100 (CET)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> CC: deuling@de.ibm.com, gdb-patches@sourceware.org, uweigand@de.ibm.com
> 
> > 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).

I agree with Michael and Markus: a proper error message in plain
English is better in this case.  If the text displayed by gdb_assert
is going to help (though personally I don't see how), we could add
some of it to the error message.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]