Commit Graph

202 Commits

Author SHA1 Message Date
Mark Kettenis 917c78fc59 * dwarf2read.c: Fix formatting. 2004-11-10 20:40:33 +00:00
Mark Kettenis a738430dd6 * dwarf2read.c (struct comp_unit_head): Fix coding style.
(dwarf_decode_line_header): Likewise.
2004-10-19 20:28:56 +00:00
Joel Brobecker bc5f45f8ff * dwarf2read.c (set_cu_language): Set language to Ada for
DW_LANG_Ada83 and DW_LANG_Ada95.
2004-10-16 00:41:00 +00:00
Corinna Vinschen 1326e61ba3 * dwarf2read.c (read_subroutine_type): Call make_function_type
instead of lookup_function_type.
2004-10-06 08:46:21 +00:00
Daniel Jacobowitz 10b3939b33 * dwarf2read.c (REF_HASH_SIZE): Move earlier.
(die_ref_table): Remove.
	(struct dwarf2_cu): Add DIES, DEPENDENCIES, and DIE_REF_TABLE.
	(struct dwarf2_per_cu_data): Add PSYMTAB.  Add a comment describing
	the usage of this type.
	(struct dwarf2_per_objfile): Update comment for ALL_COMP_UNITS.
	(struct dwarf2_pinfo, PST_PRIVATE, DWARF_INFO_OFFSET): Remove.
	(struct dwarf2_queue_item, dwarf2_queue, dwarf2_queue_tail): New.
	(dwarf2_create_include_psymtab): Update comment.
	(find_partial_die): Remove third argument.  Remove unreachable call
	to error ().
	(dwarf2_find_containing_comp_unit): Update comments.  Change one
	assertion to an error.  Remove an unreachable error.
	(dwarf2_find_comp_unit): Update comments.
	(type_at_offset): Remove dead code.
	(make_cleanup_free_die_list, dwarf2_empty_hash_tables): Remove.
	(store_in_ref_table): Add CU argument.
	(follow_die_ref): Take DIE, attribute, and CU arguments.  Handle
	inter-compilation-unit references.
	(load_full_comp_unit, process_full_comp_unit): New functions, based
	on psymtab_to_symtab_1.
	(psymtab_to_symtab_1): Use them.
	(dwarf2_add_dependence): New function.
	(dwarf2_build_psymtabs_hard): Set the psymtab in per_cu.  Always create
	a per_cu structure, and save it in READ_PSYMTAB_PRIVATE.
	(partial_die_parent_scope, guess_structure_name): Update for changes
	to find_partial_die.
	(dwarf2_psymtab_to_symtab): Initialize dwarf2_per_objfile here.
	(queue_comp_unit, process_queue, dwarf2_release_queue): New.
	(read_comp_unit): Don't call dwarf2_empty_hash_tables.
	(read_die_and_children): Update call to store_in_ref_table.
	(do_free_die_list_cleanup): Remove.
	(fixup_partial_die): Update for changes to find_partial_die.
	(read_full_die): Handle queueing absolute references.
	(read_attribute_value): Use DW_ADDR for all DW_FORM_ref* forms.
	(dwarf2_attr, die_specification, die_type)
	(die_containing_type, dwarf2_extension): Update calls to
	follow_die_ref.
	(dump_die): Update DW_FORM_ref* handling.
	(dwarf2_get_ref_die_offset): Likewise.
	(free_one_comp_unit): Release the dies list.
	(dwarf2_mark_helper): New function.
	(dwarf2_mark): Use it.
2004-10-05 17:53:26 +00:00
Daniel Jacobowitz dd5e69327d * dwarf2read.c (read_subrange_type): Add comment for variable
sized arrays.
2004-10-03 16:16:01 +00:00
Daniel Jacobowitz 1c379e2004 * dwarf2read.c (struct dwarf2_per_cu_data): New field type_hash.
(struct dwarf2_offset_and_type): New.
	(set_die_type, reset_die_and_siblings_types, get_die_type)
	(offset_and_type_hash, offset_and_type_eq): New functions.
	(read_structure_type, read_enumeration_type, read_array_type)
	(read_namespace, read_tag_pointer_type, read_tag_ptr_to_member_type)
	(read_tag_reference_type, read_tag_const_type)
	(read_tag_volatile_type, read_tag_string_type, read_subroutine_type)
	(read_typedef, read_base_type, read_subrange_type): Use
	set_die_type.
2004-09-21 15:04:41 +00:00
Daniel Jacobowitz ae038cb03c gdb/doc/
* gdb.texinfo (Maintenance Commands): Document "maint set dwarf2
	max-cache-age" and "maint show dwarf2 max-cache-age".
gdb/
	* Makefile.in (dwarf2read.o): Update dependencies.
	* dwarf2read.c: Include "command.h" and "gdbcmd.h".
	(struct dwarf2_per_objfile): Add all_comp_units, n_comp_units,
	and read_in_chain.
	(struct dwarf2_cu): Add read_in_chain, per_cu, last_used,
	mark, and has_form_ref_addr.
	(struct dwarf2_per_cu_data): New.
	(dwarf2_max_cache_age): New.
	(dwarf2_build_psymtabs_hard): Free cached compilation units
	after loading.  Create and manage the list of compilation units.
	Remove unnecessary NULL initialization.  Fix indentation.
	(psymtab_to_symtab_1): Initialize all of CU.
	(dwarf2_read_abbrevs): Set has_form_ref_addr.
	(find_partial_die): Use dwarf2_find_containing_comp_unit
	and load_comp_unit.
	(free_stack_comp_unit): Update comments.  Clear the per-cu
	pointer.  Handle aging.
	(dwarf2_find_containing_comp_unit, free_cached_comp_units)
	(age_cached_comp_units, free_one_cached_comp_unit)
	(dwarf2_mark, dwarf2_clear_marks, create_all_comp_units)
	(load_comp_unit, dwarf2_find_comp_unit, free_one_comp_unit)
	(set_dwarf2_cmdlist, show_dwarf2_cmdlist, set_dwarf2_cmd)
	(show_dwarf2_cmd): New.
	(_initialize_dwarf2_read): Provide "maint set dwarf2 max-cache-age"
	and "maint show dwarf2 max-cache-age".
	* gdbcmd.h (maintenance_set_cmdlist, maintenance_show_cmdlist): New
	externs.
	* maint.c (maintenance_set_cmdlist, maintenance_show_cmdlist): Make
	global.
2004-09-20 22:26:21 +00:00
Jeff Johnston 987504bb93 2004-09-20 Jeff Johnston <jjohnstn@redhat.com>
* dwarf2read.c (typename_concat): Change prototype to accept obstack
        and dwarf2_cu struct pointer as arguments.  Change function to use
        obstack if provided and use dwarf2_cu to determine language-specific
        separator.
        (partial_die_parent_scope): Change comment to include java.  Use
        new version of typename_concat instead of obconcat.
        (partial_die_full_name): Use typename_concat.
        (read_namespace): Ditto.
        (read_enumeration_type): Use typename_concat instead of obconcat.
        (new_symbol): Ditto.
        (add_partial_symbol): Enhance tests for C++ to also test for Java.
        (guess_structure_name): Ditto.
        (read_subroutine_type): Ditto.
        (read_structure_type): Ditto.
        (is_vtable_name): Add Java support.
        (determine_class_name): Switch to new typename_concat call.
        (determine_prefix): Switch to new typename_concat call.
        * jv-exp.y (FuncStart): New pattern.
        (MethodInvocation): Add support for simple function calls.  Change
        warning message for other forms of inferior call currently not
        supported.
        * valarith.c (value_subscript): Treat an array with upper-bound
        of -1 as unknown size.
2004-09-20 20:18:39 +00:00
Jim Blandy 1168df017b * dwarf2read.c (is_vtable_name): New function, based on logic from
read_structure_type, but passing the correct length to strncmp,
and using 'sizeof' instead of 'strlen'.
(read_structure_type): Call it.
2004-09-01 04:19:22 +00:00
David Lecomber 7ca2d3a371 2004-08-29 David Lecomber <david@streamline-computing.com>
Fix PR gdb/648
	* language.h (enum array_ordering): New enum.
	* language.h (struct language_defn): New la_array_ordering
	attribute.
	* language.c (unknown_language_defn, auto_language_defn)
	(local_language_defn): Ditto.
	* ada-lang.c (ada_language_defn): Ditto.
	* c-lang.c (c_language_defn, cplus_language_defn)
	(asm_language_defn, minimal_language_defn): Ditto.
	* f-lang.c (f_language_defn): Ditto.
	* jv-lang.c (java_language_defn): Ditto.
	* m2-lang.c (f_language_defn): Ditto.
	* objc-lang.c (objc_language_defn): Ditto.
	* p-lang.c (pascal_language_defn): Ditto.
	* scm-lang.c (scm_language_defn): Ditto.
	* eval.c (evaluate_subexp_standard): Assume Fortran arrays are
	oriented large to small in type structure.
	* dwarf2read.c (read_array_order): New function.
	(read_array_type): Use read_array_order to check row/column
	major ordering.
2004-08-29 10:12:24 +00:00
Joel Brobecker aa495d1148 * dwarf2read.c (dwarf_decode_lines): Do not consider the current
file as included until we record the first line in the linetable.
2004-08-02 01:25:57 +00:00
David Lecomber b0f35d5835 2004-07-30 David Lecomber <dsl@sources.redhat.com>
* dwarf2read.c (read_file_scope): Set producer if attribute
	present.
	(struct dwarf2_cu): Added new member producer.
2004-07-30 12:22:27 +00:00
Jeff Johnston 31c27f7773 2004-07-06 Jeff Johnston <jjohnstn@redhat.com>
* language.h (struct_language_defn): Add new function pointer:
        la_class_name_from_physname.  Also add new prototype for
        language_class_name_from_physname.
        * language.c (language_class_name_from_physname): New function.
        (unk_lang_class_name): Ditto.
        (unknown_language_defn, auto_language_defn): Change
        to add unk_lang_class_name function pointer for
        la_class_name_from_physname.
        (local_language_defn): Ditto.
        * dwarf2read.c (guess_structure_name): Change to call
        language_class_name_from_physname.
        (determine_class_name): Ditto.
        * cp-support.c (class_name_from_physname): Renamed.
        (cp_class_name_from_physname): New name of function.
        * cp-support.h: Ditto.
        * c-lang.c (c_language_defn): Change to add NULL
        for class_name_from_physname function pointer.
        (cplus_language_defn): Change to add cp_class_name_from_physname.
        * jv-lang.c (java_class_name_physname): New function.
        (java_find_last_component): New static routine.
        (java_language_defn): Add java_class_name_from_physname pointer.
        * ada-lang.c (ada_language_defn): Change to add NULL
        for class_name_from_physname function pointer.
        * f-lang.c (f_language_defn): Ditto.
        * m2-lang.c (m2_language_defn): Ditto.
        * objc-lang.c (objc_language_defn): Ditto.
        * p-lang.c (pascal_language_defn): Ditto.
        * scm-lang.c (scm_language_defn): Ditto.
2004-07-06 19:29:31 +00:00
Andrew Cagney eedc19af03 2004-06-24 Andrew Cagney <cagney@gnu.org>
* objfiles.h (struct entry_info): Delete entry_func_lowpc and
	entry_func_highpc fields.
	* objfiles.c (init_entry_point_info): Do not clear
	entry_func_lowpc and entry_func_highpc.
	(objfile_relocate): Do not relocate entry_func_lowpc and
	entry_func_highpc.
	* dwarfread.c (read_func_scope): Do not set entry_func_lowpc and
	entry_func_highpc.
	* dwarf2read.c (read_func_scope): Do not set entry_func_lowpc and
	entry_func_highpc.
	* blockframe.c (legacy_frame_chain_valid): Replace tests against
	entry_func_lowpc and entry_func_highpc with call to
	inside_entry_func.
2004-06-24 20:42:42 +00:00
Daniel Jacobowitz 473b7be660 PR gdb/1658
* dwarf2read.c (dwarf_decode_lines): Read the length of the extended
	operation as a uleb128.  Found by Michael Coulter.
2004-06-16 17:16:15 +00:00
Alan Modra 2c500098f2 * dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of
bfd_get_section_size_before_reloc or _raw_size.
	* dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
	* dwarf2read.c (dwarf2_locate_sections): Likewise.
	(dwarf2_read_section): Likewise.
	* elfread.c (elf_locate_sections): Likewise.
	* gcore.c (derive_heap_segment): Likewise.
	* mipsread.c (read_alphacoff_dynamic_symtab): Likewise.
	* remote-e7000.c (e7000_load): Likewise.
	* remote-m32r-sdi.c (m32r_load): Likewise.
	* remote-mips.c (mips_load_srec): Likewise.
	(pmon_load_fast): Likewise.
	* remote.c (compare_sections_command): Likewise.
	* symfile.c (add_section_size_callback): Likewise.
	(load_section_callback): Likewise.
	(pc_in_unmapped_range): Likewise.
	(pc_in_mapped_range): Likewise.
	(sections_overlap): Likewise.
	(list_overlays_command): Likewise.
	(simple_overlay_update_1): Likewise.
	(simple_overlay_update): Likewise.
	* tracepoint.c (remote_set_transparent_ranges): Likewise.
	* win32-nat.c (core_section_load_dll_symbols): Likewise.
2004-06-15 01:04:20 +00:00
Bob Rossi 57c22c6ce1 Add the -file-list-exec-source-files command to MI. 2004-06-10 20:05:45 +00:00
Andrew Cagney 73c1e0a129 2004-05-07 Andrew Cagney <cagney@redhat.com>
* objfiles.h (struct entry_info): Delete unused fields
	deprecated_entry_file_lowpc and deprecated_entry_file_highpc.
	* objfiles.c (init_entry_point_info, objfile_relocate): Update.
	* mipsread.c (mipscoff_symfile_read): Update.
	* mdebugread.c (parse_partial_symbols): Update.
	* dwarfread.c (read_file_scope): Update.
	* dwarf2read.c (read_file_scope): Update.
	* dbxread.c (read_dbx_symtab, read_dbx_symtab): Update.
	* coffread.c (complete_symtab): Update.
2004-05-07 14:29:34 +00:00
Joel Brobecker 58a9656eb6 * dwarf2read.c (dwarf2_create_include_psymtab): Fix build
failure detected by recent versions of GCC.
        (psymtab_to_symtab_1): No longer use the PST_PRIVATE macro
        to be consistent with the usage in dwarf2_create_include_psymtab.
2004-05-04 00:11:25 +00:00
Joel Brobecker aaa75496b0 * dwarf2read.c (line_header): Add new included_p field in
field file_names.
        (partial_die_info): New field has_stmt_list. New field line_offset.
        (dwarf2_create_include_psymtab): New function.
        (dwarf2_build_include_psymtabs): New function.
        (add_file_name): Add forward declaration. Initialize new field.
        (dwarf_decode_lines): Add new parameter. Enhance this procedure
        to be able to determine the list of files included by the
        given unit, and build their associated psymtabs.
        (dwarf2_build_psymtabs_hard): Build the psymtabs for the included
        files as well.
        (psymtab_to_symtab_1): Build the symtabs of all dependencies as well.
        (read_file_scope): Update call to dwarf_decode_lines.
        (read_partial_die): Handle DW_AT_stmt_list attributes.
2004-05-03 16:21:51 +00:00
Daniel Jacobowitz 7b5a2f43eb * dwarf2read.c (dwarf2_tmp_obstack, dwarf2_free_tmp_obstack):
Delete.
	(dwarf_alloc_block): Take a CU argument.  Use the comp_unit_obstack.
	(read_attribute_value): Update calls to dwarf_alloc_block.
	(dwarf2_build_psymtabs_hard): Don't initialize or clean up
	dwarf2_tmp_obstack.
	(psymtab_to_symtab_1): Likewise.  Clean up using
	free_stack_comp_unit.
	(add_to_cu_func_list): Use the comp_unit_obstack.
2004-04-19 18:20:50 +00:00
Joel Brobecker 05cf31d198 * dwarf2read.c (dwarf2_flag_true_p): New function.
(die_is_declaration): Use the function above. Add some comments.
2004-04-19 18:12:00 +00:00
Joel Brobecker 7867684d06 * dwarf2read.c: Back out my previous change, it was incorrect. 2004-04-16 16:12:52 +00:00
Daniel Jacobowitz 72bf949259 * dwarf2read.c: Include "hashtab.h".
(struct dwarf2_cu): Add partial_dies, comp_unit_obstack,
	has_namespace_info.
	(struct partial_die_info): Add comments.  Use bitfields to reduce
	memory footprint.  Add scope, scope_set, has_specification,
	spec_offset, die_parent, die_child, and die_sibling.
	(peek_die_abbrev): Add prototype.
	(partial_read_comp_unit_head): New function, broken out from
	dwarf2_build_psymtabs_hard.
	(dwarf2_build_psymtabs_hard): Remove unused variable abbrev_ptr.
	Use partial_read_comp_unit_head.  Initialize the CU and
	comp_unit_obstack.  Update calls to read_partial_die and
	scan_partial_symbols.  Use free_stack_comp_unit and
	load_partial_dies.
	(scan_partial_symbols): Change PDI to a pointer.  Use the child and
	sibling pointers to walk partial DIEs.  Call fixup_partial_die.
	Update calls to helper functions.  Remove NAMESPACE argument.
	Update comments.
	(partial_die_parent_scope, partial_die_full_name): New functions.
	(add_partial_symbol): Remove namespace argument.  Update call to
	pdi_needs_namespace.  Use partial_die_full_name.  Handle
	DW_TAG_namespace.  Check has_namespace_info flag.
	(pdi_needs_namespace): Remove NAMESPACE argument.  Just check the
	tag.  Handle namespaces.
	(add_partial_namespace, add_partial_enumeration): Simplify.
	(guess_structure_name): New function, derived from
	add_partial_structure.
	(add_partial_structure): Remove.
	(determine_class_name): Update comment.
	(dwarf2_read_abbrevs): Set has_namespace_info flag.
	(is_type_tag_for_partial, load_partial_dies): New functions.
	(read_partial_die): Pass abbrev and abbrev_len as arguments.
	Record specifications instead of following them immediately.
	(find_partial_die_in_comp_unit, find_partial_die)
	(fixup_partial_die, free_stack_comp_unit)
	(hashtab_obstack_allocate, dummy_obstack_deallocate)
	(partial_die_hash, partial_die_eq): New functions.
	* Makefile.in (hashtab_h): Define.
	(dwarf2read.o): Update dependencies.
	(observer_inc, observer_h): Move to the correct section.
2004-04-16 15:18:23 +00:00
Joel Brobecker fdc860a37e * dwarf2read.c (dwarf2_attribute_true_p): New function.
(die_is_declaration): Use the function above.
2004-04-16 04:31:25 +00:00
Joel Brobecker dc718098ad * dwarf2read.c (read_structure_scope): Identify stub types
using die_is_declaration() only.
2004-04-16 03:17:25 +00:00
Daniel Jacobowitz 6502dd734b * dwarf2read.c (dwarf2_objfile_data_key): New.
(struct dwarf2_per_objfile, dwarf2_per_objfile): New.
	(dwarf_info_size, dwarf_abbrev_size, dwarf_line_size)
	(dwarf_pubnames_size, dwarf_aranges_size, dwarf_loc_size)
	(dwarf_macinfo_size, dwarf_str_size, dwarf_ranges_size)
	(dwarf_frame_size, dwarf_eh_frame_size, dwarf_info_buffer)
	(dwarf_abbrev_buffer, dwarf_line_buffer, dwarf_str_buffer)
	(dwarf_macinfo_buffer, dwarf_ranges_buffer, dwarf_loc_buffer):
	Remove variables.
	(struct dwarf2_pinfo): Remove per-objfile members.  Update comments.
	(DWARF_ABBREV_SIZE, DWARF_LINE_SIZE)
	(DWARF_LOC_SIZE, DWARF_MACINFO_SIZE, DWARF_STR_SIZE)
	(DWARF_RANGES_SIZE, DWARF_INFO_BUFFER)
	(DWARF_ABBREV_BUFFER, DWARF_LINE_BUFFER, DWARF_STR_BUFFER)
	(DWARF_MACINFO_BUFFER, DWARF_RANGES_BUFFER, DWARF_LOC_BUFFER):
	Remove macros.
	(dwarf2_has_info): Take an objfile argument.  Allocate per-objfile
	data.
	(dwarf2_locate_sections, dwarf2_build_psymtabs)
	(dwarf2_build_psymtabs_easy, dwarf2_build_psymtabs_hard)
	(skip_one_die, dwarf2_get_pc_bounds, dwarf2_read_abbrevs)
	(read_partial_die, read_full_die, read_indirect_string)
	(dwarf_decode_line_header, dwarf_decode_macros)
	(dwarf2_symbol_mark_computed): Remove use of removed macros.
	Update uses of removed variables.
	(psymtab_to_symtab_1): Restore per-objfile data pointer.  Remove use
	of removed macros.
	(_initialize_dwarf2_read): New function.
	* symfile.h (dwarf2_has_info): Update prototype.
	* coffread.c (coff_symfile_read): Update call to dwarf2_has_info.
	* elfread.c (elf_symfile_read): Likewise.
2004-04-02 04:35:46 +00:00
David Carlton 90aeadfcc3 2004-03-16 David Carlton <carlton@kealia.com>
* dwarf2read.c (process_structure_scope): Process children even
	when we're a declaration.
2004-03-16 22:43:15 +00:00
David Carlton 8176b9b8a3 2004-03-15 David Carlton <carlton@kealia.com>
Fix for PR c++/1553:
	* dwarf2read.c (read_structure_type): Determine type name by
	calling determine_class_name.
	(determine_class_name): New.
	(determine_prefix): Look at TYPE_TAG_NAME and call
	determine_class_name when appropriate.
	(determine_prefix_aux, class_name): Delete.
2004-03-15 22:33:52 +00:00
Daniel Jacobowitz 134d01f12d * dwarf2read.c (read_structure_type): Rename from
read_structure_scope.  Don't create a symbol or call process_die.
	Return immediately if die->type is set.  Call read_type_die before
	dwarf2_add_member_fn.
	(process_structure_scope): New function.
	(read_enumeration_type, process_enumeration_scope): New functions,
	broken out from read_enumeration.  Don't create the enumeration
	type if it has already been created.
	(read_enumeration): Removed.
	(process_die): Call read_structure_type, process_structure_scope,
	read_enumeration_type, and process_enumeration_scope.  Just call
	new_symbol for base and subrange types.  Add a comment about other
	type dies.
	(read_type_die): Call read_enumeration_type.
	(add_partial_structure, new_symbol): Update comments.
2004-03-14 21:08:24 +00:00
Daniel Jacobowitz 4bb7a0a769 * dwarf2read.c (skip_leb128, peek_die_abbrev, skip_one_die)
(skip_children): New functions.
	(locate_pdi_sibling): Call skip_children.
2004-03-09 19:38:11 +00:00
Daniel Jacobowitz f3dd693351 * dwarf2read.c (struct comp_unit_head): Remove dwarf2_abbrevs array.
(struct dwarf2_cu): Add abbrev_obstack and dwarf2_abbrevs
	pointer.  Update comment about comp_unit_head.
	(struct abbrev_info): Shorten two int flags.
	(dwarf_alloc_abbrev): Take a CU argument.
	(dwarf2_build_psymtabs_hard): Call dwarf2_free_abbrev_table
	each time through the loop.  Update cleanup argument.
	(psymtab_to_symtab_1): Update cleanup call.
	(dwarf2_read_abbrevs, dwarf2_alloc_abbrev): Allocate on the
	abbrev_obstack.
	(dwarf2_free_abbrev_table): Renamed from dwarf2_empty_abbrev_table.
	Just call obstack_free and clear the pointer.
2004-03-09 16:57:44 +00:00
Daniel Jacobowitz d81510055c * dwarf2read.c: Add comment describing memory lifetimes.
(struct dwarf2_pinfo): Update comment.
	(dwarf2_add_field, dwarf2_add_member_fn, read_structure_scope)
	(read_enumeration, new_symbol): Don't use obsavestring.
2004-03-05 03:30:36 +00:00
Daniel Jacobowitz f6fe98efdc * dwarf2read.c (add_partial_symbol): Fix typo in adding enumerators
to the partial symbol table.
2004-02-21 02:13:35 +00:00
Elena Zannoni 9ab9195f18 2004-02-14 Elena Zannoni <ezannoni@redhat.com>
* symfile.c (init_entry_point_info, entry_point_address): Move
	from here...
	* objfiles.c (init_entry_point_info, entry_point_address):..to
	here.
	* symfile.h (init_entry_point_info, entry_point_address): Remove
	prototypes.
	* objfiles.h (init_entry_point_info, entry_point_address):Add
	prototypes.
	* cris-tdep.c: Remove include of symfile.h. Add include of
	objfiles.h.
	* infcall.c: Ditto.
	* mcore-tdep.c: Ditto.
	* mn10300-tdep.c: Ditto.
	* sh64-tdep.c: Ditto.
 	* v850-tdep.c: Ditto.
	* arm-tdep.c: Remove include of symfile.h.
	* blockframe.c: Ditto.
	* coffread.c: Ditto.
	* dbxread.c: Ditto.
	* dwarf2read.c: Ditto.
	* dwarfread.c: Ditto.
	* frv-tdep.c: Ditto.
	* ia64-tdep.c: Ditto.
	* mdebugread.c: Ditto.
	* mipsread.c: Ditto.
	* rs6000-tdep.c: Ditto.
	* s390-tdep.c: Ditto.
	* sh-tdep.c: Ditto.
	* xstormy16-tdep.c: Ditto.
	* gdbarch.sh: Remove include of symfile.h.
	* gdbarch.c: Regenerate.
	* solib-irix.c (enable_break): Use entry_point_address().
	Add comment about include file.
	* xcoffread.c: Add comment about include file.
	* Makefile.in (arm-tdep.o, blockframe.o, coffread.o, cris-tdep.o)
	(dbxread.o, dwarf2read.o, dwarfread.o, frv-tdep.o, gdbarch.o)
	(ia64-tdep.o, infcall.o, mcore-tdep.o, mdebugread.o, mipsread.o)
	(mn10300-tdep.o, rs6000-nat.o, s390-tdep.o, sh64-tdep.o)
	(sh-tdep.o, v850-tdep.o, xstormy16-tdep.o): Update dependencies.
2004-02-14 15:46:33 +00:00
Elena Zannoni 4a146b47d7 2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* buildsym.c (free_pending_blocks, finish_block)
	(record_pending_block, make_blockvector, end_symtab): Replace
	symbol_obstack with objfile_obstack.
	* coffread.c (process_coff_symbol, coff_read_struct_type)
	(coff_read_enum_type): Ditto.
	* cp-namespace.c (initialize_namespace_symtab)
	(check_one_possible_namespace_symbol): Ditto.
	* dwarf2read.c (new_symbol, dwarf2_const_value, macro_start_file)
	(dwarf2_symbol_mark_computed): Ditto.
	* dwarfread.c (enum_type, new_symbol, synthesize_typedef): Ditto.
	* elfread.c (elf_symtab_read): Ditto.
	* hpread.c (hpread_symfile_init, hpread_symfile_init)
	(hpread_read_enum_type, hpread_read_function_type)
	(hpread_read_doc_function_type, hpread_process_one_debug_symbol):
	Ditto.
	* jv-lang.c (get_java_class_symtab, add_class_symbol)
	(java_link_class_type): Ditto.
	* mdebugread.c (parse_symbol, psymtab_to_symtab_1, new_symtab)
	(new_symbol): Ditto.
	* minsyms.c (install_minimal_symbols): Ditto.
	* objfiles.c (allocate_objfile): Remove init of symbol_obstack.
	(terminate_minimal_symbol_table): Replace symbol_obstack with
	objfile_obstack.
	(free_objfile): Remove freeing of symbol_obstack.
	* objfiles.h: Remove symbol_obstack field.
	* pa64solib.c (add_to_solist): Replace symbol_obstack with
	objfile_obstack.
	* solib-sunos.c (allocate_rt_common_objfile): Remove init of
	symbol_obstack.
	(solib_add_common_symbols): Replace symbol_obstack with
	objfile_obstack.
	* somsolib.c (som_solib_add): Ditto.
	* stabsread.c (patch_block_stabs, define_symbol, read_enum_type)
	(common_block_start, common_block_end): Ditto.
	* symfile.c (reread_symbols): Remove freeing and init of
	symbol_obstack.
	(allocate_symtab): Rename symbol_obstack to objfile_obstack.
	* symfile.h: Update comment.
	* symmisc.c (print_objfile_statistics): Remove symbol_obstack
	stats printing.
	* symtab.c (symbol_set_names): Replace symbol_obstack with
	objfile_obstack.
	* symtab.h (struct general_symbol_info, struct minimal_symbol):
	Update comments.
	* xcoffread.c (read_xcoff_symtab, SYMBOL_DUP, SYMNAME_ALLOC)
	(init_stringtab, xcoff_initial_scan): Replace symbol_obstack with
	objfile_obstack.
2004-02-07 23:13:47 +00:00
Elena Zannoni 8b92e4d54f 2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
	coffstab_build_psymtabs, elfstab_build_psymtabs)
	(stabsect_build_psymtabs): Replace psymbol_obstack with
	objfile_obstack.
	* dwarf2-frame.c (decode_frame_entry_1): Ditto.
	* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
	Ditto.
	* dwarfread.c (scan_compilation_units): Ditto.
	* elfread.c (elfstab_offset_sections): Ditto.
	* hppa-tdep.c (read_unwind_info): Ditto.
	* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
	(hpread_end_psymtab): Ditto.
	* mdebugread.c (mdebug_build_psymtabs, add_pending)
	(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
	Ditto.
	* mips-tdep.c (non_heuristic_proc_desc): Ditto.
	* objfiles.c (add_to_objfile_sections)
	(build_objfile_section_table): Ditto.
	(allocate_objfile): Remove init of psymbol_obstack.
	(free_objfile): Remove freeing of psymbol_obstack.
	* objfiles.h (struct objfile): Remove field
	psymbol_obstack. Update comments.
	* pa64solib.c (pa64_solib_add_solib_objfile): Replace
	psymbol_obstack with objfile_obstack.
	* solib-sunos.c (allocate_rt_common_objfile): Remove init of
        psymbol_obstack.
	* somread.c (som_symfile_offsets, init_import_symbols)
	(init_export_symbols): Replace psymbol_obstack with
	objfile_obstack.
	* somsolib.c (som_solib_add_solib_objfile): Ditto.
	* symfile.c (default_symfile_offsets, syms_from_objfile)
	(reread_symbols): Remove freeing and init of psymbol_obstack.
	(cashier_psymtab): Update comment.
	* symmisc.c (print_objfile_statistics): Don't report stats for
	psymbol obstack.
	* symtab.h (struct general_symbol_info, struct partial_symtab):
	Update comments.
	* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
	(xcoff_symfile_offsets): Replace psymbol_obstack with
	objfile_obstack.
2004-02-07 18:29:54 +00:00
Elena Zannoni b99607ea3c 2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* objfiles.h (struct objfile): Add objfile_obstack field.
        Remove type_obstack field.

        * dwarf2read.c (dwarf2_add_field,dwarf2_add_member_fn,
        read_structure_scope read_enumeration, new_symbol): Replace
        type_obstack with objfile_obstack.
        * dwarfread.c (struct_type, enum_type): Ditto.
        * gdbtypes.c (alloc_type, alloc_type_instance, init_type)
        (lookup_fundamental_type): Ditto.
        * gdbtypes.h (TYPE_ALLOC): Ditto.
        * hpread.c (hpread_read_enum_type, hpread_read_function_type)
        (hpread_read_doc_function_type, hpread_read_struct_type)
        (fix_static_member_physnames, hpread_read_array_type)
        (hpread_read_subrange_type, hpread_type_lookup): Ditto.
        * jv-lang.c (java_lookup_class, type_from_class, type_from_class)
        (java_link_class_type): Ditto.
        * mdebugread.c (parse_type): Ditto.
        * objfiles.c (allocate_objfile, free_objfile): Ditto.
        * solib-sunos.c (solib_add_common_symbols): Ditto.
        * stabsread.c (define_symbol, read_type, read_member_functions,
        read_cpp_abbrev, read_one_struct_field): Ditto.
        * symfile.c (reread_symbols): Ditto.
        * symmisc.c (print_objfile_statistics): Ditto.
2004-02-07 16:57:55 +00:00
David Carlton 5d51ca5457 2004-01-28 David Carlton <carlton@kealia.com>
* dwarf2read.c (add_partial_structure): Use demangled name if
	namespace equals "".
2004-01-28 18:43:06 +00:00
Jim Blandy 2a35147e4a * dwarf2read.c (read_func_scope): Re-indent comment. 2004-01-28 04:05:22 +00:00
Jim Blandy 086ed43dbd Clean up misapplied patch:
* dwarf2read.c (determine_prefix): Change one of the two forward
declarations for 'determine_prefix_aux' to a declaration for this.
(read_func_scope): Use cu->language, not cu_language.  Pass 'cu'
argument to 'die_specification'.
2004-01-28 04:02:52 +00:00
Daniel Jacobowitz e142c38c71 * dwarf2read.c: Update calls to changed and renamed functions, and
references to moved variables.

	(struct dwarf2_cu): Add first_fn, last_fn, cached_fn,
	language, language_defn, list_in_scope, and ftypes members.
	(cu_first_fn, cu_last_fn, cu_cached_fn, cu_language)
	(cu_language_defn, list_in_scope, ftypes, cu_header_offset)
	(baseaddr): Remove globals.

	(dwarf_attr): Renamed to dwarf2_attr.  Add CU argument.
	(set_cu_language, die_is_declaration, die_specification)
	(determine_prefix, determin_prefix_aux, class_name, namespace_name)
	(dwarf2_linkage_name, dwarf2_name, dwarf2_extension)
	(dwarf2_get_ref_die_offset, dwarf2_fundamental_type)
	(initialize_cu_func_list, add_to_cu_func_list): Add CU argument.

	(dwarf2_build_psymtabs_hard): Add local baseaddr.  Initialize
	cu.list_in_scope.  Don't initialize cu_header_offset.
	(add_partial_symbol): Add local baseaddr.
	(psymtab_to_symtab_1): Add local baseaddr.  Use
	objfile->section_offsets for consistency.  Don't initialize
	cu_header_offset; do initialize cu.header.offset and
	cu.list_in_scope.
	(read_file_scope, read_func_scope, read_lexical_block_scope)
	(dwarf_decode_lines, new_symbol): Add local baseaddr.
2004-01-27 20:47:20 +00:00
Andrew Cagney a67af2b9de 2004-01-26 Andrew Cagney <cagney@redhat.com>
* dwarf2loc.c (dwarf_expr_frame_base): Use SYMBOL_OPS instead of
	SYMBOL_LOCATION_FUNCS
	(dwarf2_loclist_funcs, dwarf2_locexpr_funcs): Change type to
	"struct symbol_ops".
	* dwarf2loc.h (dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Change
	type to "struct symbol_ops".
	* symtab.h (struct symbol_ops): Rename "struct location_funcs".
	(struct symbol): Replace ".aux_value.loc.funcs" and
	".aux_value.loc.baton" with ".ops" and ".aux_value.ptr".
	(SYMBOL_OBJFILE): Delete macro.
	(SYMBOL_LOCATION_FUNCS): Delete macro.
	(SYMBOL_LOCATION_BATON): Update.
	* dwarf2read.c (dwarf2_symbol_mark_computed): Set SYMBOL_OPS
	intead of SYMBOL_LOCATION_FUNCS.
	* ax-gdb.c (gen_var_ref): Ditto.
	* printcmd.c (address_info): Ditto.
	* findvar.c (read_var_value): Ditto.
	(symbol_read_needs_frame): Ditto.
2004-01-26 20:36:32 +00:00
Andrew Cagney c034e007d5 Index: ChangeLog
2004-01-26  Andrew Cagney  <cagney@redhat.com>

	* dwarf2read.c (read_func_scope): Document frame-base hack.
2004-01-26 19:55:45 +00:00
David Carlton fdde2d8148 2004-01-23 David Carlton <carlton@kealia.com>
Patch for PR c++/1520:
	* dwarf2read.c (read_func_scope): Set processing_current_prefix
	properly if we have a specification die.
	(determine_prefix_aux): Rename from determine_prefix.
	(determine_prefix): Like the old determine_prefix, but never
	returns NULL.
2004-01-23 22:41:28 +00:00
David Carlton fae299cdd3 2004-01-22 David Carlton <carlton@kealia.com>
* dwarf2read.c (psymtab_to_symtab_1): Calculate lowpc, highpc via
	get_scope_pc_bounds.
	(read_file_scope): Ditto.
	(get_scope_pc_bounds): New function, produced by extracting code
	from the above two functions, consolidating it, and adding support
	for DW_TAG_namespace.
2004-01-22 19:56:54 +00:00
Joel Brobecker a02abb6201 * dwarf2read.c (dwarf2_non_const_array_bound_ignored_complaint):
Delete, no longer used.
        (read_subrange_type): New function, mostly extracted from
        read_array_type().
        (read_array_type): Replace extracted code by call to
        read_subrange_type().
        (dwarf2_get_attr_constant_value): New function.
        (scan_partial_symbols): Add handling for DW_TAG_subrange_type.
        (add_partial_symbol): Likewise.
        (process_die): Likewise.
        (new_symbol): Likewise.
        (read_type_die): Likewise.
2004-01-17 05:35:47 +00:00
Andrew Cagney cf5b2f1b3a 2004-01-16 Andrew Cagney <cagney@redhat.com>
* symfile.c: Update copyright year.
	(compare_symbols): Delete unused function.
	* stabsread.c: Update copyright year.
	(lrs_general_complaint): Delete unused function.
	(ref_search_value): Ditto.
	(get_substring): Delete declaration.
	* sh64-tdep.c: Update copyright year.
	(sh64_get_gdb_regnum): Delete unused function.
	* dwarf2read.c (dwarf2_unsupported_at_frame_base_complaint):
	Delete unused function.
2004-01-17 01:05:06 +00:00
David Carlton 63d06c5c42 2004-01-14 David Carlton <carlton@kealia.com>
Change symbols for C++ nested types to contain the fully qualified
	name, if possible.  (At least in the DWARF-2 case.)  Partial fix
	for PR's c++/57, c++/488, c++/539, c++/573, c++/609, c++/832,
	c++/895.
	* c-exp.y: Update copyright:
	(qualified_type): Handle types nested within classes.
	* cp-namespace.c: Update comments.
	(cp_set_block_scope): Delete #if 0.
	(cp_lookup_nested_type): Handle types nested within classes.
	* dwarf2read.c: (scan_partial_symbols): Call add_partial_structure
	when appropriate.
	(add_partial_symbol): Add the name of the enclosing namespace to
	types.
	(pdi_needs_namespace): New.
	(add_partial_namespace): Tweak comment.
	(add_partial_structure): New.
	(psymtab_to_symtab_1): Initialize processing_current_prefix
	here...
	(process_die): instead of here.
	(read_structure_scope): Try to figure out the name of the class or
	namespace that the structure might be defined within.
	(read_enumeration): Generate fully-qualified names, if possible.
	(read_namespace): Don't set name to NULL.
	(die_specification): New.
	(new_symbol): Generate fully-qualified names for types.
	(read_type_die): Determine appropriate prefix.
	(determine_prefix): New.
	(typename_concat): New.
	(class_name): New.
	* valops.c: Update copyright.
	(value_aggregate_elt): Pass NOSIDE to
	value_struct_elt_for_reference.
	(value_struct_elt_for_reference): Make static, add NOSIDE
	parameter, call value_maybe_namespace_elt as a last resort.
	(value_namespace_elt): Break out code into
	value_maybe_namespace_elt.
	(value_maybe_namespace_elt): New.

2004-01-14  David Carlton  <carlton@kealia.com>

	* gdb.cp/namespace.exp: Add tests involving classes defined within
	namespaces.
	* gdb.cp/namespace.cc (C::CClass): New.
	* gdb.cp/namespace1.cc: Update copyright.
	(C::OtherFileClass): New.
2004-01-14 16:54:43 +00:00