From c69553cbc51770f61cf3b9225d46d058fa2544d0 Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Mon, 3 Jan 2011 13:30:28 +0100 Subject: error handling: the error number is not part of the user interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not propagate error number to user. This is for internal programming purposes only. Error messages to the user is reported as text via LOG_ERROR(). Signed-off-by: Øyvind Harboe --- src/target/etm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/target/etm.c') diff --git a/src/target/etm.c b/src/target/etm.c index 9f7bc83d..7384764a 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -669,7 +669,7 @@ static int etm_read_instruction(struct etm_context *ctx, struct arm_instruction ctx->current_pc - ctx->image->sections[section].base_address, 4, buf, &size_read)) != ERROR_OK) { - LOG_ERROR("error while reading instruction: %i", retval); + LOG_ERROR("error while reading instruction"); return ERROR_TRACE_INSTRUCTION_UNAVAILABLE; } opcode = target_buffer_get_u32(ctx->target, buf); @@ -682,7 +682,7 @@ static int etm_read_instruction(struct etm_context *ctx, struct arm_instruction ctx->current_pc - ctx->image->sections[section].base_address, 2, buf, &size_read)) != ERROR_OK) { - LOG_ERROR("error while reading instruction: %i", retval); + LOG_ERROR("error while reading instruction"); return ERROR_TRACE_INSTRUCTION_UNAVAILABLE; } opcode = target_buffer_get_u16(ctx->target, buf); @@ -2109,6 +2109,7 @@ COMMAND_HANDLER(handle_etm_analyze_command) if ((retval = etmv1_analyze_trace(etm_ctx, CMD_CTX)) != ERROR_OK) { + /* FIX! error should be reported inside etmv1_analyze_trace() */ switch (retval) { case ERROR_ETM_ANALYSIS_FAILED: @@ -2121,7 +2122,7 @@ COMMAND_HANDLER(handle_etm_analyze_command) command_print(CMD_CTX, "no image available for trace analysis"); break; default: - command_print(CMD_CTX, "unknown error: %i", retval); + command_print(CMD_CTX, "unknown error"); } } -- cgit v1.2.3