* breakpoint.c (bpstat_stop_status): Add new argument
authorUlrich Weigand <uweigand@de.ibm.com>
Thu, 13 May 2004 16:39:11 +0000 (16:39 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Thu, 13 May 2004 16:39:11 +0000 (16:39 +0000)
STOPPED_BY_WATCHPOINT.  Use it instead of testing
target_stopped_data_address agaist 0 to check whether
or not we stopped due to a hardware watchpoint.
* breakpoint.h (bpstat_stop_status): Adapt prototype.
* infrun.c (handle_inferior_event): Call bpstat_stop_status
with new argument.

gdb/ChangeLog
gdb/breakpoint.c
gdb/breakpoint.h
gdb/infrun.c

index 7c2a80b40d0c2135acadea89828d0f1e88021fb0..4f45b6f82107a8003a7e88499e5c0f2d7b173d59 100644 (file)
@@ -1,3 +1,13 @@
+2004-05-13  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * breakpoint.c (bpstat_stop_status): Add new argument
+       STOPPED_BY_WATCHPOINT.  Use it instead of testing
+       target_stopped_data_address agaist 0 to check whether
+       or not we stopped due to a hardware watchpoint.
+       * breakpoint.h (bpstat_stop_status): Adapt prototype.
+       * infrun.c (handle_inferior_event): Call bpstat_stop_status
+       with new argument.
+
 2004-05-12  Jim Blandy  <jimb@redhat.com>
 
        * configure.in: When checking whether we should use the -bbigtoc
index 96cf0f9b36ea8a9a4af0d01175ebbdc852104d75..8d0b3c8116ab7435850ba2f751a221123e8b419a 100644 (file)
@@ -2559,7 +2559,8 @@ which its expression is valid.\n");
 }
 
 /* Get a bpstat associated with having just stopped at address
-   BP_ADDR.  */
+   BP_ADDR in thread PTID.  STOPPED_BY_WATCHPOINT is true if the
+   target thinks we stopped due to a hardware watchpoint.  */
 
 /* Determine whether we stopped at a breakpoint, etc, or whether we
    don't understand this stop.  Result is a chain of bpstat's such that:
@@ -2576,7 +2577,7 @@ which its expression is valid.\n");
    commands, FIXME??? fields.  */
 
 bpstat
-bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
+bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid, int stopped_by_watchpoint)
 {
   struct breakpoint *b, *temp;
   /* True if we've hit a breakpoint (as opposed to a watchpoint).  */
@@ -2600,7 +2601,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
        && !((b->type == bp_hardware_watchpoint
              || b->type == bp_read_watchpoint
              || b->type == bp_access_watchpoint)
-            && target_stopped_data_address () != 0)
+            && stopped_by_watchpoint)
        && b->type != bp_hardware_breakpoint
        && b->type != bp_catch_fork
        && b->type != bp_catch_vfork
index 93b6850661e5cd91e41c823c2778bac348c54523..67a67e34054f05b722bd615275b533fe27319790 100644 (file)
@@ -414,7 +414,8 @@ extern void bpstat_clear (bpstat *);
    is part of the bpstat is copied as well.  */
 extern bpstat bpstat_copy (bpstat);
 
-extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid);
+extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid, 
+                                 int stopped_by_watchpoint);
 \f
 /* This bpstat_what stuff tells wait_for_inferior what to do with a
    breakpoint (a challenging task).  */
index 96f38a5cb18eda64fa8e4cb02c7110fc5298537c..bec87465bdfd0c5e8916b5209b24b76be7ba22f9 100644 (file)
@@ -1356,6 +1356,7 @@ handle_inferior_event (struct execution_control_state *ecs)
      defined in the file "config/pa/nm-hppah.h", accesses the variable
      indirectly.  Mutter something rude about the HP merge.  */
   int sw_single_step_trap_p = 0;
+  int stopped_by_watchpoint = 0;
 
   /* Cache the last pid/waitstatus. */
   target_last_wait_ptid = ecs->ptid;
@@ -1545,7 +1546,7 @@ handle_inferior_event (struct execution_control_state *ecs)
 
       stop_pc = read_pc ();
 
-      stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
+      stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 0);
 
       ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
 
@@ -1594,7 +1595,7 @@ handle_inferior_event (struct execution_control_state *ecs)
       ecs->saved_inferior_ptid = inferior_ptid;
       inferior_ptid = ecs->ptid;
 
-      stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
+      stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 0);
 
       ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
       inferior_ptid = ecs->saved_inferior_ptid;
@@ -1910,7 +1911,7 @@ handle_inferior_event (struct execution_control_state *ecs)
 
   /* It may be possible to simply continue after a watchpoint.  */
   if (HAVE_CONTINUABLE_WATCHPOINT)
-    STOPPED_BY_WATCHPOINT (ecs->ws);
+    stopped_by_watchpoint = STOPPED_BY_WATCHPOINT (ecs->ws);
 
   ecs->stop_func_start = 0;
   ecs->stop_func_end = 0;
@@ -1990,7 +1991,8 @@ handle_inferior_event (struct execution_control_state *ecs)
       else
        {
          /* See if there is a breakpoint at the current PC.  */
-         stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
+         stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 
+                                           stopped_by_watchpoint);
 
          /* Following in case break condition called a
             function.  */
This page took 0.036484 seconds and 4 git commands to generate.