This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC/PATCH] New convenience variable $_exitsignal
- From: Doug Evans <dje at google dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>
- Date: Sat, 15 Jun 2013 23:30:06 -0700
- Subject: Re: [RFC/PATCH] New convenience variable $_exitsignal
- References: <m3mwqqvagk dot fsf at redhat dot com>
On Sat, Jun 15, 2013 at 11:25 PM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
> This patch was proposed by Pedro at:
>
> <http://sourceware.org/ml/gdb-patches/2013-06/msg00337.html>
>
> It adds a new convenience variable called "$_exitsignal", which will
> hold the signal number when the inferior terminates due to the uncaught
> signal.
>
> I've made modifications on infrun.c:handle_inferior_event such that
> $_exitcode gets cleared when the inferior signalled, and vice-versa.
> This assumption was made because IMO the variables are mutually
> exclusive, i.e., when the inferior terminates because of an uncaught
> signal it is not possible for it to return. Anyway, Pedro's explanation
> seems to follow the same logic.
>
> The patch also adds a NEWS entry, documentation bits, and a testcase.
>
> OK to apply?
Hi.
I'd like the documentation to explain how it's intended that the two
(exitcode/exitsignal) are intended to be used together. E.g., how
does one know which one has a useful value?
> gdb/ChangeLog:
> 2013-06-16 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * NEWS: Mention new convenience variable "$_exitsignal".
> * infrun.c (handle_inferior_event): Set internal variable
> "$_exitsignal" for TARGET_WAITKIND_SIGNALLED and clear
> "$_exitcode", vice-versa for TARGET_WAITKIND_STOPPED.