This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Rationalize "fatal" error handling outside of gdbserver
- From: Gary Benson <gbenson at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Doug Evans <dje at google dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 24 Jul 2014 10:28:01 +0100
- Subject: Re: [PATCH] Rationalize "fatal" error handling outside of gdbserver
- Authentication-results: sourceware.org; auth=none
- References: <1406129636-24197-1-git-send-email-gbenson at redhat dot com> <53CFF413 dot 6040402 at redhat dot com>
Pedro Alves wrote:
> On 07/23/2014 04:33 PM, Gary Benson wrote:
> > GDB and gdbserver have functions named "fatal" that are used in
> > completely different ways. In gdbserver "fatal" is used to handle
> > critial errors: it differs from "error" in that "fatal" causes
>
> "critical"
>
> > gdbserver to exit whereas "error" does not. In GDB "fatal" is
> > used to abort the current operation and return to the command
> > level. This is implemented by throwing a non-error "RETURN_QUIT"
> > exception.
> >
> > This patch removes GDB's "fatal" and "vfatal" functions entirely.
> > The exception-throwing function "throw_vfatal" is renamed as
> > "throw_vquit", and a new convenience function "throw_quit" is
> > added. The small number of calls to "fatal" are replaced with
> > calls to "throw_quit", making what is happening more obvious.
> >
> > This patch also modifies GDB's "throw_error" to call
> > "throw_verror" rather than calling "throw_it" directly. This
> > change means the assignment of RETURN_ERROR as the exception type
> > now happens in precisely one place in GDB rather than two.
> >
> > Built and regtested on RHEL6.5 x86_64.
> >
> > Ok to commit?
>
> Looks good to me.
Thanks, pushed.
Cheers,
Gary
--
http://gbenson.net/