From ac43d7a69fca52df1ad287b51c44013653ad2f61 Mon Sep 17 00:00:00 2001 From: Drasko DRASKOVIC Date: Mon, 4 Jul 2011 12:55:00 +0200 Subject: [PATCH] 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. --- src/target/arm7_9_common.c | 1 + src/target/mips_m4k.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 611d5d4a..6287891b 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 b84783b1..822d0c85 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, -- 2.39.5