diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2023-05-06 21:59:31 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-05-18 10:14:56 +0000 |
commit | d5c177cd3def7002f18270742ff3b1380feb45c5 (patch) | |
tree | f6d0992868ad7048de749bda1bc6cd88cc232a0a /src/helper/log.c | |
parent | 7fa29dc5196accb3ea159e6a29fd969640e30421 (diff) | |
download | riscv-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.c | 5 |
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 " |