This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
some more debug output in infrun.c
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 18 May 2011 17:25:36 +0100
- Subject: some more debug output in infrun.c
This adds output in which thread is current at a resume,
and, which is its current PC. I've missed the latter often,
and the former although could be inferred most of the times
from a previous context_switch note, that's not always possible,
and this makes it handier anyway. It also adds a note when
prepare_to_proceed decides we need to step over a breakpoint
in another thread.
Applied.
--
Pedro Alves
2011-05-18 Pedro Alves <pedro@codesourcery.com>
gdb/
* infrun.c (resume): Mention which is the current thread, and its
current PC in debug output.
(prepare_to_proceed): Mention the thread switching in debug
output.
---
gdb/infrun.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c 2011-05-17 15:24:15.523488993 +0100
+++ src/gdb/infrun.c 2011-05-18 17:10:03.998819003 +0100
@@ -1644,8 +1644,10 @@ resume (int step, enum target_signal sig
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
"infrun: resume (step=%d, signal=%d), "
- "trap_expected=%d\n",
- step, sig, tp->control.trap_expected);
+ "trap_expected=%d, current thread [%s] at %s\n",
+ step, sig, tp->control.trap_expected,
+ target_pid_to_str (inferior_ptid),
+ paddress (gdbarch, pc));
/* Normally, by the time we reach `resume', the breakpoints are either
removed or inserted, as appropriate. The exception is if we're sitting
@@ -2001,6 +2003,12 @@ prepare_to_proceed (int step)
/* Switch back to WAIT_PID thread. */
switch_to_thread (wait_ptid);
+ if (debug_infrun)
+ fprintf_unfiltered (gdb_stdlog,
+ "infrun: prepare_to_proceed (step=%d), "
+ "switched to [%s]\n",
+ step, target_pid_to_str (inferior_ptid));
+
/* We return 1 to indicate that there is a breakpoint here,
so we need to step over it before continuing to avoid
hitting it straight away. */