Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: Re: RFA: fix PR mi/12661
Date: Wed, 27 Apr 2011 18:26:00 -0000	[thread overview]
Message-ID: <201104271926.30493.pedro@codesourcery.com> (raw)
In-Reply-To: <m339l3in3a.fsf@fleche.redhat.com>

On Wednesday 27 April 2011 19:08:25, Tom Tromey wrote:
> @@ -364,10 +364,16 @@ static void
>  mi_inferior_exit (struct inferior *inf)
>  {
>    struct mi_interp *mi = top_level_interpreter_data ();
> +  LONGEST exit_code;
> +  struct target_waitstatus status;
> +  ptid_t ptidp;
>  
>    target_terminal_ours ();
> -  fprintf_unfiltered (mi->event_channel, "thread-group-exited,id=\"i%d\"",
> -                     inf->num);
> +  get_last_target_status (&ptidp, &status);
> +  exit_code = status.value.integer;
> +  fprintf_unfiltered (mi->event_channel,
> +                     "thread-group-exited,id=\"i%d\",exit-code=\"%s\"",
> +                     inf->num, int_string (exit_code, 8, 0, 0, 1));
>    gdb_flush (mi->event_channel);  
>  }

1 - I think this observer is called at places where get_last_target_status
will not make sense --- the last status may well be of another inferior.
E.g., debug against a live target, let it hit a break, detach.  Then in the same
gdb, open and close a core.

2 - this observer is called at places where the last target status
wasn't an exit event, thus status.value.integer will not be an exit code.
(e.g., infrun.c:follow_exec).

-- 
Pedro Alves


  reply	other threads:[~2011-04-27 18:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-27 18:08 Tom Tromey
2011-04-27 18:26 ` Pedro Alves [this message]
2011-06-02 17:09   ` Tom Tromey
2011-06-02 17:35     ` Pedro Alves
2011-06-02 19:21       ` Tom Tromey
2011-06-02 20:54         ` Eli Zaretskii
2011-06-02 21:01           ` Tom Tromey
2011-06-02 21:24             ` Eli Zaretskii
2011-06-03 15:26               ` Tom Tromey
2011-06-03 15:14           ` Tom Tromey

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=201104271926.30493.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@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