GNU Binutils with patches for OS216
修订版 | f1735a53a63040cc4b4a735bf18a3f20d308e519 (tree) |
---|---|
时间 | 2017-09-12 06:46:12 |
作者 | Tom Tromey <tom@trom...> |
Commiter | Tom Tromey |
Rename _const functions to use overloading instead
This renames a few functions -- skip_spaces_const,
skip_to_space_const, get_number_const, extract_arg_const -- to drop
the "_const" suffix and instead rely on overloading.
This makes future const fixes simpler by reducing the number of lines
that must be changed. I think it is also not any less clear, as all
these functions have the same interface as their non-const versions by
design. Furthermore there's an example of using an overload in-tree
already, namely check_for_argument.
This patch was largely created using some perl one-liners; then a few
fixes were applied by hand.
ChangeLog
2017-09-11 Tom Tromey <tom@tromey.com>
* common/common-utils.h (skip_to_space): Remove macro, redeclare
as function.
(skip_to_space): Rename from skip_to_space_const.
* common/common-utils.c (skip_to_space): New function.
(skip_to_space): Rename from skip_to_space_const.
* cli/cli-utils.h (get_number): Rename from get_number_const.
(extract_arg): Rename from extract_arg_const.
* cli/cli-utils.c (get_number): Rename from get_number_const.
(extract_arg): Rename from extract_arg_const.
(number_or_range_parser::get_number): Use ::get_number.
* aarch64-linux-tdep.c, ada-lang.c, arm-linux-tdep.c, ax-gdb.c,
break-catch-throw.c, breakpoint.c, cli/cli-cmds.c, cli/cli-dump.c,
cli/cli-script.c, cli/cli-setshow.c, compile/compile.c,
completer.c, demangle.c, disasm.c, findcmd.c, linespec.c,
linux-tdep.c, linux-thread-db.c, location.c, mi/mi-parse.c,
minsyms.c, nat/linux-procfs.c, printcmd.c, probe.c,
python/py-breakpoint.c, record.c, rust-exp.y, serial.c, stack.c,
stap-probe.c, tid-parse.c, tracepoint.c: Update all callers.
@@ -1,5 +1,26 @@ | ||
1 | 1 | 2017-09-11 Tom Tromey <tom@tromey.com> |
2 | 2 | |
3 | + * common/common-utils.h (skip_to_space): Remove macro, redeclare | |
4 | + as function. | |
5 | + (skip_to_space): Rename from skip_to_space_const. | |
6 | + * common/common-utils.c (skip_to_space): New function. | |
7 | + (skip_to_space): Rename from skip_to_space_const. | |
8 | + * cli/cli-utils.h (get_number): Rename from get_number_const. | |
9 | + (extract_arg): Rename from extract_arg_const. | |
10 | + * cli/cli-utils.c (get_number): Rename from get_number_const. | |
11 | + (extract_arg): Rename from extract_arg_const. | |
12 | + (number_or_range_parser::get_number): Use ::get_number. | |
13 | + * aarch64-linux-tdep.c, ada-lang.c, arm-linux-tdep.c, ax-gdb.c, | |
14 | + break-catch-throw.c, breakpoint.c, cli/cli-cmds.c, cli/cli-dump.c, | |
15 | + cli/cli-script.c, cli/cli-setshow.c, compile/compile.c, | |
16 | + completer.c, demangle.c, disasm.c, findcmd.c, linespec.c, | |
17 | + linux-tdep.c, linux-thread-db.c, location.c, mi/mi-parse.c, | |
18 | + minsyms.c, nat/linux-procfs.c, printcmd.c, probe.c, | |
19 | + python/py-breakpoint.c, record.c, rust-exp.y, serial.c, stack.c, | |
20 | + stap-probe.c, tid-parse.c, tracepoint.c: Update all callers. | |
21 | + | |
22 | +2017-09-11 Tom Tromey <tom@tromey.com> | |
23 | + | |
3 | 24 | * python/python.c (do_start_initialization): Use |
4 | 25 | py-event-types.def to initialize types. |
5 | 26 | Define all object type structures. |
@@ -305,7 +305,7 @@ aarch64_stap_parse_special_token (struct gdbarch *gdbarch, | ||
305 | 305 | regname, p->saved_arg); |
306 | 306 | |
307 | 307 | ++tmp; |
308 | - tmp = skip_spaces_const (tmp); | |
308 | + tmp = skip_spaces (tmp); | |
309 | 309 | /* Now we expect a number. It can begin with '#' or simply |
310 | 310 | a digit. */ |
311 | 311 | if (*tmp == '#') |
@@ -12732,13 +12732,13 @@ ada_get_next_arg (const char **argsp) | ||
12732 | 12732 | const char *end; |
12733 | 12733 | char *result; |
12734 | 12734 | |
12735 | - args = skip_spaces_const (args); | |
12735 | + args = skip_spaces (args); | |
12736 | 12736 | if (args[0] == '\0') |
12737 | 12737 | return NULL; /* No more arguments. */ |
12738 | 12738 | |
12739 | 12739 | /* Find the end of the current argument. */ |
12740 | 12740 | |
12741 | - end = skip_to_space_const (args); | |
12741 | + end = skip_to_space (args); | |
12742 | 12742 | |
12743 | 12743 | /* Adjust ARGSP to point to the start of the next argument. */ |
12744 | 12744 |
@@ -12785,12 +12785,12 @@ catch_ada_exception_command_split (const char *args, | ||
12785 | 12785 | |
12786 | 12786 | /* Check to see if we have a condition. */ |
12787 | 12787 | |
12788 | - args = skip_spaces_const (args); | |
12788 | + args = skip_spaces (args); | |
12789 | 12789 | if (startswith (args, "if") |
12790 | 12790 | && (isspace (args[2]) || args[2] == '\0')) |
12791 | 12791 | { |
12792 | 12792 | args += 2; |
12793 | - args = skip_spaces_const (args); | |
12793 | + args = skip_spaces (args); | |
12794 | 12794 | |
12795 | 12795 | if (args[0] == '\0') |
12796 | 12796 | error (_("Condition missing after `if' keyword")); |
@@ -13044,14 +13044,14 @@ catch_ada_exception_command (char *arg_entry, int from_tty, | ||
13044 | 13044 | static void |
13045 | 13045 | catch_ada_assert_command_split (const char *args, char **cond_string) |
13046 | 13046 | { |
13047 | - args = skip_spaces_const (args); | |
13047 | + args = skip_spaces (args); | |
13048 | 13048 | |
13049 | 13049 | /* Check whether a condition was provided. */ |
13050 | 13050 | if (startswith (args, "if") |
13051 | 13051 | && (isspace (args[2]) || args[2] == '\0')) |
13052 | 13052 | { |
13053 | 13053 | args += 2; |
13054 | - args = skip_spaces_const (args); | |
13054 | + args = skip_spaces (args); | |
13055 | 13055 | if (args[0] == '\0') |
13056 | 13056 | error (_("condition missing after `if' keyword")); |
13057 | 13057 | *cond_string = xstrdup (args); |
@@ -1211,7 +1211,7 @@ arm_stap_parse_special_token (struct gdbarch *gdbarch, | ||
1211 | 1211 | regname, p->saved_arg); |
1212 | 1212 | |
1213 | 1213 | ++tmp; |
1214 | - tmp = skip_spaces_const (tmp); | |
1214 | + tmp = skip_spaces (tmp); | |
1215 | 1215 | if (*tmp == '#' || *tmp == '$') |
1216 | 1216 | ++tmp; |
1217 | 1217 |
@@ -2702,7 +2702,7 @@ maint_agent_printf_command (char *exp, int from_tty) | ||
2702 | 2702 | |
2703 | 2703 | cmdrest = exp; |
2704 | 2704 | |
2705 | - cmdrest = skip_spaces_const (cmdrest); | |
2705 | + cmdrest = skip_spaces (cmdrest); | |
2706 | 2706 | |
2707 | 2707 | if (*cmdrest++ != '"') |
2708 | 2708 | error (_("Must start with a format string.")); |
@@ -2718,14 +2718,14 @@ maint_agent_printf_command (char *exp, int from_tty) | ||
2718 | 2718 | if (*cmdrest++ != '"') |
2719 | 2719 | error (_("Bad format string, non-terminated '\"'.")); |
2720 | 2720 | |
2721 | - cmdrest = skip_spaces_const (cmdrest); | |
2721 | + cmdrest = skip_spaces (cmdrest); | |
2722 | 2722 | |
2723 | 2723 | if (*cmdrest != ',' && *cmdrest != 0) |
2724 | 2724 | error (_("Invalid argument syntax")); |
2725 | 2725 | |
2726 | 2726 | if (*cmdrest == ',') |
2727 | 2727 | cmdrest++; |
2728 | - cmdrest = skip_spaces_const (cmdrest); | |
2728 | + cmdrest = skip_spaces (cmdrest); | |
2729 | 2729 | |
2730 | 2730 | nargs = 0; |
2731 | 2731 | while (*cmdrest != '\0') |
@@ -402,7 +402,7 @@ extract_exception_regexp (const char **string) | ||
402 | 402 | const char *start; |
403 | 403 | const char *last, *last_space; |
404 | 404 | |
405 | - start = skip_spaces_const (*string); | |
405 | + start = skip_spaces (*string); | |
406 | 406 | |
407 | 407 | last = start; |
408 | 408 | last_space = start; |
@@ -416,7 +416,7 @@ extract_exception_regexp (const char **string) | ||
416 | 416 | |
417 | 417 | /* No "if" token here. Skip to the next word start. */ |
418 | 418 | last_space = skip_to_space (last); |
419 | - last = skip_spaces_const (last_space); | |
419 | + last = skip_spaces (last_space); | |
420 | 420 | } |
421 | 421 | |
422 | 422 | *string = last; |
@@ -438,7 +438,7 @@ catch_exception_command_1 (enum exception_event_kind ex_event, | ||
438 | 438 | |
439 | 439 | if (!arg) |
440 | 440 | arg = ""; |
441 | - arg = skip_spaces_const (arg); | |
441 | + arg = skip_spaces (arg); | |
442 | 442 | |
443 | 443 | std::string except_rx = extract_exception_regexp (&arg); |
444 | 444 |
@@ -1048,8 +1048,8 @@ condition_completer (struct cmd_list_element *cmd, | ||
1048 | 1048 | { |
1049 | 1049 | const char *space; |
1050 | 1050 | |
1051 | - text = skip_spaces_const (text); | |
1052 | - space = skip_to_space_const (text); | |
1051 | + text = skip_spaces (text); | |
1052 | + space = skip_to_space (text); | |
1053 | 1053 | if (*space == '\0') |
1054 | 1054 | { |
1055 | 1055 | int len; |
@@ -1084,7 +1084,7 @@ condition_completer (struct cmd_list_element *cmd, | ||
1084 | 1084 | } |
1085 | 1085 | |
1086 | 1086 | /* We're completing the expression part. */ |
1087 | - text = skip_spaces_const (space); | |
1087 | + text = skip_spaces (space); | |
1088 | 1088 | expression_completer (cmd, tracker, text, word); |
1089 | 1089 | } |
1090 | 1090 |
@@ -2431,7 +2431,7 @@ parse_cmd_to_aexpr (CORE_ADDR scope, char *cmd) | ||
2431 | 2431 | |
2432 | 2432 | if (*cmdrest == ',') |
2433 | 2433 | ++cmdrest; |
2434 | - cmdrest = skip_spaces_const (cmdrest); | |
2434 | + cmdrest = skip_spaces (cmdrest); | |
2435 | 2435 | |
2436 | 2436 | if (*cmdrest++ != '"') |
2437 | 2437 | error (_("No format string following the location")); |
@@ -2447,14 +2447,14 @@ parse_cmd_to_aexpr (CORE_ADDR scope, char *cmd) | ||
2447 | 2447 | if (*cmdrest++ != '"') |
2448 | 2448 | error (_("Bad format string, non-terminated '\"'.")); |
2449 | 2449 | |
2450 | - cmdrest = skip_spaces_const (cmdrest); | |
2450 | + cmdrest = skip_spaces (cmdrest); | |
2451 | 2451 | |
2452 | 2452 | if (!(*cmdrest == ',' || *cmdrest == '\0')) |
2453 | 2453 | error (_("Invalid argument syntax")); |
2454 | 2454 | |
2455 | 2455 | if (*cmdrest == ',') |
2456 | 2456 | cmdrest++; |
2457 | - cmdrest = skip_spaces_const (cmdrest); | |
2457 | + cmdrest = skip_spaces (cmdrest); | |
2458 | 2458 | |
2459 | 2459 | /* For each argument, make an expression. */ |
2460 | 2460 |
@@ -8460,7 +8460,7 @@ add_solib_catchpoint (const char *arg, int is_load, int is_temp, int enabled) | ||
8460 | 8460 | |
8461 | 8461 | if (!arg) |
8462 | 8462 | arg = ""; |
8463 | - arg = skip_spaces_const (arg); | |
8463 | + arg = skip_spaces (arg); | |
8464 | 8464 | |
8465 | 8465 | std::unique_ptr<solib_catchpoint> c (new solib_catchpoint ()); |
8466 | 8466 |
@@ -9204,9 +9204,9 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, | ||
9204 | 9204 | const char *endp; |
9205 | 9205 | char *marker_str; |
9206 | 9206 | |
9207 | - p = skip_spaces_const (p); | |
9207 | + p = skip_spaces (p); | |
9208 | 9208 | |
9209 | - endp = skip_to_space_const (p); | |
9209 | + endp = skip_to_space (p); | |
9210 | 9210 | |
9211 | 9211 | marker_str = savestring (p, endp - p); |
9212 | 9212 | t->static_trace_marker_id = marker_str; |
@@ -9504,7 +9504,7 @@ find_condition_and_thread (const char *tok, CORE_ADDR pc, | ||
9504 | 9504 | const char *cond_start = NULL; |
9505 | 9505 | const char *cond_end = NULL; |
9506 | 9506 | |
9507 | - tok = skip_spaces_const (tok); | |
9507 | + tok = skip_spaces (tok); | |
9508 | 9508 | |
9509 | 9509 | if ((*tok == '"' || *tok == ',') && rest) |
9510 | 9510 | { |
@@ -9512,7 +9512,7 @@ find_condition_and_thread (const char *tok, CORE_ADDR pc, | ||
9512 | 9512 | return; |
9513 | 9513 | } |
9514 | 9514 | |
9515 | - end_tok = skip_to_space_const (tok); | |
9515 | + end_tok = skip_to_space (tok); | |
9516 | 9516 | |
9517 | 9517 | toklen = end_tok - tok; |
9518 | 9518 |
@@ -9569,9 +9569,9 @@ decode_static_tracepoint_spec (const char **arg_p) | ||
9569 | 9569 | char *marker_str; |
9570 | 9570 | int i; |
9571 | 9571 | |
9572 | - p = skip_spaces_const (p); | |
9572 | + p = skip_spaces (p); | |
9573 | 9573 | |
9574 | - endp = skip_to_space_const (p); | |
9574 | + endp = skip_to_space (p); | |
9575 | 9575 | |
9576 | 9576 | marker_str = savestring (p, endp - p); |
9577 | 9577 | old_chain = make_cleanup (xfree, marker_str); |
@@ -11064,8 +11064,8 @@ watch_command_1 (const char *arg, int accessflag, int from_tty, | ||
11064 | 11064 | else if (val != NULL) |
11065 | 11065 | release_value (val); |
11066 | 11066 | |
11067 | - tok = skip_spaces_const (arg); | |
11068 | - end_tok = skip_to_space_const (tok); | |
11067 | + tok = skip_spaces (arg); | |
11068 | + end_tok = skip_to_space (tok); | |
11069 | 11069 | |
11070 | 11070 | toklen = end_tok - tok; |
11071 | 11071 | if (toklen >= 1 && strncmp (tok, "if", toklen) == 0) |
@@ -11583,7 +11583,7 @@ ep_parse_optional_if_clause (const char **arg) | ||
11583 | 11583 | |
11584 | 11584 | /* Skip any extra leading whitespace, and record the start of the |
11585 | 11585 | condition string. */ |
11586 | - *arg = skip_spaces_const (*arg); | |
11586 | + *arg = skip_spaces (*arg); | |
11587 | 11587 | cond_string = *arg; |
11588 | 11588 | |
11589 | 11589 | /* Assume that the condition occupies the remainder of the arg |
@@ -11619,7 +11619,7 @@ catch_fork_command_1 (char *arg_entry, int from_tty, | ||
11619 | 11619 | |
11620 | 11620 | if (!arg) |
11621 | 11621 | arg = ""; |
11622 | - arg = skip_spaces_const (arg); | |
11622 | + arg = skip_spaces (arg); | |
11623 | 11623 | |
11624 | 11624 | /* The allowed syntax is: |
11625 | 11625 | catch [v]fork |
@@ -11664,7 +11664,7 @@ catch_exec_command_1 (char *arg_entry, int from_tty, | ||
11664 | 11664 | |
11665 | 11665 | if (!arg) |
11666 | 11666 | arg = ""; |
11667 | - arg = skip_spaces_const (arg); | |
11667 | + arg = skip_spaces (arg); | |
11668 | 11668 | |
11669 | 11669 | /* The allowed syntax is: |
11670 | 11670 | catch exec |
@@ -1240,7 +1240,7 @@ disassemble_command (char *arg, int from_tty) | ||
1240 | 1240 | } |
1241 | 1241 | } |
1242 | 1242 | |
1243 | - p = skip_spaces_const (p); | |
1243 | + p = skip_spaces (p); | |
1244 | 1244 | } |
1245 | 1245 | |
1246 | 1246 | if ((flags & (DISASSEMBLY_SOURCE_DEPRECATED | DISASSEMBLY_SOURCE)) |
@@ -1277,7 +1277,7 @@ disassemble_command (char *arg, int from_tty) | ||
1277 | 1277 | /* Two arguments. */ |
1278 | 1278 | int incl_flag = 0; |
1279 | 1279 | low = pc; |
1280 | - p = skip_spaces_const (p); | |
1280 | + p = skip_spaces (p); | |
1281 | 1281 | if (p[0] == '+') |
1282 | 1282 | { |
1283 | 1283 | ++p; |
@@ -45,7 +45,7 @@ scan_expression (const char **cmd, const char *def) | ||
45 | 45 | |
46 | 46 | end = (*cmd) + strcspn (*cmd, " \t"); |
47 | 47 | exp = savestring ((*cmd), end - (*cmd)); |
48 | - (*cmd) = skip_spaces_const (end); | |
48 | + (*cmd) = skip_spaces (end); | |
49 | 49 | return gdb::unique_xmalloc_ptr<char> (exp); |
50 | 50 | } |
51 | 51 | } |
@@ -71,10 +71,10 @@ scan_filename (const char **cmd, const char *defname) | ||
71 | 71 | /* FIXME: should parse a possibly quoted string. */ |
72 | 72 | const char *end; |
73 | 73 | |
74 | - (*cmd) = skip_spaces_const (*cmd); | |
74 | + (*cmd) = skip_spaces (*cmd); | |
75 | 75 | end = *cmd + strcspn (*cmd, " \t"); |
76 | 76 | filename.reset (savestring ((*cmd), end - (*cmd))); |
77 | - (*cmd) = skip_spaces_const (end); | |
77 | + (*cmd) = skip_spaces (end); | |
78 | 78 | } |
79 | 79 | gdb_assert (filename != NULL); |
80 | 80 |
@@ -538,7 +538,7 @@ restore_command (char *args_in, int from_tty) | ||
538 | 538 | { |
539 | 539 | binary_flag = 1; |
540 | 540 | args += strlen (binary_string); |
541 | - args = skip_spaces_const (args); | |
541 | + args = skip_spaces (args); | |
542 | 542 | } |
543 | 543 | /* Parse offset (optional). */ |
544 | 544 | if (args != NULL && *args != '\0') |
@@ -888,7 +888,7 @@ line_first_arg (const char *p) | ||
888 | 888 | { |
889 | 889 | const char *first_arg = p + find_command_name_length (p); |
890 | 890 | |
891 | - return skip_spaces_const (first_arg); | |
891 | + return skip_spaces (first_arg); | |
892 | 892 | } |
893 | 893 | |
894 | 894 | /* Process one input line. If the command is an "end", return such an |
@@ -932,7 +932,7 @@ process_next_line (char *p, struct command_line **command, int parse_commands, | ||
932 | 932 | const char *cmd_name = p; |
933 | 933 | struct cmd_list_element *cmd |
934 | 934 | = lookup_cmd_1 (&cmd_name, cmdlist, NULL, 1); |
935 | - cmd_name = skip_spaces_const (cmd_name); | |
935 | + cmd_name = skip_spaces (cmd_name); | |
936 | 936 | bool inline_cmd = *cmd_name != '\0'; |
937 | 937 | |
938 | 938 | /* If commands are parsed, we skip initial spaces. Otherwise, |
@@ -134,7 +134,7 @@ is_unlimited_literal (const char *arg) | ||
134 | 134 | { |
135 | 135 | size_t len = sizeof ("unlimited") - 1; |
136 | 136 | |
137 | - arg = skip_spaces_const (arg); | |
137 | + arg = skip_spaces (arg); | |
138 | 138 | |
139 | 139 | return (strncmp (arg, "unlimited", len) == 0 |
140 | 140 | && (isspace (arg[len]) || arg[len] == '\0')); |
@@ -93,7 +93,7 @@ get_number_trailer (const char **pp, int trailer) | ||
93 | 93 | ++p; |
94 | 94 | retval = 0; |
95 | 95 | } |
96 | - p = skip_spaces_const (p); | |
96 | + p = skip_spaces (p); | |
97 | 97 | *pp = p; |
98 | 98 | return retval; |
99 | 99 | } |
@@ -101,7 +101,7 @@ get_number_trailer (const char **pp, int trailer) | ||
101 | 101 | /* See documentation in cli-utils.h. */ |
102 | 102 | |
103 | 103 | int |
104 | -get_number_const (const char **pp) | |
104 | +get_number (const char **pp) | |
105 | 105 | { |
106 | 106 | return get_number_trailer (pp, '\0'); |
107 | 107 | } |
@@ -172,8 +172,8 @@ number_or_range_parser::get_number () | ||
172 | 172 | and also remember the end of the final token. */ |
173 | 173 | |
174 | 174 | temp = &m_end_ptr; |
175 | - m_end_ptr = skip_spaces_const (m_cur_tok + 1); | |
176 | - m_end_value = get_number_const (temp); | |
175 | + m_end_ptr = skip_spaces (m_cur_tok + 1); | |
176 | + m_end_value = ::get_number (temp); | |
177 | 177 | if (m_end_value < m_last_retval) |
178 | 178 | { |
179 | 179 | error (_("inverted range")); |
@@ -250,7 +250,7 @@ remove_trailing_whitespace (const char *start, const char *s) | ||
250 | 250 | /* See documentation in cli-utils.h. */ |
251 | 251 | |
252 | 252 | char * |
253 | -extract_arg_const (const char **arg) | |
253 | +extract_arg (const char **arg) | |
254 | 254 | { |
255 | 255 | const char *result; |
256 | 256 |
@@ -258,13 +258,13 @@ extract_arg_const (const char **arg) | ||
258 | 258 | return NULL; |
259 | 259 | |
260 | 260 | /* Find the start of the argument. */ |
261 | - *arg = skip_spaces_const (*arg); | |
261 | + *arg = skip_spaces (*arg); | |
262 | 262 | if (!**arg) |
263 | 263 | return NULL; |
264 | 264 | result = *arg; |
265 | 265 | |
266 | 266 | /* Find the end of the argument. */ |
267 | - *arg = skip_to_space_const (*arg + 1); | |
267 | + *arg = skip_to_space (*arg + 1); | |
268 | 268 | |
269 | 269 | if (result == *arg) |
270 | 270 | return NULL; |
@@ -280,7 +280,7 @@ extract_arg (char **arg) | ||
280 | 280 | const char *arg_const = *arg; |
281 | 281 | char *result; |
282 | 282 | |
283 | - result = extract_arg_const (&arg_const); | |
283 | + result = extract_arg (&arg_const); | |
284 | 284 | *arg += arg_const - *arg; |
285 | 285 | return result; |
286 | 286 | } |
@@ -33,9 +33,9 @@ extern int get_number_trailer (const char **pp, int trailer); | ||
33 | 33 | |
34 | 34 | /* Convenience. Like get_number_trailer, but with no TRAILER. */ |
35 | 35 | |
36 | -extern int get_number_const (const char **); | |
36 | +extern int get_number (const char **); | |
37 | 37 | |
38 | -/* Like get_number_const, but takes a non-const "char **". */ | |
38 | +/* Like the above, but takes a non-const "char **". */ | |
39 | 39 | |
40 | 40 | extern int get_number (char **); |
41 | 41 |
@@ -154,12 +154,12 @@ remove_trailing_whitespace (const char *start, char *s) | ||
154 | 154 | |
155 | 155 | extern char *extract_arg (char **arg); |
156 | 156 | |
157 | -/* A const-correct version of "extract_arg". | |
157 | +/* A const-correct version of the above. | |
158 | 158 | |
159 | 159 | Since the returned value is xmalloc'd, it eventually needs to be |
160 | 160 | xfree'ed, which prevents us from making it const as well. */ |
161 | 161 | |
162 | -extern char *extract_arg_const (const char **arg); | |
162 | +extern char *extract_arg (const char **arg); | |
163 | 163 | |
164 | 164 | /* A helper function that looks for an argument at the start of a |
165 | 165 | string. The argument must also either be at the end of the string, |
@@ -298,7 +298,7 @@ skip_spaces (char *chp) | ||
298 | 298 | /* A const-correct version of the above. */ |
299 | 299 | |
300 | 300 | const char * |
301 | -skip_spaces_const (const char *chp) | |
301 | +skip_spaces (const char *chp) | |
302 | 302 | { |
303 | 303 | if (chp == NULL) |
304 | 304 | return NULL; |
@@ -310,7 +310,7 @@ skip_spaces_const (const char *chp) | ||
310 | 310 | /* See documentation in common-utils.h. */ |
311 | 311 | |
312 | 312 | const char * |
313 | -skip_to_space_const (const char *chp) | |
313 | +skip_to_space (const char *chp) | |
314 | 314 | { |
315 | 315 | if (chp == NULL) |
316 | 316 | return NULL; |
@@ -319,6 +319,14 @@ skip_to_space_const (const char *chp) | ||
319 | 319 | return chp; |
320 | 320 | } |
321 | 321 | |
322 | +/* See documentation in common-utils.h. */ | |
323 | + | |
324 | +char * | |
325 | +skip_to_space (char *chp) | |
326 | +{ | |
327 | + return (char *) skip_to_space ((const char *) chp); | |
328 | +} | |
329 | + | |
322 | 330 | /* See common/common-utils.h. */ |
323 | 331 | |
324 | 332 | void |
@@ -93,16 +93,16 @@ extern char *skip_spaces (char *inp); | ||
93 | 93 | |
94 | 94 | /* A const-correct version of the above. */ |
95 | 95 | |
96 | -extern const char *skip_spaces_const (const char *inp); | |
96 | +extern const char *skip_spaces (const char *inp); | |
97 | 97 | |
98 | 98 | /* Skip leading non-whitespace characters in INP, returning an updated |
99 | 99 | pointer. If INP is NULL, return NULL. */ |
100 | 100 | |
101 | -#define skip_to_space(INP) ((char *) skip_to_space_const (INP)) | |
101 | +extern char *skip_to_space (char *inp); | |
102 | 102 | |
103 | 103 | /* A const-correct version of the above. */ |
104 | 104 | |
105 | -extern const char *skip_to_space_const (const char *inp); | |
105 | +extern const char *skip_to_space (const char *inp); | |
106 | 106 | |
107 | 107 | /* Assumes that V is an argv for a program, and iterates through |
108 | 108 | freeing all the elements. */ |
@@ -367,7 +367,7 @@ get_selected_pc_producer_options (void) | ||
367 | 367 | |
368 | 368 | cs = symtab->producer; |
369 | 369 | while (*cs != 0 && *cs != '-') |
370 | - cs = skip_spaces_const (skip_to_space_const (cs)); | |
370 | + cs = skip_spaces (skip_to_space (cs)); | |
371 | 371 | if (*cs != '-') |
372 | 372 | return NULL; |
373 | 373 | return cs; |
@@ -699,7 +699,7 @@ collect_explicit_location_matches (completion_tracker &tracker, | ||
699 | 699 | keyword. */ |
700 | 700 | if (keyword != word) |
701 | 701 | { |
702 | - keyword = skip_spaces_const (keyword); | |
702 | + keyword = skip_spaces (keyword); | |
703 | 703 | |
704 | 704 | tracker.advance_custom_word_point_by (keyword - word); |
705 | 705 | complete_on_enum (tracker, linespec_keywords, keyword, keyword); |
@@ -729,7 +729,7 @@ skip_keyword (completion_tracker &tracker, | ||
729 | 729 | const char * const *keywords, const char **text_p) |
730 | 730 | { |
731 | 731 | const char *text = *text_p; |
732 | - const char *after = skip_to_space_const (text); | |
732 | + const char *after = skip_to_space (text); | |
733 | 733 | size_t len = after - text; |
734 | 734 | |
735 | 735 | if (text[len] != ' ') |
@@ -1903,7 +1903,7 @@ expand_preserving_ws (const char *orig, size_t orig_len, | ||
1903 | 1903 | { |
1904 | 1904 | while (p_orig < orig_end && *p_orig == ' ') |
1905 | 1905 | res += *p_orig++; |
1906 | - p_lcd = skip_spaces_const (p_lcd); | |
1906 | + p_lcd = skip_spaces (p_lcd); | |
1907 | 1907 | } |
1908 | 1908 | else |
1909 | 1909 | { |
@@ -174,20 +174,20 @@ demangle_command (char *args, int from_tty) | ||
174 | 174 | while (processing_args |
175 | 175 | && *arg_start == '-') |
176 | 176 | { |
177 | - const char *p = skip_to_space_const (arg_start); | |
177 | + const char *p = skip_to_space (arg_start); | |
178 | 178 | |
179 | 179 | if (strncmp (arg_start, "-l", p - arg_start) == 0) |
180 | - lang_name.reset (extract_arg_const (&p)); | |
180 | + lang_name.reset (extract_arg (&p)); | |
181 | 181 | else if (strncmp (arg_start, "--", p - arg_start) == 0) |
182 | 182 | processing_args = 0; |
183 | 183 | else |
184 | 184 | { |
185 | - gdb::unique_xmalloc_ptr<char> option (extract_arg_const (&p)); | |
185 | + gdb::unique_xmalloc_ptr<char> option (extract_arg (&p)); | |
186 | 186 | error (_("Unrecognized option '%s' to demangle command. " |
187 | 187 | "Try \"help demangle\"."), option.get ()); |
188 | 188 | } |
189 | 189 | |
190 | - arg_start = skip_spaces_const (p); | |
190 | + arg_start = skip_spaces (p); | |
191 | 191 | } |
192 | 192 | |
193 | 193 | name = arg_start; |
@@ -1044,7 +1044,7 @@ disassembler_options_completer (struct cmd_list_element *ignore, | ||
1044 | 1044 | const char *separator = strrchr (text, ','); |
1045 | 1045 | if (separator != NULL) |
1046 | 1046 | text = separator + 1; |
1047 | - text = skip_spaces_const (text); | |
1047 | + text = skip_spaces (text); | |
1048 | 1048 | complete_on_enum (tracker, opts->name, text, word); |
1049 | 1049 | } |
1050 | 1050 | } |
@@ -110,7 +110,7 @@ parse_find_args (char *args, ULONGEST *max_countp, | ||
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | - s = skip_spaces_const (s); | |
113 | + s = skip_spaces (s); | |
114 | 114 | } |
115 | 115 | |
116 | 116 | /* Get the search range. */ |
@@ -120,7 +120,7 @@ parse_find_args (char *args, ULONGEST *max_countp, | ||
120 | 120 | |
121 | 121 | if (*s == ',') |
122 | 122 | ++s; |
123 | - s = skip_spaces_const (s); | |
123 | + s = skip_spaces (s); | |
124 | 124 | |
125 | 125 | if (*s == '+') |
126 | 126 | { |
@@ -171,7 +171,7 @@ parse_find_args (char *args, ULONGEST *max_countp, | ||
171 | 171 | struct type *t; |
172 | 172 | ULONGEST pattern_buf_size_need; |
173 | 173 | |
174 | - s = skip_spaces_const (s); | |
174 | + s = skip_spaces (s); | |
175 | 175 | |
176 | 176 | v = parse_to_comma_and_eval (&s); |
177 | 177 | t = value_type (v); |
@@ -220,7 +220,7 @@ parse_find_args (char *args, ULONGEST *max_countp, | ||
220 | 220 | |
221 | 221 | if (*s == ',') |
222 | 222 | ++s; |
223 | - s = skip_spaces_const (s); | |
223 | + s = skip_spaces (s); | |
224 | 224 | } |
225 | 225 | |
226 | 226 | if (pattern_buf_end == pattern_buf) |
@@ -474,7 +474,7 @@ linespec_lexer_lex_keyword (const char *p) | ||
474 | 474 | if (i != IF_KEYWORD_INDEX) |
475 | 475 | { |
476 | 476 | p += len; |
477 | - p = skip_spaces_const (p); | |
477 | + p = skip_spaces (p); | |
478 | 478 | for (j = 0; linespec_keywords[j] != NULL; ++j) |
479 | 479 | { |
480 | 480 | int nextlen = strlen (linespec_keywords[j]); |
@@ -709,7 +709,7 @@ linespec_lexer_lex_string (linespec_parser *parser) | ||
709 | 709 | { |
710 | 710 | if (isspace (*PARSER_STREAM (parser))) |
711 | 711 | { |
712 | - p = skip_spaces_const (PARSER_STREAM (parser)); | |
712 | + p = skip_spaces (PARSER_STREAM (parser)); | |
713 | 713 | /* When we get here we know we've found something followed by |
714 | 714 | a space (we skip over parens and templates below). |
715 | 715 | So if we find a keyword now, we know it is a keyword and not, |
@@ -856,7 +856,7 @@ linespec_lexer_lex_one (linespec_parser *parser) | ||
856 | 856 | if (parser->lexer.current.type == LSTOKEN_CONSUMED) |
857 | 857 | { |
858 | 858 | /* Skip any whitespace. */ |
859 | - PARSER_STREAM (parser) = skip_spaces_const (PARSER_STREAM (parser)); | |
859 | + PARSER_STREAM (parser) = skip_spaces (PARSER_STREAM (parser)); | |
860 | 860 | |
861 | 861 | /* Check for a keyword, they end the linespec. */ |
862 | 862 | keyword = linespec_lexer_lex_keyword (PARSER_STREAM (parser)); |
@@ -1770,7 +1770,7 @@ set_completion_after_number (linespec_parser *parser, | ||
1770 | 1770 | { |
1771 | 1771 | if (*PARSER_STREAM (parser) == ' ') |
1772 | 1772 | { |
1773 | - parser->completion_word = skip_spaces_const (PARSER_STREAM (parser) + 1); | |
1773 | + parser->completion_word = skip_spaces (PARSER_STREAM (parser) + 1); | |
1774 | 1774 | parser->complete_what = next; |
1775 | 1775 | } |
1776 | 1776 | else |
@@ -2000,7 +2000,7 @@ linespec_parse_basic (linespec_parser *parser) | ||
2000 | 2000 | if (ptr[i] == ' ') |
2001 | 2001 | { |
2002 | 2002 | LS_TOKEN_STOKEN (token).length = i; |
2003 | - PARSER_STREAM (parser) = skip_spaces_const (ptr + i + 1); | |
2003 | + PARSER_STREAM (parser) = skip_spaces (ptr + i + 1); | |
2004 | 2004 | break; |
2005 | 2005 | } |
2006 | 2006 | } |
@@ -2697,7 +2697,7 @@ parse_linespec (linespec_parser *parser, const char *arg) | ||
2697 | 2697 | advances past a keyword automatically, so skip it |
2698 | 2698 | manually. */ |
2699 | 2699 | parser->completion_word |
2700 | - = skip_spaces_const (skip_to_space_const (PARSER_STREAM (parser))); | |
2700 | + = skip_spaces (skip_to_space (PARSER_STREAM (parser))); | |
2701 | 2701 | parser->complete_what = linespec_complete_what::EXPRESSION; |
2702 | 2702 | } |
2703 | 2703 |
@@ -440,7 +440,7 @@ read_mapping (const char *line, | ||
440 | 440 | p++; |
441 | 441 | *endaddr = strtoulst (p, &p, 16); |
442 | 442 | |
443 | - p = skip_spaces_const (p); | |
443 | + p = skip_spaces (p); | |
444 | 444 | *permissions = p; |
445 | 445 | while (*p && !isspace (*p)) |
446 | 446 | p++; |
@@ -448,7 +448,7 @@ read_mapping (const char *line, | ||
448 | 448 | |
449 | 449 | *offset = strtoulst (p, &p, 16); |
450 | 450 | |
451 | - p = skip_spaces_const (p); | |
451 | + p = skip_spaces (p); | |
452 | 452 | *device = p; |
453 | 453 | while (*p && !isspace (*p)) |
454 | 454 | p++; |
@@ -456,7 +456,7 @@ read_mapping (const char *line, | ||
456 | 456 | |
457 | 457 | *inode = strtoulst (p, &p, 10); |
458 | 458 | |
459 | - p = skip_spaces_const (p); | |
459 | + p = skip_spaces (p); | |
460 | 460 | *filename = p; |
461 | 461 | } |
462 | 462 |
@@ -740,7 +740,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, | ||
740 | 740 | pid = current_inferior ()->pid; |
741 | 741 | } |
742 | 742 | |
743 | - args = skip_spaces_const (args); | |
743 | + args = skip_spaces (args); | |
744 | 744 | if (args && args[0]) |
745 | 745 | error (_("Too many parameters: %s"), args); |
746 | 746 |
@@ -870,7 +870,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, | ||
870 | 870 | printf_filtered (_("Process: %s\n"), |
871 | 871 | pulongest (strtoulst (p, &p, 10))); |
872 | 872 | |
873 | - p = skip_spaces_const (p); | |
873 | + p = skip_spaces (p); | |
874 | 874 | if (*p == '(') |
875 | 875 | { |
876 | 876 | /* ps command also relies on no trailing fields |
@@ -884,7 +884,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, | ||
884 | 884 | } |
885 | 885 | } |
886 | 886 | |
887 | - p = skip_spaces_const (p); | |
887 | + p = skip_spaces (p); | |
888 | 888 | if (*p) |
889 | 889 | printf_filtered (_("State: %c\n"), *p++); |
890 | 890 |
@@ -1560,7 +1560,7 @@ info_auto_load_libthread_db (char *args, int from_tty) | ||
1560 | 1560 | char *pids; |
1561 | 1561 | int i; |
1562 | 1562 | |
1563 | - cs = skip_spaces_const (cs); | |
1563 | + cs = skip_spaces (cs); | |
1564 | 1564 | if (*cs) |
1565 | 1565 | error (_("'info auto-load libthread-db' does not accept any parameters")); |
1566 | 1566 |
@@ -746,7 +746,7 @@ string_to_explicit_location (const char **argp, | ||
746 | 746 | len = strlen (opt.get ()); |
747 | 747 | |
748 | 748 | /* Get the argument string. */ |
749 | - *argp = skip_spaces_const (*argp); | |
749 | + *argp = skip_spaces (*argp); | |
750 | 750 | |
751 | 751 | /* All options have a required argument. Checking for this |
752 | 752 | required argument is deferred until later. */ |
@@ -779,7 +779,7 @@ string_to_explicit_location (const char **argp, | ||
779 | 779 | else if (strncmp (opt.get (), "-line", len) == 0) |
780 | 780 | { |
781 | 781 | set_oarg (explicit_location_lex_one (argp, language, NULL)); |
782 | - *argp = skip_spaces_const (*argp); | |
782 | + *argp = skip_spaces (*argp); | |
783 | 783 | if (have_oarg) |
784 | 784 | { |
785 | 785 | EL_EXPLICIT (location)->line_offset |
@@ -808,7 +808,7 @@ string_to_explicit_location (const char **argp, | ||
808 | 808 | return location; |
809 | 809 | } |
810 | 810 | |
811 | - *argp = skip_spaces_const (*argp); | |
811 | + *argp = skip_spaces (*argp); | |
812 | 812 | |
813 | 813 | /* It's a little lame to error after the fact, but in this |
814 | 814 | case, it provides a much better user experience to issue |
@@ -119,7 +119,7 @@ mi_parse_argv (const char *args, struct mi_parse *parse) | ||
119 | 119 | char *arg; |
120 | 120 | |
121 | 121 | /* Skip leading white space. */ |
122 | - chp = skip_spaces_const (chp); | |
122 | + chp = skip_spaces (chp); | |
123 | 123 | /* Three possibilities: EOF, quoted string, or other text. */ |
124 | 124 | switch (*chp) |
125 | 125 | { |
@@ -242,7 +242,7 @@ mi_parse (const char *cmd, char **token) | ||
242 | 242 | std::unique_ptr<struct mi_parse> parse (new struct mi_parse); |
243 | 243 | |
244 | 244 | /* Before starting, skip leading white space. */ |
245 | - cmd = skip_spaces_const (cmd); | |
245 | + cmd = skip_spaces (cmd); | |
246 | 246 | |
247 | 247 | /* Find/skip any token and then extract it. */ |
248 | 248 | for (chp = cmd; *chp >= '0' && *chp <= '9'; chp++) |
@@ -254,7 +254,7 @@ mi_parse (const char *cmd, char **token) | ||
254 | 254 | /* This wasn't a real MI command. Return it as a CLI_COMMAND. */ |
255 | 255 | if (*chp != '-') |
256 | 256 | { |
257 | - chp = skip_spaces_const (chp); | |
257 | + chp = skip_spaces (chp); | |
258 | 258 | parse->command = xstrdup (chp); |
259 | 259 | parse->op = CLI_COMMAND; |
260 | 260 |
@@ -279,7 +279,7 @@ mi_parse (const char *cmd, char **token) | ||
279 | 279 | _("Undefined MI command: %s"), parse->command); |
280 | 280 | |
281 | 281 | /* Skip white space following the command. */ |
282 | - chp = skip_spaces_const (chp); | |
282 | + chp = skip_spaces (chp); | |
283 | 283 | |
284 | 284 | /* Parse the --thread and --frame options, if present. At present, |
285 | 285 | some important commands, like '-break-*' are implemented by |
@@ -352,7 +352,7 @@ mi_parse (const char *cmd, char **token) | ||
352 | 352 | |
353 | 353 | option = "--language"; |
354 | 354 | chp += ls; |
355 | - lang_name = extract_arg_const (&chp); | |
355 | + lang_name = extract_arg (&chp); | |
356 | 356 | old_chain = make_cleanup (xfree, lang_name); |
357 | 357 | |
358 | 358 | parse->language = language_enum (lang_name); |
@@ -367,7 +367,7 @@ mi_parse (const char *cmd, char **token) | ||
367 | 367 | |
368 | 368 | if (*chp != '\0' && !isspace (*chp)) |
369 | 369 | error (_("Invalid value for the '%s' option"), option); |
370 | - chp = skip_spaces_const (chp); | |
370 | + chp = skip_spaces (chp); | |
371 | 371 | } |
372 | 372 | |
373 | 373 | /* For new argv commands, attempt to return the parsed argument |
@@ -90,7 +90,7 @@ msymbol_hash_iw (const char *string) | ||
90 | 90 | |
91 | 91 | while (*string && *string != '(') |
92 | 92 | { |
93 | - string = skip_spaces_const (string); | |
93 | + string = skip_spaces (string); | |
94 | 94 | if (*string && *string != '(') |
95 | 95 | { |
96 | 96 | hash = SYMBOL_HASH_NEXT (hash, *string); |
@@ -96,7 +96,7 @@ enum proc_state | ||
96 | 96 | static enum proc_state |
97 | 97 | parse_proc_status_state (const char *state) |
98 | 98 | { |
99 | - state = skip_spaces_const (state); | |
99 | + state = skip_spaces (state); | |
100 | 100 | |
101 | 101 | switch (state[0]) |
102 | 102 | { |
@@ -2447,7 +2447,7 @@ ui_printf (const char *arg, struct ui_file *stream) | ||
2447 | 2447 | if (s == 0) |
2448 | 2448 | error_no_arg (_("format-control string and values to print")); |
2449 | 2449 | |
2450 | - s = skip_spaces_const (s); | |
2450 | + s = skip_spaces (s); | |
2451 | 2451 | |
2452 | 2452 | /* A format string should follow, enveloped in double quotes. */ |
2453 | 2453 | if (*s++ != '"') |
@@ -2460,14 +2460,14 @@ ui_printf (const char *arg, struct ui_file *stream) | ||
2460 | 2460 | if (*s++ != '"') |
2461 | 2461 | error (_("Bad format string, non-terminated '\"'.")); |
2462 | 2462 | |
2463 | - s = skip_spaces_const (s); | |
2463 | + s = skip_spaces (s); | |
2464 | 2464 | |
2465 | 2465 | if (*s != ',' && *s != 0) |
2466 | 2466 | error (_("Invalid argument syntax")); |
2467 | 2467 | |
2468 | 2468 | if (*s == ',') |
2469 | 2469 | s++; |
2470 | - s = skip_spaces_const (s); | |
2470 | + s = skip_spaces (s); | |
2471 | 2471 | |
2472 | 2472 | { |
2473 | 2473 | int nargs = 0; |
@@ -558,12 +558,12 @@ parse_probe_linespec (const char *str, char **provider, | ||
558 | 558 | { |
559 | 559 | *probe_name = *objname = NULL; |
560 | 560 | |
561 | - *provider = extract_arg_const (&str); | |
561 | + *provider = extract_arg (&str); | |
562 | 562 | if (*provider != NULL) |
563 | 563 | { |
564 | - *probe_name = extract_arg_const (&str); | |
564 | + *probe_name = extract_arg (&str); | |
565 | 565 | if (*probe_name != NULL) |
566 | - *objname = extract_arg_const (&str); | |
566 | + *objname = extract_arg (&str); | |
567 | 567 | } |
568 | 568 | } |
569 | 569 |
@@ -673,7 +673,7 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs) | ||
673 | 673 | TRY |
674 | 674 | { |
675 | 675 | gdb::unique_xmalloc_ptr<char> |
676 | - copy_holder (xstrdup (skip_spaces_const (spec))); | |
676 | + copy_holder (xstrdup (skip_spaces (spec))); | |
677 | 677 | char *copy = copy_holder.get (); |
678 | 678 | |
679 | 679 | switch (type) |
@@ -431,7 +431,7 @@ get_insn_number (char **arg) | ||
431 | 431 | const char *begin, *end, *pos; |
432 | 432 | |
433 | 433 | begin = *arg; |
434 | - pos = skip_spaces_const (begin); | |
434 | + pos = skip_spaces (begin); | |
435 | 435 | |
436 | 436 | if (!isdigit (*pos)) |
437 | 437 | error (_("Expected positive number, got: %s."), pos); |
@@ -1515,7 +1515,7 @@ lex_number (void) | ||
1515 | 1515 | gdb_assert (subexps[0].rm_eo > 0); |
1516 | 1516 | if (lexptr[subexps[0].rm_eo - 1] == '.') |
1517 | 1517 | { |
1518 | - const char *next = skip_spaces_const (&lexptr[subexps[0].rm_eo]); | |
1518 | + const char *next = skip_spaces (&lexptr[subexps[0].rm_eo]); | |
1519 | 1519 | |
1520 | 1520 | if (rust_identifier_start_p (*next) || *next == '.') |
1521 | 1521 | { |
@@ -212,7 +212,7 @@ serial_open (const char *name) | ||
212 | 212 | ops = serial_interface_lookup ("pipe"); |
213 | 213 | /* Discard ``|'' and any space before the command itself. */ |
214 | 214 | ++open_name; |
215 | - open_name = skip_spaces_const (open_name); | |
215 | + open_name = skip_spaces (open_name); | |
216 | 216 | } |
217 | 217 | /* Check for a colon, suggesting an IP address/port pair. |
218 | 218 | Do this *after* checking for all the interesting prefixes. We |
@@ -1285,7 +1285,7 @@ parse_frame_specification (const char *frame_exp, int *selected_frame_p) | ||
1285 | 1285 | const char *p; |
1286 | 1286 | |
1287 | 1287 | /* Skip leading white space, bail of EOL. */ |
1288 | - frame_exp = skip_spaces_const (frame_exp); | |
1288 | + frame_exp = skip_spaces (frame_exp); | |
1289 | 1289 | if (!*frame_exp) |
1290 | 1290 | break; |
1291 | 1291 |
@@ -769,7 +769,7 @@ stap_parse_single_operand (struct stap_parse_info *p) | ||
769 | 769 | We handle the register displacement here, and the other cases |
770 | 770 | recursively. */ |
771 | 771 | if (p->inside_paren_p) |
772 | - tmp = skip_spaces_const (tmp); | |
772 | + tmp = skip_spaces (tmp); | |
773 | 773 | |
774 | 774 | while (isdigit (*tmp)) |
775 | 775 | { |
@@ -818,7 +818,7 @@ stap_parse_single_operand (struct stap_parse_info *p) | ||
818 | 818 | tmp = endp; |
819 | 819 | |
820 | 820 | if (p->inside_paren_p) |
821 | - tmp = skip_spaces_const (tmp); | |
821 | + tmp = skip_spaces (tmp); | |
822 | 822 | |
823 | 823 | /* If "stap_is_integer_prefix" returns true, it means we can |
824 | 824 | accept integers without a prefix here. But we also need to |
@@ -901,7 +901,7 @@ stap_parse_argument_conditionally (struct stap_parse_info *p) | ||
901 | 901 | have to parse it as it was a separate expression, without |
902 | 902 | left-side or precedence. */ |
903 | 903 | ++p->arg; |
904 | - p->arg = skip_spaces_const (p->arg); | |
904 | + p->arg = skip_spaces (p->arg); | |
905 | 905 | ++p->inside_paren_p; |
906 | 906 | |
907 | 907 | stap_parse_argument_1 (p, 0, STAP_OPERAND_PREC_NONE); |
@@ -913,7 +913,7 @@ stap_parse_argument_conditionally (struct stap_parse_info *p) | ||
913 | 913 | |
914 | 914 | ++p->arg; |
915 | 915 | if (p->inside_paren_p) |
916 | - p->arg = skip_spaces_const (p->arg); | |
916 | + p->arg = skip_spaces (p->arg); | |
917 | 917 | } |
918 | 918 | else |
919 | 919 | error (_("Cannot parse expression `%s'."), p->saved_arg); |
@@ -935,7 +935,7 @@ stap_parse_argument_1 (struct stap_parse_info *p, int has_lhs, | ||
935 | 935 | gdb_assert (p->arg != NULL); |
936 | 936 | |
937 | 937 | if (p->inside_paren_p) |
938 | - p->arg = skip_spaces_const (p->arg); | |
938 | + p->arg = skip_spaces (p->arg); | |
939 | 939 | |
940 | 940 | if (!has_lhs) |
941 | 941 | { |
@@ -981,7 +981,7 @@ stap_parse_argument_1 (struct stap_parse_info *p, int has_lhs, | ||
981 | 981 | |
982 | 982 | p->arg = tmp_exp_buf; |
983 | 983 | if (p->inside_paren_p) |
984 | - p->arg = skip_spaces_const (p->arg); | |
984 | + p->arg = skip_spaces (p->arg); | |
985 | 985 | |
986 | 986 | /* Parse the right-side of the expression. */ |
987 | 987 | stap_parse_argument_conditionally (p); |
@@ -1074,7 +1074,7 @@ stap_parse_argument (const char **arg, struct type *atype, | ||
1074 | 1074 | |
1075 | 1075 | reallocate_expout (&p.pstate); |
1076 | 1076 | |
1077 | - p.arg = skip_spaces_const (p.arg); | |
1077 | + p.arg = skip_spaces (p.arg); | |
1078 | 1078 | *arg = p.arg; |
1079 | 1079 | |
1080 | 1080 | /* We can safely return EXPOUT here. */ |
@@ -1189,7 +1189,7 @@ stap_parse_probe_arguments (struct stap_probe *probe, struct gdbarch *gdbarch) | ||
1189 | 1189 | arg.aexpr = expr; |
1190 | 1190 | |
1191 | 1191 | /* Start it over again. */ |
1192 | - cur = skip_spaces_const (cur); | |
1192 | + cur = skip_spaces (cur); | |
1193 | 1193 | |
1194 | 1194 | VEC_safe_push (stap_probe_arg_s, probe->args_u.vec, &arg); |
1195 | 1195 | } |
@@ -229,7 +229,7 @@ tid_range_parser::get_tid_or_range (int *inf_num, | ||
229 | 229 | { |
230 | 230 | /* Setup the number range parser to return numbers in the |
231 | 231 | whole [1,INT_MAX] range. */ |
232 | - m_range_parser.setup_range (1, INT_MAX, skip_spaces_const (p + 1)); | |
232 | + m_range_parser.setup_range (1, INT_MAX, skip_spaces (p + 1)); | |
233 | 233 | m_state = STATE_STAR_RANGE; |
234 | 234 | } |
235 | 235 | else |
@@ -618,7 +618,7 @@ decode_agent_options (const char *exp, int *trace_string) | ||
618 | 618 | else |
619 | 619 | error (_("Undefined collection format \"%c\"."), *exp); |
620 | 620 | |
621 | - exp = skip_spaces_const (exp); | |
621 | + exp = skip_spaces (exp); | |
622 | 622 | |
623 | 623 | return exp; |
624 | 624 | } |
@@ -685,7 +685,7 @@ validate_actionline (const char *line, struct breakpoint *b) | ||
685 | 685 | if (line == NULL) |
686 | 686 | return; |
687 | 687 | |
688 | - p = skip_spaces_const (line); | |
688 | + p = skip_spaces (line); | |
689 | 689 | |
690 | 690 | /* Symbol lookup etc. */ |
691 | 691 | if (*p == '\0') /* empty line: just prompt for another line. */ |
@@ -708,7 +708,7 @@ validate_actionline (const char *line, struct breakpoint *b) | ||
708 | 708 | do |
709 | 709 | { /* Repeat over a comma-separated list. */ |
710 | 710 | QUIT; /* Allow user to bail out with ^C. */ |
711 | - p = skip_spaces_const (p); | |
711 | + p = skip_spaces (p); | |
712 | 712 | |
713 | 713 | if (*p == '$') /* Look for special pseudo-symbols. */ |
714 | 714 | { |
@@ -771,7 +771,7 @@ validate_actionline (const char *line, struct breakpoint *b) | ||
771 | 771 | do |
772 | 772 | { /* Repeat over a comma-separated list. */ |
773 | 773 | QUIT; /* Allow user to bail out with ^C. */ |
774 | - p = skip_spaces_const (p); | |
774 | + p = skip_spaces (p); | |
775 | 775 | |
776 | 776 | tmp_p = p; |
777 | 777 | for (loc = t->loc; loc; loc = loc->next) |
@@ -801,7 +801,7 @@ validate_actionline (const char *line, struct breakpoint *b) | ||
801 | 801 | { |
802 | 802 | char *endp; |
803 | 803 | |
804 | - p = skip_spaces_const (p); | |
804 | + p = skip_spaces (p); | |
805 | 805 | t->step_count = strtol (p, &endp, 0); |
806 | 806 | if (endp == p || t->step_count == 0) |
807 | 807 | error (_("while-stepping step count `%s' is malformed."), line); |
@@ -1311,7 +1311,7 @@ encode_actions_1 (struct command_line *action, | ||
1311 | 1311 | { |
1312 | 1312 | QUIT; /* Allow user to bail out with ^C. */ |
1313 | 1313 | action_exp = action->line; |
1314 | - action_exp = skip_spaces_const (action_exp); | |
1314 | + action_exp = skip_spaces (action_exp); | |
1315 | 1315 | |
1316 | 1316 | cmd = lookup_cmd (&action_exp, cmdlist, "", -1, 1); |
1317 | 1317 | if (cmd == 0) |
@@ -1327,7 +1327,7 @@ encode_actions_1 (struct command_line *action, | ||
1327 | 1327 | do |
1328 | 1328 | { /* Repeat over a comma-separated list. */ |
1329 | 1329 | QUIT; /* Allow user to bail out with ^C. */ |
1330 | - action_exp = skip_spaces_const (action_exp); | |
1330 | + action_exp = skip_spaces (action_exp); | |
1331 | 1331 | |
1332 | 1332 | if (0 == strncasecmp ("$reg", action_exp, 4)) |
1333 | 1333 | { |
@@ -1487,7 +1487,7 @@ encode_actions_1 (struct command_line *action, | ||
1487 | 1487 | do |
1488 | 1488 | { /* Repeat over a comma-separated list. */ |
1489 | 1489 | QUIT; /* Allow user to bail out with ^C. */ |
1490 | - action_exp = skip_spaces_const (action_exp); | |
1490 | + action_exp = skip_spaces (action_exp); | |
1491 | 1491 | |
1492 | 1492 | { |
1493 | 1493 | struct cleanup *old_chain1 = NULL; |
@@ -2733,7 +2733,7 @@ trace_dump_actions (struct command_line *action, | ||
2733 | 2733 | |
2734 | 2734 | QUIT; /* Allow user to bail out with ^C. */ |
2735 | 2735 | action_exp = action->line; |
2736 | - action_exp = skip_spaces_const (action_exp); | |
2736 | + action_exp = skip_spaces (action_exp); | |
2737 | 2737 | |
2738 | 2738 | /* The collection actions to be done while stepping are |
2739 | 2739 | bracketed by the commands "while-stepping" and "end". */ |
@@ -2776,7 +2776,7 @@ trace_dump_actions (struct command_line *action, | ||
2776 | 2776 | QUIT; /* Allow user to bail out with ^C. */ |
2777 | 2777 | if (*action_exp == ',') |
2778 | 2778 | action_exp++; |
2779 | - action_exp = skip_spaces_const (action_exp); | |
2779 | + action_exp = skip_spaces (action_exp); | |
2780 | 2780 | |
2781 | 2781 | next_comma = strchr (action_exp, ','); |
2782 | 2782 |