* c-typeprint.c (c_typedef_print): remove (replaced by typedef_print in
typeprint.c).
* typeprint.c (typedef_print): new function. (old c_typedef_print
function with pascal language support added).
* value.h (c_printdef_print): removed.
(typedef_print): declare.
* symtab.c (print_symbol_info): call to c_typedef_print replaced by
call to typedef_print.
* expprint.c expression.h (dump_expression): Rename to
dump_prefix_expression.
* Print out the expression in normal form. Call print_longest
instead of trying to do it ourselves.
* (dump_postfix_expression): New function, prints out the expression
with indentation and better formatting and interpretation.
* parse.c (parse_exp_1): Put calls to dump expressions under ifdef
MAINTENANCE_CMDS and expressiondebug variable.
destructor name with call to destructor_name_p.
* c-lang.h, c-typeprint.c (cp_type_print_method_args): Removed,
no longer needed.
* c-typeprint.c (c_type_print_varspec_prefix, c_type_print_base):
Replace remaining fprintf_unfiltered calls with their filtered variant.
(c_type_print_base): Do not print return type for destructors from
template classes.
Replace cp_type_print_method_args with cplus_demangle call to get
consistent type output for stubbed and unstubbed methods.
* cp-valprint.c (cp_print_class_method): Replace
cp_type_print_method_args with cplus_demangle call to get consistent
type output for stubbed and unstubbed methods.
* gdbtypes.c, gdbtypes.h (get_destructor_fn_field): New function
to find the destructor field indices for a type.
* gdbtypes.h (struct type): Clarify comments for vptr_basetype
and arg_types fields.
(struct fn_field): Remove args field, no longer used.
* symtab.c (decode_line_1), valops.c (value_struct_elt,
check_field_in): Use get_destructor_fn_field to find the destructor
field indices instead of assuming that the compiler passes the member
function fields in a specific order.
* symtab.c (find_methods): Pass NULL instead of SYMBOL_BLOCK_VALUE
to lookup_symbol.
(list_symbol): Replace cp_type_print_method_args with cplus_demangle
call in zapped out code and explain why this code is zapped out.
character is one of the commonly used C++ marker characters.
* defs.h (is_cplus_marker): Add prototype.
* c-typeprint.c (c_type_print_base), ch-lang.c (chill_demangle),
cp-valprint.c (cp_print_class_method), mdebugread.c (parse_symbol),
stabsread.c (define_symbol, read_member_functions, read_struct_fields),
symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P),
values.c (vb_match): Use is_cplus_marker instead of comparison
with CPLUS_MARKER.
* ch-exp.c: New file. Use recursive-descent.
Recognize labelled array tuples and powerset ranges.
* Makefile.in: Update for no longer using yacc for ch-exp.
* c-lang.c: Make various functions non-static.
* c-lang.h: Add bunches of prototypes.
* cp-valprint.c (cp_print_value_fields): Also take address.
(cp_print_value): Likewise. Use baselcass_offset.
* stabsread.c (current_symbol): New static variable.
(type_synonym_name): Remove.
(read_type): If copying, make copy be a TYPE_CODE_TYPEDEF.
(read_array_type): Don't need to handle undefined element type here.
(cleanup_undefined_types): Ditto.
(read_range_type): Look for Chill ranges.
* valops.c (value_assign): Fix case lval_internalvar - don't try
to assign into old value (which might be too small!).
(value_coerce_array): No longer need special VALUE_REPEATED handling.
(value_arg_coerce): Cleaner array->pointer decay mechanism.
(search_struct_field): Use baseclass_offset rather than
baseclass_addr.
(value_slice): Use get_discrete_bounds.
* value.h (COERCE_VARYING_ARRAY): Take type argumnt as well.
* values.c (baseclass_offset): Change parameter interface.
(baseclass_addr): Removed.
* c-typeprint.c, c-valprint.c, ch-valprint.c, values.c, valops.c:
Add check_typedef/CHECK_TYPEDEF as needed.
create a 0-length array type, and set BOUND_CANNOT_BE_DETERMINED.
* valops.c (value_cast): If a cast like (TYPE[])VALUE (i.e. array
of unknown length) use sizeof(VALUE)/sizeof(TYPE) as the length.
* c-typeprint.c (c_type_print_varspec_suffix): If array length
is 0, print it, but not if upper_bound is BOUND_CANNOT_BE_DETERMINED.
parameter type info, set that from parameter symbols.
* c-typeprint.c (c_type_print_varspec_suffix): For TYPE_CODE_FUNC,
print parameter types, if available.
* ch-typeprint.c (chill_type_print_base): Likewise.
* gdbtypes.h (struct type): Remove function type field.
(TYPE_FUNCTION_TYPE): Remove macro. We can't as simply re-use
function types now that we're also storing parameter types.
And the payoff is much less.
* gdbtypes.c (make_function_type): Don't use/set TYPE_FUNCTION_TYPE.
(recursive_dump_type): Don't print TYPE_FUNCTION_TYPE.
* dwarfread.c (read_subroutine_type): Don't set TYPE_FUNCTION_TYPE.
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.
the return type of methods to avoid infinite loops with anonymous
types.
* valops.c (search_struct_field): Handle anonymous unions.
* sparc-tdep.c (sunos4_skip_trampoline_code): New function
to correctly handle steps into -g compiled PIC objects in the
main executable.
* config/sparc/tm-sun4os4.h (SKIP_TRAMPOLINE_CODE):
Redefine to use sunos4_skip_trampoline_code.
* dwarfread.c (DWARF_REG_TO_REGNUM): Provide a default mapping
from DWARF to GDB register numbering.
* dwarfread.c (locval): Use DWARF_REG_TO_REGNUM to map the
register value.
* config/mips/tm-mipsv4.h (DWARF_REG_TO_REGNUM): Define.
printing of static members.
(_initialize_cp_valprint): New print set subcommand
"static-members". Turn on printing of static members by default.
(cp_print_value_fields): Print static members if necessary.
* solib.c: Remove inclusion of libelf.h and elf/mips.h.
(elf_locate_base): Use only standard BFD functions to collect
information about the .dynamic section. Check for DT_MIPS_RLD_MAP
tag only if it got defined via the inclusion of <link.h>.
* f-exp.y: Write block for OP_VAR_VALUE.
* f-valprint.c (info_common_command): Handle `info common'
without an argument correctly.
* c-typeprint.c (c_type_print_base): Handle template constructors.
* symtab.c (gdb_mangle_name): Handle template method mangling,
get rid of GCC_MANGLE_BUG code, which only applied to gcc-2.2.2.
if a '(' is found in varstring, Looking for ')' at the end of
varstring did fail with demangled const member functions, which
have a trailing `const'.
* remote.c (get_offsets, putpkt): Change to `char' buffers,
to avoid errors when compiling with DEC c89.
(remote_wait): Cast to `char *' before passing buffer to
fputs_filtered, to avoid errors when compiling with DEC c89.
(remote_wait): Do not return inferior_pid by default, this
statement is never reached, which causes warnings from some
compilers.
* stabsread.c (scan_file_globals): Ignore static minimal symbols.
* symfile.c (load_command): If called with no argument, try
to get the filename from the executable file.
(generic_load): Remove check for NULL filename, it is done
in load_command now.
full details on structure elements without names. This partially
reverts the changes of 1 Jul 1993 and 31 Aug 1993; I think this aspect
of those changes was accidental.
* 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.
Change all references to stdout/stderr to gdb_stdout/gdb_stderr.
Replace all calls to stdio output functions with calls to
corresponding _unfiltered functions (`fprintf_unfiltered')
Replaced calls to fopen for output to gdb_fopen.
Added sufficient goo to utils.c and defs.h to make the above work.
The net effect is that stdio output functions are only directly used
in utils.c. Elsewhere, the _unfiltered and _filtered functions and
GDB_FILE type are used.
In the near future, GDB_FILE will stop being equivalant to FILE.
The semantics of some commands has changed in a very subtle way:
called in the right context, they may cause new occurences of
prompt_for_continue() behavior. The testsuite doesn't notice anything
like this, though.
Please respect this change by not reintroducing stdio output
dependencies in the main body of gdb code. All output from commands
should go to a GDB_FILE.
Target-specific code can still use stdio directly to communicate with
targets.
show < 0. The only case where we had been distinguishing is that
show = 0 used to print "struct " or "enum " instead of
"struct {...}" or "enum {...}" which seems clearly wrong.
* utils.c (fprintf_symbol_filtered): New function which combines
the functionality of fputs_demangled and fprint_symbol. Uses a
caller provided language parameter to select the appropriate
demangler, and caller provided args to pass to the demangler.
* defs.h (fputs_demangled, fprint_symbol): Remove prototypes.
* defs.h (fprintf_symbol_filtered): Add prototype.
* c-typeprint.c (cp_type_print_method_args): Replace calls to
fputs_demangled with call to fprintf_symbol_filtered.
* cp-valprint.c (demangle.h): Include
* cp-valprint.c (cp_print_value_fields): Replace calls to
fprint_symbol with calls to fprintf_symbol_filtered.
* printcmd.c (print_frame_args): Replace call to fprint_symbol
with call to fprintf_symbol_filtered.
* stack.c (print_frame_info, frame_info): Add language variable
to pass to fprintf_symbol_demangled and initialize it from the
symbol's language. Replace calls to fputs_demangled with calls
to fprintf_symbol_filtered.
* symtab.c (find_methods): Replace call to fputs_demangled with
call to fprintf_symbol_filtered.
**** start-sanitize-chill ****
* ch-valprint.c (demangle.h): Include.
* ch-valprint.c (chill_print_value_fields): Replace call to
fprint_symbol with call to new fprintf_symbol_filtered.
**** end-sanitize-chill ****
add a language parameter that is used to select the demangling
algorithm.
* defs.h (enum language): Move further up in file so enum can
be used in prototypes.
* defs.h (fputs_demangled): Update prototype to add lang arg.
* c-typeprint.c (cp_type_print_method_args): Add language arg
to fputs_demangled calls, remove DMGL_PARAMS flag.
* stack.c (print_frame_info): Remove obsolete code so we don't
have to update fputs_demangled usage in it.
* stack.c (print_frame_info, frame_info): Add language variable
to pass to fputs_demangled and initialize it from the symbol's
language. Call fputs_demangled with language arg.
* symtab.c (find_methods): Add language arg to fputs_demangled
call.
constants with an explicit null byte terminator. OP_STRING is
now used for real string types.
* c-lang.c (builtin_type_*): Move declarations to lang.c since
they are used by all languages.
* c-lang.c (_initialize_c_language): Move initializations of
builtin_type_* to lang.c.
* c-typeprint.c (c_type_print_varspec_prefix,
c_type_print_varspec_suffix): TYPE_CODE_PASCAL_ARRAY renamed
to TYPE_CODE_STRING.
* c-valprint.c (c_val_print): Change the way character arrays
are printed as strings to be consistent with the way strings
are printed when pointer-to-char types are dereferenced.
Remove test of print_max before calling val_print_string, which
now does it's own test.
* eval.c (evaluate_subexp): Add case for OP_ARRAY.
* expprint.c (print_subexp, dump_expression): Add case for OP_ARRAY.
* expression.h (enum exp_opcode): Add OP_ARRAY and document.
* gdbtypes.c (builtin_type_*): Add declarations moved from
c-lang.c.
* gdbtypes.c (create_string_type): New function to create real
string types.
* gdbtypes.c (recursive_dump_type): TYPE_CODE_PASCAL_ARRAY
renamed to TYPE_CODE_STRING.
* gdbtypes.c (_initialize_gdbtypes): Add initializations of
builtin_type_* types moved from c-lang.c.
* gdbtypes.h (enum type_code): TYPE_CODE_PASCAL_ARRAY renamed
to TYPE_CODE_STRING.
* gdbtypes.h (builtin_type_string): Add extern declaration.
* gdbtypes.h (create_string_type): Add prototype.
* m2-lang.c (m2_create_fundamental_type): TYPE_CODE_PASCAL_ARRAY
renamed to TYPE_CODE_STRING.
* m88k-tdep.c (pushed_size): TYPE_CODE_PASCAL_ARRAY renamed to
TYPE_CODE_STRING.
* mipsread.c (_initialize_mipsread): TYPE_CODE_PASCAL_ARRAY
renamed to TYPE_CODE_STRING.
* parse.c (length_of_subexp, prefixify_subexp): Add case for
OP_ARRAY.
* printcmd.c (print_formatted): Recognize TYPE_CODE_STRING.
* typeprint.c (print_type_scalar): TYPE_CODE_PASCAL_ARRAY renamed
to TYPE_CODE_STRING.
* valops.c (allocate_space_in_inferior): New function and
prototype, using code ripped out of value_string.
* valops.c (value_string): Rewritten to use new function
allocate_space_in_inferior, but temporarily disabled until some
other support is in place.
* valops.c (value_array): New function to create array constants.
* valprint.c (val_print_string): Add comment to document use,
complete rewrite to fix several small buglets.
* value.h (value_array): Add prototype.
* value.h (val_print_string): Change prototype to match rewrite.
**** start-sanitize-chill ****
* ch-valprint.c (chill_val_print): Add case for TYPE_CODE_STRING.
* ch-exp.y (match_character_literal): Disable recognition of
control sequence form of character literals and document why.
**** end-sanitize-chill ****
* 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.