statement about unbounded arrays being unimplemented.
* m2-valprint.c (m2_print_array_contents): New function.
(m2_print_unbounded_array): New function.
(m2_print_array_contents): New function.
* m2-typeprint.c (m2_unbounded_array): New function.
(m2_is_unbounded_array): New function.
(m2_print_type): Test for unbounded array when walking
across structs.
* m2-lang.h: Added extern m2_is_unbounded_array.
* m2-lang.c (evaluate_subexp_modula2): New function.
(exp_descriptor_modula2): New structure.
(m2_language_defn): Use exp_descriptor_modula2.
* m2-exp.y: Added TSIZE and binary subscript.
builtin_type_m2_card, builtin_type_m2_real, builtin_type_m2_bool):
Replace global variable declaration with compatibility macro.
(struct builtin_m2_type): New data type.
(builtin_m2_type): Add prototype.
* m2-lang.c (builtin_type_m2_char, builtin_type_m2_int,
builtin_type_m2_card, builtin_type_m2_real, builtin_type_m2_bool):
Remove global variables.
(m2_language_arch_info): Use builtin_m2_type instead of variables.
(build_m2_types): New function.
(m2_type_data): New variable.
(builtin_m2_type): New function.
(_initialize_m2_language): Do not build data types. Register
m2_type_data per-gdbarch data.
(enum cplus_primitive_types): New data type.
(cplus_language_arch_info): New function.
(cplus_language_defn): Set la_language_arch_info member. Do not set
la_builtin_type_vector and string_char_type members.
* f-lang.c (f_builtin_types): Remove.
(enum f_primitive_types): New data type.
(f_language_arch_info): New function.
(f_language_de): Set la_language_arch_info member. Do not set
la_builtin_type_vector and string_char_type members.
* m2-lang.c (m2_builtin_types): Remove.
(enum m2_primitive_types): New data type.
(m2_language_arch_info): New function.
(m2_language_defn): Set la_language_arch_info member. Do not set
la_builtin_type_vector and string_char_type members.
* objc-lang.c (objc_builtin_types): Remove.
(objc_language): Set la_language_arch_info member. Do not set
la_builtin_type_vector and string_char_type members.
* p-lang.c (pascal_builtin_types): Remove.
(enum pascal_primitive_types): New data type.
(pascal_language_arch_info): New function.
(pascal_language_defn): Set la_language_arch_info member. Do not set
la_builtin_type_vector and string_char_type members.
* language.h (language_defn): New field la_print_array_index.
(LA_PRINT_ARRAY_INDEX): New macro.
(default_print_array_index): Add declaration.
* language.c (default_print_array_index): new function.
(unknown_language): Add value for new field.
(auto_language): Likewise.
(local_language): Likewise.
* ada-lang.c (ada_print_array_index): New function.
(ada_language_defn): Add value for new field.
* c-lang.c (c_language_defn): Likewise.
(cpluc_language_defn): Likewise.
(asm_language_defn): Likewise.
(minimal_language_defn): Likewise.
* f-lang.c (f_language_defn): Likewise.
* jv-lang.c (java_language_defn): Likewise.
* m2-lang.c (m2_language_defn): Likewise.
* objc-lang.c (objc_language_defn): Likewise.
* p-lang.c (pascal_language_defn): Likewise.
* scm-lang.c (scm_language_defn): Likewise.
* valprint.h (print_array_indexes_p): Add declaration.
(get_array_low_bound): Add declaration.
(maybe_print_array_index): Add declaration.
* valprint.c (print_array_indexes): New static variable.
(show_print_array_indexes): New function.
(print_array_indexes_p): New function.
(get_array_low_bound): New function.
(maybe_print_array_index): New function.
(val_print_array_elements): Print the index of each element if
requested by the user.
(_initialize_valprint): Add new array-indexes "set/show print" command.
* ada-valprint.c (print_optional_low_bound): Replace extracted code
by call to ada_get_array_low_bound_and_type(). Stop printing the low
bound if indexes will be printed for all elements of the array.
(val_print_packed_array_elements): Print the index of each element
of the array if necessary.
* language.h (struct language_defn): Make la_printstr's buffer
parameter a const bfd_byte.
* p-lang.h (pascal_printstr): Update function to match.
* ada-valprint.c (ada_printstr): Update function to match.
* scm-lang.c (scm_printstr): Update function to match.
* p-lang.c (pascal_printstr): Update function to match.
* ada-lang.h (ada_printstr): Update function to match.
* m2-lang.c (m2_printstr): Update function to match.
* objc-lang.c (objc_printstr): Update function to match.
* c-lang.h (c_printstr): Update function to match.
* f-lang.c (f_printstr): Update function to match.
* c-lang.c (c_printstr): Update function to match.
* language.c (unk_lang_printstr): Update function to match.
language-specific info for printing, prefixifying, dumping, and
evaluating expressions.
(exp_descriptor_standard): Declare new variable.
(print_subexp): Make global and declare here (from expprint.c).
(dump_subexp): Ditto.
(dump_subexp_body_standard): Declare.
(operator_length_standard): Declare.
(op_name_standard): Declare.
(print_subexp): Declare.
(print_subexp_standard): Declare.
* language.h (struct language_defn): Add la_exp_desc field to hold
pointer to table for language-specific operators.
Remove evaluate_exp field, which is now in struct exp_descriptor.
* parse.c (operator_length): Move most code to new
operator_length_standard function. Use language-specific information.
(operator_length_standard): New function taking most code from
operator_length.
(exp_descriptor_standard): New constant.
* expression.h (enum exp_opcode): Add definitions of OP_EXTENDED0
and OP_EXTENDED_LAST.
* expprint.c (print_subexp): Use language-specific print_subexp.
Make global; remove static declaration.
Move most code to print_subexp_standard.
(print_subexp_standard): New function, containing code formerly in
print_subexp.
(op_name): Add expression to argument signature.
Use langauge-specific op_name.
Move most code to op_name_standard.
(op_name_standard): New function, containing code formerly in op_name.
(dump_subexp): Use new version of op_name function.
Use language-specific dump_subexp_body, and move most existing code to
dump_subexp_body_standard.
(dump_raw_expression): Use new op_name interface.
(dump_subexp_body): Move most code to dump_subexp_body_standard.
(dump_subexp_body_standard): New function, containing code formerly
in dump_subexp_body.
* language.c (unknown_language): Add default la_exp_desc field and
remove evaluate_exp field.
(auto_language): Ditto.
(local_language): Ditto.
* f-lang.c (f_language_defn): Ditto.
* c-lang.c (c_language_defn): Ditto.
(cplus_language_defn): Ditto.
(asm_language_defn): Ditto.
(minimal_language_defn): Ditto.
* p-lang.c (pascal_language_defn): Ditto.
* m2-lang.c (m2_language_defn): Ditto.
* objc-lang.c (objc_language_defn): Ditto.
* jv-lang.c (exp_descriptor_java): New variable, containing
Java-specific expression evaluator.
(java_language_defn): Add la_exp_desc field and remove evaluate_exp
field.
* scm-lang.c (exp_descriptor_scm): New variable, containing
Scheme-specific expression evaluator.
(scm_language_defn): Add la_exp_desc field and remove evaluate_exp
field.
* objc-lang.c (print_object_command): Take evaluate_exp from the
la_exp_desc field.
* Makefile.in (eval.o): Add dependency on parser-defs.h.
* eval.c: Include parser-defs.h for the full declaration of
la_exp_desc's type.
(evaluate_subexp): Get evaluate_exp out of la_exp_desc field.
* c-lang.c: Set case sensitivity on for c_language_defn,
cplus_language_defn, and asm_language_defn.
* ch-lang.c: Set case sensitivity on for chill_language_defn.
* f-lang.c: Set case sensivitity off for f_language_defn.
* jv-lang.c: Set case sensitivity on for java_language_defn.
* language.h: Add enum case_mode, case_sensitivity.
* language.c: Define case_mode, case_sensitivity. Set case
sensitivity on for unknown_language_defn, auto_language_defn,
and local_language_defn.
(show_case_command,set_case_command,set_case_str): New static func.
(set_type_range_case): New static func, replaces set_type_range ().
(set_language_command,set_type_command,set_range_command,set_language):
Call set_type_range_case ().
(language_info): Print case sensitivity setting.
(_initialize_language): Add set/show commands for 'case-sensitive'.
Set default case mode 'auto'. Set default language 'auto'.
* m2-lang.c: Set case sensitivity on for m2_language_defn.
* p-lang.c: Set case sensitivity on for pascal_language_defn.
* scm-lang.c: Set case sensitivity off for scm_language_defn.
* symtab.c (lookup_symbol): Downcase symbol name if case sensivitity
is off.
* bcache.h, bcache.c, c-valprint.c, coffread.c, stabsread.c,
stack.c, valprint.c: Change variables to unsigned.
* bcache.c: Rearrange to avoid warnings about variables not being set.
* c-lang.c, ch-lang.c, f-lang.c, m2-lang.c: Include valprint.h
rather than declaring print_max and repeat_count_threashold
ourselves (incorrectly).
* valprint.h: Do declare repeat_count_threashold.
* ch-exp.c: Use default case for internal error.
* findvar.c: Don't omit argument type.
* symtab.c: Remove unused variable.
C, else it's `const'.
* c-lang.c c-lang.h ch-lang.c f-lang.c language.c m2-lang.c
scm-lang.c: Microsoft C can't hack const pointers. Use CONST_PTR
macro instead.
* configure configure.in defs.h: Use AC_C_CONST to figure out if
the compiler supports const. Gets rid of some cruft in defs.h.
* dwarf2read.c: <string.h> -> "gdb_string.h"
* remote-sim.c: Add prototypes. Fix call to gdbsim_kill.
* sparcl-tdep.c (download): Add prototypes to write_routine and
start_routine args.
* mswin/gdbwin.c: Don't include both varargs.h AND stdarg.h. Get
rid of varargs.h Include string.h.
* (gdbwin_update gdbwin_fputs regs_changed_f bpt_changed_f
update): Fix prototypes, fix calls.
* (update): Return value for catch_errors.
* (run_execute_command togdb_command_from_tty togdb_command):
Cleanup catching of errors from calls to execute_command. Also,
dup command string to avoid modifying const strings.
* (togdb_breakinfo_i_init togdb_breakinfo_i_next): Use 0 instead
of NULL when see if b->address isn't set.
* (bi_disable_bpt bi_enable_bpt bi_delete_all
bi_delete_breakpoint): Add arg to calls to update.
* (gui_command): Add prototype.
* (mswin_query): Fix prototype.
* (_initialize_gdbwin): Dup string to avoid modifying const.
* (info_path togdb_get_info_path): Remove const from decls cuz
this can't be const (it points at malloc'ed memory).
* (togdb_searchpath): Remove const from path. Dup string to
avoid modifying const strings.
* rindex -> strrchr.
* (gdbwin_list_symbols): Regexp param is const.
* Fix lots of refs to psymtabs to deref correct pointers.
* (togdb_set_breakpoint_sal): Call set_breakpoint_sal with sal,
not &sal.
* mswin/gdbwin.h (togdb_searchpath togdb_get_info_path
toget_set_info_path): Fix prototypes to match reality.
* mswin/gui.cpp: Define _beginthreadex and _endthreadex routines
with proper prototypes.
* mswin/iface.cpp (gdbwin_fputs): Define with correct number of args.
* mswin/ser-win32s.c: Fix defs of min and max.
* mswin/serdll32.c (OpenComm16): Make cbInQueue and cbOutQueue be
USHORT.
* (WriteComm16): Change lpBug from LPVOID to LPCSTR.
* mswin/serdll32.h: Fix prototypes for OpenComm16 and WriteComm16.
* expression.h (enum exp_opcode): Added UNOP_LOWER, UNOP_UPPER,
UNUP_LENGTH.
* expprint.c (dump_expression): Handle the new exp_opcodes.
(print_subexp): Handle PREC_BUILTIN_FUNCTION.
(print_simple_m2_func): Removed.
(print_subexp): Remove support for Modula2 builtin functions.
* m2-lang.c (m2_op_print_tab): Add support for builtin functions.
* ch-exp.y: Parse LOWER, UPPER, and LENGTH builtins.
(write_lower_upper_value): Convenience function for LOWER and UPPER.
(upper_lower_argument, length_argument): Removed non-terminals.
* ch-lang.c (chill_op_print_tab): Entries for UPPER, LOWER, LENGTH.
(type_lower_upper): New function. Calculate LOWER/UPPER of type.
(value_chill_length): New function. Calcalate LENGTH of ARRAY/STRING.
(evaluate_subexp_chill): Handle UNOP_LOWER, UNOP_UPPER, UNOP_LENGTH.
This fixes PR 5015 (and 5826 which is a duplicate).
* c-lang.c (c_language_defn, cplus_language_defn, asm_langauge_defn),
f-lang.c (f_language_defn), language.c (unknown_language_defn,
auto_language_defn, local_language_defn), m2-lang.c (m2_language_defn):
Set evaluate_exp to evaluate_subexp_standard.
* ch-lang.c (evaluate_subexp_chill): New function. Chill-specific
support for MULTI_SUBSCRIPT.
(chill_language_defn): Set evaluate_exp to evaluate_subexp_chill.
* eval.c (enum noside): Move from here ....
* expression.h (enum noside): ... to here.
(evaluate_subexp_standard): New prototype.
* eval.c (evaluate_subexp): Renamed to evaluate_subexp_standard.
Removed lo-longer-needed test for chill_varying_type.
(evaluate_subexp): New. Calls exp->language_defn->evaluate_exp.
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.
* language.c (unknown_language_defn, auto_language_defn,
local_language_defn), c-lang.c (c_language_defn, cplus_language_defn,
asm_language_defn): Set c_style_arrays to true.
* m2-lang.c (m2_language_defn), ch-lang.c (chill_language_defn),
f-lang.c (f_language_defn): Set c_style_arrays to false.
* valops.c (value_string): If c_style_array is not set,
allocate string in gdb (not inferior) using allocate_value.
* value.h (COERCE_ARRAY), valops.c (value_addr, value_arg_coerce):
Only call value_coerce_array if current_language->c_style_arrays.
* values.c: Add #include "language.h". (Needed for COERCE_ARRAY.)
* valops.c (chill_varying_type): New predicate.
* valops.c (value_cast): Support assigning a fixed string or array
to a variable string/array structure.
* valarith.c (value_subscripted_rvalue): Extra parameter lowerbound.
Check index>=lowerbound, and then add lowerbound to index here,
instead of in caller. Generalize to arbitrary lval_types.
(value_subscript): Use enhanced value_subscripted_rvalue if
c_style_arrays is false (and index is in range).
an address to 'w'. Make it 'g' or 'h', depending on TARGET_PTR_BIT.
* defs.h: Just typedef CORE_ADDR to bfd_vma. Include bfd.h.
If BFD64, make a LONGEST a BFD_HOST_64_BIT.
* defs.h (longest_to_int): Don't depend on CC_HAS_LONG_LONG; instead
always just check against INT_MIN and INT_MAX (this also fixes things
if sizeof (long) > sizeof (int), e.g. Alpha).
* config/pa/tm-hppa.h, config/i386/sun386.h, config/rs6000/tm-rs6000.h:
Don't define LONGEST or BUILTIN_TYPE_LONGEST.
* gdbtypes.h: Remove BUILTIN_TYPE_LONGEST and
BUILTIN_TYPE_UNSIGNED_LONGEST.
* language.h, c-lang.c, ch-lang.c, m2-lang.c: Remove longest_int
and longest_unsigned_int.
* value.h (struct value): Just align to LONGEST, rather than worrying
about CC_HAS_LONG_LONG.
* valarith.c (value_binop, _initialize_valarith): Figure out type
ourself based on sizeof (LONGEST) rather than relying on
BUILTIN_TYPE_LONGEST. The point is that we don't depend on
CC_HAS_LONG_LONG anymore.
* valprint.c (val_print_type_code_int): Just call
extract_unsigned_integer directly, rather than going through
unpack_long.
* printcmd.c (decode_format): Remove code which would sometimes
change 'g' size to 'w' for integers. print_scalar_formatted handles
printing huge integers well enough, thank you.
Change comments regarding TYPE_CODE_BOOL.
* language.c (boolean_type): Always return 1 for TYPE_CODE_BOOL,
regardless of the language.
(value_true): Just call value_logical_not regardless of language.
* coffread.c (coff_read_enum_type), stabsread.c (read_enum_type):
Remove #if 0'd code which makes some enums TYPE_CODE_BOOL.
* language.h: Improve comment for la_builtin_type_vector.
* m2-lang.c (_initialize_m2_language): Don't add any fields to
builtin_type_m2_bool.