Fixed GDB timeout crash - regression introduced back when log_add/remove_callback...
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 4 Mar 2008 13:13:55 +0000 (13:13 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 4 Mar 2008 13:13:55 +0000 (13:13 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@442 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/helper/log.c
src/server/gdb_server.c
src/target/target.c

index cdd7b7bfe512d2f82efd4860871fca1adebfa5bf..b38987232eb290b06533bf03d367c0eb07a7e6ed 100644 (file)
@@ -60,8 +60,6 @@ static int count = 0;
  */
 static void log_puts(enum log_levels level, const char *file, int line, const char *function, const char *string)
 {
-       log_callback_t *cb;
-
        if (level == LOG_OUTPUT)
        {
                /* do not prepend any headers, just print out what we were given and return */
@@ -98,10 +96,14 @@ static void log_puts(enum log_levels level, const char *file, int line, const ch
        /* Never forward LOG_DEBUG, too verbose and they can be found in the log if need be */
        if (level <= LOG_INFO)
        {
-               log_callback_t *cb;
-               for (cb = log_callbacks; cb; cb = cb->next)
+               log_callback_t *cb, *next;
+               cb = log_callbacks;
+               /* DANGER!!!! the log callback can remove itself!!!! */
+               while (cb)
                {
+                       next=cb->next;
                        cb->fn(cb->priv, file, line, function, string);
+                       cb=next;
                }
        }
 }
index 9558aef9484662c3cb9c37c22bc9315271b937ef..74722e108e99b13a5875d2d6f237544f8ed6a2e5 100644 (file)
@@ -529,7 +529,7 @@ int gdb_output_con(connection_t *connection, const char* line)
 int gdb_output(struct command_context_s *context, char* line)
 {
        /* this will be dumped to the log and also sent as an O packet if possible */
-       USER_N(line);
+       USER_N("%s", line);
        return ERROR_OK;
 }
 
index 377bb0dc07dbd9f9c9ea4dd19cdc8787778fd46d..76f7449bde62083f91383613ab4fbd00ec3977f0 100644 (file)
@@ -1698,8 +1698,6 @@ int handle_resume_command(struct command_context_s *cmd_ctx, char *cmd, char **a
 
        target_process_events(cmd_ctx);
        
-       target_arch_state(target);
-       
        return retval;
 }
 

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)