From: Øyvind H. <go...@us...> - 2011-07-02 00:14:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via bad3ee87ac170150a9a8a72c731aa631a1ad8cf5 (commit) from f6026a8295faf158e500a7acb9884f9fd4c30ad1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bad3ee87ac170150a9a8a72c731aa631a1ad8cf5 Author: Drasko DRASKOVIC <dra...@gm...> Date: Fri Jul 1 21:12:54 2011 +0200 mips_m4k : Fix soft breakpoint endianess handling In order to compare data read from the target with some marcros or data defined on the host, we must transform this read data from target endianess to host endianess. target_read_memory() gets bytes from target to the host, but keeps them in _target_ endianess. This is OK if we just want to temporary keep this data on the host, like keeping breakpoint->orig_instr. But if we want to use this data for any ispections and comparisons on the host side, we must transform it to _host_ endianess, by using target_buffer_get_u32() function. Currently this transformation is missing, and check current_instr == MIPS32_SDBBP will never pass if target and host endianess differ, because current_instr will be kept in _target_ endianess and MIPS32_SDBBP will be kept in _host_ endianess, The patch fix this issue by using target_buffer_get_u32() to transform current_instr to _host_ endianess before comparison. diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index 9b4e1a4..b84783b 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -616,6 +616,14 @@ static int mips_m4k_unset_breakpoint(struct target *target, { return retval; } + + /** + * target_read_memory() gets us data in _target_ endianess. + * If we want to use this data on the host for comparisons with some macros + * we must first transform it to _host_ endianess using target_buffer_get_u32(). + */ + current_instr = target_buffer_get_u32(target, (uint8_t *)¤t_instr); + if (current_instr == MIPS32_SDBBP) { if ((retval = target_write_memory(target, breakpoint->address, 4, 1, ----------------------------------------------------------------------- Summary of changes: src/target/mips_m4k.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |