Commit Graph

175 Commits

Author SHA1 Message Date
Jason Molenda ad3b8c4a1a 1998-10-13 Jason Molenda (jsm@bugshack.cygnus.com)
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid
        possible nested-if confusion.
        * breakpoint.c (breakpoint_here_p): Ditto.
        (breakpoint_inserted_here_p): Ditto.
        (breakpoint_thread_match): Ditto.

        * gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined.
        * gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability
        prototypes.

        * symtab.h: Add prototype for _initialize_source.
        * value.h: Add prototype for _initialize_value.

        * defs.h: Include sys/types.h or stddef.h to get size_t.
        (make_cleanup): Add make_cleanup_func typedef and switch to using
        a prototype for this function.
        (mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't
        using mmalloc.

        * ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c
        dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c
        infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c
        symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c:
        Cast parameters passed to make_cleanup to use the new
        make_cleanup_func typedef.


More warning cleanups.  There are still a bunch of places where the first
argument to make_cleanup is not cast to (make_cleanup_func); these are
either due to the function fitting the make_cleanup_func specification
already (e.g. free()) or they are in files that weren't compiled when
I did my make on a Linux native system.  Bwahahaha.  You can see them
like this:

grep make_cleanup\  * | grep -v make_cleanup_func

I'll surely go back and clean up the remaining suspicious calls in
GDB one of these days. :-)
1998-10-14 01:15:00 +00:00
Bob Manson 1e9c814fb9 * config/sparc/tm-sp64.h (CALL_DUMMY): Store and retrieve
%o0-%o5 as 64-bit values; compensate for stack bias.
	(USE_STRUCT_CONVENTION): We only pass pointers to structs
	if they're larger than 32 bytes.
	(REG_STRUCT_HAS_ADDR): Ditto.

	* sparc-tdep.c (sparc_init_extra_frame_info): Use read_sp()
 	instead of read_register. If the target is a sparc64 and the frame
 	pointer is odd, compensate for the stack bias.
	(get_saved_register): Use read_sp().
	(DUMMY_STACK_REG_BUF_SIZE): Use FP_REGISTER_BYTES.
	(sparc_push_dummy_frame): Use read_sp()/write_sp(). On sparc64,
 	save the PC, NPC, CCR, FSR, FPRS, Y and ASI registers.
	(sparc_frame_find_saved_regs): Use read_sp(). Read the PC, NPC,
 	CCR, FSR, FPRS, Y and ASI registers from the frame, if it's a
 	dummy frame.
	(sparc_pop_frame): Use write_sp(). If the target is a sparc64 and
 	the FP is odd, compensate for stack bias.
	(sparc_store_return_value): Right-justify the return value before
 	writing it to %o0.
	(sparc_fix_call_dummy): Don't NOP out part of the call dummy on
 	sparc64.
	(sparc64_read_sp, sparc64_read_fp, sparc64_write_sp,
 	sparc64_write_fp, sp64_push_arguments,
 	sparc64_extract_return_value): New functions to support the
 	sparc64 ABI.

	* dwarfread.c (handle_producer): Set processing_gcc_compilation to
 	the right version number.

	* dwarf2read.c (read_file_scope): Assume we're processing
	GCC2 output.
1998-05-08 05:30:24 +00:00
John Metzler 67359871bb Previously, the size of pointers was taken from the hosts pointer size. Now, it is a function of TARGET_PTR_BITS. 1998-03-04 01:12:43 +00:00
Stan Shebs 7074cd4e8a Suggested by Chris Walter <walter@budoe.bu.edu>:
* dwarfread.c (set_cu_language): Recognize Fortran.
	* dwarf2read.c (set_cu_language): Ditto.
	(read_array_type): Fix language test.
1998-01-28 23:02:03 +00:00
Per Bothner f7f37388dc * gdbtypes.h: Re-interpret struct field. Suppport address of static.
Add a bunch of macros.
	* coffread.c, dwarf2read.c, dwarfread.c, mdebugread.c, stabsread.c:
	Update to use new macros.
	* coffread.c, hpread.c, stabsread.c:  Remove bugus TYPE_FIELD_VALUE.
	* value.h, values.c (value_static_field):  New function.
	* cp-valprint.c, valops.c:  Modify to use value_static_field.
1997-08-05 21:58:57 +00:00
Fred Fish 609fd03384 * buildsym.h (struct subfile): Add debugformat member.
(record_debugformat): Declare global function.
	* buildsym.c (start_subfile): Initialize debugformat member
	to NULL.
	(record_debugformat): New function to record the format.
	(end_symtab): Copy format into symtab debugformat member.
	(end_symtab): Free subfile debugformat member.
	* symmisc.c (free_symtab): Free debugformat when freeing
	symtab.
	* symfile.c (allocate_symtab): Initialize the new debugformat
	member for new symtabs.
	* symtab.h (struct symtab): Add debugformat member.
	* source.c (source_info): Print the debug format.

	* os9kread.c (os9k_process_one_symbol): Call record_debugformat
	with "OS9".
	* hpread.c (hpread_expand_symtab): Call record_debugformat
	with "HP".
	(hpread_process_one_debug_symbol): Ditto.
	* dbxread.c (process_one_symbol): Call record_debugformat
	with "stabs".
	* coffread.c (coff_start_symtab): Call record_debugformat
	with "COFF".
	* xcoffread.c (read_xcoff_symtab): Call record_debugformat
	with "XCOFF".
	* dwarfread.c (read_file_scope): Call record_debugformat
	with "DWARF 1".
	* dwarf2read.c (read_file_scope): Call record_debugformat
	with "DWARF 2".
	* dstread.c (dst_end_symtab): Set debugformat to be
	"Apollo DST".
	* mdebugread.c (new_symtab): Set debugformat to be "ECOFF".
1997-06-28 06:10:06 +00:00
Fred Fish 705ebd9239 * dwarfread.c (isreg, optimized_out, offreg, basereg): Move
global variables into the struct dieinfo structure.
	(locval): Pass pointer to a dieinfo struct rather than a
	pointer to the raw location information.  Change prototype.
	Set isreg, optimized_out, offreg and basereg as appropriate.
	(struct_type): Call locval with dieinfo struct pointer.
	(new_symbol): Ditto.
	(new_symbol): Call locval and save location before testing
	the values of the new dieinfo struct flags, set by locval.
1997-06-18 21:38:57 +00:00
Fred Fish 015e113cfe * dwarfread.c (new_symbol): Use SYMBOL_VALUE_ADDRESS, instead of
SYMBOL_VALUE, to set the value of LOC_STATIC symbols.
1997-06-17 14:01:37 +00:00
Stu Grossman ac9548059b * buildsym.c (finish_block): Treat LOC_BASEREG_ARG and
LOC_LOCAL_ARG as arguments so that GDB will know about function
	args declared this way.  Mostly affects dwarf.
	* dwarfread.c (decode_die_type):  Change default type from int to
	void.  This allows GDB to recognize void functions.
	* (new_symbol):  If AT_PROTOTYPED is present, set a flag in the
	type structure.
	* findvar.c (extract_floating store_floating):  Clean up comments
	to reflect reality.
	* gdbtypes.h:  Add TYPE_FLAG_PROTOTYPED so that we can tell if a
	function has a prototype.  Currently, only dwarf supports this.
	* utils.c (floatformat_from_doublest):  Fix logic error with
	converting from double to float.  (It wasn't shifting mant_long if
	it had a hidden bit.)

	* v850-tdep.c:  Add support for function calling.  Fix some
	problems with debugging code w/o debug symbols.
	* config/v850/tm-v850.h:  Ditto.
1996-10-15 23:44:13 +00:00
Stu Grossman 9e77e83d30 * dwarf2read.c dwarfread.c exec.c infcmd.c infrun.c main.c
mdebugread.c os9kread.c source.c top.c utils.c:  Don't
	include param.h or sys/file.h (or unistd.h in some cases).
	* defs.h exec.c inflow.c remote-array.c remote-e7000.c
	sparcl-tdep.c terminal.h utils.c:  Replace all occurances of
	__WIN32__, WINGDB, WIN32, etc... with _WIN32.
	* main.c:  Remove #ifndef WINGDB around option processing.  Fix
	bug with passing argc==0 and argv==NULL to getopt.
	* (main) Remove calls to access() before source_command.  Let
	soure_command handle access errors.
	* maint.c (maintenance_dump_me):  #ifdef out for _WIN32.
	* symtab.c (operator_chars):  Make this global for wingdb.
	* top.c (disconnect):  #ifdef out for _WIN32.
	* (source_command):  If got an error and from_tty, then call print
	error, else just return quietly.
	* utils.c (fatal_dump_core):  Can't kill ourselves under windows.
	Just exit.
	* (pollquit notice_quit):  #ifdef out stuff that doesn't exist
	under windows.
1996-08-08 02:50:22 +00:00
Fred Fish b607efe714 See gdb ChangeLog entry with header:
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-07-26 03:01:51 +00:00
Fred Fish eae8aa302e * symfile.c (INLINE_ADD_PSYMBOL): Remove ifdef.
(add_psymbol_to_list): Add an arg for passing CORE_ADDR values and
	use it, rather than calling add_psymbol_addr_to_list.
	(add_psymbol_addr_to_list): Delete.
	(add_psymbol_to_list): Make psymbol static to avoid random data in
	gaps due to alignment of structure members.
	* symfile.h (INLINE_ADD_PSYMBOL, ADD_PSYMBOL_TO_LIST,
 	ADD_PSYMBOL_ADDR_TO_LIST): Remove.  Real world tests show no
	performance improvements by inlining via complicated macros and
	they just make gdb larger and harder to maintain.
	* dwarfread.c (add_enum_psymbol): Replace ADD_PSYMBOL_TO_LIST
	and/or ADD_PSYMBOL_ADDR_TO_LIST macro(s) with call to
	add_psymbol_to_list with appropriate long or CORE_ADDR args.
	(add_partial_symbol): Ditto.
	* partial-stab.h: Ditto.
	* os9kread.c (read_os9k_psymtab): Ditto
	* mdebugread.c (parse_partial_symbols): Ditto.
	(handle_psymbol_enumerators): Ditto.
	(demangle.h): Include.
	* hpread.c (hpread_build_psymtabs): Ditto.
	(hpread_build_psymtabs): Ditto.
	(demangle.h): Include
1996-04-06 10:19:19 +00:00
Fred Fish 0708e99fc2 * dwarfread.c (add_partial_symbol): Use ADD_PSYMBOL_ADDR_TO_LIST
for CORE_ADDR values.
	(new_symbol): Use SYMBOL_VALUE_ADDRESS for CORE_ADDR values.
	* symfile.h (add_psymbol_{,addr}to_list): Add prototypes.
1996-02-19 20:46:43 +00:00
Fred Fish 4a1d2ce2ab * dwarfread.c (free_utypes): New function.
(read_file_scope): Call free_utypes as cleanup,	rather than just
 	freeing the utypes pointer.
1996-02-16 21:46:02 +00:00
Peter Schauer 255181a9ed * dwarfread.c (read_func_scope): Avoid GDB core dumps if
AT_name tag is missing.

	* procfs.c (procfs_stopped_by_watchpoint):  Fix logic when
	FLTWATCH and FLTKWATCH are defined.

	* remote.c (remote_read_bytes):  Advance memaddr for transfers,
	return number of bytes transferred for partial reads.

	* top.c (init_signals):  Reset SIGTRAP to SIG_DFL.
1996-02-03 11:32:34 +00:00
Jeff Law 436d414327 * buildsym.c (end_symtab): Remove sort_pending and sort_linevec
arguments.  Sorting is now dependent on OBJF_REORDERED.  All
        callers/references changed.
        * dbxread.c (read_ofile_symtab): Correctly determine value for
        last_source_start_addr for reordered executables.
        (process_one_symbol): Handle N_FUN with no name as an end of
        function marker.
        * partial-stab.h (case N_FN, N_TEXT): Don't assume CUR_SYMBOL_VALUE
        is the high text address for a psymtab.
        (case N_SO): Likewise.
        (case N_FUN): Handle N_FUN with no name as an end of function
        marker.
        * minsyms.c (lookup_minimal_symbol_by_pc): Examine all symbols
        at the same address rather than a random subset of them.
        * coffread.c (coff_symfile_init): Set OBJF_REORDERED.
        * elfread.c (elf_symfile_init): Similarly.
        * somread.c (som_symfile_init): Similarly.
        * xcoffread.c (xcoff_symfile_init): Similarly.

Support for debugging reordered executables.  Remaining mentor vm
changes.
1996-01-08 17:55:25 +00:00
Fred Fish 2dd30c722b * defs.h: Delete extraneous whitespace at end of file.
* symfile.h: Move #include of demangle.h outside conditional.
	* objfiles.h (struct objstats, OBJSTAT, OBJSTATS): New struct
	and macros to hold per-objfile statistics for internal instrumentation.
	(struct objfile): Add OBJSTATS member, which is optional.
	* buildsym.h (next_symbol_text_func): Now takes objfile argument.
	Also update copyright to 1995.
	* dbxread.c (dbx_next_symbol_text): Now takes objfile argument.
	(dbx_symfile_init, coffstab_build_psymtabs, elfstab_build_psymtabs,
	stabsect_build_psymtabs): Accumulate string table size.
	(dbx_next_symbol_text, read_dbx_symtab, read_ofile_symtab):
	Accumulate number of stabs symbols read.
	* dwarfread.c (new_symbol, symthesize_typedef):
	Accumulate number of full symbols created.
	* gdbtypes.c (alloc_type): Accumulate number of types.
	* maint.c (maintenance_print_statistics): New function.
	* mdebugread.c (mdebug_next_symbol_text): Now takes objfile argument.
	* minsyms.c (prim_record_minimal_symbol_and_info): Accumulate
	number of minimal symbols read.
	* os9kread.c (read_os9k_psymtab): next_symbol_text takes objfile arg.
	* partial-stab.h: next_symbol_text takes objfile arg.
	* stabsread.c (error_type, STABS_CONTINUE): Now takes objfile arg and
 	uses it to call next_symbol_text.
	* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
	Accumulate number of partial symbols created.
	* symfile.h (ADD_PSYMBOL_VT_TO_LIST): Accumulate number of partial
	symbols created.
	* symmisc.c (print_objfile_statistics): Print the per-objfile
	internal instrumentation statistics gathered.
	* xcoffread.c (xcoff_next_symbol_text): Now takes objfile argument.
1995-12-21 04:08:27 +00:00
Peter Schauer 09af586854 * alpha-tdep.c, mips-tdep.c (init_extra_frame_info):
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-10-21 13:14:53 +00:00
Stan Shebs 987622b523 * Makefile.in (CC-LD): Rename to CC_LD, so MPW xform works.
(MMALLOC_SRC): Define.
	(MMALLOC_CFLAGS): Use.
	(ser-mac.o): Add rule.
	* dwarfread.c, somread.c, ultra3-nat.c, xcoffread.c: Replace L_SET
 	with SEEK_SET in all calls to bfd_seek.
	* scm-tags.h (scm_tags): Remove excess comma.
1995-10-19 19:54:44 +00:00
Fred Fish 6c9638b444 Update FSF address. 1995-08-02 03:41:12 +00:00
J.T. Conklin 2b57629364 * configure.in: Check for working mmap, ansi headers, string.h,
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-08-01 20:14:27 +00:00
Peter Schauer bbcc95bdb1 * config/m68k/tm-m68kv4.h (DWARF_REG_TO_REGNUM): Define to
correctly map floating point registers numbers.

	* dwarfread.c (locval, new_symbol):  Handle variables that are
	optimized out.

	* mdebugread.c:  Replace all uses of builtin_type_* with
	mdebug_type_*. Define and initialize mdebug_type_*.

	* serial.h (serial_close):  Add additional argument `really_close'.
	(SERIAL_CLOSE):  Update serial_close call accordingly.
	(SERIAL_UN_FDOPEN):  Use serial_close to handle refcnt properly.
	* serial.c (serial_close):  Handle `really_close'.
	* serial.h (scb_base):  Moved to serial.c, made static.

	* valops.c (value_addr):  Don't coerce arrays.
	(typecmp):  Coerce arrays instead of calling value_addr if necessary.
1995-07-20 05:52:42 +00:00
Jim Kingdon f133a597e4 * dwarfread.c (struct dwfinfo), dbxread.c (struct symloc),
mdebugread.c (struct symloc), hpread.c (struct symloc): Fix error
	in 20 Apr 1995 cleanup of comments.
1995-05-13 21:00:17 +00:00
Jim Kingdon a367db8959 * rs6000-tdep.c (find_toc_address): Revise comment.
* symfile.c, symfile.h (init_psymbol_list): New function;
	consolidate duplicated copies from os9kread.c, dbxread.c
	and dwarfread.c.
	* defs.h: Declare info_verbose.
	* xcoffread.c: Extensive changes to support psymtabs.
1995-05-13 20:39:21 +00:00
Jim Kingdon 989d9cbac8 * dwarfread.c (struct dwfinfo), dbxread.c (struct symloc),
mdebugread.c (struct symloc), hpread.c (struct symloc): Clean
	up comments.
1995-04-21 13:19:22 +00:00
David Edelsohn 306d27ca4e * dwarfread.c (struct dieinfo): Use CORE_ADDR for at_{low,high}_pc.
(target_to_host): Change result type to CORE_ADDR.
1995-03-03 06:26:25 +00:00
Per Bothner 27202b6a47 * buildsym.c (finish_block): If finishing a function without known
parameter type info, set that from parameter symbols.
	* c-typeprint.c (c_type_print_varspec_suffix):  For TYPE_CODE_FUNC,
	print parameter types, if available.
	* ch-typeprint.c (chill_type_print_base):  Likewise.

	* gdbtypes.h (struct type):  Remove function type field.
	(TYPE_FUNCTION_TYPE):  Remove macro.  We can't as simply re-use
	function types now that we're also storing parameter types.
	And the payoff is much less.
	* gdbtypes.c (make_function_type):  Don't use/set TYPE_FUNCTION_TYPE.
	(recursive_dump_type):  Don't print TYPE_FUNCTION_TYPE.
	* dwarfread.c (read_subroutine_type):  Don't set TYPE_FUNCTION_TYPE.
1995-02-12 18:46:45 +00:00
Peter Schauer 84bdfea6aa * c-typeprint.c (c_type_print_base): Use `show' of -1 to print
the return type of methods to avoid infinite loops with anonymous
	types.
	* valops.c (search_struct_field):  Handle anonymous unions.

	* sparc-tdep.c (sunos4_skip_trampoline_code):  New function
	to correctly handle steps into -g compiled PIC objects in the
	main executable.
	* config/sparc/tm-sun4os4.h (SKIP_TRAMPOLINE_CODE):
	Redefine to use sunos4_skip_trampoline_code.

	* dwarfread.c (DWARF_REG_TO_REGNUM):  Provide a default mapping
	from DWARF to GDB register numbering.
	* dwarfread.c (locval):  Use DWARF_REG_TO_REGNUM to map the
	register value.
	* config/mips/tm-mipsv4.h (DWARF_REG_TO_REGNUM):  Define.
1994-12-17 10:46:32 +00:00
Ian Lance Taylor b8176214a5 * defs.h: If TARGET_BYTE_ORDER_SELECTABLE is defined by tm.h,
define TARGET_BYTE_ORDER as target_byte_order, and declare
	target_byte_order as an extern int, and define BITS_BIG_ENDIAN as
	a test of TARGET_BYTE_ORDER.
	* top.c: Several additions if TARGET_BYTE_ORDER_SELECTABLE is
	defined:
	(endianlist, target_byte_order): New variables.
	(set_endian, set_endian_big, set_endian_little): New functions.
	(show_endian): New function.
	(init_cmd_lists): Initialize endianlist.
	(init_main): Add commands ``set endian big'', ``set endian
	little'', and ``show endian''.
	* a29k-pinsn.c: Rewrite uses of TARGET_BYTE_ORDER and
	BITS_BIG_ENDIAN to switch at run time rather than at compile time.
	* coffread.c, dwarfread.c, findvar.c, mips-tdep.c: Likewise.
	* remote-os9k.c, stabsread.c, valarith.c, valprint.c: Likewise.
	* values.c: Likewise.
	* mips-tdep.c: Rewrite uses of GDB_TARGET_IS_MIPS64 to switch at
	run time rather than at compile time.
1994-10-06 16:47:32 +00:00
Stan Shebs 359301345a * dwarfread.c (bfd.h): Don't include. 1994-08-05 20:19:00 +00:00
Stan Shebs 8e3ff82354 * dbxread.c: Don't include libbfd.h.
* dwarfread.c, elfread.c somread.c: Don't include libbfd.h,
	<time.h>, or <sys/types.h>.
	* elfread.c (elf_symfile_read): Use only standard BFD functions to
	collect information about the stab and stab string sections.
1994-07-14 21:34:09 +00:00
Peter Schauer 8ce2cfc039 * dwarfread.c: Remove second inclusion of <sys/types.h>, which
causes problems if <sys/types.h> has no multiple inclusion protection.
1994-02-24 13:33:45 +00:00
Peter Schauer 4386eff2d1 * dwarfread.c (process_dies): Skip nested TAG_compile_unit DIEs.
* dwarfread.c (add_partial_symbol):  Do not enter opaque aggregate
	definitions into the psymtab.
1994-02-04 09:19:35 +00:00
Jim Kingdon 9fdb3f7aad * config/pa/tm-hppa.h: Define macro SMASH_TEXT_ADDRESS.
* elfread.c (record_minimal_symbol_and_info),
	dwarfread.c (process_dies), paread.c (pa_symtab_read): Use it.
1994-01-28 16:25:25 +00:00
Thomas Lord 199b2450f6 Change the stream argument to _filtered to GDB_FILE *.
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-11-01 22:25:23 +00:00
Jim Kingdon ddf5d7e82e * paread.c, coffread.c, elfread.c, dwarfread.c:
Include <time.h> and <sys/types.h> before libbfd.h.
1993-09-15 16:45:44 +00:00
Jim Kingdon 791e451394 * paread.c, coffread.c, elfread.c, dwarfread.c:
Include <time.h> before libbfd.h.
1993-09-14 23:26:43 +00:00
Jim Kingdon 996ccb3043 * symtab.c, symfile.c, c-exp.y, ch-exp.y, m2-exp.y, buildsym.c,
symfile.h, stabsread.c, minsyms.c, solib.c, nlmread.c, dwarfread.c
	partial-stab.h, symmisc.c, gdbtypes.c: Lint.  Remove (or put
	inside #if) unused variables and labels.  Fix unclosed comment.
	Deal with enumeration values unhandled in switch statements.  Make
	sure non-void functions return values.  Include appropriate
	headers.
	* dbxread.c (elfstab_build_psymtabs): Don't check for unsigned
	value < 0.
1993-09-02 01:41:40 +00:00
Jim Kingdon a1c8d76ef8 * frame.h, symtab.h, findvar.c (read_var_value): Change basereg
support to use LOC_BASEREG rather than SYMBOL_BASEREG_VALID.
	* dwarfread.c: Use LOC_BASEREG where appropriate.
	* Various: Support LOC_BASEREG and LOC_BASEREG_ARG.
1993-08-24 21:38:24 +00:00
Fred Fish f645e83516 * dwarfread.c (record_minimal_symbol): Remove prototype and
function.
	* dwarfread.c (add_partial_symbol):  Remove code to add minimal
	symbols and remove comment about limitations.  Experiments show
	that now that gdb handles the ELF symtab better for creating
	minimal symbols, that no additional information is added by
	examining the DWARF information, and in fact, given the
	limitations, the DWARF code was actually making things worse.
1993-08-08 17:14:06 +00:00
Fred Fish 379dd96582 * elfread.c (elf_symtab_read): Properly sort out the bss symbols
from the data symbols and give them the correct minimal_symbol_type.
	Add file static symbols to the minimal symbol table, not just
	global symbols.  Ignore symbols that are section names and file names.
	* dwarfread.c (add_partial_symbol):  Add comment about limitations
	of DWARF symbols for distinquishing data from bss when adding
	minimal symbols.  Add file local symbols to minimal symbols.
1993-08-07 20:27:19 +00:00
Jim Kingdon b2bebdb0f1 * gdbtypes.h (struct type): Add field tag_name.
* gdbtypes.c (type_name_no_tag), c-typeprint.c (c_type_print_base):
	Use it.
	* {coff,dwarf,mips,stabs}read.c: Set it.
1993-07-02 02:57:06 +00:00
Jim Kingdon 9745ba070f Doc fix re dependencies 1993-06-09 01:28:54 +00:00
Fred Fish c701c14c41 * {dbxread.c, dwarfread.c} (read_ofile_symtab): Rewrite to take
single parameter, the pointer to the partial symtab, rather than
	a bunch of args that are derived from the partial symtab.  Change
	prototypes and callers to match.
1993-05-31 00:21:41 +00:00
Fred Fish 5aefc1ca23 Remove chill sanitizations, which are no longer necessary. 1993-04-16 23:22:41 +00:00
Jim Kingdon 3c02636b4e * Clean up xcoff relocation.
objfiles.h (struct objfiles): Add section_offsets, num_sections.
	symfile.c (syms_from_objfile), xcoffread.c (xcoff_symfile_offsets):
	Set them.
	symtab.h (struct general_symbol_info): Add section field.
	minsyms.c (prim_record_minimal_symbol{,_and_info}): Set it.
	xcoffread.c: Set section for symbols and msymbols.
	(struct symtab): Add block_line_section field.
	buildsym.c (end_symtab): Set it.
	(end_symtab and callers): Add section parameter.
	objfiles.c (objfile_relocate): New funciton.
	xcoffexec.c (vmap_symtab): Use it.
	xcoffsolib.h (struct vmap): Remove unused fields.
	config/rs6000/tm-rs6000.h, stack.c, xcoffexec.c: Remove
	CORE_NEEDS_RELOCATION, symtab_relocated.
	config/rs6000/tm-rs6000.h: Remove use of loadinfotext.
	rs6000-tdep.c: Make loadinfotext static.
	breakpoint.c (fixup_breakpoints): Doc fix.
	symtab.h (struct symtab), config/rs6000/tm-rs6000.h, buildsym.c
	(end_symtab): primary field replaces nonreloc.
1993-03-26 14:59:43 +00:00
Fred Fish 45364c8a2a * c-exp.y (parse_number): Change high_bit to unsigned.
* demangle.c:  Change all references to cfront to ARM, since the
	actual algorithm is the one specified in the Annotated Reference
	Manual.  This was confusing users into thinking that full cfront
	support was implemented.
	* dwarfread.c (CFRONT_PRODUCER):  Remove, was never really used.
	* eval.c (evaluate_subexp):  For STRUCTOP_PTR pass the arg type
	directly to lookup_struct_elt_type, which will do the
	dereferencing itself.
	* gdbtypes.c (lookup_struct_elt_type):  Expand comments.  Fix
	NULL dereferencing bug for unnamed structs, comment out
	questionable code.
1993-03-03 02:09:02 +00:00
Fred Fish b6236d6ec4 * ch-lang.c (chill_create_fundamental_type): Track compiler
change that now emits debugging info with the type long for Chill
	longs.
	* dwarfread.c (read_tag_string_type):  Rewrite to allow forward
	references of TAG_string_type DIEs in user defined types.
1993-02-23 19:30:22 +00:00
Fred Fish ec16f7015b * c-exp.y (exp): Add production to support direct creation
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-19 23:00:19 +00:00
Fred Fish 7532cf103a * tm-sun4sol2.h (CPLUS_MARKER): Remove, now set in tm-sysv4.h.
* tm-sysv4.h (CPLUS_MARKER):  By default, g++ uses '.' as the
	CPLUS_MARKER for all SVR4 systems, so follow suit.
	* defs.h (strdup_demangled):  Remove prototype.
	* dwarfread.c (enum_type, synthesize_typedef):  Use new macro
	SYMBOL_INIT_LANGUAGE_SPECIFIC.
	* dwarfread.c (new_symbol):  Use SYMBOL_INIT_DEMANGLED_NAME.
	* minsyms.c (install_minimal_symbols, prim_record_minimal_symbol,
	prim_record_minimal_symbol_and_info):  Use new macro
	SYMBOL_INIT_LANGUAGE_SPECIFIC.
	* minsyms.c (install_minimal_symbols):  Use new macro
	SYMBOL_INIT_DEMANGLED_NAME.
	* stabsread.c (define_symbol):  Use new macro
	SYMBOL_INIT_DEMANGLED_NAME.
	* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
	Use new macro SYMBOL_INIT_DEMANGLED_NAME.
	* symfile.h (ADD_PSYMBOL_VT_TO_LIST):  Use new macro
	SYMBOL_INIT_DEMANGLED_NAME.
	* symmisc.c (dump_msymbols, dump_symtab, print_partial_symbol):
	SYMBOL_DEMANGLED_NAME now tests language itself.
	* symtab.c (COMPLETION_LIST_ADD_SYMBOL):  SYMBOL_DEMANGLED_NAME
	now tests language itself.
	* symtab.h (SYMBOL_CPLUS_DEMANGLED_NAME):  New macro that does
	what SYMBOL_DEMANGLED_NAME used to do, directly access the C++
	mangled name member in the language dependent portion of a symbol.
	* symtab.h (SYMBOL_DEMANGLED_NAME):  New macro that returns the
	mangled name member appropriate for a symbol's language.
	* symtab.h (SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME,
	SYMBOL_MATCHES_NAME, SYMBOL_MATCHES_REGEXP):
	SYMBOL_DEMANGLED_NAME now tests language itself.
	* symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC):  New macro that
	initializes language dependent portion of symbol.
	* symtab.h (SYMBOL_INIT_DEMANGLED_NAME):  New macro that
	demangles and caches the demangled form of symbol names.
	* utils.c (fputs_demangled, fprint_symbol):  Use current language
	to select an appropriate demangling algorithm.
	* utils.c (strdup_demangled):  Remove, no longer used.
	**** start-sanitize-chill ****
	* symtab.h (SYMBOL_CHILL_DEMANGLED_NAME):  New macro that directly
	access the Chill mangled name member in the language dependent
	portion of a symbol.
	* ch-lang.c (chill_demangle):  New function, simple demangler.
	* defs.h (chill_demangle):  Add prototype.
	* symtab.h (language_dependent_info):  Add struct for Chill.
	**** end-sanitize-chill ****
1993-01-01 20:29:41 +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 51b80b0072 * complaints.c: New file, code moved from utils.c.
* complaints.c (complain):  Made into a varargs function.
	* complaints.h:  New file, code moved from symfile.h.
	* Makefile.in (SFILES_MAINDIR):  Add complaints.c.
	* Makefile.in (HFILES):  Add complaints.h.
	* Makefile.in (OBS):  Add complaints.o.
	* symfile.c (complaint_root, stop_whining, complaint_series,
	complain, clear_complaints, add_show_from_set for stop_whining):
	Moved to complaints.c.
	* symfile.h (struct complaint, complaint_root decl, complain
	prototype, clear_complaints prototype):  Moved to complaints.h.
	* buildsym.c, coffread.c, dbxread.c, dwarfread.c, elfread.c,
	gdbtypes.c, mipsread.c, stbsread.c, symfile.c:  Include
	complaints.h.  Remove casts from arguments to complain(),
	which is now a varargs function, and remove unnecessary
	placeholder zero args.
	* defs.h (begin_line):  Add prototype.
	* defs.h (vprintf_filtered):  Add prototype.
	* dwarfread.c (varargs.h):  Remove, no longer needed.
	* dwarfread.c (dwarfwarn):  Remove prototype and function.
	* dwarfread.c (complaints):  Define a bunch of complaints.
	* dwarfread.c (SQUAWK):  Remove macro defs, convert all
	usages to standard complain() calls.
	* utils.c (begin_line):  New function that ensures that
	whatever gets filter-printed next starts on its own line.
	* utils.c (vprintf_filtered):  New func, like vfprintf_filtered,
	but to stdout (calls vfprintf_filtered internally).
1992-12-15 12:18:53 +00:00
Fred Fish 85f0a8484f * gdbtypes.c (create_array_type): Complete rewrite. Now requires
a optional type to decorate as an array type, the type of the
	index, and the bounds of the array.  Records this additional info
	in the array type for use with languages with nonzero array
	bounds.
	* gdbtypes.h (enum type_code):  Update comment for TYPE_CODE_ARRAY
	to note that arrays may have bounds.
	* gdbtypes.h (create_array_type):  Update prototype.
	* c-exp.y (ptype production):  Adjust for new create_array_type
	calling conventions.
	* coffread.c (decode_type):  Call create_array_type rather than
	handcrafting array types.
	* convex-tdep.c (value_type):  Remove, now use create_array_type.
	* convex-tdep.c (value_of_trapped_internalvar):  Convert calls to
	vector_type into calls to create_array_type.
	* dwarfread.c (decode_subscr_data):  Name changed to
	decode_subscript_data_item throughout.
	* dwarfread.c (decode_subscript_data_item):  Rewrite to use
	create_array_type.  Now records index type and range as well.
	* dwarfread.c (dwarf_read_array_type):  Rewrite as part of
	change to use create_array_type.
	* dwarfread.c (read_subroutine_type):  Test existing user defined
	types before decorating them, to ensure they are blank, and
	complain about it if they are not.
	* dwarfread.c (decode_fund_type):  For unrecognized types, always
	return some valid type (type integer).  If the unrecognized type
	cannot be an implementation defined type, complain as well.
	* m88k-tdep.c (pushed_size):  Update comment for TYPE_CODE_ARRAY.
	* m88k-tdep.c (store_param):  Update comment for TYPE_CODE_ARRAY.
	* mipsread.c (upgrade_type):  Add FIXME comment that code to
	handcraft arrays should be replaced with call to create_array_type.
	* stabsread.c (read_array_type):  Replace code to handcraft
	array types with call to create_array_type.
	* valprint.c (type_print_varspec_prefix):  Minor formatting
	change, join lines that don't need to be split.
1992-12-15 02:52:11 +00:00
Fred Fish 160be0ded9 Changes for Amiga Unix from rhealey@ub.d.umn.edu.
* config/amix.mh (NAT_FILE):  Add, set to nm-sysv4.h.
	* config/amix.mh (NATDEPFILES):  Add.
	* config/amix.mh (XDEPFILES):  Move procfs.o and fork-child.o
	to NATDEPFILES.

	* dwarfread.c (decode_subscr_data):  Remove spurious test that
	accepted only integer subscript types.  We don't do anything
	with the type at the moment anyway.
1992-12-08 21:47:49 +00:00
Fred Fish bf229b4ea5 * c-exp.y (c_create_fundamental_type): New function to create
language specific fundamental types for C.
	* m2-exp.y (m2_create_fundamental_type):  New function to create
	language specific fundamental types for Modula 2.
	* c-exp.y (c_language_defn, cplus_language_defn):  Add
	c_create_fundamental_type to language struct initializers.
	* m2-exp.y (m2_language_defn):  Add m2_create_fundamental_type
	to language struct initializers.
	* dwarfread.c (expression.h, language.h):  Include.
	* dwarfread.c (ftypes):  New array to hold fundamental types
	for current compilation unit.
	* dwarfread.c (cu_language_defn):  New pointer to language
	struct for language of current compilation unit.
	* dwarfread.c (dwarf_fundamental_type):  New function to
	create/lookup fundamental types.
	* dwarfread.c (set_cu_language):  Initialize cu_language_defn.
	* dwarfread.c (throughout):  Replace lookup_fundamental_type
	with dwarf_fundamental_type.
	* dwarfread.c (read_file_scope):  Zero out ftypes for each new
	compilation unit (may be different language or different objfile).
	* gdbtypes.c (lookup_fundamental_type):  Move actual type
	creations into language specific fundamental type creation
	functions and call via create_fundamental_type.  Add comment
	about this function being obsolescent.
	* gdbtypes.h (FT_BYTE, FT_UNSIGNED_BYTE):  New types, true byte
	sized signed and unsigned integers.
	* gdbtypes.h (FT_NUM_MEMBERS):  Increment, new types added.
	* language.c (language_def):  New function to lookup a language
	struct given it's enumeration.
	* language.h (struct language_defn):  Add la_fund_type, a pointer
	to a function that creates fundamental types for this language.
	* language.h (create_fundamental_type):  New macro to create
	fundamental types based on the current language.
	* language.h (language_def):  Add prototype.
	* language.c (unk_lang_create_fundamental_type):  New function
	for initializing language structs, calls error if called.
	* language.c (unk_language_defn, auto_language_defn,
	local_language_defn):  Use unk_lang_create_fundamental_type.
	**** start-sanitize-chill ****
	ch-exp.y (chill_create_fundamental_type):  New function.
	ch-exp.y (chill_language_defn):  Add chill_create_fundamental_type.
	ch-exp.y (_initialize_chill_exp):  BOOL types are only one byte.
	**** end-sanitize-chill ****
1992-12-03 20:28:16 +00:00
Fred Fish 93bb6e655c * dwarfread.c (CHILL_PRODUCER): Add producer string for
GNU chill.
	* dwarfread.c (handle_producer):  Test CHILL_PRODUCER as well
	as GCC_PRODUCER and GPLUS_PRODUCER.
1992-12-02 01:10:49 +00:00
Fred Fish 19cfe25d90 First cut at sanitizing away the chill stuff. 1992-11-16 19:25: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
Stu Grossman 603900c746 * Makefile.in (HFILES): Add nm-i386sco.h.
* dwarfread.c:  include <sys/types.h> for SCO.
* infptrace.c:  Don't include ptrace.h under SCO.
* config/i386sco.mh:  Use -D_POSIX_SOURCE instead of -posix for
gcc.
* config/i386v.mt:  Add exec.o to TDEPFILES.
1992-10-22 08:07:12 +00:00
John Gilmore d5931d797d Lint around file_ptr's (bfd's off_t's) and bfd_seek.
* dbxread.c (read_dbx_symtab):  Use L_SET as bfd_seek arg.
(elfstab_build_psymtabs):  staboffset and stabstroffset args are
file_ptr's.
* dwarfread.c (struct dwfinfo):  Convert dbfoff, lnfoff to file_ptr.
(scan_compilation_units):  Punt unused filename arg.  dbfoff,
lnoffset, and curlnoffset are file_ptr's now.
(dwarf_build_psymtabs):  Drop desc and filename args; use
objfile.  dbfoff and lnoffset are file_ptr's now.
(read_ofile_symtab):  foffset is now file_ptr.  Use L_SET in bfd_seek.
* elfread.c (struct elfinfo):  dboffset and lnoffset are file_ptr's.
(elf_symfile_read):  Skip desc and filename args to
dwarf_build_psymtabs.  Pass file_ptr's to elfstab_build_psymtabs.
* gdb-stabs.h:  Use file_ptr rather than off_t.
* mipsread.c (fixup_symtab): f_ptr is a file_ptr.  Re-enable
compile-time debug check that someone turned off as "unused".
(read_the_mips_symtab):  st_filptr is a file_ptr.  Fix bfd_seek call.
* symfile.h:  Update dwarf_build_psymtabs and
elfstab_build_psymtabs prototypes.
* xcoffread.c (init_stringtab, init_lineno, xcoff_symfile_read):
Use file_ptr offsets.  bfd_seeks use L_SET.
1992-10-15 13:40:40 +00:00
Fred Fish 4090fe1c2b * dwarfread.c (dbsize): New variable to hold size of dwarf info.
* dwarfread.c (dwarf_build_psymtabs):  Rename dbsize parameter to
	dbfsize and use it to initialize new local file scope dbsize.
	* dwarfread.c (read_ofile_symtab):  Initialize dbsize and use it.
	* dwarfread.c (basicdieinfo):  Use dbsize to check for oversize
	DIEs as well as the current check for undersize DIEs.  This helps
	to gracefully detect and reject corrupted DIE information.
1992-10-01 17:33:21 +00:00
Fred Fish 95ff889ecd * dwarfread.c (cu_language): New local variable to record
language for current compilation unit being processed.
	* dwarfread.c (set_cu_language):  New local function to decode
	and record language for current compilation unit being processed.
	* dwarfread.c (synthesize_typedef):  Add local function to
	synthesize a typedef for C++ classes, structs, unions, and
	enumerations.
	* dwarfread.c (read_structure_scope):  Synthesize typedefs
	for C++ classes, structs and unions.
	* dwarfread.c (read_enumeration):  Synthesize typedefs for
	C++ enumerations.
	* dwarfread.c (read_file_scope):   Call set_cu_language to
	record language for current compilation unit.  After symtab
	is built, save this recorded language.
	* dwarfread.c (process_dies, add_partial_symbol, struct_type,
	scan_partial_symbols, new_symbol):  Recognize TAG_class_type.
	* dwarfread.c (add_partial_symbol):  Synthesize partial symbol
	typedefs for C++ classes, structs, unions, and enumerations.
	* dwarfread.c (scan_compilation_units):  Call set_cu_language
	to record language for current compilation unit.
	* dwarfread.c (scan_partial_symbols):  Call add_enum_psymbol here
	for TAG_enumeration_types, rather than in add_partial_symbol.
	* dwarfread.c (add_partial_symbol):  Combine TAG_enumeration_type
	case with class, struct, and union type cases, now that they are
	the same.  Remove tests for non-NULL name attributes, now done
	by callers.
	* gdbtypes.h (TYPE_CODE_CLASS):  Add type for C++ classes, but
	treat as alias for TYPE_CODE_STRUCT for now.
1992-08-31 20:50:45 +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 3dc755fb81 * cplus-dem.c (cplus_markers): Add table for gnu style and
use throughout, in place of compile time constant CPLUS_MARKER.
	* cplus-dem.c (ARM_VTABLE_STRING, ARM_VTABLE_STRLEN):  Add.
	* cplus-dem.c (cfront_special):  New function, as suggested
	by pfieland@stratus.com.
	* cplus-dem.c (forget_types):  New function.
	* cplus-dem.c (cplus_demangle):  Call gnu_special, moved from
	demangle_prefix().
	* cplus-dem.c (mop_up):  Call forget_types().
	* cplus-dem.c (AUTO_DEMANGLING, GNU_DEMANGLING, LUCID_DEMANGLING):
	Use throughout, instead of checking current_demangling_style.
	* cplus-dem.c (demangle_signature):  When finding an explicit
	start of function args, forget all remembered types for
	lucid/cfront style demangling.
	* cplus-dem.c (demangle_prefix):  In a sequence of two or more
	underbar characters, use last pair as the delimiter.  Hoist
	gnu_special() call up to cplus_demangle().  Call cfront_special()
	when appropriate.
	* cplus-dem.c (cplus_special):  Fix virtual table name demangling
	for inherited classes.
	* cplus-dem.c (demangle_args):  Document quirks of numbered
	references to previously seen types.
	* dbxread.c (read_ofile_symtab, process_one_symbol):
	Use AUTO_DEMANGLING rather than explicitly checking
	current_demangling_style.
	* demangle.h:  Add some comments.
	* demangle.h (AUTO_DEMANGLING, GNU_DEMANGLING, LUCID_DEMANGLING,
	CFRONT_DEMANGLING):  New macros.
	* dwarfread.c (LCC_PRODUCER):  Remove trailing space, which is
	not found in the actual producer string produced by lcc.
	* dwarfread.c (handle_producer):  Use AUTO_DEMANGLING rather
	than explicitly checking current_demangling_style.
1992-08-14 19:14:15 +00:00
Fred Fish 7b5d965008 * buildsym.c (end_symtab): Document that end_symtab can return
NULL under non-error conditions.
 	* dwarfread.c (read_file_scope):  Guard against dereferencing NULL
 	returned from end_symtab for empty compilation units.
1992-08-12 18:17:48 +00:00
Fred Fish a679650f37 * Makefile.in (VERSION): Bump to 4.6.3.
* dwarfread.c (scan_partial_symbols):  Skip over DIE's within
	function scopes when building partial symbol tables.
	* objfiles.c (open_existing_mapped_file):  Make it clear in
	warning message that out of date mapped files are ignored.
	* symtab.c (lookup_symtab_1, lookup_symbol):  Print compilation
	unit source file name in error message.
1992-08-11 05:29:41 +00:00
Fred Fish 50055e94a1 * dwarfread.c (struct dieinfo): Add has_at_byte_size.
* dwarfread.c (struct_type):  In absence of AT_byte_size for
	bitfield, use size of object of member's type for the size of
	the anonymous object containing the bit field.
	* dwarfread.c (completedieinfo):  Set has_at_byte_size when
	an AT_byte_size attribute is seen.
	* mipsread.c (psymtab_to_symtab_1):  Fix misspelled cast to
	union aux_ext (was aux_ent).
	* i386-pinsn.c (print_insn):  Cast 2'nd arg to read_memory from
	unsigned char* to char*, for Lucid compiler.
	* i386-tdep.c (codestream_fill):  Fix cast of 2'nd arg to read_memory
	to be correct type (from unsigned char* to char*).
	* valprint.c (type_print_derivation_info):  Minor tweak to placement
	of commas in derived class printing.
	* xcoffread.c (builtin_type):  Fix misspelling in fatal message.
1992-08-09 06:14:59 +00:00
Fred Fish cd46ffad4e * dwarfread.c (struct dieinfo): Remove obsolete at_visibility,
at_import, at_frame_base.
	* dwarfread.c (completedieinfo):  Remove cases for obsolete
	AT_visibility, AT_import, and AT_frame_base attributes.
	* breakpoint.h (BREAKPOINT_MAX):  Increase from 10 to 16 for
	i860, which can keep up to 4 shadow breakpoints.
	* tm-stratus.h (USG):  Define.
	* tm-stratus.h (TARGET_BYTE_ORDER):  Define to BIG_ENDIAN.
	* xm-stratus.h (HOST_BYTE_ORDER):  Define to BIG_ENDIAN.
	* xm-stratus.h (xm-sysv4.h):  Include, name changed from xm-svr4.h.
	* xm-stratus.h (NO_JOB_CONTROL):  Remove define.
	* config/stratus.mt (TDEPFILES):  Include files available from
	stratus that are not yet in release pending receipt of paperwork
	at FSF.
	* buildsym.c (finish_block):  Minor code format change.
	* gdbtypes.h (struct field):  Add to comments.
	* gdbtypes.h (virtual_field_bits):  Add to comments.
	* objfiles.c (allocate_objfile):  Change obstack interface to
	match FSF merging efforts.
1992-08-01 20:40:59 +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 d4902ab0a7 * dwarfread.c (read_file_scope): Pass contents of AT_comp_dir
to start_symtab as the directory name.
	* dwarfread.c (completedieinfo):  Strip off any leading hostname
	portion of the AT_comp_dir attribute string.  Gdb doesn't know
	what to do with them (FIXME).
1992-07-17 17:16:26 +00:00
Fred Fish 345e9ab8dc Change LCC_PRODUCER string to match current NCR lcc AT_producer. Update
energize-patches to work when configured with -srcdir=.
1992-07-16 19:12:49 +00:00
Fred Fish d23639b2ec * dbxread.c, dwarfread.c: Re-enable experimental code to
automatically select demangling style.
	* demangle.c (DEFAULT_DEMANGLING_STYLE):  Rename from simply
	DEMANGLING_STYLE, to make more descriptive.  Revert back to
	"auto" as default.  Comment use.
	* Makefile.in (DEMANGLING_STYLE, DEMANGLE_OPTS):  Remove.
	* Makefile.in (${DEMANGLER}.o) Remove target and special
	compilation rule.
1992-07-15 19:33:21 +00:00
Fred Fish 2dbde378c4 * Makefile.in (DEMANGLING_STYLE): New define to set default
demangling style for C++.  Defaults to "auto".
	* Makefile.in (DEMANGLE_OPTS):  Use DEMANGLING_STYLE.
	* Makefile.in (SFILES_MAINDIR):  Add demangle.c
	* Makefile.in (OBS):  Add demangle.o
	* cplus-dem.c (GNU_DEMANGLING, ARM_DEMANGLING, LUCID_DEMANGLING):
	Remove compile time decisions about demangling style and replace
	with runtime decisions using current_demangling_style.
	* cplus-dem.c (main):  Expand code included during building of
	standalone demangler to recognize demangling style options.
	* dbxread.c (demangle.h):  Include.
	* dbxread.c (read_ofile_symtab, process_one_symbol):  Set GNU C++
	demangling style if processing g++ code and current demangling style
	is auto (Note: this feature currently disabled.)
	* demangle.c:  New file, generic demangling control.
	* demangle.h (demangling_styles):  New enumeration to select one
	of several demangling styles.  Also define string names for each
	style.
	* demangle.h (set_demangling_style):  Add prototype.
	* dwarfread.c (demangle.h):  Include.
	* dwarfread.c (GPLUS_PRODUCER, LCC_PRODUCER, CFRONT_PRODUCER):
	New producer string prefixes to recognize.
	* dwarfread.c (handle_producer):  Consolidate actions for specific
	producers.  Set demangling style based on producer string if
	current style is auto.  (Note: this feature currently disabled.)
	* config/ncr3000.mt (DEMANGLE_OPTS):  Remove.
1992-07-14 02:13:12 +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
John Gilmore 2670f34d21 Relocate symbols using an array of section_offsets, rather than a
single `addr' or `offset'.  This makes Solaris-2 support work, and
permits better VxWorks (and maybe xcoff) support later.  See ChangeLog.
1992-07-04 13:59:03 +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 0efe20a642 * command.c (add_abbrev_prefix_cmd): Fix misspelling in comment.
* dwarfread.c (enum_type):  Fix misspelling in comment.
	* valprint.c (val_print_fields, cplus_val_print):  Minor
	adjustment to printing of C++ class structures to more closely
	match format for printing C structures, with and without setting
	pretty print.
1992-06-23 03:33:47 +00:00
Fred Fish 1c92ca6f3b * dwarfread.c (decode_modified_type): Change type of first arg.
Change 'modifier' to char from unsigned char.  Cast single use
that needs to be unsigned char.
* symtab.h (SYMBOL_BASEREG_VALID):  Explain disabling.
* utils.c (strdup_demangled):  Add function.
* defs.h (strdup_demangled):  Add prototype.
* stack.c (return_command):  Demangle C++ function names for query.
* infcmd.c (jump_command):  Demangle C++ function names for query.
* cplus-dem.c (consume_count):  New function and prototype.
* cplus-dem.c (demangle_class, gnu_special, demangle_func_type,
do_type):  Replace conversion code with consume_count().
* cplus-dem.c (gnu_special):  Fix demangled of static members.
* source.c (list_command):  Print demangled function names
when appropriate.  Fix supplied by Peter Schauer.
1992-06-15 14:26:57 +00:00
Fred Fish 6c316cfd66 * inflow.c (new_tty): Temporarily ignore SIGTTOU when
disconnecting from controlling terminal, to avoid gdb hanging
	on SVR4.  Fixes bug reported by Oliver Okrongli.
	* procfs.c (PROC_NAME_FMT):  Change format to match default used
	by system, as suggested by Oliver Okrongli.
	* tm-68k.h (FRAME_FIND_SAVED_REGS):  Apply missing parentheses
	bug fix from Brent Townshend (bst%tt@cam.ORG).
	* c-exp.y (nonempty_typelist):  Fix memory overrun bug reported
	by turlais@rechser.total.fr.
	* dwarfread.c (decode_subscr_data):  Fix bug in calculation of
	length of non-zero lowerbound arrays.  Bug fix from Peggy Fieland.
	* objfiles.h (unlink_objfile):  Add prototype.
	* objfiles.c (unlink_objfile):  Add function.
	* objfiles.c (free_objfile):  Call unlink_objfile.
	* objfiles.c (allocate_objfile):  Call unlink_objfile on newly
	remapped objfiles.  Bug reported by hahn@sunshine.labs.tek.com.
	Also, discard old possibly bogus sf struct.
	* symfile.c (symbol_file_add):  Call init_entry_point_info() and
	find_sym_fns() for remapped symbol files, in case of any changes
	since the last mapping.
1992-05-17 23:54:32 +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 2d6d969c61 Fix to dwarfread.c to target pointer and target long sizes, fixes for
mapped symbol file handling, and a couple of other misc small fixes.
1992-04-17 02:59:43 +00:00
Fred Fish 13b5a7ff3e Extensive changes to replace swapin() function with target_to_host()
and fix all usages to be independent of host/target integer size
mismatches.  However, cross debugging will still not work until the
sign extension issue is resolved either by fixing the bfd library
or implementing sign extension in the gdb code.
1992-04-14 04:09:00 +00:00
Fred Fish 95967e7379 Add swapin() function, and SWAPIN macro that calls it, to do byte swapping
copies using appropriate bfd routines.
1992-04-11 06:27:53 +00:00
John Gilmore 84ffdec2cb Create and use macros for iterating on symtabs, psymtabs, msymbols.
* minsyms.c (iterate_over_msymbols):  Remove; clunky and slow.
* symfile.h, symtab.h (iterate_over_msymbols):  Remove prototype
* coffread.c (coff_symfile_read):  iterate_over_symtabs => ALL_SYMTABS.
(patch_opaque_types):  Avoid dummy args and result.
* objfiles.c (have_partial_symbols, have_full_symbols,
have_minimal_symbols):  explicit iteration => ALL_OBJFILES; simplify.
(iterate_over_objfiles, iterate_over_symtabs,
iterate_over_psymtabs):  Remove, clunky and slow.
* objfiles.h:  Replace iterate_over_* prototypes with ALL_SYMTABS,
ALL_PSYMTABS, and ALL_MSYMBOLS macros.
* symmisc.c (dump_symtab, dump_psymtab, dump_msymbols,
dump_objfile):  Remove dummy args and results.  Move filename
comparisons to callers.
(printsyms_command, printpsyms_command, printmsyms_command,
printobjfiles_command):  iterate_over_* => ALL_*.  Compare filenames.
* symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab,
lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info,
list_symbols, make_symbol_completion_list):  Replace explicit
iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS.
Eliminate Dijkstra flag crap, break out of loops with gotos.
(lookup_symtab_1):  Protect '/' tests from short filenames.
(cplus_mangled_symbol):  Move inline into lookup_symbol.
* xcoffexec.c (relocate_objfile_msymbols):  Remove poor hack.
(relocate_minimal_symbol):  Move inline to vmap_symtab.
(vmap_symtab):  Replace iteration with ALL_OBJFILES,
iterate_over_msymbols with ALL_MSYMBOLS.

Misc cleanup prior to release.

* dwarfread.c (dwarf_build_psymtabs):  Remove mainline test.
* mipsread.c (compare_symtabs, compare_psymtabs):  Remove, unused.
* mipsread.c:  Add prototypes for all static functions.

* symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab,
dump_blockvector, dump_block, dump_addrchass, dump_namespace,
dump_symbol, dump_type, dump_linetable, dump_strtbl):  Remove, unused.
* xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab,
dump_blockvector, dump_block, dump_addrchass, dump_namespace,
dump_symbol, dump_type, dump_linetable, dump_strtbl):  Remove 2nd
unused copy!

* buildsym.c (define_symbol):  Handle global register variables
(from Pierre Willard).  Complain if register numbers are too large.
1992-03-29 23:17:36 +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
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
Fred Fish 9e4c1921e5 Add code to handle TAG_pointer_type DIE's (DWARF Information Entries)
that are produced by the i486/SVR4 MetaWare compiler, but not by the
AT&T or GCC compilers.
1992-02-17 23:26:54 +00:00
Fred Fish af21362450 When creating user defined types for subroutine and array types, check
first to see if a partial type already exists due to a forward reference,
and if so, bash it to fit.
1992-02-17 15:23:05 +00:00
Fred Fish 99140c31fe The list_in_scope pointer needs to be initialized to point to a
valid scope.  Use the file scope as the initial scope.
1992-01-24 06:32:43 +00:00
Fred Fish a5bd5ba617 Changes to fix bug with static variables within function scopes. 1992-01-15 06:42:32 +00:00
Fred Fish 4d315a071a Many changes to convert over to generic symbol table reading code in
buildsym.c   (second cvs ci attempt)
1992-01-11 01:41:23 +00:00
Per Bothner a3723a4352 Missed some stuff last time.
Also, recognize constructors specially in gdb_mangle_name().
1991-12-28 19:37:55 +00:00
Fred Fish b440b1e9e4 Various changes to clean up ADD_PSYMBOL_TO_LIST and ADD_PSYMBOL_ADDR_TO_LIST
usages.
1991-12-27 03:55:12 +00:00
Per Bothner 7e258d18e0 Oodles of changes. The most important is adding support for stabs
encapsulated in mips ecoff.  See ChangeLog for the gory details.
1991-12-23 23:16:58 +00:00
Fred Fish f8b76e70b7 Numerous small changes and a complete reorganization of solib.c, to support
SVR4 shared libraries in a manner very close to the original SunOS support.
See the ChangeLog for details.
1991-12-16 20:57:28 +00:00