Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [RFC/PATCH] New convenience variable $_exitsignal
Date: Mon, 17 Jun 2013 17:28:00 -0000	[thread overview]
Message-ID: <51BF4550.80704@redhat.com> (raw)
In-Reply-To: <m3mwqqvagk.fsf@redhat.com>

On 06/16/2013 07:25 AM, Sergio Durigan Junior wrote:
> @@ -3455,6 +3455,12 @@ handle_inferior_event (struct execution_control_state *ecs)
>  	  set_internalvar_integer (lookup_internalvar ("_exitcode"),
>  				   (LONGEST) ecs->ws.value.integer);
>  
> +	  /* Clear the internal variable, since if we are here chances
> +	     are the inferior has not been terminated by a signal.
> +	     And even if it has, then GDB will get to
> +	     TARGET_WAITKIND_SIGNALLED in time...  */

No it won't.  The target either returns TARGET_WAITKIND_EXITED
or TARGET_WAITKIND_SIGNALLED.  They're mutually exclusive.

> +	  clear_internalvar (lookup_internalvar ("_exitsignal"));
> +
>  	  /* Also record this in the inferior itself.  */
>  	  current_inferior ()->has_exit_code = 1;
>  	  current_inferior ()->exit_code = (LONGEST) ecs->ws.value.integer;
> @@ -3462,7 +3468,17 @@ handle_inferior_event (struct execution_control_state *ecs)
>  	  print_exited_reason (ecs->ws.value.integer);
>  	}
>        else
> -	print_signal_exited_reason (ecs->ws.value.sig);
> +	{
> +	  print_signal_exited_reason (ecs->ws.value.sig);
> +	  /* Set the value of the internal variable $_exitsignal,
> +	     which holds the signal uncaught by the inferior.  */
> +	  set_internalvar_integer (lookup_internalvar ("_exitsignal"),
> +				   (LONGEST) ecs->ws.value.sig);
> +
> +	  /* Clear the $_exitcode internal variable, because if the
> +	     inferior signalled then its return code does not exist.  */

s/the inferior signalled/the inferior died with a signal/ ?

> +	  clear_internalvar (lookup_internalvar ("_exitcode"));
> +	}

-- 
Pedro Alves


  parent reply	other threads:[~2013-06-17 17:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-16  6:30 Sergio Durigan Junior
2013-06-16 16:22 ` Doug Evans
2013-06-17  3:33 ` Eli Zaretskii
2013-06-17  7:32 ` Pierre Muller
2013-06-17 17:55   ` Sergio Durigan Junior
2013-06-19  5:26     ` Sergio Durigan Junior
2013-09-16 18:04       ` Pedro Alves
2013-09-17  0:11         ` Sergio Durigan Junior
2013-09-17 16:19           ` Pedro Alves
2013-09-17 18:39         ` Tom Tromey
2013-09-17 18:53           ` Philippe Waroquiers
2013-09-17 18:59             ` Sergio Durigan Junior
2013-09-17 18:59             ` Tom Tromey
2013-09-17 19:08             ` Pedro Alves
2013-09-17 19:02           ` Pedro Alves
2013-09-17 19:09             ` Tom Tromey
2013-07-18 16:48     ` Tom Tromey
2013-06-17 17:28 ` Pedro Alves [this message]
2013-06-17 17:31   ` Pedro Alves
2013-06-17 17:41   ` Sergio Durigan Junior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51BF4550.80704@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox