ARM: core DPM support for watchpoints

This is a NOP unless the underlying core exposes two new methods, and
neither of the two cores using this (ARM11xx, Cortex-A8) do so yet.

This patch only updates those cores so they pass a flag saying whether
or not to update breakpoint and watchpoint status before resuming; and
removing some now-needless anti-segfault code from ARM11.  Cortex-A8
didn't have that code ... yes, it segfaulted when setting watchpoints.

NOTE:  this uses a slightly different strategy for setting/clearing
breakpoints than the ARM7/ARM9/etc code uses.  It leaves them alone
unless it's *got* to change something, to speed halt/resume cycles
(including single stepping).

ALSO NOTE:  this under-delivers for Cortex-A8, where regions with size
up to 2 GBytes can be watched ... it handles watchpoints which ARM11 can
also handle (size 1/2/4 bytes).  Should get fixed later.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
This commit is contained in:
David Brownell
2009-12-01 21:47:45 -08:00
parent 1c7d3d200c
commit 66ca84b581
4 changed files with 301 additions and 40 deletions

View File

@@ -41,7 +41,7 @@
static int cortex_a8_poll(struct target *target);
static int cortex_a8_debug_entry(struct target *target);
static int cortex_a8_restore_context(struct target *target);
static int cortex_a8_restore_context(struct target *target, bool bpwp);
static int cortex_a8_set_breakpoint(struct target *target,
struct breakpoint *breakpoint, uint8_t matchmode);
static int cortex_a8_unset_breakpoint(struct target *target,
@@ -602,11 +602,7 @@ static int cortex_a8_resume(struct target *target, int current,
dap_ap_select(swjdp, swjdp_debugap);
if (!debug_execution)
{
target_free_all_working_areas(target);
// cortex_m3_enable_breakpoints(target);
// cortex_m3_enable_watchpoints(target);
}
#if 0
if (debug_execution)
@@ -661,7 +657,7 @@ static int cortex_a8_resume(struct target *target, int current,
armv4_5->core_cache->reg_list[15].dirty = 1;
armv4_5->core_cache->reg_list[15].valid = 1;
cortex_a8_restore_context(target);
cortex_a8_restore_context(target, handle_breakpoints);
#if 0
/* the front-end may request us not to handle breakpoints */
@@ -952,7 +948,7 @@ static int cortex_a8_step(struct target *target, int current, uint32_t address,
return ERROR_OK;
}
static int cortex_a8_restore_context(struct target *target)
static int cortex_a8_restore_context(struct target *target, bool bpwp)
{
struct armv7a_common *armv7a = target_to_armv7a(target);
@@ -961,7 +957,7 @@ static int cortex_a8_restore_context(struct target *target)
if (armv7a->pre_restore_context)
armv7a->pre_restore_context(target);
arm_dpm_write_dirty_registers(&armv7a->dpm);
arm_dpm_write_dirty_registers(&armv7a->dpm, bpwp);
if (armv7a->post_restore_context)
armv7a->post_restore_context(target);