aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-03-18 11:43:09 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-03-18 11:43:09 +0000
commitcf10427caa55be47a6c93976883b595cf2c5be52 (patch)
tree58b1629446d31eda3892625e90cb43a188c199d7
parentc13924e32cf58e51aa6b86f785c7961daf3da01e (diff)
downloadriscv-openocd-cf10427caa55be47a6c93976883b595cf2c5be52.zip
riscv-openocd-cf10427caa55be47a6c93976883b595cf2c5be52.tar.gz
riscv-openocd-cf10427caa55be47a6c93976883b595cf2c5be52.tar.bz2
Hiroshi Ito <ito@mlb.co.jp> fix division by 0
git-svn-id: svn://svn.berlios.de/openocd/trunk@1416 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/target/trace.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/target/trace.c b/src/target/trace.c
index 257e8ce..93925cd 100644
--- a/src/target/trace.c
+++ b/src/target/trace.c
@@ -128,7 +128,11 @@ int handle_trace_history_command(struct command_context_s *cmd_ctx, char *cmd, c
int i;
int first = 0;
int last = trace->trace_history_pos;
-
+
+ if ( !trace->trace_history_size ) {
+ command_print(cmd_ctx, "trace history buffer is not allocated");
+ return ERROR_OK;
+ }
if (trace->trace_history_overflowed)
{
first = trace->trace_history_pos;