subrange.
* f-lang.h (enum f90_range_type): New enumeration type to identify
F90 subrange type.
* f-exp.y (yyparse): Add support for parsing F90 subrange and
change substring parsing to subrange parsing.
* parse.c (operator_length_standard): Set the operator length
and args number for OP_F90_RANGE.
* eval.c (evaluate_subexp_standard): Add code to evaluate F90
array section and substring.
(value_f90_subarray): New function to evaluate F90 array section.
(evaluate_subexp_standard): Delete label op_f77_substr and its code
because the logic is implemented by function value_f90_subarray now.
(yylex): Add code to scan exponentiation operator.
* eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
* valarith.c (value_binop): Reset errno to 0 before calling pow
to do exponentiation operation.
* command.h (add_setshow_integer_cmd): Make VAR an integer.
* cli/cli-decode.c (add_setshow_integer_cmd): Update to match.
* valops.c (value_string): Add a cast.
* eval.c (evaluate_subexp_standard): Use gdb_byte for byte buffers.
* breakpoint.c (re_enable_breakpoints_in_shlibs): Use gdb_byte for
byte buffers.
* target.h (struct target_ops): For to_insert_hw_breakpoint and
to_remove_hw_breakpoint use gdb_byte for byte buffer parameters.
* breakpoint.h (struct bp_location): Make shadow_contents a
gdb_byte buffer.
* cli/cli-setshow.c (do_setshow_command): Fix cast.
* cli/cli-dump.c (restore_section_callback)
(restore_binary_file): Use gdb_byte for byte buffers.
* proc-service.c (ps_ptwrite, ps_ptread, ps_pdwrite): Fix casts.
(ps_xfer_memory): Use gdb_byte for byte buffers.
* tracepoint.c (mem2hex): Use gdb_byte for byte buffers, and char
for string buffers.
* ser-tcp.c (net_open): Make len a socklen_t.
Committed by Jim Blandy <jimb@redhat.com>.
* eval.c (evaluate_subexp_standard, case OP_OBJC_MSGCALL): Use
CORE_ADDR as type for selectors. Correct types for GNU run time
message lookup function to use double indirection.
* objc-lang.c (lookup_child_selector): Use CORE_ADDR as return type.
* objc-lang.h (lookup_child_selector): Adapt prototype.
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.
The old method would drag in the entire array, then look for the
single element. This method just gets the right element out instead.
Saves memory, and saves a crash for array with (*) as one of the
dimensions when it would previously have allocated (unsigned int) -1 bytes.
* frame.c (get_current_frame): Check target_has_registers before
checking target_has_stack.
* eval.c (evaluate_subexp_standard): Use get_selected_frame,
instead of deprecated_selected_frame.
* findvar.c (value_of_register): Pass "frame", not
deprecated_selected_frame, to value_of_builtin_reg.
* frame.c: Include "gdb_string.h" and "builtin-regs.h".
(frame_map_regnum_to_name): New function.
(frame_map_name_to_regnum): New function.
* frame.h (frame_map_name_to_regnum): Declare.
(frame_map_regnum_to_name): Declare.
* builtin-regs.c (builtin_reg_map_regnum_to_name): New function.
* builtin-regs.h (builtin_reg_map_regnum_to_name): Declare.
* parse.c: Do not include "builtin-regs.h".
(target_map_name_to_register): Delete function.
(write_dollar_variable): Use frame_map_name_to_regnum.
* parser-defs.h (target_map_name_to_register): Delete declaration.
* expprint.c: Include "frame.h".
(print_subexp): Use frame_map_regnum_to_name.
* eval.c (evaluate_subexp_standard): Use frame_map_regnum_to_name.
* infcmd.c (registers_info): Use frame_map_name_to_regnum.
2002-09-25 Andrew Cagney <cagney@redhat.com>
* gdb.base/pc-fp.exp, gdb.base/pc-fp.c: New test.
* valops.c (find_overload_match): Accept obj as a
reference parameter. Update it before returning.
* value.h (find_overload_match): Update prototype.
* eval.c (evaluate_subexp_standard): Pass object to
find_overload_match by reference.
2001-12-10 Fred Fish <fnf@redhat.com>
* values.c (value_fn_field): Add physname variable. Use a minimal
symbol if we don't find a full symbol. Remove setting of the new
value's type since that was already done by allocate_value().
Remove obsolete commented out error call since callees need to
handle a NULL return, which is possible result not an error.
* eval.c (evaluate_subexp_standard): Move check for inlined
functions to precede attempt to dereference a NULL argvec[0].
Abstract out operations specific to particular C++ ABI's, and
invoke them through a function table. This removes the C++ ABI
dependencies scattered throughout the code, and allows us to
cleanly add support for new C++ ABI's.
* cp-abi.h, cp-abi.h, gnu-v2-abi.c, hpacc-abi.c: New files.
* c-typeprint.c, c-valprint.c, dbxread.c, eval.c, gdbtypes.c,
jv-typeprint.c, linespec.c, symtab.c, typeprint.c, valops.c:
#include "cp-abi.h". These files all use functions now declared
there.
* symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P):
Deleted. These services are now provided by functions declared in
cp-abi.h.
* value.h (value_rtti_type, value_virtual_fn_field): Same.
* values.c (value_virtual_fn_field): Same, for this definition.
* valops.c (value_rtti_type): Same.
* c-typeprint.c (c_type_print_base): Use the functions from
"cp-abi.h", instead of the old macros, or hard-coded ABI-specific
tests.
* dbxread.c (record_minimal_symbol): Same.
* gdbtypes.c (get_destructor_fn_field, virtual_base_index,
virtual_base_index_skip_primaries): Same.
* jv-typeprint.c (java_type_print_base): Same.
* linespec.c (find_methods, decode_line_1): Same.
* symtab.c (gdb_mangle_name): Same.
* Makefile.in (SFILES): Add the new .c files mentioned above.
(cp_abi_h): New variable.
(COMMON_OBS): Add gnu-v2-abi.o, hpacc-abi.o, and cp-abi.o.
(cp-abi.o, gnu-v2-abi.o, hpacc-abi.o): New targets.
(c-typeprint.o, c-valprint.o, dbxread.o, eval.o, gdbtypes.o,
jv-typeprint.o, symtab.o, linespec.o, typeprint.o, valops.o): Add
dependency on $(cp_abi_h).
functions which architectures can redefine, defaulting to
generic_pointer_to_address and generic_address_to_pointer.
* findvar.c (extract_typed_address, store_typed_address,
generic_pointer_to_address, generic_address_to_pointer): New
functions.
(POINTER_TO_ADDRESS, ADDRESS_TO_POINTER): Provide default
definitions.
(extract_address, store_address): Doc fixes.
* values.c (value_as_pointer): Doc fix.
(value_from_pointer): New function.
* defs.h (extract_typed_address, store_typed_address): New
declarations.
* inferior.h (generic_address_to_pointer,
generic_pointer_to_address): New declarations.
* value.h (value_from_pointer): New declaration.
* ax-gdb.c (const_var_ref): Use value_from_pointer, not
value_from_longest.
* blockframe.c (generic_push_dummy_frame): Use read_pc and
read_sp, not read_register.
* c-valprint.c (c_val_print): Use extract_typed_address instead of
extract_address to extract vtable entries and references.
* cp-valprint.c (cp_print_value_fields): Use value_from_pointer
instead of value_from_longest to extract the vtable's address.
* eval.c (evaluate_subexp_standard): Use value_from_pointer
instead of value_from_longest to compute `this', and for doing
pointer-to-member dereferencing.
* findvar.c (read_register): Use extract_unsigned_integer, not
extract_address.
(read_var_value): Use store_typed_address instead of store_address
for building label values.
(locate_var_value): Use value_from_pointer instead of
value_from_longest.
* hppa-tdep.c (find_stub_with_shl_get): Use value_from_pointer,
instead of value_from_longest, to build arguments to __d_shl_get.
* printcmd.c (set_next_address): Use value_from_pointer, not
value_from_longest.
(x_command): Use value_from_pointer, not value_from_longest.
* tracepoint.c (set_traceframe_context): Use value_from_pointer,
not value_from_longest.
* valarith.c (value_add, value_sub): Use value_from_pointer, not
value_from_longest.
* valops.c (find_function_in_inferior, value_coerce_array,
value_coerce_function, value_addr, hand_function_call): Same.
* value.h (COERCE_REF): Use unpack_pointer, not unpack_long.
* values.c (unpack_long): Use extract_typed_address to produce
addresses from pointers and references, not extract_address.
(value_from_longest): Use store_typed_address instead of
store_address to produce pointer and reference values.
* eval.c (evaluate_subexp_with_coercion): Add call to
check_typedef, to handle typedeffed vars correctly.
* gdb.base/printcmds.c: Add typedeffed arrays.
* gdb.base/printcmds.exp (test_print_typedef_arrays): New
procedure to test arrays that are typedef'd.
* gdbtk.c (gdb_get_breakpoint_info): Add string for new
enumeration del_at_next_stop to bpdisp array.
end-sanitize-gdbtk
* eval.c (evaluate_subexp_for_sizeof): Handle dereferencing
of non-pointer values.
* symtab.c (gdb_mangle_name): Improve mangling of nested types,
their physical names already include the class name.
* valops.c (value_cast): Handle upcast of a class pointer.
From Andreas Schwab (schwab@issan.informatik.uni-dortmund.de):
* corelow.c (get_core_registers): Make secname big enough.
if we have a type.
* eval.c (evaluate_subexp_standard): In case of OP_ARRAY:
check number of args against bounds of array to avoid
memory corruption.
* value.h (COERCE_REF): Do a CHECK_TYPEDEF in case we get
a TYPE_CODE_TYPEDEF.
Add some checks for powerset compatibility.
* valops.c (value_slice): Use lowbound instead of lowerbound for
call to slice_range_type to get correct bounds.
before testing against reg_ptr.
* eval.c (evaluate_subexp_standard): Cast type of
TYPE_FN_FIELD_VOFFSET to int.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer): Cast type of sizeof to int.
* values.c (unpack_field_as_long, modify_field): Ditto.
* valops.c (value_assign, call_function_by_hand): Ditto.
* infcmd.c (do_registers_info): Ditto.
* ser-tcp.c (tcp_open): Ditto
* remote.c (putpkt): Ditto.
* dcache.c (dcache_peek): Ditto.
* dcache.c (dcache_poke): Ditto.
* m2-exp.y (yylex): Ditto.
* gnu-regex.c (re_match_2): Ditto.
* f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef
out unused macro definition and variables.
* inftarg.c (proc_wait): Move from main.c to here, and make static.
* valprint.c (val_print_string): Change bufsize from int to unsigned.
* main.c (wait.h): Include
* top.c (command_line_input): Remove unused variable "c".
* f-typeprint.c (f_type_print_varspec_prefix): Add missing enum
value TYPE_CODE_TYPEDEF to switch statement.
(f_type_print_varspec_suffix): Add missing enum value
TYPE_CODE_TYPEDEF to switch statement.
* ch-exp.c (parse_primval): Add remaining enumeration values to
switch statement, with no specific action.
(ch_lex): Add LOC_UNRESOLVED in switch statement.
(pushback_token): Ifdef out, since code using it is ifdef'd out.
* stabsread.c (cleanup_undefined_types): Remove unused label
"badtype".
* objfiles.h (print_symbol_bcache_statistics): Add prototype.
* maint.c (objfiles.h): Include.
(maintenance_print_statistics): Remove unused variable "temp".
* minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove
unused variable "found_file_symbol".
* m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch.
* language.c (lang_bool_type): Use existing function local type
variable rather than create block local variables.
* solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS.
* infptrace.c (wait.h, command.h): Include.
* ser-tcp.c (gdb_string.h): Include
* i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR.
(i386_get_frame_setup): Change "pc" from int to CORE_ADDR.
* command.c (complete_on_enum): Make assignment used as truth value
explictly check against NULL.
(wait.h): Include.
* infrun.c (wait_for_inferior): Ifdef out prologue_pc since code
that uses it is ifdef'd out.
* parser-defs.h: Add prototype for write_dollar_variable.
* infrun.c: Add prototype for write_pc_pid.
* breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs.
* symmisc.c (bcache.h): Include.
* bcache.h: Add prototype for print_bcache_statistics.
* symfile.c: Include <time.h>.
* printcmd.c (print_scalar_formatted): Change len to unsigned int.
* valarith.c (value_equal): Cast result of TYPE_LENGTH to int.
* valarith.c (value_binop): Change result_len, promoted_len1,
and promoted_len2 to unsigned int.
* valarith.c (value_subscripted_rvalue): Change elt_offs and
elt_size to unsigned int.
* valops.c (value_array): Change typelength to unsigned int.
(destructor_name_p): Change len to unsigned int.
* scm-lang.h (scm_parse): Add prototype for scm_unpack.
* symfile.c (decrement_reading_symtab): Change return type to void.
* valarith.c (value_subscript): Remove unused variable "word".
(value_subscript): Remove unused variable "tint".
* valops.c (auto_abandon): Ifdef out, since code using it is also
ifdef'd out.
* eval.c (init_array_element): Remove unused variable "val".
* Makefile.in (values.o): Depends on scm-lang.h.
(command.o): Depends upon wait_h.
(ser-tcp.o): Depends upon gdb_string.h.
(infptrace.o): Depends upon wait_h and command_h.
(maint.o): Depends on objfiles.h and symfile.h.
* values.c (allocate_repeat_value): Remove unused variable
"element_type".
(scm-lang.h): Include.
* breakpoint.c (create_longjmp_breakpoint): Enclose in
GET_LONGJMP_TARGET define, unused otherwise.
* config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint,
i386_remove_watchpoint and i386_stopped_by_watchpoint.
for TYPE_CODE_SET and TYPE_CODE_BITSTRING too.
* eval.c (evaluate_subexp_standard): When known, use the formal
parameter type as the expected type when evaluating arg expressions.
* ch-lang.c (evaluate_subexp_chill): Likewise (for MULTI_SUBSCRIPT).
This (with a fix to gcc/config/sparc/sparc.h) fixes PR chill/8742.
* language.h (LA_BOOL_TYPE): New macro.
* eval.c (evaluate_subexp_standard) Use LA_BOOL_TYPE instead
of builtin_type_int where appropriate,
* valarith.c (value_subscript): Likewise.
Add check_typedef/CHECK_TYPEDEF as needed.
* f-typeprint.c: Various cleaning up.
* valarith.c (value_subscript): Also subscript bitstrings (for Chill).
* typeprint.c (print_type_scalar): Also support TYPE_CODE_RANGE.
* eval.c (evaluate_subexp_standard case OP_ARRAY): Implement
support for labelled array tuples and ranges in powerset tuples.
(init_array_element): New function.
around calls to create_longjmp_breakpoint. Why install the
breakpoints if we can't find the longjmp target?
* infrun.c (wait_for_inferior): Cleanup comments near call test.
* remote-mips.c: Fixed a bunch of prototypes to avoid char/int
complaint from picky compilers. Add comment to mips_expect.
Replace all instances of sr_get_debug with remote_debug.
* (mips_readchar): Don't jam init string to monitor.
mips_initialize() handles that.
* (mips_receive_header): Print better message when we get too
much garbage.
* (mips_request): Allow caller to pass in buff to allow them to
analyze the returned message.
* (mips_initialize): Re-do initialization to try sending a BREAK,
a ^C, and then a download escape sequence. Cleanup protocol
startup. Eliminate sleeps. Clear breakpoints (if using monitor
breakpoints). Re-init frame.
* (mips_detach): Close down target.
start-sanitize-gm
* (mips_resume): Pass signal down to target.
* (mips_create_inferior): Start target with TARGET_SIGNAL_PWR.
end-sanitize-gm
* (mips_wait): Handle return status with registers, or breakpoint stuff.
* (mips_kill): Add ^C handling.
* (mips_insert_breakpoint mips_remove_breakpoint): Call new
breakpoint stuff if enabled.
* (calculate_mask remote_mips_set_watchpoint
remote_mips_remove_watchpoint remote_mips_stopped_by_watchpoint):
Hardware watchpoint/breakpoint stuff.
* (common_breakpoint): Common code for new monitor breakpoint commands.
* (mips_load): Don't use `prompt'. It's a global variable.
* top.c (dont_repeat_command): New command for use in
user-defined commands to suppress auto-repeat (by hittin return key).
start-sanitize-gm
* utils.c (request_quit): Call target_kill here. Good idea.
Needs a better implementation.
end-sanitize-gm
* valops.c: Add start of auto function-call abandonment capability.
start-sanitize-gm
* c-exp.y: Add code (currently disabled) to handle GM dynamic
structures (it conflicts with @!).
* eval.c (evaluate_subexp_standard): ditto.
* expprint.c (print_subexp dump_expression): ditto.
* expression.h (enum exp_opcode): ditto.
* parse.c (length_of_subexp): ditto.
* configure, configure.in: Add mip*-*-magic* target.
* magic.c magic.h: Special routines to handle GM stuff (like
stepping through dispatcher).
end-sanitize-gm
* 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.
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.
* ch-exp.y (match_bitstring_literal): Fix for proper endianness.
* expprint.c (print_subexp): Don't call error on OP_BITSTRING,
just print B'<unimlemented>'.
* gdbtypes.c (create_set_type): Fix bug in length calculation.
* valops.c, value.h (value_bitstring): New function.
* eval.c (evaluate_subexp): Implement support for OP_BITSTRING.
* ch-typeprint.c (chill_type_print_base): For TYPE_CODE_FUNC,
check that return type is non-void, and print in proper Chill syntax.
labeled structre tuples.
* ch-exp.y (tuple_element, named_record_element, tuple_elements):
New non-terminals, to handle labeled structure tuples.
(tuple): Re-define using tuple_elements.
* eval.c (evaluate_labeled_field_init): New function, to handle
initialization of structure fields, possibly using OP_LABELED.
(evaluate_subexp): Use it.
* expprint.c (print_subexp case): For OP_ARRAY, use Chill syntax
for Chill. Handled OP_LABELED.
* parse.c (length_of_subexp, prefixify_subexp): Handle OP_LABELED.
* eval.c (evaluate_subexp): Handle Chill Powerset tuples.
* valarith.c (value_bit_index): Just treat bitstring as represented
by an array of bytes. Alignment is handled by compiler.
(tuple): Parse simple unlabelled tuples.
* eval.c (evaluate_subexp case OP_ARRAY): Use expect_type to
evaluate brace-initializer-expressions depending on context.
(evaluate_subexp case UNOP_CAST): Pass the target type as
expected type when evaluating the expression.
ChangeLog eval.c valops.c
* valops.c (typecmp): improve prototype matching when calling
a method. Make 'p (*(ostream *) &cout) << "lll" ' to work.
* eval.c(evalute_subexp): fix operator search problem when call
like p x.'operator+'(i).
* eval.c (evaluate_subexp): Handle new BINOP_MOD.
* expprint.c (dump_expression): Handle new BINOP_MOD.
* language.c (binop_type_check): Handle new BINOP_MOD.
* main.c (float_handler): Re-enable float handler when hit.
* valarith.c (language.h): Include, need current_language.
* valarith.c (TRUNCATION_TOWARDS_ZERO): Define default macro
for integer divide truncates towards zero for negative results.
* valarith.c (value_x_binop): Handle BINOP_MOD if seen.
* valarith.c (value_binop): Allow arithmetic operations on
TYPE_CODE_CHAR variables. Add case to handle new BINOP_MOD.
**** start-sanitize-chill ****
* ch-exp.y (operand_4): Add useful actions for MOD and REM.
* ch-exp.y (tokentab3): Add MOD and REM.
* ch-exp.y (yylex): Set innermost_block for symbols found
in local scopes. Return LOCATION_NAME for local symbols.
* ch-lang.c (chill_op_print_tab): Fix MOD entry to use
BINOP_MOD instead of BINOP_REM. Add REM entry, using BINOP_REM.
**** end-sanitize-chill ****
* eval.c (evaluate_subexp_with_coercion): Only coerce arrays
to pointer types when the current language is C. It loses for
other languages when the lower index bound is nonzero.
* valarith.c (value_subscript): Take array lower bounds into
account when performing subscripting operations.
* valops.c (value_coerce_array): Add comment describing why
arrays with nonzero lower bounds are dealt with in value_subscript,
rather than in value_coerce_array.
* expprint.c (print_subexp): Rename BINOP_MULTI_SUBSCRIPT to
MULTI_SUBSCRIPT.
* expprint.c (dump_expression): New function for dumping
expression vectors during gdb debugging.
* expression.h (BINOP_MULTI_SUBSCRIPT): Name changed to
MULTI_SUBSCRIPT and moved out of BINOP range.
* expression.h (DUMP_EXPRESSION): New macro that calls
dump_expression if DEBUG_EXPRESSIONS is defined.
* m2-exp.y (BINOP_MULTI_SUBSCRIPT): Changed to MULTI_SUBSCRIPT.
* parse.c (length_of_subexp, prefixify_subexp): Change
BINOP_MULTI_SUBSCRIPT to MULTI_SUBSCRIPT.
* parse.c (parse_exp_1): Call DUMP_EXPRESSION before and after
prefixify'ing the expression.
* printcmd.c (print_command_1): Add comment.
**** start-sanitize-chill ****
* ch-exp.y (expression_list): Add useful actions.
* ch-exp.y (value_array_element): Add useful actions.
* ch-exp.y (array_primitive_value): Add production.
* ch-exp.y (yylex): Recognize ',' as a token.
**** end-sanitize-chill ****
* 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 ****
symtab.h, tm-i386v4.h, valprint.c, values.c: Lint.
* breakpoint.c, c-exp.y, coffread.c, command.c, environ.c, eval.c,
findvar.c, infcmd.c, infptrace.c, infrun.c, m2-exp.y, parse.c,
putenv.c, solib.c, sparc-xdep.c, symtab.c, tm-i386v.h, tm-sparc.h,
utils.c, valarith.c, valops.c, valprint.c, values.c:
Replace bcopy() use with memcpy(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
* breakpoint.c, buildsym.c, coffread.c, dbxread.c, i386-tdep.c,
ieee-float.c, infcmd.c, sparc-tdep.c, stack.c, symtab.c, symtab.h,
target.c, values.c:
Replace bzero() use with memset(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
* i386-tdep.c, main.c, valprint.c:
Replace bcmp() use with memcmp(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
(_initialize_remote): `set remotedebug' enables packet trace.
* dbxread.c (process_one_symbol:N_FUN): GCC now produces relative
N_SLINE's, etc, just like Sun cc on Solaris2.
* am29k-tdep.c (read_register_stack, write_register_stack):
Change RSTACK_HIGH_ADDR to rstack_high_address, a user-settable
variable. Add `set' and `show' commands for it.
* doc/gdb.texinfo: Document it.
* eval.c: Avoid residue-by-zero when evaluating without side effects.
(Bug and fix found by Pierre Willard.)
* sparc-tdep.c: Clean up slightly for Solaris2.