cortexm: fixed an issue with watchpoint handling and a register sanity check
This commit is contained in:
parent
08956eb4fb
commit
54790f032e
@ -502,7 +502,7 @@ bool cortexm_attach(target *t)
|
|||||||
priv->flash_patch_revision = (r >> 28);
|
priv->flash_patch_revision = (r >> 28);
|
||||||
priv->hw_watchpoint_max = CORTEXM_MAX_WATCHPOINTS;
|
priv->hw_watchpoint_max = CORTEXM_MAX_WATCHPOINTS;
|
||||||
r = target_mem_read32(t, CORTEXM_DWT_CTRL);
|
r = target_mem_read32(t, CORTEXM_DWT_CTRL);
|
||||||
if ((r >> 28) > priv->hw_watchpoint_max)
|
if ((r >> 28) < priv->hw_watchpoint_max)
|
||||||
priv->hw_watchpoint_max = r >> 28;
|
priv->hw_watchpoint_max = r >> 28;
|
||||||
|
|
||||||
/* Clear any stale breakpoints */
|
/* Clear any stale breakpoints */
|
||||||
@ -675,7 +675,7 @@ static int dcrsr_regnum(target *t, unsigned reg)
|
|||||||
return regnum_cortex_m[reg];
|
return regnum_cortex_m[reg];
|
||||||
} else if ((t->target_options & TOPT_FLAVOUR_V7MF) &&
|
} else if ((t->target_options & TOPT_FLAVOUR_V7MF) &&
|
||||||
(reg < (sizeof(regnum_cortex_m) +
|
(reg < (sizeof(regnum_cortex_m) +
|
||||||
sizeof(regnum_cortex_mf) / 4))) {
|
sizeof(regnum_cortex_mf)) / 4)) {
|
||||||
return regnum_cortex_mf[reg - sizeof(regnum_cortex_m)/4];
|
return regnum_cortex_mf[reg - sizeof(regnum_cortex_m)/4];
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user