[PATCH 1/3 v4] Introduce common/errors.h

Doug Evans dje@google.com
Mon Jul 28 20:16:00 GMT 2014


On Fri, Jul 25, 2014 at 1:51 AM, Gary Benson <gbenson@redhat.com> wrote:
> Doug Evans wrote:
> [...]
>> In the case of malloc_failure, it's not really an *internal* error,
>
> No--and certainly not by the description of internal_error earlier in
> the file.
>
>> even if in the case of gdb it calls internal_error, though arguably
>> it should do something different - it's more of a "fatal". :-)
>> Though I'm not suggesting trying to go down that path.  :-)
>
> I spoke with Pedro about this in Cambridge.  malloc failure is a funny
> one: sometimes it's fatal, other times it's not an issue; it depends
> entirely on what the memory you were trying to allocate was for.
>
>> It might be possible come up with a name other than "fatal" that
>> could apply to both gdb and gdbserver so that malloc_failure could
>> call it, but no need to try to do that now.
>
> I don't know if you saw but I removed "fatal" from GDB the other day

Indeed, saw that.

> (http://tinyurl.com/k6neuwd) so the path is clear to add a "fatal" if
> we want one.  It would be nice if such a function were smart enough to
> work even if called before exceptions and cleanups were set up.  It
> might be a nice general thing if all error-handling functions worked
> that way (error and internal_error could work like gdbserver's "fatal"
> if called early.)  That might even be a prerequisite to moving
> exceptions and cleanups into common code and making gdbserver use
> them.
>
> (I'm not planning to do any of this now, this is just thinking aloud!)

No worries!



More information about the Gdb-patches mailing list