This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: abort() to internal_error()
- To: GDB Discussion <gdb at sources dot redhat dot com>
- Subject: Re: abort() to internal_error()
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Fri, 16 Feb 2001 12:59:47 -0700
- References: <3A8D419B.35FE24C@cygnus.com>
On Feb 16, 10:04am, Andrew Cagney wrote:
> KevinB's kindly cooked up a script that will replace all instances of:
>
> abort ();
>
> with
>
> internal_error (__FILE__, __LINE__, "function calls abort ()");
>
> Applying and committing this script will signify the end of a very long
> campain I've been waging with GDB - to significantly reduce the
> likelhood that GDB dumps core.
>
> >From memory, this has been discussed several times before (and is listed
> in the TODO file). The only problem I can think of is the message.
> However, if you think about it:
>
> (gdb) pwd
> internal_error: /a/b/c/d/foo.c:47: function calls abort ()
> ....
>
> is still infinatly better than something like
>
> (gdb) pwd
> Program received SIGXYZZY, core dumped
> $
>
> so I think is good enough,
>
> comments?
It should be noted that if the "function calls abort ()" message is
unpalatable for some reason (e.g, lack of specificity), these can be
replaced with something more suitable over time. In each case, the
choice of a more suitable message will likely depend upon the context,
so I think that Andrew's suggestion is a reasonable first step. It is
certainly better than what we have now...
Kevin