|
From: kc8apf at B. <kc...@ma...> - 2009-05-27 22:30:21
|
Author: kc8apf
Date: 2009-05-27 22:30:17 +0200 (Wed, 27 May 2009)
New Revision: 1933
Modified:
trunk/src/helper/log.c
trunk/src/server/gdb_server.c
Log:
Author: Nicolas Pitre <ni...@ca...>
- Silence errors about keep_alive() not being called frequently enough unless
a gdb session is active or debugging is enabled
Modified: trunk/src/helper/log.c
===================================================================
--- trunk/src/helper/log.c 2009-05-27 15:15:06 UTC (rev 1932)
+++ trunk/src/helper/log.c 2009-05-27 20:30:17 UTC (rev 1933)
@@ -385,7 +385,19 @@
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)
{
Modified: trunk/src/server/gdb_server.c
===================================================================
--- trunk/src/server/gdb_server.c 2009-05-27 15:15:06 UTC (rev 1932)
+++ trunk/src/server/gdb_server.c 2009-05-27 20:30:17 UTC (rev 1933)
@@ -61,6 +61,10 @@
/* 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 @@
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 @@
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)
{
|