nds32: report any one of hit read watchpoints 76/1576/7
authorHsiangkai Wang <hsiangkai@gmail.com>
Tue, 18 Jun 2013 08:37:21 +0000 (16:37 +0800)
committerSpencer Oliver <spen@spen-soft.co.uk>
Fri, 13 Sep 2013 19:37:40 +0000 (19:37 +0000)
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>
src/target/nds32_v3_common.c

index b524679e286e2eae1c4fdc8e90e21cff86360fb6..e88430f2b93e69413ff969af0fbd170379c8933b 100644 (file)
@@ -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 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);
 
        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 (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;
+                       }
                }
        }
 
                }
        }
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)