ARM semihosting: use breakpoint on ARM7
authorNicolas Pitre <nico@fluxnic.net>
Sat, 5 Dec 2009 06:01:55 +0000 (01:01 -0500)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Sat, 5 Dec 2009 07:07:10 +0000 (23:07 -0800)
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>
src/target/arm7_9_common.c

index 25f8cb3206e8616c76f539bfffb6ba86026aa789..905e1082c2b88d1b2a802500fc97ab5726ef488f 100644 (file)
@@ -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",

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)