1992-02-22 09:46:16 +08:00
|
|
|
/* Internal type definitions for GDB.
|
|
|
|
Copyright (C) 1992 Free Software Foundation, Inc.
|
|
|
|
Contributed by Cygnus Support, using pieces from other GDB modules.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|
|
|
|
|
|
|
#if !defined (GDBTYPES_H)
|
|
|
|
#define GDBTYPES_H 1
|
|
|
|
|
|
|
|
/* When gdb creates fundamental types, it uses one of the following
|
|
|
|
type identifiers. The identifiers are used to index a vector of
|
|
|
|
pointers to any types that are created. */
|
|
|
|
|
|
|
|
#define FT_VOID 0
|
|
|
|
#define FT_BOOLEAN 1
|
|
|
|
#define FT_CHAR 2
|
|
|
|
#define FT_SIGNED_CHAR 3
|
|
|
|
#define FT_UNSIGNED_CHAR 4
|
|
|
|
#define FT_SHORT 5
|
|
|
|
#define FT_SIGNED_SHORT 6
|
|
|
|
#define FT_UNSIGNED_SHORT 7
|
|
|
|
#define FT_INTEGER 8
|
|
|
|
#define FT_SIGNED_INTEGER 9
|
|
|
|
#define FT_UNSIGNED_INTEGER 10
|
|
|
|
#define FT_LONG 11
|
|
|
|
#define FT_SIGNED_LONG 12
|
|
|
|
#define FT_UNSIGNED_LONG 13
|
|
|
|
#define FT_LONG_LONG 14
|
|
|
|
#define FT_SIGNED_LONG_LONG 15
|
|
|
|
#define FT_UNSIGNED_LONG_LONG 16
|
|
|
|
#define FT_FLOAT 17
|
|
|
|
#define FT_DBL_PREC_FLOAT 18
|
|
|
|
#define FT_EXT_PREC_FLOAT 19
|
|
|
|
#define FT_COMPLEX 20
|
|
|
|
#define FT_DBL_PREC_COMPLEX 21
|
|
|
|
#define FT_EXT_PREC_COMPLEX 22
|
|
|
|
#define FT_STRING 23
|
1992-04-15 13:42:00 +08:00
|
|
|
#define FT_FIXED_DECIMAL 24
|
|
|
|
#define FT_FLOAT_DECIMAL 25
|
1992-12-04 04:28:16 +08:00
|
|
|
#define FT_BYTE 26
|
|
|
|
#define FT_UNSIGNED_BYTE 27
|
1992-02-22 09:46:16 +08:00
|
|
|
|
1992-12-04 04:28:16 +08:00
|
|
|
#define FT_NUM_MEMBERS 28 /* Highest FT_* above, plus one. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
* defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
1992-12-23 14:34:57 +08:00
|
|
|
/* Some macros for char-based bitfields. */
|
|
|
|
|
|
|
|
#define B_SET(a,x) ((a)[(x)>>3] |= (1 << ((x)&7)))
|
|
|
|
#define B_CLR(a,x) ((a)[(x)>>3] &= ~(1 << ((x)&7)))
|
|
|
|
#define B_TST(a,x) ((a)[(x)>>3] & (1 << ((x)&7)))
|
|
|
|
#define B_TYPE unsigned char
|
|
|
|
#define B_BYTES(x) ( 1 + ((x)>>3) )
|
|
|
|
#define B_CLRALL(a,x) memset ((a), 0, B_BYTES(x))
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
/* Different kinds of data types are distinguished by the `code' field. */
|
|
|
|
|
|
|
|
enum type_code
|
|
|
|
{
|
|
|
|
TYPE_CODE_UNDEF, /* Not used; catches errors */
|
|
|
|
TYPE_CODE_PTR, /* Pointer type */
|
1992-12-15 10:52:11 +08:00
|
|
|
TYPE_CODE_ARRAY, /* Array type with lower & upper bounds. */
|
1992-02-22 09:46:16 +08:00
|
|
|
TYPE_CODE_STRUCT, /* C struct or Pascal record */
|
|
|
|
TYPE_CODE_UNION, /* C union or Pascal variant part */
|
|
|
|
TYPE_CODE_ENUM, /* Enumeration type */
|
|
|
|
TYPE_CODE_FUNC, /* Function type */
|
|
|
|
TYPE_CODE_INT, /* Integer type */
|
1993-05-23 03:20:37 +08:00
|
|
|
|
|
|
|
/* Floating type. This is *NOT* a complex type. Complex types, when
|
|
|
|
we have them, will have their own type code (or TYPE_CODE_ERROR if
|
|
|
|
we can parse a complex type but not manipulate it). There are parts
|
|
|
|
of GDB which bogusly assume that TYPE_CODE_FLT can mean complex. */
|
|
|
|
TYPE_CODE_FLT,
|
|
|
|
|
|
|
|
/* Void type (values zero length; the length field is ignored). */
|
|
|
|
TYPE_CODE_VOID,
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
TYPE_CODE_SET, /* Pascal sets */
|
|
|
|
TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */
|
1993-01-16 13:15:58 +08:00
|
|
|
TYPE_CODE_STRING, /* String types, distinct from array of char */
|
1993-01-22 02:13:55 +08:00
|
|
|
TYPE_CODE_BITSTRING, /* String of bits, distinct from bool array */
|
1993-05-23 03:20:37 +08:00
|
|
|
|
|
|
|
/* Unknown type. The length field is valid if we were able to
|
|
|
|
deduce that much about the type, or 0 if we don't even know that. */
|
|
|
|
TYPE_CODE_ERROR,
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
/* C++ */
|
|
|
|
TYPE_CODE_MEMBER, /* Member type */
|
|
|
|
TYPE_CODE_METHOD, /* Method type */
|
|
|
|
TYPE_CODE_REF, /* C++ Reference types */
|
|
|
|
|
|
|
|
/* Modula-2 */
|
|
|
|
TYPE_CODE_CHAR, /* *real* character type */
|
1992-12-04 04:28:16 +08:00
|
|
|
TYPE_CODE_BOOL /* BOOLEAN type */
|
1992-02-22 09:46:16 +08:00
|
|
|
};
|
|
|
|
|
* dwarfread.c (cu_language): New local variable to record
language for current compilation unit being processed.
* dwarfread.c (set_cu_language): New local function to decode
and record language for current compilation unit being processed.
* dwarfread.c (synthesize_typedef): Add local function to
synthesize a typedef for C++ classes, structs, unions, and
enumerations.
* dwarfread.c (read_structure_scope): Synthesize typedefs
for C++ classes, structs and unions.
* dwarfread.c (read_enumeration): Synthesize typedefs for
C++ enumerations.
* dwarfread.c (read_file_scope): Call set_cu_language to
record language for current compilation unit. After symtab
is built, save this recorded language.
* dwarfread.c (process_dies, add_partial_symbol, struct_type,
scan_partial_symbols, new_symbol): Recognize TAG_class_type.
* dwarfread.c (add_partial_symbol): Synthesize partial symbol
typedefs for C++ classes, structs, unions, and enumerations.
* dwarfread.c (scan_compilation_units): Call set_cu_language
to record language for current compilation unit.
* dwarfread.c (scan_partial_symbols): Call add_enum_psymbol here
for TAG_enumeration_types, rather than in add_partial_symbol.
* dwarfread.c (add_partial_symbol): Combine TAG_enumeration_type
case with class, struct, and union type cases, now that they are
the same. Remove tests for non-NULL name attributes, now done
by callers.
* gdbtypes.h (TYPE_CODE_CLASS): Add type for C++ classes, but
treat as alias for TYPE_CODE_STRUCT for now.
1992-09-01 04:50:45 +08:00
|
|
|
/* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an
|
|
|
|
alias for TYPE_CODE_STRUCT. Eventually these should probably be
|
|
|
|
officially distinct types within gdb. */
|
|
|
|
|
|
|
|
#define TYPE_CODE_CLASS TYPE_CODE_STRUCT
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
/* Some bits for the type's flags word. */
|
|
|
|
|
|
|
|
/* Explicitly unsigned integer type */
|
|
|
|
|
|
|
|
#define TYPE_FLAG_UNSIGNED (1 << 0)
|
|
|
|
|
1992-04-15 13:42:00 +08:00
|
|
|
/* Explicitly signed integer type */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
#define TYPE_FLAG_SIGNED (1 << 1)
|
|
|
|
|
1993-08-26 23:37:03 +08:00
|
|
|
/* This appears in a type's flags word if it is a stub type (e.g., if
|
1992-02-22 09:46:16 +08:00
|
|
|
someone referenced a type that wasn't defined in a source file
|
|
|
|
via (struct sir_not_appearing_in_this_film *)). */
|
|
|
|
|
|
|
|
#define TYPE_FLAG_STUB (1 << 2)
|
|
|
|
|
1992-04-15 13:42:00 +08:00
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
struct type
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Code for kind of type */
|
|
|
|
|
|
|
|
enum type_code code;
|
|
|
|
|
|
|
|
/* Name of this type, or NULL if none.
|
1993-07-08 02:26:03 +08:00
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
This is used for printing only, except by poorly designed C++ code.
|
1993-07-08 02:26:03 +08:00
|
|
|
For looking up a name, look for a symbol in the VAR_NAMESPACE. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
1993-07-08 02:26:03 +08:00
|
|
|
/* Tag name for this type, or NULL if none. This means that the
|
|
|
|
name of the type consists of a keyword followed by the tag name.
|
|
|
|
Which keyword is determined by the type code ("struct" for
|
|
|
|
TYPE_CODE_STRUCT, etc.). As far as I know C/C++ are the only languages
|
|
|
|
with this feature.
|
|
|
|
|
|
|
|
This is used for printing only, except by poorly designed C++ code.
|
1993-08-26 23:37:03 +08:00
|
|
|
For looking up a name, look for a symbol in the STRUCT_NAMESPACE.
|
|
|
|
One more legitimate use is that if TYPE_FLAG_STUB is set, this is
|
|
|
|
the name to use to look for definitions in other files. */
|
1993-07-02 10:57:06 +08:00
|
|
|
|
|
|
|
char *tag_name;
|
|
|
|
|
1993-05-23 03:20:37 +08:00
|
|
|
/* Length, in units of TARGET_CHAR_BIT bits,
|
|
|
|
of storage for a value of this type */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
unsigned length;
|
|
|
|
|
|
|
|
/* Every type is now associated with a particular objfile, and the
|
|
|
|
type is allocated on the type_obstack for that objfile. One problem
|
|
|
|
however, is that there are times when gdb allocates new types while
|
|
|
|
it is not in the process of reading symbols from a particular objfile.
|
|
|
|
Fortunately, these happen when the type being created is a derived
|
|
|
|
type of an existing type, such as in lookup_pointer_type(). So
|
|
|
|
we can just allocate the new type using the same objfile as the
|
|
|
|
existing type, but to do this we need a backpointer to the objfile
|
|
|
|
from the existing type. Yes this is somewhat ugly, but without
|
|
|
|
major overhaul of the internal type system, it can't be avoided
|
|
|
|
for now. */
|
|
|
|
|
|
|
|
struct objfile *objfile;
|
|
|
|
|
|
|
|
/* For a pointer type, describes the type of object pointed to.
|
|
|
|
For an array type, describes the type of the elements.
|
1992-03-25 06:54:21 +08:00
|
|
|
For a function or method type, describes the type of the return value.
|
1992-02-22 09:46:16 +08:00
|
|
|
For a range type, describes the type of the full range.
|
|
|
|
Unused otherwise. */
|
|
|
|
|
|
|
|
struct type *target_type;
|
|
|
|
|
|
|
|
/* Type that is a pointer to this type.
|
|
|
|
NULL if no such pointer-to type is known yet.
|
|
|
|
The debugger may add the address of such a type
|
|
|
|
if it has to construct one later. */
|
|
|
|
|
|
|
|
struct type *pointer_type;
|
|
|
|
|
|
|
|
/* C++: also need a reference type. */
|
|
|
|
|
|
|
|
struct type *reference_type;
|
|
|
|
|
|
|
|
/* Type that is a function returning this type.
|
|
|
|
NULL if no such function type is known here.
|
|
|
|
The debugger may add the address of such a type
|
|
|
|
if it has to construct one later. */
|
|
|
|
|
|
|
|
struct type *function_type;
|
|
|
|
|
|
|
|
/* Flags about this type. */
|
|
|
|
|
|
|
|
short flags;
|
|
|
|
|
|
|
|
/* Number of fields described for this type */
|
|
|
|
|
|
|
|
short nfields;
|
|
|
|
|
|
|
|
/* For structure and union types, a description of each field.
|
|
|
|
For set and pascal array types, there is one "field",
|
|
|
|
whose type is the domain type of the set or array.
|
|
|
|
For range types, there are two "fields",
|
|
|
|
the minimum and maximum values (both inclusive).
|
|
|
|
For enum types, each possible value is described by one "field".
|
1992-08-02 04:40:59 +08:00
|
|
|
For C++ classes, there is one field for each base class (if it is
|
|
|
|
a derived class) plus one field for each class data member. Member
|
|
|
|
functions are recorded elsewhere.
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
Using a pointer to a separate array of fields
|
|
|
|
allows all types to have the same size, which is useful
|
|
|
|
because we can allocate the space for a type before
|
|
|
|
we know what to put in it. */
|
|
|
|
|
|
|
|
struct field
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Position of this field, counting in bits from start of
|
|
|
|
containing structure. For a function type, this is the
|
|
|
|
position in the argument list of this argument.
|
1992-05-04 07:05:07 +08:00
|
|
|
For a range bound or enum value, this is the value itself.
|
* Makefile.in (VERSION): Bump to 4.7.4.
* Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c,
m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c.
* Makefile.in (HFILES): Add valprint.h.
* Makefile.in (OBS): Add typeprint.o, c-typeprint.o,
m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o.
* typeprint.c, typeprint.h: New files for language independent
type printing functions.
* c-typeprint.c, m2-typeprint.c: New files for language dependent
type printing functions and definitions.
* valprint.h: New include file for language independent value
printing definitions.
* c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language
dependent value printing functions.
* c-exp.y (production ptype): Add range_type variable and use new
create_range_type function.
* c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab),
infcmd.c (path_var_name), language.c (unk_op_print_tab),
m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent
"const static" to ANSI-conformant "static const".
* c-exp.y (c_create_fundamental_type): Remove unused nbytes.
* c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type,
and c_val_print.
* c-lang.h (c_print_type, c_val_print): Add prototypes.
* coffread.c (decode_type): Add range_type variable and call to
new create_range_type function.
* complaints.c (complain): Remove unused val variable.
* complaints.c (_initialize_complaints): Make it void.
* convex-tdep.c (value_of_trapped_internalvar): Add range_type
variable and call new create_range_type function.
* defs.h (enum val_prettyprint): Move enum from value.h to here
so we can avoid having to include value.h just for prototypes that
need the enum (thanks ANSI).
* dwarfread.c (struct_type): Local anonymous_size variable is
only used if !BITS_BIG_ENDIAN.
* dwarfread.c (decode_subscript_data_item): Add rangetype
variable and call new create_range_type function.
* elfread.c (elf_symfile_read): Remove unused dbx and text_sect
variables.
* eval.c (evaluate_subexp): Remove unused local variable name
and the statement with no side effects that initializes it.
* expprint.c (print_subexp): Change local_printstr to
LA_PRINT_STRING.
* gdbtypes.c (create_range_type): New function that creates
a range type using code fragments from object file readers as
an example of what has to be initialized.
* gdbtypes.c (create_array_type): Removed index_type, low_bound,
and high_bound parameters, replaced with a single range_type
parameter. Change function body to use passed in range_type
rather than handcrafting one.
* gdbtypes.h (create_range_type): Add prototype.
* gdbtypes.h (create_array_type): Change prototype parameters.
* infrun.c (normal_stop): Remove unused local variables tem and c.
* infrun.c (hook_stop_stub): Return 0 rather than random value.
* language.c (unk_lang_print_type, unk_lang_val_print): Add
stub functions that call error if called.
* language.c (unknown_language_defn, auto_language_defn,
local_language_defn): Add initializers unk_lang_print_type and
unk_lang_val_print.
* language.h (struct language_defn): Reformat for larger
comments, add la_print_type and la_val_print members. Add
LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar
to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING.
* m2-lang.c (m2_create_fundamental_type): Remove unused local
variable nbytes.
* m2-lang.c (m2_language_defn): Add initializers m2_print_type
and m2_val_print.
* m2-lang.h (m2_print_type, m2_val_print): Add prototypes.
* main.c (execute_command): Remove unused local variable cmdlines.
* main.c (echo_command), stabsread.c (read_type), printcmd.c
(clear_displays), symmisc.c (block_depth), values.c
(clear_value_history):
Make testing of truth value of assignment result explicit.
* mipsread.c (upgrade_type): Update FIXME to include future use
of create_range_type.
* printcmd.c (ptype_command, ptype_eval, whatis_command,
whatis_exp, maintenance_print_type): Move prototypes and functions
to new typeprint.c.
* printcmd.c (_initialize_printcmd): Move add_com calls for
ptype_command and whatis_command to new typeprint.c.
* ser-bsd.c (serial_open): Remove unused variable sgttyb.
* source.c (find_source_lines): Local variable c only used
when LSEEK_NOT_LINEAR is defined.
* stabsread.c (read_array_type): Use new create_range_type
function.
* stabsread.c (read_range_type): Add new index_type variable and
call new create_range_type function rather than handcrafting
range types.
* symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE.
* symtab.c (typedef_print usages): Use c_typedef_print, renamed.
* symtab.c (type_print_base usages): Use c_type_print_base.
* symtab.c (type_print_varspec_prefix usages): Use
c_type_print_varspec_prefix.
* symtab.c (type_print_method_args usages): Use
cp_type_print_method_args.
* valprint.c: Completely ripped apart and the fragments used
to create c-valprint.c, cp-valprint.c, m2-valprint.c, and
valprint.h. Remaining stuff is language independent.
* value.h (struct fn_field): Forward declare for prototypes.
* value.h (type_print_1): Remove prototype.
* value.h (enum val_prettyprint): Moved to defs.h.
* value.h (typedef_print): Prototype renamed to c_typedef_print.
* value.h (baseclass_offset): Add prototype.
**** start-sanitize-chill ****
* Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c.
* Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o.
* ch-typeprint.c: New file for language dependent type printing.
* ch-valprint.c: New file for language dependent value printing.
* ch-exp.y (parse_number): Remove prototype and stub function.
* ch-exp.y (decode_integer_literal): Removed unused digits and
temp variables.
* ch-exp.y (convert_float): Completely ifdef out for now.
* ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5),
ch-lang.c (chill_op_print_tab):
Change from ANSI-obsolescent "const static" to ANSI-conformant
"static const".
* ch-exp.y (yylex): Add unhandled storage class enumeration
literals to switch statement for completeness.
* ch-lang.c (chill_create_fundamental_types): Remove unused
nbytes variable. Change dummy type to 2 bytes to match int.
Handle FT_VOID types gratuituously added to chill DWARF by
compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR
type rather than a one byte TYPE_CODE_INT type.
* ch-lang.c (chill_language_defn): Add chill_print_type and
chill_val_print.
* ch-lang.h (chill_print_type, chill_val_print): Add prototypes.
**** end-sanitize-chill ****
1992-12-19 04:21:32 +08:00
|
|
|
(FIXME: What about ranges larger than host int size?)
|
1992-05-04 07:05:07 +08:00
|
|
|
For BITS_BIG_ENDIAN=1 targets, it is the bit offset to the MSB.
|
|
|
|
For BITS_BIG_ENDIAN=0 targets, it is the bit offset to the LSB. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
int bitpos;
|
|
|
|
|
|
|
|
/* Size of this field, in bits, or zero if not packed.
|
|
|
|
For an unpacked field, the field's type's length
|
|
|
|
says how many bytes the field occupies. */
|
Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES.
Clean up problems with targets and hosts that have 64 bit longs
and pointers and 32 bit ints.
* breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c,
ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c,
expprint.c, gdbtypes.c, infcmd.c, language.c, language.h,
m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h,
printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c,
symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
Change all printf formats from %x to %lx if outputting an address.
Change la_*_format to use long format.
local_hex_string, local_hex_string_custom now take an unsigned long
argument, change all callers.
* coffread.c (read_coff_symtab): Remove superfluous cast for
complaint output.
* dbxread.c (end_psymtab): Cast MSYMBOL_INFO to long, not int.
* findvar.c, value.h (write_register): Change register value to long.
* gdbtypes.h (struct type): Change `bitsize' to long as
TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer.
* inferior.h (struct inferior_status): Change type of stop_pc to
CORE_ADDR.
* language.h (local_octal_string, local_octal_string_custom):
Remove prototype, the functions are neither defined nor used.
* mipsread.c (parse_symbol): Use temporary variable for bitsize as
f->bitsize is a long now.
* objfiles.c (add_to_objfile_sections, build_objfile_section_table):
Use unsigned long casts instead of int for abusing sections_end
pointer as integer.
* stack.c (parse_frame_specification): Change type of `args' to
CORE_ADDR for SETUP_ARBITRARY_FRAME.
* printcmd.c (make_vasize): Allow redefinition via MAKEVA_SIZE.
* mipsread.c (parse_type): Alpha cc now supports the t->continued
bit, update algorithm to match the way the compiler uses it.
1993-09-29 01:43:25 +08:00
|
|
|
/* FIXME: This is abused by TYPE_FIELD_STATIC_PHYSNAME to contain
|
|
|
|
a pointer, so it has to be long. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES.
Clean up problems with targets and hosts that have 64 bit longs
and pointers and 32 bit ints.
* breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c,
ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c,
expprint.c, gdbtypes.c, infcmd.c, language.c, language.h,
m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h,
printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c,
symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
Change all printf formats from %x to %lx if outputting an address.
Change la_*_format to use long format.
local_hex_string, local_hex_string_custom now take an unsigned long
argument, change all callers.
* coffread.c (read_coff_symtab): Remove superfluous cast for
complaint output.
* dbxread.c (end_psymtab): Cast MSYMBOL_INFO to long, not int.
* findvar.c, value.h (write_register): Change register value to long.
* gdbtypes.h (struct type): Change `bitsize' to long as
TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer.
* inferior.h (struct inferior_status): Change type of stop_pc to
CORE_ADDR.
* language.h (local_octal_string, local_octal_string_custom):
Remove prototype, the functions are neither defined nor used.
* mipsread.c (parse_symbol): Use temporary variable for bitsize as
f->bitsize is a long now.
* objfiles.c (add_to_objfile_sections, build_objfile_section_table):
Use unsigned long casts instead of int for abusing sections_end
pointer as integer.
* stack.c (parse_frame_specification): Change type of `args' to
CORE_ADDR for SETUP_ARBITRARY_FRAME.
* printcmd.c (make_vasize): Allow redefinition via MAKEVA_SIZE.
* mipsread.c (parse_type): Alpha cc now supports the t->continued
bit, update algorithm to match the way the compiler uses it.
1993-09-29 01:43:25 +08:00
|
|
|
long bitsize;
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
/* In a struct or enum type, type of this field.
|
|
|
|
In a function type, type of this argument.
|
|
|
|
In an array type, the domain-type of the array. */
|
|
|
|
|
|
|
|
struct type *type;
|
|
|
|
|
|
|
|
/* Name of field, value or argument.
|
|
|
|
NULL for range bounds and array domains. */
|
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
} *fields;
|
|
|
|
|
|
|
|
/* For types with virtual functions, VPTR_BASETYPE is the base class which
|
1993-08-03 03:21:04 +08:00
|
|
|
defined the virtual function table pointer.
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
For types that are pointer to member types, VPTR_BASETYPE
|
|
|
|
is the type that this pointer is a member of.
|
|
|
|
|
|
|
|
Unused otherwise. */
|
|
|
|
|
|
|
|
struct type *vptr_basetype;
|
|
|
|
|
1993-08-03 03:21:04 +08:00
|
|
|
/* Field number of the virtual function table pointer in
|
|
|
|
VPTR_BASETYPE. If -1, we were unable to find the virtual
|
|
|
|
function table pointer in initial symbol reading, and
|
|
|
|
fill_in_vptr_fieldno should be called to find it if possible.
|
|
|
|
|
|
|
|
Unused if this type does not have virtual functions. */
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
int vptr_fieldno;
|
|
|
|
|
|
|
|
/* Slot to point to additional language-specific fields of this type. */
|
|
|
|
|
|
|
|
union type_specific
|
|
|
|
{
|
|
|
|
|
|
|
|
/* ARG_TYPES is for TYPE_CODE_METHOD and TYPE_CODE_FUNC. */
|
|
|
|
|
|
|
|
struct type **arg_types;
|
|
|
|
|
1992-07-09 12:40:39 +08:00
|
|
|
/* CPLUS_STUFF is for TYPE_CODE_STRUCT. It is initialized to point to
|
|
|
|
cplus_struct_default, a default static instance of a struct
|
|
|
|
cplus_struct_type. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
struct cplus_struct_type *cplus_stuff;
|
|
|
|
|
|
|
|
} type_specific;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NULL_TYPE ((struct type *) 0)
|
|
|
|
|
|
|
|
/* C++ language-specific information for TYPE_CODE_STRUCT and TYPE_CODE_UNION
|
|
|
|
nodes. */
|
|
|
|
|
|
|
|
struct cplus_struct_type
|
|
|
|
{
|
1993-07-31 07:06:37 +08:00
|
|
|
/* Number of base classes this type derives from. The baseclasses are
|
|
|
|
stored in the first N_BASECLASSES fields (i.e. the `fields' field of
|
|
|
|
the struct type). I think only the `type' field of such a field has
|
|
|
|
any meaning. */
|
1992-07-21 12:14:34 +08:00
|
|
|
|
|
|
|
short n_baseclasses;
|
|
|
|
|
|
|
|
/* Number of methods with unique names. All overloaded methods with
|
|
|
|
the same name count only once. */
|
|
|
|
|
|
|
|
short nfn_fields;
|
|
|
|
|
|
|
|
/* Number of methods described for this type plus all the
|
|
|
|
methods that it derives from. */
|
|
|
|
|
|
|
|
int nfn_fields_total;
|
|
|
|
|
1992-08-02 04:40:59 +08:00
|
|
|
/* For derived classes, the number of base classes is given by n_baseclasses
|
|
|
|
and virtual_field_bits is a bit vector containing one bit per base class.
|
|
|
|
If the base class is virtual, the corresponding bit will be set.
|
|
|
|
I.E, given:
|
|
|
|
|
|
|
|
class A{};
|
|
|
|
class B{};
|
|
|
|
class C : public B, public virtual A {};
|
|
|
|
|
|
|
|
B is a baseclass of C; A is a virtual baseclass for C.
|
|
|
|
This is a C++ 2.0 language feature. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
1992-07-09 12:40:39 +08:00
|
|
|
B_TYPE *virtual_field_bits;
|
|
|
|
|
|
|
|
/* For classes with private fields, the number of fields is given by
|
|
|
|
nfields and private_field_bits is a bit vector containing one bit
|
|
|
|
per field.
|
|
|
|
If the field is private, the corresponding bit will be set. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
B_TYPE *private_field_bits;
|
|
|
|
|
1992-07-09 12:40:39 +08:00
|
|
|
/* For classes with protected fields, the number of fields is given by
|
|
|
|
nfields and protected_field_bits is a bit vector containing one bit
|
|
|
|
per field.
|
|
|
|
If the field is private, the corresponding bit will be set. */
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
B_TYPE *protected_field_bits;
|
|
|
|
|
1993-11-06 09:32:11 +08:00
|
|
|
/* for classes with fields to be ignored, either this is optimized out
|
|
|
|
or this field has length 0 */
|
|
|
|
|
|
|
|
B_TYPE *ignore_field_bits;
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
/* For classes, structures, and unions, a description of each field,
|
|
|
|
which consists of an overloaded name, followed by the types of
|
|
|
|
arguments that the method expects, and then the name after it
|
1992-07-21 12:14:34 +08:00
|
|
|
has been renamed to make it distinct.
|
|
|
|
|
|
|
|
fn_fieldlists points to an array of nfn_fields of these. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
struct fn_fieldlist
|
|
|
|
{
|
|
|
|
|
|
|
|
/* The overloaded name. */
|
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
/* The number of methods with this name. */
|
|
|
|
|
|
|
|
int length;
|
|
|
|
|
|
|
|
/* The list of methods. */
|
|
|
|
|
|
|
|
struct fn_field
|
|
|
|
{
|
|
|
|
|
1993-07-31 07:06:37 +08:00
|
|
|
/* If is_stub is clear, this is the mangled name which we can
|
|
|
|
look up to find the address of the method (FIXME: it would
|
|
|
|
be cleaner to have a pointer to the struct symbol here
|
|
|
|
instead). */
|
|
|
|
|
|
|
|
/* If is_stub is set, this is the portion of the mangled
|
|
|
|
name which specifies the arguments. For example, "ii",
|
|
|
|
if there are two int arguments, or "" if there are no
|
|
|
|
arguments. See gdb_mangle_name for the conversion from this
|
|
|
|
format to the one used if is_stub is clear. */
|
1992-07-21 12:14:34 +08:00
|
|
|
|
|
|
|
char *physname;
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
/* The return value of the method */
|
|
|
|
|
|
|
|
struct type *type;
|
|
|
|
|
1993-07-31 07:06:37 +08:00
|
|
|
/* The argument list. Only valid if is_stub is clear. Contains
|
|
|
|
the type of each argument, including `this', and ending with
|
|
|
|
a NULL pointer after the last argument. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
struct type **args;
|
|
|
|
|
1992-07-21 12:14:34 +08:00
|
|
|
/* For virtual functions.
|
|
|
|
First baseclass that defines this virtual function. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
struct type *fcontext;
|
|
|
|
|
1992-07-21 12:14:34 +08:00
|
|
|
/* Attributes. */
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
unsigned int is_const : 1;
|
|
|
|
unsigned int is_volatile : 1;
|
|
|
|
unsigned int is_private : 1;
|
|
|
|
unsigned int is_protected : 1;
|
1993-07-31 07:06:37 +08:00
|
|
|
|
|
|
|
/* A stub method only has some fields valid (but they are enough
|
|
|
|
to reconstruct the rest of the fields). */
|
1992-02-22 09:46:16 +08:00
|
|
|
unsigned int is_stub : 1;
|
1993-07-31 07:06:37 +08:00
|
|
|
|
|
|
|
/* Unused. */
|
1992-02-22 09:46:16 +08:00
|
|
|
unsigned int dummy : 3;
|
|
|
|
|
|
|
|
/* Index into that baseclass's virtual function table,
|
|
|
|
minus 2; else if static: VOFFSET_STATIC; else: 0. */
|
|
|
|
|
1992-07-21 12:14:34 +08:00
|
|
|
unsigned int voffset : 24;
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
# define VOFFSET_STATIC 1
|
|
|
|
|
|
|
|
} *fn_fields;
|
|
|
|
|
|
|
|
} *fn_fieldlists;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/* The default value of TYPE_CPLUS_SPECIFIC(T) points to the
|
|
|
|
this shared static structure. */
|
|
|
|
|
1993-01-10 12:23:06 +08:00
|
|
|
extern const struct cplus_struct_type cplus_struct_default;
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
extern void
|
|
|
|
allocate_cplus_struct_type PARAMS ((struct type *));
|
|
|
|
|
|
|
|
#define INIT_CPLUS_SPECIFIC(type) \
|
|
|
|
(TYPE_CPLUS_SPECIFIC(type)=(struct cplus_struct_type*)&cplus_struct_default)
|
|
|
|
#define ALLOCATE_CPLUS_STRUCT_TYPE(type) allocate_cplus_struct_type (type)
|
|
|
|
#define HAVE_CPLUS_STRUCT(type) \
|
|
|
|
(TYPE_CPLUS_SPECIFIC(type) != &cplus_struct_default)
|
|
|
|
|
|
|
|
#define TYPE_NAME(thistype) (thistype)->name
|
1993-07-02 10:57:06 +08:00
|
|
|
#define TYPE_TAG_NAME(type) ((type)->tag_name)
|
1992-02-22 09:46:16 +08:00
|
|
|
#define TYPE_TARGET_TYPE(thistype) (thistype)->target_type
|
|
|
|
#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
|
|
|
|
#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
|
|
|
|
#define TYPE_FUNCTION_TYPE(thistype) (thistype)->function_type
|
|
|
|
#define TYPE_LENGTH(thistype) (thistype)->length
|
|
|
|
#define TYPE_OBJFILE(thistype) (thistype)->objfile
|
|
|
|
#define TYPE_FLAGS(thistype) (thistype)->flags
|
|
|
|
#define TYPE_UNSIGNED(thistype) ((thistype)->flags & TYPE_FLAG_UNSIGNED)
|
|
|
|
#define TYPE_CODE(thistype) (thistype)->code
|
|
|
|
#define TYPE_NFIELDS(thistype) (thistype)->nfields
|
|
|
|
#define TYPE_FIELDS(thistype) (thistype)->fields
|
|
|
|
|
|
|
|
/* C++ */
|
|
|
|
|
|
|
|
#define TYPE_VPTR_BASETYPE(thistype) (thistype)->vptr_basetype
|
|
|
|
#define TYPE_DOMAIN_TYPE(thistype) (thistype)->vptr_basetype
|
|
|
|
#define TYPE_VPTR_FIELDNO(thistype) (thistype)->vptr_fieldno
|
|
|
|
#define TYPE_FN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fields
|
|
|
|
#define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields
|
|
|
|
#define TYPE_NFN_FIELDS_TOTAL(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields_total
|
|
|
|
#define TYPE_TYPE_SPECIFIC(thistype) (thistype)->type_specific
|
|
|
|
#define TYPE_ARG_TYPES(thistype) (thistype)->type_specific.arg_types
|
|
|
|
#define TYPE_CPLUS_SPECIFIC(thistype) (thistype)->type_specific.cplus_stuff
|
|
|
|
#define TYPE_BASECLASS(thistype,index) (thistype)->fields[index].type
|
|
|
|
#define TYPE_N_BASECLASSES(thistype) TYPE_CPLUS_SPECIFIC(thistype)->n_baseclasses
|
|
|
|
#define TYPE_BASECLASS_NAME(thistype,index) (thistype)->fields[index].name
|
|
|
|
#define TYPE_BASECLASS_BITPOS(thistype,index) (thistype)->fields[index].bitpos
|
|
|
|
#define BASETYPE_VIA_PUBLIC(thistype, index) (!TYPE_FIELD_PRIVATE(thistype, index))
|
|
|
|
#define BASETYPE_VIA_VIRTUAL(thistype, index) \
|
|
|
|
B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index))
|
|
|
|
|
|
|
|
#define TYPE_FIELD(thistype, n) (thistype)->fields[n]
|
|
|
|
#define TYPE_FIELD_TYPE(thistype, n) (thistype)->fields[n].type
|
|
|
|
#define TYPE_FIELD_NAME(thistype, n) (thistype)->fields[n].name
|
|
|
|
#define TYPE_FIELD_VALUE(thistype, n) (* (int*) &(thistype)->fields[n].type)
|
|
|
|
#define TYPE_FIELD_BITPOS(thistype, n) (thistype)->fields[n].bitpos
|
|
|
|
#define TYPE_FIELD_BITSIZE(thistype, n) (thistype)->fields[n].bitsize
|
|
|
|
#define TYPE_FIELD_PACKED(thistype, n) (thistype)->fields[n].bitsize
|
|
|
|
|
|
|
|
#define TYPE_FIELD_PRIVATE_BITS(thistype) \
|
|
|
|
TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits
|
|
|
|
#define TYPE_FIELD_PROTECTED_BITS(thistype) \
|
|
|
|
TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits
|
1993-11-06 09:32:11 +08:00
|
|
|
#define TYPE_FIELD_IGNORE_BITS(thistype) \
|
|
|
|
TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits
|
1992-02-22 09:46:16 +08:00
|
|
|
#define TYPE_FIELD_VIRTUAL_BITS(thistype) \
|
|
|
|
TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits
|
|
|
|
#define SET_TYPE_FIELD_PRIVATE(thistype, n) \
|
|
|
|
B_SET (TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits, (n))
|
|
|
|
#define SET_TYPE_FIELD_PROTECTED(thistype, n) \
|
|
|
|
B_SET (TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits, (n))
|
1993-11-06 09:32:11 +08:00
|
|
|
#define SET_TYPE_FIELD_IGNORE(thistype, n) \
|
|
|
|
B_SET (TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits, (n))
|
1992-02-22 09:46:16 +08:00
|
|
|
#define SET_TYPE_FIELD_VIRTUAL(thistype, n) \
|
|
|
|
B_SET (TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n))
|
|
|
|
#define TYPE_FIELD_PRIVATE(thistype, n) \
|
|
|
|
(TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits == NULL ? 0 \
|
|
|
|
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits, (n)))
|
|
|
|
#define TYPE_FIELD_PROTECTED(thistype, n) \
|
|
|
|
(TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits == NULL ? 0 \
|
|
|
|
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->protected_field_bits, (n)))
|
1993-11-06 09:32:11 +08:00
|
|
|
#define TYPE_FIELD_IGNORE(thistype, n) \
|
|
|
|
(TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits == NULL ? 0 \
|
|
|
|
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits, (n)))
|
1992-02-22 09:46:16 +08:00
|
|
|
#define TYPE_FIELD_VIRTUAL(thistype, n) \
|
|
|
|
B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n))
|
|
|
|
|
|
|
|
#define TYPE_FIELD_STATIC(thistype, n) ((thistype)->fields[n].bitpos == -1)
|
|
|
|
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) ((char *)(thistype)->fields[n].bitsize)
|
|
|
|
|
|
|
|
#define TYPE_FN_FIELDLISTS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists
|
|
|
|
#define TYPE_FN_FIELDLIST(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n]
|
|
|
|
#define TYPE_FN_FIELDLIST1(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n].fn_fields
|
|
|
|
#define TYPE_FN_FIELDLIST_NAME(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n].name
|
|
|
|
#define TYPE_FN_FIELDLIST_LENGTH(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n].length
|
|
|
|
|
|
|
|
#define TYPE_FN_FIELD(thisfn, n) (thisfn)[n]
|
1992-07-21 12:14:34 +08:00
|
|
|
#define TYPE_FN_FIELD_PHYSNAME(thisfn, n) (thisfn)[n].physname
|
1992-02-22 09:46:16 +08:00
|
|
|
#define TYPE_FN_FIELD_TYPE(thisfn, n) (thisfn)[n].type
|
|
|
|
#define TYPE_FN_FIELD_ARGS(thisfn, n) TYPE_ARG_TYPES ((thisfn)[n].type)
|
1992-07-21 12:14:34 +08:00
|
|
|
#define TYPE_FN_FIELD_CONST(thisfn, n) ((thisfn)[n].is_const)
|
|
|
|
#define TYPE_FN_FIELD_VOLATILE(thisfn, n) ((thisfn)[n].is_volatile)
|
1992-02-22 09:46:16 +08:00
|
|
|
#define TYPE_FN_FIELD_PRIVATE(thisfn, n) ((thisfn)[n].is_private)
|
|
|
|
#define TYPE_FN_FIELD_PROTECTED(thisfn, n) ((thisfn)[n].is_protected)
|
1992-07-21 12:14:34 +08:00
|
|
|
#define TYPE_FN_FIELD_STUB(thisfn, n) ((thisfn)[n].is_stub)
|
|
|
|
#define TYPE_FN_FIELD_FCONTEXT(thisfn, n) ((thisfn)[n].fcontext)
|
|
|
|
#define TYPE_FN_FIELD_VOFFSET(thisfn, n) ((thisfn)[n].voffset-2)
|
|
|
|
#define TYPE_FN_FIELD_VIRTUAL_P(thisfn, n) ((thisfn)[n].voffset > 1)
|
|
|
|
#define TYPE_FN_FIELD_STATIC_P(thisfn, n) ((thisfn)[n].voffset == VOFFSET_STATIC)
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
extern struct type *builtin_type_void;
|
|
|
|
extern struct type *builtin_type_char;
|
|
|
|
extern struct type *builtin_type_short;
|
|
|
|
extern struct type *builtin_type_int;
|
|
|
|
extern struct type *builtin_type_long;
|
1992-03-26 16:33:43 +08:00
|
|
|
extern struct type *builtin_type_signed_char;
|
1992-02-22 09:46:16 +08:00
|
|
|
extern struct type *builtin_type_unsigned_char;
|
|
|
|
extern struct type *builtin_type_unsigned_short;
|
|
|
|
extern struct type *builtin_type_unsigned_int;
|
|
|
|
extern struct type *builtin_type_unsigned_long;
|
|
|
|
extern struct type *builtin_type_float;
|
|
|
|
extern struct type *builtin_type_double;
|
|
|
|
extern struct type *builtin_type_long_double;
|
|
|
|
extern struct type *builtin_type_complex;
|
|
|
|
extern struct type *builtin_type_double_complex;
|
1993-01-16 13:15:58 +08:00
|
|
|
extern struct type *builtin_type_string;
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
/* This type represents a type that was unrecognized in symbol
|
|
|
|
read-in. */
|
|
|
|
|
|
|
|
extern struct type *builtin_type_error;
|
|
|
|
|
|
|
|
extern struct type *builtin_type_long_long;
|
|
|
|
extern struct type *builtin_type_unsigned_long_long;
|
|
|
|
|
|
|
|
/* Modula-2 types */
|
|
|
|
|
|
|
|
extern struct type *builtin_type_m2_char;
|
|
|
|
extern struct type *builtin_type_m2_int;
|
|
|
|
extern struct type *builtin_type_m2_card;
|
|
|
|
extern struct type *builtin_type_m2_real;
|
|
|
|
extern struct type *builtin_type_m2_bool;
|
|
|
|
|
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y.
* Makefile.in (YYFILES): Add ch-exp.tab.c.
* Makefile.in (YYOBJ): Add ch-exp.tab.o.
* Makefile.in (saber_gdb): Add unload of ch-exp.y and load
of ch-exp.tab.c.
* Makefile.in (distclean): Add target ch-exp.tab.c.
* Makefile.in (realclean): Add rm of ch-exp.tab.c.
* Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on
Makefile since it contains sed patterns used in generation.
Add sed pattern to also delete #include of any malloc.h.
* Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets.
* ch-exp.y: New expression parser, for GNU-Chill.
* c-exp.y, expr.c, expression.h, language.c, m2-exp.y,
parser-defs.h, valarith.c, valops.c, value.h: Remap macros and
function names to conform to K&R terminology with respect to
logical and bitwise operators:
UNOP_ZEROP => UNOP_LOGICAL_NOT
UNOP_LOGNOT => UNOP_COMPLEMENT
BINOP_LOGAND => BINOP_BITWISE_AND
BINOP_LOGXOR => BINOP_BITWISE_XOR
BINOP_LOGIOR => BINOP_BITWISE_IOR
BINOP_AND => BINOP_LOGICAL_AND
BINOP_OR => BINOP_LOGICAL_OR
PREC_OR => PREC_LOGICAL_OR
PREC_AND => PREC_LOGICAL_AND
PREC_LOGIOR => PREC_BITWISE_IOR
PREC_LOGXOR => PREC_BITWISE_XOR
PREC_LOGAND => PREC_BITWISE_AND
value_zerop() => value_logical_not()
value_lognot() => value_complement()
* c-exp.y (c_op_print_tab): Add explicit empty terminator.
* m2-exp.y (m2_op_print_tab): Add explicit empty terminator.
* defs.h (enum language): Add language_chill.
* dwarfread.c (set_cu_language): Add LANG_CHILL case and make
LANG_MODULA2 a recognized language.
* eval.c (evaluate_subexp): Add OP_BOOL case.
* expprint.c (print_subexp): Add OP_BOOL case.
* gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for
Chill as well as Modula-2.
* gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long,
builtin_type_chill_ulong, builtin_type_chill_real): Add.
* i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary
and is nonexistant in some SVR4 based systems.
* language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4.
* language.c (set_language_command): Add chill.
* language.c (binop_result_type, integral_type, character_type,
boolean_type, structured_type, value_true, binop_type_check):
Add language_chill cases.
* language.h (_LANG_chill): Define.
* m2-exp.y (number_sign, modblock): Make static, #ifdef out
unused modblock.
* m2-exp.y (ANDAND): Rename to LOGICAL_AND.
* source.c (source_info): Fix minor nits, print "1 line" rather
than "1 lines", and "language is <lang>".
* symfile.c (deduce_language_from_filename): Recognize the
filename extensions ".chill", ".c186", and ".c286" for Chill.
* valarith.c (value_binop): Handle TYPE_CODE_BOOL as well
as TYPE_CODE_INT and TYPE_CODE_FLOAT.
* valprint.c (val_print): Print TYPE_CODE_BOOL type values as
"TRUE" or "FALSE".
* valprint.c (typedef_print): Add case for language_chill.
* values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-16 01:28:02 +08:00
|
|
|
/* Chill types */
|
|
|
|
|
|
|
|
extern struct type *builtin_type_chill_bool;
|
* language.h (language_format_info): New structure to bundle
local formatting information.
* language.h (language_defn): Replace individual format info
with language_format_info structs.
* language.h (local_*_format, local_*_format_prefix,
local_*_format_specifier, local_*_format_suffix): New macros
for binary/octal/decimal/hex formats to access info elements.
* c-exp.y (c_language_defn): Update for new format handling.
* m2-exp.y (m2_language_defn): Update for new format handling.
* dbxread.c (language.h): Include for partial-stab.h use.
* defs.h (local_hex_format, local_hex_format_custom,
local_hex_string, local_hex_string_custom): Move to language.h.
* language.c (local_hex_format_custom, local_hex_string,
local_hex_string_custom, local_octal_format_custom): Use new
format handling.
* language.c (unknown_language_defn, auto_language_defn,
local_language_defn): Update for new format handling.
* printcmd.c (print_scalar_formatted): Use new macros
to access decimal and binary format info for printing.
**** start-sanitize-chill ****
* c-exp.y (chill_language_defn): Update for new format handling.
* ch-exp.y (CHARACTER_LITERAL): Add support to yylex.
* ch-exp.y (match_integer_literal): Add function.
* ch-exp.y (builtin_type_chill_char): Add definition.
* gdbtypes.h (builtin_type_chill_char): Add declaration.
**** end-sanitize-chill ****
1992-11-19 06:49:38 +08:00
|
|
|
extern struct type *builtin_type_chill_char;
|
* Makefile.in (SFILES_MAINDIR): Add ch-exp.y.
* Makefile.in (YYFILES): Add ch-exp.tab.c.
* Makefile.in (YYOBJ): Add ch-exp.tab.o.
* Makefile.in (saber_gdb): Add unload of ch-exp.y and load
of ch-exp.tab.c.
* Makefile.in (distclean): Add target ch-exp.tab.c.
* Makefile.in (realclean): Add rm of ch-exp.tab.c.
* Makefile.in (c-exp.tab.c, m2-exp.tab.c): Add dependency on
Makefile since it contains sed patterns used in generation.
Add sed pattern to also delete #include of any malloc.h.
* Makefile.in (ch-exp.tab.o, ch-exp.tab.c): New targets.
* ch-exp.y: New expression parser, for GNU-Chill.
* c-exp.y, expr.c, expression.h, language.c, m2-exp.y,
parser-defs.h, valarith.c, valops.c, value.h: Remap macros and
function names to conform to K&R terminology with respect to
logical and bitwise operators:
UNOP_ZEROP => UNOP_LOGICAL_NOT
UNOP_LOGNOT => UNOP_COMPLEMENT
BINOP_LOGAND => BINOP_BITWISE_AND
BINOP_LOGXOR => BINOP_BITWISE_XOR
BINOP_LOGIOR => BINOP_BITWISE_IOR
BINOP_AND => BINOP_LOGICAL_AND
BINOP_OR => BINOP_LOGICAL_OR
PREC_OR => PREC_LOGICAL_OR
PREC_AND => PREC_LOGICAL_AND
PREC_LOGIOR => PREC_BITWISE_IOR
PREC_LOGXOR => PREC_BITWISE_XOR
PREC_LOGAND => PREC_BITWISE_AND
value_zerop() => value_logical_not()
value_lognot() => value_complement()
* c-exp.y (c_op_print_tab): Add explicit empty terminator.
* m2-exp.y (m2_op_print_tab): Add explicit empty terminator.
* defs.h (enum language): Add language_chill.
* dwarfread.c (set_cu_language): Add LANG_CHILL case and make
LANG_MODULA2 a recognized language.
* eval.c (evaluate_subexp): Add OP_BOOL case.
* expprint.c (print_subexp): Add OP_BOOL case.
* gdbtypes.h (enum_typecode): Note TYPE_CODE_BOOL used for
Chill as well as Modula-2.
* gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long,
builtin_type_chill_ulong, builtin_type_chill_real): Add.
* i387-tdep.c (sys/dir.h): Remove, appears to be unnecessary
and is nonexistant in some SVR4 based systems.
* language.c (DEFAULT_ALLOCSIZE): Change from 3 => 4.
* language.c (set_language_command): Add chill.
* language.c (binop_result_type, integral_type, character_type,
boolean_type, structured_type, value_true, binop_type_check):
Add language_chill cases.
* language.h (_LANG_chill): Define.
* m2-exp.y (number_sign, modblock): Make static, #ifdef out
unused modblock.
* m2-exp.y (ANDAND): Rename to LOGICAL_AND.
* source.c (source_info): Fix minor nits, print "1 line" rather
than "1 lines", and "language is <lang>".
* symfile.c (deduce_language_from_filename): Recognize the
filename extensions ".chill", ".c186", and ".c286" for Chill.
* valarith.c (value_binop): Handle TYPE_CODE_BOOL as well
as TYPE_CODE_INT and TYPE_CODE_FLOAT.
* valprint.c (val_print): Print TYPE_CODE_BOOL type values as
"TRUE" or "FALSE".
* valprint.c (typedef_print): Add case for language_chill.
* values.c (value_from_longest): Handle TYPE_CODE_BOOL.
1992-11-16 01:28:02 +08:00
|
|
|
extern struct type *builtin_type_chill_long;
|
|
|
|
extern struct type *builtin_type_chill_ulong;
|
|
|
|
extern struct type *builtin_type_chill_real;
|
|
|
|
|
1993-04-29 15:07:39 +08:00
|
|
|
/* CC_HAS_LONG_LONG is defined if the host has "long long". */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
1993-04-29 15:07:39 +08:00
|
|
|
#ifdef CC_HAS_LONG_LONG
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
#define BUILTIN_TYPE_LONGEST builtin_type_long_long
|
|
|
|
#define BUILTIN_TYPE_UNSIGNED_LONGEST builtin_type_unsigned_long_long
|
|
|
|
|
1993-04-29 15:07:39 +08:00
|
|
|
#else /* not CC_HAS_LONG_LONG. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
#define BUILTIN_TYPE_LONGEST builtin_type_long
|
|
|
|
#define BUILTIN_TYPE_UNSIGNED_LONGEST builtin_type_unsigned_long
|
|
|
|
|
1993-04-29 15:07:39 +08:00
|
|
|
#endif /* not CC_HAS_LONG_LONG. */
|
1992-02-22 09:46:16 +08:00
|
|
|
|
|
|
|
/* Maximum and minimum values of built-in types */
|
|
|
|
|
|
|
|
#define MAX_OF_TYPE(t) \
|
|
|
|
TYPE_UNSIGNED(t) ? UMAX_OF_SIZE(TYPE_LENGTH(t)) \
|
|
|
|
: MAX_OF_SIZE(TYPE_LENGTH(t))
|
|
|
|
|
|
|
|
#define MIN_OF_TYPE(t) \
|
|
|
|
TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \
|
|
|
|
: MIN_OF_SIZE(TYPE_LENGTH(t))
|
|
|
|
|
* coffread.c (decode_type): Call alloc_type to alloc new
types.
* stabsread.c (read_array_type, read_range_type, define_symbol):
Call alloc_type to alloc new types.
* stabsread.c (define_symbol): Move dbl_valu symbol field data
from type_obstack to symbol_obstack.
* stabsread.c (define_symbol): Move typedef_sym from type_obstack
to symbol_obstack.
* gdbtypes.h (TYPE_ALLOC): New macro to allocate space for data
associated with a type, using the same mechanism as was used to
allocate space for the type structure itself.
* coffread.c (patch_type, coff_read_struct_type,
coff_read_enum_type): Use TYPE_ALLOC.
* dwarfread.c (struct_type): Use TYPE_ALLOC.
* gdbtypes.c (create_array_type, check_stub_method,
allocate_cplus_struct_type): Use TYPE_ALLOC.
* mipsread.c (parse_symbol, parse_type): Use TYPE_ALLOC.
* stabsread.c (read_struct_type, read_array_type, read_enum_type,
read_range_type): Use TYPE_ALLOC.
1992-08-24 08:13:11 +08:00
|
|
|
/* Allocate space for storing data associated with a particular type.
|
|
|
|
We ensure that the space is allocated using the same mechanism that
|
|
|
|
was used to allocate the space for the type structure itself. I.E.
|
|
|
|
if the type is on an objfile's type_obstack, then the space for data
|
|
|
|
associated with that type will also be allocated on the type_obstack.
|
|
|
|
If the type is not associated with any particular objfile (such as
|
|
|
|
builtin types), then the data space will be allocated with xmalloc,
|
|
|
|
the same as for the type structure. */
|
|
|
|
|
|
|
|
#define TYPE_ALLOC(t,size) \
|
1992-08-29 08:31:10 +08:00
|
|
|
(TYPE_OBJFILE (t) != NULL \
|
* coffread.c (decode_type): Call alloc_type to alloc new
types.
* stabsread.c (read_array_type, read_range_type, define_symbol):
Call alloc_type to alloc new types.
* stabsread.c (define_symbol): Move dbl_valu symbol field data
from type_obstack to symbol_obstack.
* stabsread.c (define_symbol): Move typedef_sym from type_obstack
to symbol_obstack.
* gdbtypes.h (TYPE_ALLOC): New macro to allocate space for data
associated with a type, using the same mechanism as was used to
allocate space for the type structure itself.
* coffread.c (patch_type, coff_read_struct_type,
coff_read_enum_type): Use TYPE_ALLOC.
* dwarfread.c (struct_type): Use TYPE_ALLOC.
* gdbtypes.c (create_array_type, check_stub_method,
allocate_cplus_struct_type): Use TYPE_ALLOC.
* mipsread.c (parse_symbol, parse_type): Use TYPE_ALLOC.
* stabsread.c (read_struct_type, read_array_type, read_enum_type,
read_range_type): Use TYPE_ALLOC.
1992-08-24 08:13:11 +08:00
|
|
|
? obstack_alloc (&TYPE_OBJFILE (t) -> type_obstack, size) \
|
1992-08-29 08:31:10 +08:00
|
|
|
: xmalloc (size))
|
* coffread.c (decode_type): Call alloc_type to alloc new
types.
* stabsread.c (read_array_type, read_range_type, define_symbol):
Call alloc_type to alloc new types.
* stabsread.c (define_symbol): Move dbl_valu symbol field data
from type_obstack to symbol_obstack.
* stabsread.c (define_symbol): Move typedef_sym from type_obstack
to symbol_obstack.
* gdbtypes.h (TYPE_ALLOC): New macro to allocate space for data
associated with a type, using the same mechanism as was used to
allocate space for the type structure itself.
* coffread.c (patch_type, coff_read_struct_type,
coff_read_enum_type): Use TYPE_ALLOC.
* dwarfread.c (struct_type): Use TYPE_ALLOC.
* gdbtypes.c (create_array_type, check_stub_method,
allocate_cplus_struct_type): Use TYPE_ALLOC.
* mipsread.c (parse_symbol, parse_type): Use TYPE_ALLOC.
* stabsread.c (read_struct_type, read_array_type, read_enum_type,
read_range_type): Use TYPE_ALLOC.
1992-08-24 08:13:11 +08:00
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
extern struct type *
|
|
|
|
alloc_type PARAMS ((struct objfile *));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
init_type PARAMS ((enum type_code, int, int, char *, struct objfile *));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
lookup_reference_type PARAMS ((struct type *));
|
|
|
|
|
* gdbtypes.c (make_{reference,pointer,function}_type): New
functions which handle overwriting of forward-referenced types
for stabs file reading.
(lookup_{reference,pointer,function}_type): These just call
the make_*_type functions with a null storage alloc parameter.
* gdbtypes.h (make_{reference,pointer,function}_type): Declare.
* xcoffread.c (smash_to_pointer_type): Remove, no longer used.
* buildsym.c (dbx_lookup_type): Zero result for (-1,-1) arg.
(dbx_alloc_type): Make it easier to understand. No funct change.
(define_symbol: 't'): Don't put the typedef name into the name of
the struct, union, or enum. Bugfix.
(read_type: '*', '&', 'f'): Add comments. Use make_XXX_type
routines to properly handle overwriting preallocated types so that
forward references will work.
(read_enum_type): Force enum values to file scope, due to bug in
Sun compiler output. FIXME, fix later.
Remove unused header_file_prev_index mechanism. It was already
obsolete in gdb-3.5. These comments appeared in 3.5:
/* This code was used before I knew about the instance codes.
My first hypothesis is that it is not necessary now
that instance codes are handled. */
* dbxread.c (add_new_header_file): Remove header_file_prev_index.
* buildsym.h: Remove it and prev_index that saves it.
* buildsym.c (push_subfile, pop_subfile, start_symtab): Remove it.
* solib.c (special_symbol_handling): When called from core files,
must set up debug_addr. Don't print error messages, just return.
* symmisc.c (print_symbol): Less ascii diarrhea for enums, please.
1992-05-01 17:14:43 +08:00
|
|
|
extern struct type *
|
|
|
|
make_reference_type PARAMS ((struct type *, struct type **));
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
extern struct type *
|
|
|
|
lookup_member_type PARAMS ((struct type *, struct type *));
|
|
|
|
|
|
|
|
extern void
|
|
|
|
smash_to_method_type PARAMS ((struct type *, struct type *, struct type *,
|
|
|
|
struct type **));
|
|
|
|
|
|
|
|
extern void
|
|
|
|
smash_to_member_type PARAMS ((struct type *, struct type *, struct type *));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
allocate_stub_method PARAMS ((struct type *));
|
|
|
|
|
|
|
|
extern char *
|
|
|
|
type_name_no_tag PARAMS ((const struct type *));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
lookup_struct_elt_type PARAMS ((struct type *, char *, int));
|
|
|
|
|
* gdbtypes.c (make_{reference,pointer,function}_type): New
functions which handle overwriting of forward-referenced types
for stabs file reading.
(lookup_{reference,pointer,function}_type): These just call
the make_*_type functions with a null storage alloc parameter.
* gdbtypes.h (make_{reference,pointer,function}_type): Declare.
* xcoffread.c (smash_to_pointer_type): Remove, no longer used.
* buildsym.c (dbx_lookup_type): Zero result for (-1,-1) arg.
(dbx_alloc_type): Make it easier to understand. No funct change.
(define_symbol: 't'): Don't put the typedef name into the name of
the struct, union, or enum. Bugfix.
(read_type: '*', '&', 'f'): Add comments. Use make_XXX_type
routines to properly handle overwriting preallocated types so that
forward references will work.
(read_enum_type): Force enum values to file scope, due to bug in
Sun compiler output. FIXME, fix later.
Remove unused header_file_prev_index mechanism. It was already
obsolete in gdb-3.5. These comments appeared in 3.5:
/* This code was used before I knew about the instance codes.
My first hypothesis is that it is not necessary now
that instance codes are handled. */
* dbxread.c (add_new_header_file): Remove header_file_prev_index.
* buildsym.h: Remove it and prev_index that saves it.
* buildsym.c (push_subfile, pop_subfile, start_symtab): Remove it.
* solib.c (special_symbol_handling): When called from core files,
must set up debug_addr. Don't print error messages, just return.
* symmisc.c (print_symbol): Less ascii diarrhea for enums, please.
1992-05-01 17:14:43 +08:00
|
|
|
extern struct type *
|
|
|
|
make_pointer_type PARAMS ((struct type *, struct type **));
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
extern struct type *
|
|
|
|
lookup_pointer_type PARAMS ((struct type *));
|
|
|
|
|
* gdbtypes.c (make_{reference,pointer,function}_type): New
functions which handle overwriting of forward-referenced types
for stabs file reading.
(lookup_{reference,pointer,function}_type): These just call
the make_*_type functions with a null storage alloc parameter.
* gdbtypes.h (make_{reference,pointer,function}_type): Declare.
* xcoffread.c (smash_to_pointer_type): Remove, no longer used.
* buildsym.c (dbx_lookup_type): Zero result for (-1,-1) arg.
(dbx_alloc_type): Make it easier to understand. No funct change.
(define_symbol: 't'): Don't put the typedef name into the name of
the struct, union, or enum. Bugfix.
(read_type: '*', '&', 'f'): Add comments. Use make_XXX_type
routines to properly handle overwriting preallocated types so that
forward references will work.
(read_enum_type): Force enum values to file scope, due to bug in
Sun compiler output. FIXME, fix later.
Remove unused header_file_prev_index mechanism. It was already
obsolete in gdb-3.5. These comments appeared in 3.5:
/* This code was used before I knew about the instance codes.
My first hypothesis is that it is not necessary now
that instance codes are handled. */
* dbxread.c (add_new_header_file): Remove header_file_prev_index.
* buildsym.h: Remove it and prev_index that saves it.
* buildsym.c (push_subfile, pop_subfile, start_symtab): Remove it.
* solib.c (special_symbol_handling): When called from core files,
must set up debug_addr. Don't print error messages, just return.
* symmisc.c (print_symbol): Less ascii diarrhea for enums, please.
1992-05-01 17:14:43 +08:00
|
|
|
extern struct type *
|
|
|
|
make_function_type PARAMS ((struct type *, struct type **));
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
extern struct type *
|
|
|
|
lookup_function_type PARAMS ((struct type *));
|
|
|
|
|
|
|
|
extern struct type *
|
* Makefile.in (VERSION): Bump to 4.7.4.
* Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c,
m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c.
* Makefile.in (HFILES): Add valprint.h.
* Makefile.in (OBS): Add typeprint.o, c-typeprint.o,
m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o.
* typeprint.c, typeprint.h: New files for language independent
type printing functions.
* c-typeprint.c, m2-typeprint.c: New files for language dependent
type printing functions and definitions.
* valprint.h: New include file for language independent value
printing definitions.
* c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language
dependent value printing functions.
* c-exp.y (production ptype): Add range_type variable and use new
create_range_type function.
* c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab),
infcmd.c (path_var_name), language.c (unk_op_print_tab),
m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent
"const static" to ANSI-conformant "static const".
* c-exp.y (c_create_fundamental_type): Remove unused nbytes.
* c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type,
and c_val_print.
* c-lang.h (c_print_type, c_val_print): Add prototypes.
* coffread.c (decode_type): Add range_type variable and call to
new create_range_type function.
* complaints.c (complain): Remove unused val variable.
* complaints.c (_initialize_complaints): Make it void.
* convex-tdep.c (value_of_trapped_internalvar): Add range_type
variable and call new create_range_type function.
* defs.h (enum val_prettyprint): Move enum from value.h to here
so we can avoid having to include value.h just for prototypes that
need the enum (thanks ANSI).
* dwarfread.c (struct_type): Local anonymous_size variable is
only used if !BITS_BIG_ENDIAN.
* dwarfread.c (decode_subscript_data_item): Add rangetype
variable and call new create_range_type function.
* elfread.c (elf_symfile_read): Remove unused dbx and text_sect
variables.
* eval.c (evaluate_subexp): Remove unused local variable name
and the statement with no side effects that initializes it.
* expprint.c (print_subexp): Change local_printstr to
LA_PRINT_STRING.
* gdbtypes.c (create_range_type): New function that creates
a range type using code fragments from object file readers as
an example of what has to be initialized.
* gdbtypes.c (create_array_type): Removed index_type, low_bound,
and high_bound parameters, replaced with a single range_type
parameter. Change function body to use passed in range_type
rather than handcrafting one.
* gdbtypes.h (create_range_type): Add prototype.
* gdbtypes.h (create_array_type): Change prototype parameters.
* infrun.c (normal_stop): Remove unused local variables tem and c.
* infrun.c (hook_stop_stub): Return 0 rather than random value.
* language.c (unk_lang_print_type, unk_lang_val_print): Add
stub functions that call error if called.
* language.c (unknown_language_defn, auto_language_defn,
local_language_defn): Add initializers unk_lang_print_type and
unk_lang_val_print.
* language.h (struct language_defn): Reformat for larger
comments, add la_print_type and la_val_print members. Add
LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar
to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING.
* m2-lang.c (m2_create_fundamental_type): Remove unused local
variable nbytes.
* m2-lang.c (m2_language_defn): Add initializers m2_print_type
and m2_val_print.
* m2-lang.h (m2_print_type, m2_val_print): Add prototypes.
* main.c (execute_command): Remove unused local variable cmdlines.
* main.c (echo_command), stabsread.c (read_type), printcmd.c
(clear_displays), symmisc.c (block_depth), values.c
(clear_value_history):
Make testing of truth value of assignment result explicit.
* mipsread.c (upgrade_type): Update FIXME to include future use
of create_range_type.
* printcmd.c (ptype_command, ptype_eval, whatis_command,
whatis_exp, maintenance_print_type): Move prototypes and functions
to new typeprint.c.
* printcmd.c (_initialize_printcmd): Move add_com calls for
ptype_command and whatis_command to new typeprint.c.
* ser-bsd.c (serial_open): Remove unused variable sgttyb.
* source.c (find_source_lines): Local variable c only used
when LSEEK_NOT_LINEAR is defined.
* stabsread.c (read_array_type): Use new create_range_type
function.
* stabsread.c (read_range_type): Add new index_type variable and
call new create_range_type function rather than handcrafting
range types.
* symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE.
* symtab.c (typedef_print usages): Use c_typedef_print, renamed.
* symtab.c (type_print_base usages): Use c_type_print_base.
* symtab.c (type_print_varspec_prefix usages): Use
c_type_print_varspec_prefix.
* symtab.c (type_print_method_args usages): Use
cp_type_print_method_args.
* valprint.c: Completely ripped apart and the fragments used
to create c-valprint.c, cp-valprint.c, m2-valprint.c, and
valprint.h. Remaining stuff is language independent.
* value.h (struct fn_field): Forward declare for prototypes.
* value.h (type_print_1): Remove prototype.
* value.h (enum val_prettyprint): Moved to defs.h.
* value.h (typedef_print): Prototype renamed to c_typedef_print.
* value.h (baseclass_offset): Add prototype.
**** start-sanitize-chill ****
* Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c.
* Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o.
* ch-typeprint.c: New file for language dependent type printing.
* ch-valprint.c: New file for language dependent value printing.
* ch-exp.y (parse_number): Remove prototype and stub function.
* ch-exp.y (decode_integer_literal): Removed unused digits and
temp variables.
* ch-exp.y (convert_float): Completely ifdef out for now.
* ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5),
ch-lang.c (chill_op_print_tab):
Change from ANSI-obsolescent "const static" to ANSI-conformant
"static const".
* ch-exp.y (yylex): Add unhandled storage class enumeration
literals to switch statement for completeness.
* ch-lang.c (chill_create_fundamental_types): Remove unused
nbytes variable. Change dummy type to 2 bytes to match int.
Handle FT_VOID types gratuituously added to chill DWARF by
compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR
type rather than a one byte TYPE_CODE_INT type.
* ch-lang.c (chill_language_defn): Add chill_print_type and
chill_val_print.
* ch-lang.h (chill_print_type, chill_val_print): Add prototypes.
**** end-sanitize-chill ****
1992-12-19 04:21:32 +08:00
|
|
|
create_range_type PARAMS ((struct type *, struct type *, int, int));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
create_array_type PARAMS ((struct type *, struct type *, struct type *));
|
1992-02-22 09:46:16 +08:00
|
|
|
|
1993-01-16 13:15:58 +08:00
|
|
|
extern struct type *
|
|
|
|
create_string_type PARAMS ((struct type *, struct type *));
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
extern struct type *
|
|
|
|
lookup_unsigned_typename PARAMS ((char *));
|
|
|
|
|
1992-07-11 07:30:40 +08:00
|
|
|
extern struct type *
|
|
|
|
lookup_signed_typename PARAMS ((char *));
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
extern void
|
|
|
|
check_stub_type PARAMS ((struct type *));
|
|
|
|
|
|
|
|
extern void
|
|
|
|
check_stub_method PARAMS ((struct type *, int, int));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
lookup_primitive_typename PARAMS ((char *));
|
|
|
|
|
|
|
|
extern char *
|
|
|
|
gdb_mangle_name PARAMS ((struct type *, int, int));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
builtin_type PARAMS ((char **));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
lookup_typename PARAMS ((char *, struct block *, int));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
lookup_template_type PARAMS ((char *, struct type *, struct block *));
|
|
|
|
|
|
|
|
extern struct type *
|
|
|
|
lookup_fundamental_type PARAMS ((struct objfile *, int));
|
|
|
|
|
1992-03-30 07:26:47 +08:00
|
|
|
extern void
|
|
|
|
fill_in_vptr_fieldno PARAMS ((struct type *));
|
|
|
|
|
* maint.c: New file.
* Makefile.in (SFILES_MAINDIR): Add new file maint.c.
* Makefile.in (OBS): Add new file maint.o.
* defs.h (command_class): Add class_maintenance.
* defs.h (MAINTENANCE_CMDS): Default to including maintenance
commands. Allow for them (and other nonessential parts of gdb)
to be selectively left out under special circumstances.
* gdbtypes.c (recursive_dump_type): New function; supports
maintenance print-type command.
* gdbtypes.h (recursive_dump_type, maintenance_print_type):
Add prototypes.
* main.c (maintenancelist, maintenanceinfolist): Add maintenance
command lists.
* main.c (initialize_cmd_lists): Eliminate unnecessary casts on
initializers. Add initializations for setprintlist, showprintlist,
setchecklist, showchecklist, maintenancelist, and maintenanceinfolist.
* printcmd.c (maintenance_print_type): New maintenance cmd.
* valprint.c (setprintlist, showprintlist): Move to main.c, as
implied by comment that all cmd lists are owned by main.c.
* infcmd.c (unsetlist): Move to main.c, as implied by comment
that all cmd lists are owned by main.c.
* language.c (setchecklist, showchecklist): Move to main.c, as
implied by comment that all cmd lists are owned by main.c
* breakpoint.c (enablelist, enablebreaklist, disablelist, cmdlist,
deletelist): Remove redundant declarations (also in gdbcmd.h).
* symmisc.c (printsyms_command): Now maintenance_print_symbols.
* symmisc.c (printmsyms_command): Now maintenance_print_msymbols.
* symmisc.c (printpsyms_command): Now maintenance_print_psymbols.
* symmisc.c (printobjfiles_command): Now maintenance_print_objfiles.
* symtab.h (maintenance_print_symbols, maintenance_print_psymbols,
maintenance_print_msymbols, maintenance_print_objfiles):
Add prototypes.
* symmisc.c (printsyms_command, printpsyms_command,
printmsyms_command, printobjfiles_command): Removed from
_initialize_symmisc.
* main.c (dump_me_command): Moved to maint.c and renamed to
maintenance_dump_me.
* breakpoint.c (all_breakpoints_info): Rename to
maintenance_info_breakpoints.
* breakpoint.c (_initialize_breakpoint): Convert add_info of
all_breakpoints_info to add maintenance_info_breakpoints to the
maintenanceinfolist instead.
main.c (initialize_main): Set up maintenance class commands.
1992-07-06 08:22:57 +08:00
|
|
|
#if MAINTENANCE_CMDS
|
|
|
|
extern void recursive_dump_type PARAMS ((struct type *, int));
|
|
|
|
#endif
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
/* printcmd.c */
|
|
|
|
|
|
|
|
extern void
|
1993-11-02 06:25:23 +08:00
|
|
|
print_scalar_formatted PARAMS ((char *, struct type *, int, int, GDB_FILE *));
|
1992-02-22 09:46:16 +08:00
|
|
|
|
* maint.c: New file.
* Makefile.in (SFILES_MAINDIR): Add new file maint.c.
* Makefile.in (OBS): Add new file maint.o.
* defs.h (command_class): Add class_maintenance.
* defs.h (MAINTENANCE_CMDS): Default to including maintenance
commands. Allow for them (and other nonessential parts of gdb)
to be selectively left out under special circumstances.
* gdbtypes.c (recursive_dump_type): New function; supports
maintenance print-type command.
* gdbtypes.h (recursive_dump_type, maintenance_print_type):
Add prototypes.
* main.c (maintenancelist, maintenanceinfolist): Add maintenance
command lists.
* main.c (initialize_cmd_lists): Eliminate unnecessary casts on
initializers. Add initializations for setprintlist, showprintlist,
setchecklist, showchecklist, maintenancelist, and maintenanceinfolist.
* printcmd.c (maintenance_print_type): New maintenance cmd.
* valprint.c (setprintlist, showprintlist): Move to main.c, as
implied by comment that all cmd lists are owned by main.c.
* infcmd.c (unsetlist): Move to main.c, as implied by comment
that all cmd lists are owned by main.c.
* language.c (setchecklist, showchecklist): Move to main.c, as
implied by comment that all cmd lists are owned by main.c
* breakpoint.c (enablelist, enablebreaklist, disablelist, cmdlist,
deletelist): Remove redundant declarations (also in gdbcmd.h).
* symmisc.c (printsyms_command): Now maintenance_print_symbols.
* symmisc.c (printmsyms_command): Now maintenance_print_msymbols.
* symmisc.c (printpsyms_command): Now maintenance_print_psymbols.
* symmisc.c (printobjfiles_command): Now maintenance_print_objfiles.
* symtab.h (maintenance_print_symbols, maintenance_print_psymbols,
maintenance_print_msymbols, maintenance_print_objfiles):
Add prototypes.
* symmisc.c (printsyms_command, printpsyms_command,
printmsyms_command, printobjfiles_command): Removed from
_initialize_symmisc.
* main.c (dump_me_command): Moved to maint.c and renamed to
maintenance_dump_me.
* breakpoint.c (all_breakpoints_info): Rename to
maintenance_info_breakpoints.
* breakpoint.c (_initialize_breakpoint): Convert add_info of
all_breakpoints_info to add maintenance_info_breakpoints to the
maintenanceinfolist instead.
main.c (initialize_main): Set up maintenance class commands.
1992-07-06 08:22:57 +08:00
|
|
|
#if MAINTENANCE_CMDS
|
|
|
|
extern void maintenance_print_type PARAMS ((char *, int));
|
|
|
|
#endif
|
|
|
|
|
1992-02-22 09:46:16 +08:00
|
|
|
#endif /* GDBTYPES_H */
|