23 struct rtos_reg **reg_list,
int *num_regs);
32 #define HW_THREAD_NAME_STR_SIZE (32)
46 assert(0 &&
"Target is not found in it's own SMP group!");
87 int threads_found = 0;
88 int thread_list_size = 0;
114 thread_list_size = 1;
119 if (current_threadid <= thread_list_size)
140 switch (current_reason) {
225 if (thread_id == tid)
233 struct rtos_reg **rtos_reg_list,
int *rtos_reg_list_size)
248 struct reg **reg_list;
255 for (
int i = 0; i < reg_list_size; i++) {
256 if (!reg_list[i] || !reg_list[i]->
exist || reg_list[i]->
hidden)
260 *rtos_reg_list_size = j;
261 *rtos_reg_list = calloc(*rtos_reg_list_size,
sizeof(
struct rtos_reg));
262 if (!*rtos_reg_list) {
268 for (
int i = 0; i < reg_list_size; i++) {
269 if (!reg_list[i] || !reg_list[i]->
exist || reg_list[i]->
hidden)
271 if (!reg_list[i]->
valid) {
272 retval = reg_list[i]->
type->
get(reg_list[i]);
277 free(*rtos_reg_list);
281 (*rtos_reg_list)[j].number = reg_list[i]->
number;
282 (*rtos_reg_list)[j].size = reg_list[i]->
size;
283 memcpy((*rtos_reg_list)[j].
value, reg_list[i]->
value,
314 LOG_TARGET_ERROR(curr,
"Couldn't find register %" PRIu32
" in thread %" PRId64,
324 unsigned int bytes = (
reg->
size + 7) / 8;
353 (*symbol_list)[0].symbol_name =
NULL;
378 if (packet[0] ==
'H' && packet[1] ==
'g') {
379 int64_t current_threadid;
380 sscanf(packet,
"Hg%16" SCNx64, ¤t_threadid);
384 if (current_threadid > 0) {
393 }
else if (current_threadid == 0 || current_threadid == -1) {
uint64_t buffer
Pointer to data buffer to send over SPI.
uint32_t size
Size of dw_spi_transaction::buffer.
uint32_t address
Starting address. Sector aligned.
int gdb_put_packet(struct connection *connection, const char *buffer, int len)
static struct target * get_target_from_connection(struct connection *connection)
static int hwthread_create(struct target *target)
static int hwthread_thread_packet(struct connection *connection, const char *packet, int packet_size)
static bool hwthread_detect_rtos(struct target *target)
static int hwthread_read_buffer(struct rtos *rtos, target_addr_t address, uint32_t size, uint8_t *buffer)
#define HW_THREAD_NAME_STR_SIZE
static int hwthread_update_threads(struct rtos *rtos)
static int hwthread_set_reg(struct rtos *rtos, uint32_t reg_num, uint8_t *reg_value)
static int hwthread_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
static int hwthread_write_buffer(struct rtos *rtos, target_addr_t address, uint32_t size, const uint8_t *buffer)
static struct target * hwthread_find_thread(struct target *target, threadid_t thread_id)
const struct rtos_type hwthread_rtos
static int hwthread_get_thread_reg(struct rtos *rtos, int64_t thread_id, 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 threadid_t threadid_from_target(const struct target *target)
static int hwthread_target_for_threadid(struct connection *connection, int64_t thread_id, struct target **p_target)
static int hwthread_fill_thread(struct rtos *rtos, struct target *curr, int thread_num, threadid_t tid)
static int hwthread_smp_init(struct target *target)
The JTAG interface can be implemented with a software or hardware fifo.
#define LOG_TARGET_INFO(target, fmt_str,...)
#define LOG_TARGET_WARNING(target, fmt_str,...)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_TARGET_DEBUG(target, fmt_str,...)
struct reg * register_get_by_number(struct reg_cache *first, uint32_t reg_num, bool search_all)
int rtos_thread_packet(struct connection *connection, char const *packet, int packet_size)
void rtos_free_threadlist(struct rtos *rtos)
#define foreach_smp_target(pos, head)
int(* get)(struct reg *reg)
int(* set)(struct reg *reg, uint8_t *buf)
const struct reg_arch_type * type
int(* gdb_thread_packet)(struct connection *connection, char const *packet, int packet_size)
struct thread_detail * thread_details
void * rtos_specific_params
int(* gdb_target_for_threadid)(struct connection *connection, int64_t thread_id, struct target **p_target)
threadid_t current_thread
Table should be terminated by an element with NULL in symbol_name.
enum target_debug_reason debug_reason
struct reg_cache * reg_cache
struct list_head * smp_targets
int target_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
int target_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
Obtain the registers for GDB.
const char * debug_reason_name(const struct target *t)
static bool target_was_examined(const struct target *target)
static const char * target_name(const struct target *target)
Returns the instance-specific name of the specified target.
#define DIV_ROUND_UP(m, n)
Rounds m up to the nearest multiple of n using division.