projects
/
fw
/
openocd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove target argument from gdb packet handling functions
[fw/openocd]
/
src
/
target
/
etm.c
diff --git
a/src/target/etm.c
b/src/target/etm.c
index c71c5d199fabbf1827b465e4267c14c0d55db835..7384764aa1f4f1ed9b46077f898743420fbdd131 100644
(file)
--- 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)
{
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);
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)
{
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);
return ERROR_TRACE_INSTRUCTION_UNAVAILABLE;
}
opcode = target_buffer_get_u16(ctx->target, buf);
@@
-1897,7
+1897,15
@@
COMMAND_HANDLER(handle_etm_load_command)
return ERROR_FAIL;
}
return ERROR_FAIL;
}
- if (fileio_size(&file) % 4)
+ int filesize;
+ int retval = fileio_size(&file, &filesize);
+ if (retval != ERROR_OK)
+ {
+ fileio_close(&file);
+ return retval;
+ }
+
+ if (filesize % 4)
{
command_print(CMD_CTX, "size isn't a multiple of 4, no valid trace data");
fileio_close(&file);
{
command_print(CMD_CTX, "size isn't a multiple of 4, no valid trace data");
fileio_close(&file);
@@
-2101,6
+2109,7
@@
COMMAND_HANDLER(handle_etm_analyze_command)
if ((retval = etmv1_analyze_trace(etm_ctx, CMD_CTX)) != ERROR_OK)
{
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:
switch (retval)
{
case ERROR_ETM_ANALYSIS_FAILED:
@@
-2113,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, "no image available for trace analysis");
break;
default:
- command_print(CMD_CTX, "unknown error
: %i", retval
);
+ command_print(CMD_CTX, "unknown error
"
);
}
}
}
}