From: Pedro Alves <palves@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v3 10/17] Implement all-stop on top of a target running non-stop mode
Date: Tue, 19 May 2015 19:19:00 -0000 [thread overview]
Message-ID: <555B8CB2.50600@redhat.com> (raw)
In-Reply-To: <089e0122eb54b0c5c6051661dd3e@google.com>
On 05/18/2015 10:27 PM, Doug Evans wrote:
> > /* On all-stop, shouldn't have resumed unless we needed a
> > step over. */
> > @@ -2383,7 +2384,10 @@ resume (enum gdb_signal sig)
> > insert_single_step_breakpoint (gdbarch, aspace, pc);
> > insert_breakpoints ();
> >
> > - resume_ptid = user_visible_resume_ptid (user_step);
> > + if (target_is_non_stop_p ())
> > + resume_ptid = inferior_ptid;
> > + else
> > + resume_ptid = user_visible_resume_ptid (user_step);
>
> Hi.
> For my own education, why is this change needed?
Please see the comment tweaks below.
> This takes a bit of reading to grok (the difference
> b/w non_stop and target_is_non_stop_p).
> Can you copy the comment below (marked XYZ) here?
Done (in all places).
Let me know what you think.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 82fa526..2f8a708 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2384,6 +2384,11 @@ resume (enum gdb_signal sig)
insert_single_step_breakpoint (gdbarch, aspace, pc);
insert_breakpoints ();
+ /* In non-stop, we always control threads individually.
+ Note that the target may always work in non-stop mode
+ even with "set non-stop off", in which case
+ user_visible_resume_ptid could return a wildcard
+ ptid. */
if (target_is_non_stop_p ())
resume_ptid = inferior_ptid;
else
@@ -2946,7 +2951,8 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal)
}
else if (!non_stop && target_is_non_stop_p ())
{
- /* Start all other threads that are implicitly resumed too. */
+ /* In all-stop, but the target is always in non-stop mode.
+ Start all other threads that are implicitly resumed too. */
ALL_NON_EXITED_THREADS (tp)
{
/* Ignore threads of processes we're not resuming. */
@@ -5670,13 +5676,15 @@ handle_signal_stop (struct execution_control_state *ecs)
if (target_is_non_stop_p ())
{
+ /* Either "set non-stop" is "on", or the target is
+ always in non-stop mode. In this case, we have a bit
+ more work to do. Resume the current thread, and if
+ we had paused all threads, restart them while the
+ signal handler runs. */
keep_going (ecs);
- /* The step-over has been canceled temporarily while the
- signal handler executes. */
if (was_in_line)
{
- /* We had paused all threads, restart them. */
restart_threads (ecs->event_thread);
}
else if (debug_infrun)
--
1.9.3
next prev parent reply other threads:[~2015-05-19 19:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 21:27 Doug Evans
2015-05-19 19:19 ` Pedro Alves [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-04-17 10:47 [PATCH v3 00/23] All-stop on top of non-stop Pedro Alves
2015-04-17 11:38 ` [PATCH v3 10/17] Implement all-stop on top of a target running non-stop mode Pedro Alves
2015-04-21 11:09 ` Yao Qi
2015-04-22 20:16 ` Pedro Alves
2015-04-24 7:39 ` Yao Qi
2015-05-19 18:08 ` Pedro Alves
2015-05-21 9:17 ` Yao Qi
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=555B8CB2.50600@redhat.com \
--to=palves@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/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