summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;