Use c-ctype.h (not safe-ctype.h) in gdb

This changes gdb and related programs to use the gnulib c-ctype code
rather than safe-ctype.h.  The gdb-safe-ctype.h header is removed.

This changes common-defs.h to include the c-ctype header, making it
available everywhere in gdb.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33217
Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2025-08-04 09:58:43 -06:00
parent 50673a4629
commit 15e11aac9c
23 changed files with 78 additions and 140 deletions

View File

@@ -408,7 +408,7 @@ convert_ucn (const char *p, const char *limit, const char *dest_charset,
gdb_byte data[4];
int i;
for (i = 0; i < length && p < limit && ISXDIGIT (*p); ++i, ++p)
for (i = 0; i < length && p < limit && c_isxdigit (*p); ++i, ++p)
result = (result << 4) + fromhex (*p);
for (i = 3; i >= 0; --i)
@@ -450,7 +450,7 @@ convert_octal (struct type *type, const char *p,
unsigned long value = 0;
for (i = 0;
i < 3 && p < limit && ISDIGIT (*p) && *p != '8' && *p != '9';
i < 3 && p < limit && c_isdigit (*p) && *p != '8' && *p != '9';
++i)
{
value = 8 * value + fromhex (*p);
@@ -473,7 +473,7 @@ convert_hex (struct type *type, const char *p,
{
unsigned long value = 0;
while (p < limit && ISXDIGIT (*p))
while (p < limit && c_isxdigit (*p))
{
value = 16 * value + fromhex (*p);
++p;
@@ -518,7 +518,7 @@ convert_escape (struct type *type, const char *dest_charset,
case 'x':
advance ();
if (!ISXDIGIT (*p))
if (!c_isxdigit (*p))
error (_("\\x used with no following hex digits."));
p = convert_hex (type, p, limit, output);
break;
@@ -540,7 +540,7 @@ convert_escape (struct type *type, const char *dest_charset,
int length = *p == 'u' ? 4 : 8;
advance ();
if (!ISXDIGIT (*p))
if (!c_isxdigit (*p))
error (_("\\u used with no following hex digits"));
p = convert_ucn (p, limit, dest_charset, output, length);
}