From 08fc7417333dc8ba4dd4ac15776ed2e9ede504bd Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Thu, 3 Jan 2013 16:43:27 +0000 Subject: [PATCH] rtos: do not use LOG_OUTPUT LOG_OUTPUT is not intended for general output so use the correct LOG_* functions instead. Change-Id: I48d0fe765637024dbafc68f2ea08219d3ff42754 Signed-off-by: Spencer Oliver Reviewed-on: http://openocd.zylin.com/1104 Tested-by: jenkins Reviewed-by: Freddie Chopin --- src/rtos/FreeRTOS.c | 25 ++++++++++++------------- src/rtos/ThreadX.c | 30 +++++++++++++++--------------- src/rtos/eCos.c | 22 +++++++++++----------- src/rtos/rtos.c | 8 ++++---- 4 files changed, 42 insertions(+), 43 deletions(-) diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c index 6394434df0..acf3689faf 100644 --- a/src/rtos/FreeRTOS.c +++ b/src/rtos/FreeRTOS.c @@ -140,12 +140,12 @@ static int FreeRTOS_update_threads(struct rtos *rtos) param = (const struct FreeRTOS_params *) rtos->rtos_specific_params; if (rtos->symbols == NULL) { - LOG_OUTPUT("No symbols for FreeRTOS\r\n"); + LOG_ERROR("No symbols for FreeRTOS"); return -3; } if (rtos->symbols[FreeRTOS_VAL_uxCurrentNumberOfTasks].address == 0) { - LOG_OUTPUT("Don't have the number of threads in FreeRTOS \r\n"); + LOG_ERROR("Don't have the number of threads in FreeRTOS"); return -2; } @@ -156,7 +156,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos) (uint8_t *)&thread_list_size); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read FreeRTOS thread count from target\r\n"); + LOG_ERROR("Could not read FreeRTOS thread count from target"); return retval; } @@ -187,7 +187,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *)&rtos->current_thread); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading current thread in FreeRTOS thread list\r\n"); + LOG_ERROR("Error reading current thread in FreeRTOS thread list"); return retval; } @@ -269,7 +269,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos) param->thread_count_width, (uint8_t *)&list_thread_count); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading number of threads in FreeRTOS thread list\r\n"); + LOG_ERROR("Error reading number of threads in FreeRTOS thread list"); free(list_of_lists); return retval; } @@ -285,7 +285,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *)&list_elem_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading first thread item location in FreeRTOS thread list\r\n"); + LOG_ERROR("Error reading first thread item location in FreeRTOS thread list"); free(list_of_lists); return retval; } @@ -300,7 +300,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *)&(rtos->thread_details[tasks_found].threadid)); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading thread list item object in FreeRTOS thread list\r\n"); + LOG_ERROR("Error reading thread list item object in FreeRTOS thread list"); free(list_of_lists); return retval; } @@ -316,7 +316,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos) FREERTOS_THREAD_NAME_STR_SIZE, (uint8_t *)&tmp_str); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading first thread item location in FreeRTOS thread list\r\n"); + LOG_ERROR("Error reading first thread item location in FreeRTOS thread list"); free(list_of_lists); return retval; } @@ -350,7 +350,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *)&list_elem_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading next thread item location in FreeRTOS thread list\r\n"); + LOG_ERROR("Error reading next thread item location in FreeRTOS thread list"); free(list_of_lists); return retval; } @@ -386,12 +386,11 @@ static int FreeRTOS_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, ch param->pointer_width, (uint8_t *)&stack_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading stack frame from FreeRTOS thread\r\n"); + LOG_ERROR("Error reading stack frame from FreeRTOS thread"); return retval; } return rtos_generic_stack_read(rtos->target, param->stacking_info, stack_ptr, hex_reg_list); - } static int FreeRTOS_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]) @@ -438,7 +437,7 @@ static int FreeRTOS_get_thread_ascii_info(struct rtos *rtos, threadid_t thread_i FREERTOS_THREAD_NAME_STR_SIZE, (uint8_t *)&tmp_str); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading first thread item location in FreeRTOS thread list\r\n"); + LOG_ERROR("Error reading first thread item location in FreeRTOS thread list"); return retval; } tmp_str[FREERTOS_THREAD_NAME_STR_SIZE-1] = '\x00'; @@ -471,7 +470,7 @@ static int FreeRTOS_create(struct target *target) i++; } if (i >= FREERTOS_NUM_PARAMS) { - LOG_OUTPUT("Could not find target in FreeRTOS compatibility list\r\n"); + LOG_ERROR("Could not find target in FreeRTOS compatibility list"); return -1; } diff --git a/src/rtos/ThreadX.c b/src/rtos/ThreadX.c index 714c6fef5d..571814cb54 100644 --- a/src/rtos/ThreadX.c +++ b/src/rtos/ThreadX.c @@ -134,12 +134,12 @@ static int ThreadX_update_threads(struct rtos *rtos) param = (const struct ThreadX_params *) rtos->rtos_specific_params; if (rtos->symbols == NULL) { - LOG_OUTPUT("No symbols for ThreadX\r\n"); + LOG_ERROR("No symbols for ThreadX"); return -4; } if (rtos->symbols[ThreadX_VAL_tx_thread_created_count].address == 0) { - LOG_OUTPUT("Don't have the number of threads in ThreadX \r\n"); + LOG_ERROR("Don't have the number of threads in ThreadX"); return -2; } @@ -150,7 +150,7 @@ static int ThreadX_update_threads(struct rtos *rtos) (uint8_t *)&thread_list_size); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read ThreadX thread count from target\r\n"); + LOG_ERROR("Could not read ThreadX thread count from target"); return retval; } @@ -182,7 +182,7 @@ static int ThreadX_update_threads(struct rtos *rtos) (uint8_t *)&rtos->current_thread); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read ThreadX current thread from target\r\n"); + LOG_ERROR("Could not read ThreadX current thread from target"); return retval; } @@ -219,7 +219,7 @@ static int ThreadX_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *)&thread_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read ThreadX thread location from target\r\n"); + LOG_ERROR("Could not read ThreadX thread location from target"); return retval; } @@ -241,7 +241,7 @@ static int ThreadX_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *)&name_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read ThreadX thread name pointer from target\r\n"); + LOG_ERROR("Could not read ThreadX thread name pointer from target"); return retval; } @@ -252,7 +252,7 @@ static int ThreadX_update_threads(struct rtos *rtos) THREADX_THREAD_NAME_STR_SIZE, (uint8_t *)&tmp_str); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading thread name from ThreadX target\r\n"); + LOG_ERROR("Error reading thread name from ThreadX target"); return retval; } tmp_str[THREADX_THREAD_NAME_STR_SIZE-1] = '\x00'; @@ -271,7 +271,7 @@ static int ThreadX_update_threads(struct rtos *rtos) 4, (uint8_t *)&thread_status); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading thread state from ThreadX target\r\n"); + LOG_ERROR("Error reading thread state from ThreadX target"); return retval; } @@ -304,7 +304,7 @@ static int ThreadX_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *) &thread_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading next thread pointer in ThreadX thread list\r\n"); + LOG_ERROR("Error reading next thread pointer in ThreadX thread list"); return retval; } } @@ -339,7 +339,7 @@ static int ThreadX_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, cha param->pointer_width, (uint8_t *)&stack_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading stack frame from ThreadX thread\r\n"); + LOG_ERROR("Error reading stack frame from ThreadX thread"); return retval; } @@ -399,7 +399,7 @@ static int ThreadX_get_thread_detail(struct rtos *rtos, param = (const struct ThreadX_params *) rtos->rtos_specific_params; if (rtos->symbols == NULL) { - LOG_OUTPUT("No symbols for ThreadX\r\n"); + LOG_ERROR("No symbols for ThreadX"); return -3; } @@ -412,7 +412,7 @@ static int ThreadX_get_thread_detail(struct rtos *rtos, param->pointer_width, (uint8_t *)&name_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read ThreadX thread name pointer from target\r\n"); + LOG_ERROR("Could not read ThreadX thread name pointer from target"); return retval; } @@ -422,7 +422,7 @@ static int ThreadX_get_thread_detail(struct rtos *rtos, THREADX_THREAD_NAME_STR_SIZE, (uint8_t *)&tmp_str); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading thread name from ThreadX target\r\n"); + LOG_ERROR("Error reading thread name from ThreadX target"); return retval; } tmp_str[THREADX_THREAD_NAME_STR_SIZE-1] = '\x00'; @@ -440,7 +440,7 @@ static int ThreadX_get_thread_detail(struct rtos *rtos, 4, (uint8_t *)&thread_status); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading thread state from ThreadX target\r\n"); + LOG_ERROR("Error reading thread state from ThreadX target"); return retval; } @@ -474,7 +474,7 @@ static int ThreadX_create(struct target *target) i++; } if (i >= THREADX_NUM_PARAMS) { - LOG_OUTPUT("Could not find target in ThreadX compatibility list\r\n"); + LOG_ERROR("Could not find target in ThreadX compatibility list"); return -1; } diff --git a/src/rtos/eCos.c b/src/rtos/eCos.c index 7964712f8b..6a0ed4ec06 100644 --- a/src/rtos/eCos.c +++ b/src/rtos/eCos.c @@ -115,12 +115,12 @@ static int eCos_update_threads(struct rtos *rtos) param = (const struct eCos_params *) rtos->rtos_specific_params; if (rtos->symbols == NULL) { - LOG_OUTPUT("No symbols for eCos\r\n"); + LOG_ERROR("No symbols for eCos"); return -4; } if (rtos->symbols[eCos_VAL_thread_list].address == 0) { - LOG_OUTPUT("Don't have the thread list head\r\n"); + LOG_ERROR("Don't have the thread list head"); return -2; } @@ -177,7 +177,7 @@ static int eCos_update_threads(struct rtos *rtos) 2, (uint8_t *)&rtos->current_thread); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read eCos current thread from target\r\n"); + LOG_ERROR("Could not read eCos current thread from target"); return retval; } @@ -224,7 +224,7 @@ static int eCos_update_threads(struct rtos *rtos) 2, (uint8_t *)&thread_id); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read eCos thread id from target\r\n"); + LOG_ERROR("Could not read eCos thread id from target"); return retval; } rtos->thread_details[tasks_found].threadid = thread_id; @@ -235,7 +235,7 @@ static int eCos_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *)&name_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Could not read eCos thread name pointer from target\r\n"); + LOG_ERROR("Could not read eCos thread name pointer from target"); return retval; } @@ -246,7 +246,7 @@ static int eCos_update_threads(struct rtos *rtos) ECOS_THREAD_NAME_STR_SIZE, (uint8_t *)&tmp_str); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading thread name from eCos target\r\n"); + LOG_ERROR("Error reading thread name from eCos target"); return retval; } tmp_str[ECOS_THREAD_NAME_STR_SIZE-1] = '\x00'; @@ -265,7 +265,7 @@ static int eCos_update_threads(struct rtos *rtos) 4, (uint8_t *)&thread_status); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading thread state from eCos target\r\n"); + LOG_ERROR("Error reading thread state from eCos target"); return retval; } @@ -299,7 +299,7 @@ static int eCos_update_threads(struct rtos *rtos) param->pointer_width, (uint8_t *) &thread_index); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading next thread pointer in eCos thread list\r\n"); + LOG_ERROR("Error reading next thread pointer in eCos thread list"); return retval; } } while (thread_index != first_thread); @@ -339,7 +339,7 @@ static int eCos_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, char * 2, (uint8_t *)&id); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading unique id from eCos thread\r\n"); + LOG_ERROR("Error reading unique id from eCos thread"); return retval; } @@ -361,7 +361,7 @@ static int eCos_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, char * param->pointer_width, (uint8_t *)&stack_ptr); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading stack frame from eCos thread\r\n"); + LOG_ERROR("Error reading stack frame from eCos thread"); return retval; } @@ -404,7 +404,7 @@ static int eCos_create(struct target *target) i++; } if (i >= ECOS_NUM_PARAMS) { - LOG_OUTPUT("Could not find target in eCos compatibility list\r\n"); + LOG_ERROR("Could not find target in eCos compatibility list"); return -1; } diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 61fc7936ff..ddeb74f8ec 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -229,7 +229,7 @@ int rtos_qsymbol(struct connection *connection, char *packet, int packet_size) } if (os->type->detect_rtos(target)) { - LOG_OUTPUT("Auto-detected RTOS: %s\r\n", os->type->name); + LOG_INFO("Auto-detected RTOS: %s", os->type->name); rtos_detected = 1; goto done; } else { @@ -239,7 +239,7 @@ int rtos_qsymbol(struct connection *connection, char *packet, int packet_size) } if (8 + (strlen(next_sym) * 2) + 1 > sizeof(reply)) { - LOG_OUTPUT("ERROR: RTOS symbol '%s' name is too long for GDB!", next_sym); + LOG_ERROR("ERROR: RTOS symbol '%s' name is too long for GDB!", next_sym); goto done; } @@ -429,7 +429,7 @@ int rtos_generic_stack_read(struct target *target, int retval; if (stack_ptr == 0) { - LOG_OUTPUT("Error: null stack pointer in thread\r\n"); + LOG_ERROR("Error: null stack pointer in thread"); return -5; } /* Read the stack */ @@ -440,7 +440,7 @@ int rtos_generic_stack_read(struct target *target, address -= stacking->stack_registers_size; retval = target_read_buffer(target, address, stacking->stack_registers_size, stack_data); if (retval != ERROR_OK) { - LOG_OUTPUT("Error reading stack frame from FreeRTOS thread\r\n"); + LOG_ERROR("Error reading stack frame from FreeRTOS thread"); return retval; } #if 0 -- 2.30.2