aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-03-21 11:08:44 +0000
committerPedro Alves <palves@redhat.com>2014-03-21 11:08:44 +0000
commitb65dc60b233704405c334bbe16c4fc5689187b7b (patch)
treedc93aea4b22b2d5552a04dd495e34dddfa586706 /gdb/infrun.c
parent36cb1214c9f26b4e9b42d146dcf64621b36b91df (diff)
downloadgdb-b65dc60b233704405c334bbe16c4fc5689187b7b.zip
gdb-b65dc60b233704405c334bbe16c4fc5689187b7b.tar.gz
gdb-b65dc60b233704405c334bbe16c4fc5689187b7b.tar.bz2
normal_stop: Extend and clarify comment.
Explain better why we skip saying "Switching to ..." in non-stop mode. gdb/ 2014-03-21 Pedro Alves <palves@redhat.com> * infrun.c (normal_stop): Extend comment.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d7de7d1..8f9e820 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -6059,18 +6059,22 @@ normal_stop (void)
&& last.kind != TARGET_WAITKIND_NO_RESUMED)
make_cleanup (finish_thread_state_cleanup, &inferior_ptid);
- /* In non-stop mode, we don't want GDB to switch threads behind the
- user's back, to avoid races where the user is typing a command to
- apply to thread x, but GDB switches to thread y before the user
- finishes entering the command. */
-
/* As with the notification of thread events, we want to delay
notifying the user that we've switched thread context until
the inferior actually stops.
There's no point in saying anything if the inferior has exited.
Note that SIGNALLED here means "exited with a signal", not
- "received a signal". */
+ "received a signal".
+
+ Also skip saying anything in non-stop mode. In that mode, as we
+ don't want GDB to switch threads behind the user's back, to avoid
+ races where the user is typing a command to apply to thread x,
+ but GDB switches to thread y before the user finishes entering
+ the command, fetch_inferior_event installs a cleanup to restore
+ the current thread back to the thread the user had selected right
+ after this event is handled, so we're not really switching, only
+ informing of a stop. */
if (!non_stop
&& !ptid_equal (previous_inferior_ptid, inferior_ptid)
&& target_has_execution