From: Pedro Alves <pedro@codesourcery.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] remote-sim.c: Add support for multiple sim instances
Date: Sun, 08 Aug 2010 16:43:00 -0000 [thread overview]
Message-ID: <201008081742.58022.pedro@codesourcery.com> (raw)
In-Reply-To: <20100806162043.01c142e2@mesquite.lan>
On Saturday 07 August 2010 00:20:43, Kevin Buettner wrote:
> +static int
> +gdbsim_close_inferior (struct inferior *inf, void *arg)
> +{
> + struct sim_inferior_data *sim_data = inferior_data (inf,
> + sim_inferior_data_key);
> + if (sim_data != NULL)
> + {
> + ptid_t ptid = sim_data->remote_sim_ptid;
> +
> + sim_inferior_data_cleanup (inf, sim_data);
> + set_inferior_data (inf, sim_inferior_data_key, NULL);
> +
> + inferior_ptid = ptid;
Please do "switch_to_thread (ptid)" instead, so that the
program space and current inferior globals are kept
in sync with inferior_ptid while mourning.
> + generic_mourn_inferior ();
> + }
> +
> + return 0;
> }
>
> +static int
> +gdbsim_stop_inferior (struct inferior *inf, void *arg)
> +{
> + struct sim_inferior_data *sim_data
> + = get_sim_inferior_data (inf, SIM_INSTANCE_NEEDED);
> +
> + if (sim_data)
> + {
> + /* Try to stop the sim. If it can't stop, exit GDB altogether. */
> + if (!sim_stop (sim_data->gdbsim_desc))
> + {
> + quit ();
> + }
> + }
> +
Calling quit doesn't exit GDB; it throws the same exception ^C usually
ends up throwing, cancelling the whole current operation all the way back
to the top CLI prompt. (Well, usually. Some places catch all
exceptions instead of just RETURN_MASK_ERROR.
Other than that, it looked good to me. Thanks!
--
Pedro Alves
next prev parent reply other threads:[~2010-08-08 16:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-02 22:30 Kevin Buettner
2010-07-08 20:08 ` Tom Tromey
2010-07-27 23:07 ` Kevin Buettner
2010-07-27 23:14 ` Pedro Alves
2010-07-27 23:31 ` Kevin Buettner
2010-08-03 12:05 ` Pedro Alves
2010-08-06 23:21 ` Kevin Buettner
2010-08-08 16:43 ` Pedro Alves [this message]
2010-08-10 0:21 ` Kevin Buettner
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=201008081742.58022.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@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