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 at specifix dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Markus Deuling <deuling at de dot ibm dot com>, GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 03 Mar 2008 12:30:30 -0800
- Subject: Re: [patch] Add proper error message instead of gdb_assert
- References: <200803032000.m23K00SA027858@d12av02.megacenter.de.ibm.com>
On Mon, 2008-03-03 at 21:00 +0100, Ulrich Weigand wrote:
> Markus Deuling wrote:
>
> > when trying to put > 1 values into an array (fortran subrange) which
> > comes from a register, register_size is called with regnum == -1.
>
> You need to fix the caller to not do this, then.
>
> > This patch replaces that gdb_assert by a proper error message before
> > exiting:
>
> An "internal error" is neither more nor less "proper" than a failed
> assertion. Both say "there's a bug in GDB", and neither should be
> triggerable by normal user interaction.
Yes, but they're not equivalent. An assertion failure terminates
the session. Shouldn't we reserve that for situations that we
can reasonably assume are un-recoverable?