Commit Graph

329 Commits

Author SHA1 Message Date
Elena Zannoni 6a34fd2fd5 2001-11-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (set_namestring): New function, replacing the
	SET_NAMESTRING macro.
	(SET_NAMESTRING, CUR_SYMBOL_TYPE, CUR_SYMBOL_VALUE,
	CUR_SYMBOL_STRX, DBXREAD_ONLY, START_PSYMTAB, END_PSYMTAB): Delete
	definitions.
	(read_dbx_symtab): Don't include partial-stab.h any more. Don't
	reuse code in partial-stab.h, include the code directly, instead.

        * Makefile.in (dbxread.o): Remove dependency on partial-stab.h.
	(HFILES_NO_SRCDIR): Remove partial-stab.h.
2001-11-08 04:39:04 +00:00
Fred Fish 4dc13854e5 2001-11-06 Fred Fish <fnf@redhat.com>
* complaints.c (info_verbose): Remove unneeded decl, is in defs.h.
	* dbxread.c: Ditto
	* dwarf2read.c: Ditto.
	* dwarfread.c: Ditto.
	* exec.c: Ditto.
	* hpread.c: Ditto.
	* hpread.h: Ditto.
	* mdebugread.c: Ditto.
	* os9kread.c: Ditto.
	* stack.c: Ditto.
	* symfile.c: Ditto.
	* tracepoint.c: Ditto.
2001-11-06 23:38:15 +00:00
Jim Blandy 3973eaddf4 Isolate STABS readers' use of the `textlow' and `texthigh' fields
of `struct partial_symtab' to only a few locations.  This change
is not supposed to affect the way the values are computed, only
where they live.

* dbxread.c (struct symloc): Add `textlow' and `texthigh' fields
to the reader-specific structure.
* mdebugread.c (struct symloc): Same.
* dbxread.c (TEXTLOW, TEXTHIGH): New accessor macros.
* mdebugread.c (TEXTLOW, TEXTHIGH): Same.
* dbxread.c (dbx_symfile_read): After we've built all our partial
symbol tables, set each partial symtab's `textlow' and `texthigh'
fields from our reader-specific structure.
* mdebugread.c (mdebug_build_psymtabs): Same.
* dbxread.c (start_psymtab): Initialize the reader-specific
structure's `textlow' and `texthigh' from the new psymtab's.
* mdebugread.c (parse_partial_symbols, new_psymtab): Same.
* dbxread.c (read_dbx_symtab, end_psymtab, read_ofile_symtab): Use
the reader-specific `textlow' and `texthigh', not the generic
psymtab fields.
* mdebugread.c (parse_lines, parse_partial_symbols,
psymtab_to_symtab_1): Same.
* partial-stab.h: Same.
2001-10-24 17:10:18 +00:00
Alan Modra 3a42e9d062 * coffread.c: Replace all occurrences of bfd_read with bfd_bread.
* dbxread.c: Likewise.
	* dwarf2read.c: Likewise.
	* dwarfread.c: Likewise.
	* somread.c: Likewise.
	* ultra3-nat.c: Likewise.
	* xcoffread.c: Likewise.
2001-09-20 03:03:40 +00:00
Kevin Buettner 9a058a09a9 Don't use error result from find_stab_function_addr(). 2001-09-06 20:50:48 +00:00
Elena Zannoni d3d55eeb77 2001-09-04 Elena Zannoni <ezannoni@redhat.com>
From Daniel Jacobowitz  <drow@mvista.com>
	* dbxread.c (free_header_files): Make global.
	(init_header_files): Likewise.
	* stabsread.h (free_header_files): Add prototype.
	(init_header_files): Likewise.
	* mdebugread.c (mdebug_build_psymtabs): Initialize
	properly before using the stabs debug reader.
2001-09-05 02:54:15 +00:00
Elena Zannoni ef96bde82e 2001-09-04 Elena Zannoni <ezannoni@redhat.com>
From Daniel Jacobowitz  <drow@mvista.com>
	* dbxread.c (dbx_symfile_read): Only reinitialize
	the psymbol list if mainline or if both static
	and global lists are empty.
	* dwarf2read.c (dwarf2_build_psymtabs): Likewise.
	* dwarfread.c (dwarf_build_psymtabs): Likewise.
	* xcoffread.c (xcoff_initial_scan): Likewise.
	* os9kread.c (os9k_symfile_read): Likewise.
2001-09-05 02:13:11 +00:00
H.J. Lu 40b3352ba7 2001-08-14 Daniel Jacobowitz <drow@mvista.com>
H.J. Lu  (hjl@gnu.org)

	* partial-stab.h: valu should be a CORE_ADDR.

2001-08-14  H.J. Lu  (hjl@gnu.org)

	* dbxread.c (SWAP_SYMBOL): Removed.
	(INTERNALIZE_SYMBOL): Check sign extended vma.
2001-08-15 05:02:28 +00:00
Andrew Cagney 51cc5b0737 * symtab.c (main_name): New function.
(set_main_name): New function.
* symtab.h: Declare.
* TODO: Update

From 2000-03-05 Anthony Green <green@redhat.com>:
* dbxread.c (process_one_symbol): Handle the N_MAIN stab by
setting main_name.
* blockframe.c (inside_main_func): Use main_name instead of
"main".
* symtab.c (find_main_psymtab): Ditto.
* source.c (select_source_symtab): Ditto.
* nlmread.c (nlm_symfile_read): Ditto.
* rs6000-tdep.c (skip_prologue): Ditto.
2001-07-07 17:19:50 +00:00
Jim Blandy 015a42b4cf (Changes from Daniel Berlin, with revisions by Jim Blandy.)
Abstract out operations specific to particular C++ ABI's, and
invoke them through a function table.  This removes the C++ ABI
dependencies scattered throughout the code, and allows us to
cleanly add support for new C++ ABI's.
* cp-abi.h, cp-abi.h, gnu-v2-abi.c, hpacc-abi.c: New files.
* c-typeprint.c, c-valprint.c, dbxread.c, eval.c, gdbtypes.c,
jv-typeprint.c, linespec.c, symtab.c, typeprint.c, valops.c:
#include "cp-abi.h".  These files all use functions now declared
there.
* symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P):
Deleted.  These services are now provided by functions declared in
cp-abi.h.
* value.h (value_rtti_type, value_virtual_fn_field): Same.
* values.c (value_virtual_fn_field): Same, for this definition.
* valops.c (value_rtti_type): Same.
* c-typeprint.c (c_type_print_base): Use the functions from
"cp-abi.h", instead of the old macros, or hard-coded ABI-specific
tests.
* dbxread.c (record_minimal_symbol): Same.
* gdbtypes.c (get_destructor_fn_field, virtual_base_index,
virtual_base_index_skip_primaries): Same.
* jv-typeprint.c (java_type_print_base): Same.
* linespec.c (find_methods, decode_line_1): Same.
* symtab.c (gdb_mangle_name): Same.
* Makefile.in (SFILES): Add the new .c files mentioned above.
(cp_abi_h): New variable.
(COMMON_OBS): Add gnu-v2-abi.o, hpacc-abi.o, and cp-abi.o.
(cp-abi.o, gnu-v2-abi.o, hpacc-abi.o): New targets.
(c-typeprint.o, c-valprint.o, dbxread.o, eval.o, gdbtypes.o,
jv-typeprint.o, symtab.o, linespec.o, typeprint.o, valops.o): Add
dependency on $(cp_abi_h).
2001-04-27 00:19:09 +00:00
J.T. Conklin 3172dc307b * arch-utils.c (#include "gdbthread.h"): Removed.
(#include "symfile.h"): Removed.
(XMALLOC): Removed unused macro.
* breakpoint.c (tbreak_command): Removed local declaration.
(awatch_command, do_enable_breakpoint, set_breakpoint_count):
Remove duplicate declarations.
(bpstat_should_step, bpstat_have_active_hw_watchpoints)
(remove_solib_event_breakpoints): Fix indentation botch.
* c-typeprint.c (#include "command.h"): Removed.
(#include "gdbcmd.h"): Removed.
* ch-exp.c (ch_terminal_match_float_literal, parse_expr)
(parse_primval, parse_untyped_expr, parse_opt_untyped_expr):
Removed duplicate declarations.
* ch-typeprint.c (#include "command.h"): Removed.
(#include "gdbcmd.h"): Removed.
* corefile.c (#include "frame.h"): Removed
(#include "symfile.h"): Removed.
(#include "language.h"): Removed.
* dbxread.c (#include "command.h"): Removed.
* environ.c (#include "gdbcore.h"): Removed.
* event-loop.c (#include "top.h"): Removed.
* f-typeprint.c (#include "command.h"): Removed.
(#include "gdbcmd.h"): Removed.
(#include "language.h"): Removed.
(#include "typeprint.h"): Removed.
(#include "frame.h"): Removed.
* gdbtypes.h (print_type_scalar): Removed declaration.
* infcmd.c (#include "completer.h"): Removed.
* language.c (#include "frame.h"): Removed.
* m2-typeprint.c (#include "command.h"): Removed.
(#include "gdbcmd.h"): Removed.
(#include "language.h"): Removed.
* m2-valprint.c (#include "valprint.h"): Removed.
* p-typeprint.c (#include "command.h"): Removed.
(#include "gdbcmd.h"): Removed.
* p-valprint.c (#include "typeprint.h"): Removed.
* parse.c (#include "linespec.h"): Removed.
* regcache.c (#include "frame.h"): Removed.
* remote.c (#include "frame.h"): Removed.
(getpkt_sane): Make static.
* source.c (#include "completer.h"): Removed.
* stack.c (#include "symfile.h"): Removed.
(#include "objfiles.h"): Removed.
* symfile.c (#include "completer.h"): Removed.
* tracepoint.c (#include "completer.h"): Removed.
* values.c (#include "frame.h"): Removed.
* varobj.c (#include "valprint.h"): Removed.
* wrapper.c (#include "frame.h"): Removed.

* memattr.c (create_mem_region): Removed unused variable.
* remote-nrom.c: Removed spurious semicolon after init_nrom_ops.
-------------------------------------------------------------------
2001-03-27 20:36:24 +00:00
Elena Zannoni b9179dbce9 2001-03-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
From  Andrew Cagney  <ac131313@redhat.com>

        * coffread.c (coff_symtab_read): Initialize
 	``fcn_first_line_addr''.  Check that the ``.bf'' always preceeds
 	the ``.ef'' info.
	* dbxread.c (find_text_range): Initialize ``start'' and ``end''.
2001-03-26 02:48:23 +00:00
J.T. Conklin 5565b5569b 2001-03-06 J.T. Conklin <jtc@redback.com>
* symtab.h (decode_line_1): Removed declaration.

        * symfile.c (#include <assert.h>): Removed.

        * arch-utils.c (#include <ctype.h>): Removed.
        * c-typeprint.c: Likewise.
        * dbxread.c: Likewise.
        * gdbtypes.c: Likewise.
        * target.c: Likewise.
        * os9kread.c: Likewise.

        * c-valprint.c (#include "demangle.h"): Removed.
        * ch-typeprint.c: Likewise.
        * eval.c: Likewise.
        * f-typeprint.c: Likewise.
        * f-valprint.c: Likewise.
        * m2-typeprint.c: Likewise.
        * typeprint.c: Likewise.
        * p-typeprint.c: Likewise.
        * valarith.c: Likewise.
        * valprint.c: Likewise.

        * m2-typeprint.c (#include "gdb_string.h"): Removed.
        * nlmread.c: Likewise.

        * mdebugread.c (#include "gdb-stabs.h"): Removed.
        * minsyms.c: Likewise.
        * mipsread.c: Likewise.
        * nlmread.c: Likewise.

        * m2-typeprint.c (#include "obstack.h"): Removed.
        * m2-valprint.c: Likewise.

        * event-loop.c (#include <setjmp.h>): Removed.
2001-03-07 02:57:08 +00:00
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Kevin Buettner e1e9e218c1 Replace calls to abort() with calls to internal_error(). 2001-02-25 04:45:12 +00:00
Jason Merrill 8052a17a6a * dbxread.c (read_ofile_symtab): Stay with AUTO_DEMANGLING for G++.
(process_one_symbol): Likewise.
        * dwarfread.c (handle_producer): Likewise.
2001-01-19 14:53:44 +00:00
Kevin Buettner b8c9b27d1e Replace free() with xfree(). 2000-12-15 01:01:51 +00:00
Michael Snyder 0fb34c3a10 2000-12-08 Michael Snyder <msnyder@mvstp600e.cygnus.com>
* alpha-tdep.c: Fix typo in comment.
        * dbxread.c: Fix typo in comment.
        * fr30-tdep.c: Fix typo: newline missing after comment.
        * mcore-tdep.c: Fix typo in comment.
2000-12-08 19:59:25 +00:00
David Anderson 114d1f2c1d Spelling correction in comment: dependant->dependent 2000-09-01 23:45:13 +00:00
Kevin Buettner 9df3df999d Protoization. 2000-08-21 17:30:58 +00:00
Kevin Buettner fba45db2fa Protoization. 2000-07-30 01:48:28 +00:00
Kevin Buettner 507f3c78fb Eliminate PARAMS from function pointer declarations. 2000-06-04 00:41:10 +00:00
Kevin Buettner a14ed312fd PARAMS removal. 2000-05-28 01:12:42 +00:00
Andrew Cagney 74b7792f0f Purge (almost) make_cleanup_func. 2000-05-22 09:02:23 +00:00
Andrew Cagney 56e290f494 Cleanup discard_minimal_symbols cleanup. 2000-05-16 04:07:39 +00:00
Elena Zannoni b8fbeb1874 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
        SECT_OFF_RODATA): Define as functions of OBJFILE.  Add
        sect_index_text, sect_index_data, sect_index_rodata,
        sect_index_bss to objfile structure.
        * gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
        SECT_OFF_RODATA): Remove.
        * objfiles.c (allocate_objfile): Initialize
        sect_index_{text,data,bss,rodata} to -1, for error detection.

        * symfile.c (default_symfile_offsets): Initialize
        sect_index_{text,data,bss,rodata} from bfd information.
        * xcoffread.c (xcoff_symfile_offsets): Ditto.
        * somread.c (som_symfile_offsets): Initialize
        sect_index_{text,data,bss,rodata}.

        * coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
        hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
        mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
        remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
        stabsread.c, symfile.c, xcoffread.c:
        Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
        current objfile.

        * xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-04 16:52:34 +00:00
Jason Molenda c3f6f71df3 import gdb-2000-01-05 snapshot 2000-01-06 03:07:20 +00:00
Jason Molenda c2d11a7da0 import gdb-1999-12-06 snapshot 1999-12-07 03:56:43 +00:00
Jason Molenda c2c6d25f0d import gdb-1999-09-21 1999-09-22 03:28:34 +00:00
Stan Shebs d4f3574e77 import gdb-1999-09-08 snapshot 1999-09-09 00:02:17 +00:00
Jason Molenda 96baa820df import gdb-1999-08-09 snapshot 1999-08-09 21:36:23 +00:00
Jason Molenda a0b3c4fd32 import gdb-1999-08-02 snapshot 1999-08-02 23:48:37 +00:00
Jason Molenda c5aa993b1f import gdb-1999-07-07 post reformat 1999-07-07 20:19:36 +00:00
Jason Molenda 392a587b05 import gdb-1999-05-25 snapshot 1999-05-25 18:09:09 +00:00
Stan Shebs 7a292a7adf import gdb-19990422 snapshot 1999-04-26 18:34:20 +00:00
Stan Shebs c906108c21 Initial creation of sourceware repository 1999-04-16 01:35:26 +00:00
Stan Shebs 071ea11e85 Initial creation of sourceware repository 1999-04-16 01:34:07 +00:00
Peter Schauer 655a27b099 Improve support for SunPro F77.
* dbxread.c (end_psymtab, process_one_symbol):  Handle minimal
	symbols with trailing underscore names.
	* minsyms.c (find_stab_function_addr):  Ditto.
	* dbxread.c (process_one_symbol):  Ignore N_ALIAS for now.
	* partial-stab.h (case N_ALIAS):  Ditto.
	* stabsread.c (read_sun_builtin_type):  Handle boolean types.
1998-06-28 18:36:50 +00:00
Doug Evans 705b12dfdf * dbxread.c (read_dbx_symtab): Don't lower texthigh for last psymtab. 1998-06-05 20:57:54 +00:00
Jeff Law b84b918329 * mdebugread.c (psymtab_to_symtab_1): Handle new live range stabs
entries.

        * dbxread.c: More comment cleanups.
        * stabsread.c: Fix various violations of the GNU coding and
        formatting standards.  Update/add comments to make code clearer.
        (resolve_reference): Delete unused function.
        (ref_search_val): Remove function.  It didn't belong in stabsread.c
        (resolve_live_range): No longer returns a value.  Do not add it
        to the live range list until the entire range stab has been parsed.
        (get_substring): Remove duplicate declaration.
        (resolve_symbol_reference): Now static.  Remove unnecessary code
        to deal with cleanups.
         (ref_add): Use xrealloc instea of realloc.
        (process_reference): Reorganize slightly to make clearer.
        * stabsread.h (resolve_symbol_reference): Remove declaration.
        (resolve_reference): Likewise.
        * symtab.c (find_active_alias): New function.
        (lookup_block_symbol): Use find_active_alias.
        * symtab.h (struct range_list): Fix dangling struct live_range
        reference.
        (ref_search_val): Remove decl.

        * symtab.h (struct range_list): Renamed from struct live_range.
        (struct symbol): Remove struct live_range_info substruct.
        Bring the alias list and range list fields up to the toplevel
        as "aliases" and "ranges".
        (SYMBOL_ALIASES, SYMBOL_RANGES): Corresponding changes.
        (SYMBOL_RANGE_START, SYMBOL_RANGE_END, SYMBOL_RANGE_NEXT): Delete.
        * stabsread.c: Corresponding changes.
Bring first round of cleanups over from r5900 branch.
1997-10-22 23:28:30 +00:00
Jeff Law ab41527bce * dbxread.c: Fix various violations of the GNU coding and
formatting standards.  Update/add comments to make code
        clearer.
        (process_later): Use xrealloc instead of realloc.
1997-10-22 19:04:30 +00:00
Dawn Perchik 166d7e5549 * stabsread.h, symtab.h, dbxread.c, symtab.c, stabsread.c:
Fix prototypes.  Remove function scoped function declarations.
1997-09-22 22:52:23 +00:00
Mark Alexander 899c402166 * dbxread.c (MSYMBOL_SIZE): New macro.
(end_psymtab): Use MSYMBOL_SIZE to extract size from minimal symbol.
	* elfread.c (elf_symtab_read): If ELF symbol is "special",
	such as a MIPS16 function, mark minimal symbol as special too.
	* mips-tdep.c (pc_is_mips16): New function to check whether
	a function is MIPS16 by looking at the minimal symbol.  Use
	pc_is_mips16 throughout instead of IS_MIPS16_ADDR macro.
	* config/mips/tm-mips.h (SYMBOL_IS_SPECIAL, MAKE_MSYMBOL_SPECIAL,
	MSYMBOL_IS_SPECIAL, MSYMBOL_SIZE): New functions for setting/testing
	"special" MIPS16 bit in ELF and minimal symbols.
	* mdebugread.c (parse_partial_symbols): Don't construct a partial
	symbol table for a file that already has one.
start-sanitize-tx19
	* configure.tgt: Support TX19.
	* config/mips/tm-tx19.h, config/mips/tm-tx19l.h, config/mips/tx19.mt,
	config/mips/tx19l.mt: New files for TX19.
end-sanitize-tx19
1997-09-15 21:06:16 +00:00
Jeff Law b303e1053f * symtab.c, dbxread.c, stabsread.c: Fix up ANSI-C isms. Fix
some formatting problems.
1997-09-09 23:53:37 +00:00
Dawn Perchik d719efc6d5 * dbxread.c, buildsym.c, symtab.c, stabsread.c: Add support for
reading stabs extensions for live range information.
	* stabsread.h, partial-stab.h: Add prototypes for new functions.
	* symtab.h: Add structure for storing live range information.
1997-09-08 00:38:19 +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
Stu Grossman 139e2c0f92 * dbxread.c: Don't swap symbols in place, since internal and
external forms may have different sizes.  Don't assume that an
	internal_nlist has the same layout as an external_nlist.  Create
	symbol for n_strx element so to hide specifics of nlist from
	partial-stab.h.
	* partial-stab.h:  Don't reference dbxread symbols directly.  Use
	CUR_SYMBOL_STRX instead.
	* config/i386/xm-windows.h:  Define SIGQUIT and SIGTRAP.

	* config/v850/tm-v850.h:  Define PS_REGNUM and TARGET_V850 for
	MSVC builds.
	* mswin/gdbwin.c (reg_order):  Define register order for V850.
	* mswin/gui.cpp (CGuiApp::InitInstance):  Define target name for
	V850.
	* mswin/regdoc.h:  Define MAXREGS for V850.
1996-10-24 17:31:45 +00:00
Fred Fish a7f56d5aff Just some cleanups noticed while working on PR 10760
* dbxread.c (dbx_symfile_read): Call free_pending_blocks rather
	than poking global variable (which is now static).
	* hpread.c (hpread_build_psymtabs): Ditto.
	* os9kread.c (os9k_symfile_read): Ditto.
	* xcoffread.c (xcoff_initial_scan): Ditto.

	* buildsym.h (free_pending_blocks): Declare here.
	(pending_blocks): Remove declaration of global symbol.
	(free_pendings): Remove declaration of global symbol.
	(make_blockvector): Declare here.
	(record_pending_block): Declare here.

	* dstread.c (make_blockvector): Remove static copy that was old
	clone of version in buildsym.c.
	(process_dst_block): Call record_pending_block rather than doing
	it by hand.
	(read_dst_symtab): Ditto.

	* buildsym.c (make_blockvector): Make global rather than static,
	(record_pending_block): New function, code moved from finish_block.
	(finish_block): Use record_pending_block.
	(free_pending_blocks): New function.
	(really_free_pendings): Call free_pending_blocks.
	(pending_blocks): Make static instead of global.
	(free_pendings): Make static instead of global.
1996-10-08 19:00:38 +00:00
Per Bothner 7f8da359a8 Replace header_files global by per-objfile field.
* gdb-stabs.h (struct dbx_symfile_info):  Add fields header_files,
	n_header_files, n_allocated_header_files.
	* stabsread.h (header_files, n_header_files, n_allocated_header_files):
	Replace externs by macros HEADER_FILES, N_HEADER_FILES, and
	N_ALLOCATED_HEADER_FILES.
	* dbxread.c (dbx_symfile_finish):  Free HEADER_FILES.
	(free_header_files, init_header-files):  Don't free/init headerfiles.
	(various functions):  Use macros instead of header_files globals.
	* stabsread.c (various functions):  Likewise.
1996-10-07 17:45:29 +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
Stu Grossman 3a179be149 * Makefile.in (os9kread.o): Remove dependency on partial-stab.h.
* dbxread.c (read_dbx_symtab end_psymtab), partial-stab.h:  Don't
	use partial_symtab->textlow==0 as a flag, as 0 is a legitimate
	text address.  Use a seperate flag (textlow_not_set) instead.
	This makes stabs in ELF .o files work a lot better.
	* mdebugread.c xcoffread.c:  Define textlow_not_set for
	partial-stab.h.
	* stabsread.h (end_psymtab):  Add textlow_not_set arg to prototype.
1996-07-23 01:24:58 +00:00
Fred Fish ace4b8d75a (laying some groundwork for a fix for PR 8443)
* coffread.c (record_minimal_symbol): Don't presave name string
	on symbol_obstack before passing to prim_record_minimal_symbol.
	It now handles saving the string itself.
	* dbxread.c (read_dbx_dynamic_symtab): Ditto.
	* mipsread.c (read_alphacoff_dynamic_symtab): Ditto.
	* os9kread.c (record_minimal_symbol): Ditto.
	* solib.c (solib_add_common_symbols): Ditto.

	* coffread.c (coff_symtab_read): Don't presave name string on
	symbol_obstack before passing to prim_record_minimal_symbol_and_info.
	It now handles saving the string itself.
	* dbxread.c (record_minimal_symbol): Ditto.
	* elfread.c (record_minimal_symbol_and_info): Ditto.

	* dstread.c (record_minimal_symbol): Remove static function that just
	called prim_record_minimal_symbol with the same args (after change to
 	prim_record_minimal_symbol to do it's own name string saves).
	* nlmread.c (record_minimal_symbol): Ditto.
	* somread.c (record_minimal_symbol): Ditto.

	* hpread.c (hpread_read_enum_type): Save symbol name on symbol obstack.
	(hpread_read_function_type): Ditto.
	(hpread_process_one_debug_symbol): Ditto.
	* mdebugread.c (parse_symbol): Ditto.
	(new_symbol): Ditto.
	* minsyms.c (prim_record_minimal_symbol_and_info): Ditto.

	* coffread.c (process_coff_symbol): Use obsavestring to save
	SYMBOL_NAME, rather than obstack_copy0.
	* dstread.c (create_new_symbol): Ditto
	* symfile.c (obconcat): Ditto.
	* stabsread.c (patch_block_stabs): Ditto.
	* xcoffread.c (SYMNAME_ALLOC): Ditto.

	* symfile.c (obsavestring): Update comments
	* solib.c (solib_add_common_symbols): Remove local var origname.
1996-07-08 09:05:18 +00:00
Mark Alexander e74acce48c * coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c,
os9kread.c: Replace identical sym_offsets functions with
	default_symfile_offsets.
	* somread.c (som_symfile_offsets): Use new SIZEOF_SECTION_OFFSETS
	macro to allocate section_offsets.
	* symfile.c (default_symfile_offsets): New function.
	* symfile.h: Declare default_symfile_offsets.
	* symtab.h: Define SIZEOF_SECTION_OFFSETS macro to
	simplify allocation of section_offsets.
1996-07-03 05:11:40 +00:00
Dawn Perchik 94f5a25f2e Add new support for parsing cfront stabs. 1996-04-24 19:34:45 +00:00
Fred Fish f309ad9590 * coffread.c, dbxread.c, dstread.c, objfiles.c, os9kread.c,
symfile.c, symtab.c:  Use "obstack.h" rather than <obstack.h>.
1995-12-09 05:12:46 +00:00
David Edelsohn 4588619966 * dbxread.c (dbx_symfile_read): Set block_address_function_relative
for `pe' format files.
1995-11-28 23:45:17 +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
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 ab52cc44ba * dbxread.c: Add comment explaining lowest_text_address. 1995-04-25 18:31:31 +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
Peter Schauer b9e585030c * buildsym.c (patch_subfile_name): Update last_source_file
with the real source file name.
	* dbxread.c (end_psymtab):  Handle static functions in the
	SOFUN_ADDRESS_MAYBE_MISSING case by passing pst->filename
	to lookup_minimal_symbol.
	(process_one_symbol):  Ignore extra outermost context from
	SunPRO cc and acc.
	* stabsread.c (define_symbol):  Do not complain for SunPRO
	static variable encoding if STATIC_TRANSFORM_NAME is defined.
	* sparc-tdep.c, config/sparc/tm-sun4sol2.h
	(sunpro_static_transform_name):  Renamed from
	solaris_static_transform_name.
	* config/sparc/tm-sun4os4.h (STATIC_TRANSFORM_NAME):
	Define to sunpro_static_transform_name for acc 3.0 compiled
	executables.
	* procfs.c, config/alpha/nm-osf2.h (PROCFS_DONT_TRACE_FAULTS):
	Renamed from PROCFS_DONT_TRACE_IFAULT, don't trace any faults
	if defined.
	* procfs.c (info_proc_siginfo):  Cast sip->si_addr to
	`unsigned long' and use `lx' format for printing it.
1995-03-25 09:23:10 +00:00
Jim Kingdon f69ecb9c9a * xcoffread.c (read_xcoff_symtab): Fix obsolete comment about
mst_solib_trampoline.

	* f-valprint.c (f_val_print): Change cast of valaddr from
	CORE_ADDR * to char **, since that is how it is used.

	* dbxread.c (read_dbx_dynamic_symtab): Save copy of symbol names
	using obsavestring, and pass that to prim_record_minimal_symbol.
	Having the objfile point to bfd_asymbol_name directly doesn't work
	if we save and restore a mapped symbol file.
1994-09-14 22:45:49 +00:00
Peter Schauer 26a859ec83 * corelow.c (add_solib_stub): Copy to_sections changes from
core_ops to current_target after adding the shared libraries.
	* partial-stab.h (N_EXCL), dbxread.c (add_old_header_file,
	find_corresponding_bincl_psymtab):  Change `repeated header not seen'
	error to a complaint, simplify complaint.
	* procfs.c (signalname, errnoname):  Make `name' const.
	* symfile.c (reread_symbols):  Use filename from old BFD to
	reopen the objfile.
	* values.c (record_latest_value):  Don't record value in the
	history chain until we are sure there won't be an error.
1994-09-10 08:50:10 +00:00
Stu Grossman 320f93f714 * dbxread.c, partial-stab.h (near N_SO): SO stabs with blank
names mean end of .o file.
	* infrun.c (wait_for_inferior):  Clean up multi-thread logic near
	top of routine.  Handle new thread notification cleanly.
	* lynx-nat.c (child_wait):  General cleanups, handle new LynxOS
	thread notification scheme.
	* (child_resume):  General cleanups, handle resumption of all
	threads properly.
1994-06-28 23:36:52 +00:00
Jeff Law bfe2f12bd0 * somread.c: Renamed from paread.c. Changed function names and
comments to reflect that this file deals with SOM (an object file
	format), rather than the PA (a cpu).
	(Makefile.in): Chaned appropriately.
	(config/pa/hppabsd.mh, config/pa/hppahpux.mh): Likewise.
	* dbxread.c (somstab_build_psymtabs): Renamed from
	pastab_build_psymtabs.
1994-06-27 06:09:40 +00:00
Stu Grossman a66e8382de * dbxread.c (record_minimal_symbol): Record the section
associated with the symbol to make dynmaic relocation work.
	* (dbx_symfile_read, process_one_symbol):  Fixes to work around
	Solaris brain-damage which don't apply to relocatable object
	files.
	* (stabsect_build_psymtabs):  New routine to read stabs out of an
	arbitrarily named section.
	* nlmread.c (nlm_symtab_read):  Read ALL syms from the NLM, not just
	globals.
	* (nlm_symfile_read):  Call stabsect_build_psymtabs to read the
	stabs out of the nlm.
	* partial-stabs.h (cases 'f' & 'F'):  Fixes to work around Solaris
	brain-damage which don't apply to relocatable object files.
	* remote.c (putpkt):  Improve error reporting and error handling.
	* stabsread.c (define_symbol, scan_file_globals):  Record section
	info in sym.
1994-04-26 17:14:52 +00:00
Peter Schauer 0683ac4b2c * dbxread.c (read_dbx_dynamic_symtab): Reinstall support for sun3,
BFD handles sun3 dynamic relocations now.
	* elfread.c (elf_symtab_read, elf_symfile_read):  Handle dynamic
	symbol table.
1994-04-21 17:09:31 +00:00
Peter Schauer be78eb1ab1 * dbxread.c (read_dbx_dynamic_symtab): Relocate BFD symbols by
section vma. Do not read dynamic relocs for sun3 executables to
	avoid BFD assertion message.
1994-04-18 20:26:32 +00:00
Peter Schauer 2fe3b329f6 * infrun.c (IN_SOLIB_TRAMPOLINE): Correct comment, trampolines
are in the .plt section.
	* minsyms.c (lookup_solib_trampoline_symbol_by_pc,
	find_solib_trampoline_target):  New functions for handling
	stepping into -g compiled shared libraries.
	* symtab.h (lookup_solib_trampoline_symbol_by_pc,
	find_solib_trampoline_target):  Add prototypes.
	* config/tm-sunos.h (IN_SOLIB_TRAMPOLINE, SKIP_TRAMPOLINE_CODE):
	Define to handle stepping into  -g compiled shared libraries.
	* config/tm-sysv4.h (SKIP_TRAMPOLINE_CODE):  Define to handle
	stepping into  -g compiled shared libraries.
	* configure.in:  Add mips-*-sysv4* support.
	* config/mips/mipsv4.mh, config/mips/mipsv4.mt,
	config/mips/tm-mipsv4.h, config/mips/xm-mipsv4.h, mipsv4-nat.c:
	New files for MIPS SVR4 support.
	* Makefile.in:  Update for new mipsv4 files.
	* alpha-tdep.c (heuristic_proc_desc, find_proc_desc):  Use
	read_next_frame_reg to obtain the frame relative stack pointer.
	* mips-tdep.c (heuristic_proc_desc):  Use read_next_frame_reg to
	obtain the frame relative stack pointer.
	* mdebugread.c (parse_partial_symbols, psymtab_to_symtab1):
	Handle stStatic and stStaticProc symbols in stabs-in-ecoff output
	by entering them into the minimal symbol table.
	* printcmd.c (print_scalar_formatted):  Do not try to unpack to
	a long for float formats.
	* solib.c:  Include "elf/mips.h" only if DT_MIPS_RLD_MAP does not
	get defined in <link.h>.
	* solib.c (solib_add):  Add shared library sections to the section
	table of the target before adding the symbols.
	* partial-stab.h:  Relocate static and global functions.
	* dbxread.c (read_dbx_symtab):  Remove unused variable
	end_of_text_address.  Relocate text_addr when passing it
	to end_psymtab.

	For Alpha OSF/1 targets, enable gdb to set breakpoints in shared
	library functions before the executable is run. Retrieve dynamic
	symbols from stripped executables.
	* mipsread.c (read_alphacoff_dynamic_symtab):  New function.
	* mipsread.c (mipscoff_symfile_read):  Use it. Issue warning message
	if no debugging symbols were found.
	* alpha-tdep.c (alpha_skip_prologue):  Silently return the unaltered
	pc if memory at the pc is not accessible and GDB_TARGET_HAS_SHARED_LIBS
	is defined.
	* config/alpha/nm-alpha.h (GDB_TARGET_HAS_SHARED_LIBS):  Define,
	OSF/1 has shared libraries.
1994-04-08 00:35:15 +00:00
Ian Lance Taylor 192b64e7f9 * dbxread.c (read_dbx_dynamic_symtab): Adjust for recent changes
to BFD handling of dynamic symbols.
1994-04-07 19:13:17 +00:00
Peter Schauer db2302cb93 * ch-exp.y (decode_integer_value, match_character_literal,
match_bitstring_literal):  Guard tolower calls with isupper,
	tolower on old BSD systems blindly subtracts a constant.
	* dbxread.c (read_ofile_symtab):  Check for __gnu_compiled_* as
	well when determining the producer of the object file.
	* mdebugread.c (has_opaque_xref):  New function to check for
	cross reference to an opaque aggregate.
	* mdebugread.c (parse_symbol, parse_partial_symbols):  Do not
	enter typedefs to opaque aggregates into the symbol tables.
	* mdebugread.c (parse_external):  Remove skip_procedures argument,
	it has always been 1.  Remove code that handled stProc symbols,
	it was never executed and was wrong, as the index of a
	stProc symbol points to the local symbol table and not to the
	auxiliary symbol info. Update caller.
	* mdebugread.c (parse_partial_symbols):  Do not enter external
	stProc symbols into the partial symbol table, they are already
	entered into the minimal symbol table.
	* config/i386/tm-symmetry.h:  Clean up, it is now only used for Dynix.
	Remove all conditionals and definitions for ptx.
	I386_REGNO_TO_SYMMETRY moved to here from symm-tdep.c.
	Fix addresses of floating point registers in REGISTER_U_ADDR.
	STORE_STRUCT_RETURN now handles cc and gcc conventions.
	FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC,
	IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET defined to make backtracing through
	signal trampoline code work.
	* config/i386/xm-symmetry.h:  Clean up, it is now only used for Dynix.
	Remove all conditionals and definitions for ptx.
	Remove KDB definitions.
	* symm-nat.c (store_inferior_registers):  Fetch registers before
	storing them to obtain valid floating point control registers.
	Store fpu registers.
	* symm-nat.c (print_1167_control_word):  Dynix 3.1.1 defines
	FPA_PCR_CC_C0 and FPA_PCR_CC_C1, avoid duplicate case value.
	* symm-nat.c (fetch_inferior_registers, child_xfer_memory):
	Fix typos.
	* symm-nat.c (child_resume):  Update type of `signal' parameter.
	* symm-tdep.c (I386_REGNO_TO_SYMMETRY):  Moved to tm-symmetry.h.
1994-03-30 09:57:08 +00:00
Jim Kingdon 5801f3488e * dbxread.c (end_psymtab): Add comment about empty psymtabs. 1994-03-24 15:12:40 +00:00
Jim Kingdon 9d2b8d50f4 * dbxread.c: New variable lowest_text_address.
(record_minimal_symbol, read_dbx_symtab): Set it.
	(read_dbx_symtab): Use lowest_text_address + text_size instead of
	end_of_text_address.
	* config/gould/tm-pn.h: Add comment regarding END_OF_TEXT_DEFAULT.
1994-03-08 18:22:56 +00:00
Jim Kingdon 6545c6a085 * dbxread.c (end_psymtab): Only patch psymtab textlow and texthigh
if N_SO_ADDRESS_MAYBE_MISSING is defined.
	* config/sparc/tm-sun4sol2.h: Define it.
1994-01-21 17:53:57 +00:00
Jim Kingdon 404f69a80b * dbxread.c: Move default definition of GCC_COMPILED_FLAG_SYMBOL
from here . . .
	* symtab.h: . . . to here.
	* dbxread.c (record_minimal_symbol): Move check for gcc{,2}_compiled.
	and __gnu_compiled* from here . . .
	* minsyms.c (prim_record_minimal_symbol_and_info): . . . to here.
	* minsyms.c (prim_record_minimal_symbol): Call
	prim_record_minimal_symbol_and_info rather than duplicating code.
1993-12-27 16:31:56 +00:00
Jeff Law 2f8c3639fa * dbxread.c (process_one_symbol): Handle stabs-in-som just like
stabs-in-elf.
        (pastab_build_psymtabs): Likewise.

        * hppa-tdep.c: Change all comments to reference %r3 or frame pointer
        rather than %r4.
        (frame_chain, skip_prologue, dig_rp_from_stack): Handle %r3 as the
        frame pointer.

        * config/pa/tm-hppa.h (FP_REGNUM): Define as %r3.
        (FIND_FRAME_SAVED_REGS): Handle %r3 as frame pointer.
        (CALL_DUMMY): Likewise.
1993-12-27 04:46:05 +00:00
Jim Kingdon 4023311b08 * dbxread.c: Remove BELIEVE_PCC_PROMOTION define. The code which
used this was moved to stabsread.c a long time ago.
1993-11-10 19:42:31 +00:00
Jim Kingdon b30c81b649 * dbxread.c (unknown_symchar_complaint): Make message refer to
"symbol descriptor" not "symbol type character" for consistency
	with stabs.texinfo terminology.
1993-11-05 04:57:29 +00:00
Jim Kingdon c7d4c4c8ce * dbxread.c (process_one_symbol): Do relocate 'S' symbols by
the text offset (revert 12 Oct 93 change).
1993-11-04 23:03:03 +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 0eed42deee * symfile.h (sym_fns), symfile.c (find_sym_fns), xcoffread.c,
coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, paread.c:
	Change from using bfd target name to using the flavour.
1993-10-31 18:54:28 +00:00
Jim Kingdon 4d57c5995e * symfile.c (reread_symbols): When re-reading symbols, do all the
right operations ourself, rather than calling symbol_file_command.
	If we re-read something, call clear_symtab_users not just
	breakpoint_re_set.
	* objfiles.h, objfiles.c (build_objfile_section_table): No longer
	static.
	* symfile.c (clear_symtab_users): Call clear_pc_function_cache.
	* coffread.c, dbxread.c, elfread.c, mipsread.c, nlmread.c, paread.c
	(*_symfile_offsets): Set objfile->num_sections.
	* remote.c (remote_wait), symfile.c (syms_from_objfile):
	Don't muck with objfile->num_sections now that all the symbol
	readers set it.
	* elfread.c: Clean up obsolete comment about handling only DWARF.
	* paread.c: Remove comment about how we should use an "ordinary"
	file format with an hppa suffix.  There is nothing ordinary about SOM.
1993-10-30 20:21:19 +00:00
Stan Shebs 965a5c32b7 Added new slot to objfile struct to be shared by all stab-reading formats. 1993-10-03 23:04:25 +00:00
Stan Shebs b5b186a2cd Additions to support stabs-in-coff. 1993-09-29 01:53:52 +00:00
Jim Kingdon 5573d7d4b1 Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES.

	Clean up problems with targets and hosts that have 64 bit longs
	and pointers and 32 bit ints.
	* breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c,
	ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c,
	expprint.c, gdbtypes.c, infcmd.c, language.c, language.h,
	m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h,
	printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c,
	symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
	Change all printf formats from %x to %lx if outputting an address.
	Change la_*_format to use long format.
	local_hex_string, local_hex_string_custom now take an unsigned long
	argument, change all callers.
	* coffread.c (read_coff_symtab):  Remove superfluous cast for
	complaint output.
	* dbxread.c (end_psymtab):  Cast MSYMBOL_INFO to long, not int.
	* findvar.c, value.h (write_register):  Change register value to long.
	* gdbtypes.h (struct type):  Change `bitsize' to long as
	TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer.
	* inferior.h (struct inferior_status):  Change type of stop_pc to
	CORE_ADDR.
	* language.h (local_octal_string, local_octal_string_custom):
	Remove prototype, the functions are neither defined nor used.
	* mipsread.c (parse_symbol):  Use temporary variable for bitsize as
	f->bitsize is a long now.
	* objfiles.c (add_to_objfile_sections, build_objfile_section_table):
	Use unsigned long casts instead of int for abusing sections_end
	pointer as integer.
	* stack.c (parse_frame_specification):  Change type of `args' to
	CORE_ADDR for SETUP_ARBITRARY_FRAME.

	* printcmd.c (make_vasize):  Allow redefinition via MAKEVA_SIZE.
	* mipsread.c (parse_type):  Alpha cc now supports the t->continued
	bit, update algorithm to match the way the compiler uses it.
1993-09-28 17:43:25 +00:00
Jim Kingdon 3c7d306488 Revert previous change. It doesn't work because it neglects to
consider there may be a file compiled without -g screwing things up
(e.g. we are looking for the minimal symbol for "main" and we get the
one for "start" instead).

This is the change I mean:
	* minsyms.c, symtab.h (lookup_next_minimal_symbol): New function.
	* dbxread.c (process_one_symbol): Use it.
1993-09-08 17:26:31 +00:00
Jim Kingdon 9f1e14f4c9 * minsyms.c, symtab.h (lookup_next_minimal_symbol): New function.
* dbxread.c (process_one_symbol): Use it.
1993-09-08 15:51:39 +00:00
Jim Kingdon c09bd4433e revise comment 1993-09-08 14:08:43 +00:00
Jim Kingdon 8adcfb97ad * dbxread.c (process_one_symbol): If the value of an N_FUN for a
function is zero, use minimal symbols to get the address.
1993-09-07 18:12:26 +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
K. Richard Pixley 4ed97c9a83 bzero -> memset 1993-09-01 21:56:42 +00:00
Peter Schauer cbba020f3f * stabsread.h, dbxread.c (end_psymtab): Return NULL if the psymtab
was empty and thrown away.
	* mipsread.c (parse_partial_symbols):  Do not add empty psymtabs to
	dependency list, skip self dependencies.
	* mipsread.c (parse_fdr):  Removed, obsolete.
	* mipsread.c (parse_lines):  Check for cbLine being zero, not
	cbLineOffset.
	* mipsread.c (struct symloc):  Add pst_language.
	* mipsread.c (parse_partial_symbols):  Set up proper language for header
	files, save it in pst_language for psymtab_to_symtab_1.
	* mipsread.c (psymtab_to_symtab_1):  Use pst_language.
1993-08-30 19:50:47 +00:00
Jim Kingdon a656507936 Write ChangeLog entry for sef changes.
Remove dbxread.c change; I handle this in BFD by making the name start
with "a.out".
1993-08-23 19:46:03 +00:00
Sean Eric Fagan 05c81f45b4 Add support for netbsd386 (almost-but-not-quite 386bsd). 1993-08-23 07:45:32 +00:00
Peter Schauer 0eb22669dc * breakpoint.c (breakpoint_1): Walk the breakpoint chain to decide if
we have breakpoints or watchpoints as we might have to ignore internal
	breakpoints.

	Fix gdb core dumps after `file newfile' commands.
	* symtab.h, symfile.c (clear_symtab_users):  New routine which
	unconditionally clears symtab users. clear_symtab_users_once
	commented out as it was a noop anyway.
	* objfiles.c (free_objfile):  Don't call clear_symtab_users_once.
	* objfiles.c (free_all_objfiles), symfile.c (new_symfile_objfile),
	xcoffexec.c (exec_close):  Call clear_symtab_users if necessary.
	* symfile.c (syms_from_objfile):  Install cleanups for errors during
	symbol reading.
	* coffread.c, dbxread.c, mipsread.c, xcoffread.c (*_symfile_read):
	Lint cleanup code, call do_cleanups explicitly.
	* symfile.c (symbol_file_add):  Call new_symfile_objfile and
	reinit_frame_cache _after_ the new symbols are read in.
1993-07-27 19:40:57 +00:00
Jim Kingdon 3ef0fc8c58 * dbxread.c (process_one_symbol): Deal with SunOS4 acc N_STSYM and
N_GSYM functions.
1993-07-27 19:01:11 +00:00
Jim Kingdon b8ec9a798f * hppa-tdep.c: Remove all uses of use_unwind and `set use_unwind'
command.  Now we use unwind info by default if we can find it.

	* config/sparc: Move VARIABLES_INSIDE_BLOCK and SUN_FIXED_LBRAC_BUG
	to tm-sparc.h so they are shared between Solaris and SunOS4.
	* dbxread.c (process_one_symbol): Deal with SunOS4 acc N_STSYM and
	N_GSYM functions.
1993-07-26 22:16:09 +00:00
Jim Kingdon 4f47020526 improve comment about Sun acc 1993-07-12 15:58:42 +00:00
Jim Kingdon ec06a3cb25 * dbxread.c (copy_pending): Change name and function of begi argument
to endi, since that is what the caller needs.
1993-06-23 19:20:49 +00:00
Jim Kingdon 2c7ab4ca35 * config/i386/*aix*, i386aix-nat.c: New files.
* configure.in: Use them.
	* alldeps.mak: List them.
	* coffread.c (decode_base_type): Deal with anonymous enum type.
	* i387-tdep.c (print_387_status_word): Add comment re "top".
	* i386-tdep.c [I386_AIX_TARGET] (i386_extract_return_value): New func.
	* dbxread.c: Use SEEK_SET and SEEK_CUR, not L_*.  Define them if and
	only if not defined by a header file.
	* mipsread.c: Don't define L_SET or L_INCR.
1993-06-21 23:46:49 +00:00
Jim Kingdon a5e6391b44 * dbxread.c (process_one_symbol): If SUN_FIXED_LBRAC_BUG is not
defined, don't worry about Sun's silly LBRAC bug.

	* dbxread.c (process_one_symbol): If there's a symbol before an
	N_SO, don't error().
	(case N_BCOMM): complain () not error ().
1993-06-13 18:46:47 +00:00
Jim Kingdon 8357834fbe * dbxread.c (process_one_symbol): Set n_opt_found based on whether
a non-gcc N_OPT symbol is found.  Make SUN_FIXED_LBRAC_BUG a macro
	which returns 0 or 1 to say whether to do it.
	* config/sparc/sun4{sol2,os4}.h
	(SUN_FIXED_LBRAC_BUG,VARIABLES_INSIDE_BLOCK): Use n_opt_found so
	the right thing happens for both acc and SunOS4 /bin/cc.
1993-06-13 02:26:18 +00:00
Jim Kingdon 574dac8e6d * dbxread.c (process_one_symbol): Rather than having
BLOCK_ADDRESS_FUNCTION_RELATIVE a macro, make it a variable which
	is true if we are doing stabs-in-elf, false otherwise.
	config/sparc/tm-sun4sol2.h: Don't define it.
1993-06-11 21:53:49 +00:00
Fred Fish 2707b48a61 * dbxread.c (read_ofile_symtab): Remove "#if 1" around code to
set demangling style automatically.
	* defs.h (CPLUS_MARKER):  Clarify comment that this is only for
	GNU C++, not C++ in general.
	* symtab.h (general_symbol_info):  Simplify by eliminating one
	structure level for the language dependent info.
1993-05-30 22:41:52 +00:00
John Gilmore 65ce5df44f * dbxread.c (unknown_symchar_complaint): Add new complaint.
* stabsread.c:  Declare it.
* partial-stab.h:  Use it.

* utils.c (malloc_botch):  Don't forward-declare if NO_MMALLOC.
1993-04-15 09:41:59 +00:00
Fred Fish 69a272c4f6 * dbxread.c (dbx_symfile_init): Make size of the string table
size field a define (DBX_STRINGTAB_SIZE_SIZE).  Ensure that the
	offset to the string table is nonzero and handle the nonexistant
	string table case, should it occur.  Ensure that the string table
	size read from the file is reasonable, with a minimum lower bound
	of DBX_STRINGTAB_SIZE_SIZE instead of zero.
1993-03-04 00:01:32 +00:00
Fred Fish 6985bc542e * dbxread.c (dbx_symfile_init): Fix for nonexistant string table,
reported by mycroft@gnu.ai.mit.edu.

	(Ultrix 2.2 support from Michael Rendell <michael@mercury.cs.mun.ca>)
	* configure.in (vax-*-ultrix2*):  New triplet.
	* config/vaxult2.mh:  New file.
	* xm-vaxult2.h:  New file.
1993-03-03 06:04:26 +00:00
K. Richard Pixley 040b959771 * dbxread.c (process_one_symbol): cast enum value N_SO into int when
comparing against an int.  Avoids superfluous warning from vax
  ultrix 4.2 cc.
1993-02-17 21:58:25 +00:00
Fred Fish 51db232366 * dbxread.c (dbx_symfile_init, elfstab_build_psymtabs):
Call new bfd_get_size() and verify that string table is no larger
	than the file that is supposed to contain it.
	* symfile.c (syms_from_objfile):  Only complain about configured
	NAMES_HAVE_UNDERSCORE differences between gdb and bfd if the
	current target is the default BFD target.
1992-12-28 01:44:21 +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 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
John Gilmore e0ba1d1427 * findvar.c (supply_register): Add CLEAN_UP_REGISTER_VALUE hook.
* tm-hppa.h (CLEAN_UP_REGISTER_VALUE):  Use it.
* hppa-coredep.c:  Remove, now that we use the hook.
* config/hppab.mh, config/hppah.mh:  Use standard coredep.o.
* hppab-xdep.c, hppah-xdep.c:  Remove custom code, use hook.

* dbxread.c, partial-stab.h:  Replace all #ifdef hp9000s800's with
GDB_TARGET_IS_HPPA's.  This is a SERIOUS KLUDGE.  The code needs to all
be ripped out and reimplemented right (see elfread.c).
* tm-hppa.h (GDB_TARGET_IS_HPPA):  Define.
1992-09-26 10:24:26 +00:00
Stu Grossman 1aed676612 * tm-sparc.h, dbxread.c (read_ofile_symtab): Install Jim Wilson's
fix to differentiate between gcc1 & gcc2 compiled files so that we
can debug calls that pass structs as args correctly.
* symmisc.c (dump_symtab):  If block was compiled with gcc, say
so, and what version.
1992-09-25 22:59:27 +00:00
Fred Fish 3416d90bd6 * buildsym.c (start_subfile): Compact dirname initialization.
* buildsym.c (patch_subfile_names):  New function.
	* buildsym.c (end_symtab):  Make copy of dirname on symbol obstack.
	* buildsym.c (end_symtab):  Free all malloc'd subfile fields.
	* buildsym.h (patch_subfile_names):  Add prototype.
	* dbxread.c (process_one_symbol):  Call patch_subfile_names.
1992-08-06 19:59:46 +00:00
Stu Grossman 784fd92b3d * dbxread.c (dbx_symfile_init): Init stab_section_info to NULL to
prevent crashes when examining cross-targets.
* dbxread.c (process_one_symbol):  Include directory name when
calling start_subfile for SOL & BINCL symbols.  This allows gdb to
find include files, and yacc/lex sources when the cwd doesn't match
that in which the object was compiled.
* objfiles.h (ALL_MSYMBOLS):  Don't seg fault when there are no
msymbols.
* symtab.c (lookup_symtab_1):  Rewrite.  It now handles include
files.
1992-07-08 08:00:30 +00:00
John Gilmore ec8ceca3f3 * buildsym.c (finish_block): Fix thinko `inner block' complaints.
* dbxread.c (process_one_symbol):  Parse N_OPT "gcc2_compiled.".
* procfs.c (proc_set_exec_trap): Set run-on-last-close flag on
child processes, to avoid dead ones "hanging around" after GDB exits.
(attach): Always stop the process if it needs it.  Set RLC flag
when attaching running processes, so it will continue if we detach
it, quit, or are killed.
(detach):  Clear faults and set RLC flag to make process run
when we close it.
(open_proc_file):  New `mode' argument for O_RDONLY or O_RDWR.
Callers changed.
(info_proc):  Open process O_RDONLY, so we can see any process,
even those controlled by debuggers.
* tm-sun4sol2.h (SUN_FIXED_LBRAC_BUG):  They did (in Sol 2).
1992-07-05 10:26:53 +00:00
John Gilmore 2af231b836 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.

* dbxread.c:  Conforming changes.
(struct dbx_symfile_info):  Move to gdb-stabs.h.
(start_psymtab):  Call elfstab_offset_sections to calculate good
offsets for this source file, based on the ELF symbol table info.
(read_ofile_symtab):  Yank N_CATCH, which is dead.
(process_one_symbol, N_CATCH):  Yank.
(", N_FUN, N_FNAME, N_FN, N_FN_SEQ, N_SO, N_SOL, N_ENTRY):
Relocate with SECT_OFF_TEXT.
(", N_STSYM, N_LCSYM, N_ROSYM):  Grope around in the stab string
to distinguish relocatable from absolute symbols.  Then, if not
absolute, do:
(", N_STSYM, N_DSLINE):  SECT_OFF_DATA.
(", N_LCSYM, N_BSLINE):  SECT_OFF_BSS.
(", N_ROSYM):  SECT_OFF_RODATA.
(elfstab_build_psymtabs):  Caller has allocated dbx_symfile_info.
(dbx_symfile_offsets):  Add to translate addr to offset.
1992-07-04 21:03:34 +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
John Gilmore 4c7c6bab1f * dbxread.c (process_one_symbol): Ignore N_MAIN, N_ENDM for Solaris.
* partial-stab.h:  Ignore N_ENDM.
* elfread.c (elf_symtab_read):  Ignore symbols that don't have a
CODE or DATA section attachment.  This eliminates a lot of random
values from shared libraries, which screw up the ordinary symbols
in the address ranges they happen to overlap.
* buildsym.c (define_symbol):  Eliminate special tests
for function types; move into "function" cases in switch statement.
(define_symbol: 'f', 'F', 'P'):  Process all parameter types
in case they define new type numbers.  But ignore them (FIXME).
('k', 'B'):  Ignore const and volatile if we see them (FIXME).
(read_sun_builtin_type):  Add commentary.
1992-07-03 07:08:31 +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
Stu Grossman bf18ac8007 * dbxread.c (dbx_symfile_init): Move more code under hp9000s800
conditional.
* hppabsd-core.c:  Don't include "param.h", include <sys/param.h>
instead.
* remote.c (remote_wait):  Cast signal to void * to avoid warning
from busted HP compiler.
1992-06-25 23:02:57 +00:00
John Gilmore fef9f55c2b * dbxread.c (read_ofile_symtab): Remove N_CATCH special case,
since it is no longer used and burns time for every symbol read.
(process_one_symbol):  Treat N_CATCH like default (complain).
1992-06-24 19:58:57 +00:00
Stu Grossman 7da1e27dd4 * configure.in, dbxread.c, hppa-coredep.c, hppa-pinsn.c,
hppabsd-core.c, hppabsd-tdep.c, hppabsd-xdep.c, hppahpux-tdep.c,
hppahpux-xdep.c, munch, partial-stab.h, tm-hppabsd.h,
tm-hppahpux.h, xm-hppabsd.h, xm-hppahpux.h:  HPPA merge.
1992-06-19 22:43:49 +00:00
John Gilmore 8f86a4e465 * remote.c (getpkt): Error if input exceeds buffer size.
(_initialize_remote):  `set remotedebug' enables packet trace.

* dbxread.c (process_one_symbol:N_FUN):  GCC now produces relative
N_SLINE's, etc, just like Sun cc on Solaris2.

* am29k-tdep.c (read_register_stack, write_register_stack):
Change RSTACK_HIGH_ADDR to rstack_high_address, a user-settable
variable.  Add `set' and `show' commands for it.
* doc/gdb.texinfo:  Document it.

* eval.c:  Avoid residue-by-zero when evaluating without side effects.
(Bug and fix found by Pierre Willard.)

* sparc-tdep.c:  Clean up slightly for Solaris2.
1992-06-19 21:09:54 +00:00
Stu Grossman c72af08913 * dbxread.c (process_one_symbol), partial-stab.h: Ignore
extraneous SO stabs from busted C++ compilers.
1992-06-16 01:43:35 +00:00
Fred Fish 4c07f28d77 * Makefile.in (VERSION): Bump to 4.5.5.
* symtab.c (decode_line_1):  Until C++ support stabilizes, when
	C++ lookups fail, print possibly helpful hint about completion.
	* cplus-dem.c (demangle_signature):  Fix ARM style demangling
	for static data members.
	* dbxread.c (dbx_psymtab_to_symtab_1):  Fix prototype.
	* config/ncr3000.mh (INSTALL):  Don't use /usr/ucb/install,
	it's broken on ncr3000's.
1992-06-15 19:25:13 +00:00
John Gilmore bcbf95597c * dbxread.c (end_psymtab): Only reset texthigh if it's not already
set.  Don't reset our own texthigh, or dependency-only pst's, in
scanning all the rest of the psymtabs.
(process_one_symbol):  Fix comments around N_OBJ, N_OPT, N_UNDF.

* buildsym.h (N_UNDF):  Improve comments.
(N_LSYM, etc):  Skip types without names (":T(0,3)=sfoob...").
1992-06-14 18:10:10 +00:00
John Gilmore 9342ecb944 * dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc.
Add static symbol_table_offset, string_table_offset,
file_string_table_offset, next_file_string_table_offset,
last_function_name.
(add_old_header_file):  Convert error() to complain()t.
(dbx_symfile_read):  Get symbol size via the objfile.
Also get symbol_table_offset.
(dbx_symfile_init):  Record symbol size and count via the objfile.
(dbx_next_symbol_text):  Always add file_string_table_offset when
accessing string table.
(read_dbx_symtab):  Initialize file_string_table_offset to 0.
(SET_NAMESTRING):  Use the offset.
(end_psymtab):  Large kludge to determine addresses where source
files start and end (for the psymtab header).
(psymtab_to_symtab_1):  Set file_string_table_offset before reading.
Get this, symbol size, and symbol offset, from psymtab.
(read_ofile_symtab):  Don't back up one symbol for Solaris2.
Patch up last_source_start_addr if zero in N_SO.
(process_one_symbol):  Add variable function_start_offset.
( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE):  Add ifdef for
BLOCK_ADDRESS_FUNCTION_RELATIVE.
( "", N_OBJ, N_OPT):  Ignore.
(elfstab_build_psymtabs):  New function to read stabs out of
an ELF file.

* Makefile.in:  Accept $(BISON) even though we really want $(YACC).
(gdb):  use GLOBAL_CFLAGS when linking, too.
* partial-stab.h (N_UNDF):  Deal with Sol2 relative stringtab offsets.
(N_OBJ, N_OPT):  Ignore.
('f', 'F'):  Save last function name.

* symfile.h:  Prototype elfstab_build_psymtabs.
* symfile.c:  Add almost-OK debug versions of add_psymbol_*to_list.

* xm-sysv4.h:  Add <limits.h> to avoid conflicting defns in defs.h.
1992-06-13 06:39:27 +00:00
John Gilmore ac88ca205c Lint.
* symfile.c (add_symbol_file_command):  Initialize mapped/readnow.
1992-04-02 10:35:19 +00:00
Fred Fish 3624c87592 Mostly changes to dbxread.c to preserve stringtab's on a per-objfile
basis, for use in expanding psymtabs to full symtabs.  See ChangeLog
for other details.
1992-03-27 01:04:14 +00:00
Fred Fish 80d68b1d49 * coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c,
elfread.c (coff_symfile_finish):  Add function, prototype, and
	add to the xxxx_sym_fns struct for each file type.  Also reformat
	the xxxx_sym_fns vector to a standard format and add comments.
	* coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c,
	elfread.c (xxx_symfile_new_init, xxx_symfile_init, xxx_symfile_read):
	Pass pointer to struct objfile rather than pointer to sym_fns.
	Change references inside each function accordingly.  Allocate any
	symbol file specific info in the per-objfile memory region.
	* dbxread.c (free_and_init_header_files):  Break function into
	free_header_files(), called from dbx_symfile_finish(), and
	init_header_files(), called from dbx_new_init().
	* dbxread.c (dbx_new_init):  Move deallocation things to new
	dbx_symfile_finish function.
	* elfread.c (elf_new_init):  Call buildsym_new_init().
	* objfiles.c (free_objfile): Call the appropriate symfile_finish()
	routine for the objfile before deallocating other stuff.
	* sparc-tdep.c (get_longjmp_target):  Cast target_read_memory arg.
	* symfile.h:  Move struct sym_fns to before struct objfile def.
	Add sym_finish function pointer and change prototypes of other
	function pointers to reflect passing struct objfile pointer rather
	than struct sym_fns pointer.
	* symfile.c:  Remove now obsolete symtab_fns pointer.
	* symfile.c (symfile_init):  Renamed to find_sym_fns, and now only
	locates the correct sym_fns struct for the given objfile.
	* symfile.c (syms_from_objfile, symbol_file_add):  Restructured
	for better support of mapped symbol tables.
	* symfile.c (symbol_file_command):  Remove obsolete code using
	symfile_fns.
	* symfile.h:  Remove duplicate declarations for symfile_objfile,
	entry_point, and object_files.
	* target.c (target_info):  Compare symfile_objfile to NULL.
	* xcoffread.c (aixcoff_new_init):  Move deallocation stuff to
	aixcoff_symfile_finish().
1992-03-19 21:57:15 +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
John Gilmore 021959e249 * xm-sun3os4.h, xm-sun4os4.h: Enable HAVE_MMAP.
* minsyms.c (install_minimal_symbols):  Add bunches to any
existing minsyms in the objfile.  Avoid extra mallocation
by working directly in the obstack.  Remove ignored `mainline' parm.
* coffread.c, dbxread.c, elfread.c, mipsread.c, solib.c, symtab.h,
xcoffread.c:  Change all callers.
* FIXME:  We should be able to eliminate MAINLINE from all the
symbol readers now, with a small bit of work.

* valops.c, value.h:  Lint.
* remote-vx.c:  Add missing break; statement.  Bugfix by
Michael Sclafani, <sclafani@src.dec.com>.
1992-02-22 08:17:01 +00:00
John Gilmore c55e616795 Handle debug symbols in dynamically loaded (relocated) code:
* dbxread.c (read_ofile_symtab):  Fix up N_CATCH better.  Pass
offset to process_one_symbol.
(process_one_symbol):  Take new offset parameter.  Add it into
appropriate symbol types to relocate symbols to loaded addresses.
Handle all possible symbol types, and complain() about types that
we don't expect to see.
* mipsread.c (psymtab_to_symtab_1):  Pass offset of zero to
process_one_symbol (FIXME, should pass real offset).

Misc bugfixes:

* breakpoint.c (resolve_sal_pc):  Split out code to resolve a
sal's PC value.
(set_breakpoint, break_command_1, until_break_command,
catch_command_1, breakpoint_re_set_one):  Use it.
(breakpoint_re_set_one):  Disable bkpts that don't re-set cleanly.
(breakpoint_re_set):  Mention breakpoint number in error messages.
* symtab.h (resolve_sal_pc):  Declare.
* infcmd.c (jump_command):  Use resolve_sal_pc.

* source.c (find_source_lines):  Avoid "Source file is more
recent than executable" when bfd_get_mtime gives 0.
(list_command):  Shorten "FILE, line N" to "FILE:N".

* putenv.c (putenv):  Avoid unportably casting pointers to unsigneds.
1992-01-28 02:57:37 +00:00
Stu Grossman 0bd83fd723 Oops, checked in version with the wrong stuff enabled. Turn it off... 1992-01-28 02:38:11 +00:00
Stu Grossman 3c03b5de58 * dbxread.c (process_one_symbol): Make a first cut at handling
symbol tables generated by Suns acc.
1992-01-28 02:24:08 +00:00
Per Bothner 0cf9329b64 * tm-mips.h: Removed BLOCK_ADDRESS_ABSOLUTE, now that
mips-tfile has been hacked to act more "traditionally."
	* dbxread.c:  Fixed typo in comment.
1992-01-13 23:00:42 +00:00
Per Bothner aab77d5f23 More changes, mostly cleanups from the last set.
Made some more progress in removing duplicate assembly opcode files.
More improvements to how mipsread and to a lesser extent dbxread work.
See the ChangeLog for details.
1991-12-27 21:11:37 +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
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
John Gilmore 4137c5fc0d * buildsym.c: Break out initial malloc sizes.
(record_line):  Record directly in a subfile.  Alloc on demand.
(compare_line_numbers):  Add from xcoffread.c.
(end_symtab):  New params say whether to sort pendings and
linetable.  Patch block stabs if defined.  Shrink linetable before
allocating the symtab.
* buildsym.h:  Delete line_vector* and prev_line_number.  Add
global_stabs and file_stabs for xcoffread.
* dbxread.c (start_subfile):  Move to buildsym.  Change above calls.
* symtab.h:  LINETABLE(symtab) can now be null.  Zap LINELIST.
* symmisc.c, symtab.c:  Cope with null LINETABLEs.
1991-10-27 22:26:02 +00:00
John Gilmore c030245775 Break out symbol-table-building routines
from dbxread.c, so they can be shared with xcoffread.c.
1991-10-26 07:21:30 +00:00
Per Bothner bcccec8c8d Various fixes to improve g++ debugging. See ChangeLog. 1991-10-26 02:05:14 +00:00
Fred Fish 4a35d6e91b Remove the object file specific fields from the partial symbol table
structure and replace them with a pointer to private data for each
different flavor of object file reader to initialize appropriately.
1991-10-24 08:42:20 +00:00
John Gilmore 6150cc735f * dbxread.c (read_dbx_symtab, process_one_symbol): Handle
Sequent N_FN_SEQ like everybody else's N_FN.
1991-10-16 19:38:56 +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 7cefc05e6a * coffread.c, dbxread.c, symfile.c, symmisc.c, symtab.h: Remove
vestiges of typevectors, which were for symsegs and are no longer
used.  (From a question by Eliot Dresselhaus
<dresselh@RFT30.nas.nasa.gov>).
1991-10-04 07:40:21 +00:00
John Gilmore 9bba3334a0 * dbxread.c, coffread.c: static-ize functions that were
gratuitiously external.  (From Fred Fish.)
1991-10-04 06:46:30 +00:00
John Gilmore 5b0a744f98 * c-exp.y: sym->class to SYMBOL_CLASS (sym).
* dbxread.c (dbx_lookup_type):  Keep doubling size of typevector
until it is large enough.
1991-10-04 03:17:46 +00:00
John Gilmore 5bc757e244 * dbxread.c (read_type): Handle error case slightly better.
Make complaint message not C++-specific.

* symtab.c (lookup_symtab_1, lookup_symbol):  "fatal" errors
between symtabs and psymtabs become ordinary error()s.

* dbxread.c (read_dbx_symtab):  Relocate end_of_text_addr
properly, making "end pc" correct in shared lib psymtabs.
(From Guy Harris <guy@auspex.com>.)
1991-10-03 16:35:17 +00:00
John Gilmore 9bb3045288 * dbxread.c: Enable, but soften, const_vol_complaint.
(read_dbx_symtab):  N_STSYM and N_LCSYM define static vars.
Ditto Gould N_NBSTS and N_NBLCS.  Also, all types in the psymtab
should be file-scope, not global.
(read_struct_type):  Remove ancient multiple-inheritance warning.
(read_range_type):  Check base type, complain & patch if undefined.
1991-10-01 13:29:10 +00:00
John Gilmore 0c4d2cc2b3 * symfile.c (allocate_symtab): New fn, consolidates the work
of allocating and initializing a new struct symtab.  Set the
language of the symtab based on its filename extension.
* symfile.h:  Declare it.
* mipsread.c (new_symtab):  Use it.  Minor formatting changes.
* dbxread.c (end_symtab):  Use it.

* mipsread.c (parse_symbol, case stParam and stProc):  Add #if 0'd
code for saving types of parameters with each function definition.
* dbxread.c (define_symbol, function and parameter cases):  Ditto.
(read_dbx_symtab, case N_DEFD):  Ignore.
(read_enum_type):  Recognize FALSE/TRUE enum as Modula-2 BOOLEAN
type.
(read_range_type):  Rename MAX_OF_TYPE to MAX_OF_C_TYPE, etc.
#if 0 out its uses, though, since they set a dead value.
* coffread.c (end_symtab):  Use allocate_symtab.
(process_coff_symbol):  #if 0'd for functions and params as above.
(read_enum_type):  Recognize Modula-2 BOOLEAN.
1991-09-19 02:32:35 +00:00
Michael Tiemann 9404978d0b Fixed two C++ related bugs. 1991-08-19 14:40:50 +00:00
John Gilmore c3a2180180 Eliminate LOC_EXTERNAL. Improve select_source_symtab. Bug fixes. 1991-07-19 06:45:19 +00:00
John Gilmore d11c44f1ee Roll in Tiemann changes for gcc -ansi. Fix assorted bugs. See ChangeLog. 1991-05-30 08:52:52 +00:00
John Gilmore dcc355360e Update bfd_h_get{short,long} to bfd_h_get{_16,_32} for basic type size
independence.
1991-05-29 00:13:44 +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
John Gilmore 639893384d Merge devo/bfd with GDB's bfd.
Get getopt and obstack from -liberty rather than compiling them here.
* coffread.c: turn a printf into a complain(), and try to deal more
gracefully with botched-looking lineno pointers.
* dbxread.c:  Use bfd_get_symcount rather than bfd_get_symcount_upper_bound.
Don't coredump on files with zero symbols in them (a BFD bug showed this one).
* environ.c:  Pass GNUTARGET into the parent (gdb) as well as the child.
1991-05-02 03:39:15 +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 62c4f98b2b dbxread.c (read_type): If we get "##", don't lookup_function_type
and start clobbering it; allocate_stub_method instead.
	* dbxread.c (read_struct_type): Put "op$" instead of "operator"
	in the symbol table.
	* dbxread.c (read_struct_type): Set fcontext to 0 for normal member
	function.
	* dbxread.c (read_struct_type): Initialize name to 0.
	* dbxread.c (read_ofile_symtab, N_CATCH): Add offset to bufp->n_value.
	* dbxread.c (dbx_create_type): Zero TYPE_VPTR_BASETYPE.
	(read_struct_type): Don't bother to set TYPE_VTPR_{BASETYPE,FIELDNO}
	if it's just going to be {0,1}.

	* dbxread.c (virtual_context): Use TYPE_BASECLASS starting at 0
	(yes, it's #if 0, but just in case...).
1991-04-26 22:59:00 +00:00
Jim Kingdon 9107291db4 * main.c (cd_command): Call dont_repeat.
* dbxread.c (read_struct_type): If const/volatile character is
	missing, don't complain, just continue.

	* dbxread.c (read_struct_type): Only try to read the fcontext if
	it is there.  Also change "error_type " to "return error_type ".
	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.

	* dbxread.c (read_struct_type): Fix typo: *pp != '\0' -> **pp != '\0'.
1991-04-24 00:08:50 +00:00
Jim Kingdon 9a822037b1 *** empty log message *** 1991-04-23 01:11:11 +00:00
John Gilmore 3f83182d58 * dbxread.c (end_symtab, end_psymtab): Change comments.
(initialize_dbxread):  Call dbx_new_init() in case the first
        command is add-symbols.
1991-04-19 01:19:15 +00:00
John Gilmore f96238813e Permit symbols to be superseded when new symbol files have
been read in, particularly for VxWorks.

        * dbxread.c (read_dbx_symtab): Allow N_SOL to cleanly take us back
        to the main file, as well as to include files.  Also, put global
        functions into the global psymtab, to make "i fun" work.
        (end_psymtab):  Free named symtabs and psymtabs for a file, once a
        new psymtab for it has been read.
1991-04-13 21:51:28 +00:00
John Gilmore 66eeea27cc *** empty log message *** 1991-04-06 02:11:43 +00:00
John Gilmore 3f2e006b77 *** empty log message *** 1991-04-05 09:02:10 +00:00
K. Richard Pixley bd5635a1e2 Initial revision 1991-03-28 16:26:26 +00:00
John Gilmore 831c851165 Initial revision 1990-09-05 17:54:31 +00:00
gdb-3.5 7a67dd45ca gdb-3.5 2012-06-03 15:36:32 +01:00
gdb-3.4 1c997a4ae8 gdb-3.4 2012-06-03 15:36:32 +01: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.3 7c75bab3d3 gdb-2.5.3 2012-06-03 15:36:30 +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