aboutsummaryrefslogtreecommitdiff
path: root/src/server/gdb_server.h
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/server/gdb_server.h
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/server/gdb_server.h')
-rw-r--r--src/server/gdb_server.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/gdb_server.h b/src/server/gdb_server.h
index e27aad7..4288ceb 100644
--- a/src/server/gdb_server.h
+++ b/src/server/gdb_server.h
@@ -20,6 +20,7 @@
struct image;
struct reg;
#include <target/target.h>
+#include <server/server.h>
#define GDB_BUFFER_SIZE 16384
@@ -29,6 +30,8 @@ void gdb_service_free(void);
int gdb_put_packet(struct connection *connection, char *buffer, int len);
+int gdb_get_actual_connections(void);
+
static inline struct target *get_target_from_connection(struct connection *connection)
{
struct gdb_service *gdb_service = connection->service->priv;