RFC: internal_error() change + abort()
Michael Snyder
msnyder@redhat.com
Mon Jul 24 11:18:00 GMT 2000
Andrew Cagney wrote:
>
> Hello,
>
> Now that we've moved to ISO-C we might as well make use of __LINE__ and
> __FILE__. With that in mind, I'd like to change internal_error()'s
> signature to:
>
> internal_error (const char *file, long line,
> const char *fmt, ...);
>
> with all files updated accordingly.
>
>
> The second, kind of related change, is to just go through and purge all
> but one call to abort() with a call to:
>
> internal_error (__FILE__, __LINE__, "FIXME: Code was calling abort()");
>
> The abort() calls scattered through out GDB need to eventually be
> converted to error() or internal_error() (case by case). This, somewhat
> brutal change, at least stops GDB dumping core on the poor user.
How do you decide when it's safe to NOT abort?
Eg. if a malloc call fails, you're probably completely
out of virtual memory. Are you sure printf will work
under such a circumstance?
More information about the Gdb-patches
mailing list