summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2011-01-03 13:30:28 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-01-03 13:33:27 +0100
commitc69553cbc51770f61cf3b9225d46d058fa2544d0 (patch)
tree07aa7f6d5bc1861cc926e2359034ef42f17dc46a /src/target
parent1795239cfda77315ea2f4fbc028e7a411d13a7d0 (diff)
downloadopenocd+libswd-c69553cbc51770f61cf3b9225d46d058fa2544d0.tar.gz
openocd+libswd-c69553cbc51770f61cf3b9225d46d058fa2544d0.tar.bz2
openocd+libswd-c69553cbc51770f61cf3b9225d46d058fa2544d0.tar.xz
openocd+libswd-c69553cbc51770f61cf3b9225d46d058fa2544d0.zip
error handling: the error number is not part of the user interface
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 <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/arm11.c2
-rw-r--r--src/target/cortex_m3.c2
-rw-r--r--src/target/etm.c7
-rw-r--r--src/target/xscale.c4
4 files changed, 8 insertions, 7 deletions
diff --git a/src/target/arm11.c b/src/target/arm11.c
index 9955143a..2d978e63 100644
--- a/src/target/arm11.c
+++ b/src/target/arm11.c
@@ -175,7 +175,7 @@ static int arm11_debug_entry(struct arm11_common *arm11)
*/
retval = arm_dpm_read_current_registers(&arm11->dpm);
if (retval != ERROR_OK)
- LOG_ERROR("DPM REG READ -- fail %d", retval);
+ LOG_ERROR("DPM REG READ -- fail");
retval = arm11_run_instr_data_prepare(arm11);
if (retval != ERROR_OK)
diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c
index 93c88c09..f6918afa 100644
--- a/src/target/cortex_m3.c
+++ b/src/target/cortex_m3.c
@@ -1533,7 +1533,7 @@ static int cortex_m3_store_core_reg_u32(struct target *target,
{
struct reg *r;
- LOG_ERROR("JTAG failure %i", retval);
+ LOG_ERROR("JTAG failure");
r = armv7m->core_cache->reg_list + num;
r->dirty = r->valid;
return ERROR_JTAG_DEVICE_ERROR;
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");
}
}
diff --git a/src/target/xscale.c b/src/target/xscale.c
index 32c656bb..9511be0a 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -2753,7 +2753,7 @@ static int xscale_read_instruction(struct target *target, uint32_t pc,
pc - xscale->trace.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(target, buf);
@@ -2766,7 +2766,7 @@ static int xscale_read_instruction(struct target *target, uint32_t pc,
pc - xscale->trace.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(target, buf);