aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
AgeCommit message (Collapse)AuthorFilesLines
1997-02-20Since d10v is public now, remove all sanitization statementsMichael Meissner1-24/+39
1996-12-14 * c-exp.y (qualified_name): Replace explicit check for validPeter Schauer1-9/+21
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.
1996-11-27Added target function calls for SH, M32R and H8300.Michael Snyder1-31/+91
Added some generic target-independant code for managing call-dummy frames. Wed Nov 27 10:32:14 1996 Michael Snyder <msnyder@cleaver.cygnus.com> * breakpoint.c: DELETE command will not delete CALL_DUMMY breakpoint. * blockframe.c: Add target-independant support for managing CALL_DUMMY frames on the host side. * frame.h: Declarations for generic CALL_DUMMY frame support. * h8300-tdep.c: Add target function calls using generic frame support. * config/h8300/tm-h8300.h: config for generic target function calls. start-sanitize-m32r * m32r-tdep.c: Add target function calls using generic frame support. * config/m32r/tm-m32r.h: config for generic target function calls. end-sanitize-m32r * sh-tdep.c: Add target function calls using generic frame support. * config/sh/tm-sh.h: config for generic target function calls. start-sanitize-v850 * v850-tdep.c: Add target function calls using generic frame support. * config/v850/tm-v850.h: config for generic target function calls. end-sanitize-v850 * valops.c: ADD PUSH_RETURN_ADDRESS so that it doesn't have to be done by PUSH_ARGUMENTS when there's no CALL_DUMMY.
1996-07-28 * configure.in: Add test for "long long" support.Fred Fish1-0/+6
* configure: Regenerate with autoconf. * acconfig.h: Add CC_HAS_LONG_LONG * config.in: Regenerate with autoheader. * config/mips/tm-mips64.h (FORCE_LONG_LONG): Remove * config/sparc/tm-sp64.h (CC_HAS_LONG_LONG): Remove. * config/mips/tm-vr4300el.h (CC_HAS_LONG_LONG): Remove. * config/mips/tm-vr4300.h (CC_HAS_LONG_LONG): Remove. * config/mips/xm-irix5.h (CC_HAS_LONG_LONG): Remove (PRINTF_HAS_LONG_LONG): Remove. (FORCE_LONG_LONG): Remove. * config/powerpc/xm-aix.h (UINT_MAX): Undef and use gdb's version. * config/convex/xm-convex.h (CC_HAS_LONG_LONG): Remove (PRINTF_HAS_LONG_LONG): Remove. * config/xm-nbsd.h (CC_HAS_LONG_LONG): Remove. (PRINTF_HAS_LONG_LONG): Remove. * config/pa/tm-hppa.h (GET_FIELD): Put parens around subtraction inside shift. Put parens around subtraction in operand of bitwise and. (struct frame_info): Forward declare if __STDC__ defined. (frame_saved_regs): Ditto. (struct value): Ditto. (struct type): Ditto. (struct inferior_status): Ditto. (init_extra_frame_info): Add prototype. (skip_prologue): Ditto. (frameless_function_invocation): Ditto. (frame_chain): Ditto. (frame_chain_valid): Ditto. (saved_pc_after_call): Ditto. (hppa_fix_call_dummy): Ditto. (hppa_push_arguments): Ditto. (pa_do_registers_info): Ditto. (in_solib_call_trampoline): Ditto. (in_solib_return_trampoline): Ditto. (push_dummy_frame): Ditto. * convex-tdep.c (decout): Use print_longest rather than fprintf_filtered. * defs.h: Remove use of FORCE_LONG_LONG and __GNUC__ to set CC_HAS_LONG_LONG. (INT_MIN): Fix so it works correctly when assigned to a long long. * valprint.c (longest_to_int): Rewrite to remove dependence on INT_MIN and INT_MAX. (print_longest): Rewrite the code that falls back to synthesized hex output when LONGEST value is not representable as in a long and printf doesn't support printing long longs. * ch-valprint.c (chill_val_print): Cast 2nd arg of chill_print_type_scalar to LONGEST. chill_print_type_scalar): Make static and add prototype. * hppa-tdep.c (get_field): Ifdef out unused function. (set_field): Ditto. (extract_3): Ditto. (extract_5_store): Ditto. (extract_11): Ditto. (extract_12): Ditto. (deposit_17): Ditto. (extract_14): Convert to static and add prototype. (deposit_14): Ditto. (extract_21): Ditto. (deposit_21): Ditto. (extract_17): Ditto. (extract_5r_store): Ditto. (extract_5R_store): Ditto. (extract_5_load): Ditto. (find_proc_framesize): Ditto. (find_dummy_frame_regs): Ditto. (sign_extend): Ditto. (find_unwind_entry): Add prototype. (find_return_regnum): Ditto. (unwind_command): Ditto. (find_dummy_frame_regs): Add parens around subtraction in operand of bitwise-and. (skip_prologue): Add parens around operands of logical-and inside operand of logical-or. (sign_extend): Add parens around operands of subtraction inside operand of shift. (low_sign_extend): Ditto. * top.c (filename_completer): Convert old style decl of filename_completion_function into prototype. * f-lang.c (patch_common_entries): Ifdef out unused function. * stabsread.c (read_cfront_baseclasses): Remove unused local variable "msg_noterm". (resolve_cfront_continuation): Remove unused local variable "fip". (read_type): Remove unused variable xtypenums. (read_cfront_static_fields): Remove unused variable "i". (read_cfront_static_fields): Remove unused variable "nfields". (read_cfront_member_functions): Add missing comment terminator. (read_cfront_static_fields): Return 1 rather than random value. (read_cfront_baseclasses): Ditto. (read_cfront_baseclasses): Ditto. (read_cfront_baseclasses): Ditto. * somsolib.c (som_solib_create_inferior_hook): Remove unused variable "u". (som_solib_create_inferior_hook): Remove unused variable shadow_contents. (language.h): Add for needed prototypes. (som_solib_sharedlibrary_command): Add prototype. * hpread.c: (hpread_read_array_type): Add prototype. * somread.c (hpread_build_pysmtabs): Add prototype. (hpread_symfile_finish): Ditto. (hpread_symfile_init): Ditto. * hppah-nat.c (fetch_register): Convert old style decl to prototype. (gdbcore.h): Include for needed prototypes. (fetch_register): Remove unused variable "mess". * remote-pa.c (get_offsets): Ifdef out unused function. (remote_start_remote): Remove unused variable "timeout". (boot_board): Add prototype. (reaad_frame): Add prototype. (getpkt): Remove unused variable "bp". (remote_kill): Add prototype. (remote_mourn): Add prototype. (remote_insert_breakpoint): Add prototype. (remote_remove_breakpoint): Add prototype. * valops.c (value_push): Only use if PUSH_ARGUMENTS is not defined. * infcmd.c (do_registers_info): Only need prototype if DO_REGISTERS_INFO is not defined. (breakpoint_auto_delete_contents): Only need if CALL_DUMMY_BREAKPOINT_OFFSET is defined.
1996-07-26See gdb ChangeLog entry with header:Fred Fish1-2/+5
Thu Jul 25 19:41:31 1996 Fred Fish <fnf@cygnus.com> for a rather huge set of changes. I was going to put them here, but it made cvs dump core. :-(
1996-03-30 * core-aout.c (fetch_core_registers): Cast core_reg_size to intFred Fish1-6/+8
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.
1996-03-28 * valops.c (value_assign): Make copy of internal variable valueFred Fish1-4/+11
before returning it as a new value, since it is owned by the internal variable and will be freed along with it.
1996-02-17 * Add native support for long double data type.Stu Grossman1-10/+35
* c-exp.y (%union): Change dval to typed_val_float. Use DOUBLEST to store actual data. Change types of INT and FLOAT tokens to typed_val_int and typed_val_float respectively. Create new token DOUBLE_KEYWORD to specify the string `double'. Make production for FLOAT use type determined by parse_number. Add production for "long double" data type. * (parse_number): Use sscanf to parse numbers as float, double or long double depending upon the type of typed_val_float.dval. Also allow user to specify `f' or `l' suffix to explicitly specify float or long double constants. Change typed_val to typed_val_int. * (yylex): Change typed_val to typed_val_int. Also, scan for "double" keyword. * coffread.c (decode_base_type): Add support for T_LNGDBL basic type. * configure, configure.in: Add check for long double support in the host compiler. * defs.h: Define DOUBLEST appropriatly depending on whether HAVE_LONG_DOUBLE (from autoconf) is defined. Also, fix prototypes for functions that handle this type. * expression.h (union exp_element): doubleconst is now type DOUBLEST. * m2-exp.y f-exp.y (%union): dval becomes type DOUBLEST. * findvar.c (extract_floating): Make return value be DOUBLEST. Also, add support for numbers with size of long double. * (store_floating): Arg `val' is now type DOUBLEST. Handle all floating types. * parser-defs.h parse.c (write_exp_elt_dblcst): Arg expelt is now DOUBLEST. * valarith.c (value_binop): Change temp variables v1, v2 and v to type DOUBLEST. Coerce type of result to long double if either op was of that type. * valops.c (value_arg_coerce): If argument type is bigger than double, coerce to long double. * (call_function_by_hand): If REG_STRUCT_HAS_ADDR is defined, and arg type is float and > 8 bytes, then use pointer-to-object calling conventions. * valprint.c (print_floating): Arg doub is now type DOUBLEST. Use appropriate format and precision to print out floating point values. * value.h: Fixup prototypes for value_as_double, value_from_double, and unpack_double to use DOUBLEST. * values.c (record_latest_value): Remove check for invalid floats. Allow history to store them so that people may examine them in hex if they want. * (value_as_double unpack_double): Change return value to DOUBLEST. * (value_from_double): Arg `num' is now DOUBLEST. * (using_struct_return): Use RETURN_VALUE_ON_STACK macro (target specific) to expect certain types to always be returned on the stack.
1996-01-12 * stabsread.c (read_struct_type): Trivial simplification.Per Bothner1-5/+7
* valops.c (call_function_by_hand): Use invisible references for TYPE_CODE_SET and TYPE_CODE_BITSTRING too.
1995-12-01 * valops.c (value_slice): Implement (value) bitstring slices.Per Bothner1-20/+45
* valprint.c (val_print): If TYPE_LENGTH is zero, don't automatically print "<incomplete type>" - Chill has zero-length (string) types.
1995-11-30 * ch-exp.y: Replaced by ...Per Bothner1-142/+190
* 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.
1995-10-21 * alpha-tdep.c, mips-tdep.c (init_extra_frame_info):Peter Schauer1-28/+36
Do not set saved registers from heuristics for a sigtramp frame. * dwarfread.c (enum_type): Determine signedness of enum type from enumerators. * mips-tdep.c: Include gdb_string.h, gcc -Wall lint. * rs6000-nat.c (xcoff_relocate_core): Fix typo. * valops.c (value_repeat): Fix length of memory transfer to match recent allocate_repeat_value change.
1995-09-27 * valops.c (search_struct_field): Also allow "else" as a variant name,Per Bothner1-1/+4
1995-09-27 * eval.c (evaluate_struct_tuple): New function. Used to evaluatePer Bothner1-9/+33
structure tuples. Now also handles Chill variant records. (get_label): New function, used by evaluate_struct_tuple. (evaluate_subexp_standard case OP_ARRAY): Use evaluate_struct_tuple. (evaluate_labeled_field_init): Removed. * valops.c (search_struct_field): Generalize to work with Chill variant records.
1995-09-19 * gdbtypes.c (create_set_type): Set TYPE_LENGTH in bytes, not bits.Per Bothner1-4/+18
* valops.c (value_bitstring): TYPE_LENGTH is bytes, not bits. * gdbtypes.c (force_to_range_type): Calculate upper limit of TYPE_CODE_CHAR depending on TYPE_LENGTH (instead of just using 255).
1995-08-01* configure.in: Check for working mmap, ansi headers, string.h,J.T. Conklin1-15/+32
strings.h, and memory.h. * configure: Regenerated. * gdb_stat.h: New file, "portable" <sys/stat.h>. * gdb_string.h: New file, "portable" <string.h>. * altos-xdep.c, arm-tdep.c, arm-xdep.c, convex-tdep.c, convex-xdep.c, coredep.c, cxux-nat.c, dbxread.c, exec.c, gould-xdep.c, hppa-tdep.c, i386aix-nat.c, i386b-nat.c, i386mach-nat.c, i386v-nat.c, infptrace.c, m88k-nat.c, main.c, mdebugread.c, objfiles.c, os9kread.c, procfs.c, pyr-xdep.c, rs6000-nat.c, source.c, standalone.c, stuff.c, sun386-nat.c, symfile.c, symm-nat.c, symm-tdep.c, symtab.c, top.c, ultra3-nat.c, ultra3-xdep.c, umax-xdep.c, xcoffread.c: Include "gdb_stat.h" instead of <sys/stat.h>. * alpha-tdep.c, breakpoint.c, buildsym.c, c-typeprint.c, ch-typeprint.c, coffread.c, command.c, core-sol2.c, core-svr4.c, core.c, corelow.c, cp-valprint.c, dbxread.c, dcache.c, demangle.c, dpx2-nat.c, dstread.c, dwarfread.c, elfread.c, environ.c, eval.c, exec.c, f-lang.c, f-typeprint.c, f-valprint.c, findvar.c, fork-child.c, gdbtypes.c, hpread.c, i386-tdep.c, infcmd.c, inflow.c, infptrace.c, infrun.c, irix5-nat.c, language.c, m2-typeprint.c, main.c, mdebugread.c, minsyms.c, mipsread.c, monitor.c, nlmread.c, objfiles.c, os9kread.c, osfsolib.c, parse.c, printcmd.c, procfs.c, regex.c, remote-adapt.c, remote-arc.c, remote-array.c, remote-bug.c, remote-e7000.c, remote-eb.c, remote-es.c, remote-hms.c, remote-mm.c, remote-os9k.c, remote-pa.c, remote-sim.c, remote-st.c, remote-udi.c, remote-utils.c, remote-vx.c, remote-vx29k.c, remote-vx68.c, remote-vx960.c, remote-vxmips.c, remote-vxsparc.c, remote.c, solib.c, somread.c, source.c, stabsread.c, stack.c, symfile.c, symmisc.c, symtab.c, target.c, top.c, typeprint.c, utils.c, valarith.c, valops.c, valprint.c, values.c, xcoffread.c: Include "gdb_string.h" instead of <string.h>. * gdbtk.c: Likewise. * config/xm-sysv4.h, i386/xm-ptx.h, m68k/xm-sun3os4.h, sparc/xm-sun4os4.h (HAVE_MMAP): Removed. * config/xm-lynx.h, config/i386/xm-ptx.h, config/m68k/nm-apollo68b.h, config/m68k/xm-hp300hpux.h, config/mips/xm-irix3.h, config/mips/xm-mips.h, config/mips/xm-news-mips.h, config/mips/xm-riscos.h, config/pa/hppah.h, config/rs6000/xm-rs6000.h, config/sparc/xm-sun4os4.h, config/sparc/xm-sun4sol2.h, config/vax/xm-vaxbsd.h, config/vax/xm-vaxult.h, config/vax/xm-vaxult2.h (MEM_FNS_DECLARED): Removed. * config/mips/xm-irix3.h, config/mips/xm-mips.h, config/pa/xm-hppah.h (memcpy, memset): Removed declarations.
1995-03-14 * valops.c (value_repeat), eval.c (evaluate_subexp_standard):Jim Kingdon1-0/+2
If VALUE_REPEATED is already set, just error out.
1995-03-14 * valops.c (value_cast, value_slice), parse.c (follow_types): AddJim Kingdon1-0/+5
FIXME-type-allocation comments.
1995-03-06 * valops.c (value_cast): Don't use backslash newline--pre-ANSIJim Kingdon1-2/+2
compilers (such as SunOS4 /bin/cc) don't generally support it except in some contexts.
1995-03-04 * valops.c (value_cast): Cehck for cast to array type *before*Per Bothner1-58/+76
we coerce array to pointer (in case arg2 is already array). * valops.c (call_function_by_hand): Set using_gcc to 2 if using gcc2. Needed for REG_STRUCT_HAS_ADDR to work on sparc. Also check REG_STRUCT_HAS_ADDR for union, array and string types. * valops.c (call_function_by_hand): Re-arrange code for pushing paramaters on the stack so we can do better STACK_ALIGN. * valops.c (call_function_by_hand): Call error if the number of arguments is fewer than parameter types in function type.
1995-03-03 * valops.c (value_struct_elt_for_reference): Work around macroJeff Law1-4/+25
bugs in HP's compilers. * c-exp.y (block): Likewise.
1995-02-12 * valops.c (value_arg_coerce): Now takes param_type argument.Per Bothner1-704/+84
(call_function_by_hand): Convert arguments with value_arg_coerce early, and overwrite original args with converted args. No longer need multiple calls to value_arg_coerce. (value_arg_push): Removed. * hppa-tdep.c (hppa_push_arguments): No longer call value_arg_coerce. * mips-tdep.c (mips_push_arguments): Likewise. * alpha-tdep.c (alpha_push_arguments): Likewise. * rs6000-tdep.c (push_arguments, ran_out_of_registers_for_arguments): Likewise. * value.h (value_arg_coerce): Remove declaration. (It's now static.) * valops.c (value_cast): Do COERCE_VARYING_ARRAY after COERCE_REF.
1995-02-01 * ch-exp.y (value_string_element, string_primitive_value,Per Bothner1-14/+123
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-01-23 Add support for Chill bitstring literals (e.h. H'FF00').Per Bothner1-8/+43
* 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.
1994-10-29 * top.c (line_completion_function): Renamed fromPeter Schauer1-27/+493
symbol_completion_function, takes the line buffer and the point in the line buffer as additional arguments. (readline_line_completion_function): New function, interface between readline and line_completion_function. (init_main): Use it. (complete_command): Use line_completion_function instead of abusing rl_line_buffer. Free completion strings after printing them. * symtab.c (completion_list_add_name): Recheck for duplicates if we intend to add a modified symbol. * gdbtypes.h (cplus_struct_type): nfn_fields_total no longer includes the number of methods from the baseclasses. * stabsread.c (attach_fn_fields_to_type): No longer add the number of methods from the baseclasses to TYPE_NFN_FIELDS_TOTAL, the baseclass type might not have been completely filled in yet. * symtab.c (total_number_of_methods): New function to compute the total number of methods for a type, including the methods from baseclasses. (decode_line_1): Use it instead of TYPE_NFN_FIELDS_TOTAL to allocate the symbol array for find_methods. * stabsread.c (scan_file_globals): Add default case to minimal symbol type switch, to avoid gcc -Wall warnings. * config/rs6000/tm-rs6000.h (INIT_EXTRA_FRAME_INFO): Don't test for zero backchain pointer to recognize a signal handler frame, if read() gets interrupted by a signal, the backchain will be non zero. (SIG_FRAME_FP_OFFSET): Move to here from rs6000-tdep.c, improve comment. (SIG_FRAME_PC_OFFSET): New definition. (FRAME_SAVED_PC): Return saved pc from sigcontext if this is a signal handler frame. * rs6000-tdep.c (function_frame_info): Do not error out if we can't access the instructions. * config/rs6000/tm-rs6000.h (CONVERT_FROM_FUNC_PTR_ADDR): New definition to get the function address from a function pointer. * valops.c (find_function_addr): Use it when calling a user function through a function pointer.
1994-08-19 Initial Fortran language support, adapted from work by Farooq ButtStan Shebs1-112/+355
(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-03-01 * value.h (struct value): Add modifiable field.Jim Kingdon1-1/+5
* values.c (allocate_value, record_latest_value, value_copy): Set it. (record_latest_value): Don't mess with VALUE_LVAL of value. * valops.c (value_assign): Check it. Reword existing error message on not_lval.
1994-01-25 * valops.c (value_assign): Set `type' after coercing toval.Peter Schauer1-13/+19
* c-valprint.c (c_val_print), ch-valprint.c (chill_val_print): Use extract_unsigned_integer to get the address of a reference.
1993-12-25Sat Dec 25 09:50:29 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)Jim Kingdon1-1/+1
* valops.c (value_struct_elt): Check for (value)-1 return from search_struct_method.
1993-12-21 * valops.c (value_coerce_array): Handle STRINGs as well as ARRAYs.Per Bothner1-2/+15
1993-11-18Modified Files:Kung Hsu1-0/+10
ChangeLog valops.c * valops.c(search_struct_method): to use unified search so type conversion operator works in calling method. (this file should be checked in with last commit, I missed it).
1993-11-17Modified Files:Kung Hsu1-12/+20
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).
1993-11-02 * findvar.c (value_of_register, value_from_register),Peter Schauer1-14/+24
hppa-tdep.c (pa_print_fp_reg), infcmd.c (do_registers_info), valops.c (value_assign): Use REGISTER_CONVERT_TO_* only if REGISTER_CONVERTIBLE is defined, otherwise just copy the content. Pass desired type to REGISTER_CONVERT_TO_*. * config/m68k/tm-m68k.h, config/i960/tm-i960.h (REGISTER_CONVERT_*): Pass length of desired type to store/extract_floating. * config/i386/tm-arm.h, config/i386/tm-i386aix.h, config/i386/tm-sun386.h, config/i386/tm-symmetry.h, config/m88k/tm-m88k.h config/rs6000/tm-rs6000.h (REGISTER_CONVERT_*): Use extract_floating and store_floating with length of desired type. * config/m68k/tm-news.h (STORE,EXTRACT_RETURN_VALUE): Add type parameter to REGISTER_CONVERT_*. * config/a29k/tm-a29k.h, config/convex/tm-convex.h, config/gould/tm-np1.h, config/gould/tm-pn.h, config/h8300/tm-h8300.h, config/h8500/tm-h8500.h, config/i386/tm-i386v.h, config/mips/tm-mips.h, config/ns32k/tm-merlin.h, config/ns32k/tm-umax.h, config/pa/tm-hppa.h, config/pyr/tm-pyr.h, config/sh/tm-sh.h, config/sparc/tm-sparc.h, config/tahoe/tm-tahoe.h, config/vax/tm-vax.h, config/z8k/tm-z8k.h (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_RAW, REGISTER_CONVERT_TO_VIRTUAL): Remove versions for which REGISTER_CONVERTIBLE is always false. * z8k-tdep.c (register_convert_to_virtual, register_convert_to_raw): Remove, no longer used. * alpha-tdep.c (alpha_register_convert_to_raw, alpha_register_convert_to_virtual): New routines to handle the different raw formats in alpha floating point registers. * config/alpha/tm-alpha.h (REGISTER_CONVERTIBLE, REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Use them.
1993-10-28 * valops.c (value_assign): Change bitfield code to use a buffer ofJim Kingdon1-13/+29
the correct size, rather than an int.
1993-10-26 * valops.c (value_assign): Call reinit_frame_cache when assigningJim Kingdon1-0/+9
to a register.
1993-10-08 * findvar.c, value.h (symbol_read_needs_frame): New function.Jim Kingdon1-1/+1
* c-exp.y, m2-exp.y: Call it instead of having our own switch on the symbol's class. * valops.c (value_of_variable): Use symbol_read_needs_frame to decide whether we care about finding a frame.
1993-10-05 Changes to support alpha OSF/1 in native mode.Peter Schauer1-8/+13
* alpha-nat.c, alpha-tdep.c, config/alpha/alpha-osf1.mt, config/alpha/nm-alpha.h, config/alpha/tm-alpha.h, osfsolib.c: New files. * Makefile.in: Add new files and dependencies. * configure.in: Add alpha target. * config/alpha/alpha-osf1.mh (NATDEPFILES): Add osfsolib.o * config/alpha/alpha-osf1.mh (MH_CFLAGS): Remove, we can handle shared libraries now. * config/alpha/xm-alpha.h: Cleanup, get MAKEVA_* defines right. * defs.h (CORE_ADDR): Make its type overridable via CORE_ADDR_TYPE, provide `unsigned int' default. * breakpoint.c (breakpoint_auto_delete): Delete only if we really stopped for the breakpoint. * stabsread.c, stabsread.h (define_symbol): Change valu parameter to a CORE_ADDR. * stabsread.c (read_range_type): Handle the case where the lower bound overflows and the upper doesn't and the range is legal. * infrun.c (resume): Do not step a breakpoint instruction if CANNOT_STEP_BREAKPOINT is defined. * inferior.h (CALL_DUMMY_LOCATION): New variant AT_ENTRY_POINT. Now that we have the bp_call_dummy breakpoint the call dummy code is no longer needed. PUSH_DUMMY_FRAME, PUSH_ARGUMENTS and FIX_CALL_DUMMY can be used to set up everything for the dummy. The breakpoint for the dummy is set at the entry point and thats it. * blockframe.c (inside_entry_file, inside_entry_func): Do not stop backtraces if pc is in the call dummy at the entry point. * infcmd.c (run_stack_dummy): Handle AT_ENTRY_POINT case. Use the expected breakpoint pc when setting up the frame for set_momentary_breakpoint. * symfile.c (entry_point_address): New function for AT_ENTRY_POINT support. * valops.c (call_function_by_hand): Handle AT_ENTRY_POINT case.
1993-09-23CVS:Kung Hsu1-12/+16
1993-09-17 * findvar.c (extract_signed_integer): Cast *p to LONGEST before doingPeter Schauer1-5/+5
the xor and subtract. Otherwise it will not sign extend if the type of LONGEST is larger than int. * cp-valprint.c (cp_print_class_method): Inhibit core dump if domain is an undefined cross reference. * valops.c (call_function_by_hand): Set real_pc to correct
1993-08-27 * infcmd.c, inferior.h (run_stack_dummy): If we stop somewhereJim Kingdon1-2/+36
besides the dummy, return 1 rather than calling error(). Let caller print the error message. Remove name argument. * valops.c (call_function_by_hand): Deal with changes to calling sequence of run_stack_dummy. Discard restore_inferior_status cleanup if run_stack_dummy returns 1.
1993-08-18 * blockframe.c (block_innermost_frame): Uncomment.Jim Kingdon1-14/+57
Return NULL if passed NULL. * frame.h: Declare it. * expression.h (union exp_element): Add field block. * parse.c (write_exp_elt_block): New function. * expression.h (OP_VAR_VALUE): Now takes additional struct block *. * *-exp.y: Write block for OP_VAR_VALUE. * eval.c, expprint.c, parse.c: Deal with block for OP_VAR_VALUE. * valops.c, value.h (value_of_variable), callers: Add second argument, for block.
1993-07-10 * findvar.c, defs.hJim Kingdon1-5/+6
({extract,store}_{signed_integer,unsigned_integer,address}): New routines to replace SWAP_TARGET_AND_HOST. All over: All uses of SWAP_TARGET_AND_HOST on integers replaced.
1993-07-09minor comment fixJim Kingdon1-1/+1
1993-07-08 * infcmd.c (run_stack_dummy): New argument name.Jim Kingdon1-7/+62
Change error message in (another) attempt to make it comprehensible. * valops.c (call_function_by_hand): Pass name to run_stack_dummy. * symtab.h: Declare demangle and asm_demangle since macros use them.
1993-04-23 * Fix two bugs found by deja-gnu. One is the incorrect reportingStu Grossman1-2/+12
of the PC being in a stack dummy when looking at a core file without symbols. The other is the incorrect passing of char arguments during expression evaluation (ie: p foo('a','b') would mess up the passing of it's args because it wasn't coercing the char's to ints). * hppah-tdep.c: Rename global functions to have consistent hppa_ prefix. Make more functions static. Drop hp_ prefix from static functions. (hppa_push_arguments): Call value_arg_coerce to cast char to int args if necessary. (hppa_fix_call_dummy): Create this routine from FIX_CALL_DUMMY macro in tm-hppa.h. * inferior.h (PC_IN_CALL_DUMMY): Check for frame_address being valid (ie: != 0) before doing comparison against PC. * valops.c (call_function_by_hand): Adjust call to FIX_CALL_DUMMY to reflect new arguments. * config/pa/tm-hppa.h (POP_FRAME, PUSH_ARGUMENTS): Use new hppa_ prefix for func name. (FIX_CALL_DUMMY): Move code into hppah-tdep.c. * testsuite/gdb.t16/gdbme.c, testsuite/gdb.t17/gdbme.c: Add calls to malloc() so that we can test GDB eval of dynamically created arrays (like char strings in `print "foo"').
1993-02-01 * valops.c (typecmp): Now static.Michael Tiemann1-78/+204
1992-12-23 * defs.h (STRCMP, STREQ, STREQN): New macros.Fred Fish1-17/+17
* 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-22 * hppa-pinsn.c (print_insn): Improve handling of be and bleStu Grossman1-3/+10
branch targets to compute target address using const from previous instruction if necessary. * Add `Q' operator to print out bit position field various instructions. * hppah-nat.c: #include sys/param.h, and sys/user.h. General cleanups, use new code from Utah. * (store_inferior_registers): Update to new code from Utah. * (initialize_kernel_u_addr): Re-enable decl of struct user u. * (fetch_register): Clear out priv level when reading PCs. * hppah-tdep.c: Get rid of gobs of KERNELDEBUG stuff. * Remove decl of errno, #include wait.h and target.h. * (frame_saved_pc): Check `flags' pseudo-register to see if we were inside of a kernel call. If so, then PC is in a different register. Also, mask out bottom two bits of all PCs so as not to confuse higher level code. * (push_dummy_frame): Create from #define in tm-hppa.h. * (find_dummy_frame_regs): Update from Utah. * (hp_pop_frame): Create from #define in tm-hppa.h. * (hp_restore_pc_queue): New, from Utah. * (hp_push_arguments): Big fixes from Utah. * (pa_do_registers_info, pa_print_registers): Only print out fp regs upon request. * (skip_trampoline_code): New routine to deal with stubs that live in nowhereland between callers and callees. * i860-tdep.c: Remove decl of attach_flag. * infrun.c (wait_for_inferior): Add new macro INSTRUCTION_NULLIFIED, which can tell if the instruction pointed at by PC will be nullified. If so, then step the target once more so as to avoid confusing the user. * (just before step_over_function:): Use stop_func_start, not stop_pc when checking for the existance of line number info. stop_func_start will reflect the proper address of the target routine, not of the stub that we may be traversing to get there. * tm-hppa.h: define SKIP_TRAMPOLINE_CODE and IN_SOLIB_TRAMPOLINE to deal with the stubs that PA compilers sometimes stick between callers and callees. Also, define FLAGS_REGNUM for access to the `flags' pseudo-reg. * (REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW): Use memcpy, not bcopy. * (CANNOT_STORE_REGISTER): New from Utah. Says that we can't write gr0, PC regs, and PSW! * (FRAME_FIND_SAVED_REGS): Bug fixes from Utah. * (PUSH_DUMMY_FRAME, POP_FRAME): Make into real routines in hppah-nat.c. * (CALL_DUMMY, FIX_CALL_DUMMY): Fixes from Utah. * Define struct unwind_table_entry. * valops.c (call_function_by_hand): Add another arg to FIX_CALL_DUMMY (under #ifdef GDB_TARGET_IS_HPPA). Why is this necessary?
1992-11-24 * c-exp.y (yylex): Add tempbuf, tempbufindex, and tempbufsize,Fred Fish1-48/+30
which together maintain a dynamically expandable static buffer for the lexer to use when translating C strings to their internal form (other future uses possible). Fix parsing of C style strings to do the normal C style input conversions of escaped character sequences. * valops.c (value_string): Remove translation of escaped character sequences, now done in C expression parser.
1992-09-10Removed a large number of changes inserted by Per BothnerJohn Gilmore1-22/+18
for C++ support. These will go back in when they've been examined.