1 /***************************************************************************
2 * Copyright (C) 2005, 2007 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
24 #include "replacements.h"
31 int handle_trace_history_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
33 target_t *target = get_current_target(cmd_ctx);
34 trace_t *trace = target->trace_info;
38 if (trace->trace_history)
39 free(trace->trace_history);
41 trace->trace_history_size = strtoul(args[0], NULL, 0);
42 trace->trace_history = malloc(sizeof(u32) * trace->trace_history_size);
44 command_print(cmd_ctx, "new trace history size: %i", trace->trace_history_size);
50 for (i = 0; i < trace->trace_history_size; i++)
52 if (trace->trace_history[i] < trace->num_trace_points)
55 address = trace->trace_points[trace->trace_history[i]].address;
56 command_print(cmd_ctx, "trace point %i: 0x%8.8x",
57 trace->trace_history[i],
63 command_print(cmd_ctx, "trace point %i: -not defined-", trace->trace_history[i]);