aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsiangkai Wang <hsiangkai@gmail.com>2013-06-18 16:37:21 +0800
committerSpencer Oliver <spen@spen-soft.co.uk>2013-09-13 19:37:40 +0000
commita8d0fec087b18d44a05124e48fa9f2ef111d3e8a (patch)
tree3ac8a22c29ddfe9b05e7e18e6a1ee568bfa1330e
parent6b9c491257dead736b4fd35c21b50f3cf3d2807d (diff)
downloadriscv-openocd-a8d0fec087b18d44a05124e48fa9f2ef111d3e8a.zip
riscv-openocd-a8d0fec087b18d44a05124e48fa9f2ef111d3e8a.tar.gz
riscv-openocd-a8d0fec087b18d44a05124e48fa9f2ef111d3e8a.tar.bz2
nds32: report any one of hit read watchpoints
If multiple read watchpoints are hit at the same time, report any one of these hit watchpoints. Change-Id: I8d4439aa80e4b62bb7d48bbdc0450920e2008a2e Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com> Reviewed-on: http://openocd.zylin.com/1576 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
-rw-r--r--src/target/nds32_v3_common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/target/nds32_v3_common.c b/src/target/nds32_v3_common.c
index b524679..e88430f 100644
--- a/src/target/nds32_v3_common.c
+++ b/src/target/nds32_v3_common.c
@@ -240,6 +240,7 @@ static int nds32_v3_get_exception_address(struct nds32 *nds32,
uint32_t match_count;
int32_t i;
static int32_t number_of_hard_break;
+ uint32_t bp_control;
if (number_of_hard_break == 0) {
aice_read_debug_reg(aice, NDS_EDM_SR_EDM_CFG, &edm_cfg);
@@ -255,6 +256,14 @@ static int nds32_v3_get_exception_address(struct nds32 *nds32,
if (match_bits & (1 << i)) {
aice_read_debug_reg(aice, NDS_EDM_SR_BPA0 + i, address);
match_count++;
+
+ /* If target hits multiple read/access watchpoint,
+ * select the first one. */
+ aice_read_debug_reg(aice, NDS_EDM_SR_BPC0 + i, &bp_control);
+ if (0x3 == (bp_control & 0x3)) {
+ match_count = 1;
+ break;
+ }
}
}