Commit Graph

173 Commits

Author SHA1 Message Date
Per Bothner 35fcebce93 A ton of changes to improve C++ debugging. See ChangeLog. 1992-09-04 07:37:18 +00:00
Fred Fish dac9734e58 * coffread.c (decode_type): Call alloc_type to alloc new
types.
	* stabsread.c (read_array_type, read_range_type, define_symbol):
	Call alloc_type to alloc new types.
	* stabsread.c (define_symbol):  Move dbl_valu symbol field data
	from type_obstack to symbol_obstack.
	* stabsread.c (define_symbol):  Move typedef_sym from type_obstack
	to symbol_obstack.
	* gdbtypes.h (TYPE_ALLOC):  New macro to allocate space for data
	associated with a type, using the same mechanism as was used to
	allocate space for the type structure itself.
	* coffread.c (patch_type, coff_read_struct_type,
	coff_read_enum_type):  Use TYPE_ALLOC.
	* dwarfread.c (struct_type):  Use TYPE_ALLOC.
	* gdbtypes.c (create_array_type, check_stub_method,
	allocate_cplus_struct_type):  Use TYPE_ALLOC.
	* mipsread.c (parse_symbol, parse_type):  Use TYPE_ALLOC.
	* stabsread.c (read_struct_type, read_array_type, read_enum_type,
	read_range_type):  Use TYPE_ALLOC.
1992-08-24 00:13:11 +00:00
Fred Fish d07734e31f * Makefile.in (VERSION): Bump to 4.6.2.
* Makefile.in (SFILES_MAINDIR):  Add stabsread.c
	* Makefile.in (OBS):  Add stabsread.o
	* Makefile.in (stabsread.o):  Add build rule.
	* stabsread.c, stabsread.h:  New files.
	* buildsym.c:  Split out stabs specific support to stabsread.c.
	* buildsym.h:  Split out stabs specific support to stabsread.h.
	* dbxread.c (stabsread.h):  Include
	* dbxread.c (dbx_new_init):  Call stabsread_new_init.
	* dbxread.c (dbx_psymtab_to_symtab_1):  Call stabsread_init.
	* dbxread.c (read_ofile_symtab):  Call end_stabs.
	* dbxread.c (process_one_symbol):  Call end_stabs and start_stabs.
	* dbxread.c (elfstab_build_psymtabs):  Call stabsread_new_init.
	* dwarfread.c (psymtab_to_symtab_1):  Call buildsym_init, add
	really_free_pendings to cleanups.
	* elfread.c (elf_new_init):  Call stabsread_new_init.
	* gdbtypes.c:  Small changes to maintenance commands.
	* mipsread.c (stabsread.h):  Include.
	* mipsread.c (psymtab_to_symtab_1):  Call end_stabs.
	* xcoffread.c (stabsread.h):  Include.
	* xcoffread.c (global_stabs):  Remove redundant def.
	* xcoffread.c (read_xcoff_symtab):  Call start_stabs and end_stabs.
1992-07-28 04:22:18 +00:00
Fred Fish c0f1085b5a * buildsym.c (read_struct_type): Initialize structs allocated
with alloca, to avoid using random values from stack later on.
	* defs.h (fprintf_filtered):  Add prototype.
	* gdbtypes.c (check_stub_method):  Fix misleading comments.
	* gdbtypes.c (print_arg_types, dump_fn_fieldlists):  New maint
	support functions.
	* gdbtypes.c (print_cplus_stuff, recursive_dump_type):  Many
	small changes to maint support functions.
	* gdbtypes.h (cplus_struct_type):  Reorganize member ordering
	for some fields and expand comments.
	* objfiles.c (allocate_objfile):  Use new obstack_alloc_arg
	macro and track change to obstack_full_begin macro.
	* utils.c (fprintfi_filtered):  New function.
	* valprint.c (type_print_base):  Fixup field printing to not
	print extraneous lines and not print bogus "no data fields"
	messages for C++ classes with no data members.  Also use new
	fprintfi_filtered function.
1992-07-21 04:14:34 +00:00
Per Bothner a252e71520 * gdbtypes.c, gdbtypes.h: New function lookup_signed_typename.
* c-exp.y:  Call lookup_signed_typename() after seeing
	"signed".  This handles "signed char" correctly.
	* c-exp.y:  Recognize (but ignore) 'const' and 'volatile'
	keywords before a type specifier.
1992-07-10 23:30:40 +00:00
Per Bothner 5c5b5d4b0e Various fixes to improve C++ debugging. See ChangeLog. 1992-07-10 03:56:17 +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 0239d9b328 * maint.c: New file.
* Makefile.in (SFILES_MAINDIR):  Add new file maint.c.
	* Makefile.in (OBS):  Add new file maint.o.
	* defs.h (command_class):  Add class_maintenance.
	* defs.h (MAINTENANCE_CMDS):  Default to including maintenance
	commands.  Allow for them (and other nonessential parts of gdb)
	to be selectively left out under special circumstances.
	* gdbtypes.c (recursive_dump_type):  New function; supports
	maintenance print-type command.
	* gdbtypes.h (recursive_dump_type, maintenance_print_type):
	Add prototypes.
	* main.c (maintenancelist, maintenanceinfolist):  Add maintenance
	command lists.
	* main.c (initialize_cmd_lists):  Eliminate unnecessary casts on
	initializers.  Add initializations for setprintlist, showprintlist,
	setchecklist, showchecklist, maintenancelist, and maintenanceinfolist.
	* printcmd.c (maintenance_print_type):  New maintenance cmd.
	* valprint.c (setprintlist, showprintlist):  Move to main.c, as
	implied by comment that all cmd lists are owned by main.c.
	* infcmd.c (unsetlist):  Move to main.c, as implied by comment
	that all cmd lists are owned by main.c.
	* language.c (setchecklist, showchecklist):  Move to main.c, as
	implied by comment that all cmd lists are owned by main.c
	* breakpoint.c (enablelist, enablebreaklist, disablelist, cmdlist,
	deletelist):  Remove redundant declarations (also in gdbcmd.h).
	* symmisc.c (printsyms_command):  Now maintenance_print_symbols.
	* symmisc.c (printmsyms_command):  Now maintenance_print_msymbols.
	* symmisc.c (printpsyms_command):  Now maintenance_print_psymbols.
	* symmisc.c (printobjfiles_command):  Now maintenance_print_objfiles.
	* symtab.h (maintenance_print_symbols, maintenance_print_psymbols,
	maintenance_print_msymbols, maintenance_print_objfiles):
	Add prototypes.
	* symmisc.c (printsyms_command, printpsyms_command,
	printmsyms_command, printobjfiles_command):  Removed from
	_initialize_symmisc.
	* main.c (dump_me_command):  Moved to maint.c and renamed to
	maintenance_dump_me.
	* breakpoint.c (all_breakpoints_info):  Rename to
	maintenance_info_breakpoints.
	* breakpoint.c (_initialize_breakpoint):  Convert add_info of
	all_breakpoints_info to add maintenance_info_breakpoints to the
	maintenanceinfolist instead.
	main.c (initialize_main):  Set up maintenance class commands.
1992-07-06 00:22:57 +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 50e0dc4198 * mipsread.c: Pass NULL name pointer to init_type, not 0.
* gdbtypes.c (init_type):  Use copy of typename on type_obstack.
	* dwarfread.c (enum_type):  Save enum names on type_obstack.
	* dwarfread.c (struct_type):  Save member name on type_obstack.
	* symtab.c (_initialize_symtab):  Fix misspelling.
	* regex.c (store_jump, insert_jump):  Return void.
1992-06-25 19:10:49 +00:00
Fred Fish 6b53bf346d * expprint.c (print_subexp): Add missing ']'.
* defs.h (reg_names):  Fix declaration to match that in infcmd.c
	* stack.c (reg_names):  Delete redundant (and inconsistent) decl.
	* WHATS.NEW:  Point out improved C++ function name handling.
	* gdbtypes.c (lookup_fundamental_type):  For now, use the same
	type names for both implicitly and explicitly signed integral
	types.  See comment in the source code.
1992-06-12 20:51:42 +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 ea1549b346 * gdbtypes.c (make_{reference,pointer,function}_type): New
functions which handle overwriting of forward-referenced types
for stabs file reading.
(lookup_{reference,pointer,function}_type):  These just call
the make_*_type functions with a null storage alloc parameter.
* gdbtypes.h (make_{reference,pointer,function}_type):  Declare.
* xcoffread.c (smash_to_pointer_type):  Remove, no longer used.

* buildsym.c (dbx_lookup_type):  Zero result for (-1,-1) arg.
(dbx_alloc_type):  Make it easier to understand.  No funct change.
(define_symbol: 't'):  Don't put the typedef name into the name of
the struct, union, or enum.  Bugfix.
(read_type: '*', '&', 'f'):  Add comments.  Use make_XXX_type
routines to properly handle overwriting preallocated types so that
forward references will work.
(read_enum_type):  Force enum values to file scope, due to bug in
Sun compiler output.  FIXME, fix later.

Remove unused header_file_prev_index mechanism.  It was already
obsolete in gdb-3.5.  These comments appeared in 3.5:
  /* This code was used before I knew about the instance codes.
     My first hypothesis is that it is not necessary now
     that instance codes are handled.  */
* dbxread.c (add_new_header_file):  Remove header_file_prev_index.
* buildsym.h:  Remove it and prev_index that saves it.
* buildsym.c (push_subfile, pop_subfile, start_symtab):  Remove it.

* solib.c (special_symbol_handling):  When called from core files,
must set up debug_addr.  Don't print error messages, just return.
* symmisc.c (print_symbol):  Less ascii diarrhea for enums, please.
1992-05-01 09:14:43 +00:00
Fred Fish 1867b3be84 Back out of TYPE_FLAG_FUND_TYPE change, solve the problem in valprint.c by
just printing the type name from the type if it is not otherwise handled.
Implement new handling of the ".syms" file for reusable symbol files.
1992-04-18 02:30:28 +00:00
Fred Fish 4a11eef2eb Add TYPE_FLAG_FUND_TYPE bit to the flags member of the type structure,
and use it to decide when to print the actual type name rather than
trying to invent the name of a fundamental type.  This clears up the
confusion between int/long when they are the same sizes, removes one
obstacle to multi-language support (previously valprint.c thought
everything was a C type), and allows gdb to support distinctions between
explicitly and implicitly signed types when the compiler supports such
distinction in the debug output (as does every ANSI compiler I tested
except for gcc).
1992-04-15 05:42:00 +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 c2e4669f8c Misc cleanups from code review. 1992-03-27 23:56:15 +00:00
Fred Fish 5e2e79f859 Many changes, most related to creating entry point information on a per-objfile
basis.  See comments in objfiles.h and details in ChangeLog.  Also remove
redundant definitions of FRAME_CHAIN_VALID from most of the tm-* files and
use a default definition in frame.h.
1992-03-21 01:56:01 +00:00
Fred Fish 318bf84ffe Globs of changes. See the ChangeLog for details. Most related to
using the new mmalloc package.
1992-03-15 01:09:14 +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
Steve Chamberlain 96743d3c30 * gdbtypes.c (lookup_pointer_type): initialize the TYPE_LENGTH of
a ptype to reflect the setting of TARGET_PTR_BIT.  Set the
	TYPE_FLAGS of a ptype to TYPE_FLAG_UNSIGNED.
	* tm-h8300.h, h8300-tdep.c, remote-hms.c: personal checkpoint
	* printcmd.c (print_address): if ADDR_BITS_REMOVE is defined, use
	it before printing out the hex shape of an address.
1992-03-03 07:05:23 +00:00
John Gilmore 93fe4e330e Saberlint.
* symmisc.c, xcoffread.c:  Move debug functions to symmisc.c.
1992-02-22 09:16:11 +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