mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-01 08:27:59 +00:00
Added Charles changes for GCC@ symbols.
This commit is contained in:
parent
b37b9a6d2d
commit
add6d758b6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195
@ -44,6 +44,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IEEE_FLOAT
|
#define IEEE_FLOAT
|
||||||
|
#define LONG_LONG
|
||||||
|
|
||||||
/* Library stuff: POSIX tty (not supported yet), V7 tty (sigh), vprintf. */
|
/* Library stuff: POSIX tty (not supported yet), V7 tty (sigh), vprintf. */
|
||||||
|
|
||||||
@ -138,10 +139,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
|
|
||||||
/* Largest integer type */
|
/* Largest integer type */
|
||||||
#define LONGEST long
|
#define LONGEST long long
|
||||||
|
|
||||||
/* Name of the builtin type for the LONGEST type above. */
|
/* Name of the builtin type for the LONGEST type above. */
|
||||||
#define BUILTIN_TYPE_LONGEST builtin_type_long
|
#define BUILTIN_TYPE_LONGEST builtin_type_long_long
|
||||||
|
|
||||||
/* Say how long (ordinary) registers are. */
|
/* Say how long (ordinary) registers are. */
|
||||||
|
|
||||||
|
@ -158,6 +158,7 @@ static struct type *read_enum_type ();
|
|||||||
static struct type *read_struct_type ();
|
static struct type *read_struct_type ();
|
||||||
static struct type *read_array_type ();
|
static struct type *read_array_type ();
|
||||||
static long read_number ();
|
static long read_number ();
|
||||||
|
static void read_huge_number ();
|
||||||
static void finish_block ();
|
static void finish_block ();
|
||||||
static struct blockvector *make_blockvector ();
|
static struct blockvector *make_blockvector ();
|
||||||
static struct symbol *define_symbol ();
|
static struct symbol *define_symbol ();
|
||||||
@ -5291,11 +5292,12 @@ read_range_type (pp, typenums)
|
|||||||
char **pp;
|
char **pp;
|
||||||
int typenums[2];
|
int typenums[2];
|
||||||
{
|
{
|
||||||
char *errp = *pp;
|
|
||||||
int rangenums[2];
|
int rangenums[2];
|
||||||
int n2, n3;
|
long n2, n3;
|
||||||
|
int n2bits, n3bits;
|
||||||
int self_subrange;
|
int self_subrange;
|
||||||
struct type *result_type;
|
struct type *result_type;
|
||||||
|
struct type *index_type;
|
||||||
|
|
||||||
/* First comes a type we are a subrange of.
|
/* First comes a type we are a subrange of.
|
||||||
In C it is usually 0, 1 or the type being defined. */
|
In C it is usually 0, 1 or the type being defined. */
|
||||||
@ -5309,8 +5311,45 @@ read_range_type (pp, typenums)
|
|||||||
|
|
||||||
/* The remaining two operands are usually lower and upper bounds
|
/* The remaining two operands are usually lower and upper bounds
|
||||||
of the range. But in some special cases they mean something else. */
|
of the range. But in some special cases they mean something else. */
|
||||||
n2 = read_number (pp, ';');
|
read_huge_number (pp, ';', &n2, &n2bits);
|
||||||
n3 = read_number (pp, ';');
|
read_huge_number (pp, ';', &n3, &n3bits);
|
||||||
|
|
||||||
|
if (n2bits == -1 || n3bits == -1)
|
||||||
|
error ("Unrecognized type range %s.", pp);
|
||||||
|
|
||||||
|
if (n2bits != 0 || n3bits != 0)
|
||||||
|
#ifdef LONG_LONG
|
||||||
|
{
|
||||||
|
char got_signed = 0;
|
||||||
|
char got_unsigned = 0;
|
||||||
|
/* Number of bits in the type. */
|
||||||
|
int nbits;
|
||||||
|
|
||||||
|
/* Range from 0 to <large number> is an unsigned large integral type. */
|
||||||
|
if ((n2bits == 0 && n2 == 0) && n3bits != 0)
|
||||||
|
{
|
||||||
|
got_unsigned = 1;
|
||||||
|
nbits = n3bits;
|
||||||
|
}
|
||||||
|
/* Range fro <large number> to <large number>-1 is a large signed
|
||||||
|
integral type. */
|
||||||
|
else if (n2bits != 0 && n3bits != 0 && n2bits == n3bits + 1)
|
||||||
|
{
|
||||||
|
got_signed = 1;
|
||||||
|
nbits = n2bits;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for "long long". */
|
||||||
|
if (got_signed && nbits == CHAR_BIT * sizeof (long long))
|
||||||
|
return builtin_type_long_long;
|
||||||
|
if (got_unsigned && nbits == CHAR_BIT * sizeof (long long))
|
||||||
|
return builtin_type_unsigned_long_long;
|
||||||
|
|
||||||
|
error ("Large type isn't a long long.");
|
||||||
|
}
|
||||||
|
#else /* LONG_LONG */
|
||||||
|
error ("Type long long not supported on this machine.");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* A type defined as a subrange of itself, with bounds both 0, is void. */
|
/* A type defined as a subrange of itself, with bounds both 0, is void. */
|
||||||
if (self_subrange && n2 == 0 && n3 == 0)
|
if (self_subrange && n2 == 0 && n3 == 0)
|
||||||
@ -5354,31 +5393,29 @@ read_range_type (pp, typenums)
|
|||||||
*dbx_lookup_type (rangenums) == builtin_type_int))
|
*dbx_lookup_type (rangenums) == builtin_type_int))
|
||||||
{
|
{
|
||||||
/* an unsigned type */
|
/* an unsigned type */
|
||||||
#ifdef LONG_LONG
|
if (n3 == UINT_MAX)
|
||||||
if (n3 == - sizeof (long long))
|
|
||||||
return builtin_type_unsigned_long_long;
|
|
||||||
#endif
|
|
||||||
if (n3 == (1 << (8 * sizeof (int))) - 1)
|
|
||||||
return builtin_type_unsigned_int;
|
return builtin_type_unsigned_int;
|
||||||
if (n3 == (1 << (8 * sizeof (short))) - 1)
|
if (n3 == ULONG_MAX)
|
||||||
|
return builtin_type_unsigned_long;
|
||||||
|
if (n3 == USHRT_MAX)
|
||||||
return builtin_type_unsigned_short;
|
return builtin_type_unsigned_short;
|
||||||
if (n3 == (1 << (8 * sizeof (char))) - 1)
|
if (n3 == UCHAR_MAX)
|
||||||
return builtin_type_unsigned_char;
|
return builtin_type_unsigned_char;
|
||||||
}
|
}
|
||||||
#ifdef LONG_LONG
|
#ifdef LONG_LONG
|
||||||
else if (n3 == 0 && n2 == -sizeof (long long))
|
else if (n3 == 0 && n2 == -sizeof (long long))
|
||||||
return builtin_type_long_long;
|
return builtin_type_long_long;
|
||||||
#endif
|
#endif
|
||||||
else if (n2 == -n3 -1)
|
else if (n2 == -n3 -1)
|
||||||
{
|
{
|
||||||
/* a signed type */
|
/* a signed type */
|
||||||
if (n3 == (1 << (8 * sizeof (int) - 1)) - 1)
|
if (n3 == INT_MAX)
|
||||||
return builtin_type_int;
|
return builtin_type_int;
|
||||||
if (n3 == (1 << (8 * sizeof (long) - 1)) - 1)
|
if (n3 == LONG_MAX)
|
||||||
return builtin_type_long;
|
return builtin_type_long;
|
||||||
if (n3 == (1 << (8 * sizeof (short) - 1)) - 1)
|
if (n3 == SHRT_MAX)
|
||||||
return builtin_type_short;
|
return builtin_type_short;
|
||||||
if (n3 == (1 << (8 * sizeof (char) - 1)) - 1)
|
if (n3 == CHAR_MAX)
|
||||||
return builtin_type_char;
|
return builtin_type_char;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5389,7 +5426,7 @@ read_range_type (pp, typenums)
|
|||||||
a self_subrange type; I'm going to assume that this is used
|
a self_subrange type; I'm going to assume that this is used
|
||||||
as an idiom, and that all of them are special cases. So . . . */
|
as an idiom, and that all of them are special cases. So . . . */
|
||||||
if (self_subrange)
|
if (self_subrange)
|
||||||
error ("Type defined as subrange of itself.");
|
error ("Type defined as subrange of itself: %s.", pp);
|
||||||
|
|
||||||
result_type = (struct type *) obstack_alloc (symbol_obstack,
|
result_type = (struct type *) obstack_alloc (symbol_obstack,
|
||||||
sizeof (struct type));
|
sizeof (struct type));
|
||||||
@ -5470,6 +5507,109 @@ read_number (pp, end)
|
|||||||
return n * sign;
|
return n * sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
read_huge_number (pp, end, valu, bits)
|
||||||
|
char **pp;
|
||||||
|
int end;
|
||||||
|
long *valu;
|
||||||
|
int *bits;
|
||||||
|
{
|
||||||
|
char *p = *pp;
|
||||||
|
int sign = 1;
|
||||||
|
long n = 0;
|
||||||
|
int radix = 10;
|
||||||
|
char overflow = 0;
|
||||||
|
int nbits = 0;
|
||||||
|
int c;
|
||||||
|
long upper_limit;
|
||||||
|
|
||||||
|
/* Handle an optional leading minus sign. */
|
||||||
|
|
||||||
|
if (*p == '-')
|
||||||
|
{
|
||||||
|
sign = -1;
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Leading zero means octal. GCC uses this to output values larger
|
||||||
|
than an int (because that would be hard in decimal). */
|
||||||
|
if (*p == '0')
|
||||||
|
{
|
||||||
|
radix = 8;
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
|
||||||
|
upper_limit = LONG_MAX / radix;
|
||||||
|
while ((c = *p++) >= '0' && c <= '9')
|
||||||
|
{
|
||||||
|
if (n <= upper_limit)
|
||||||
|
{
|
||||||
|
n *= radix;
|
||||||
|
n += c - '0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
overflow = 1;
|
||||||
|
|
||||||
|
/* This depends on large values being output in octal, which is
|
||||||
|
what GCC does. */
|
||||||
|
if (radix == 8)
|
||||||
|
{
|
||||||
|
if (nbits == 0)
|
||||||
|
{
|
||||||
|
if (c == '0')
|
||||||
|
/* Ignore leading zeroes. */
|
||||||
|
;
|
||||||
|
else if (c == '1')
|
||||||
|
nbits = 1;
|
||||||
|
else if (c == '2' || c == '3')
|
||||||
|
nbits = 2;
|
||||||
|
else
|
||||||
|
nbits = 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
nbits += 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (end)
|
||||||
|
{
|
||||||
|
if (c && c != end)
|
||||||
|
{
|
||||||
|
if (bits != NULL)
|
||||||
|
*bits = -1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
--p;
|
||||||
|
|
||||||
|
*pp = p;
|
||||||
|
if (overflow)
|
||||||
|
{
|
||||||
|
if (nbits == 0)
|
||||||
|
{
|
||||||
|
/* Large decimal constants are an error (because it is hard to
|
||||||
|
count how many bits are in them). */
|
||||||
|
if (bits != NULL)
|
||||||
|
*bits = -1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -0x7f is the same as 0x80. So deal with it by adding one to
|
||||||
|
the number of bits. */
|
||||||
|
if (sign == -1)
|
||||||
|
++nbits;
|
||||||
|
if (bits)
|
||||||
|
*bits = nbits;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (valu)
|
||||||
|
*valu = n * sign;
|
||||||
|
if (bits)
|
||||||
|
*bits = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Read in an argument list. This is a list of types. It is terminated with
|
/* Read in an argument list. This is a list of types. It is terminated with
|
||||||
a ':', FYI. Return the list of types read in. */
|
a ':', FYI. Return the list of types read in. */
|
||||||
static struct type **
|
static struct type **
|
||||||
|
@ -425,14 +425,14 @@ GDB manual (available as on-line info or a printed manual).\n", stderr);
|
|||||||
count = 0;
|
count = 0;
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
|
extern void exec_file_command (), symbol_file_command ();
|
||||||
|
extern void core_file_command ();
|
||||||
register char *arg = argv[i];
|
register char *arg = argv[i];
|
||||||
/* Args starting with - say what to do with the following arg
|
/* Args starting with - say what to do with the following arg
|
||||||
as a filename. */
|
as a filename. */
|
||||||
if (arg[0] == '-')
|
if (arg[0] == '-')
|
||||||
{
|
{
|
||||||
extern void exec_file_command (), symbol_file_command ();
|
extern void tty_command (), directory_command ();
|
||||||
extern void core_file_command (), directory_command ();
|
|
||||||
extern void tty_command ();
|
|
||||||
|
|
||||||
if (!strcmp (arg, "-q") || !strcmp (arg, "-nx")
|
if (!strcmp (arg, "-q") || !strcmp (arg, "-nx")
|
||||||
|| !strcmp (arg, "-quiet") || !strcmp (arg, "-batch")
|
|| !strcmp (arg, "-quiet") || !strcmp (arg, "-batch")
|
||||||
@ -1657,6 +1657,7 @@ set_prompt_command (text)
|
|||||||
static void
|
static void
|
||||||
quit_command ()
|
quit_command ()
|
||||||
{
|
{
|
||||||
|
extern void exec_file_command ();
|
||||||
if (have_inferior_p ())
|
if (have_inferior_p ())
|
||||||
{
|
{
|
||||||
if (inhibit_confirm || query ("The program is running. Quit anyway? "))
|
if (inhibit_confirm || query ("The program is running. Quit anyway? "))
|
||||||
|
Loading…
Reference in New Issue
Block a user