#include "parser-defs.h"
#include "user-regs.h"
#include "xml-syscall.h"
-#include <ctype.h>
#include "record-full.h"
#include "linux-record.h"
static int
aarch64_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
{
- return (*s == '#' || isdigit (*s) /* Literal number. */
+ return (*s == '#' || c_isdigit (*s) /* Literal number. */
|| *s == '[' /* Register indirection. */
- || isalpha (*s)); /* Register value. */
+ || c_isalpha (*s)); /* Register value. */
}
/* This routine is used to parse a special token in AArch64's assembly.
start = tmp;
/* Register name. */
- while (isalnum (*tmp))
+ while (c_isalnum (*tmp))
++tmp;
if (*tmp != ',')
else if (*tmp == '+')
++tmp;
- if (!isdigit (*tmp))
+ if (!c_isdigit (*tmp))
return {};
displacement = strtol (tmp, &endp, 10);
%{
-#include <ctype.h>
#include "gdbsupport/unordered_map.h"
#include "expression.h"
#include "value.h"
[[fallthrough]];
case 'S':
renaming_expr += 1;
- if (isdigit (*renaming_expr))
+ if (c_isdigit (*renaming_expr))
{
char *next;
long val = strtol (renaming_expr, &next, 10);
const char *end = pstate->lexptr;
/* First the end of the prefix. Here we stop at the token start or
at '.' or space. */
- for (; end > m_original_expr && end[-1] != '.' && !isspace (end[-1]); --end)
+ for (; end > m_original_expr && end[-1] != '.' && !c_isspace (end[-1]); --end)
{
/* Nothing. */
}
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "event-top.h"
#include "exceptions.h"
#include "extract-store-integer.h"
{
gdb_assert (*str == '[');
++str;
- while (*str != '\0' && isalpha (*str))
+ while (*str != '\0' && c_isalpha (*str))
++str;
/* We accept a missing "]" in order to support completion. */
return *str == '\0' || (str[0] == ']' && str[1] == '\0');
static int
is_lower_alphanum (const char c)
{
- return (isdigit (c) || (isalpha (c) && islower (c)));
+ return (c_isdigit (c) || (c_isalpha (c) && c_islower (c)));
}
/* ENCODED is the linkage name of a symbol and LEN contains its length.
static void
ada_remove_trailing_digits (const char *encoded, int *len)
{
- if (*len > 1 && isdigit (encoded[*len - 1]))
+ if (*len > 1 && c_isdigit (encoded[*len - 1]))
{
int i = *len - 2;
- while (i > 0 && isdigit (encoded[i]))
+ while (i > 0 && c_isdigit (encoded[i]))
i--;
if (i >= 0 && encoded[i] == '.')
*len = i;
if (*len > 1
&& encoded[*len - 1] == 'N'
- && (isdigit (encoded[*len - 2]) || islower (encoded[*len - 2])))
+ && (c_isdigit (encoded[*len - 2]) || c_islower (encoded[*len - 2])))
*len = *len - 1;
}
remove_compiler_suffix (const char *encoded, int *len)
{
int offset = *len - 1;
- while (offset > 0 && isalpha (encoded[offset]))
+ while (offset > 0 && c_isalpha (encoded[offset]))
--offset;
if (offset > 0 && encoded[offset] == '.')
{
for (int i = 0; i < n; ++i)
{
- if (!isxdigit (str[i]))
+ if (!c_isxdigit (str[i]))
return false;
result <<= 4;
result |= fromhex (str[i]);
/* Remove trailing __{digit}+ or trailing ${digit}+. */
- if (len0 > 1 && isdigit (encoded[len0 - 1]))
+ if (len0 > 1 && c_isdigit (encoded[len0 - 1]))
{
i = len0 - 2;
- while ((i >= 0 && isdigit (encoded[i]))
- || (i >= 1 && encoded[i] == '_' && isdigit (encoded[i - 1])))
+ while ((i >= 0 && c_isdigit (encoded[i]))
+ || (i >= 1 && encoded[i] == '_' && c_isdigit (encoded[i - 1])))
i -= 1;
if (i > 1 && encoded[i] == '_' && encoded[i - 1] == '_')
len0 = i - 1;
/* The first few characters that are not alphabetic are not part
of any encoding we use, so we can copy them over verbatim. */
- for (i = 0; i < len0 && !isalpha (encoded[i]); i += 1)
+ for (i = 0; i < len0 && !c_isalpha (encoded[i]); i += 1)
decoded.push_back (encoded[i]);
at_start_name = 1;
int op_len = strlen (ada_opname_table[k].encoded);
if ((strncmp (ada_opname_table[k].encoded + 1, encoded + i + 1,
op_len - 1) == 0)
- && !isalnum (encoded[i + op_len]))
+ && !c_isalnum (encoded[i + op_len]))
{
decoded.append (ada_opname_table[k].decoded);
at_start_name = 0;
if (len0 - i > 5 && encoded [i] == '_' && encoded [i+1] == '_'
&& encoded [i+2] == 'B' && encoded [i+3] == '_'
- && isdigit (encoded [i+4]))
+ && c_isdigit (encoded [i+4]))
{
int k = i + 5;
- while (k < len0 && isdigit (encoded[k]))
+ while (k < len0 && c_isdigit (encoded[k]))
k++; /* Skip any extra digit. */
/* Double-check that the "__B_{DIGITS}+" sequence we found
internally generated. */
if (len0 - i > 3 && encoded [i] == '_' && encoded[i+1] == 'E'
- && isdigit (encoded[i+2]))
+ && c_isdigit (encoded[i+2]))
{
int k = i + 3;
- while (k < len0 && isdigit (encoded[k]))
+ while (k < len0 && c_isdigit (encoded[k]))
k++;
if (k < len0
i++;
}
- if (wide && i < len0 + 3 && encoded[i] == 'U' && isxdigit (encoded[i + 1]))
+ if (wide && i < len0 + 3 && encoded[i] == 'U' && c_isxdigit (encoded[i + 1]))
{
if (convert_from_hex_encoded (decoded, &encoded[i + 1], 2))
{
continue;
}
}
- else if (wide && i < len0 + 5 && encoded[i] == 'W' && isxdigit (encoded[i + 1]))
+ else if (wide && i < len0 + 5 && encoded[i] == 'W' && c_isxdigit (encoded[i + 1]))
{
if (convert_from_hex_encoded (decoded, &encoded[i + 1], 4))
{
}
}
else if (wide && i < len0 + 10 && encoded[i] == 'W' && encoded[i + 1] == 'W'
- && isxdigit (encoded[i + 2]))
+ && c_isxdigit (encoded[i + 2]))
{
if (convert_from_hex_encoded (decoded, &encoded[i + 2], 8))
{
}
}
- if (encoded[i] == 'X' && i != 0 && isalnum (encoded[i - 1]))
+ if (encoded[i] == 'X' && i != 0 && c_isalnum (encoded[i - 1]))
{
/* This is a X[bn]* sequence not separated from the previous
part of the name with a non-alpha-numeric character (in other
if (operators)
{
for (i = 0; i < decoded.length(); ++i)
- if (isupper (decoded[i]) || decoded[i] == ' ')
+ if (c_isupper (decoded[i]) || decoded[i] == ' ')
goto Suppress;
}
/* Skip optional leading __[0-9]+. */
- if (len > 3 && str[0] == '_' && str[1] == '_' && isdigit (str[2]))
+ if (len > 3 && str[0] == '_' && str[1] == '_' && c_isdigit (str[2]))
{
str += 3;
- while (isdigit (str[0]))
+ while (c_isdigit (str[0]))
str += 1;
}
if (str[0] == '.' || str[0] == '$')
{
matching = str + 1;
- while (isdigit (matching[0]))
+ while (c_isdigit (matching[0]))
matching += 1;
if (matching[0] == '\0')
return 1;
if (len > 3 && str[0] == '_' && str[1] == '_' && str[2] == '_')
{
matching = str + 3;
- while (isdigit (matching[0]))
+ while (c_isdigit (matching[0]))
matching += 1;
if (matching[0] == '\0')
return 1;
#endif
/* _E[0-9]+[bs]$ */
- if (len > 3 && str[0] == '_' && str [1] == 'E' && isdigit (str[2]))
+ if (len > 3 && str[0] == '_' && str [1] == 'E' && c_isdigit (str[2]))
{
matching = str + 3;
- while (isdigit (matching[0]))
+ while (c_isdigit (matching[0]))
matching += 1;
if ((matching[0] == 'b' || matching[0] == 's')
&& matching [1] == '\0')
return 1;
return 0;
}
- if (!isdigit (str[2]))
+ if (!c_isdigit (str[2]))
return 0;
for (k = 3; str[k] != '\0'; k += 1)
- if (!isdigit (str[k]) && str[k] != '_')
+ if (!c_isdigit (str[k]) && str[k] != '_')
return 0;
return 1;
}
- if (str[0] == '$' && isdigit (str[1]))
+ if (str[0] == '$' && c_isdigit (str[1]))
{
for (k = 2; str[k] != '\0'; k += 1)
- if (!isdigit (str[k]) && str[k] != '_')
+ if (!c_isdigit (str[k]) && str[k] != '_')
return 0;
return 1;
}
return 0;
for (i=0; decoded_name[i] != '\0'; i++)
- if (isalpha (decoded_name[i]) && !islower (decoded_name[i]))
+ if (c_isalpha (decoded_name[i]) && !c_islower (decoded_name[i]))
return 0;
return 1;
angle bracket notation. */
const char *tmp;
- for (tmp = sym_name; *tmp != '\0' && !isupper (*tmp); tmp++);
+ for (tmp = sym_name; *tmp != '\0' && !c_isupper (*tmp); tmp++);
if (*tmp != '\0')
match = false;
}
{
/* Wrapper field. */
}
- else if (isupper (name[0]))
+ else if (c_isupper (name[0]))
return 1;
}
{
ULONGEST RU;
- if (!isdigit (str[k]))
+ if (!c_isdigit (str[k]))
return 0;
/* Do it the hard way so as not to make any assumption about
the relationship of unsigned long (%lu scan format code) and
LONGEST. */
RU = 0;
- while (isdigit (str[k]))
+ while (c_isdigit (str[k]))
{
RU = RU * 10 + (str[k] - '0');
k += 1;
len = strlen (name);
- if (!isdigit (name[len - 1]))
+ if (!c_isdigit (name[len - 1]))
return 1;
- if (isdigit (name[len - 2]))
+ if (c_isdigit (name[len - 2]))
align_offset = len - 2;
else
align_offset = len - 1;
{
while ((tmp = strstr (name, "__")) != NULL)
{
- if (isdigit (tmp[2]))
+ if (c_isdigit (tmp[2]))
break;
else
name = tmp + 2;
else
return name;
- if (isascii (v) && isprint (v))
+ if (c_isascii (v) && c_isprint (v))
storage = string_printf ("'%c'", v);
else if (name[1] == 'U')
storage = string_printf ("'[\"%02x\"]'", v);
args = skip_spaces (args);
if (startswith (args, "if")
- && (isspace (args[2]) || args[2] == '\0'))
+ && (c_isspace (args[2]) || args[2] == '\0'))
{
args += 2;
args = skip_spaces (args);
/* Check whether a condition was provided. */
if (startswith (args, "if")
- && (isspace (args[2]) || args[2] == '\0'))
+ && (c_isspace (args[2]) || args[2] == '\0'))
{
args += 2;
args = skip_spaces (args);
&& symbol_search_name[1] == '_')
{
symbol_search_name += 2;
- while (isdigit (*symbol_search_name))
+ while (c_isdigit (*symbol_search_name))
++symbol_search_name;
if (symbol_search_name[0] == '_'
&& symbol_search_name[1] == '_')
. { error (_("Invalid character '%s' in expression."), yytext); }
%%
-#include <ctype.h>
/* Initialize the lexer for processing new expression. */
static void
{
if (*s2 != '_')
{
- *s1 = tolower(*s2);
+ *s1 = c_tolower(*s2);
s1 += 1;
}
}
exp = strtol(exp0, (char **) NULL, 10);
gdb_mpz result;
- while (isxdigit (*num0))
+ while (c_isxdigit (*num0))
{
int dig = fromhex (*num0);
if (dig >= base)
struct stoken result;
result.ptr = name;
- while (len > 0 && isspace (name0[len-1]))
+ while (len > 0 && c_isspace (name0[len-1]))
len -= 1;
if (name0[0] == '<' || strstr (name0, "___") != NULL)
}
else if (in_quotes)
name[i++] = name0[i0++];
- else if (isalnum (name0[i0]))
+ else if (c_isalnum (name0[i0]))
{
- name[i] = tolower (name0[i0]);
+ name[i] = c_tolower (name0[i0]);
i += 1; i0 += 1;
}
- else if (isspace (name0[i0]))
+ else if (c_isspace (name0[i0]))
i0 += 1;
else if (name0[i0] == '\'')
{
do
i += 1;
- while (isspace (str[i]));
+ while (c_isspace (str[i]));
if (strncasecmp (str + i, "all", 3) == 0
- && !isalnum (str[i + 3]) && str[i + 3] != '_')
+ && !c_isalnum (str[i + 3]) && str[i + 3] != '_')
return i0;
}
return -1;
return 1;
else if (str[0] == '\0')
return 0;
- else if (tolower (subseq[0]) == tolower (str[0]))
+ else if (c_tolower (subseq[0]) == c_tolower (str[0]))
return subseqMatch (subseq+1, str+1) || subseqMatch (subseq, str+1);
else
return subseqMatch (subseq, str+1);
{
gdb_assert (*str == '\'');
++str;
- while (isspace (*str))
+ while (c_isspace (*str))
++str;
int len = strlen (str);
rewind_to_char (int ch)
{
pstate->lexptr -= yyleng;
- while (toupper (*pstate->lexptr) != toupper (ch))
+ while (c_toupper (*pstate->lexptr) != c_toupper (ch))
pstate->lexptr -= 1;
yyrestart (NULL);
}
#include "cli/cli-style.h"
#include "typeprint.h"
#include "ada-lang.h"
-#include <ctype.h>
static int print_selected_record_field_types (struct type *, struct type *,
int, int,
if (s == name_buffer)
return name_buffer;
- if (!islower (s[1]))
+ if (!c_islower (s[1]))
return NULL;
for (s = q = name_buffer; *s != '\0'; q += 1)
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "event-top.h"
#include "extract-store-integer.h"
#include "gdbtypes.h"
/* If this character fits in the normal ASCII range, and is
a printable character, then print the character as if it was
an ASCII character, even if this is a wide character.
- The UCHAR_MAX check is necessary because the isascii function
+ The UCHAR_MAX check is necessary because the c_isascii function
requires that its argument have a value of an unsigned char,
or EOF (EOF is obviously not printable). */
- if (c <= UCHAR_MAX && isascii (c) && isprint (c))
+ if (c <= UCHAR_MAX && c_isascii (c) && c_isprint (c))
{
if (c == quoter && c == '"')
gdb_printf (stream, "\"\"");
#include "stap-probe.h"
#include "parser-defs.h"
#include "user-regs.h"
-#include <ctype.h>
#include "elf/common.h"
/* Under ARM GNU/Linux the traditional way of performing a breakpoint
static int
arm_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
{
- return (*s == '#' || *s == '$' || isdigit (*s) /* Literal number. */
+ return (*s == '#' || *s == '$' || c_isdigit (*s) /* Literal number. */
|| *s == '[' /* Register indirection or
displacement. */
- || isalpha (*s)); /* Register value. */
+ || c_isalpha (*s)); /* Register value. */
}
/* This routine is used to parse a special token in ARM's assembly.
start = tmp;
/* Register name. */
- while (isalnum (*tmp))
+ while (c_isalnum (*tmp))
++tmp;
if (*tmp != ',')
regname = (char *) alloca (len + 2);
offset = 0;
- if (isdigit (*start))
+ if (c_isdigit (*start))
{
/* If we are dealing with a register whose name begins with a
digit, it means we should prefix the name with the letter
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "extract-store-integer.h"
#include "frame.h"
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "auto-load.h"
#include "gdbsupport/gdb_vecs.h"
#include "progspace.h"
buf = name_holder.c_str ();
for (p = buf; *p != '\0'; ++p)
{
- if (isspace (*p))
+ if (c_isspace (*p))
break;
}
/* We don't allow nameless scripts, they're not helpful to the user. */
{
const char *cond_string;
- if (((*arg)[0] != 'i') || ((*arg)[1] != 'f') || !isspace ((*arg)[2]))
+ if (((*arg)[0] != 'i') || ((*arg)[1] != 'f') || !c_isspace ((*arg)[2]))
return NULL;
/* Skip the "if" keyword. */
First, check if there's an if clause. */
cond_string = ep_parse_optional_if_clause (&arg);
- if ((*arg != '\0') && !isspace (*arg))
+ if ((*arg != '\0') && !c_isspace (*arg))
error (_("Junk at end of arguments."));
std::unique_ptr<exec_catchpoint> c
First, check if there's an if clause. */
cond_string = ep_parse_optional_if_clause (&arg);
- if ((*arg != '\0') && !isspace (*arg))
+ if ((*arg != '\0') && !c_isspace (*arg))
error (_("Junk at end of arguments."));
/* If this target supports it, create a fork or vfork catchpoint
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "breakpoint.h"
#include "inferior.h"
#include "cli/cli-utils.h"
/* Skip whitespace. */
arg = skip_spaces (arg);
- for (i = 0; i < 127 && arg[i] && !isspace (arg[i]); ++i)
+ for (i = 0; i < 127 && arg[i] && !c_isspace (arg[i]); ++i)
cur_name[i] = arg[i];
cur_name[i] = '\0';
arg += i;
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "arch-utils.h"
-#include <ctype.h>
#include "breakpoint.h"
#include "exceptions.h"
#include "inferior.h"
cond_string = ep_parse_optional_if_clause (&arg);
- if ((*arg != '\0') && !isspace (*arg))
+ if ((*arg != '\0') && !c_isspace (*arg))
error (_("Junk at end of arguments."));
if (ex_event != EX_EVENT_THROW
{
gdb_assert (direction == parse_direction::backward);
- while (isspace (**curr))
+ while (c_isspace (**curr))
--(*curr);
tok_end = *curr;
- while (!isspace (**curr))
+ while (!c_isspace (**curr))
--(*curr);
tok_start = (*curr) + 1;
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "arch-utils.h"
-#include <ctype.h>
#include "event-top.h"
#include "exceptions.h"
#include "gdbsupport/gdb_vecs.h"
{
tracker.advance_custom_word_point_by (1);
/* We don't support completion of history indices. */
- if (!isdigit (text[1]))
+ if (!c_isdigit (text[1]))
complete_internalvar (tracker, &text[1]);
return;
}
int len;
len = exp_end - exp_start;
- while (len > 0 && isspace (exp_start[len - 1]))
+ while (len > 0 && c_isspace (exp_start[len - 1]))
len--;
error (_("Cannot watch constant value `%.*s'."), len, exp_start);
}
/* Decide if we are dealing with a static tracepoint marker (`-m'),
or with a normal static tracepoint. */
- if (arg && startswith (arg, "-m") && isspace (arg[2]))
+ if (arg && startswith (arg, "-m") && c_isspace (arg[2]))
{
ops = &strace_marker_breakpoint_ops;
locspec = new_linespec_location_spec (&arg,
#include "record-btrace.h"
#include <inttypes.h>
-#include <ctype.h>
#include <algorithm>
#include <string>
begin = *arg;
pos = skip_spaces (begin);
- if (!isdigit (*pos))
+ if (!c_isdigit (*pos))
error (_("Expected positive number, got: %s."), pos);
number = strtoul (pos, &end, 10);
{
const char *pos = skip_spaces (*arg);
- if (!isdigit (*pos))
+ if (!c_isdigit (*pos))
error (_("Expected positive number, got: %s."), pos);
char *end;
%{
-#include <ctype.h>
#include "expression.h"
#include "value.h"
#include "parser-defs.h"
#include "cp-abi.h"
#include "cp-support.h"
#include "gdbsupport/gdb_obstack.h"
-#include <ctype.h>
#include "gdbcore.h"
#include "gdbarch.h"
#include "c-exp.h"
#include "charset-list.h"
#include "gdbsupport/environ.h"
#include "arch-utils.h"
-#include <ctype.h>
#ifdef USE_WIN32API
#include <windows.h>
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));
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;
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);
if (*p == '\0')
error (_("Missing modifier."));
- while (*p && ! isspace (*p))
+ while (*p && ! c_isspace (*p))
{
switch (*p++)
{
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);
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"
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 ();
}
/* 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. */
}
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
#include "cli/cli-cmds.h"
#include "value.h"
#include "completer.h"
-#include <ctype.h>
#include "target.h"
#include "readline/tilde.h"
#include "gdbcore.h"
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. */
}
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);
#include "event-top.h"
#include "value.h"
-#include <ctype.h>
#include "ui-out.h"
#include "top.h"
while ((p = strchr (p, '$')))
{
if (startswith (p, "$arg")
- && (isdigit (p[4]) || p[4] == 'c'))
+ && (c_isdigit (p[4]) || p[4] == 'c'))
return p;
p++;
}
/* 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;
#include "readline/tilde.h"
#include "value.h"
-#include <ctype.h>
#include "arch-utils.h"
#include "observable.h"
#include "interps.h"
{
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. */
#include "cli/cli-utils.h"
#include "value.h"
-#include <ctype.h>
/* See documentation in cli-utils.h. */
/* 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 ()),
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;
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);
/* 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;
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;
}
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')))
{
}
else
{
- if (isdigit (*(m_cur_tok + 1)))
+ if (c_isdigit (*(m_cur_tok + 1)))
error (_("negative value"));
if (*(m_cur_tok + 1) == '$')
{
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
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;
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);
#include "gdbsupport/common-utils.h"
#include "coff/internal.h"
-#include <ctype.h>
/* Internal section information */
int i;
for (i = 0; i < forward_dll_name_len; i++)
- forward_qualified_name[i] = tolower (forward_qualified_name[i]);
+ forward_qualified_name[i] = c_tolower (forward_qualified_name[i]);
msymbol = lookup_minimal_symbol (current_program_space,
forward_qualified_name.c_str ());
}
#include "bfd.h"
#include "gdbsupport/gdb_obstack.h"
-#include <ctype.h>
#include "coff/internal.h"
#include "libcoff.h"
/* We can have multiple .stab sections if linked with
--split-by-reloc. */
for (s = name + sizeof ".stab" - 1; *s != '\0'; s++)
- if (!isdigit (*s))
+ if (!c_isdigit (*s))
break;
if (*s == '\0')
csi->stabsects->push_back (sectp);
/* The name must start with "__fu<digits>__". */
if (!startswith (cs->c_name, "__fu"))
return 0;
- if (! isdigit (cs->c_name[4]))
+ if (! c_isdigit (cs->c_name[4]))
return 0;
- for (i = 5; cs->c_name[i] != '\0' && isdigit (cs->c_name[i]); i++)
+ for (i = 5; cs->c_name[i] != '\0' && c_isdigit (cs->c_name[i]); i++)
/* Nothing, just incrementing index past all digits. */;
if (cs->c_name[i] != '_' || cs->c_name[i + 1] != '_')
return 0;
%{
-#include <ctype.h>
#include "expression.h"
#include "value.h"
#include "parser-defs.h"
len = strlen (s);
/* Check suffix for `i' , `fi' or `li' (idouble, ifloat or ireal). */
- if (len >= 1 && tolower (s[len - 1]) == 'i')
+ if (len >= 1 && c_tolower (s[len - 1]) == 'i')
{
- if (len >= 2 && tolower (s[len - 2]) == 'f')
+ if (len >= 2 && c_tolower (s[len - 2]) == 'f')
{
putithere->typed_val_float.type
= parse_d_type (ps)->builtin_ifloat;
len -= 2;
}
- else if (len >= 2 && tolower (s[len - 2]) == 'l')
+ else if (len >= 2 && c_tolower (s[len - 2]) == 'l')
{
putithere->typed_val_float.type
= parse_d_type (ps)->builtin_ireal;
}
}
/* Check suffix for `f' or `l'' (float or real). */
- else if (len >= 1 && tolower (s[len - 1]) == 'f')
+ else if (len >= 1 && c_tolower (s[len - 1]) == 'f')
{
putithere->typed_val_float.type
= parse_d_type (ps)->builtin_float;
len -= 1;
}
- else if (len >= 1 && tolower (s[len - 1]) == 'l')
+ else if (len >= 1 && c_tolower (s[len - 1]) == 'l')
{
putithere->typed_val_float.type
= parse_d_type (ps)->builtin_real;
/* Hex exponents start with 'p', because 'e' is a valid hex
digit and thus does not indicate a floating point number
when the radix is hex. */
- if ((!hex && !got_e && tolower (p[0]) == 'e')
- || (hex && !got_e && tolower (p[0] == 'p')))
+ if ((!hex && !got_e && c_tolower (p[0]) == 'e')
+ || (hex && !got_e && c_tolower (p[0] == 'p')))
got_dot = got_e = 1;
/* A '.' always indicates a decimal floating point number
regardless of the radix. If we have a '..' then its the
else if (!got_dot && (p[0] == '.' && p[1] != '.'))
got_dot = 1;
/* This is the sign of the exponent, not the end of the number. */
- else if (got_e && (tolower (p[-1]) == 'e' || tolower (p[-1]) == 'p')
+ else if (got_e && (c_tolower (p[-1]) == 'e'
+ || c_tolower (p[-1]) == 'p')
&& (*p == '-' || *p == '+'))
continue;
/* We will take any letters or digits, ignoring any embedded '_'.
const char *p = &tokstart[1];
size_t len = strlen ("entry");
- while (isspace (*p))
+ while (c_isspace (*p))
p++;
- if (strncmp (p, "entry", len) == 0 && !isalnum (p[len])
+ if (strncmp (p, "entry", len) == 0 && !c_isalnum (p[len])
&& p[len] != '_')
{
pstate->lexptr = &p[len];
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
-#include <ctype.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
#include <libproc.h>
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "gdbsupport/gdb_obstack.h"
#include "symtab.h"
#include "buildsym.h"
while ((c = *str++) != 0)
{
if (index_version >= 5)
- c = tolower (c);
+ c = c_tolower (c);
r = r * 67 + c - 113;
}
{
const unsigned char *str = (const unsigned char *) str_;
- /* Note: tolower here ignores UTF-8, which isn't fully compliant.
+ /* Note: c_tolower here ignores UTF-8, which isn't fully compliant.
See http://dwarfstd.org/ShowIssue.php?issue=161027.1. */
uint32_t hash = 5381;
while (int c = *str++)
- hash = hash * 33 + tolower (c);
+ hash = hash * 33 + c_tolower (c);
return hash;
}
uint32_t
dwarf5_djb_hash (std::string_view str)
{
- /* Note: tolower here ignores UTF-8, which isn't fully compliant.
+ /* Note: c_tolower here ignores UTF-8, which isn't fully compliant.
See http://dwarfstd.org/ShowIssue.php?issue=161027.1. */
uint32_t hash = 5381;
for (char c : str)
- hash = hash * 33 + tolower (c & 0xff);
+ hash = hash * 33 + c_tolower (c & 0xff);
return hash;
}
{
/* The next character should be an underscore ('_') followed
by a digit. */
- if (encoding[k] != '_' || !isdigit (encoding[k + 1]))
+ if (encoding[k] != '_' || !c_isdigit (encoding[k + 1]))
return false;
/* Skip the underscore. */
int start = k;
/* Determine the number of digits for our number. */
- while (isdigit (encoding[k]))
+ while (c_isdigit (encoding[k]))
k++;
if (k == start)
return false;
#include "gdbsupport/gdb_obstack.h"
#include "objfiles.h"
#include "typeprint.h"
-#include <ctype.h>
#include "expop.h"
#include "c-exp.h"
#include "inferior.h"
#include "readline/tilde.h"
#include "gdbcore.h"
-#include <ctype.h>
#include <sys/stat.h>
#include "solib.h"
#include <algorithm>
error (_("Must specify section name and its virtual address"));
/* Parse out section name. */
- for (secname = args; !isspace (*args); args++);
+ for (secname = args; !c_isspace (*args); args++);
unsigned seclen = args - secname;
/* Parse out new virtual address. */
#include "expop.h"
#include "ada-exp.h"
-#include <ctype.h>
/* Meant to be used in debug sessions, so don't export it in a header file. */
extern void ATTRIBUTE_USED debug_exp (struct expression *exp);
#include "language.h"
#include "f-lang.h"
#include "block.h"
-#include <ctype.h>
#include <algorithm>
#include "type-stack.h"
#include "f-exp.h"
while (len-- > 0)
{
c = *p++;
- if (isupper (c))
- c = tolower (c);
+ if (c_isupper (c))
+ c = c_tolower (c);
if (len == 0 && c == 'l')
long_p = 1;
else if (len == 0 && c == 'u')
if (pid == 0)
error (_("No current process: you must name one."));
}
- else if (built_argv.count () == 1 && isdigit (built_argv[0][0]))
+ else if (built_argv.count () == 1 && c_isdigit (built_argv[0][0]))
pid = strtol (built_argv[0], NULL, 10);
else
error (_("Invalid arguments."));
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "arch-utils.h"
-#include <ctype.h>
#include "cli/cli-cmds.h"
#include "value.h"
#include "target.h"
{
++s;
- while (*s != '\0' && *s != '/' && !isspace (*s))
+ while (*s != '\0' && *s != '/' && !c_isspace (*s))
{
- if (isdigit (*s))
+ if (c_isdigit (*s))
{
max_count = atoi (s);
- while (isdigit (*s))
+ while (c_isdigit (*s))
++s;
continue;
}
typedef int gdb_wint_t;
#define gdb_wcslen strlen
-#define gdb_iswprint isprint
-#define gdb_iswxdigit isxdigit
+#define gdb_iswprint c_isprint
+#define gdb_iswxdigit c_isxdigit
#define gdb_btowc /* empty */
#define gdb_WEOF EOF
}
-#include <ctype.h>
#include <setjmp.h>
#include <signal.h>
#include <sys/ptrace.h>
{
struct inf *inf = cur_inf ();
- if (!args || (!isdigit (*args) && strcmp (args, "none") != 0))
+ if (!args || (!c_isdigit (*args) && strcmp (args, "none") != 0))
error (_("Illegal argument to \"set signal-thread\" command.\n"
"Should be a thread ID, or \"none\"."));
#include "gdb-demangle.h"
#include "cp-abi.h"
#include "cp-support.h"
-#include <ctype.h>
static cp_abi_ops gnu_v2_abi_ops;
gnuv2_is_constructor_name (const char *name)
{
if ((name[0] == '_' && name[1] == '_'
- && (isdigit (name[2]) || strchr ("Qt", name[2])))
+ && (c_isdigit (name[2]) || strchr ("Qt", name[2])))
|| startswith (name, "__ct__"))
return complete_object_ctor;
else
%{
-#include <ctype.h>
#include "expression.h"
#include "value.h"
#include "parser-defs.h"
/* Handle suffixes: 'f' for float32, 'l' for long double.
FIXME: This appears to be an extension -- do we want this? */
- if (len >= 1 && tolower (p[len - 1]) == 'f')
+ if (len >= 1 && c_tolower (p[len - 1]) == 'f')
{
putithere->typed_val_float.type
= builtin_go_types->builtin_float32;
len--;
}
- else if (len >= 1 && tolower (p[len - 1]) == 'l')
+ else if (len >= 1 && c_tolower (p[len - 1]) == 'l')
{
putithere->typed_val_float.type
= parse_type (par_state)->builtin_long_double;
const char *p = &tokstart[1];
size_t len = strlen ("entry");
- while (isspace (*p))
+ while (c_isspace (*p))
p++;
- if (strncmp (p, "entry", len) == 0 && !isalnum (p[len])
+ if (strncmp (p, "entry", len) == 0 && !c_isalnum (p[len])
&& p[len] != '_')
{
par_state->lexptr = &p[len];
#include "parser-defs.h"
#include "gdbarch.h"
-#include <ctype.h>
/* The main function in the main package. */
static const char GO_MAIN_MAIN[] = "main.main";
while (p > buf)
{
int current = *(const unsigned char *) --p;
- int current_is_digit = isdigit (current);
+ int current_is_digit = c_isdigit (current);
if (saw_digit)
{
#include "cli/cli-utils.h"
#include "inf-child.h"
-#include <ctype.h>
#include <unistd.h>
#include <sys/utsname.h>
#include <io.h>
/* See README file in this directory for implementation notes, coding
conventions, et.al. */
-#include <ctype.h>
#include "charset.h"
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
#include "stap-probe.h"
#include "user-regs.h"
#include "expression.h"
-#include <ctype.h>
#include <algorithm>
#include <unordered_set>
#include "producer.h"
i386_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
{
return (*s == '$' /* Literal number. */
- || (isdigit (*s) && s[1] == '(' && s[2] == '%') /* Displacement. */
+ || (c_isdigit (*s) && s[1] == '(' && s[2] == '%') /* Displacement. */
|| (*s == '(' && s[1] == '%') /* Register indirection. */
- || (*s == '%' && isalpha (s[1]))); /* Register access. */
+ || (*s == '%' && c_isalpha (s[1]))); /* Register access. */
}
/* Helper function for i386_stap_parse_special_token.
{
const char *s = p->arg;
- if (isdigit (*s) || *s == '-' || *s == '+')
+ if (c_isdigit (*s) || *s == '-' || *s == '+')
{
bool got_minus[3];
int i;
got_minus[0] = true;
}
- if (!isdigit ((unsigned char) *s))
+ if (!c_isdigit (*s))
return {};
displacements[0] = strtol (s, &endp, 10);
got_minus[1] = true;
}
- if (!isdigit ((unsigned char) *s))
+ if (!c_isdigit (*s))
return {};
displacements[1] = strtol (s, &endp, 10);
got_minus[2] = true;
}
- if (!isdigit ((unsigned char) *s))
+ if (!c_isdigit (*s))
return {};
displacements[2] = strtol (s, &endp, 10);
s += 2;
start = s;
- while (isalnum (*s))
+ while (c_isalnum (*s))
++s;
if (*s++ != ')')
{
const char *s = p->arg;
- if (isdigit (*s) || *s == '(' || *s == '-' || *s == '+')
+ if (c_isdigit (*s) || *s == '(' || *s == '-' || *s == '+')
{
bool offset_minus = false;
long offset = 0;
offset_minus = true;
}
- if (offset_minus && !isdigit (*s))
+ if (offset_minus && !c_isdigit (*s))
return {};
- if (isdigit (*s))
+ if (c_isdigit (*s))
{
char *endp;
s += 2;
start = s;
- while (isalnum (*s))
+ while (c_isalnum (*s))
++s;
if (*s != ',' || s[1] != '%')
s += 2;
start = s;
- while (isalnum (*s))
+ while (c_isalnum (*s))
++s;
len_index = s - start;
#include "solib-svr4-linux.h"
#include "regset.h"
-#include <ctype.h>
/* The sigtramp code is in a non-readable (executable-only) region
of memory called the ``gate page''. The addresses in question
static int
ia64_linux_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
{
- return ((isdigit (*s) && s[1] == '[' && s[2] == 'r') /* Displacement. */
+ return ((c_isdigit (*s) && s[1] == '[' && s[2] == 'r') /* Displacement. */
|| *s == 'r' /* Register value. */
- || isdigit (*s)); /* Literal number. */
+ || c_isdigit (*s)); /* Literal number. */
}
/* Core file support. */
#include "reggroups.h"
#include "block.h"
#include "solib.h"
-#include <ctype.h>
#include "observable.h"
#include "target-descriptions.h"
#include "user-regs.h"
if (p[-1] == '&')
{
p--;
- while (p > args && isspace (p[-1]))
+ while (p > args && c_isspace (p[-1]))
p--;
*bg_char_p = 1;
resembling a register following it. */
if (addr_exp[0] == '$')
addr_exp++;
- if (isspace ((*addr_exp)) || (*addr_exp) == '\0')
+ if (c_isspace ((*addr_exp)) || (*addr_exp) == '\0')
error (_("Missing register name"));
/* Find the start/end of this register name/num/group. */
start = addr_exp;
- while ((*addr_exp) != '\0' && !isspace ((*addr_exp)))
+ while ((*addr_exp) != '\0' && !c_isspace ((*addr_exp)))
addr_exp++;
end = addr_exp;
#include "cli/cli-style.h"
#include "displaced-stepping.h"
#include "infrun.h"
-#include <ctype.h>
#include "exceptions.h"
#include "symtab.h"
#include "frame.h"
for (char *arg : built_argv)
{
wordlen = strlen (arg);
- for (digits = 0; isdigit (arg[digits]); digits++)
+ for (digits = 0; c_isdigit (arg[digits]); digits++)
{;
}
allsigs = 0;
return data out of a "language-specific" struct pointer that is set
whenever the working language changes. That would be a lot faster. */
-#include <ctype.h>
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "interps.h"
#include "target.h"
#include "arch-utils.h"
-#include <ctype.h>
#include "cli/cli-utils.h"
#include "filenames.h"
#include "ada-lang.h"
++(parser->lexer.stream);
}
- while (isdigit (*parser->lexer.stream))
+ while (c_isdigit (*parser->lexer.stream))
{
++tokenp->data.string.length;
++(parser->lexer.stream);
/* If the next character in the input buffer is not a space, comma,
quote, or colon, this input does not represent a number. */
if (*parser->lexer.stream != '\0'
- && !isspace (*parser->lexer.stream) && *parser->lexer.stream != ','
+ && !c_isspace (*parser->lexer.stream) && *parser->lexer.stream != ','
&& *parser->lexer.stream != ':'
&& !strchr (linespec_quote_characters, *parser->lexer.stream))
{
if (i == FORCE_KEYWORD_INDEX && p[len] == '\0')
return linespec_keywords[i];
- if (!isspace (p[len]))
+ if (!c_isspace (p[len]))
continue;
if (i == FORCE_KEYWORD_INDEX)
int nextlen = strlen (linespec_keywords[j]);
if (strncmp (p, linespec_keywords[j], nextlen) == 0
- && isspace (p[nextlen]))
+ && c_isspace (p[nextlen]))
return linespec_keywords[i];
}
}
int nextlen = strlen (linespec_keywords[j]);
if (strncmp (p, linespec_keywords[j], nextlen) == 0
- && isspace (p[nextlen]))
+ && c_isspace (p[nextlen]))
return NULL;
}
}
while (1)
{
- if (isspace (*parser->lexer.stream))
+ if (c_isspace (*parser->lexer.stream))
{
p = skip_spaces (parser->lexer.stream);
/* When we get here we know we've found something followed by
{
const char *op = parser->lexer.stream;
- while (op > start && isspace (op[-1]))
+ while (op > start && c_isspace (op[-1]))
op--;
if (op - start >= CP_OPERATOR_LEN)
{
op -= CP_OPERATOR_LEN;
if (strncmp (op, CP_OPERATOR_STR, CP_OPERATOR_LEN) == 0
&& (op == start
- || !(isalnum (op[-1]) || op[-1] == '_')))
+ || !(c_isalnum (op[-1]) || op[-1] == '_')))
{
/* This is an operator name. Keep going. */
++(parser->lexer.stream);
else
line_offset.sign = LINE_OFFSET_NONE;
- if (*string != '\0' && !isdigit (*string))
+ if (*string != '\0' && !c_isdigit (*string))
error (_("malformed line offset: \"%s\""), start);
/* Right now, we only allow base 10 for offsets. */
#include "gdbsupport/eintr.h"
#include "target/waitstatus.h"
#include <dirent.h>
-#include <ctype.h>
#include <list>
/* Now find actual file positions. */
rewinddir (d);
while ((de = readdir (d)) != NULL)
- if (isdigit (de->d_name[0]))
+ if (c_isdigit (de->d_name[0]))
{
tmp = strtol (&de->d_name[0], NULL, 10);
fp->filepos[tmp] = call_lseek (tmp, 0, SEEK_CUR);
#include "elf-bfd.h"
#include "gregset.h"
#include "gdbcore.h"
-#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "inf-loop.h"
#include "cli/cli-style.h"
#include "gdbsupport/unordered_map.h"
-#include <ctype.h>
#include <algorithm>
/* This enum represents the values that the user can choose when
p = skip_spaces (p);
const char *permissions_start = p;
- while (*p && !isspace (*p))
+ while (*p && !c_isspace (*p))
p++;
mapping.permissions = std::string (permissions_start,
(size_t) (p - permissions_start));
p = skip_spaces (p);
const char *device_start = p;
- while (*p && !isspace (*p))
+ while (*p && !c_isspace (*p))
p++;
mapping.device = {device_start, (size_t) (p - device_start)};
char filename[100];
fileio_error target_errno;
- if (args && isdigit (args[0]))
+ if (args && c_isdigit (args[0]))
{
char *tem;
specifically under the entry of `/proc/[pid]/stat'. */
/* Getting rid of the PID, since we already have it. */
- while (isdigit (*proc_stat))
+ while (c_isdigit (*proc_stat))
++proc_stat;
proc_stat = skip_spaces (proc_stat);
{
/* Advancing the pointer to the beginning of the UID. */
tmpstr += sizeof ("Uid:");
- while (*tmpstr != '\0' && !isdigit (*tmpstr))
+ while (*tmpstr != '\0' && !c_isdigit (*tmpstr))
++tmpstr;
- if (isdigit (*tmpstr))
+ if (c_isdigit (*tmpstr))
p->pr_uid = strtol (tmpstr, &tmpstr, 10);
}
{
/* Advancing the pointer to the beginning of the GID. */
tmpstr += sizeof ("Gid:");
- while (*tmpstr != '\0' && !isdigit (*tmpstr))
+ while (*tmpstr != '\0' && !c_isdigit (*tmpstr))
++tmpstr;
- if (isdigit (*tmpstr))
+ if (c_isdigit (*tmpstr))
p->pr_gid = strtol (tmpstr, &tmpstr, 10);
}
#include "auto-load.h"
#include "cli/cli-utils.h"
#include <signal.h>
-#include <ctype.h>
#include "nat/linux-namespaces.h"
#include <algorithm>
#include "gdbsupport/pathstuff.h"
#include "probe.h"
#include "cp-support.h"
-#include <ctype.h>
#include <string.h>
static std::string
whitespace or comma. */
if (*start == '-' || *start == '+')
{
- while (*inp[0] != '\0' && *inp[0] != ',' && !isspace (*inp[0]))
+ while (*inp[0] != '\0' && *inp[0] != ',' && !c_isspace (*inp[0]))
++(*inp);
}
else
{
/* Handle numbers first, stopping at the next whitespace or ','. */
- while (isdigit (*inp[0]))
+ while (c_isdigit (*inp[0]))
++(*inp);
- if (*inp[0] == '\0' || isspace (*inp[0]) || *inp[0] == ',')
+ if (*inp[0] == '\0' || c_isspace (*inp[0]) || *inp[0] == ',')
return gdb::unique_xmalloc_ptr<char> (savestring (start,
*inp - start));
*inp = start;
while ((*inp)[0]
&& (*inp)[0] != ','
- && !(isspace ((*inp)[0])
+ && !(c_isspace ((*inp)[0])
|| linespec_lexer_lex_keyword (&(*inp)[1])))
{
/* Special case: C++ operator,. */
{
const char *p = comma;
- while (p > start && isspace (p[-1]))
+ while (p > start && c_isspace (p[-1]))
p--;
if (p - start >= CP_OPERATOR_LEN)
{
p -= CP_OPERATOR_LEN;
if (strncmp (p, CP_OPERATOR_STR, CP_OPERATOR_LEN) == 0
&& (p == start
- || !(isalnum (p[-1]) || p[-1] == '_')))
+ || !(c_isalnum (p[-1]) || p[-1] == '_')))
{
return true;
}
if (argp == NULL
|| *argp == NULL
|| *argp[0] != '-'
- || !isalpha ((*argp)[1])
+ || !c_isalpha ((*argp)[1])
|| ((*argp)[0] == '-' && (*argp)[1] == 'p'))
return NULL;
}
/* Only emit an "invalid argument" error for options
that look like option strings. */
- else if (opt.get ()[0] == '-' && !isdigit (opt.get ()[1]))
+ else if (opt.get ()[0] == '-' && !c_isdigit (opt.get ()[1]))
{
if (completion_info == NULL)
error (_("invalid explicit location argument, \"%s\""), opt.get ());
#include <sys/types.h>
#include <sys/stat.h>
-#include <ctype.h>
#include "gdbsupport/event-loop.h"
#include "ui-out.h"
If pid_or_core_arg's first character is a digit, try attach
first and then corefile. Otherwise try just corefile. */
- if (isdigit (pid_or_core_arg[0]))
+ if (c_isdigit (pid_or_core_arg[0]))
{
ret = catch_command_errors (attach_command, pid_or_core_arg,
!batch_flag);
#include "arch-utils.h"
-#include <ctype.h>
#include <cmath>
#include <signal.h>
#include "command.h"
sect = NULL;
p = arg;
- if (!isdigit (*p))
+ if (!c_isdigit (*p))
{ /* See if we have a valid section name. */
- while (*p && !isspace (*p)) /* Find end of section name. */
+ while (*p && !c_isspace (*p)) /* Find end of section name. */
p++;
if (*p == '\000') /* End of command? */
error (_("Need to specify section name and address"));
#include "language.h"
#include "location.h"
#include "linespec.h"
-#include <ctype.h>
#include "tracepoint.h"
enum
result += "\\\"";
break;
default:
- if (isprint (argv[0][i]))
+ if (c_isprint (argv[0][i]))
result += argv[0][i];
else
{
#include "valprint.h"
#include "mi-getopt.h"
#include "extension.h"
-#include <ctype.h>
#include "mi-parse.h"
#include <optional>
#include "inferior.h"
#include "varobj.h"
#include "language.h"
#include "value.h"
-#include <ctype.h>
#include "mi-getopt.h"
#include "gdbthread.h"
#include "mi-parse.h"
gen_name = varobj_gen_name ();
name = gen_name.c_str ();
}
- else if (!isalpha (name[0]))
+ else if (!c_isalpha (name[0]))
error (_("-var-create: name of object must begin with a letter"));
if (strcmp (frame, "*") == 0)
#include <optional>
#include "gdbsupport/byte-vector.h"
-#include <ctype.h>
#include "gdbsupport/run-time-clock.h"
#include <chrono>
#include "progspace-and-thread.h"
#include "mi-cmds.h"
#include "mi-parse.h"
-#include <ctype.h>
#include "cli/cli-utils.h"
#include "language.h"
while (++count < 3)
{
c = (**string_ptr);
- if (isdigit (c) && c != '8' && c != '9')
+ if (c_isdigit (c) && c != '8' && c != '9')
{
(*string_ptr)++;
i *= 8;
return;
}
/* Insist on trailing white space. */
- if (chp[1] != '\0' && !isspace (chp[1]))
+ if (chp[1] != '\0' && !c_isspace (chp[1]))
{
freeargv (argv);
return;
int len;
const char *start = chp;
- while (*chp != '\0' && !isspace (*chp))
+ while (*chp != '\0' && !c_isspace (*chp))
{
chp++;
}
{
const char *tmp = chp + 1; /* discard ``-'' */
- for (; *chp && !isspace (*chp); chp++)
+ for (; *chp && !c_isspace (*chp); chp++)
;
this->command = make_unique_xstrndup (tmp, chp - tmp);
}
else
break;
- if (*chp != '\0' && !isspace (*chp))
+ if (*chp != '\0' && !c_isspace (*chp))
error (_("Invalid value for the '%s' option"), option);
chp = skip_spaces (chp);
}
to figure out what full symbol table entries need to be read in. */
-#include <ctype.h>
#include "maint.h"
#include "symtab.h"
#include "bfd.h"
#include <sys/types.h>
#include <sys/sysinfo.h>
-#include <ctype.h>
#include <utmp.h>
#include <time.h>
#include <unistd.h>
PID_T tid;
int core;
- if (!isdigit (dp->d_name[0])
+ if (!c_isdigit (dp->d_name[0])
|| NAMELEN (dp) > MAX_PID_T_STRLEN)
continue;
std::string cores_str;
int i;
- if (!isdigit (dp->d_name[0])
+ if (!c_isdigit (dp->d_name[0])
|| NAMELEN (dp) > MAX_PID_T_STRLEN)
continue;
{
PID_T pid, pgid;
- if (!isdigit (dp->d_name[0])
+ if (!c_isdigit (dp->d_name[0])
|| NAMELEN (dp) > MAX_PID_T_STRLEN)
continue;
struct stat statbuf;
char procentry[sizeof ("/proc/4294967295")];
- if (!isdigit (dp->d_name[0])
+ if (!c_isdigit (dp->d_name[0])
|| NAMELEN (dp) > sizeof ("4294967295") - 1)
continue;
PID_T tid;
int core;
- if (!isdigit (dp2->d_name[0])
+ if (!c_isdigit (dp2->d_name[0])
|| NAMELEN (dp2) > sizeof ("4294967295") - 1)
continue;
struct stat statbuf;
char procentry[sizeof ("/proc/4294967295")];
- if (!isdigit (dp->d_name[0])
+ if (!c_isdigit (dp->d_name[0])
|| NAMELEN (dp) > sizeof ("4294967295") - 1)
continue;
char buf[1000];
ssize_t rslt;
- if (!isdigit (dp2->d_name[0]))
+ if (!c_isdigit (dp2->d_name[0]))
continue;
std::string fdname
if (pid == 0)
error (_("No current process: you must name one."));
}
- else if (built_argv.count () == 1 && isdigit (built_argv[0][0]))
+ else if (built_argv.count () == 1 && c_isdigit (built_argv[0][0]))
pid = strtol (built_argv[0], NULL, 10);
else
error (_("Invalid arguments."));
#include "cli/cli-utils.h"
#include "c-exp.h"
-#include <ctype.h>
#include <algorithm>
struct objc_object {
for (;;)
{
- if (isalnum (*s2) || (*s2 == '_') || (*s2 == ':'))
+ if (c_isalnum (*s2) || (*s2 == '_') || (*s2 == ':'))
*s1++ = *s2;
- else if (isspace (*s2))
+ else if (c_isspace (*s2))
;
else if ((*s2 == '\0') || (*s2 == '\''))
break;
s1++;
nclass = s1;
- while (isalnum (*s1) || (*s1 == '_'))
+ while (c_isalnum (*s1) || (*s1 == '_'))
s1++;
s2 = s1;
s2++;
s2 = skip_spaces (s2);
ncategory = s2;
- while (isalnum (*s2) || (*s2 == '_'))
+ while (c_isalnum (*s2) || (*s2 == '_'))
s2++;
*s2++ = '\0';
}
for (;;)
{
- if (isalnum (*s2) || (*s2 == '_') || (*s2 == ':'))
+ if (c_isalnum (*s2) || (*s2 == '_') || (*s2 == ':'))
*s1++ = *s2;
- else if (isspace (*s2))
+ else if (c_isspace (*s2))
;
else if (*s2 == ']')
break;
Probably also lots of other problems, less well defined PM. */
%{
-#include <ctype.h>
#include "expression.h"
#include "value.h"
#include "parser-defs.h"
{
/* Handle suffixes: 'f' for float, 'l' for long double.
FIXME: This appears to be an extension -- do we want this? */
- if (len >= 1 && tolower (p[len - 1]) == 'f')
+ if (len >= 1 && c_tolower (p[len - 1]) == 'f')
{
putithere->typed_val_float.type
= parse_type (par_state)->builtin_float;
len--;
}
- else if (len >= 1 && tolower (p[len - 1]) == 'l')
+ else if (len >= 1 && c_tolower (p[len - 1]) == 'l')
{
putithere->typed_val_float.type
= parse_type (par_state)->builtin_long_double;
if (explen > 2)
for (const auto &token : tokentab3)
if (strncasecmp (tokstart, token.oper, 3) == 0
- && (!isalpha (token.oper[0]) || explen == 3
- || (!isalpha (tokstart[3])
- && !isdigit (tokstart[3]) && tokstart[3] != '_')))
+ && (!c_isalpha (token.oper[0]) || explen == 3
+ || (!c_isalpha (tokstart[3])
+ && !c_isdigit (tokstart[3]) && tokstart[3] != '_')))
{
pstate->lexptr += 3;
yylval.opcode = token.opcode;
if (explen > 1)
for (const auto &token : tokentab2)
if (strncasecmp (tokstart, token.oper, 2) == 0
- && (!isalpha (token.oper[0]) || explen == 2
- || (!isalpha (tokstart[2])
- && !isdigit (tokstart[2]) && tokstart[2] != '_')))
+ && (!c_isalpha (token.oper[0]) || explen == 2
+ || (!c_isalpha (tokstart[2])
+ && !c_isdigit (tokstart[2]) && tokstart[2] != '_')))
{
pstate->lexptr += 2;
yylval.opcode = token.opcode;
#include "p-lang.h"
#include "valprint.h"
#include "value.h"
-#include <ctype.h>
#include "c-lang.h"
#include "gdbarch.h"
#include "cli/cli-style.h"
#include "p-lang.h"
#include "typeprint.h"
#include "gdb-demangle.h"
-#include <ctype.h>
#include "cli/cli-style.h"
/* See language.h. */
{
gdb_puts (" (", stream);
/* We must demangle this. */
- while (isdigit (physname[0]))
+ while (c_isdigit (physname[0]))
{
int len = 0;
int i, j;
char *argname;
- while (isdigit (physname[len]))
+ while (c_isdigit (physname[len]))
{
len++;
}
during the process of parsing; the lower levels of the tree always
come first in the result. */
-#include <ctype.h>
#include "arch-utils.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "cli/cli-utils.h"
#include "parser-defs.h"
#include "user-regs.h"
-#include <ctype.h>
#include "elf-bfd.h"
#include "producer.h"
#include "target-float.h"
ppc_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
{
return (*s == 'i' /* Literal number. */
- || (isdigit (*s) && s[1] == '('
- && isdigit (s[2])) /* Displacement. */
- || (*s == '(' && isdigit (s[1])) /* Register indirection. */
- || isdigit (*s)); /* Register value. */
+ || (c_isdigit (*s) && s[1] == '('
+ && c_isdigit (s[2])) /* Displacement. */
+ || (*s == '(' && c_isdigit (s[1])) /* Register indirection. */
+ || c_isdigit (*s)); /* Register value. */
}
/* Implementation of `gdbarch_stap_parse_special_token', as defined in
ppc_stap_parse_special_token (struct gdbarch *gdbarch,
struct stap_parse_info *p)
{
- if (isdigit (*p->arg))
+ if (c_isdigit (*p->arg))
{
/* This temporary pointer is needed because we have to do a lookahead.
We could be dealing with a register displacement, and in such case
char *regname;
int len;
- while (isdigit (*s))
+ while (c_isdigit (*s))
++s;
if (*s == '(')
#include "ax.h"
#include "ax-gdb.h"
#include "location.h"
-#include <ctype.h>
#include <algorithm>
#include <optional>
const char *keyword = *csp;
size_t len = strlen (keyword);
- if (strncmp (s, keyword, len) == 0 && isspace (s[len]))
+ if (strncmp (s, keyword, len) == 0 && c_isspace (s[len]))
{
*linespecp += len + 1;
return 1;
#include <sys/syscall.h>
#include "gdbsupport/gdb_wait.h"
#include <signal.h>
-#include <ctype.h>
#include "gdb_bfd.h"
#include "auxv.h"
#include "procfs.h"
gdb_argv built_argv (args);
for (char *arg : built_argv)
{
- if (isdigit (arg[0]))
+ if (c_isdigit (arg[0]))
{
pid = strtoul (arg, &tmp, 10);
if (*tmp == '/')
error_no_arg (_("system call to trace"));
pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
- if (isdigit (args[0]))
+ if (c_isdigit (args[0]))
{
const int syscallnum = atoi (args);
"GNU Fortran 4.8.2 20140120 (Red Hat 4.8.2-16) -mtune=generic ..."
"GNU C++14 5.0.0 20150123 (experimental)"
*/
- while (*cs && !isspace (*cs))
+ while (*cs && !c_isspace (*cs))
cs++;
- if (*cs && isspace (*cs))
+ if (*cs && c_isspace (*cs))
cs++;
if (sscanf (cs, "%d.%d", major, minor) == 2)
return 1;
{
gdb_assert (name != nullptr);
- if (*name == '\0' || !isalpha (*name))
+ if (*name == '\0' || !c_isalpha (*name))
return false;
for (; *name != '\0'; ++name)
- if (!isalnum (*name) && *name != '_' && *name != '-')
+ if (!c_isalnum (*name) && *name != '_' && *name != '-')
return false;
return true;
}
for (int i = 0; i < name_len; i++)
{
- if (!isalnum (name[i]) && name[i] != '-')
+ if (!c_isalnum (name[i]) && name[i] != '-')
{
PyErr_Format
(PyExc_ValueError,
PyErr_SetString (PyExc_ValueError, _("MI command name is empty."));
return -1;
}
- else if ((name_len < 2) || (name[0] != '-') || !isalnum (name[1]))
+ else if ((name_len < 2) || (name[0] != '-') || !c_isalnum (name[1]))
{
PyErr_SetString (PyExc_ValueError,
_("MI command name does not start with '-'"
{
for (int i = 2; i < name_len; i++)
{
- if (!isalnum (name[i]) && name[i] != '-')
+ if (!c_isalnum (name[i]) && name[i] != '-')
{
PyErr_Format
(PyExc_ValueError,
return 0;
for (i = 0; i < n; ++i)
{
- if (!isxdigit (string[i]))
+ if (!c_isxdigit (string[i]))
return 0;
}
return 1;
#include "python.h"
#include "extension-priv.h"
#include "cli/cli-utils.h"
-#include <ctype.h>
#include "location.h"
#include "run-on-main-thread.h"
#include "observable.h"
#include "interps.h"
#include "top.h"
-#include <ctype.h>
/* This is the debug switch for process record. */
unsigned int record_debug = 0;
begin = *arg;
pos = skip_spaces (begin);
- if (!isdigit (*pos))
+ if (!c_isdigit (*pos))
error (_("Expected positive number, got: %s."), pos);
number = strtoulst (pos, &end, 10);
pos = skip_spaces (*arg);
- if (!isdigit (*pos))
+ if (!c_isdigit (*pos))
error (_("Expected positive number, got: %s."), pos);
long result = strtol (pos, &end, 10);
for (; *args; ++args)
{
- if (isspace (*args))
+ if (c_isspace (*args))
break;
if (*args == '/')
for (; *args; ++args)
{
- if (isspace (*args))
+ if (c_isspace (*args))
break;
if (*args == '/')
#include "inferior.h"
#include "infrun.h"
#include "value.h"
-#include <ctype.h>
#include <fcntl.h>
#include <signal.h>
#include <setjmp.h>
/* See the GDB User Guide for details of the GDB remote protocol. */
-#include <ctype.h>
#include <fcntl.h>
#include "exceptions.h"
#include "gdbsupport/common-inferior.h"
/* The stub recognized the packet request. Check that the
operation succeeded. */
if (buf[0] == 'E'
- && isxdigit (buf[1]) && isxdigit (buf[2])
+ && c_isxdigit (buf[1]) && c_isxdigit (buf[2])
&& buf[3] == '\0')
/* "Enn" - definitely an error. */
return packet_result::make_numeric_error (buf + 1);
while (annex[i] && (i < (get_remote_packet_size () - 8)))
{
/* Bad caller may have sent forbidden characters. */
- gdb_assert (isprint (annex[i]) && annex[i] != '$' && annex[i] != '#');
+ gdb_assert (c_isprint (annex[i]) && annex[i] != '$' && annex[i] != '#');
*p2++ = annex[i];
i++;
}
for (int i = 0; i < buf.size (); ++i)
{
gdb_byte c = buf[i];
- if (isprint (c))
+ if (c_isprint (c))
gdb_putc (c, &stb);
else
gdb_printf (&stb, "\\x%02x", (unsigned char) c);
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "block.h"
#include "c-lang.h"
gdb_puts ("\\t", stream);
else if (ch == '\0')
gdb_puts ("\\0", stream);
- else if (ch >= 32 && ch <= 127 && isprint (ch))
+ else if (ch >= 32 && ch <= 127 && c_isprint (ch))
gdb_putc (ch, stream);
else if (ch <= 255)
gdb_printf (stream, "\\x%02x", ch);
gdb_putc (ccw_bits[b], file);
}
else
- gdb_putc (tolower (ccw_bits[b]), file);
+ gdb_putc (c_tolower (ccw_bits[b]), file);
}
gdb_putc ('\n', file);
}
static int
s390_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
{
- return ((isdigit (*s) && s[1] == '(' && s[2] == '%') /* Displacement
+ return ((c_isdigit (*s) && s[1] == '(' && s[2] == '%') /* Displacement
or indirection. */
|| *s == '%' /* Register access. */
- || isdigit (*s)); /* Literal number. */
+ || c_isdigit (*s)); /* Literal number. */
}
/* gdbarch init. */
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "serial.h"
#include "cli/cli-cmds.h"
#include "cli/cli-utils.h"
break;
default:
gdb_printf (stream,
- isprint (ch) ? "%c" : "\\x%02x", ch & 0xFF);
+ c_isprint (ch) ? "%c" : "\\x%02x", ch & 0xFF);
break;
}
}
protocol_end += protocol_delim.length ();
std::transform (protocol.begin (), protocol.end (), protocol.begin (),
- [] (unsigned char c) { return std::tolower (c); });
+ [] (unsigned char c) { return c_tolower (c); });
std::string_view path;
size_t path_end = uri.find_first_of ("#?", protocol_end);
for (size_t i = 0; i < path.length (); ++i)
if (path[i] == '%'
&& i < path.length () - 2
- && std::isxdigit (path[i + 1])
- && std::isxdigit (path[i + 2]))
+ && c_isxdigit (path[i + 1])
+ && c_isxdigit (path[i + 2]))
{
std::string_view hex_digits = path.substr (i + 1, 2);
decoded_path += std::stoi (std::string (hex_digits), 0, 16);
#include "c-lang.h"
#include "cp-abi.h"
#include "cp-support.h"
-#include <ctype.h>
#include "block.h"
#include "filenames.h"
p = *string + 1;
/* Read number as reference id. */
- while (*p && isdigit (*p))
+ while (*p && c_isdigit (*p))
{
refnum = refnum * 10 + *p - '0';
p++;
deftypes we know how to handle is a local. */
if (!strchr ("cfFGpPrStTvVXCR", *p))
#else
- if (isdigit (*p) || *p == '(' || *p == '-')
+ if (c_isdigit (*p) || *p == '(' || *p == '-')
#endif
deftype = 'l';
else
break;
case '@':
- if (isdigit (**pp) || **pp == '(' || **pp == '-')
+ if (c_isdigit (**pp) || **pp == '(' || **pp == '-')
{ /* Member (class & variable) type */
/* FIXME -- we should be doing smash_to_XXX types here. */
/* Check if we're past a valid LEVEL already. */
if (levels.finished ()
- && cmd > text && !isspace (cmd[-1]))
+ && cmd > text && !c_isspace (cmd[-1]))
return;
/* We're past LEVELs, advance word point. */
return;
/* Check if we're past a valid COUNT already. */
- if (cmd > text && !isspace (cmd[-1]))
+ if (cmd > text && !c_isspace (cmd[-1]))
return;
/* We're past COUNT, advance word point. */
#include "expop.h"
#include "gdbsupport/unordered_map.h"
-#include <ctype.h>
/* The name of the SystemTap section where we will find information about
the probes. */
if (r != NULL)
*r = "";
- return isdigit (*s) > 0;
+ return c_isdigit (*s) > 0;
}
for (p = t; *p != NULL; ++p)
{
size_t len = strlen (*p);
- if ((len == 0 && isdigit (*s))
+ if ((len == 0 && c_isdigit (*s))
|| (len > 0 && strncasecmp (s, *p, len) == 0))
{
/* Integers may or may not have a prefix. The "len == 0"
struct type *long_type = builtin_type (gdbarch)->builtin_long;
operation_up disp_op;
- if (isdigit (*p->arg))
+ if (c_isdigit (*p->arg))
{
/* The value of the displacement. */
long displacement;
start = p->arg;
/* We assume the register name is composed by letters and numbers. */
- while (isalnum (*p->arg))
+ while (c_isalnum (*p->arg))
++p->arg;
std::string regname (start, p->arg - start);
/* We only add the GDB's register prefix/suffix if we are dealing with
a numeric register. */
- if (isdigit (*start))
+ if (c_isdigit (*start))
{
if (gdb_reg_prefix != NULL)
regname = gdb_reg_prefix + regname;
if (p->inside_paren_p)
tmp = skip_spaces (tmp);
- while (isdigit (*tmp))
+ while (c_isdigit (*tmp))
{
/* We skip the digit here because we are only interested in
knowing what kind of unary operation this is. The digit
(std::move (result)));
}
}
- else if (isdigit (*p->arg))
+ else if (c_isdigit (*p->arg))
{
/* A temporary variable, needed for lookahead. */
const char *tmp = p->arg;
expr::operation_up result;
if (*p->arg == '-' || *p->arg == '~' || *p->arg == '+' || *p->arg == '!'
- || isdigit (*p->arg)
+ || c_isdigit (*p->arg)
|| gdbarch_stap_is_single_operand (p->gdbarch, p->arg))
result = stap_parse_single_operand (p);
else if (*p->arg == '(')
This loop shall continue until we run out of characters in the input,
or until we find a close-parenthesis, which means that we've reached
the end of a sub-expression. */
- while (*p->arg != '\0' && *p->arg != ')' && !isspace (*p->arg))
+ while (*p->arg != '\0' && *p->arg != ')' && !c_isspace (*p->arg))
{
const char *tmp_exp_buf;
enum exp_opcode opcode;
Where `N' can be [+,-][1,2,4,8]. This is not mandatory, so
we check it here. If we don't find it, go to the next
state. */
- if ((cur[0] == '-' && isdigit (cur[1]) && cur[2] == '@')
- || (isdigit (cur[0]) && cur[1] == '@'))
+ if ((cur[0] == '-' && c_isdigit (cur[1]) && cur[2] == '@')
+ || (c_isdigit (cur[0]) && cur[1] == '@'))
{
if (*cur == '-')
{
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <ctype.h>
#include <chrono>
#include <algorithm>
error (_("'%s': Filename extension must begin with '.'"), ext_args.c_str ());
/* Find end of first arg. */
- while (*end != '\0' && !isspace (*end))
+ while (*end != '\0' && !c_isspace (*end))
end++;
if (*end == '\0')
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <ctype.h>
#include "cp-abi.h"
#include "cp-support.h"
#include "observable.h"
/* Don't get faked out by `operator' being part of a longer
identifier. */
- if (isalpha (*p) || *p == '_' || *p == '$' || *p == '\0')
+ if (c_isalpha (*p) || *p == '_' || *p == '$' || *p == '\0')
return *end;
/* Allow some whitespace between `operator' and the operator symbol. */
/* Recognize 'operator TYPENAME'. */
- if (isalpha (*p) || *p == '_' || *p == '$')
+ if (c_isalpha (*p) || *p == '_' || *p == '$')
{
const char *q = p + 1;
- while (isalnum (*q) || *q == '_' || *q == '$')
+ while (c_isalnum (*q) || *q == '_' || *q == '$')
q++;
*end = q;
return p;
int fix = -1; /* -1 means ok; otherwise number of
spaces needed. */
- if (isalpha (*opname) || *opname == '_' || *opname == '$')
+ if (c_isalpha (*opname) || *opname == '_' || *opname == '$')
{
/* There should 1 space between 'operator' and 'TYPENAME'. */
if (opname[-1] != ' ' || opname[-2] == ' ')
if (colon && *(colon + 1) != ':')
{
int colon_index = colon - regexp;
- while (colon_index > 0 && isspace (regexp[colon_index - 1]))
+ while (colon_index > 0 && c_isspace (regexp[colon_index - 1]))
--colon_index;
file_name = make_unique_xstrndup (regexp, colon_index);
{
for (; p > text; --p)
{
- if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0')
+ if (c_isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0')
continue;
else
{
Unfortunately we have to find it now to decide. */
while (t > text)
- if (isalnum (t[-1]) || t[-1] == '_' ||
+ if (c_isalnum (t[-1]) || t[-1] == '_' ||
t[-1] == ' ' || t[-1] == ':' ||
t[-1] == '(' || t[-1] == ')')
--t;
which are in symbols. */
while (p > text)
{
- if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0'
+ if (c_isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0'
|| p[-1] == ':' || strchr (break_on, p[-1]) != NULL)
--p;
else
#include "regcache.h"
#include "btrace.h"
-#include <ctype.h>
#include <sys/types.h>
#include <signal.h>
#include "ui-out.h"
/* Check if we're past a valid thread ID list already. */
if (parser.finished ()
- && cmd > text && !isspace (cmd[-1]))
+ && cmd > text && !c_isspace (cmd[-1]))
return;
/* We're past the thread ID list, advance word point. */
if (*cmd == '\0')
error (_("Please specify a command following the thread ID list"));
- if (tidlist == cmd || isdigit (cmd[0]))
+ if (tidlist == cmd || c_isdigit (cmd[0]))
invalid_thread_id_error (cmd);
scoped_restore_current_thread restore_thread;
#include "tid-parse.h"
#include "inferior.h"
#include "gdbthread.h"
-#include <ctype.h>
/* See tid-parse.h. */
or we are not in a range and not in front of an integer, negative
integer, convenience var or negative convenience var. */
return (*m_cur_tok == '\0'
- || !(isdigit (*m_cur_tok)
+ || !(c_isdigit (*m_cur_tok)
|| *m_cur_tok == '$'
|| *m_cur_tok == '*'));
case STATE_THREAD_RANGE:
m_qualified = true;
p = dot + 1;
- if (isspace (*p))
+ if (c_isspace (*p))
return false;
}
else
}
m_range_parser.init (p);
- if (p[0] == '*' && (p[1] == '\0' || isspace (p[1])))
+ if (p[0] == '*' && (p[1] == '\0' || c_isspace (p[1])))
{
/* Setup the number range parser to return numbers in the
whole [1,INT_MAX] range. */
#include "event-top.h"
#include <sys/stat.h>
-#include <ctype.h>
#include "ui-out.h"
#include "cli-out.h"
#include "tracepoint.h"
#include "inferior.h"
#include "gdbthread.h"
#include "tracefile.h"
-#include <ctype.h>
#include <algorithm>
#include "gdbsupport/filestuff.h"
#include "gdbarch.h"
/* All digits in the name is reserved for value history
references. */
- for (p = name; isdigit (*p); p++)
+ for (p = name; c_isdigit (*p); p++)
;
if (*p == '\0')
error (_("$%s is not a valid trace state variable name"), name);
- for (p = name; isalnum (*p) || *p == '_'; p++)
+ for (p = name; c_isalnum (*p) || *p == '_'; p++)
;
if (*p != '\0')
error (_("$%s is not a valid trace state variable name"), name);
error (_("Name of trace variable should start with '$'"));
name_start = p;
- while (isalnum (*p) || *p == '_')
+ while (c_isalnum (*p) || *p == '_')
p++;
std::string name (name_start, p - name_start);
#include "tui/tui-win.h"
#include "gdb_curses.h"
-#include <ctype.h>
#include "readline/readline.h"
#include <signal.h>
#include <string_view>
/* Process the number of lines to scroll. */
std::string copy = arg;
buf_ptr = ©[0];
- if (isdigit (*buf_ptr))
+ if (c_isdigit (*buf_ptr))
{
char *num_str;
#include "cp-abi.h"
#include "typeprint.h"
#include "valprint.h"
-#include <ctype.h>
#include "cli/cli-utils.h"
#include "extension.h"
#include "completer.h"
{
int seen_one = 0;
- for (++exp; *exp && !isspace (*exp); ++exp)
+ for (++exp; *exp && !c_isspace (*exp); ++exp)
{
switch (*exp)
{
if (!*exp && !seen_one)
error (_("flag expected"));
- if (!isspace (*exp))
+ if (!c_isspace (*exp))
error (_("expected space after format"));
exp = skip_spaces (exp);
}
"first line is not terminated with a '.' character");
/* Checks the doc is not terminated with a new line. */
- if (isspace (c->doc[strlen (c->doc) - 1]))
+ if (c_isspace (c->doc[strlen (c->doc) - 1]))
broken_doc_invariant
(prefix, c->name,
"has superfluous trailing whitespace");
else
{
/* \n\n is ok, so we check that explicitly here. */
- if (isspace (nl[-1]) && nl[-1] != '\n')
+ if (c_isspace (nl[-1]) && nl[-1] != '\n')
broken_doc_invariant (prefix, c->name,
"has whitespace before a newline");
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "gdbsupport/gdb_wait.h"
#include "gdbsupport/scoped_signal_handler.h"
#include "event-top.h"
#include "gdbsupport/gdb_obstack.h"
#include "charset.h"
#include "typeprint.h"
-#include <ctype.h>
#include <algorithm>
#include "gdbsupport/byte-vector.h"
#include "cli/cli-option.h"
#include "valprint.h"
#include "cli/cli-decode.h"
#include "extension.h"
-#include <ctype.h>
#include "tracepoint.h"
#include "cp-abi.h"
#include "user-regs.h"
len = 2;
/* Find length of numeral string. */
- for (; isdigit (h[len]); len++)
+ for (; c_isdigit (h[len]); len++)
;
/* Make sure numeral string is not part of an identifier. */
- if (h[len] == '_' || isalpha (h[len]))
+ if (h[len] == '_' || c_isalpha (h[len]))
return NULL;
/* Now collect the index value. */
/* cmd.exe recognizes "&N" only immediately after the redirection symbol. */
if (*s != '&')
{
- while (isspace (*s)) /* skip whitespace before file name */
+ while (c_isspace (*s)) /* skip whitespace before file name */
s++;
*d++ = ' '; /* separate file name with a single space */
}
s++;
*d++ = *s++;
}
- else if (isspace (*s) && !quote)
+ else if (c_isspace (*s) && !quote)
break;
else
*d++ = *s++;
int quote = 0;
bool retval = false;
- while (isspace (*s))
+ while (c_isspace (*s))
*d++ = *s++;
while (*s)
#include <sys/types.h>
#include <fcntl.h>
-#include <ctype.h>
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#if HAVE_SIGNAL_H
#include <signal.h>
#endif
-#include <ctype.h>
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include "gdbsupport/netstuff.h"
#include "gdbsupport/filestuff.h"
#include "gdbsupport/gdb-sigmask.h"
-#include <ctype.h>
#if HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
else if (cc != 1 || c != '\003')
{
fprintf (stderr, "input_interrupt, count = %d c = %d ", cc, c);
- if (isprint (c))
+ if (c_isprint (c))
fprintf (stderr, "('%c')\n", c);
else
fprintf (stderr, "('\\x%02x')\n", c & 0xff);
here is convert the buffer from a T packet to an S packet
and the avoid adding any extra content by breaking out. */
gdb_assert (buf_start[0] == 'T');
- gdb_assert (isxdigit (buf_start[1]));
- gdb_assert (isxdigit (buf_start[2]));
+ gdb_assert (c_isxdigit (buf_start[1]));
+ gdb_assert (c_isxdigit (buf_start[2]));
buf_start[0] = 'S';
buf_start[3] = '\0';
break;
#include "tdesc.h"
#include "gdbsupport/rsp-low.h"
#include "gdbsupport/signals-state-save-restore.h"
-#include <ctype.h>
#include <unistd.h>
#if HAVE_SIGNAL_H
#include <signal.h>
debug_timestamp = 0;
/* First remove leading spaces, for "monitor set debug-format". */
- while (isspace (*arg))
+ while (c_isspace (*arg))
++arg;
std::vector<gdb::unique_xmalloc_ptr<char>> options
struct debug_opt
{
/* NAME is the name of this debug option, this should be a simple string
- containing no whitespace, starting with a letter from isalpha(), and
- contain only isalnum() characters and '_' underscore and '-' hyphen.
+ containing no whitespace, starting with a letter from c_isalpha(), and
+ contain only c_isalnum() characters and '_' underscore and '-' hyphen.
SETTER is a callback function used to set the debug variable. This
callback will be passed true to enable the debug setting, or false to
: m_name (name),
m_setter (setter)
{
- gdb_assert (isalpha (*name));
+ gdb_assert (c_isalpha (*name));
}
/* Called to enable or disable the debug setting. */
#include <dlfcn.h>
#endif
#include <limits.h>
-#include <ctype.h>
struct thread_db
{
free (libthread_db_search_path);
/* Skip leading space (if any). */
- while (isspace (*cp))
+ while (c_isspace (*cp))
++cp;
if (*cp == '\0')
#include "gdbthread.h"
#include "gdbsupport/rsp-low.h"
-#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
#include <chrono>
trace_debug ("Want to collect registers");
++act;
/* skip past hex digits of mask for now */
- while (isxdigit(*act))
+ while (c_isxdigit(*act))
++act;
break;
}
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
/* We need to be careful when filename is of the form 'd:foo', which
is equivalent of d:./foo, which is totally different from d:/foo. */
- if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] == ':')
+ if (strlen (dir_name) == 2 && c_isalpha (dir_name[0]) && dir_name[1] == ':')
{
dir_name[2] = '.';
dir_name[3] = '\000';