The C style guide forbids typedef'd structs, see 'Naming Rules'.
Change-Id: Ia7c8218fb61ff0c74b6dd0d10fb51a77cf059c14
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6028
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
static int FreeRTOS_update_threads(struct rtos *rtos);
static int FreeRTOS_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
struct rtos_reg **reg_list, int *num_regs);
-static int FreeRTOS_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);
+static int FreeRTOS_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[]);
struct rtos_type FreeRTOS_rtos = {
.name = "FreeRTOS",
return rtos_generic_stack_read(rtos->target, param->stacking_info_cm3, stack_ptr, reg_list, num_regs);
}
-static int FreeRTOS_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int FreeRTOS_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
unsigned int i;
*symbol_list = calloc(
- ARRAY_SIZE(FreeRTOS_symbol_list), sizeof(symbol_table_elem_t));
+ ARRAY_SIZE(FreeRTOS_symbol_list), sizeof(struct symbol_table_elem));
for (i = 0; i < ARRAY_SIZE(FreeRTOS_symbol_list); i++) {
(*symbol_list)[i].symbol_name = FreeRTOS_symbol_list[i].name;
static int ThreadX_create(struct target *target);
static int ThreadX_update_threads(struct rtos *rtos);
static int ThreadX_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs);
-static int ThreadX_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);
+static int ThreadX_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[]);
return rtos_generic_stack_read(rtos->target, stacking_info, stack_ptr, reg_list, num_regs);
}
-static int ThreadX_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int ThreadX_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
unsigned int i;
*symbol_list = calloc(
- ARRAY_SIZE(ThreadX_symbol_list), sizeof(symbol_table_elem_t));
+ ARRAY_SIZE(ThreadX_symbol_list), sizeof(struct symbol_table_elem));
for (i = 0; i < ARRAY_SIZE(ThreadX_symbol_list); i++)
(*symbol_list)[i].symbol_name = ThreadX_symbol_list[i];
static int chibios_update_threads(struct rtos *rtos);
static int chibios_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
struct rtos_reg **reg_list, int *num_regs);
-static int chibios_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);
+static int chibios_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[]);
struct rtos_type chibios_rtos = {
.name = "chibios",
CHIBIOS_VAL_CH_DEBUG = 2
};
-static symbol_table_elem_t chibios_symbol_list[] = {
+static struct symbol_table_elem chibios_symbol_list[] = {
{ "rlist", 0, true}, /* Thread ready list */
{ "ch", 0, true}, /* System data structure */
{ "ch_debug", 0, false}, /* Memory Signature containing offsets of fields in rlist */
return rtos_generic_stack_read(rtos->target, param->stacking_info, stack_ptr, reg_list, num_regs);
}
-static int chibios_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int chibios_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
*symbol_list = malloc(sizeof(chibios_symbol_list));
stack_ptr, reg_list, num_regs);
}
-static int chromium_ec_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int chromium_ec_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
size_t s;
*symbol_list = calloc(ARRAY_SIZE(chromium_ec_symbol_list),
- sizeof(symbol_table_elem_t));
+ sizeof(struct symbol_table_elem));
if (!(*symbol_list)) {
LOG_ERROR("Chromium-EC: out of memory");
return ERROR_FAIL;
static int eCos_create(struct target *target);
static int eCos_update_threads(struct rtos *rtos);
static int eCos_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs);
-static int eCos_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);
+static int eCos_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[]);
struct eCos_thread_state {
int value;
return -1;
}
-static int eCos_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int eCos_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
unsigned int i;
*symbol_list = calloc(
- ARRAY_SIZE(eCos_symbol_list), sizeof(symbol_table_elem_t));
+ ARRAY_SIZE(eCos_symbol_list), sizeof(struct symbol_table_elem));
for (i = 0; i < ARRAY_SIZE(eCos_symbol_list); i++)
(*symbol_list)[i].symbol_name = eCos_symbol_list[i];
static int embKernel_update_threads(struct rtos *rtos);
static int embKernel_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
struct rtos_reg **reg_list, int *num_regs);
-static int embKernel_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);
+static int embKernel_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[]);
struct rtos_type embKernel_rtos = {
.name = "embKernel",
return rtos_generic_stack_read(rtos->target, param->stacking_info, stack_ptr, reg_list, num_regs);
}
-static int embKernel_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int embKernel_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
unsigned int i;
- *symbol_list = calloc(ARRAY_SIZE(embKernel_symbol_list), sizeof(symbol_table_elem_t));
+ *symbol_list = calloc(ARRAY_SIZE(embKernel_symbol_list), sizeof(struct symbol_table_elem));
for (i = 0; i < ARRAY_SIZE(embKernel_symbol_list); i++)
(*symbol_list)[i].symbol_name = embKernel_symbol_list[i];
uint32_t reg_num, struct rtos_reg *rtos_reg);
static int hwthread_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
struct rtos_reg **reg_list, int *num_regs);
-static int hwthread_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);
+static int hwthread_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[]);
static int hwthread_smp_init(struct target *target);
static int hwthread_set_reg(struct rtos *rtos, uint32_t reg_num, uint8_t *reg_value);
return reg->type->set(reg, reg_value);
}
-static int hwthread_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int hwthread_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
/* return an empty list, we don't have any symbols to look up */
- *symbol_list = calloc(1, sizeof(symbol_table_elem_t));
+ *symbol_list = calloc(1, sizeof(struct symbol_table_elem));
(*symbol_list)[0].symbol_name = NULL;
return 0;
}
NULL
};
-static int linux_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int linux_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
unsigned int i;
- *symbol_list = (symbol_table_elem_t *)
- calloc(ARRAY_SIZE(linux_symbol_list), sizeof(symbol_table_elem_t));
+ *symbol_list = (struct symbol_table_elem *)
+ calloc(ARRAY_SIZE(linux_symbol_list), sizeof(struct symbol_table_elem));
for (i = 0; i < ARRAY_SIZE(linux_symbol_list); i++)
(*symbol_list)[i].symbol_name = linux_symbol_list[i];
}
/* API function, export list of required symbols */
-static int mqx_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int mqx_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
- *symbol_list = calloc(ARRAY_SIZE(mqx_symbol_list), sizeof(symbol_table_elem_t));
+ *symbol_list = calloc(ARRAY_SIZE(mqx_symbol_list), sizeof(struct symbol_table_elem));
if (NULL == *symbol_list)
return ERROR_FAIL;
/* export required symbols */
(uint32_t)thread_id + xcpreg_offset, reg_list, num_regs);
}
-static int nuttx_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int nuttx_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
unsigned int i;
- *symbol_list = (symbol_table_elem_t *) calloc(1,
- sizeof(symbol_table_elem_t) * ARRAY_SIZE(nuttx_symbol_list));
+ *symbol_list = (struct symbol_table_elem *) calloc(1,
+ sizeof(struct symbol_table_elem) * ARRAY_SIZE(nuttx_symbol_list));
for (i = 0; i < ARRAY_SIZE(nuttx_symbol_list); i++)
(*symbol_list)[i].symbol_name = nuttx_symbol_list[i];
static int riot_update_threads(struct rtos *rtos);
static int riot_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
struct rtos_reg **reg_list, int *num_regs);
-static int riot_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);
+static int riot_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[]);
struct riot_thread_state {
int value;
num_regs);
}
-static int riot_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int riot_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
- *symbol_list = calloc(ARRAY_SIZE(riot_symbol_list), sizeof(symbol_table_elem_t));
+ *symbol_list = calloc(ARRAY_SIZE(riot_symbol_list), sizeof(struct symbol_table_elem));
if (*symbol_list == NULL) {
LOG_ERROR("RIOT: out of memory");
return target->rtos->gdb_thread_packet(connection, packet, packet_size);
}
-static symbol_table_elem_t *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr)
+static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr)
{
- symbol_table_elem_t *s;
+ struct symbol_table_elem *s;
if (!os->symbols)
os->type->get_symbol_list_to_lookup(&os->symbols);
* if 'symbol' is not declared optional */
static bool is_symbol_mandatory(const struct rtos *os, const char *symbol)
{
- for (symbol_table_elem_t *s = os->symbols; s->symbol_name; ++s) {
+ for (struct symbol_table_elem *s = os->symbols; s->symbol_name; ++s) {
if (!strcmp(s->symbol_name, symbol))
return !s->optional;
}
uint64_t addr = 0;
size_t reply_len;
char reply[GDB_BUFFER_SIZE + 1], cur_sym[GDB_BUFFER_SIZE / 2 + 1] = ""; /* Extra byte for null-termination */
- symbol_table_elem_t *next_sym = NULL;
+ struct symbol_table_elem *next_sym = NULL;
struct target *target = get_target_from_connection(connection);
struct rtos *os = target->rtos;
/**
* Table should be terminated by an element with NULL in symbol_name
*/
-typedef struct symbol_table_elem_struct {
+struct symbol_table_elem {
const char *symbol_name;
symbol_address_t address;
bool optional;
-} symbol_table_elem_t;
+};
struct thread_detail {
threadid_t threadid;
struct rtos {
const struct rtos_type *type;
- symbol_table_elem_t *symbols;
+ struct symbol_table_elem *symbols;
struct target *target;
/* add a context variable instead of global variable */
/* The thread currently selected by gdb. */
struct rtos_reg **reg_list, int *num_regs);
int (*get_thread_reg)(struct rtos *rtos, int64_t thread_id,
uint32_t reg_num, struct rtos_reg *reg);
- int (*get_symbol_list_to_lookup)(symbol_table_elem_t *symbol_list[]);
+ int (*get_symbol_list_to_lookup)(struct symbol_table_elem *symbol_list[]);
int (*clean)(struct target *target);
char * (*ps_command)(struct target *target);
int (*set_reg)(struct rtos *rtos, uint32_t reg_num, uint8_t *reg_value);
num_regs);
}
-static int uCOS_III_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
+static int uCOS_III_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
{
- *symbol_list = calloc(ARRAY_SIZE(uCOS_III_symbol_list), sizeof(symbol_table_elem_t));
+ *symbol_list = calloc(ARRAY_SIZE(uCOS_III_symbol_list), sizeof(struct symbol_table_elem));
if (*symbol_list == NULL) {
LOG_ERROR("uCOS-III: out of memory");
return ERROR_FAIL;