pass = -1;
event_ptid = wait_one (&ws);
-
- if (ws.kind == TARGET_WAITKIND_NO_RESUMED)
+ if (debug_infrun)
{
- /* All resumed threads exited. */
+ fprintf_unfiltered (gdb_stdlog,
+ "infrun: stop_all_threads %s %s\n",
+ target_waitstatus_to_string (&ws).c_str (),
+ target_pid_to_str (event_ptid).c_str ());
}
- else if (ws.kind == TARGET_WAITKIND_THREAD_EXITED
- || ws.kind == TARGET_WAITKIND_EXITED
- || ws.kind == TARGET_WAITKIND_SIGNALLED)
- {
- if (debug_infrun)
- {
- ptid_t ptid = ptid_t (ws.value.integer);
- fprintf_unfiltered (gdb_stdlog,
- "infrun: %s exited while "
- "stopping threads\n",
- target_pid_to_str (ptid).c_str ());
- }
+ if (ws.kind == TARGET_WAITKIND_NO_RESUMED
+ || ws.kind == TARGET_WAITKIND_THREAD_EXITED
+ || ws.kind == TARGET_WAITKIND_EXITED
+ || ws.kind == TARGET_WAITKIND_SIGNALLED)
+ {
+ /* All resumed threads exited
+ or one thread/process exited/signalled. */
}
else
{
enum stop_kind stop_soon;
+ if (debug_infrun)
+ fprintf_unfiltered (gdb_stdlog, "infrun: handle_inferior_event %s\n",
+ target_waitstatus_to_string (&ecs->ws).c_str ());
+
if (ecs->ws.kind == TARGET_WAITKIND_IGNORE)
{
/* We had an event in the inferior, but we are not interested in
not stopped, and we are ignoring the event. Another possible
circumstance is any event which the lower level knows will be
reported multiple times without an intervening resume. */
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_IGNORE\n");
prepare_to_wait (ecs);
return;
}
if (ecs->ws.kind == TARGET_WAITKIND_THREAD_EXITED)
{
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_THREAD_EXITED\n");
prepare_to_wait (ecs);
return;
}
{
/* No unwaited-for children left. IOW, all resumed children
have exited. */
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_NO_RESUMED\n");
-
stop_print_frame = 0;
stop_waiting (ecs);
return;
switch (ecs->ws.kind)
{
case TARGET_WAITKIND_LOADED:
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_LOADED\n");
context_switch (ecs);
/* Ignore gracefully during startup of the inferior, as it might
be the shell which has just loaded some objects, otherwise
_("unhandled stop_soon: %d"), (int) stop_soon);
case TARGET_WAITKIND_SPURIOUS:
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_SPURIOUS\n");
if (handle_stop_requested (ecs))
return;
context_switch (ecs);
return;
case TARGET_WAITKIND_THREAD_CREATED:
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_THREAD_CREATED\n");
if (handle_stop_requested (ecs))
return;
context_switch (ecs);
case TARGET_WAITKIND_EXITED:
case TARGET_WAITKIND_SIGNALLED:
- if (debug_infrun)
- {
- if (ecs->ws.kind == TARGET_WAITKIND_EXITED)
- fprintf_unfiltered (gdb_stdlog,
- "infrun: TARGET_WAITKIND_EXITED\n");
- else
- fprintf_unfiltered (gdb_stdlog,
- "infrun: TARGET_WAITKIND_SIGNALLED\n");
- }
-
inferior_ptid = ecs->ptid;
set_current_inferior (find_inferior_ptid (ecs->ptid));
set_current_program_space (current_inferior ()->pspace);
the above cases end in a continue or goto. */
case TARGET_WAITKIND_FORKED:
case TARGET_WAITKIND_VFORKED:
- if (debug_infrun)
- {
- if (ecs->ws.kind == TARGET_WAITKIND_FORKED)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_FORKED\n");
- else
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_VFORKED\n");
- }
-
/* Check whether the inferior is displaced stepping. */
{
struct regcache *regcache = get_thread_regcache (ecs->event_thread);
/* Done with the shared memory region. Re-insert breakpoints in
the parent, and keep going. */
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog,
- "infrun: TARGET_WAITKIND_VFORK_DONE\n");
-
context_switch (ecs);
current_inferior ()->waiting_for_vfork_done = 0;
return;
case TARGET_WAITKIND_EXECD:
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_EXECD\n");
/* Note we can't read registers yet (the stop_pc), because we
don't yet know the inferior's post-exec architecture.
/* Be careful not to try to gather much state about a thread
that's in a syscall. It's frequently a losing proposition. */
case TARGET_WAITKIND_SYSCALL_ENTRY:
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog,
- "infrun: TARGET_WAITKIND_SYSCALL_ENTRY\n");
/* Getting the current syscall number. */
if (handle_syscall_event (ecs) == 0)
process_event_stop_test (ecs);
syscall. Stepping one instruction seems to get it back
into user code.) */
case TARGET_WAITKIND_SYSCALL_RETURN:
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog,
- "infrun: TARGET_WAITKIND_SYSCALL_RETURN\n");
if (handle_syscall_event (ecs) == 0)
process_event_stop_test (ecs);
return;
case TARGET_WAITKIND_STOPPED:
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_STOPPED\n");
handle_signal_stop (ecs);
return;
case TARGET_WAITKIND_NO_HISTORY:
- if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_NO_HISTORY\n");
/* Reverse execution: target ran out of history info. */
/* Switch to the stopped thread. */