summaryrefslogtreecommitdiff
path: root/src/target/trace.c
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 /src/target/trace.c
parentc13924e32cf58e51aa6b86f785c7961daf3da01e (diff)
downloadopenocd+libswd-cf10427caa55be47a6c93976883b595cf2c5be52.tar.gz
openocd+libswd-cf10427caa55be47a6c93976883b595cf2c5be52.tar.bz2
openocd+libswd-cf10427caa55be47a6c93976883b595cf2c5be52.tar.xz
openocd+libswd-cf10427caa55be47a6c93976883b595cf2c5be52.zip
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
Diffstat (limited to 'src/target/trace.c')
-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 257e8ceb..93925cd1 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;