aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index b14f34c..266b892 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2052,7 +2052,6 @@ static void keep_going_pass_signal (struct execution_control_state *ecs);
static void prepare_to_wait (struct execution_control_state *ecs);
static int keep_going_stepped_thread (struct thread_info *tp);
static step_over_what thread_still_needs_step_over (struct thread_info *tp);
-static void stop_all_threads (void);
/* Are there any pending step-over requests? If so, run all we can
now and return true. Otherwise, return false. */
@@ -4015,7 +4014,7 @@ init_thread_stepping_state (struct thread_info *tss)
/* Set the cached copy of the last ptid/waitstatus. */
-static void
+void
set_last_target_status (ptid_t ptid, struct target_waitstatus status)
{
target_last_wait_ptid = ptid;
@@ -4437,9 +4436,9 @@ save_waitstatus (struct thread_info *tp, struct target_waitstatus *ws)
}
}
-/* Stop all threads. */
+/* See infrun.h. */
-static void
+void
stop_all_threads (void)
{
/* We may need multiple passes to discover all threads. */
@@ -4548,6 +4547,8 @@ stop_all_threads (void)
}
else
{
+ struct inferior *inf;
+
t = find_thread_ptid (event_ptid);
if (t == NULL)
t = add_thread (event_ptid);
@@ -4557,6 +4558,15 @@ stop_all_threads (void)
t->resumed = 0;
t->control.may_range_step = 0;
+ /* This may be the first time we see the inferior report
+ a stop. */
+ inf = find_inferior_ptid (event_ptid);
+ if (inf->needs_setup)
+ {
+ switch_to_thread_no_regs (t);
+ setup_inferior (0);
+ }
+
if (ws.kind == TARGET_WAITKIND_STOPPED
&& ws.value.sig == GDB_SIGNAL_0)
{