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: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org
- Cc: Doug Evans <dje at google dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Wed, 23 Jul 2014 18:42:43 +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>
On 07/23/2014 04:33 PM, Gary Benson wrote:
> Hi all,
Hi there.
>
> 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,
--
Pedro Alves