aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2009-12-05 01:01:55 -0500
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-04 23:07:10 -0800
commitec8c3b5a678f3f236c3b574975eff6434e0aab60 (patch)
tree28035f4937155f108c455e22ba8b9eb9c30d40f0
parente8599cc3d81c659c3b8fdf65177006689865d4f4 (diff)
downloadriscv-openocd-ec8c3b5a678f3f236c3b574975eff6434e0aab60.zip
riscv-openocd-ec8c3b5a678f3f236c3b574975eff6434e0aab60.tar.gz
riscv-openocd-ec8c3b5a678f3f236c3b574975eff6434e0aab60.tar.bz2
ARM semihosting: use breakpoint on ARM7
Fall back to software breakpoint when vector catch isn't available. Possible enhancements: - add extra optional command parameter to select high vectors - add extra optional command parameter to select hardware breakpoint Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
-rw-r--r--src/target/arm7_9_common.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index 25f8cb3..905e108 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -2835,7 +2835,6 @@ COMMAND_HANDLER(handle_arm7_9_semihosting_command)
COMMAND_PARSE_ENABLE(CMD_ARGV[0], semihosting);
- /* TODO: support other methods if vector catch is unavailable */
if (arm7_9->has_vector_catch) {
struct reg *vector_catch = &arm7_9->eice_cache
->reg_list[EICE_VEC_CATCH];
@@ -2844,14 +2843,17 @@ COMMAND_HANDLER(handle_arm7_9_semihosting_command)
embeddedice_read_reg(vector_catch);
buf_set_u32(vector_catch->value, 2, 1, semihosting);
embeddedice_store_reg(vector_catch);
+ } else {
+ /* TODO: allow optional high vectors and/or BKPT_HARD */
+ if (semihosting)
+ breakpoint_add(target, 8, 4, BKPT_SOFT);
+ else
+ breakpoint_remove(target, 8);
+ }
- /* FIXME never let that "catch" be dropped! */
-
- arm7_9->armv4_5_common.is_semihosting = semihosting;
+ /* FIXME never let that "catch" be dropped! */
+ arm7_9->armv4_5_common.is_semihosting = semihosting;
- } else if (semihosting) {
- command_print(CMD_CTX, "vector catch unavailable");
- }
}
command_print(CMD_CTX, "semihosting is %s",