diff options
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-cmds.c | 16 | ||||
-rw-r--r-- | gdb/cli/cli-decode.c | 9 | ||||
-rw-r--r-- | gdb/cli/cli-dump.c | 1 | ||||
-rw-r--r-- | gdb/cli/cli-option.c | 4 | ||||
-rw-r--r-- | gdb/cli/cli-script.c | 7 | ||||
-rw-r--r-- | gdb/cli/cli-setshow.c | 3 | ||||
-rw-r--r-- | gdb/cli/cli-utils.c | 27 |
7 files changed, 31 insertions, 36 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index a15a04a..d353654 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -301,8 +301,8 @@ with_command_completer_1 (const char *set_cmd_prefix, command as if it was a "set" command. */ if (delim == text || delim == nullptr - || !isspace (delim[-1]) - || !(isspace (delim[2]) || delim[2] == '\0')) + || !c_isspace (delim[-1]) + || !(c_isspace (delim[2]) || delim[2] == '\0')) { std::string new_text = std::string (set_cmd_prefix) + text; tracker.advance_custom_word_point_by (-(int) strlen (set_cmd_prefix)); @@ -785,14 +785,14 @@ source_command (const char *args, int from_tty) if (args[0] != '-') break; - if (args[1] == 'v' && isspace (args[2])) + if (args[1] == 'v' && c_isspace (args[2])) { source_verbose = 1; /* Skip passed -v. */ args = &args[3]; } - else if (args[1] == 's' && isspace (args[2])) + else if (args[1] == 's' && c_isspace (args[2])) { search_path = 1; @@ -1184,7 +1184,7 @@ pipe_command_completer (struct cmd_list_element *ignore, delimiter = opts.delimiter.c_str (); /* Check if we're past option values already. */ - if (text > org_text && !isspace (text[-1])) + if (text > org_text && !c_isspace (text[-1])) return; const char *delim = strstr (text, delimiter); @@ -1669,7 +1669,7 @@ disassemble_command (const char *arg, int from_tty) if (*p == '\0') error (_("Missing modifier.")); - while (*p && ! isspace (*p)) + while (*p && ! c_isspace (*p)) { switch (*p++) { @@ -1938,8 +1938,8 @@ alias_command_completer (struct cmd_list_element *ignore, typing COMMAND DEFAULT-ARGS... */ if (delim != text && delim != nullptr - && isspace (delim[-1]) - && (isspace (delim[1]) || delim[1] == '\0')) + && c_isspace (delim[-1]) + && (c_isspace (delim[1]) || delim[1] == '\0')) { std::string new_text = std::string (delim + 1); diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 48a3466..2b30a6e 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -16,7 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "symtab.h" -#include <ctype.h> #include "gdbsupport/gdb_regex.h" #include "completer.h" #include "ui-out.h" @@ -2053,8 +2052,8 @@ print_doc_line (struct ui_file *stream, const char *str, if (for_value_prefix) { char &c = (*line_buffer)[0]; - if (islower (c)) - c = toupper (c); + if (c_islower (c)) + c = c_toupper (c); if (line_buffer->back () == '.') line_buffer->pop_back (); } @@ -2227,7 +2226,7 @@ valid_cmd_char_p (int c) /* Alas "42" is a legitimate user-defined command. In the interests of not breaking anything we preserve that. */ - return isalnum (c) || c == '-' || c == '_' || c == '.'; + return c_isalnum (c) || c == '-' || c == '_' || c == '.'; } /* See command.h. */ @@ -2491,7 +2490,7 @@ lookup_cmd (const char **line, struct cmd_list_element *list, } else { - if (c->type == set_cmd && **line != '\0' && !isspace (**line)) + if (c->type == set_cmd && **line != '\0' && !c_isspace (**line)) error (_("Argument must be preceded by space.")); /* We've got something. It may still not be what the caller diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index afbbea6..3cdd9a3 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -23,7 +23,6 @@ #include "cli/cli-cmds.h" #include "value.h" #include "completer.h" -#include <ctype.h> #include "target.h" #include "readline/tilde.h" #include "gdbcore.h" diff --git a/gdb/cli/cli-option.c b/gdb/cli/cli-option.c index a30261e..5da8c73 100644 --- a/gdb/cli/cli-option.c +++ b/gdb/cli/cli-option.c @@ -227,7 +227,7 @@ parse_option (gdb::array_view<const option_def_group> options_group, match = &o; match_ctx = grp.ctx; - if ((isspace (arg[len]) || arg[len] == '\0') + if ((c_isspace (arg[len]) || arg[len] == '\0') && strlen (o.name) == len) break; /* Exact match. */ } @@ -635,7 +635,7 @@ complete_options (completion_tracker &tracker, if (ov && !tracker.have_completions () && **args == '\0' - && *args > text && !isspace ((*args)[-1])) + && *args > text && !c_isspace ((*args)[-1])) { tracker.advance_custom_word_point_by (*args - text); diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 3ea80a5..048d391 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -19,7 +19,6 @@ #include "event-top.h" #include "value.h" -#include <ctype.h> #include "ui-out.h" #include "top.h" @@ -829,7 +828,7 @@ locate_arg (const char *p) while ((p = strchr (p, '$'))) { if (startswith (p, "$arg") - && (isdigit (p[4]) || p[4] == 'c')) + && (c_isdigit (p[4]) || p[4] == 'c')) return p; p++; } @@ -1324,9 +1323,9 @@ validate_comname (const char **comname) /* Find the last word of the argument. */ p = *comname + strlen (*comname); - while (p > *comname && isspace (p[-1])) + while (p > *comname && c_isspace (p[-1])) p--; - while (p > *comname && !isspace (p[-1])) + while (p > *comname && !c_isspace (p[-1])) p--; last_word = p; diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 4d4695f..8528ac5 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -17,7 +17,6 @@ #include "readline/tilde.h" #include "value.h" -#include <ctype.h> #include "arch-utils.h" #include "observable.h" #include "interps.h" @@ -49,7 +48,7 @@ parse_auto_binary_operation (const char *arg) { int length = strlen (arg); - while (isspace (arg[length - 1]) && length > 0) + while (c_isspace (arg[length - 1]) && length > 0) length--; /* Note that "o" is ambiguous. */ diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c index 23706e0..d0ca594 100644 --- a/gdb/cli/cli-utils.c +++ b/gdb/cli/cli-utils.c @@ -20,7 +20,6 @@ #include "cli/cli-utils.h" #include "value.h" -#include <ctype.h> /* See documentation in cli-utils.h. */ @@ -46,7 +45,7 @@ get_ulongest (const char **pp, int trailer) /* Internal variable. Make a copy of the name, so we can null-terminate it to pass to lookup_internalvar(). */ const char *start = ++p; - while (isalnum (*p) || *p == '_') + while (c_isalnum (*p) || *p == '_') p++; std::string varname (start, p - start); if (!get_internalvar_integer (lookup_internalvar (varname.c_str ()), @@ -67,7 +66,7 @@ get_ulongest (const char **pp, int trailer) p = end; } - if (!(isspace (*p) || *p == '\0' || *p == trailer)) + if (!(c_isspace (*p) || *p == '\0' || *p == trailer)) error (_("Trailing junk at: %s"), p); p = skip_spaces (p); *pp = p; @@ -111,7 +110,7 @@ get_number_trailer (const char **pp, int trailer) const char *start = ++p; LONGEST longest_val; - while (isalnum (*p) || *p == '_') + while (c_isalnum (*p) || *p == '_') p++; varname = (char *) alloca (p - start + 1); strncpy (varname, start, p - start); @@ -136,7 +135,7 @@ get_number_trailer (const char **pp, int trailer) /* There is no number here. (e.g. "cond a == b"). */ { /* Skip non-numeric token. */ - while (*p && !isspace((int) *p)) + while (*p && !c_isspace((int) *p)) ++p; /* Return zero, which caller must interpret as error. */ retval = 0; @@ -144,10 +143,10 @@ get_number_trailer (const char **pp, int trailer) else retval = atoi (p1); } - if (!(isspace (*p) || *p == '\0' || *p == trailer)) + if (!(c_isspace (*p) || *p == '\0' || *p == trailer)) { /* Trailing junk: return 0 and let caller print error msg. */ - while (!(isspace (*p) || *p == '\0' || *p == trailer)) + while (!(c_isspace (*p) || *p == '\0' || *p == trailer)) ++p; retval = 0; } @@ -262,8 +261,8 @@ number_or_range_parser::get_number () option rather than an incomplete range, so check for end of string as well. */ if (m_cur_tok[0] == '-' - && !(isspace (m_cur_tok[-1]) - && (isalpha (m_cur_tok[1]) + && !(c_isspace (m_cur_tok[-1]) + && (c_isalpha (m_cur_tok[1]) || m_cur_tok[1] == '-' || m_cur_tok[1] == '\0'))) { @@ -293,7 +292,7 @@ number_or_range_parser::get_number () } else { - if (isdigit (*(m_cur_tok + 1))) + if (c_isdigit (*(m_cur_tok + 1))) error (_("negative value")); if (*(m_cur_tok + 1) == '$') { @@ -330,9 +329,9 @@ number_or_range_parser::finished () const integer, convenience var or negative convenience var. */ return (m_cur_tok == NULL || *m_cur_tok == '\0' || (!m_in_range - && !(isdigit (*m_cur_tok) || *m_cur_tok == '$') + && !(c_isdigit (*m_cur_tok) || *m_cur_tok == '$') && !(*m_cur_tok == '-' - && (isdigit (m_cur_tok[1]) || m_cur_tok[1] == '$')))); + && (c_isdigit (m_cur_tok[1]) || m_cur_tok[1] == '$')))); } /* Accept a number and a string-form list of numbers such as is @@ -370,7 +369,7 @@ number_is_in_list (const char *list, int number) const char * remove_trailing_whitespace (const char *start, const char *s) { - while (s > start && isspace (*(s - 1))) + while (s > start && c_isspace (*(s - 1))) --s; return s; @@ -420,7 +419,7 @@ int check_for_argument (const char **str, const char *arg, int arg_len) { if (strncmp (*str, arg, arg_len) == 0 - && ((*str)[arg_len] == '\0' || isspace ((*str)[arg_len]))) + && ((*str)[arg_len] == '\0' || c_isspace ((*str)[arg_len]))) { *str += arg_len; *str = skip_spaces (*str); |