target/cortex_m: simplify cortex_m_unset_breakpoint()
Cortex-M uses only 2 byte breakpoint instruction. cortex_m_unset_breakpoint() does not need to check breakpoint->length, use the length as the size argument in target_write_memory() Change-Id: I20bb869f6abce2fc61f0469e34a638bc4dc6f7ce Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4889 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Jānis Skujenieks <janis.skujenieks@gmail.com> Reviewed-by: Christopher Head <chead@zaber.com>reverse-resume-order
parent
a7479fa89d
commit
16432e681e
|
@ -1260,17 +1260,11 @@ int cortex_m_unset_breakpoint(struct target *target, struct breakpoint *breakpoi
|
|||
comparator_list[fp_num].fpcr_value);
|
||||
} else {
|
||||
/* restore original instruction (kept in target endianness) */
|
||||
if (breakpoint->length == 4) {
|
||||
retval = target_write_memory(target, breakpoint->address & 0xFFFFFFFE, 4, 1,
|
||||
retval = target_write_memory(target, breakpoint->address & 0xFFFFFFFE,
|
||||
breakpoint->length, 1,
|
||||
breakpoint->orig_instr);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
} else {
|
||||
retval = target_write_memory(target, breakpoint->address & 0xFFFFFFFE, 2, 1,
|
||||
breakpoint->orig_instr);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
breakpoint->set = false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue