Commit 16432e68 authored by Tomas Vanek's avatar Tomas Vanek Committed by Matthias Welwarsky
Browse files

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: default avatarTomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4889


Tested-by: jenkins
Reviewed-by: default avatarMatthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: default avatarJānis Skujenieks <janis.skujenieks@gmail.com>
Reviewed-by: default avatarChristopher Head <chead@zaber.com>
parent a7479fa8
......@@ -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;
}
if (retval != ERROR_OK)
return retval;
}
breakpoint->set = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment