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.
This commit is contained in:
Pierre Muller
2009-05-11 11:13:09 +00:00
parent 77ae44b0d3
commit d92524f1ee
9 changed files with 57 additions and 26 deletions

View 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;