]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Unify target macros.
authorPierre Muller <muller@sourceware.org>
Mon, 11 May 2009 11:13:09 +0000 (11:13 +0000)
committerPierre Muller <muller@sourceware.org>
Mon, 11 May 2009 11:13:09 +0000 (11:13 +0000)
* target.h (STOPPED_BY_WATCHPOINT): Delete, replaced by ...
(target_stoppped_by_watchpoint): New macro.
(HAVE_STEPPABLE_WATCHPOINT): Delete, replaced by ...
(target_have_steppable_watchpoint): New macro.
(HAVE_CONTINUABLE_WATCHPOINT): Delete, replace by ...
(target_have_continuable_watchpoint): New macro.
(TARGET_CAN_USE_HARDWARE_WATCHPOINT):Delete, replaced by ...
(target_can_use_hardware_watchpoint): New macro.
(TARGET_REGION_OK_FOR_HW_WATCHPOINT):Delete, replaced by ...
(target_region_ok_for_hw_watchpoint): New macro.

* breakpoint.c (update_watchpoint): Use new macros.
(bpstat_alloc): Likewise.
(create_breakpoint): Likewise.
(watch_command_1): Likewise.
(can_use_hardware_watchpoint): Likewise.
(do_enable_breakpoint): Likewise.
* infrun.c (handle_inferior_event): Adapt to new macros.
* mips-tdep.c (mips_gdbarch_init): Update comments.
* procfs.c (procfs_set_watchpoint): Update comment.
(procfs_insert_watchpoint): Adapt to new macros.
* remote-m32r-sdi.c (m32r_stop):
* remote-mips.c (mips_remove_breakpoint):
* target.c (debug_to_region_ok_for_hw_watchpoint): Update to new macros.
(debug_to_stopped_by_watchpoint): Likewise.

gdb/ChangeLog
gdb/breakpoint.c
gdb/infrun.c
gdb/mips-tdep.c
gdb/procfs.c
gdb/remote-m32r-sdi.c
gdb/remote-mips.c
gdb/target.c
gdb/target.h

index ebb3fa6d56b271dc5bfff183b505e33b9a4edef6..47506de42005cbbe7fd39c48ef601133cd2b5fa3 100644 (file)
@@ -1,3 +1,34 @@
+2009-05-11  Pierre Muller  <muller.u-strasbg.fr>
+
+       Unify target macros.
+
+       * target.h (STOPPED_BY_WATCHPOINT): Delete, replaced by ...
+       (target_stoppped_by_watchpoint): New macro.
+       (HAVE_STEPPABLE_WATCHPOINT): Delete, replaced by ...
+       (target_have_steppable_watchpoint): New macro.
+       (HAVE_CONTINUABLE_WATCHPOINT): Delete, replace by ...
+       (target_have_continuable_watchpoint): New macro.
+       (TARGET_CAN_USE_HARDWARE_WATCHPOINT):Delete, replaced by ...
+       (target_can_use_hardware_watchpoint): New macro.
+       (TARGET_REGION_OK_FOR_HW_WATCHPOINT):Delete, replaced by ...
+       (target_region_ok_for_hw_watchpoint): New macro.
+
+       * breakpoint.c (update_watchpoint): Use new macros.
+       (bpstat_alloc): Likewise.
+       (create_breakpoint): Likewise.
+       (watch_command_1): Likewise.
+       (can_use_hardware_watchpoint): Likewise.
+       (do_enable_breakpoint): Likewise.
+       * infrun.c (handle_inferior_event): Adapt to new macros.
+       * mips-tdep.c (mips_gdbarch_init): Update comments.
+       * procfs.c (procfs_set_watchpoint): Update comment.
+       (procfs_insert_watchpoint): Adapt to new macros.
+       * remote-m32r-sdi.c (m32r_stop):
+       * remote-mips.c (mips_remove_breakpoint):
+       * target.c (debug_to_region_ok_for_hw_watchpoint): Update to new macros.
+       (debug_to_stopped_by_watchpoint): Likewise.
+
+
 2009-05-10  Pierre Muller  <muller.u-strasbg.fr>
 
        * src/gdb/target.h: Remove all tests for already defined
index 35db0f375d141ed51b046160179d4288c471b7b3..e832596f10bef83d9c42fc5a44cb5339ecfff266 100644 (file)
@@ -961,7 +961,7 @@ update_watchpoint (struct breakpoint *b, int reparse)
              b->type = bp_watchpoint;
            else
              {
-               int target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT
+               int target_resources_ok = target_can_use_hardware_watchpoint
                  (bp_hardware_watchpoint, i + mem_cnt, other_type_used);
                if (target_resources_ok <= 0)
                  b->type = bp_watchpoint;
@@ -2602,7 +2602,7 @@ bpstat_alloc (const struct bp_location *bl, bpstat cbs /* Current "bs" value */
 int
 watchpoints_triggered (struct target_waitstatus *ws)
 {
-  int stopped_by_watchpoint = STOPPED_BY_WATCHPOINT (*ws);
+  int stopped_by_watchpoint = target_stopped_by_watchpoint ();
   CORE_ADDR addr;
   struct breakpoint *b;
 
@@ -5249,7 +5249,7 @@ create_breakpoint (struct symtabs_and_lines sals, char *addr_string,
     {
       int i = hw_breakpoint_used_count ();
       int target_resources_ok = 
-       TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_hardware_breakpoint, 
+       target_can_use_hardware_watchpoint (bp_hardware_breakpoint, 
                                            i + 1, 0);
       if (target_resources_ok == 0)
        error (_("No hardware breakpoint support in the target."));
@@ -6170,7 +6170,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
     {
       i = hw_watchpoint_used_count (bp_type, &other_type_used);
       target_resources_ok = 
-       TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_type, i + mem_cnt, 
+       target_can_use_hardware_watchpoint (bp_type, i + mem_cnt, 
                                            other_type_used);
       if (target_resources_ok == 0 && bp_type != bp_hardware_watchpoint)
        error (_("Target does not support this type of hardware watchpoint."));
@@ -6308,7 +6308,7 @@ can_use_hardware_watchpoint (struct value *v)
                  CORE_ADDR vaddr = VALUE_ADDRESS (v) + value_offset (v);
                  int       len   = TYPE_LENGTH (value_type (v));
 
-                 if (!TARGET_REGION_OK_FOR_HW_WATCHPOINT (vaddr, len))
+                 if (!target_region_ok_for_hw_watchpoint (vaddr, len))
                    return 0;
                  else
                    found_memory_cnt++;
@@ -7977,7 +7977,7 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
       int i;
       i = hw_breakpoint_used_count ();
       target_resources_ok = 
-       TARGET_CAN_USE_HARDWARE_WATCHPOINT (bp_hardware_breakpoint, 
+       target_can_use_hardware_watchpoint (bp_hardware_breakpoint, 
                                            i + 1, 0);
       if (target_resources_ok == 0)
        error (_("No hardware breakpoint support in the target."));
index 1876a01bfef3e8f94257695229e02285277ff2b7..903f31c6a259f481ad49702e92ade51249fa2a8e 100644 (file)
@@ -2568,7 +2568,7 @@ targets should add new threads to the thread list themselves in non-stop mode.")
     {
       fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = 0x%s\n",
                           paddr_nz (stop_pc));
-      if (STOPPED_BY_WATCHPOINT (&ecs->ws))
+      if (target_stopped_by_watchpoint ())
        {
           CORE_ADDR addr;
          fprintf_unfiltered (gdb_stdlog, "infrun: stopped by watchpoint\n");
@@ -2824,7 +2824,7 @@ targets should add new threads to the thread list themselves in non-stop mode.")
   /* If necessary, step over this watchpoint.  We'll be back to display
      it in a moment.  */
   if (stopped_by_watchpoint
-      && (HAVE_STEPPABLE_WATCHPOINT
+      && (target_have_steppable_watchpoint
          || gdbarch_have_nonsteppable_watchpoint (current_gdbarch)))
     {
       /* At this point, we are stopped at an instruction which has
@@ -2849,14 +2849,14 @@ targets should add new threads to the thread list themselves in non-stop mode.")
         disable all watchpoints and breakpoints.  */
       int hw_step = 1;
 
-      if (!HAVE_STEPPABLE_WATCHPOINT)
+      if (!target_have_steppable_watchpoint)
        remove_breakpoints ();
        /* Single step */
       hw_step = maybe_software_singlestep (current_gdbarch, stop_pc);
       target_resume (ecs->ptid, hw_step, TARGET_SIGNAL_0);
       registers_changed ();
       waiton_ptid = ecs->ptid;
-      if (HAVE_STEPPABLE_WATCHPOINT)
+      if (target_have_steppable_watchpoint)
        infwait_state = infwait_step_watch_state;
       else
        infwait_state = infwait_nonstep_watch_state;
index fa1c7636606d5c18f3d55609f279b3bd378e426d..66793fd7fa0a0c5adeb1784571baf676b34404c4 100644 (file)
@@ -6005,11 +6005,11 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   else
     set_gdbarch_print_insn (gdbarch, gdb_print_insn_mips);
 
-  /* FIXME: cagney/2003-08-29: The macros HAVE_STEPPABLE_WATCHPOINT,
-     HAVE_NONSTEPPABLE_WATCHPOINT, and HAVE_CONTINUABLE_WATCHPOINT
+  /* FIXME: cagney/2003-08-29: The macros target_have_steppable_watchpoint,
+     HAVE_NONSTEPPABLE_WATCHPOINT, and target_have_continuable_watchpoint
      need to all be folded into the target vector.  Since they are
-     being used as guards for STOPPED_BY_WATCHPOINT, why not have
-     STOPPED_BY_WATCHPOINT return the type of watchpoint that the code
+     being used as guards for target_stopped_by_watchpoint, why not have
+     target_stopped_by_watchpoint return the type of watchpoint that the code
      is sitting on?  */
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
 
index e6f20d1154b7dcd8f9f9a1c695ad95ac1ee57c60..8bda43560ddf80736e416d51d6e8f24e9c9e89f8 100644 (file)
@@ -5289,7 +5289,7 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
 
    Note:  procfs_can_use_hw_breakpoint() is not yet used by all
    procfs.c targets due to the fact that some of them still define
-   TARGET_CAN_USE_HARDWARE_WATCHPOINT.  */
+   target_can_use_hardware_watchpoint.  */
 
 static int
 procfs_can_use_hw_breakpoint (int type, int cnt, int othertype)
@@ -5352,7 +5352,7 @@ procfs_stopped_by_watchpoint (void)
 static int
 procfs_insert_watchpoint (CORE_ADDR addr, int len, int type)
 {
-  if (!HAVE_STEPPABLE_WATCHPOINT
+  if (!target_have_steppable_watchpoint
       && !gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
     {
       /* When a hardware watchpoint fires off the PC will be left at
index 029cc089d720740c3bb3c97948fa4d992fe53694..7aedd3d8da6588fdff3e5281f9d694774c366f65 100644 (file)
@@ -1398,7 +1398,7 @@ m32r_stop (ptid_t ptid)
 
 /* Tell whether this target can support a hardware breakpoint.  CNT
    is the number of hardware breakpoints already installed.  This
-   implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro.  */
+   implements the target_can_use_hardware_watchpoint macro.  */
 
 static int
 m32r_can_use_hw_watchpoint (int type, int cnt, int othertype)
index 152fb379ac496c260828320cba10310d9a1765b9..23e845fd704e4b066c00b26b644097f51e9dbfd4 100644 (file)
@@ -2249,7 +2249,7 @@ mips_remove_breakpoint (struct bp_target_info *bp_tgt)
 
 /* Tell whether this target can support a hardware breakpoint.  CNT
    is the number of hardware breakpoints already installed.  This
-   implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro.  */
+   implements the target_can_use_hardware_watchpoint macro.  */
 
 int
 mips_can_use_watchpoint (int type, int cnt, int othertype)
index f7366f82d0f2ad7032fc62e45de1a079ed2f930d..d0df43083b798e4da51da377236b4e50035db9d0 100644 (file)
@@ -2889,7 +2889,7 @@ debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
   retval = debug_target.to_region_ok_for_hw_watchpoint (addr, len);
 
   fprintf_unfiltered (gdb_stdlog,
-                     "TARGET_REGION_OK_FOR_HW_WATCHPOINT (%ld, %ld) = 0x%lx\n",
+                     "target_region_ok_for_hw_watchpoint (%ld, %ld) = 0x%lx\n",
                      (unsigned long) addr,
                      (unsigned long) len,
                      (unsigned long) retval);
@@ -2904,7 +2904,7 @@ debug_to_stopped_by_watchpoint (void)
   retval = debug_target.to_stopped_by_watchpoint ();
 
   fprintf_unfiltered (gdb_stdlog,
-                     "STOPPED_BY_WATCHPOINT () = %ld\n",
+                     "target_stopped_by_watchpoint () = %ld\n",
                      (unsigned long) retval);
   return retval;
 }
index 5866b42fc606b0561c603c2e76eb28d472a4e7a9..b94149ab99f73b9a3a28c0b3934e130ca3371113 100644 (file)
@@ -1053,17 +1053,17 @@ extern char *normal_pid_to_str (ptid_t ptid);
 /* Returns non-zero if we were stopped by a hardware watchpoint (memory read or
    write).  */
 
-#define STOPPED_BY_WATCHPOINT(w) \
-   (*current_target.to_stopped_by_watchpoint) ()
+#define target_stopped_by_watchpoint \
+   (*current_target.to_stopped_by_watchpoint)
 
 /* Non-zero if we have steppable watchpoints  */
 
-#define HAVE_STEPPABLE_WATCHPOINT \
+#define target_have_steppable_watchpoint \
    (current_target.to_have_steppable_watchpoint)
 
 /* Non-zero if we have continuable watchpoints  */
 
-#define HAVE_CONTINUABLE_WATCHPOINT \
+#define target_have_continuable_watchpoint \
    (current_target.to_have_continuable_watchpoint)
 
 /* Provide defaults for hardware watchpoint functions.  */
@@ -1076,10 +1076,10 @@ extern char *normal_pid_to_str (ptid_t ptid);
    bp_hardware_breakpoint.  CNT is the number of such watchpoints used so far
    (including this one?).  OTHERTYPE is who knows what...  */
 
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE,CNT,OTHERTYPE) \
+#define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
  (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
 
-#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr, len) \
+#define target_region_ok_for_hw_watchpoint(addr, len) \
     (*current_target.to_region_ok_for_hw_watchpoint) (addr, len)