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
This commit is contained in:
Antonio Borneo
2023-05-06 21:59:31 +02:00
parent 7fa29dc519
commit d5c177cd3d
4 changed files with 17 additions and 12 deletions

View File

@@ -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;