GNU Binutils with patches for OS216
Revision | f938677d425cd0453e26f7f51d9e94c87c92a25d (tree) |
---|---|
Zeit | 2017-09-27 23:44:55 |
Autor | Tom Tromey <tom@trom...> |
Commiter | Tom Tromey |
Constify some commands in btrace.c
gdb/ChangeLog
2017-09-27 Tom Tromey <tom@tromey.com>
* btrace.c (get_uint, get_context_size, no_chunk)
(maint_btrace_packet_history_cmd)
(maint_btrace_clear_packet_history_cmd, maint_btrace_clear_cmd)
(maint_info_btrace_cmd): Constify.
@@ -1,5 +1,12 @@ | ||
1 | 1 | 2017-09-27 Tom Tromey <tom@tromey.com> |
2 | 2 | |
3 | + * btrace.c (get_uint, get_context_size, no_chunk) | |
4 | + (maint_btrace_packet_history_cmd) | |
5 | + (maint_btrace_clear_packet_history_cmd, maint_btrace_clear_cmd) | |
6 | + (maint_info_btrace_cmd): Constify. | |
7 | + | |
8 | +2017-09-27 Tom Tromey <tom@tromey.com> | |
9 | + | |
3 | 10 | * reverse.c (delete_bookmark_command): Constify. |
4 | 11 | |
5 | 12 | 2017-09-27 Tom Tromey <tom@tromey.com> |
@@ -3180,9 +3180,10 @@ btrace_maint_print_packets (struct btrace_thread_info *btinfo, | ||
3180 | 3180 | /* Read a number from an argument string. */ |
3181 | 3181 | |
3182 | 3182 | static unsigned int |
3183 | -get_uint (char **arg) | |
3183 | +get_uint (const char **arg) | |
3184 | 3184 | { |
3185 | - char *begin, *end, *pos; | |
3185 | + const char *begin, *pos; | |
3186 | + char *end; | |
3186 | 3187 | unsigned long number; |
3187 | 3188 | |
3188 | 3189 | begin = *arg; |
@@ -3203,23 +3204,23 @@ get_uint (char **arg) | ||
3203 | 3204 | /* Read a context size from an argument string. */ |
3204 | 3205 | |
3205 | 3206 | static int |
3206 | -get_context_size (char **arg) | |
3207 | +get_context_size (const char **arg) | |
3207 | 3208 | { |
3208 | - char *pos; | |
3209 | - int number; | |
3210 | - | |
3211 | - pos = skip_spaces (*arg); | |
3209 | + const char *pos = skip_spaces (*arg); | |
3212 | 3210 | |
3213 | 3211 | if (!isdigit (*pos)) |
3214 | 3212 | error (_("Expected positive number, got: %s."), pos); |
3215 | 3213 | |
3216 | - return strtol (pos, arg, 10); | |
3214 | + char *end; | |
3215 | + long result = strtol (pos, &end, 10); | |
3216 | + *arg = end; | |
3217 | + return result; | |
3217 | 3218 | } |
3218 | 3219 | |
3219 | 3220 | /* Complain about junk at the end of an argument string. */ |
3220 | 3221 | |
3221 | 3222 | static void |
3222 | -no_chunk (char *arg) | |
3223 | +no_chunk (const char *arg) | |
3223 | 3224 | { |
3224 | 3225 | if (*arg != 0) |
3225 | 3226 | error (_("Junk after argument: %s."), arg); |
@@ -3228,7 +3229,7 @@ no_chunk (char *arg) | ||
3228 | 3229 | /* The "maintenance btrace packet-history" command. */ |
3229 | 3230 | |
3230 | 3231 | static void |
3231 | -maint_btrace_packet_history_cmd (char *arg, int from_tty) | |
3232 | +maint_btrace_packet_history_cmd (const char *arg, int from_tty) | |
3232 | 3233 | { |
3233 | 3234 | struct btrace_thread_info *btinfo; |
3234 | 3235 | struct thread_info *tp; |
@@ -3333,7 +3334,7 @@ maint_btrace_packet_history_cmd (char *arg, int from_tty) | ||
3333 | 3334 | /* The "maintenance btrace clear-packet-history" command. */ |
3334 | 3335 | |
3335 | 3336 | static void |
3336 | -maint_btrace_clear_packet_history_cmd (char *args, int from_tty) | |
3337 | +maint_btrace_clear_packet_history_cmd (const char *args, int from_tty) | |
3337 | 3338 | { |
3338 | 3339 | struct btrace_thread_info *btinfo; |
3339 | 3340 | struct thread_info *tp; |
@@ -3355,7 +3356,7 @@ maint_btrace_clear_packet_history_cmd (char *args, int from_tty) | ||
3355 | 3356 | /* The "maintenance btrace clear" command. */ |
3356 | 3357 | |
3357 | 3358 | static void |
3358 | -maint_btrace_clear_cmd (char *args, int from_tty) | |
3359 | +maint_btrace_clear_cmd (const char *args, int from_tty) | |
3359 | 3360 | { |
3360 | 3361 | struct btrace_thread_info *btinfo; |
3361 | 3362 | struct thread_info *tp; |
@@ -3418,7 +3419,7 @@ maint_btrace_pt_show_cmd (char *args, int from_tty) | ||
3418 | 3419 | /* The "maintenance info btrace" command. */ |
3419 | 3420 | |
3420 | 3421 | static void |
3421 | -maint_info_btrace_cmd (char *args, int from_tty) | |
3422 | +maint_info_btrace_cmd (const char *args, int from_tty) | |
3422 | 3423 | { |
3423 | 3424 | struct btrace_thread_info *btinfo; |
3424 | 3425 | struct thread_info *tp; |