From 96df1db7b17b5a2298150f21c1c1bee00ffbe0f9 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Fri, 25 Jan 2019 14:34:01 -0800 Subject: Remove debug statements. Change-Id: If37bc883fea0b83740bfd6a7fcb2091db0ac61f0 --- src/rtos/hwthread.c | 30 ++---------------------------- src/rtos/rtos.c | 1 - src/rtos/rtos.h | 3 +-- 3 files changed, 3 insertions(+), 31 deletions(-) (limited to 'src/rtos') diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c index caa3f72..cb8fb20 100644 --- a/src/rtos/hwthread.c +++ b/src/rtos/hwthread.c @@ -37,7 +37,7 @@ 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_smp_init(struct target *target); -int hwthread_set_reg(struct rtos *rtos, int reg_num, uint8_t *reg_value); +int hwthread_set_reg(struct rtos *rtos, uint32_t reg_num, uint8_t *reg_value); #define HW_THREAD_NAME_STR_SIZE (32) @@ -91,9 +91,6 @@ static int hwthread_update_threads(struct rtos *rtos) int64_t current_thread = 0; enum target_debug_reason current_reason = DBG_REASON_UNDEFINED; - LOG_DEBUG("current_thread=%i", (int)rtos->current_thread); - LOG_DEBUG("current_threadid=%i", (int)rtos->current_threadid); - if (rtos == NULL) return ERROR_FAIL; @@ -112,22 +109,6 @@ static int hwthread_update_threads(struct rtos *rtos) } else thread_list_size = 1; -#if 0 - if (thread_list_size == rtos->thread_count) { - /* Nothing changed. Exit early. - * This is important because if we do recreate the data, we potentially - * change what the current thread is, which can lead to trouble because - * this function is sometimes called when single stepping - * (gdb_handle_vcont_packet), and the current thread should not be - * changed as part of that. */ - /* TODO: Do we need to confirm that all the "threads" are really the - * same? Is it even possible to change the number of configured - * targets and SMP groups after this function is called the first time? - */ - return ERROR_OK; - } -#endif - /* Wipe out previous thread details if any, but preserve threadid. */ int64_t current_threadid = rtos->current_threadid; rtos_free_threadlist(rtos); @@ -201,8 +182,6 @@ static int hwthread_update_threads(struct rtos *rtos) } threads_found++; - LOG_DEBUG(">>> tid=%ld, debug_reason=%d, current_thread=%ld, current_reason=%d", - tid, curr->debug_reason, current_thread, current_reason); } } else { hwthread_fill_thread(rtos, target, threads_found); @@ -220,8 +199,6 @@ static int hwthread_update_threads(struct rtos *rtos) else rtos->current_thread = threadid_from_target(target); - LOG_DEBUG("current_thread=%i", (int)rtos->current_thread); - LOG_DEBUG("current_threadid=%i", (int)rtos->current_threadid); return 0; } @@ -287,7 +264,6 @@ static int hwthread_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, static int hwthread_get_thread_reg(struct rtos *rtos, int64_t thread_id, uint32_t reg_num, struct rtos_reg *rtos_reg) { - LOG_DEBUG(">>> thread %ld, reg %d", thread_id, reg_num); if (rtos == NULL) return ERROR_FAIL; @@ -316,7 +292,7 @@ static int hwthread_get_thread_reg(struct rtos *rtos, int64_t thread_id, return ERROR_OK; } -int hwthread_set_reg(struct rtos *rtos, int reg_num, uint8_t *reg_value) +int hwthread_set_reg(struct rtos *rtos, uint32_t reg_num, uint8_t *reg_value) { if (rtos == NULL) return ERROR_FAIL; @@ -368,8 +344,6 @@ static int hwthread_thread_packet(struct connection *connection, const char *pac struct target *curr = NULL; int64_t current_threadid; - LOG_DEBUG(">>> %s", packet); - if (packet[0] == 'H' && packet[1] == 'g') { /* Never reached, because this case is handled by rtos_thread_packet(). */ sscanf(packet, "Hg%16" SCNx64, ¤t_threadid); diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index a5b7fdb..8b9eb4c 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -552,7 +552,6 @@ int rtos_set_reg(struct connection *connection, int reg_num, { struct target *target = get_target_from_connection(connection); int64_t current_threadid = target->rtos->current_threadid; - LOG_DEBUG(">>> thread %ld, reg %d", current_threadid, reg_num); if ((target->rtos != NULL) && (target->rtos->type->set_reg != NULL) && (current_threadid != -1) && diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h index 001837f..81829b1 100644 --- a/src/rtos/rtos.h +++ b/src/rtos/rtos.h @@ -82,8 +82,7 @@ struct rtos_type { int (*get_symbol_list_to_lookup)(symbol_table_elem_t *symbol_list[]); int (*clean)(struct target *target); char * (*ps_command)(struct target *target); - // TODO: int or uint32_t for reg_num? - int (*set_reg)(struct rtos *rtos, int reg_num, uint8_t *reg_value); + int (*set_reg)(struct rtos *rtos, uint32_t reg_num, uint8_t *reg_value); }; struct stack_register_offset { -- cgit v1.1