aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-valprint.c
AgeCommit message (Collapse)AuthorFilesLines
1998-10-05 * c-lang.c (emit_char c_printchar c_printstr), c-lang.h (c_printstr)Stu Grossman1-2/+4
ch-lang.c (chill_printstr chill_printchar) c-valprint.c (c_val_print) ch-valprint.c (chill_val_print) expprint.c (print_subexp) f-lang.c (f_printstr f_printchar emit_char) f-valprint.c (f_val_print) jv-lang.c (java_printchar java_emit_char) jv-valprint.c (java_value_print java_val_print) language.c (unk_lang_printchar unk_lang_printstr unk_lang_emit_char) language.h (struct language_defn LA_PRINT_STRING LA_EMIT_CHAR) m2-lang.c (m2_printstr m2_printchar emit_char) printcmd.c (print_formatted) scm-lang.c (scm_printstr) valprint.c (val_print_string) value.h (val_print_string): Add emit_char routines to language_desc struct to allow finer control over language specific character output issues. Add character width arg to printstr routines to allow handling of wchar_t/Unicode strings. Fix c_printstr to handle wide characters. Supply width argument to LA_PRINT_STRING and val_print_string. * jv-lang.c (java_object_type dynamics_objfile java_link_class_type get_dynamics_objfile get_java_object_type) jv-lang.h (get_java_object_type): Make lots of things static. * expprint.c (dump_prefix_expression dump_subexp): Move opcode name printing to common routine (op_name). * (dump_subexp): Add support for OP_SCOPE.
1997-08-03 * c-valprint.c (c_val_print): Use extract_address to retrievePeter Schauer1-4/+5
the address of the virtual function. From Peter Bloecher (Peter.Bloecher@eedn.ericsson.se). * eval.c (evaluate_subexp_standard), valarith.c (value_x_unop): Handle C++ operator *.
1997-02-12 * c-valprint.c: Fix checkin glitch.Dawn Perchik1-1/+0
1997-02-12 * c-valprint.c (c_val_print): Fix printing for arrays definedDawn Perchik1-0/+1
with 0 length. A sticky tag caused this fix from revision 2.32 date: 1996/04/29 23:25:27; author: dawn; state: Exp; lines: +1 -0 branches: 2.32.34; to not make it into devo.
1997-01-04 * Makefile.in configure configure.in: Remove ENABLE_CLIBS,Stu Grossman1-2/+3
ENABLE_OBS, and THREAD_DB_OBS. These are consolidated into LIBS and CONFIG_OBS. * configure configure.in: Clean up test cases around thread support. start-sanitize-v850 * configure.tgt (v850-*-*): Include v850ice.o and v850.lib if host is Windows. end-sanitize-v850 * c-valprint.c ch-valprint.c cp-valprint.c eval.c expprint.c printcmd.c valops.c value.h values.c: Add bfd_section arg to value_at and value_at_lazy. * coffread.c dbxread.c elfread.c mdebugread.c minsyms.c symtab.h: Add bfd_section arg to prim_record_minimal_symbol_and_info. * corefile.c gdbcore.h printcmd.c valops.c: Use read_memory_section instead of read_memory. It takes a bfd_section arg. * coffread.c dbxread.c elfread.c gdb-stabs.h objfiles.h: Remove unnecessary cast for assignment of struct dbx_symfile_info. Struct objfile now uses a real pointer instead of PTR for this element. * dbxread.c (dbx_symfile_init): Stash bfd section pointers for text, data and bss into dbx_symfile_info. * exec.c (xfer_memory): Handle transfers for user-specified sections. * findvar.c (read_var_value locate_var_value): Copy bfd section from the symbol to the value. * gdb-stabs.h: Add section pointers for text, data and bss sections. * maint.c (translate address command): Add test code for overlay address translation. * printcmd.c (do_examine do_one_display): Now takes a bfd section arg. * (print_formatted x_command): Record current section along with current address for repeated commands. * sparc-nat.c (fetch_inferior_registers): Change target_xfer_memory to target_{read write}_memory to allow changes to target_xfer_memory interface for section info. * symmisc.c (dump_msymbols print_symbol): Print section assocaited with symbol. * symtab.c (fixup_symbol_section): New routine to add section info to symbols returned by lookup_symbol. * symtab.h (struct general_symbol_info): Add bfd section to symbols. * target.c target.h (target_xfer_memory): Add bfd section to args. * (target_read_memory_section): New routine to read data from a specific section. * (target_memory_bfd_section): New global variable to pass bfd section in to targets. * valarith.c (value_add value_addr value_array): Preserve bfd section when computing new value. * value.h (struct value): Add bfd section to values. * values.c (allocate_value value_copy): Initialize/preserve bfd section. * (unpack_double): Clean up _MSC_VER conditionals to remove duplicate code. start-sanitize-v850 * v850ice.c: New module to support communication with NEC's PC-based ICE. * config/v850/tm-v850.h (REGISTER_NAMES): Replace sp, gp, fp, and ep names with rxx names. sp and fp are renamed via a different mechanism. end-sanitize-v850
1996-11-09 * alpha-tdep.c (heuristic_proc_desc): Stop examining the prologuePeter Schauer1-3/+4
if we encounter a positive stack adjustment. (find_proc_desc): If heuristic_fence_post is non-zero, use heuristic_proc_start to determine the start of a function before calling heuristic_proc_desc. * coffread.c (coff_symtab_read): Change minimal symbol types for C_LABEL symbols from mst_* to mst_file_*. * config/m68k/sun3os4.mh (MMALLOC_CFLAGS): Define MMCHECK_FORCE to 1. * configure.in: Handle error message from sun3 native ld when configuring HLDFLAGS. * configure: Regenerated with autoconf. * c-valprint.c (c_value_print): Adjust value address by VALUE_OFFSET. * cp-valprint.c (cp_print_value): Prevent gdb crashes by making sure that the virtual base pointer from an user object still points to accessible memory. * dbxread.c (dbx_symfile_init): Initialize sym_stab_info to clear the recently added header_files fields. (dbx_symfile_finish): Free hfiles[i].vector to avoid storage leak.
1996-04-29 * c-valprint.c (c_val_print): Fix printing for arrays definedDawn Perchik1-0/+1
with 0 length.
1996-01-24 * stabsread.c (rs6000_builtin_type): Make bool type unsigned.Per Bothner1-2/+14
(read_one_struct_field): Support boolean bitfields. * c-valprint.c (c_val_print): Print booleans properly.
1995-11-30 * ch-exp.y: Replaced by ...Per Bothner1-44/+13
* 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-06 * values.c allocate_repeat_value): Allocate an array type, andPer Bothner1-45/+22
a value of that type; use that instead of setting VALUE_REPEATED. * value.h (struct value): Remove fields repetitions and repeated. (VALUE_REPEATED, VALUE_REPETITIONS): Removed, no longer used. * c-valprint.c, ch-valprint.c, eval.c, printcmd.c, valops.c, value.h, values.c: Simplify, since now VALUE_REPEATED is never used. * valprint.c (value_print_array_elemen): Removed never-used function.
1995-08-02Update FSF address.Fred Fish1-1/+1
1995-03-10 Fix problems with infinite recursion when printing a classPeter Schauer1-5/+3
that contains a static instance of the class. * cp-valprint.c (dont_print_vb_obstack): Renamed from dont_print_obstack, made static. (dont_print_statmem_obstack): New obstack, controls printing of static member classes. (_initialize_cp_valprint): Initialize it. (cp_print_static_field): New function, handles printing of static members. (cp_print_value_fields): New parameter dont_print_statmem to handle recursive printing of static member classes, use cp_print_static_field to handle printing of static members. * c-valprint.c (cp_print_value_fields): Update prototype and call to include additional dont_print_statmem parameter. * c-valprint.c, f-valprint.c (dont_print_obstack): Remove unused extern declaration. * alpha-tdep.c, findvar.c, infptrace.c: Include <string.h>. * config/alpha/tm-alpha.h (FRAME_FIND_SAVED_REGS): Call alpha_find_saved_regs if fi->saved_regs is still NULL. * elfread.c (elf_symtab_read): Ensure that the filename field of a minsym is nonempty. Ignore solib trampoline symbols from the main symbol table, they might have a bogus value. * procfs.c (set_proc_siginfo), config/alpha/alpha-osf2.mh: Fix typos in comments.
1994-11-01 * c-valprint.c (c_value_print): Check for plain literal `char'Peter Schauer1-3/+3
target type when suppressing `(char *)' output for strings.
1994-07-15 Stop printing at null char option, from Oliver MeyerStan Shebs1-2/+19
(omeyer@i3.informatik.rwth-aachen.de). * valprint.h, valprint.c (stop_print_at_null): New global. * valprint.c (_initialize_valprint): New print set subcommand "null-stop". * c-valprint.c (c_val_print): If stop_print_at_null is on, and printing a char array, adjust the number of chars to print.
1994-06-30 * Makefile.in (dcache_h): Remove redundant definition.Stan Shebs1-1/+0
(init.c): Add a comment. (top.c): Remove explicit compile action. * breakpoint.c (mention): Share code indicating location of break/watchpoints, don't print address if addressprint is off. * breakpoint.c, c-typeprint.c, c-valprint.c, energize.c, symtab.h (demangle): Remove redundant declarations. * eval.c: Remove redundant function declarations. * objfiles.h: Cosmetic and grammatical improvements. * TODO: Various updates.
1994-06-05 Fix value_print, which used to be ostensibly langauge-indepentdent,Per Bothner1-0/+61
but would print pointers and arrays in C syntax. Instead, call a language-specific function. See ChangeLog for details.
1994-05-05 Add partial support for g++ code compiled with -fvtable-thunks.Per Bothner1-0/+11
* c-valprint.c (c_val_print): Add vtblprint support when using thunks. * cp-valprint.c (cp_is_vtbl_member): A vtable can be an array of pointers (if using thunks) as well as array of structs (otherwise). * cp-valprint.c (vtbl_ptr_name_old, vtbl_ptr_name): Move to global level, and make the latter non-static (so define_symbol can use it). * stabsread.c (define_symbol): If the type being defined is a pointer type named "__vtbl_ptr_type", set the TYPE_NAME to that name. * symtab.h (VTBL_PREFIX_P): Allow "_VT" as well as "_vt". * values.c (value_virtual_fn_field): Handle thunks. * values.c (value_headof): Minor efficiency hack. * values.c (value_headof): Incomplete thunk support. FIXME.
1994-05-04 * valprint.c (print_longest): Clarify comment about use_local.Jim Kingdon1-2/+2
* printcmd.c, defs.h (print_address_numeric), callers in symmisc.c, symfile.c, stack.c, source.c, remote.c, infcmd.c, cp-valprint.c, core.c, ch-valprint.c, c-valprint.c, breakpoint.c, exec.c: New argument use_local. * source.c (identify_source_line): Use filtered output. Use print_address_numeric.
1994-03-13 * valprint.c (val_print_string): Ignore error if the errorJim Kingdon1-3/+4
happened after a terminating '\0'. * c-valprint.c (c_val_print): Never add 1 to return value from val_print_string; just return what it returns.
1994-03-03 * breakpoint.c, breakpoint.h, c-valprint.c, ch-valprint.c,Jim Kingdon1-2/+2
cp-valprint.c, eval.c, expprint.c, findvar.c, language.c, objfiles.h, infcmd.c, printcmd.c, stack.c, typeprint.c, valarith.c, valops.c, valprint.c, value.h, values.c: Replace value with value_ptr. This is for the ptx compiler. * objfiles.h, target.h: Don't declare a "sec_ptr" field using a "sec_ptr" typedef. * symm-nat.c: Add a bunch of stuff for symmetry's ptrace stuff. #if 0 i386_float_info. * symm-tdep.c (round): Remove. Also remove sgttyb. * symm-tdep.c: Remove lots of stuff which duplicates stuff from i386-tdep.c. Remove register_addr and ptx_coff_regno_to_gdb. * i386-tdep.c (i386_frame_find_saved_regs): Put in I386_REGNO_TO_SYMMETRY check in case it is needed for Dynix someday. * config/i386/nm-symmetry.h: Change KERNEL_U_ADDR. Move stuff from PTRACE_READ_REGS, PTRACE_WRITE_REGS macros to symm-nat.c. Define CHILD_WAIT and declare child_wait(). * config/i386/tm-symmetry.h: Remove call function stuff; stuff in tm-i386v.h is apparently OK. * config/i386/xm-symmetry.h [_SEQUENT_]: Define HAVE_TERMIOS not HAVE_TERMIO. Define MEM_FNS_DECLARED, NEED_POSIX_SETPGID, and USE_O_NOCTTY.
1994-01-27 Fix many sins which will come up in 32 bit x 64 bit GDB, andJim Kingdon1-4/+5
various miscellaneous things discovered in the process: * printcmd.c, defs.h (print_address_numeric): New function. * c-valprint.c (c_val_print), ch-valprint.c (chill_val_print) breakpoint.c (describe_other_breakpoints, breakpoint_1, mention), cp-valprint.c (cplus_print_value), infcmd.c (jump_command), printcmd.c, stack.c, symfile.c, symmisc.c, valprint.c: Use it. * utils.c, defs.h (gdb_print_address): New function. * expprint (dump_expression), gdbtypes.h: Use it. * breakpoint.c (describe_other_breakpoints), symmisc.c (dump_symtab, print_symbol): Use filtered not unfiltered I/O. (remove_breakpoints): Remove BREAKPOINT_DEBUG code. Might as well just run gdb under a debugger for this (and it had problems with printing addresses, how to print b->shadow, etc.). * buildsym.c (make_blockvector), core.c (memory_error), exec.c (print_section_info), maint.c (print_section_table), mdebugread.c (parse_procedure), solib.c, source.c, symfile.c, symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c: Add comments saying code is broken. Marked with "FIXME-32x64". * dbxread.c (process_one_symbol), partial-stab.h (default), remote-vx.c (vx_run_files_info): Don't cast int being passed to local_hex_string. * symmisc.c (print_symbol): Don't cast long being passed to %lx. * symtab.h (general_symbol_info): Add comment about SYMBOL_VALUE only being a long. * symmisc.c (print_symbol): Print "offset" in message for LOC_ARG and LOC_LOCAL. * printcmd.c (print_address): Remove #if 0 code with ADDR_BITS_REMOVE. * source.c: Include <sys/types.h> regardless of USG.
1994-01-25 * valops.c (value_assign): Set `type' after coercing toval.Peter Schauer1-2/+4
* c-valprint.c (c_val_print), ch-valprint.c (chill_val_print): Use extract_unsigned_integer to get the address of a reference.
1994-01-11* c-valprint.c (c_val_print): Treat TYPE_CODE_RANGE like TYPE_CODE_INT.Jim Kingdon1-5/+10
1993-12-17Modified Files:Kung Hsu1-3/+3
ChangeLog symtab.c c-valprint.c * symtab (decode_line_1): fix a bug when position char is not set correctly. * c-valprint (c_val_print): handle vtbl printing when vtbl is not set up yet.
1993-11-01Change the stream argument to _filtered to GDB_FILE *.Thomas Lord1-7/+7
Change all references to stdout/stderr to gdb_stdout/gdb_stderr. Replace all calls to stdio output functions with calls to corresponding _unfiltered functions (`fprintf_unfiltered') Replaced calls to fopen for output to gdb_fopen. Added sufficient goo to utils.c and defs.h to make the above work. The net effect is that stdio output functions are only directly used in utils.c. Elsewhere, the _unfiltered and _filtered functions and GDB_FILE type are used. In the near future, GDB_FILE will stop being equivalant to FILE. The semantics of some commands has changed in a very subtle way: called in the right context, they may cause new occurences of prompt_for_continue() behavior. The testsuite doesn't notice anything like this, though. Please respect this change by not reintroducing stdio output dependencies in the main body of gdb code. All output from commands should go to a GDB_FILE. Target-specific code can still use stdio directly to communicate with targets.
1993-09-29Modified Files:Kung Hsu1-1/+18
c-valprint.c Log messages: * c-valprint.c: to fix virtual table print bug (pr2695)
1993-09-28Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)Jim Kingdon1-1/+1
* symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES. Clean up problems with targets and hosts that have 64 bit longs and pointers and 32 bit ints. * breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c, ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c, expprint.c, gdbtypes.c, infcmd.c, language.c, language.h, m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h, printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c, symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c: Change all printf formats from %x to %lx if outputting an address. Change la_*_format to use long format. local_hex_string, local_hex_string_custom now take an unsigned long argument, change all callers. * coffread.c (read_coff_symtab): Remove superfluous cast for complaint output. * dbxread.c (end_psymtab): Cast MSYMBOL_INFO to long, not int. * findvar.c, value.h (write_register): Change register value to long. * gdbtypes.h (struct type): Change `bitsize' to long as TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer. * inferior.h (struct inferior_status): Change type of stop_pc to CORE_ADDR. * language.h (local_octal_string, local_octal_string_custom): Remove prototype, the functions are neither defined nor used. * mipsread.c (parse_symbol): Use temporary variable for bitsize as f->bitsize is a long now. * objfiles.c (add_to_objfile_sections, build_objfile_section_table): Use unsigned long casts instead of int for abusing sections_end pointer as integer. * stack.c (parse_frame_specification): Change type of `args' to CORE_ADDR for SETUP_ARBITRARY_FRAME. * printcmd.c (make_vasize): Allow redefinition via MAKEVA_SIZE. * mipsread.c (parse_type): Alpha cc now supports the t->continued bit, update algorithm to match the way the compiler uses it.
1993-09-08gcc lintK. Richard Pixley1-1/+0
1993-07-12 * c-valprint.c (c_val_print): Fix thinko with unspecified lengthJim Kingdon1-2/+3
arrays.
1993-06-25 * c-valprint.c (c_val_print): Handle TYPE_CODE_BOOLEAN.Jim Kingdon1-0/+4
* stabsread.c: Type -16 is 4 bytes.
1993-06-12 * Makefile.in (VERSION): Bump to 4.9.2.Fred Fish1-4/+0
* c-valprint.c (c_val_print): For array of chars printed with string syntax, don't print the address of the array. From bothner@cygnus.com. * c-exp.y (yylex): Recognize '.' as indicating a floating point number regardless of the radix. From wilson@cygnus.com. * valprint.c (set_input_radix_1, set_output_radix_1): New prototypes and functions that do the actual radix setting work. * valprint.c (set_radix, set_output_radix, set_input_radix): Rewrite to use set_input_radix_1 and set_output_radix_1. * valprint.c (initialize_valprint): Enable commands to independently set and show input and output radices. * valprint.c (show_radix): New prototype and function that handles separate input and output radices.
1993-04-29 * defs.h (CC_HAS_LONG_LONG): Set up to define CC_HAS_LONG_LONGFred Fish1-5/+1
when compiling with gcc, but disable it for now. See comment. * defs.h (LONGEST): Define as either "long" or "long long" based on CC_HAS_LONG_LONG. * defs.h (longest_to_int): Use CC_HAS_LONG_LONG to control how longest_to_int is defined. * c-valprint.c (c_val_print): Call print_longest. * expprint.c (dump_expression): Use PRINTF_HAS_LONG_LONG instead of LONG_LONG. * {printcmd.c, gdbtypes.h} (LONG_LONG): Replace usages with CC_HAS_LONG_LONG. * printcmd.c (print_scalar_formatted): Call print_longest and let it figure out what to do for PRINTF_HAS_LONG_LONG. * typeprint.c (print_type_scalar): Call print_longest and let it figure out what to do for PRINTF_HAS_LONG_LONG. * valprint.c (val_print_type_code_int): Call print_longest and let it figure out what to do for PRINTF_HAS_LONG_LONG. * stabsread.c (LONG_LONG): Replace usages with CC_HAS_LONG_LONG. * value.h (struct value): Replace usage of LONG_LONG with CC_HAS_LONG_LONG. * value.h (print_longest): Add prototype. * values.c (LONG_LONG): Replace usages with CC_HAS_LONG_LONG. * values.c (unpack_double): Collapse code that was unnecessarily dependent on CC_HAS_LONG_LONG. Use LONGEST instead of direct types. * values.c (value_from_longest): Remove dependency on CC_HAS_LONG_LONG and just use LONGEST. * solib.c (solib_map_sections): Use bfd_get_filename to access filename field. * solib.c (clear_solib): Save filename and free it later, after bfd_close, since bfd_close may reference it. Use bfd_get_filename to access the field. * config/convex/xm-convex.h (LONG_LONG): Replace with CC_HAS_LONG_LONG. Add define for PRINTF_HAS_LONG_LONG. * doc/gdbint.texinfo (LONG_LONG): Replace with CC_HAS_LONG_LONG. Add PRINTF_HAS_LONG_LONG references.
1993-03-02* coffread.c (process_coff_symbol): Change PCC argument correctionJohn Gilmore1-1/+1
so that it only happens on big-endian targets; so that it only happens if the short or char argument is aligned on an int boundary; and so that it changes the location, rather than the type, of the argument. These changes tend to parallel similar (old) changes in stabsread.c. * coffread.c (coff_read_enum_type): Use the specified size for enums, don't assume that they are int-sized. * c-valprint.c (c_val_print): Don't assume enums are the same as ints.
1993-01-19 * c-exp.y (exp): Add production to support direct creationFred Fish1-0/+1
of array constants using the obvious syntax. * c-valprint.c (c_val_print): Set printed string length. * dwarfread.c (read_tag_string_type): New prototype and function that handles TAG_string_type DIEs. * dwarfread.c (process_dies): Add case for TAG_string_type that calls new read_tag_string_type function. * expprint.c (print_subexp): Add support for OP_ARRAY. * gdbtypes.c (create_range_type, create_array_type): Inherit objfile from the index type. **** start-sanitize-chill **** * ch-typeprint.c (chill_print_type): Add case for TYPE_CODE_STRING. * ch-valprint.c (chill_val_print): Fix case for TYPE_CODE_STRING. **** end-sanitize-chill ****
1993-01-16 * c-exp.y (exp:STRING): Convert C strings into array-of-charFred Fish1-14/+16
constants with an explicit null byte terminator. OP_STRING is now used for real string types. * c-lang.c (builtin_type_*): Move declarations to lang.c since they are used by all languages. * c-lang.c (_initialize_c_language): Move initializations of builtin_type_* to lang.c. * c-typeprint.c (c_type_print_varspec_prefix, c_type_print_varspec_suffix): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * c-valprint.c (c_val_print): Change the way character arrays are printed as strings to be consistent with the way strings are printed when pointer-to-char types are dereferenced. Remove test of print_max before calling val_print_string, which now does it's own test. * eval.c (evaluate_subexp): Add case for OP_ARRAY. * expprint.c (print_subexp, dump_expression): Add case for OP_ARRAY. * expression.h (enum exp_opcode): Add OP_ARRAY and document. * gdbtypes.c (builtin_type_*): Add declarations moved from c-lang.c. * gdbtypes.c (create_string_type): New function to create real string types. * gdbtypes.c (recursive_dump_type): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * gdbtypes.c (_initialize_gdbtypes): Add initializations of builtin_type_* types moved from c-lang.c. * gdbtypes.h (enum type_code): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * gdbtypes.h (builtin_type_string): Add extern declaration. * gdbtypes.h (create_string_type): Add prototype. * m2-lang.c (m2_create_fundamental_type): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * m88k-tdep.c (pushed_size): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * mipsread.c (_initialize_mipsread): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_ARRAY. * printcmd.c (print_formatted): Recognize TYPE_CODE_STRING. * typeprint.c (print_type_scalar): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * valops.c (allocate_space_in_inferior): New function and prototype, using code ripped out of value_string. * valops.c (value_string): Rewritten to use new function allocate_space_in_inferior, but temporarily disabled until some other support is in place. * valops.c (value_array): New function to create array constants. * valprint.c (val_print_string): Add comment to document use, complete rewrite to fix several small buglets. * value.h (value_array): Add prototype. * value.h (val_print_string): Change prototype to match rewrite. **** start-sanitize-chill **** * ch-valprint.c (chill_val_print): Add case for TYPE_CODE_STRING. * ch-exp.y (match_character_literal): Disable recognition of control sequence form of character literals and document why. **** end-sanitize-chill ****
1993-01-14 * c-valprint.c (cp_print_class_member): Add extern decl.Fred Fish1-149/+7
* c-valprint.c (c_val_print): Extract code for printing methods and move it to cp_print_class_method in cp-valprint.c. * c-valprint.c (c_val_print): Extract code to print strings and move it to val_print_string in valprint.c. * cp-valprint.c (cp_print_class_method): New function using code extracted from c_val_print. * valprint.c (val_print_string): New function using code extracted from c_val_print. * value.h (val_print_string): Add prototype. **** start-sanitize-chill **** * ch-exp.y (CHARACTER_STRING_LITERAL): Set correct token type. * ch-exp.y (literal): Add action for CHARACTER_STRING_LITERAL. * ch-exp.y (tempbuf, tempbufsize, tempbufindex, GROWBY_MIN_SIZE, CHECKBUF, growbuf_by_size): New variables, macros, and support functions for implementing a dynamically expandable temp buffer. * ch-exp.y (match_string_literal): New lexer function. * ch-exp.y (match_bitstring_literal): Dynamic buffer code removed and replaced with new CHECKBUF macro. * ch-exp.y (yylex): Call match_string_literal when appropriate. * ch-valprint.c (ch_val_print): Add code for TYPE_CODE_PTR. **** end-sanitize-chill ****
1992-12-23 * defs.h (STRCMP, STREQ, STREQN): New macros.Fred Fish1-5/+5
* 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-18 * Makefile.in (VERSION): Bump to 4.7.4.Fred Fish1-0/+542
* 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 ****