diff options
author | Salvador <sarroyofdez@yahoo.es> | 2012-03-17 09:25:23 +0100 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2012-03-30 15:50:55 +0000 |
commit | 1274df07f128e97cc75f68b24303ebcfe440ddde (patch) | |
tree | f960f3226723a0a761a1a24c35790f2c179df031 /src | |
parent | f1c0133321c8fcadadd10bba5537c0a634eb183b (diff) | |
download | riscv-openocd-1274df07f128e97cc75f68b24303ebcfe440ddde.zip riscv-openocd-1274df07f128e97cc75f68b24303ebcfe440ddde.tar.gz riscv-openocd-1274df07f128e97cc75f68b24303ebcfe440ddde.tar.bz2 |
Bug in src/target/mips32_pracc.c
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/mips32_pracc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c index 267a4ff..0cada4f 100644 --- a/src/target/mips32_pracc.c +++ b/src/target/mips32_pracc.c @@ -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; |