From: Drasko DRASKOVIC Date: Mon, 4 Jul 2011 10:55:00 +0000 (+0200) Subject: mips_m4k and arm7_9 : Fix soft bkpt endianess for 16-bit instructions X-Git-Tag: v0.5.0~26 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=ac43d7a69fca52df1ad287b51c44013653ad2f61 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. --- diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 611d5d4acc..6287891bb3 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 b84783b1ab..822d0c8541 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,