
This patch make 'set debug infrun 1' produce more detailed
information about watchpoint hits. OK?

	* gdb/infrun.c (handle_inferior_event): More
	detailed debugging about watchpoint hit.
---
 gdb/infrun.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/gdb/infrun.c b/gdb/infrun.c
index d79ed3f..6c62b60 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1597,7 +1597,17 @@ handle_inferior_event (struct execution_control_state *ecs)
   stop_pc = read_pc_pid (ecs->ptid);
 
   if (debug_infrun)
-    fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = 0x%s\n", paddr_nz (stop_pc));
+    {
+      CORE_ADDR addr;
+      fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = 0x%s\n", paddr_nz (stop_pc));
+      if (STOPPED_BY_WATCHPOINT (*ws))
+	{
+	  fprintf_unfiltered (gdb_stdlog, "infrun: stopped by watchpoint\n");
+	  fprintf_unfiltered (gdb_stdlog, 
+			      "infrun: stopped data address = 0x%s\n", 
+			      paddr_nz (addr));
+	}
+    }
 
   if (stepping_past_singlestep_breakpoint)
     {
@@ -1823,9 +1833,6 @@ handle_inferior_event (struct execution_control_state *ecs)
       && (HAVE_STEPPABLE_WATCHPOINT
 	  || gdbarch_have_nonsteppable_watchpoint (current_gdbarch)))
     {
-      if (debug_infrun)
-	fprintf_unfiltered (gdb_stdlog, "infrun: STOPPED_BY_WATCHPOINT\n");
-
       /* At this point, we are stopped at an instruction which has
          attempted to write to a piece of memory under control of
          a watchpoint.  The instruction hasn't actually executed
-- 
1.5.3.5


