aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/gdb_server.c8
-rw-r--r--src/target/target.c6
-rw-r--r--src/target/target.h12
3 files changed, 21 insertions, 5 deletions
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index c012738..4a6bc03 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -947,7 +947,7 @@ int gdb_get_registers_packet(connection_t *connection, target_t *target, char* p
LOG_DEBUG("-");
#endif
- if ((retval = target->type->get_gdb_reg_list(target, &reg_list, &reg_list_size)) != ERROR_OK)
+ if ((retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size)) != ERROR_OK)
{
return gdb_error(connection, retval);
}
@@ -1005,7 +1005,7 @@ int gdb_set_registers_packet(connection_t *connection, target_t *target, char *p
return ERROR_SERVER_REMOTE_CLOSED;
}
- if ((retval = target->type->get_gdb_reg_list(target, &reg_list, &reg_list_size)) != ERROR_OK)
+ if ((retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size)) != ERROR_OK)
{
return gdb_error(connection, retval);
}
@@ -1057,7 +1057,7 @@ int gdb_get_register_packet(connection_t *connection, target_t *target, char *pa
LOG_DEBUG("-");
#endif
- if ((retval = target->type->get_gdb_reg_list(target, &reg_list, &reg_list_size)) != ERROR_OK)
+ if ((retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size)) != ERROR_OK)
{
return gdb_error(connection, retval);
}
@@ -1092,7 +1092,7 @@ int gdb_set_register_packet(connection_t *connection, target_t *target, char *pa
LOG_DEBUG("-");
- if ((retval = target->type->get_gdb_reg_list(target, &reg_list, &reg_list_size)) != ERROR_OK)
+ if ((retval = target_get_gdb_reg_list(target, &reg_list, &reg_list_size)) != ERROR_OK)
{
return gdb_error(connection, retval);
}
diff --git a/src/target/target.c b/src/target/target.c
index 4a60cc4..7a4548c 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -543,6 +543,12 @@ int target_bulk_write_memory(struct target_s *target,
}
+int target_get_gdb_reg_list(struct target_s *target,
+ struct reg_s **reg_list[], int *reg_list_size)
+{
+ return target->type->get_gdb_reg_list(target, reg_list, reg_list_size);
+}
+
int target_run_algorithm(struct target_s *target,
int num_mem_params, mem_param_t *mem_params,
int num_reg_params, reg_param_t *reg_param,
diff --git a/src/target/target.h b/src/target/target.h
index 9674c47..1b28893 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -151,7 +151,9 @@ typedef struct target_type_s
int (*soft_reset_halt_imp)(struct target_s *target);
int (*soft_reset_halt)(struct target_s *target);
- /* target register access for gdb.
+ /**
+ * Target register access for GDB. Do @b not call this function
+ * directly, use target_get_gdb_reg_list() instead.
*
* Danger! this function will succeed even if the target is running
* and return a register list with dummy values.
@@ -401,6 +403,14 @@ extern void target_set_examined(struct target_s *target);
extern void target_reset_examined(struct target_s *target);
/**
+ * Obtain the registers for GDB.
+ *
+ * This routine is a wrapper for target->type->get_gdb_reg_list.
+ */
+extern int target_get_gdb_reg_list(struct target_s *target,
+ struct reg_s **reg_list[], int *reg_list_size);
+
+/**
* Run an algorithm on the @a target given.
*
* This routine is a wrapper for target->type->run_algorithm.