Author: Nicolas Pitre <nico@cam.org>
authorkc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 27 May 2009 20:30:17 +0000 (20:30 +0000)
committerkc8apf <kc8apf@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 27 May 2009 20:30:17 +0000 (20:30 +0000)
- Silence errors about keep_alive() not being called frequently enough unless
a gdb session is active or debugging is enabled

git-svn-id: svn://svn.berlios.de/openocd/trunk@1933 b42882b7-edfa-0310-969c-e2dbd0fdcd60

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

index 4ba0dd6a77d9116ee969b982b0cb6f1c2f6f2dbe..549d71279d9a8f38b226f39ff796920f545a21dc 100644 (file)
@@ -385,7 +385,19 @@ void keep_alive()
        current_time=timeval_ms();
        if (current_time-last_time>1000)
        {
-               LOG_WARNING("keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (%lld). Workaround: increase \"set remotetimeout\" in GDB", current_time-last_time);
+               extern int gdb_actual_connections;
+
+               if (gdb_actual_connections)
+                       LOG_WARNING("keep_alive() was not invoked in the "
+                               "1000ms timelimit. GDB alive packet not "
+                               "sent! (%lld). Workaround: increase "
+                               "\"set remotetimeout\" in GDB",
+                               current_time-last_time);
+               else
+                       LOG_DEBUG("keep_alive() was not invoked in the "
+                               "1000ms timelimit (%lld). This may cause "
+                               "trouble with GDB connections.",
+                               current_time-last_time);
        }
        if (current_time-last_time>500)
        {
index f4e9c326988c5db5b049fa1759a51b367c9c494d..c012738808b14182f35e5a25e39fa04062c62135 100644 (file)
@@ -61,6 +61,10 @@ enum gdb_detach_mode
 /* target behaviour on gdb detach */
 enum gdb_detach_mode detach_mode = GDB_DETACH_RESUME;
 
+/* number of gdb connections, mainly to supress gdb related debugging spam
+ * in helper/log.c when no gdb connections are actually active */
+int gdb_actual_connections;
+
 /* set if we are sending a memory map to gdb
  * via qXfer:memory-map:read packet */
 /* enabled by default*/
@@ -797,6 +801,9 @@ int gdb_new_connection(connection_t *connection)
        if (initial_ack != '+')
                gdb_putback_char(connection, initial_ack);
        target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_ATTACH );
+
+       gdb_actual_connections++;
+
        return ERROR_OK;
 }
 
@@ -805,6 +812,8 @@ int gdb_connection_closed(connection_t *connection)
        gdb_service_t *gdb_service = connection->service->priv;
        gdb_connection_t *gdb_connection = connection->priv;
 
+       gdb_actual_connections--;
+
        /* see if an image built with vFlash commands is left */
        if (gdb_connection->vflash_image)
        {

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)