diff options
author | Drasko DRASKOVIC <drasko.draskovic@gmail.com> | 2011-07-04 12:55:00 +0200 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2011-07-04 18:15:18 +0200 |
commit | ac43d7a69fca52df1ad287b51c44013653ad2f61 (patch) | |
tree | 58fd0de0ae768bd45153bdd1f030ff613a3d839e | |
parent | d4cd6f032015552f00bf4b5a90f25f5f958e9d9e (diff) | |
download | riscv-openocd-ac43d7a69fca52df1ad287b51c44013653ad2f61.zip riscv-openocd-ac43d7a69fca52df1ad287b51c44013653ad2f61.tar.gz riscv-openocd-ac43d7a69fca52df1ad287b51c44013653ad2f61.tar.bz2 |
mips_m4k and arm7_9 : Fix soft bkpt endianess for 16-bit instructions
The patch fix comparison of target data on the host by using
target_buffer_get_u16() to transform current_instr to
_host_ endianess before comparison.
-rw-r--r-- | src/target/arm7_9_common.c | 1 | ||||
-rw-r--r-- | src/target/mips_m4k.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 611d5d4..6287891 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -392,6 +392,7 @@ static int arm7_9_unset_breakpoint(struct target *target, struct breakpoint *bre { return retval; } + current_instr = target_buffer_get_u16(target, (uint8_t *)¤t_instr); if (current_instr == arm7_9->thumb_bkpt) if ((retval = target_write_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr)) != ERROR_OK) { diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index b84783b..822d0c8 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -643,7 +643,7 @@ static int mips_m4k_unset_breakpoint(struct target *target, { return retval; } - + current_instr = target_buffer_get_u16(target, (uint8_t *)¤t_instr); if (current_instr == MIPS16_SDBBP) { if ((retval = target_write_memory(target, breakpoint->address, 2, 1, |