Commit Graph

56 Commits

Author SHA1 Message Date
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Andrew Cagney 8e65ff28b0 Add __FILE__ and __LINE__ parameter to internal_error() /
internal_verror().
2001-02-08 06:03:54 +00:00
Jim Blandy 090c42a489 * dwarf2read.c (read_tag_const_type, read_tag_volatile_type):
Implement these correctly, using make_cv_type.
2001-01-24 00:22:47 +00:00
Kevin Buettner b8c9b27d1e Replace free() with xfree(). 2000-12-15 01:01:51 +00:00
Michael Snyder 88496bb5c6 2000-12-08 Michael Snyder <msnyder@mvstp600e.cygnus.com>
* dwarf2read.c (DWARF2_REG_TO_REGNUM): New macro.  Provide default
        definition.  Will be used to translate between the compiler's
        register numbering and GDB's (for register variables etc).
        (new_symbol): Use DWARF2_REG_TO_REGNUM to translate register ids.
2000-12-08 20:12:36 +00:00
Daniel Berlin b3810801a5 2000-11-07 Daniel Berlin <dberlin@redhat.com>
* dwarf2read.c: Revert June 5th change for caching of types,
        as per Jim Blandy's request.
2000-11-08 02:50:51 +00:00
Kevin Buettner a275699e3a In new_symbol(), relocate symbol address by base address of the section
it is in instead of using the base address of the .text section.
2000-11-03 22:38:38 +00:00
Kevin Buettner 679ebd0f9c Fix date in comment. 2000-08-04 16:51:47 +00:00
Kevin Buettner 613e165759 DWARF2.1 64-bit support. 2000-08-04 16:25:30 +00:00
Kevin Buettner fba45db2fa Protoization. 2000-07-30 01:48:28 +00:00
Jim Blandy 8713b1b135 * dwarf2read.c (read_structure_scope): Correct overzealous
addition of cu_header argument.
2000-07-24 17:07:26 +00:00
Andrew Cagney 107d2387e3 Eliminate global address_size. Replace with function
read_comp_unit_head() and ``struct compu_unit_head'' parameter.
Include support for signed address case.
Fixes problem of global address size / sign being out-of-sync with
with current section.
2000-07-24 01:26:10 +00:00
Andrew Cagney 7f0e3f52b0 From Richard Henderson <rth@cygnus.com>:
* dwarf2read.c (dwarf2_empty_hash_tables): Renamed from
dwarf2_empty_die_ref_table; zero dwarf2_cached_types as well.
Update all callers.
2000-07-18 07:47:02 +00:00
Jim Blandy ce5d95e1bc 2000-06-14 Jim Blandy <jimb@redhat.com>
* dwarf2read.c (dump_die): Use the proper printf format for
	printing DW_UNSND values; they're longs now.

	* dwarf2read.c (dump_die): We can read DW_FORM_data8 now, on
	at least some platforms, so print it out too.

2000-06-14  James E. Wilson  <wilson@bletchleypark.cygnus.com>

	* dwarf2read.c (struct attribute): Change unsnd and snd field types
	to long.
	(read_8_bytes): Change return type to long.
	(read_unsigned_leb128): Change return type to long.  Change type of
	local result to long.  Cast argument of left shift to long.
	(read_signed_leb128): Likewise.
2000-06-14 23:29:06 +00:00
Daniel Berlin 357e46e7c9 C++ improvements 2000-06-05 20:49:53 +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
Kevin Buettner bf9198f149 Fix typo in sign extension code in dwarf2_const_value_data(). 2000-05-13 00:51:35 +00:00
Philippe De Muyter c13c43fdda * ax-gdb.c (agent_command): Remove now useless cast of
`free_current_contents' when passed to `make_cleanup'.
	* coffread.c (coff_symfile_read): Ditto.
	* dwarf2read.c (dwarf2_add_member_fn, read_array_type): Ditto.
	(dwarf_decode_lines): Ditto.
	* eval.c (parse_and_eval_address, parse_and_eval_address_1): Ditto.
	(parse_and_eval, parse_to_comma_and_eval): Ditto.
	* parse.c (parse_exp_1): Ditto.
	* printcmd.c (print_command_1, output_command, set_command): Ditto.
	(x_command, print_frame_args, printf_command): Ditto.
	* top.c (execute_control_command): Ditto.
	* tracepoint.c (validate_actionline): Ditto.
	* typeprint.c (whatis_exp, ptype_command): Ditto.
	(maintenance_print_type): Ditto.
2000-04-26 12:41:48 +00:00
Jim Blandy 64367e0abc * dwarf2read.c: Revert Andrew Cagney's change of Dec 15, 1997.
Don't include "bfd-elf.h".
(address_significant_size): Delete variable.
(dwarf2_build_psymtabs_hard): Don't set it, or check for
consistency between it and the Dwarf 2 compilation unit header
address size.
(read_address): Don't mask off bits above
address_significant_size.
* Makefile.in (dwarf2read.o): Don't depend on $(elf_bfd_h).
(elf_bfd_h): Remove variable; it's no longer used.
2000-04-08 22:35:35 +00:00
Andrew Cagney 244106e863 Read 2 byte (16 bit addresses) when needed. 2000-02-29 05:10:04 +00:00
Andrew Cagney 3ca72b44a8 From Jason Merrill: (die_is_declaration): New fn.. 2000-02-14 04:37:06 +00:00
Jason Molenda dfcd3bfb6f import gdb-2000-02-04 snapshot 2000-02-05 07:30:26 +00:00
Jason Molenda 2df3850c7b import gdb-1999-10-11 snapshot 1999-10-12 04:37:53 +00:00
Jason Molenda 2acceee218 import gdb-1999-10-04 snapshot 1999-10-05 23:13:56 +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
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
Stu Grossman 4cffc916c1 * dwarf2read.c (dump_die): Change stderr gdb_stderr.
* expprint.c (print_subexp):  fprintf => fprintf_unfiltered.
	* jv-typeprint.c (java_type_print_base):  fputs => fputs_filtered.
	* stack.c (struct function_bounds):  Remove superfluous `typedef'.
	* symfile.c (list_overlays_command):  stdout => gdb_stdout.
	* symmisc.c (maintenance_check_symtabs):  stdout => gdb_stdout.
	* utils.c (print_spaces):  Make more efficient.
1999-01-11 21:51:39 +00:00
David Taylor 4770ff087a Start of HP merge changes to GDB. 1998-12-10 21:25:43 +00:00
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
Peter Schauer b0a5badb69 * dwarf2read.c (dwarf2_build_psymtabs_hard): Do not adjust the
address range of a compilation unit without children.

	* mdebugread.c (parse_partial_symbols):  Fix handling of stabs
	continuations, use xmalloc and xrealloc.
1998-10-11 19:54:57 +00:00
Zdenek Radouch e01b420025 Modifications/fixes to support the ARM/ELF port. 1998-09-01 16:24:23 +00:00
Peter Schauer be5f18e140 * dwarf2read.c (read_subroutine_type): Set TYPE_FLAG_PROTOTYPED
on C++ functions.
	* valops.c (value_arg_coerce):  Add new argument to indicate whether
	the function has a prototype, handle integer and float promotions
	accordingly.
        (call_function_by_hand):  Always call value_arg_coerce, pass down
	prototype information.
1998-05-23 09:31:41 +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
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
Andrew Cagney e7ab2a476e (Mostly from Gavin Koch)
In dwarf2read.c, if the ABI is 32 bit and 64 bit addresses are encountered
discard the most significant 32 bits.
Use CORE_ADDR for address variables instead of long.
Add more explicit tx49 configur target.
Check/use sigaction/SA_RESTART in remote-sim.c
1997-12-15 12:38:05 +00:00
Andrew Cagney 70a46de24e (CVS is doing wierd things)
Re-checkin fixes to code verifying dwarf debug info CU headers before
using it.
1997-12-10 23:11:20 +00:00
Andrew Cagney 760410e55a * dwarf2read.c (dwarf2_build_psymtabs_hard): Check cu_header.length is
within dwarf_info_buffer not dwarf_abbrev_buffer.
1997-12-10 06:30:04 +00:00
Andrew Cagney 3199620a49 Check the abbrev offset found in the .debug_info section before using
it.
1997-11-26 12:35:07 +00:00
Dawn Perchik 6850646060 * dwarf2read.c (dwarf2_build_psymtabs_hard): Handle the case
where a compilation unit die has no children (DW_TAG_compile_unit
	has DW_children_no).
	(scan_partial_symbols): Add comment for nesting_level.
1997-11-01 01:28:26 +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
Peter Schauer e7e98487ba * dwarf2read.c (dwarf2_linkage_name): New function to get
the linkage name of a die from DW_AT_MIPS_linkage_name or
	DW_AT_name.
	(read_func_scope, dwarf2_add_field, dwarf2_add_member_fn,
	new_symbol):  Use it instead of accessing DW_AT_name.
	(read_partial_die):  Use DW_AT_MIPS_linkage name as name of the
	partial die if present.
	(dwarf2_add_member_fn):  Make a copy of physname on the type obstack.
1997-02-08 09:16:26 +00:00
Peter Schauer 5499537344 * dwarf2read.c: Replace integral tag, name and form fields in
internal structure definitions with the corresponding enumeration
	types from dwarf2.h. Add default cases to switches on enumerations
	where appropriate.
	Make quoting of string arguments in complaint messages consistent.
	Check for NULL returns from DW_STRING.
	(struct partial_die_info):  Add sibling and has_type fields, remove
	unused value field.
	(DW_*):  Move access macro definitions near the definition of the
	attribute structure.
	(struct field_info):  New structure to pass information about fields
	and member functions between die processing routines.
	(dwarf2_build_psymtabs_hard):  Set cu_header_offset.
	(scan_partial_symbols):  Do not enter DW_TAG_subprogram dies into
	the partial symbol table if the DW_AT_*_pc attributes are missing.
	Add file scope base type definitions to the partial symbol table.
	Skip over child dies if the die has a sibling attribute.
	(add_partial_symbol):  Enter global variables with type attributes
	and without location descriptors into the partial symbol table.
	Store value of DW_TAG_variable dies in the partial symbol table.
	Do not enter global variables into the minimal symbol table.
	Add base type definitions to the partial symbol table.
	(psymtab_to_symtab_1):  Use dwarf2_get_pc_bounds to determine highpc.
	(process_die):  Move check for DW_AT_low_pc to read_func_scope.
	Add a typedef symbol for base type definitions to the symbol table.
	Ignore DW_TAG_inlined_subroutine tags for now.
	(read_file_scope):  Use dwarf2_get_pc_bounds to determine pc bounds.
	(read_func_scope, read_lexical_block_scope):  Use dwarf2_get_pc_bounds
	to determine pc bounds, ignore dies with invalid bounds.
	(dwarf2_get_pc_bounds):  New routine to extract and validate the
	DW_AT_*_pc attributes of a die.
	(dwarf2_add_field, dwarf2_attach_fields_to_type, skip_member_fn_name,
	dwarf2_add_member_fn, dwarf2_attach_fn_fields_to_type):
	New functions to handle fields and member functions.
	(read_structure_scope):  Rewritten to use them.
	(read_array_type):  Renamed from dwarf_read_array_type.
	Default upper array bound to describe an array with unspecified
	length.
	Create array types in backwards order, as dwarf2 puts out the array
	dimensions from left to right.
	(read_subroutine_type):  Handle DW_TAG_unspecified_parameters,
	DW_AT_artificial and DW_AT_prototyped.
	(read_base_type):  Make an unsigned type for DW_ATE_boolean.
	Pass objfile to dwarf_base_type.
	(read_partial_die):  Use read_attribute to read in the attributes.
	Handle DW_AT_sibling and DW_AT_type.
	Follow references when determining DW_AT_name and DW_AT_external
	attributes of the die.
	Validate DW_AT_*_pc attributes.
	(read_full_die):  Use read_attribute to read in the attributes.
	(read_attribute):  New function to read an attribute described
	by an abbreviated attribute.
	(new_symbol):  Relocate symbol value for DW_TAG_label with baseaddr.
	Do not set SYMBOL_VALUE_ADDRESS for DW_TAG_subprogram,
	SYMBOL_BLOCK_VALUE for the symbol will be set later by finish_block.
	Change symbol class for global variables with a zero valued location
	descriptor to LOC_UNRESOLVED.
	Handle DW_AT_const_value attributes for DW_TAG_variable,
	DW_TAG_formal_parameter and DW_TAG_enumerator.
	Build a typedef symbol for DW_TAG_base_type.
	(dwarf2_const_value):  New routine to copy a constant value from an
	attribute to a symbol.
	(dwarf_base_type):  Use passed in objfile, not current_objfile
	when calling dwarf2_fundamental_type.
	(dump_die):  Use DW_* accessor macros to access values of attributes.
	(decode_locdesc):  Handle DW_OP_plus_uconst.
1997-01-25 08:09:53 +00:00