aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2009-05-30 00:19:13 +0000
committerDoug Evans <dje@google.com>2009-05-30 00:19:13 +0000
commit5a43797524a9df0545e73709583a43bb404b3d9a (patch)
tree046603d97b17fcdf5fd8716c0e40e2d95e01bd07 /gdb/infrun.c
parent17c3b0a8bf32f6c76cf133cd9ecd35452150a88f (diff)
downloadfsf-binutils-gdb-5a43797524a9df0545e73709583a43bb404b3d9a.zip
fsf-binutils-gdb-5a43797524a9df0545e73709583a43bb404b3d9a.tar.gz
fsf-binutils-gdb-5a43797524a9df0545e73709583a43bb404b3d9a.tar.bz2
* infrun.c (prepare_to_proceed): Document. Assert !non_stop.
If scheduler-locking is enabled, we're not going to be singlestepping any other previously stopped thread. * gdb.threads/hand-call-in-threads.exp: New file. * gdb.threads/hand-call-in-threads.c: New file.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 88a1c4e..9b302bf 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1364,13 +1364,21 @@ clear_proceed_status (void)
}
}
-/* This should be suitable for any targets that support threads. */
+/* Check the current thread against the thread that reported the most recent
+ event. If a step-over is required return TRUE and set the current thread
+ to the old thread. Otherwise return FALSE.
+
+ This should be suitable for any targets that support threads. */
static int
prepare_to_proceed (int step)
{
ptid_t wait_ptid;
struct target_waitstatus wait_status;
+ int schedlock_enabled;
+
+ /* With non-stop mode on, threads are always handled individually. */
+ gdb_assert (! non_stop);
/* Get the last target status returned by target_wait(). */
get_last_target_status (&wait_ptid, &wait_status);
@@ -1382,9 +1390,15 @@ prepare_to_proceed (int step)
return 0;
}
+ schedlock_enabled = (scheduler_mode == schedlock_on
+ || (scheduler_mode == schedlock_step
+ && step));
+
/* Switched over from WAIT_PID. */
if (!ptid_equal (wait_ptid, minus_one_ptid)
- && !ptid_equal (inferior_ptid, wait_ptid))
+ && !ptid_equal (inferior_ptid, wait_ptid)
+ /* Don't single step WAIT_PID if scheduler locking is on. */
+ && !schedlock_enabled)
{
struct regcache *regcache = get_thread_regcache (wait_ptid);