Commit Graph

157 Commits

Author SHA1 Message Date
Jim Kingdon 9925b92861 * values.c (USE_STRUCT_RETURN): Only use gcc wierdness for gcc1. 1993-04-06 21:20:30 +00:00
Michael Tiemann 7cb0f87089 * values.c (value_headof): Fix typo in which VTBL and ARG were
being confused for one another.
1993-02-01 01:16:35 +00:00
Fred Fish c4413e2c9b * c-exp.y (exp:STRING): Convert C strings into array-of-char
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-16 05:15:58 +00:00
Fred Fish 2e4964adfc * defs.h (STRCMP, STREQ, STREQN): New macros.
* 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-23 06:34:57 +00:00
Fred Fish a8a69e6332 * Makefile.in (VERSION): Bump to 4.7.4.
* 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 ****
1992-12-18 20:21:32 +00:00
Fred Fish 394171ace4 * tm-sun4sol2.h: Add CPLUS_MARKER. Solaris 2.0 requires '.'
rather than '$'.  This particular piece of braindamage is
	spreading like ooze. It's now infected libiberty, deja-gnu,
	gdb, and gcc.
	* values.c (baseclass_addr):  Use CPLUS_MARKER rather than
	hardwired '$' character.
1992-11-30 20:07:35 +00:00
Fred Fish e58de8a230 * Makefile.in (SFILES_MAINDIR): Add ch-exp.y.
* Makefile.in (YYFILES):  Add ch-exp.tab.c.
	* Makefile.in (YYOBJ):  Add ch-exp.tab.o.
	* Makefile.in (saber_gdb):  Add unload of ch-exp.y and load
	of ch-exp.tab.c.
	* Makefile.in (distclean):  Add target ch-exp.tab.c.
	* Makefile.in (realclean):  Add rm of ch-exp.tab.c.
	* Makefile.in (c-exp.tab.c, m2-exp.tab.c):  Add dependency on
	Makefile since it contains sed patterns used in generation.
	Add sed pattern to also delete #include of any malloc.h.
	* Makefile.in (ch-exp.tab.o, ch-exp.tab.c):  New targets.
	* ch-exp.y:  New expression parser, for GNU-Chill.
	* c-exp.y, expr.c, expression.h, language.c, m2-exp.y,
	parser-defs.h, valarith.c, valops.c, value.h:  Remap macros and
	function names to conform to K&R terminology with respect to
	logical and bitwise operators:
	UNOP_ZEROP => UNOP_LOGICAL_NOT
	UNOP_LOGNOT => UNOP_COMPLEMENT
	BINOP_LOGAND => BINOP_BITWISE_AND
	BINOP_LOGXOR => BINOP_BITWISE_XOR
	BINOP_LOGIOR => BINOP_BITWISE_IOR
	BINOP_AND => BINOP_LOGICAL_AND
	BINOP_OR => BINOP_LOGICAL_OR
	PREC_OR => PREC_LOGICAL_OR
	PREC_AND => PREC_LOGICAL_AND
	PREC_LOGIOR => PREC_BITWISE_IOR
	PREC_LOGXOR => PREC_BITWISE_XOR
	PREC_LOGAND => PREC_BITWISE_AND
	value_zerop() => value_logical_not()
	value_lognot() => value_complement()
	* c-exp.y (c_op_print_tab):  Add explicit empty terminator.
	* m2-exp.y (m2_op_print_tab):  Add explicit empty terminator.
	* defs.h (enum language):  Add language_chill.
	* dwarfread.c (set_cu_language):  Add LANG_CHILL case and make
	LANG_MODULA2 a recognized language.
	* eval.c (evaluate_subexp):  Add OP_BOOL case.
	* expprint.c (print_subexp):  Add OP_BOOL case.
	* gdbtypes.h (enum_typecode):  Note TYPE_CODE_BOOL used for
	Chill as well as Modula-2.
	* gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long,
	builtin_type_chill_ulong, builtin_type_chill_real):  Add.
	* i387-tdep.c (sys/dir.h):  Remove, appears to be unnecessary
	and is nonexistant in some SVR4 based systems.
	* language.c (DEFAULT_ALLOCSIZE):  Change from 3 => 4.
	* language.c (set_language_command):  Add chill.
	* language.c (binop_result_type, integral_type, character_type,
	boolean_type, structured_type, value_true, binop_type_check):
	Add language_chill cases.
	* language.h (_LANG_chill):  Define.
	* m2-exp.y (number_sign, modblock):  Make static, #ifdef out
	unused modblock.
	* m2-exp.y (ANDAND):  Rename to LOGICAL_AND.
	* source.c (source_info):  Fix minor nits, print "1 line" rather
	than "1 lines", and "language is <lang>".
	* symfile.c (deduce_language_from_filename):  Recognize the
	filename extensions ".chill", ".c186", and ".c286" for Chill.
	* valarith.c (value_binop):  Handle TYPE_CODE_BOOL as well
	as TYPE_CODE_INT and TYPE_CODE_FLOAT.
	* valprint.c (val_print):  Print TYPE_CODE_BOOL type values as
	"TRUE" or "FALSE".
	* valprint.c (typedef_print):  Add case for language_chill.
	* values.c (value_from_longest):  Handle TYPE_CODE_BOOL.
1992-11-15 17:28:02 +00:00
John Gilmore 94603999f9 A bunch of changes mostly to improve debugging of C++ programs.
Specifically, the calling of inferiors methods is improved.

	* value.h:  New macros METHOD_PTR_IS_VIRTUAL,
	METHOD_PTR_FROM_VOFFSET, METHOD_PTR_TO_VOFFSET to partially
	hide the implementation details of pointer-to-method objects.
	How to tell if the pointer points to a virtual method is
	still very dependent on the particular compiler, but this
	should make it easier to find the places to change.
	* eval.c (evaluate_subexp [case OP_FUNCALL]), valprint.c
	(val_print [case TYPE_CODE_PTR]):  Use the new METHOD_PTR_*
	macros, instead of a hard-wired-in code that incorrectly
	assumed a no-longerused representation of pointer-to-method
	values.  And otherwise fix the relevant bit-rotted code.

	* valprint.c (type_print_base [case TYPE_CODE_STRUCT]):
	If there are both fields and methods, put a space between.

	* stabsread.c (read_struct_type):  Fix bug in handling of
	GNU C++ anonymous type (indicated by CPLUS_MARKER followed
	by '_').  (It used to prematurely exit the loop reading in
	the fields, so it would think it should start reading
	methods while still in the fields.  This could crash gdb
	given a gcc that can emit nested type information.)

	* valops.c (search_struct_method):  Pass 'this' value by
	reference instead of by value.  This provides a more
	consistent interface through a recursive search where the
	"bottom" functions may need to adjust offsets (due to multiple
	inheritance).
	* valops.c, value.h, values.c:  Pass extra parameters to
	value_fn_field and value_virtual_fn_field so we can
	correctly adjust offset for multiple inheritance.
	* eval.c (evaluate_subexp [case OP_FUNCALL]):  Simplify
	virtual function calls by using value_virtual_fn_field().
	* values.c: New function baseclass_offset, derived from
	baseclass_addr (which perhaps can be made obsolete?).
	It returns an offset rather than an address.  This is a
	cleaner interface since it doesn't mess around allocating
	new values.
	* valops.c (search_struct_method):  Use baseclass_offset
	rather than baseclass_addr.
1992-10-06 09:22:43 +00:00
John Gilmore 2640f7e138 Removed a large number of changes inserted by Per Bothner
for C++ support.  These will go back in when they've been
examined.
1992-09-10 00:07:06 +00:00
Per Bothner 35fcebce93 A ton of changes to improve C++ debugging. See ChangeLog. 1992-09-04 07:37:18 +00:00
Fred Fish 8050a57b2c * dwarfread.c (alloc_utype, decode_subscr_data): Call alloc_type
to create new blank types, instead of handcrafting them.
	* defs.h (printfi_filtered):  Add prototype.
	* utils.c (printfi_filtered):  New function.
	* gdbtypes.c (recursive_dump_type):  Use printfi_filtered to
	to simplify the code.  Other cleanups.
	* gdbtypes.c (check_stub_method):  Demangle using DMGL_ANSI.
	* gdbtypes.h (struct cplus_struct_type):  Add comments describing
	use of various fields.
	* gdbtypes.c (print_bit_vector, print_cplus_stuff):  New functions.
	* c-exp.y (%token):  Add CLASS as a token for C++, add grammar
	production that currently treats it exactly the same as STRUCT.
	* c-exp.y (yylex):  Recognize "class" as token CLASS.
	* symtab.c (gdb_mangle_name):  Rewrite to match current g++ stabs.
	* symtab.c (decode_line_1):  Fix to pass quoted args on down to
	general symbol handling code.  Call cplus_mangle_opname with
	DMGL_ANSI.
	* symtab.c (decode_line_2):  Print demangled function names in
	breakpoint menus, instead of just file and line number.
	* symtab.c (name_match):  Call cplus_demangle with DMGL_ANSI.
	* valprint.c (type_print_base):  Print "class" for C++ classes,
	rather than "struct".  Print section labels for public, protected
	and private members of C++ classes.
	* values.c:  Include demangle.h.
	* values.c (value_headof):  Call cplus_demangle with DMGL_ANSI.
1992-07-09 04:40:39 +00:00
Fred Fish 4ed3a9ea66 * breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
	eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
	i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
	infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
	putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
	sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
	tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
	values.c, xcoffread.c:
	Remove "(void)" casts from function calls where the return value
	is ignored, in accordance with GNU coding standards.
1992-07-04 03:22:08 +00:00
Fred Fish 51b57ded88 * dbxread.c, i386-pinsn.c, i386-tdep.c, regex.c, solib.c, symmisc.c,
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.
1992-06-29 23:34:38 +00:00
Steve Chamberlain ae0ea72ee2 Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
	allowing hosts with different text and binary file formats to
	work.
	* coffread.c (read_coff_symtab): changed calling convention and
	operation - now it opens its own file with FOPEN_RB rather than
	duping and fdopening the provided handle.
	* dbxread.c, cplus-dem.c: #include mangling.
	* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
	binary files oring in the right bit.
	* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
	* remote-hms.c: cleanup to use the new remote serial stuff
	* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
	independent remote terminal I/O.
	* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
	* source.c (openp): fix off by one problem removing / - can now
	open a source file in the root directory with DOS.
	* values.c (value_as_pointer): remove bogus address bits from
	long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
Fred Fish 8f793aa541 * Makefile.in (DEMANGLER): Define and default to cplus-dem.
Allows selection of C++ demangler to be a configuration option
	until multiple demanglers are supported.
	* demangle.h:  New include file for extended demangler support.
	* breakpoint.c, gdbtypes.c, printcmd.c, stack.c, symtab.c,
	utils.c, valprint.c:  Include "demangle.h" and change all calls
	to cplus_demangle() or fputs_demangled() to use individual
	demangling options.
	* valprint.c (type_print_1):  Change options to cplus_demangle
	to print demangled function args.  Still broken, but now less so.
	* cplus-dem.c:  Include demangle.h, reorganize and update some
	comments to reflect reality.
	* cplus-dem.c (cplus_demangle, cplus_mangle_opname):  Change
	second arg from fixed integer to bit based multiple options.
	* cplus-dem.c (optable):  Reformat and replace ansi members with
	bit based options.
	* cplus-dem.c (do_type):  Fix bug with parsing missing return type.
1992-05-05 18:16:23 +00:00
John Gilmore 6fab5bef69 * values.c (set_internalvar): Force evaluation of lazy values.
Bug reported by RMS.
1992-05-05 05:31:21 +00:00
Fred Fish 4db8e515c4 * Makefile.in (VERSION): Bump to 4.5.2.
* Makefile.in (DEMANGLE_OPTS):  Add, default to -Dnounderscore.
	* configure.in:  Simplify ncr3000 gdb_host logic, add gdb_target.
	* dwarfread.c (struct_type):  Apply fix from Peggy Fieland for
	proper handling of bit fields.
	* gdbtypes.h (struct type):  Clarify use of field.bitpos.
	* symtab.h:  Fix couple of misspellings in comments.
	* value.h (struct value):  Clarify use of bitpos.
	* value.h (unpack_field_as_long):  Change prototype, returns
	LONGEST.
	* values.c (unpack_field_as_long):  Change return type to LONGEST,
	sign extend unpacked fields that are signed, other rewriting.
	* config/ncr3000.mt:  New target config file.
1992-05-03 23:05:07 +00:00
Fred Fish 5c1c5e6745 Fix bug in values.c unpacking signed characters on hosts where the default
character type is unsigned.  Add some cases to the tables in procfs.c
for constants defined in newer SVR4 systems and reorder the tests for
ioctl support of resetting the inherit-on-fork flag to favor the latest
method using PIOCRESET.
1992-04-02 18:00:10 +00:00
John Gilmore ac88ca205c Lint.
* symfile.c (add_symbol_file_command):  Initialize mapped/readnow.
1992-04-02 10:35:19 +00:00
John Gilmore be772100b5 Lint 1992-03-29 23:26:47 +00:00
Per Bothner 01be69139e More C++ improvements (pointers to members, qualified names). See ChangeLog. 1992-03-20 21:57:17 +00:00
Per Bothner 2cd9998540 Some improvements to g++ debugging.
* symtab.c (list_symbols): demangle before pattern matching.
	* symtab.c:  Other fixes to improve handing of operators.
	* valprint.c (type_print_base):  Fix test for constructor.
	* values.c (value_static_field):  Allow evaluation of
	CLASS::METHOD, returning a function pointer.
1992-03-19 00:05:35 +00:00
Michael Tiemann d747e0af3d Tue Mar 3 15:11:52 1992 Michael Tiemann (tiemann@cygnus.com)
* All GDB files that #include defs.h: Removed stdio.h.
	(defs.h): #include stdio.h.

This has been tested by building GDBs for all targets hosted on Sun4.
None of the build problems were related to stdio.h inclusion.  (n.b.
many configurations don't build for other reasons.)
1992-03-03 23:26:26 +00:00
John Gilmore 1ab3bf1b14 * Check in Fred Fish's changes in these modules. Fred
will make ChangeLog entries for all of them.
1992-02-22 01:46:16 +00:00
Steve Chamberlain 1f46923ff4 * coffread.c (read_enum_type): Use the size of a target int when
describing enum.
	* defs.h: added new #define for TARGET_PTR_BIT, defaults to size
	of target int.
	* h8300-tdep.c, remote-hms.c, tm-h8300.h: too many changes to count
	* symtab.c (lookup_reference_type, lookup_ptr_type): use
	TARGET_PTR_BIT to determine size of a pointer
	* values.c (unpack_long): when unpacking a REF or a PTR don't
	assume the size of the type.
1992-02-06 20:03:31 +00:00
Per Bothner 8e9a3f3b18 Mainly stuff to improve handling of TYPE_CODE_REF (C++ reference)
values. (See ChangeLog.)
1991-12-30 19:22:29 +00:00
John Gilmore f1d77e9053 Improve G++ debugging support. 1991-11-27 09:43:59 +00:00
John Gilmore 7d9884b927 * defs.h: Incorporate param.h. All users changed.
* param-no-tm.h:  Change users to define TM_FILE_OVERRIDE instead.
* param.h, param-no-tm.h:  Removed.
* Update copyrights in all changed files.
* dbxread.c, dwarfread.c, inflow.c, infrun.c, m2-exp.y, putenv.c,
solib.c, symtab.h, tm-umax.h, valprint.c:  Lint.
* tm-convex.h, tm-hp300hpux.h, tm-merlin.h, tm-sparc.h,
xm-merlin.h:  Avoid host include files in target descriptions.
* getpagesize.h:  Removed, libiberty copes now.
1991-11-21 18:42:05 +00:00
Per Bothner 0e2a896cf5 Fixes related to handling of C++ methods (handle destructors
and parameters that are functions).
1991-11-12 22:20:02 +00:00
Fred Fish 58ae87f612 Remove internal gdb definition of fixed arg count concat() function and
convert to use of variable arg count concat() in libiberty.
1991-11-12 17:50:14 +00:00
Per Bothner 545af6ce07 Add C++ as a separate language.
Also, fix a C++ problem when looking for methods in super-classes.
(There was confusion between base and derived types.)
1991-11-06 01:08:21 +00:00
Per Bothner bcccec8c8d Various fixes to improve g++ debugging. See ChangeLog. 1991-10-26 02:05:14 +00:00
John Gilmore afe4ca159b Changes from Fred Fish:
* tm-68k.h (FPI_REGNUM):  Add.
* infrun.c (child_create_inferior):  flush stdout and stderr
before forking.
* configure.in:  Handle amigados, amix hosts and targets.
* inflow.c:  Handle TIOCGLTC_BROKEN for Amiga.

From Andreas Schwab:
* values.c (show_convenience):  Use printf_filtered.
* main.c (define_command):  Check result of lookup_command for
exact match.
(echo_command):  Use printf_filtered, and force output out.

* dbxread.c (read_enum_type):  Avoid Modula-2 kludge that breaks C
programs.
* i387-tdep.c (double_to_i387):  Fix typo for double_to_ieee_extended.
* utils.c (_initialize_utils):  If !ISATTY, don't paginate.
1991-10-15 23:29:34 +00:00
John Gilmore 35505d07d7 * values.c (unpack_long, value_from_longest): Handle
TYPE_CODE_BOOL and TYPE_CODE_CHAR.
1991-09-19 03:07:56 +00:00
John Gilmore 96b2f51cdc Fix some infrastructure to be able to cope with host and target
machines with different sized basic types (ints, ptrs, etc).
(Idea from pierre@la.tce.com (Pierre Willard).)

* values.c (value_from_longest):  Rename from value_from_long.
Handle pointer types as well as integers, so that targets with
different pointer sizes from the host can be accomodated.
* breakpoint.c, convex-tdep.c, eval.c, expprint.c, printcmd.c,
valarith.c, valops.c, valprint.c, value.h, values.c:  Rename
uses of value_from_long to value_from_longest.
1991-09-06 07:13:38 +00:00
Stu Grossman 61a7292f6f lint 1991-08-22 22:50:50 +00:00
John Gilmore 4f6f12f989 Only read the right number of bytes in reading basetypes, so we don't
overrun malloc.
1991-08-03 02:02:03 +00:00
John Gilmore c3a2180180 Eliminate LOC_EXTERNAL. Improve select_source_symtab. Bug fixes. 1991-07-19 06:45:19 +00:00
John Gilmore 99a7de40cb Change GDB over to GNU General Public License version 2. 1991-06-04 07:31:55 +00:00
Jim Kingdon 2bff8e38bc *** empty log message *** 1991-05-03 00:50:18 +00:00
Jim Kingdon e1ce8aa5ed The list of changes is too long to fit in the cvs log (since it truncates!).
Look at the ChangeLog for Apr 30 and May 1.
1991-05-02 04:28:42 +00:00
Michael Tiemann aec4cb918e Tue Apr 30 13:13:33 1991 Michael Tiemann (tiemann at cygint.cygnus.com)
* valprint.c (type_print_base): If the type being printed is a
	struct containing undefined types, print "<undefine type>"
	as the type instead of crashing.
	* values.c (value_headof): Get the vtable pointer taking
	TYPE_VPTR_BASETYPE into account.
	* symtab.c, symtab.h, dbxread.c: Fix various whitespace splotches.
1991-04-30 20:19:02 +00:00
Jim Kingdon 122ad9abf2 * param-no-tm.h: Make BITS_BIG_ENDIAN defined to 0/1, not defined
or not defined.  Don't define it based on TARGET_BYTE_ORDER if
	it's already defined (in the tm.h file).
	mips-opcode.h (BIT_FIELDS_*),
	values.c (modify_field, unpack_field_as_long):
	Use #if BITS_BIG_ENDIAN not #ifdef BITS_BIG_ENDIAN.
1991-04-29 05:27:04 +00:00
Jim Kingdon 71b16efa43 * values.c (check_stub_method): Do lookup_method_type and stuff
rather than smash_to_method_type.
	* values.c (check_stub_method): Deal with operator names.
	* values.c: Move declaration of cplus_demangle to top of file.
	* values.c (baseclass_addr): If can't read memory, set *ERRP
	rather than calling error().
	* values.c (value_static_field): Recursively check all baseclasses.
	Return NULL if not found.
	* values.c, value.h: New functions value_{headof,from_vtable_info}.
	values.c (value_virtual_fn_field):
	Don't bother to do anything with
	return value from fill_in_vptr_fieldno.CVS: Modified Files:
1991-04-26 23:04:10 +00:00
Jim Kingdon e532974c43 values.c (value_virtual_fn_field): If there is no fcontext,
then do things the way GDB 3.x did.
	valops.c (search_struct_method): Add type to value_virtual_fn_field
	arguments.
1991-04-24 01:01:09 +00:00
Jim Kingdon fcb887ffcd * breakpoint.c (bpstat_print): Try all elements on the bpstat
chain before giving up with an internal error.

Sun Apr 21 21:43:10 1991  Jim Kingdon  (kingdon at cygint.cygnus.com)

	* value.h, values.c (value_{,free_to_}mark): New functions.
	breakpoint.c (bpstat_stop_status): Use them.
1991-04-22 07:08:07 +00:00
Jim Kingdon f266e5641b *** empty log message *** 1991-04-19 01:32:08 +00:00
John Gilmore 3f2e006b77 *** empty log message *** 1991-04-05 09:02:10 +00:00
K. Richard Pixley dd3b648e8b Johns release 1991-03-28 16:28:29 +00:00
John Gilmore 831c851165 Initial revision 1990-09-05 17:54:31 +00:00
gdb-3.3 4187119d59 gdb-3.3 2012-06-03 15:36:32 +01:00
gdb-3.1 e91b87a368 gdb-3.1 2012-06-03 15:36:31 +01:00
gdb-2.8.1 bb7592f010 gdb-2.8.1 2012-06-03 15:36:31 +01:00
gdb-2.8 3bf57d2108 gdb-2.8 2012-06-03 15:36:31 +01:00
gdb-2.5.2 6368691e88 gdb-2.5.2 2012-06-03 15:36:30 +01:00
gdb-2.5.1 632ea0ccc5 gdb-2.5.1 2012-06-03 15:36:30 +01:00
gdb-2.4+.aux.coff 7b4ac7e1ed gdb-2.4+.aux.coff 2012-06-03 15:36:30 +01:00