added global gdb breakpoint override configuration command
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 13 Aug 2008 20:42:07 +0000 (20:42 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 13 Aug 2008 20:42:07 +0000 (20:42 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@914 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/server/gdb_server.c

index 3f346584efa724125b1a3e4ed3e2d321220101ed..7be05acf34110ef4f886c0a19988eb4d9eb58de9 100644 (file)
@@ -46,6 +46,9 @@
 #define _DEBUG_GDB_IO_
 #endif
 
+static int gdb_breakpoint_override;
+static enum breakpoint_type gdb_breakpoint_override_type;
+
 extern int gdb_error(connection_t *connection, int retval);
 static unsigned short gdb_port;
 static const char *DIGITS = "0123456789abcdef";
@@ -1277,6 +1280,11 @@ int gdb_breakpoint_watchpoint_packet(connection_t *connection, target_t *target,
                wp_type = WPT_READ;
        else if (type == 4) /* access watchpoint */
                wp_type = WPT_ACCESS;
+       
+       if (gdb_breakpoint_override&&((bp_type==BKPT_SOFT)||(bp_type==BKPT_SOFT)))
+       {
+               bp_type=gdb_breakpoint_override_type;
+       }
 
        if (*separator != ',')
        {
@@ -2169,6 +2177,41 @@ int handle_gdb_report_data_abort_command(struct command_context_s *cmd_ctx, char
        return ERROR_OK;
 }
 
+/* daemon configuration command gdb_port */
+int handle_gdb_breakpoint_override_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+{
+       if (argc == 0)
+       {
+               
+       } else if (argc==1)
+       {
+               gdb_breakpoint_override = 1;
+               if (strcmp(args[0], "hard")==0)
+               {
+                       gdb_breakpoint_override_type=BKPT_HARD;
+               } else if (strcmp(args[0], "soft")==0)
+               {
+                       gdb_breakpoint_override_type=BKPT_SOFT;
+               } else if (strcmp(args[0], "disable") == 0)
+               {
+                       gdb_breakpoint_override = 0;
+               }
+       } else
+       {
+               return ERROR_COMMAND_SYNTAX_ERROR;
+       }
+       if (gdb_breakpoint_override)
+       {
+               LOG_USER("force %s breakpoints", (gdb_breakpoint_override_type==BKPT_HARD)?"hard":"soft");
+       } else
+       {
+               LOG_USER("breakpoint type is not overriden");
+       }
+       
+       return ERROR_OK;
+}
+
+
 int gdb_register_commands(command_context_t *command_context)
 {
        register_command(command_context, NULL, "gdb_port", handle_gdb_port_command,
@@ -2181,5 +2224,10 @@ int gdb_register_commands(command_context_t *command_context)
                        COMMAND_CONFIG, "");
        register_command(command_context, NULL, "gdb_report_data_abort", handle_gdb_report_data_abort_command,
                        COMMAND_CONFIG, "");
+       register_command(command_context, NULL, "gdb_breakpoint_override", handle_gdb_breakpoint_override_command,
+                       COMMAND_EXEC, "hard/soft/disabled - force breakpoint type for gdb 'break' commands."
+                       "The raison d'etre for this option is to support GDB GUI's without "
+                       "a hard/soft breakpoint concept where the default OpenOCD behaviour "
+                       "is not sufficient");
        return ERROR_OK;
 }

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)