39 #define ECOS_NUM_STATES ARRAY_SIZE(ecos_thread_states)
71 "Cyg_Thread::thread_list",
72 "Cyg_Scheduler_Base::current_thread",
91 int thread_list_size = 0;
108 LOG_ERROR(
"Don't have the thread list head");
117 uint32_t thread_index;
120 param->pointer_width,
121 (uint8_t *) &thread_index);
122 uint32_t first_thread = thread_index;
126 thread_index +
param->thread_next_offset,
127 param->pointer_width,
128 (uint8_t *) &thread_index);
131 }
while (thread_index != first_thread);
134 uint32_t current_thread_addr;
138 (uint8_t *)¤t_thread_addr);
143 current_thread_addr +
param->thread_uniqueid_offset,
147 LOG_ERROR(
"Could not read eCos current thread from target");
155 char tmp_str[] =
"Current Execution";
166 if (thread_list_size == 0) {
177 thread_index = first_thread;
180 #define ECOS_THREAD_NAME_STR_SIZE (200)
183 uint32_t name_ptr = 0;
184 uint32_t prev_thread_ptr;
189 thread_index +
param->thread_uniqueid_offset,
191 (uint8_t *)&thread_id);
193 LOG_ERROR(
"Could not read eCos thread id from target");
200 thread_index +
param->thread_name_offset,
201 param->pointer_width,
202 (uint8_t *)&name_ptr);
204 LOG_ERROR(
"Could not read eCos thread name pointer from target");
213 (uint8_t *)&tmp_str);
215 LOG_ERROR(
"Error reading thread name from eCos target");
220 if (tmp_str[0] ==
'\x00')
221 strcpy(tmp_str,
"No Name");
224 malloc(strlen(tmp_str)+1);
228 int64_t thread_status = 0;
230 thread_index +
param->thread_state_offset,
232 (uint8_t *)&thread_status);
234 LOG_ERROR(
"Error reading thread state from eCos target");
244 const char *state_desc;
248 state_desc =
"Unknown state";
257 prev_thread_ptr = thread_index;
262 prev_thread_ptr +
param->thread_next_offset,
263 param->pointer_width,
264 (uint8_t *) &thread_index);
266 LOG_ERROR(
"Error reading next thread pointer in eCos thread list");
269 }
while (thread_index != first_thread);
276 struct rtos_reg **reg_list,
int *num_regs)
295 uint32_t thread_index;
297 (uint8_t *)&thread_index);
301 thread_index +
param->thread_uniqueid_offset,
305 LOG_ERROR(
"Error reading unique id from eCos thread");
309 if (
id == thread_id) {
314 thread_index +
param->thread_next_offset,
315 param->pointer_width,
316 (uint8_t *) &thread_index);
321 int64_t stack_ptr = 0;
323 thread_index +
param->thread_stack_offset,
324 param->pointer_width,
325 (uint8_t *)&stack_ptr);
327 LOG_ERROR(
"Error reading stack frame from eCos thread");
332 param->stacking_info,
344 *symbol_list = calloc(
373 LOG_ERROR(
"Could not find target in eCos compatibility list");
static struct aice_port_param_s param
@ ECOS_VAL_CURRENT_THREAD_PTR
static const struct ecos_thread_state ecos_thread_states[]
static bool ecos_detect_rtos(struct target *target)
static int ecos_update_threads(struct rtos *rtos)
#define ECOS_THREAD_NAME_STR_SIZE
const struct rtos_type ecos_rtos
static const char *const ecos_symbol_list[]
static int ecos_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
static int ecos_create(struct target *target)
static int ecos_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
static const struct ecos_params ecos_params_list[]
The JTAG interface can be implemented with a software or hardware fifo.
#define LOG_ERROR(expr ...)
int rtos_generic_stack_read(struct target *target, const struct rtos_register_stacking *stacking, int64_t stack_ptr, struct rtos_reg **reg_list, int *num_regs)
void rtos_free_threadlist(struct rtos *rtos)
const struct rtos_register_stacking rtos_ecos_cortex_m3_stacking
unsigned char thread_name_offset
const struct rtos_register_stacking * stacking_info
unsigned char thread_state_offset
unsigned char thread_next_offset
unsigned char thread_uniqueid_offset
unsigned char pointer_width
unsigned char thread_stack_offset
struct thread_detail * thread_details
struct symbol_table_elem * symbols
void * rtos_specific_params
threadid_t current_thread
Table should be terminated by an element with NULL in symbol_name.
const char * name
Name of this type of target.
struct target_type * type
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
static const char * target_name(struct target *target)
Returns the instance-specific name of the specified target.
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.