aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-08-22 14:06:29 +0000
committerPedro Alves <palves@redhat.com>2008-08-22 14:06:29 +0000
commite0bb1c1c26100adf76647b45e24aedd73a355b5e (patch)
treea9b5e11a464e7fd19feab4cbc96b43e7b1ac7cea
parenta3ecef734dbaff7879f2a372f00e280284f63245 (diff)
downloadgdb-e0bb1c1c26100adf76647b45e24aedd73a355b5e.zip
gdb-e0bb1c1c26100adf76647b45e24aedd73a355b5e.tar.gz
gdb-e0bb1c1c26100adf76647b45e24aedd73a355b5e.tar.bz2
* infrun.c (proceed): Move back setting previous_inferior_ptid
from here ... (wait_for_inferior): ... to here. (fetch_inferior_event): ... and here.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/infrun.c13
2 files changed, 17 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c67ade7..155fb66 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-22 Pedro Alves <pedro@codesourcery.com>
+
+ * infrun.c (proceed): Move back setting previous_inferior_ptid
+ from here ...
+ (wait_for_inferior): ... to here.
+ (fetch_inferior_event): ... and here.
+
2008-08-21 Ulrich Weigand <uweigand@de.ibm.com>
* gdbarch.sh: Include "regcache.h" into gdbarch.c.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 5d42004..de1827e 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1336,9 +1336,6 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
/* Fill in with reasonable starting values. */
init_thread_stepping_state (tss);
- /* We'll update this if & when we switch to a new thread. */
- previous_inferior_ptid = inferior_ptid;
-
/* Reset to normal state. */
init_infwait_state ();
@@ -1516,6 +1513,9 @@ wait_for_inferior (int treat_exec_as_sigtrap)
overlay_cache_invalid = 1;
+ /* We'll update this if & when we switch to a new thread. */
+ previous_inferior_ptid = inferior_ptid;
+
/* We have to invalidate the registers BEFORE calling target_wait
because they can be loaded from the target while in target_wait.
This makes remote debugging a bit more efficient for those
@@ -1568,6 +1568,13 @@ fetch_inferior_event (void *client_data)
overlay_cache_invalid = 1;
+ /* We can only rely on wait_for_more being correct before handling
+ the event in all-stop, but previous_inferior_ptid isn't used in
+ non-stop. */
+ if (!ecs->wait_some_more)
+ /* We'll update this if & when we switch to a new thread. */
+ previous_inferior_ptid = inferior_ptid;
+
if (non_stop)
/* In non-stop mode, the user/frontend should not notice a thread
switch due to internal events. Make sure we reverse to the