Bug in src/target/mips32_pracc.c
authorSalvador <sarroyofdez@yahoo.es>
Sat, 17 Mar 2012 08:25:23 +0000 (09:25 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Fri, 30 Mar 2012 15:50:55 +0000 (15:50 +0000)
The bug shows up with the command "mdw addres count" and only if count>1024 (count>0x400).
The first 1024 values shows as expected, but the rest of the values  are wrong.
Name of variable  bytesread" is changed to "wordsread" to reflect what really does.

Change-Id: Iad79393e72da2637551c5ae6e829e3873605c520
Signed-off-by: Salvador <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/527
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/target/mips32_pracc.c

index 267a4ffd94c89c24a263ffe17854263daf44a4e4..0cada4fa4962545f2f9c7b6c10594f712c809a0c 100644 (file)
@@ -343,10 +343,10 @@ static int mips32_pracc_read_mem32(struct mips_ejtag *ejtag_info, uint32_t addr,
 
        int retval = ERROR_OK;
        int blocksize;
-       int bytesread;
+       int wordsread;
        uint32_t param_in[2];
 
-       bytesread = 0;
+       wordsread = 0;
 
        while (count > 0) {
                blocksize = count;
@@ -357,13 +357,13 @@ static int mips32_pracc_read_mem32(struct mips_ejtag *ejtag_info, uint32_t addr,
                param_in[1] = blocksize;
 
                retval = mips32_pracc_exec(ejtag_info, ARRAY_SIZE(code), code,
-                               ARRAY_SIZE(param_in), param_in, blocksize, &buf[bytesread], 1);
+                               ARRAY_SIZE(param_in), param_in, blocksize, &buf[wordsread], 1);
                if (retval != ERROR_OK)
                        return retval;
 
                count -= blocksize;
-               addr += blocksize;
-               bytesread += blocksize;
+               addr += blocksize*sizeof(uint32_t);
+               wordsread += blocksize;
        }
 
        return retval;

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)