+2009-05-24 Doug Evans <dje@google.com>
+
+ * linux-low.c (get_stop_pc): Print pc if debug_threads.
+ (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
+ (linux_resume_one_lwp): Ditto.
+
2009-05-23 Doug Evans <dje@google.com>
* linux-low.c (linux_resume_one_lwp): Change type of first arg
{
CORE_ADDR stop_pc = (*the_low_target.get_pc) ();
- if (get_thread_lwp (current_inferior)->stepping)
- return stop_pc;
- else
- return stop_pc - the_low_target.decr_pc_after_break;
+ if (! get_thread_lwp (current_inferior)->stepping)
+ stop_pc -= the_low_target.decr_pc_after_break;
+
+ if (debug_threads)
+ fprintf (stderr, "stop pc is 0x%lx\n", (long) stop_pc);
+
+ return stop_pc;
}
static void *
decrement. We go immediately from this function to resuming,
and can not safely call get_stop_pc () again. */
if (the_low_target.set_pc != NULL)
- (*the_low_target.set_pc) (stop_pc);
+ {
+ if (debug_threads)
+ fprintf (stderr, "Set pc to 0x%lx\n", (long) stop_pc);
+ (*the_low_target.set_pc) (stop_pc);
+ }
/* We consumed the pending SIGTRAP. */
event_child->pending_is_breakpoint = 0;
}
if (debug_threads
- && WIFSTOPPED (*wstatp))
+ && WIFSTOPPED (*wstatp)
+ && the_low_target.get_pc != NULL)
{
struct thread_info *saved_inferior = current_inferior;
+ CORE_ADDR pc;
+
current_inferior = (struct thread_info *)
find_inferior_id (&all_threads, child->head.id);
- /* For testing only; i386_stop_pc prints out a diagnostic. */
- if (the_low_target.get_pc != NULL)
- get_stop_pc ();
+ pc = (*the_low_target.get_pc) ();
+ fprintf (stderr, "linux_wait_for_lwp: pc is 0x%lx\n", (long) pc);
current_inferior = saved_inferior;
}
if (debug_threads && the_low_target.get_pc != NULL)
{
- fprintf (stderr, " ");
- (*the_low_target.get_pc) ();
+ CORE_ADDR pc = (*the_low_target.get_pc) ();
+ fprintf (stderr, " resuming from pc 0x%lx\n", (long) pc);
}
/* If we have pending signals, consume one unless we are trying to reinsert