* 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-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
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;
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;
{
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."));
{
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."));
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++;
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."));
{
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");
/* 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
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;
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);
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)
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
/* 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)
/* 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)
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);
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;
}
/* 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. */
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)