summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-10-24 06:36:06 -0700
committerZachary T Welch <zw@superlucidity.net>2009-11-05 18:03:19 -0800
commit04b8a2a6f3e85fc701ce19c8c5999ab8a75964cd (patch)
tree72187774d33f8fbcb77bb2b0364fe57259e6be4c
parenta8886cdfee58aff32a6c3e3cdf818e584d1075d7 (diff)
downloadopenocd_libswd-04b8a2a6f3e85fc701ce19c8c5999ab8a75964cd.tar.gz
openocd_libswd-04b8a2a6f3e85fc701ce19c8c5999ab8a75964cd.tar.bz2
openocd_libswd-04b8a2a6f3e85fc701ce19c8c5999ab8a75964cd.tar.xz
openocd_libswd-04b8a2a6f3e85fc701ce19c8c5999ab8a75964cd.zip
Improve trace command argument parsing.
-rw-r--r--src/target/trace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/target/trace.c b/src/target/trace.c
index 9387f830..e74c6160 100644
--- a/src/target/trace.c
+++ b/src/target/trace.c
@@ -86,7 +86,9 @@ static int handle_trace_point_command(struct command_context_s *cmd_ctx, char *c
trace->trace_points_size += 32;
}
- trace->trace_points[trace->num_trace_points].address = strtoul(args[0], NULL, 0);
+ uint32_t address;
+ COMMAND_PARSE_NUMBER(u32, args[0], address);
+ trace->trace_points[trace->num_trace_points].address = address;
trace->trace_points[trace->num_trace_points].hit_counter = 0;
trace->num_trace_points++;
@@ -112,7 +114,7 @@ static int handle_trace_history_command(struct command_context_s *cmd_ctx, char
if (trace->trace_history)
free(trace->trace_history);
- trace->trace_history_size = strtoul(args[0], NULL, 0);
+ COMMAND_PARSE_NUMBER(u32, args[0], trace->trace_history_size);
trace->trace_history = malloc(sizeof(uint32_t) * trace->trace_history_size);
command_print(cmd_ctx, "new trace history size: %i", (int)(trace->trace_history_size));