--- gdb/infcmd.c@@/INSIGHT-6.8-ST-1.0 2008-08-12 12:00:00.000000000 +0100 +++ gdb/infcmd.c 2008-08-18 18:18:04.000000000 +0100 @@ -29,6 +29,7 @@ #include "environ.h" #include "value.h" #include "gdbcmd.h" +#include "gdbthread.h" #include "symfile.h" #include "gdbcore.h" #include "target.h" @@ -653,6 +654,27 @@ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); } +/* Reset to waiting PID. */ +static void +prepare_to_step (void) +{ + ptid_t wait_ptid; + struct target_waitstatus wait_status; + + /* Get the last target status returned by target_wait(). */ + get_last_target_status (&wait_ptid, &wait_status); + + /* Switched over from WAIT_PID. */ + if (!ptid_equal (wait_ptid, minus_one_ptid) + && !ptid_equal (wait_ptid, inferior_ptid)) + { + /* Switch back to WAIT_PID thread. */ + switch_to_thread (wait_ptid); + printf_filtered (_("[Switching to %s]\n"), + target_pid_to_str (inferior_ptid)); + } +} + /* Step until outside of current statement. */ static void @@ -699,6 +721,8 @@ ERROR_NO_INFERIOR; + prepare_to_step (); + if (count_string) async_exec = strip_bg_char (&count_string); @@ -1057,6 +1081,8 @@ struct symbol *func; struct symtab_and_line sal; + prepare_to_step (); + clear_proceed_status (); frame = get_current_frame ();