This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3 v4] Introduce common/errors.h
- From: Doug Evans <dje at google dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Mon, 28 Jul 2014 12:54:24 -0700
- Subject: Re: [PATCH 1/3 v4] Introduce common/errors.h
- Authentication-results: sourceware.org; auth=none
- References: <1406206287-6817-1-git-send-email-gbenson at redhat dot com> <1406206287-6817-2-git-send-email-gbenson at redhat dot com> <21457 dot 17973 dot 551020 dot 113918 at ruffy dot mtv dot corp dot google dot com> <20140725085134 dot GB4812 at blade dot nx>
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!