1992-02-22 01:46:16 +00:00
|
|
|
/* Internal type definitions for GDB.
|
1996-12-14 09:17:22 +00:00
|
|
|
Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
|
1992-02-22 01:46:16 +00:00
|
|
|
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
|
1995-08-02 03:41:12 +00:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
#if !defined (GDBTYPES_H)
|
|
|
|
#define GDBTYPES_H 1
|
|
|
|
|
* gdbtypes.h: Add TYPE_FLAG_TARGET_STUB.
* gdbtypes.c (check_stub_type): On TYPE_FLAG_TARGET_STUB, do
what cleanup_undefined_types does for arrays, except we clear
TYPE_FLAG_TARGET_STUB if we fix up the type.
* stabsread.c (cleanup_undefined_types): Add comments about how
doing arrays here is no longer the clean way to do it.
(read_array_type): Set TYPE_FLAG_TARGET_STUB as well as calling
add_undefined_type.
* c-typeprint.c, ch-typeprint.c: Move call to check_stub_type
outside switch so it happens for all type codes.
* cp-valprint.c (cp_print_value_fields): Recurse to val_print,
instead of c_val_print, so that check_stub_type gets called.
* gdbtypes.h, gdbtypes.c, m2-lang.c, ch-lang.c, c-lang.c: Remove
TYPE_FLAG_SIGNED. It was inconsistently set, never checked
(except in recursive_dump_type), and is pointless.
1993-11-15 20:13:30 +00:00
|
|
|
/* Codes for `fundamental types'. This is a monstrosity based on the
|
|
|
|
bogus notion that there are certain compiler-independent
|
|
|
|
`fundamental types'. None of these is well-defined (how big is
|
|
|
|
FT_SHORT? Does it depend on the language? How does the
|
|
|
|
language-specific code know which type to correlate to FT_SHORT?) */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
#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 05:42:00 +00:00
|
|
|
#define FT_FIXED_DECIMAL 24
|
|
|
|
#define FT_FLOAT_DECIMAL 25
|
1992-12-03 20:28:16 +00:00
|
|
|
#define FT_BYTE 26
|
|
|
|
#define FT_UNSIGNED_BYTE 27
|
1992-02-22 01:46:16 +00:00
|
|
|
|
1992-12-03 20:28:16 +00:00
|
|
|
#define FT_NUM_MEMBERS 28 /* Highest FT_* above, plus one. */
|
1992-02-22 01:46:16 +00: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 06:34:57 +00: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 01:46:16 +00: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 02:52:11 +00:00
|
|
|
TYPE_CODE_ARRAY, /* Array type with lower & upper bounds. */
|
1992-02-22 01:46:16 +00: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-22 19:20:37 +00:00
|
|
|
|
Initial Fortran language support, adapted from work by Farooq Butt
(fmbutt@engage.sps.mot.com).
* Makefile.in: Add Fortran-related files and dependencies.
* defs.h (language_fortran): New language enum.
* language.h (_LANG_fortran): Define.
(MAX_FORTRAN_DIMS): Define.
* expression.h: Reformat to standard.
(MULTI_F77_SUBSCRIPT, OP_F77_UNDETERMINED_ARGLIST,
OP_F77_LITERAL_COMPLEX, OP_F77_SUBSTR): New expression opcodes.
* gdbtypes.h (TYPE_CODE_COMPLEX, TYPE_CODE_LITERAL_COMPLEX,
TYPE_CODE_LITERAL_STRING): New type codes.
(type): New fields upper_bound_type and lower_bound_type.
(TYPE_ARRAY_UPPER_BOUND_TYPE, TYPE_ARRAY_LOWER_BOUND_TYPE,
TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): New
macros.
(builtin_type_f_character, etc): Declare.
* value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_START): Define.
* f-exp.y: New file, Fortran expression grammar.
* f-lang.c: New file, Fortran language support functions.
* f-lang.h: New file, Fortran language support declarations.
* f-typeprint.c: New file, Fortran type printing.
* f-valprint.c: New file, Fortran value printing.
* eval.c (evaluate_subexp): Add code for new expression opcodes,
fix wording of error message.
* gdbtypes.c (f77_create_literal_complex_type,
f77_create_literal_string_type): New functions.
* language.c (set_language_command): Add Fortran info.
(calc_f77_array_dims): New function.
* parse.c (length_of_subexp, prefixify_subexp): Add cases for new
expression opcodes.
* symfile.c (deduce_language_from_filename): Recognize .f and .F
as Fortran source files.
* valops.c (f77_value_literal_string, f77_value_substring,
f77_value_literal_complex): New functions.
1994-08-19 21:59:05 +00:00
|
|
|
/* Floating type. This is *NOT* a complex type. Beware, there are parts
|
1993-05-22 19:20:37 +00:00
|
|
|
of GDB which bogusly assume that TYPE_CODE_FLT can mean complex. */
|
|
|
|
TYPE_CODE_FLT,
|
|
|
|
|
1994-03-24 18:32:31 +00:00
|
|
|
/* Void type. The length field specifies the length (probably always
|
|
|
|
one) which is used in pointer arithmetic involving pointers to
|
|
|
|
this type, but actually dereferencing such a pointer is invalid;
|
|
|
|
a void type has no length and no actual representation in memory
|
|
|
|
or registers. A pointer to a void type is a generic pointer. */
|
1993-05-22 19:20:37 +00:00
|
|
|
TYPE_CODE_VOID,
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
TYPE_CODE_SET, /* Pascal sets */
|
|
|
|
TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */
|
1993-12-27 18:56:23 +00:00
|
|
|
|
|
|
|
/* A string type which is like an array of character but prints
|
|
|
|
differently (at least for CHILL). It does not contain a length
|
|
|
|
field as Pascal strings (for many Pascals, anyway) do; if we want
|
|
|
|
to deal with such strings, we should use a new type code. */
|
|
|
|
TYPE_CODE_STRING,
|
|
|
|
|
|
|
|
/* String of bits; like TYPE_CODE_SET but prints differently (at least
|
|
|
|
for CHILL). */
|
|
|
|
TYPE_CODE_BITSTRING,
|
1993-05-22 19:20:37 +00: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 01:46:16 +00:00
|
|
|
|
|
|
|
/* C++ */
|
|
|
|
TYPE_CODE_MEMBER, /* Member type */
|
|
|
|
TYPE_CODE_METHOD, /* Method type */
|
|
|
|
TYPE_CODE_REF, /* C++ Reference types */
|
|
|
|
|
|
|
|
TYPE_CODE_CHAR, /* *real* character type */
|
1994-02-02 17:20:45 +00:00
|
|
|
|
|
|
|
/* Boolean type. 0 is false, 1 is true, and other values are non-boolean
|
|
|
|
(e.g. FORTRAN "logical" used as unsigned int). */
|
Initial Fortran language support, adapted from work by Farooq Butt
(fmbutt@engage.sps.mot.com).
* Makefile.in: Add Fortran-related files and dependencies.
* defs.h (language_fortran): New language enum.
* language.h (_LANG_fortran): Define.
(MAX_FORTRAN_DIMS): Define.
* expression.h: Reformat to standard.
(MULTI_F77_SUBSCRIPT, OP_F77_UNDETERMINED_ARGLIST,
OP_F77_LITERAL_COMPLEX, OP_F77_SUBSTR): New expression opcodes.
* gdbtypes.h (TYPE_CODE_COMPLEX, TYPE_CODE_LITERAL_COMPLEX,
TYPE_CODE_LITERAL_STRING): New type codes.
(type): New fields upper_bound_type and lower_bound_type.
(TYPE_ARRAY_UPPER_BOUND_TYPE, TYPE_ARRAY_LOWER_BOUND_TYPE,
TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): New
macros.
(builtin_type_f_character, etc): Declare.
* value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_START): Define.
* f-exp.y: New file, Fortran expression grammar.
* f-lang.c: New file, Fortran language support functions.
* f-lang.h: New file, Fortran language support declarations.
* f-typeprint.c: New file, Fortran type printing.
* f-valprint.c: New file, Fortran value printing.
* eval.c (evaluate_subexp): Add code for new expression opcodes,
fix wording of error message.
* gdbtypes.c (f77_create_literal_complex_type,
f77_create_literal_string_type): New functions.
* language.c (set_language_command): Add Fortran info.
(calc_f77_array_dims): New function.
* parse.c (length_of_subexp, prefixify_subexp): Add cases for new
expression opcodes.
* symfile.c (deduce_language_from_filename): Recognize .f and .F
as Fortran source files.
* valops.c (f77_value_literal_string, f77_value_substring,
f77_value_literal_complex): New functions.
1994-08-19 21:59:05 +00:00
|
|
|
TYPE_CODE_BOOL,
|
|
|
|
|
|
|
|
/* Fortran */
|
1995-11-30 01:07:28 +00:00
|
|
|
TYPE_CODE_COMPLEX, /* Complex float */
|
|
|
|
|
|
|
|
TYPE_CODE_TYPEDEF
|
1992-02-22 01:46:16 +00: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-08-31 20:50:45 +00:00
|
|
|
/* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an
|
1994-02-02 17:20:45 +00:00
|
|
|
alias for TYPE_CODE_STRUCT. This is for DWARF, which has a distinct
|
|
|
|
"class" attribute. Perhaps we should actually have a separate TYPE_CODE
|
|
|
|
so that we can print "class" or "struct" depending on what the debug
|
|
|
|
info said. It's not clear we should bother. */
|
* 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-08-31 20:50:45 +00:00
|
|
|
|
|
|
|
#define TYPE_CODE_CLASS TYPE_CODE_STRUCT
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
/* Some bits for the type's flags word. */
|
|
|
|
|
* gdbtypes.h: Add TYPE_FLAG_TARGET_STUB.
* gdbtypes.c (check_stub_type): On TYPE_FLAG_TARGET_STUB, do
what cleanup_undefined_types does for arrays, except we clear
TYPE_FLAG_TARGET_STUB if we fix up the type.
* stabsread.c (cleanup_undefined_types): Add comments about how
doing arrays here is no longer the clean way to do it.
(read_array_type): Set TYPE_FLAG_TARGET_STUB as well as calling
add_undefined_type.
* c-typeprint.c, ch-typeprint.c: Move call to check_stub_type
outside switch so it happens for all type codes.
* cp-valprint.c (cp_print_value_fields): Recurse to val_print,
instead of c_val_print, so that check_stub_type gets called.
* gdbtypes.h, gdbtypes.c, m2-lang.c, ch-lang.c, c-lang.c: Remove
TYPE_FLAG_SIGNED. It was inconsistently set, never checked
(except in recursive_dump_type), and is pointless.
1993-11-15 20:13:30 +00:00
|
|
|
/* Unsigned integer type. If this is not set for a TYPE_CODE_INT, the
|
|
|
|
type is signed. */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
#define TYPE_FLAG_UNSIGNED (1 << 0)
|
|
|
|
|
1993-08-26 15:37:03 +00:00
|
|
|
/* This appears in a type's flags word if it is a stub type (e.g., if
|
1992-02-22 01:46:16 +00: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)
|
|
|
|
|
* gdbtypes.h: Add TYPE_FLAG_TARGET_STUB.
* gdbtypes.c (check_stub_type): On TYPE_FLAG_TARGET_STUB, do
what cleanup_undefined_types does for arrays, except we clear
TYPE_FLAG_TARGET_STUB if we fix up the type.
* stabsread.c (cleanup_undefined_types): Add comments about how
doing arrays here is no longer the clean way to do it.
(read_array_type): Set TYPE_FLAG_TARGET_STUB as well as calling
add_undefined_type.
* c-typeprint.c, ch-typeprint.c: Move call to check_stub_type
outside switch so it happens for all type codes.
* cp-valprint.c (cp_print_value_fields): Recurse to val_print,
instead of c_val_print, so that check_stub_type gets called.
* gdbtypes.h, gdbtypes.c, m2-lang.c, ch-lang.c, c-lang.c: Remove
TYPE_FLAG_SIGNED. It was inconsistently set, never checked
(except in recursive_dump_type), and is pointless.
1993-11-15 20:13:30 +00:00
|
|
|
/* The target type of this type is a stub type, and this type needs to
|
1995-11-30 01:07:28 +00:00
|
|
|
be updated if it gets un-stubbed in check_typedef.
|
|
|
|
Used for arrays and ranges, in which TYPE_LENGTH of the array/range
|
|
|
|
gets set based on the TYPE_LENGTH of the target type.
|
|
|
|
Also, set for TYPE_CODE_TYPEDEF. */
|
* gdbtypes.h: Add TYPE_FLAG_TARGET_STUB.
* gdbtypes.c (check_stub_type): On TYPE_FLAG_TARGET_STUB, do
what cleanup_undefined_types does for arrays, except we clear
TYPE_FLAG_TARGET_STUB if we fix up the type.
* stabsread.c (cleanup_undefined_types): Add comments about how
doing arrays here is no longer the clean way to do it.
(read_array_type): Set TYPE_FLAG_TARGET_STUB as well as calling
add_undefined_type.
* c-typeprint.c, ch-typeprint.c: Move call to check_stub_type
outside switch so it happens for all type codes.
* cp-valprint.c (cp_print_value_fields): Recurse to val_print,
instead of c_val_print, so that check_stub_type gets called.
* gdbtypes.h, gdbtypes.c, m2-lang.c, ch-lang.c, c-lang.c: Remove
TYPE_FLAG_SIGNED. It was inconsistently set, never checked
(except in recursive_dump_type), and is pointless.
1993-11-15 20:13:30 +00:00
|
|
|
|
|
|
|
#define TYPE_FLAG_TARGET_STUB (1 << 3)
|
1992-04-15 05:42:00 +00:00
|
|
|
|
1996-10-15 23:44:13 +00:00
|
|
|
/* This is a function type which appears to have a prototype. We need this
|
|
|
|
for function calls in order to tell us if it's necessary to coerce the args,
|
|
|
|
or to just do the standard conversions. */
|
|
|
|
|
|
|
|
#define TYPE_FLAG_PROTOTYPED (1 << 4)
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
struct type
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Code for kind of type */
|
|
|
|
|
|
|
|
enum type_code code;
|
|
|
|
|
|
|
|
/* Name of this type, or NULL if none.
|
1993-07-07 18:26:03 +00:00
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
This is used for printing only, except by poorly designed C++ code.
|
1993-07-07 18:26:03 +00:00
|
|
|
For looking up a name, look for a symbol in the VAR_NAMESPACE. */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
1993-07-07 18:26:03 +00: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 15:37:03 +00: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 02:57:06 +00:00
|
|
|
|
|
|
|
char *tag_name;
|
|
|
|
|
1995-03-14 14:05:16 +00:00
|
|
|
/* Length of storage for a value of this type. Various places pass
|
|
|
|
this to memcpy and such, meaning it must be in units of
|
|
|
|
HOST_CHAR_BIT. Various other places expect they can calculate
|
|
|
|
addresses by adding it and such, meaning it must be in units of
|
|
|
|
TARGET_CHAR_BIT. For some DSP targets, in which HOST_CHAR_BIT
|
|
|
|
will (presumably) be 8 and TARGET_CHAR_BIT will be (say) 32, this
|
|
|
|
is a problem. One fix would be to make this field in bits
|
|
|
|
(requiring that it always be a multiple of HOST_CHAR_BIT and
|
|
|
|
TARGET_CHAR_BIT)--the other choice would be to make it
|
|
|
|
consistently in units of HOST_CHAR_BIT. */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
unsigned length;
|
|
|
|
|
Initial Fortran language support, adapted from work by Farooq Butt
(fmbutt@engage.sps.mot.com).
* Makefile.in: Add Fortran-related files and dependencies.
* defs.h (language_fortran): New language enum.
* language.h (_LANG_fortran): Define.
(MAX_FORTRAN_DIMS): Define.
* expression.h: Reformat to standard.
(MULTI_F77_SUBSCRIPT, OP_F77_UNDETERMINED_ARGLIST,
OP_F77_LITERAL_COMPLEX, OP_F77_SUBSTR): New expression opcodes.
* gdbtypes.h (TYPE_CODE_COMPLEX, TYPE_CODE_LITERAL_COMPLEX,
TYPE_CODE_LITERAL_STRING): New type codes.
(type): New fields upper_bound_type and lower_bound_type.
(TYPE_ARRAY_UPPER_BOUND_TYPE, TYPE_ARRAY_LOWER_BOUND_TYPE,
TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): New
macros.
(builtin_type_f_character, etc): Declare.
* value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_START): Define.
* f-exp.y: New file, Fortran expression grammar.
* f-lang.c: New file, Fortran language support functions.
* f-lang.h: New file, Fortran language support declarations.
* f-typeprint.c: New file, Fortran type printing.
* f-valprint.c: New file, Fortran value printing.
* eval.c (evaluate_subexp): Add code for new expression opcodes,
fix wording of error message.
* gdbtypes.c (f77_create_literal_complex_type,
f77_create_literal_string_type): New functions.
* language.c (set_language_command): Add Fortran info.
(calc_f77_array_dims): New function.
* parse.c (length_of_subexp, prefixify_subexp): Add cases for new
expression opcodes.
* symfile.c (deduce_language_from_filename): Recognize .f and .F
as Fortran source files.
* valops.c (f77_value_literal_string, f77_value_substring,
f77_value_literal_complex): New functions.
1994-08-19 21:59:05 +00:00
|
|
|
/* FIXME, these should probably be restricted to a Fortran-specific
|
|
|
|
field in some fashion. */
|
|
|
|
#define BOUND_CANNOT_BE_DETERMINED 5
|
|
|
|
#define BOUND_BY_REF_ON_STACK 4
|
|
|
|
#define BOUND_BY_VALUE_ON_STACK 3
|
|
|
|
#define BOUND_BY_REF_IN_REG 2
|
|
|
|
#define BOUND_BY_VALUE_IN_REG 1
|
|
|
|
#define BOUND_SIMPLE 0
|
|
|
|
int upper_bound_type;
|
|
|
|
int lower_bound_type;
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
/* 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-24 22:54:21 +00:00
|
|
|
For a function or method type, describes the type of the return value.
|
1992-02-22 01:46:16 +00:00
|
|
|
For a range type, describes the type of the full range.
|
* eval.c (evaluate_subexp): Clean up handling of
OP_UNDETERMINED_ARGLIST (no backtracking, more general).
* f-valprint.c (f_val_print): Print TYPE_CODE_STRING using
LA_PRINT_STRING, and not val_print_string (which reads from inferior).
* ch-lang.c (chill_is_varying_struct), ch-lang.h: Remve function
duplicate function made redundant by chill_varying_type.
Re-write of f77 string and complex number support:
* language.h (struct language_defn): New fields string_lower_bound
and string_char_type.
* c-lang.c (c_language_defn, cplus_language_defn, asm_language_defn),
language.c (unknown_language_defn, auto_language_defn,
local_language_defn), m2-lang.c (m2_language_defn), f-lang.c
(f_language_defn), ch-lang.c (chill_language_defn): Set new fields.
* gdbtypes.c (create_string_type): Use new string_char_type field.
* valops.c (value_string): Use new string_lower_bound field.
* defs.h (TARGET_COMPLEX_BIT, TARGET_DOUBLE_COMPLEX_BIT): Removed.
* f-lang.c (f_create_fundamental_type, _initialize_f_language),
m2-lang.c (m2_create_fundamental_type),
gdbtypes.c (_initialize_gdbtypes): Set TYPE_TARGET_TYPE of complex
types. Set their TYPE_CODEs to TYPE_CODE_COMPLEX.
* mdebugread.c (mdebug_type_complex, mdebug_type_double_complex):
Removed. Use builtin_type_complex and builtin_type_double_complex.
* gdbtypes.h (enum type_code): Removed TYPE_CODE_LITERAL_STRING
and TYPE_CODE_LITERAL_COMPLEX.
* c-typeprint.c, f-typeprint.c, f-valprint.c, eval.c: Removed uses of
TYPE_CODE_LITERAL_STRING and TYPE_CODE_LITERAL_COMPLEX.
* gdbtypes.c, gdbtypes.h (f77_create_literal_complex_type,
f77_create_literal_string_type): Removed.
* value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_MEMADDR,
VALUE_SUBSTRING_MYADDR): Removed.
* expression.h (enum exp_opcode): Rename OP_F77_LITERAL_COMPLEX to
OP_COMPLEX.
* parse.c: Update accordingly.
* f-valprint.c (f77_print_cmplx): Removed.
(f_val_print case TYPE_CODE_COMPLEX): Re-write to use print_floating.
* f-exp.y (STRING_LITERAL): Use OP_STRING instead of OP_ARRAY.
* eval.c (evaluate_subexp): For case OP_ARRAY, don't call
f77_value_literal_string.
* valops.c, value.h (f77_value_literal_string, f77_value_substring,
f77_assign_from_literal_string, f77_assign_from_literal_complex):
Removed.
(value_assign): No longer need to handle literal types.
* valops.c (f77_value_literal_complex), value.h: Re-written and
renamed to value_literal_complex. Last arg is now a (complex) type.
* valops.c (f77_cast_into_complex): Re-written and renamed to
cast_into_complex.
* eval.c (evaluate_subexp): Update accordingly.
1995-02-02 03:37:26 +00:00
|
|
|
For a complex type, describes the type of each coordinate.
|
1992-02-22 01:46:16 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
/* 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".
|
1995-02-12 18:46:45 +00:00
|
|
|
For a function type, a "field" for each parameter type.
|
1992-08-01 20:40:59 +00: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 01:46:16 +00: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
|
|
|
|
{
|
|
|
|
|
|
|
|
|
1997-08-05 21:58:57 +00:00
|
|
|
|
|
|
|
union field_location
|
|
|
|
{
|
|
|
|
/* Position of this field, counting in bits from start of
|
|
|
|
containing structure.
|
|
|
|
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.
|
|
|
|
For a function type, this is the position in the argument list
|
|
|
|
of this argument.
|
|
|
|
For a range bound or enum value, this is the value itself. */
|
|
|
|
|
|
|
|
int bitpos;
|
|
|
|
|
|
|
|
/* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
|
|
|
|
is the location (in the target) of the static field.
|
|
|
|
Otherwise, physname is the mangled label of the static field. */
|
|
|
|
|
|
|
|
CORE_ADDR physaddr;
|
|
|
|
char* physname;
|
|
|
|
} loc;
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
/* Size of this field, in bits, or zero if not packed.
|
|
|
|
For an unpacked field, the field's type's length
|
1997-08-05 21:58:57 +00:00
|
|
|
says how many bytes the field occupies.
|
|
|
|
A value of -1 or -2 indicates a static field; -1 means the location
|
|
|
|
is specified by the label loc.physname; -2 means that loc.physaddr
|
|
|
|
specifies the actual address. */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
1997-08-05 21:58:57 +00:00
|
|
|
int bitsize;
|
1992-02-22 01:46:16 +00:00
|
|
|
|
1997-08-05 21:58:57 +00:00
|
|
|
/* In a struct or union type, type of this field.
|
1992-02-22 01:46:16 +00:00
|
|
|
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;
|
|
|
|
|
1996-12-14 09:17:22 +00:00
|
|
|
/* For types with virtual functions (TYPE_CODE_STRUCT), VPTR_BASETYPE
|
|
|
|
is the base class which defined the virtual function table pointer.
|
1992-02-22 01:46:16 +00:00
|
|
|
|
1996-12-14 09:17:22 +00:00
|
|
|
For types that are pointer to member types (TYPE_CODE_MEMBER),
|
|
|
|
VPTR_BASETYPE is the type that this pointer is a member of.
|
|
|
|
|
|
|
|
For method types (TYPE_CODE_METHOD), VPTR_BASETYPE is the aggregate
|
|
|
|
type that contains the method.
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
Unused otherwise. */
|
|
|
|
|
|
|
|
struct type *vptr_basetype;
|
|
|
|
|
1993-08-02 19:21:04 +00: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 01:46:16 +00:00
|
|
|
int vptr_fieldno;
|
|
|
|
|
|
|
|
/* Slot to point to additional language-specific fields of this type. */
|
|
|
|
|
|
|
|
union type_specific
|
|
|
|
{
|
|
|
|
|
1996-12-14 09:17:22 +00:00
|
|
|
/* ARG_TYPES is for TYPE_CODE_METHOD.
|
|
|
|
Contains the type of each argument, ending with a void type
|
|
|
|
after the last argument for normal member functions or a NULL
|
|
|
|
pointer after the last argument for functions with variable
|
|
|
|
arguments. */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
struct type **arg_types;
|
|
|
|
|
1992-07-09 04:40:39 +00: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 01:46:16 +00: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-30 23:06:37 +00: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 04:14:34 +00:00
|
|
|
|
|
|
|
short n_baseclasses;
|
|
|
|
|
|
|
|
/* Number of methods with unique names. All overloaded methods with
|
|
|
|
the same name count only once. */
|
|
|
|
|
|
|
|
short nfn_fields;
|
|
|
|
|
1994-10-29 09:51:32 +00:00
|
|
|
/* Number of methods described for this type, not including the
|
1992-07-21 04:14:34 +00:00
|
|
|
methods that it derives from. */
|
|
|
|
|
|
|
|
int nfn_fields_total;
|
|
|
|
|
1992-08-01 20:40:59 +00: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 01:46:16 +00:00
|
|
|
|
1992-07-09 04:40:39 +00: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 01:46:16 +00:00
|
|
|
|
|
|
|
B_TYPE *private_field_bits;
|
|
|
|
|
1992-07-09 04:40:39 +00: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 01:46:16 +00:00
|
|
|
B_TYPE *protected_field_bits;
|
|
|
|
|
1993-11-06 01:32:11 +00: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 01:46:16 +00: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 04:14:34 +00:00
|
|
|
has been renamed to make it distinct.
|
|
|
|
|
|
|
|
fn_fieldlists points to an array of nfn_fields of these. */
|
1992-02-22 01:46:16 +00: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-30 23:06:37 +00: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 04:14:34 +00:00
|
|
|
|
|
|
|
char *physname;
|
|
|
|
|
1996-12-14 09:17:22 +00:00
|
|
|
/* The type of the method. */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
struct type *type;
|
|
|
|
|
1992-07-21 04:14:34 +00:00
|
|
|
/* For virtual functions.
|
|
|
|
First baseclass that defines this virtual function. */
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
struct type *fcontext;
|
|
|
|
|
1992-07-21 04:14:34 +00:00
|
|
|
/* Attributes. */
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
unsigned int is_const : 1;
|
|
|
|
unsigned int is_volatile : 1;
|
|
|
|
unsigned int is_private : 1;
|
|
|
|
unsigned int is_protected : 1;
|
1993-07-30 23:06:37 +00:00
|
|
|
|
|
|
|
/* A stub method only has some fields valid (but they are enough
|
|
|
|
to reconstruct the rest of the fields). */
|
1992-02-22 01:46:16 +00:00
|
|
|
unsigned int is_stub : 1;
|
1993-07-30 23:06:37 +00:00
|
|
|
|
|
|
|
/* Unused. */
|
1992-02-22 01:46:16 +00: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 04:14:34 +00:00
|
|
|
unsigned int voffset : 24;
|
1992-02-22 01:46:16 +00: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 04:23:06 +00:00
|
|
|
extern const struct cplus_struct_type cplus_struct_default;
|
1992-02-22 01:46:16 +00: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 02:57:06 +00:00
|
|
|
#define TYPE_TAG_NAME(type) ((type)->tag_name)
|
1992-02-22 01:46:16 +00: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
|
1995-11-30 01:07:28 +00:00
|
|
|
/* Note that if thistype is a TYPEDEF type, you have to call check_typedef.
|
|
|
|
But check_typedef does set the TYPE_LENGTH of the TYPEDEF type,
|
|
|
|
so you only have to call check_typedef once. Since allocate_value
|
|
|
|
calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */
|
1992-02-22 01:46:16 +00:00
|
|
|
#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)
|
1995-11-30 01:07:28 +00:00
|
|
|
/* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you wan the real
|
|
|
|
type, you need to do TYPE_CODE (check_type (this_type)). */
|
1992-02-22 01:46:16 +00:00
|
|
|
#define TYPE_CODE(thistype) (thistype)->code
|
|
|
|
#define TYPE_NFIELDS(thistype) (thistype)->nfields
|
|
|
|
#define TYPE_FIELDS(thistype) (thistype)->fields
|
|
|
|
|
1994-09-17 00:38:23 +00:00
|
|
|
#define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0)
|
1993-12-21 22:18:51 +00:00
|
|
|
#define TYPE_LOW_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 0)
|
|
|
|
#define TYPE_HIGH_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 1)
|
|
|
|
|
Initial Fortran language support, adapted from work by Farooq Butt
(fmbutt@engage.sps.mot.com).
* Makefile.in: Add Fortran-related files and dependencies.
* defs.h (language_fortran): New language enum.
* language.h (_LANG_fortran): Define.
(MAX_FORTRAN_DIMS): Define.
* expression.h: Reformat to standard.
(MULTI_F77_SUBSCRIPT, OP_F77_UNDETERMINED_ARGLIST,
OP_F77_LITERAL_COMPLEX, OP_F77_SUBSTR): New expression opcodes.
* gdbtypes.h (TYPE_CODE_COMPLEX, TYPE_CODE_LITERAL_COMPLEX,
TYPE_CODE_LITERAL_STRING): New type codes.
(type): New fields upper_bound_type and lower_bound_type.
(TYPE_ARRAY_UPPER_BOUND_TYPE, TYPE_ARRAY_LOWER_BOUND_TYPE,
TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): New
macros.
(builtin_type_f_character, etc): Declare.
* value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_START): Define.
* f-exp.y: New file, Fortran expression grammar.
* f-lang.c: New file, Fortran language support functions.
* f-lang.h: New file, Fortran language support declarations.
* f-typeprint.c: New file, Fortran type printing.
* f-valprint.c: New file, Fortran value printing.
* eval.c (evaluate_subexp): Add code for new expression opcodes,
fix wording of error message.
* gdbtypes.c (f77_create_literal_complex_type,
f77_create_literal_string_type): New functions.
* language.c (set_language_command): Add Fortran info.
(calc_f77_array_dims): New function.
* parse.c (length_of_subexp, prefixify_subexp): Add cases for new
expression opcodes.
* symfile.c (deduce_language_from_filename): Recognize .f and .F
as Fortran source files.
* valops.c (f77_value_literal_string, f77_value_substring,
f77_value_literal_complex): New functions.
1994-08-19 21:59:05 +00:00
|
|
|
/* Moto-specific stuff for FORTRAN arrays */
|
|
|
|
|
|
|
|
#define TYPE_ARRAY_UPPER_BOUND_TYPE(thistype) (thistype)->upper_bound_type
|
|
|
|
#define TYPE_ARRAY_LOWER_BOUND_TYPE(thistype) (thistype)->lower_bound_type
|
|
|
|
|
|
|
|
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
|
|
|
|
(TYPE_FIELD_BITPOS((TYPE_FIELD_TYPE((arraytype),0)),1))
|
|
|
|
|
|
|
|
#define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \
|
|
|
|
(TYPE_FIELD_BITPOS((TYPE_FIELD_TYPE((arraytype),0)),0))
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
/* 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
|
1997-08-05 21:58:57 +00:00
|
|
|
#define TYPE_BASECLASS_BITPOS(thistype,index) TYPE_FIELD_BITPOS(thistype,index)
|
1992-02-22 01:46:16 +00:00
|
|
|
#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))
|
|
|
|
|
1997-08-05 21:58:57 +00:00
|
|
|
#define FIELD_TYPE(thisfld) ((thisfld).type)
|
|
|
|
#define FIELD_NAME(thisfld) ((thisfld).name)
|
|
|
|
#define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
|
|
|
|
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
|
|
|
|
#define FIELD_PHYSNAME(thisfld) ((thisfld).loc.physname)
|
|
|
|
#define FIELD_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
|
|
|
|
#define SET_FIELD_PHYSNAME(thisfld, name) \
|
|
|
|
((thisfld).bitsize = -1, FIELD_PHYSNAME(thisfld) = (name))
|
|
|
|
#define SET_FIELD_PHYSADDR(thisfld, name) \
|
|
|
|
((thisfld).bitsize = -2, FIELD_PHYSADDR(thisfld) = (name))
|
1992-02-22 01:46:16 +00:00
|
|
|
#define TYPE_FIELD(thistype, n) (thistype)->fields[n]
|
1997-08-05 21:58:57 +00:00
|
|
|
#define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n))
|
|
|
|
#define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n))
|
|
|
|
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(TYPE_FIELD(thistype,n))
|
|
|
|
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
|
|
|
|
#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0)
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
#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 01:32:11 +00:00
|
|
|
#define TYPE_FIELD_IGNORE_BITS(thistype) \
|
|
|
|
TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits
|
1992-02-22 01:46:16 +00: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 01:32:11 +00:00
|
|
|
#define SET_TYPE_FIELD_IGNORE(thistype, n) \
|
|
|
|
B_SET (TYPE_CPLUS_SPECIFIC(thistype)->ignore_field_bits, (n))
|
1992-02-22 01:46:16 +00: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 01:32:11 +00: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 01:46:16 +00:00
|
|
|
#define TYPE_FIELD_VIRTUAL(thistype, n) \
|
|
|
|
B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n))
|
|
|
|
|
1997-08-05 21:58:57 +00:00
|
|
|
#define TYPE_FIELD_STATIC(thistype, n) ((thistype)->fields[n].bitsize < 0)
|
|
|
|
#define TYPE_FIELD_STATIC_HAS_ADDR(thistype, n) ((thistype)->fields[n].bitsize == -2)
|
|
|
|
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_PHYSNAME(TYPE_FIELD(thistype, n))
|
|
|
|
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_PHYSADDR(TYPE_FIELD(thistype, n))
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
#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 04:14:34 +00:00
|
|
|
#define TYPE_FN_FIELD_PHYSNAME(thisfn, n) (thisfn)[n].physname
|
1992-02-22 01:46:16 +00: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 04:14:34 +00: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 01:46:16 +00: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 04:14:34 +00: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 01:46:16 +00:00
|
|
|
|
1998-03-20 07:50:33 +00:00
|
|
|
/* Implicit sizes */
|
1992-02-22 01:46:16 +00: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 08:33:43 +00:00
|
|
|
extern struct type *builtin_type_signed_char;
|
1992-02-22 01:46:16 +00: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 05:15:58 +00:00
|
|
|
extern struct type *builtin_type_string;
|
1992-02-22 01:46:16 +00:00
|
|
|
|
1998-03-20 07:50:33 +00:00
|
|
|
/* Explicit sizes - see <intypes.h> for naming schema */
|
|
|
|
extern struct type *builtin_type_int8;
|
|
|
|
extern struct type *builtin_type_uint8;
|
|
|
|
extern struct type *builtin_type_int16;
|
|
|
|
extern struct type *builtin_type_uint16;
|
|
|
|
extern struct type *builtin_type_int32;
|
|
|
|
extern struct type *builtin_type_uint32;
|
|
|
|
extern struct type *builtin_type_int64;
|
|
|
|
extern struct type *builtin_type_uint64;
|
|
|
|
/* start-sanitize-r5900 */
|
|
|
|
extern struct type *builtin_type_int128;
|
|
|
|
extern struct type *builtin_type_uint128;
|
|
|
|
/* end-sanitize-r5900 */
|
|
|
|
|
1992-02-22 01:46:16 +00: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-15 17:28:02 +00: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-18 22:49:38 +00: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-15 17:28:02 +00:00
|
|
|
extern struct type *builtin_type_chill_long;
|
|
|
|
extern struct type *builtin_type_chill_ulong;
|
|
|
|
extern struct type *builtin_type_chill_real;
|
|
|
|
|
Initial Fortran language support, adapted from work by Farooq Butt
(fmbutt@engage.sps.mot.com).
* Makefile.in: Add Fortran-related files and dependencies.
* defs.h (language_fortran): New language enum.
* language.h (_LANG_fortran): Define.
(MAX_FORTRAN_DIMS): Define.
* expression.h: Reformat to standard.
(MULTI_F77_SUBSCRIPT, OP_F77_UNDETERMINED_ARGLIST,
OP_F77_LITERAL_COMPLEX, OP_F77_SUBSTR): New expression opcodes.
* gdbtypes.h (TYPE_CODE_COMPLEX, TYPE_CODE_LITERAL_COMPLEX,
TYPE_CODE_LITERAL_STRING): New type codes.
(type): New fields upper_bound_type and lower_bound_type.
(TYPE_ARRAY_UPPER_BOUND_TYPE, TYPE_ARRAY_LOWER_BOUND_TYPE,
TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): New
macros.
(builtin_type_f_character, etc): Declare.
* value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_START): Define.
* f-exp.y: New file, Fortran expression grammar.
* f-lang.c: New file, Fortran language support functions.
* f-lang.h: New file, Fortran language support declarations.
* f-typeprint.c: New file, Fortran type printing.
* f-valprint.c: New file, Fortran value printing.
* eval.c (evaluate_subexp): Add code for new expression opcodes,
fix wording of error message.
* gdbtypes.c (f77_create_literal_complex_type,
f77_create_literal_string_type): New functions.
* language.c (set_language_command): Add Fortran info.
(calc_f77_array_dims): New function.
* parse.c (length_of_subexp, prefixify_subexp): Add cases for new
expression opcodes.
* symfile.c (deduce_language_from_filename): Recognize .f and .F
as Fortran source files.
* valops.c (f77_value_literal_string, f77_value_substring,
f77_value_literal_complex): New functions.
1994-08-19 21:59:05 +00:00
|
|
|
/* Fortran (F77) types */
|
|
|
|
|
|
|
|
extern struct type *builtin_type_f_character;
|
|
|
|
extern struct type *builtin_type_f_integer;
|
|
|
|
extern struct type *builtin_type_f_logical;
|
|
|
|
extern struct type *builtin_type_f_logical_s1;
|
|
|
|
extern struct type *builtin_type_f_logical_s2;
|
|
|
|
extern struct type *builtin_type_f_integer;
|
|
|
|
extern struct type *builtin_type_f_integer_s2;
|
|
|
|
extern struct type *builtin_type_f_real;
|
|
|
|
extern struct type *builtin_type_f_real_s8;
|
|
|
|
extern struct type *builtin_type_f_real_s16;
|
|
|
|
extern struct type *builtin_type_f_complex_s8;
|
|
|
|
extern struct type *builtin_type_f_complex_s16;
|
|
|
|
extern struct type *builtin_type_f_complex_s32;
|
|
|
|
extern struct type *builtin_type_f_void;
|
|
|
|
|
1992-02-22 01:46:16 +00: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 00:13:11 +00: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 00:31:10 +00: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 00:13:11 +00:00
|
|
|
? obstack_alloc (&TYPE_OBJFILE (t) -> type_obstack, size) \
|
1992-08-29 00:31:10 +00: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 00:13:11 +00:00
|
|
|
|
1992-02-22 01:46:16 +00: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 09:14:43 +00:00
|
|
|
extern struct type *
|
|
|
|
make_reference_type PARAMS ((struct type *, struct type **));
|
|
|
|
|
1992-02-22 01:46:16 +00: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 09:14:43 +00:00
|
|
|
extern struct type *
|
|
|
|
make_pointer_type PARAMS ((struct type *, struct type **));
|
|
|
|
|
1992-02-22 01:46:16 +00: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 09:14:43 +00:00
|
|
|
extern struct type *
|
|
|
|
make_function_type PARAMS ((struct type *, struct type **));
|
|
|
|
|
1992-02-22 01:46:16 +00: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-18 20:21:32 +00: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 01:46:16 +00:00
|
|
|
|
1993-01-16 05:15:58 +00:00
|
|
|
extern struct type *
|
|
|
|
create_string_type PARAMS ((struct type *, struct type *));
|
|
|
|
|
1994-08-23 21:39:50 +00:00
|
|
|
extern struct type *create_set_type PARAMS ((struct type *, struct type *));
|
|
|
|
|
* ch-exp.y (value_string_element, string_primitive_value,
start_element, left_element, right_element, slice_size,
lower_element, upper_element, first_element): Removed.
(value_string_slice, value_array_slice): Replaced by ...
(slice): New non-terminal, with working slice support.
(primitive_value_lparen, rparen): New non-terminals.
(maybe_tuple_elements): New non-terminal, to allow empty tuples.
(idtokentab): Added "up".
* value.h (COERCE_VARYING_ARRAY): New macro.
* valarith.c (value_subscript): Use it.
* valops.c (value_cast): Likewise. Also, do nothing if already
correct type, and allow converting from/to range to/from scalar.
* valops.c, value.h (varying_to_slice, value_slice): New functions.
* eval.c (OP_ARRAY): Add cast for array element.
* expression.h (TERNOP_SLICE, TERNOP_SLICE_COUNT): New exp_opcodes.
* valops.c (chill_varying_type): Moved function frp, here ...
* gdbtypes.c (chill_varying_type), gdbtypes.h: ... to here.
* parse.c (length_of_subexp, prefixify_subexp): Add support
for TERNOP_SLICE, TERNOP_SLICE_COUNT.
* expprint.c (print_subexp, dump_expression): Likewise.
* eval.c (evaluate_subexp): Likewise.
* eval.c (evaluate_subexp case MULTI_SUBSCRIPT): Don't call
value_x_binop on a Chill varying string.
1995-02-01 21:02:51 +00:00
|
|
|
extern int chill_varying_type PARAMS ((struct type*));
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
extern struct type *
|
|
|
|
lookup_unsigned_typename PARAMS ((char *));
|
|
|
|
|
1992-07-10 23:30:40 +00:00
|
|
|
extern struct type *
|
|
|
|
lookup_signed_typename PARAMS ((char *));
|
|
|
|
|
1995-11-30 01:07:28 +00:00
|
|
|
extern struct type *
|
|
|
|
check_typedef PARAMS ((struct type *));
|
|
|
|
|
|
|
|
#define CHECK_TYPEDEF(TYPE) (TYPE) = check_typedef (TYPE)
|
1992-02-22 01:46:16 +00:00
|
|
|
|
|
|
|
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-29 23:26:47 +00:00
|
|
|
extern void
|
|
|
|
fill_in_vptr_fieldno PARAMS ((struct type *));
|
|
|
|
|
1996-12-14 09:17:22 +00:00
|
|
|
extern int get_destructor_fn_field PARAMS ((struct type *, int *, int *));
|
|
|
|
|
1995-10-05 01:09:53 +00:00
|
|
|
extern int get_discrete_bounds PARAMS ((struct type*, LONGEST*, LONGEST*));
|
|
|
|
|
* 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 00:22:57 +00:00
|
|
|
#if MAINTENANCE_CMDS
|
|
|
|
extern void recursive_dump_type PARAMS ((struct type *, int));
|
|
|
|
#endif
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
/* printcmd.c */
|
|
|
|
|
|
|
|
extern void
|
1993-11-01 22:25:23 +00:00
|
|
|
print_scalar_formatted PARAMS ((char *, struct type *, int, int, GDB_FILE *));
|
1992-02-22 01:46:16 +00:00
|
|
|
|
1994-05-17 20:13:50 +00:00
|
|
|
extern int can_dereference 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 00:22:57 +00:00
|
|
|
#if MAINTENANCE_CMDS
|
|
|
|
extern void maintenance_print_type PARAMS ((char *, int));
|
|
|
|
#endif
|
|
|
|
|
1996-07-26 03:01:51 +00:00
|
|
|
/* typeprint.c */
|
|
|
|
|
|
|
|
extern void print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
|
|
|
|
|
1992-02-22 01:46:16 +00:00
|
|
|
#endif /* GDBTYPES_H */
|