From: Daniel Jacobowitz <drow@false.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [non-stop] 07/10 non-stop inferior control
Date: Wed, 25 Jun 2008 20:06:00 -0000 [thread overview]
Message-ID: <20080625194409.GF25575@caradoc.them.org> (raw)
In-Reply-To: <200806152205.16824.pedro@codesourcery.com>
On Sun, Jun 15, 2008 at 10:05:16PM +0100, Pedro Alves wrote:
> It is also needed to have support to interrupt/suspend a simple
> thread so a new target_stop_ptid method was added to request
> the target to interrupt a single thread.
How about adding a ptid argument to to_stop instead? I think the code
will be shared in most cases.
> @@ -1810,11 +1847,16 @@ handle_inferior_event (struct execution_
> && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED && ecs->new_thread_event)
> add_thread (ecs->ptid);
>
> - /* Mark all threads as not-executing. In non-stop, this should be
> - adjusted to only mark ecs->ptid. */
> - if (ecs->ws.kind != TARGET_WAITKIND_IGNORE
> - && stop_soon != STOP_QUIETLY)
> - set_executing (pid_to_ptid (-1), 0);
> + if (ecs->ws.kind != TARGET_WAITKIND_IGNORE)
> + {
> + /* Mark the stopped threads accordingly. */
> + if (!non_stop
> + || ecs->ws.kind == TARGET_WAITKIND_EXITED
> + || ecs->ws.kind == TARGET_WAITKIND_SIGNALLED)
> + set_executing (pid_to_ptid (-1), 0);
> + else
> + set_executing (ecs->ptid, 0);
> + }
>
> switch (ecs->ws.kind)
> {
Are we going to miss the stop_soon check here?
> - switch_to_thread (tp->ptid);
> + if (non_stop)
> + context_switch_to (tp->ptid);
> + else
> + switch_to_thread (tp->ptid);
> +
Ow ow my head, I really wish we didn't need both of these. We'll
never keep track of which is which. Will we eventually be able to
merge them?
> - add_prefix_cmd ("thread", class_run, thread_command, _("\
> + c = add_prefix_cmd ("thread", class_run, thread_command, _("\
> Use this command to switch between threads.\n\
> The new thread ID must be currently known."),
> &thread_cmd_list, "thread ", 1, &cmdlist);
Indentation on that last line.
Otherwise OK.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-06-25 19:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-15 21:06 Pedro Alves
2008-06-25 20:06 ` Daniel Jacobowitz [this message]
2008-06-25 20:20 ` Pedro Alves
2008-07-02 3:34 ` Pedro Alves
2008-07-07 18:10 ` Daniel Jacobowitz
2008-07-02 3:34 ` [non-stop v2] 07.2/10 update all targets to target_stop change Pedro Alves
2008-07-07 18:10 ` Daniel Jacobowitz
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=20080625194409.GF25575@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.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