]> git.sur5r.net Git - openocd/commitdiff
mips_m4k and arm7_9 : Fix soft bkpt endianess for 16-bit instructions
authorDrasko DRASKOVIC <drasko.draskovic@gmail.com>
Mon, 4 Jul 2011 10:55:00 +0000 (12:55 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 4 Jul 2011 16:15:18 +0000 (18:15 +0200)
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
src/target/mips_m4k.c

index 611d5d4acc002ed2f2bd3a7213b74f501c6d71d9..6287891bb3437a336e88b222fd804ba1a6340d81 100644 (file)
@@ -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 *)&current_instr);
                        if (current_instr == arm7_9->thumb_bkpt)
                                if ((retval = target_write_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr)) != ERROR_OK)
                                {
index b84783b1ab0c2113c6b21fc220d53fe0405ed86e..822d0c8541831d5ab5bd58c6b9ca71819809c377 100644 (file)
@@ -643,7 +643,7 @@ static int mips_m4k_unset_breakpoint(struct target *target,
                        {
                                return retval;
                        }
-
+                       current_instr = target_buffer_get_u16(target, (uint8_t *)&current_instr);
                        if (current_instr == MIPS16_SDBBP)
                        {
                                if ((retval = target_write_memory(target, breakpoint->address, 2, 1,