aboutsummaryrefslogtreecommitdiff
path: root/src/helper/log.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2023-05-06 21:59:31 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2023-05-18 10:14:56 +0000
commitd5c177cd3def7002f18270742ff3b1380feb45c5 (patch)
treef6d0992868ad7048de749bda1bc6cd88cc232a0a /src/helper/log.c
parent7fa29dc5196accb3ea159e6a29fd969640e30421 (diff)
downloadriscv-openocd-d5c177cd3def7002f18270742ff3b1380feb45c5.zip
riscv-openocd-d5c177cd3def7002f18270742ff3b1380feb45c5.tar.gz
riscv-openocd-d5c177cd3def7002f18270742ff3b1380feb45c5.tar.bz2
server: gdb: export gdb_actual_connections through a function
The internal variable 'gdb_actual_connections' is used by log and by semihosting to determine if there are active GDB connections. Keep the variable local in server's code and only export its value through a dedicated function. This solves the issue detected by 'parse' of the variable defined as global but not declared in any include file. Change-Id: I6e14f4cb1097787404094636f8a2a291340222dd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7673 Tested-by: jenkins
Diffstat (limited to 'src/helper/log.c')
-rw-r--r--src/helper/log.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/helper/log.c b/src/helper/log.c
index e6a70a3..a4fc53d 100644
--- a/src/helper/log.c
+++ b/src/helper/log.c
@@ -19,6 +19,7 @@
#include "command.h"
#include "replacements.h"
#include "time_support.h"
+#include <server/gdb_server.h>
#include <server/server.h>
#include <stdarg.h>
@@ -399,9 +400,7 @@ char *alloc_printf(const char *format, ...)
static void gdb_timeout_warning(int64_t delta_time)
{
- extern int gdb_actual_connections;
-
- if (gdb_actual_connections)
+ if (gdb_get_actual_connections())
LOG_WARNING("keep_alive() was not invoked in the "
"%d ms timelimit. GDB alive packet not "
"sent! (%" PRId64 " ms). Workaround: increase "