Commit Graph

482 Commits

Author SHA1 Message Date
Tom Tromey 6438229074 PR c++/11961:
* dwarf2read.c (new_symbol_full) <DW_TAG_template_type_param>:
	Don't set TYPE_NAME on the type.
2010-08-31 20:03:20 +00:00
Doug Evans 36374493cd * dwarf2read.c (dw2_require_line_header): Read from .debug_types
as appropriate.
2010-08-27 23:09:58 +00:00
Tom Tromey 8b93c54cd7 * dwarf2read.c (dwarf2_attach_fields_to_type): Don't set
TYPE_FIELD_IGNORE_BITS.
2010-08-27 21:03:39 +00:00
Doug Evans 16be1145cb * dwarf2read.c (dwarf2_per_objfile_free): Reorganize buffers to match
the order they're defined in.  munmap .debug_types buffer.
2010-08-27 16:37:03 +00:00
Doug Evans e254ef6a5f * dwarf2read.c (dw2_require_full_path): Rename parameter cu to per_cu.
(dw2_forget_cached_source_info): Rename local cu to per_cu.
	(dw2_lookup_symtab, dw2_do_expand_symtabs_matching): Ditto.
	(dw2_print_stats, dw2_expand_all_symtabs): Ditto.
	(dw2_expand_symtabs_with_filename, dw2_find_symbol_file): Ditto.
	(dw2_find_symbol_file, dw2_expand_symtabs_matching): Ditto.
	(dw2_map_symbol_filenames, dwarf2_initialize_objfile): Ditto.
	(dwarf2_free_objfile, write_one_signatured_type): Ditto.
	(write_psymtabs_to_index): Ditto.
2010-08-26 23:36:53 +00:00
Doug Evans c6da4ceffb * dwarf2read.c (dwarf2_build_include_psymtabs): Remove unnecessary
forward decl.  Pass pst->dirname to dwarf_decode_lines.
	(psymtab_include_file_name): New function.
	(dwarf_decode_lines): Call it.  Update comments.
2010-08-26 16:47:55 +00:00
Pedro Alves cd02d79dc8 * dwarf2read.c (inherit_abstract_dies): Handle origin die's
compilation unit being different from target die's.
2010-08-25 18:20:07 +00:00
Doug Evans 673bfd454b PR symtab/11942
* dwarf2read.c (dwarf2_per_objfile): New members debug_info_type_hash,
	debug_types_type_hash.
	(dwarf2_cu, dwarf2_per_cu_data): Delete member type_hash.
	All uses updated.
	(lookup_die_type): Renamed from tag_type_to_tag.  First look in
	appropriate type_hash table.  All callers updated.
	(allocate_signatured_type_table): Renamed from
	allocate_signatured_type_hash_table.  All callers updated.
	(create_signatured_type_table_from_index): Renamed from
	create_signatured_type_hash_from_index.  All callers updated.
	(read_die_type): Add comment.  Move actual reading to ...
	(read_die_type_1): ... here.  New function.
	(follow_die_ref_or_sig): Tweak comment.
	(set_die_type): Rewrite to use appropriate choice of
	debug_info_type_hash or debug_types_type_hash.
	(get_die_type_at_offset): New function.
	(get_die_type): Call it.

	testsuite/
	PR symtab/11942
	* gdb.dwarf2/dw4-sig-types.cc: New file.
	* gdb.dwarf2/dw4-sig-types.h: New file.
	* gdb.dwarf2/dw4-sig-types-b.cc: New file.
	* gdb.dwarf2/dw4-sig-types.exp: New file.
2010-08-25 00:09:14 +00:00
Doug Evans e71ec85366 * dwarf2read.c (set_die_type): Fix typo in comment. 2010-08-23 21:49:26 +00:00
Doug Evans 9dc481d3a7 * dwarf2read.c (read_structure_type): Add comment.
(read_enumeration_type): Add comment.
	(process_enumeration_scope): Move definition of some locals
	closer to their use.
	(read_namespace_type): Add comment.
2010-08-23 21:44:39 +00:00
Keith Seitz 3da10d80f8 PR symtab/11465:
* dwarf2read.c (struct delayed_method_info): New struct.
	(struct dwarf2_cu): Add vector method_list.
	(scan_partial_symbols): Count methods for union, class, structure,
	and interface types.
	(add_to_method_list): New function.
	(free_delayed_list): New function.
	(compute_delayed_physnames): New function.
	(process_full_comp_unit): Make a cleanup for the CU's delayed
	physname list, compute the delayed physnames, and free the
	the list.
	(dwarf2_add_member_fn): For C++ and Java, delay the computation
	of the physname until after the CU is read.

	* dwarf2read.c (read_structure_type): Check if the current
	DIE's type was already completed after dwarf2_full_name
	was called.
2010-08-20 17:16:44 +00:00
Doug Evans f3574227a8 * gdb_assert.h (gdb_assert_not_reached): New macro.
(gdb_assert_fail): Fix typo in comment.
	* avr-tdep.c (avr_return_value): Use gdb_assert_not_reached instead of
	gdb_assert (0).
	* darwin-nat.c (darwin_check_new_threads): Ditto.
	* dwarf2read.c (dwarf2_get_section_info): Ditto.
	(munmap_section_buffer): Ditto.
	* m32c-tdep.c (make_types): Ditto.
	(m32c_decode_srcdest4, m32c_decode_sd23, m32c_frame_base): Ditto.
	* macroexp.c (get_character_constant): Ditto.
	(get_string_literal): Ditto.
	* mep-tdep.c (mep_pseudo_cr_size): Ditto.
	(mep_pseudo_cr_index, mep_register_type): Ditto.
	(mep_pseudo_register_read, mep_pseudo_register_write): Ditto.
	(mep_get_insn, mep_analyze_prologue): Ditto.
	* objfiles.c (qsort_cmp): Ditto.
	* prologue-value.c (pv_is_identical): Ditto.
	* record.c (record_get_loc): Ditto.
	* value.c (value_static_field): Ditto.
	* xtensa-tdep.c (call0_track_op): Ditto.
2010-08-18 19:13:33 +00:00
Hui Zhu 1d9ec526ee 2010-08-13 Hui Zhu <teawater@gmail.com>
* dwarf2read.c (load_partial_comp_unit): Initialize free_cu_cleanup.
	(read_comp_unit): Initialize back_to.
2010-08-13 03:14:03 +00:00
Pedro Alves 98bfdba52e 2010-08-12 Daniel Jacobowitz <dan@codesourcery.com>
Pedro Alves  <pedro@codesourcery.com>

	* dwarf2read.c: Include "c-lang.h" and "valprint.h".
	(struct dwarf2_per_objfile) <reading_partial_symbols>: New field.
	(struct partial_die_info) <has_template_arguments>: New field.
	<num_attrs>: Change type to unsigned char.
	<building_fullname>: New field.
	(dwarf2_build_psymtabs_hard): Set reading_partial_symbols.  Only
	allocate a CU if we don't have one already.  Add a cleanup for the
	CU.
	(partial_die_full_name): Handle template arguments not in
	DW_AT_name.
	(dwarf2_psymtab_to_symtab): Clear reading_partial_symbols.
	(load_full_comp_unit): Only allocate a CU if we don't have one
	already.
	(do_ui_file_peek_last): New.
	(dwarf2_compute_name): Handle template parameters not in
	DW_AT_name.
	(read_comp_unit): Read and free abbrevs if not read yet.
	(load_partial_dies): Handle template arguments not in DW_AT_name.
	(find_partial_die): If we have a CU, but no a partial dies yet,
	also read in the CU.
	(dwarf2_const_value_attr): New, abstracted out from
	dwarf2_const_value.
	(dwarf2_const_value, dwarf2_const_value_data): Adjust to use
	dwarf2_const_value_attr.
	(determine_prefix): Detect and break loops created by RCVT's debug
	info.
	(maybe_queue_comp_unit): Bail out early if reading partial
	symbols.
	(follow_die_offset): Load full CU if we have no dies.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Make public.
	* dwarf2loc.h (dwarf2_evaluate_loc_desc): Declare.
2010-08-12 19:55:38 +00:00
Sami Wagiaalla e37fd15a52 Complete symbol construction before adding to pending list.
2010-08-09  Sami Wagiaalla  <swagiaal@redhat.com>

	* dwarf2read.c (new_symbol): Add symbol to variable list at end of
	function after symbol construction is complete.
	Do the same for template symbol addition to template_symbols list.
2010-08-09 20:34:06 +00:00
Sami Wagiaalla 33e5013ed2 create and use symbol_set_language.
2010-08-09  Sami Wagiaalla  <swagiaal@redhat.com>

	* symtab.h: Renamed SYMBOL_INIT_LANGUAGE_SPECIFIC to
	SYMBOL_SET_LANGUAGE.
	(symbol_init_language_specific): Renamed to symbol_set_language.
	* symtab.c (symbol_init_language_specific): Removed redundant check
	for language_cplus.
	Renamed to symbol_set_language.
	* stabsread.c (define_symbol): Updated.
	(read_enum_type): Updated
	* psymtab.c (add_psymbol_to_bcache): Updated.
	* minsyms.c (install_minimal_symbols): Updated.
	* coffread.c (process_coff_symbol): SYMBOL_SET_LANGUAGE instead of
	SYMBOL_LANGUAGE to set the language.
	* minsyms.c (prim_record_minimal_symbol_full): Ditto.
	* mdebugread.c (new_symbol): Ditto.
	* cp-namespace.c (check_one_possible_namespace_symbol): Ditto.
	* dwarf2read.c (new_symbol_full): Ditto.
	* jv-lang.c (add_class_symbol): Ditto.
2010-08-09 19:42:48 +00:00
Doug Evans 2de00c64c4 * dwarf2read.c (dwarf_attr_name): Add DW_AT_GNU_odr_signature. 2010-08-03 00:51:29 +00:00
Tom Tromey 053315c213 * dwarf2read.c (dwarf2_const_value_data): Never sign extend. 2010-07-28 20:05:03 +00:00
Pedro Alves 3ce3b1ba31 2010-07-28 Daniel Jacobowitz <dan@codesourcery.com>
gdb/
	* dwarf2read.c (read_subroutine_type): Improve THIS detection,
	handling DW_AT_object_pointer, and workaround GCC PR 43053.

	gdb/testsuite/
	* gdb.cp/member-ptr.exp, gdb.cp/printmethod.exp,
	gdb.dwarf2/member-ptr-forwardref.exp: Adjust.
2010-07-28 19:04:08 +00:00
Tom Tromey 34eaf5422c gdb
PR c++/9946:
	* symfile.c (reread_symbols): Clear template_symbols.
	* symtab.h (struct symbol) <is_cplus_template_function>: New
	field.
	(SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION): New macro.
	(struct template_symbol): New.
	* symtab.c (lookup_symbol_aux_local): Use
	cp_lookup_symbol_imports_or_template.
	* objfiles.h (struct objfile) <template_symbols>: New field.
	* objfiles.c (relocate_one_symbol): New function.
	(objfile_relocate1): Use it.  Relocate isolated symbols.
	* gdbtypes.h (struct cplus_struct_type) <n_template_arguments,
	template_arguments>: New fields.
	(TYPE_N_TEMPLATE_ARGUMENTS): New macro.
	(TYPE_TEMPLATE_ARGUMENTS): Likewise.
	(TYPE_TEMPLATE_ARGUMENT): Likewise.
	(lookup_typename): Update.
	* gdbtypes.c (lookup_typename): Constify "block" argument.
	* dwarf2read.c: Include vec.h.
	(symbolp): New typedef.
	(read_func_scope): Read template arguments.  Allocate a
	template_symbol when needed.
	(read_structure_type): Read template arguments.
	(new_symbol_full): New function, from new_symbol.  Handle
	DW_TAG_template_type_param and DW_TAG_template_value_param.
	(new_symbol): Rewrite as wrapper.
	* cp-support.h (cp_lookup_symbol_imports_or_template): Declare.
	* cp-namespace.c: Include language.h.
	(search_symbol_list): New function.
	(cp_lookup_symbol_imports_or_template): Likewise.
gdb/testsuite
	PR c++/9946:
	* gdb.cp/temargs.exp: New file.
	* gdb.cp/temargs.cc: New file.
2010-07-28 16:23:59 +00:00
Pedro Alves 9b1c24c8f7 * dwarf2read.c (read_string): Rename to ...
(read_direct_string): ... this.
	(skip_one_die, read_attribute_value, dwarf_decode_line_header)
	(dwarf_decode_lines, dwarf_decode_macros): Adjust.
2010-07-27 22:26:27 +00:00
Joel Brobecker abebb8b041 ARI fix (trailing newline in warning message).
* dwarf2read.c (dw2_find_pc_sect_symtab): Remove trailing newline
        in warning message.
2010-07-27 16:16:32 +00:00
Ken Werner ac0b195c01 * valops.c (dwarf2_read_index): Initialize the types_list and types_list_elements variables. 2010-07-27 07:57:49 +00:00
Jerome Guitton caac4577e5 gdb/
* dwarf2read.c (add_partial_symbol): Do not add a global variable if
	its adress is null. Add comment to explain why.
	(new_symbol): Ditto.
2010-07-26 09:30:00 +00:00
Tom Tromey 1fd400ffc4 * dwarf2read.c (struct dwarf2_per_objfile) <n_type_comp_units,
type_comp_units>: New fields.
	(dw2_get_cu): New function.
	(create_cus_from_index): Remove unused argument.
	(create_signatured_type_hash_from_index): New function.
	(create_addrmap_from_index): Update.
	(dwarf2_read_index): Handle version 2.
	(dw2_find_last_source_symtab, dw2_forget_cached_source_info)
	(dw2_lookup_symtab, dw2_do_expand_symtabs_matching)
	(dw2_print_stats, dw2_expand_all_symtabs)
	(dw2_expand_symtabs_with_filename, dw2_find_symbol_file)
	(dw2_expand_symtabs_matching, dw2_map_symbol_filenames): Update.
	(dwarf2_initialize_objfile): Call create_debug_types_hash_table.
	(allocate_signatured_type_hash_table): New function.
	(add_signatured_type_cu_to_list): Likewise.
	(create_debug_types_hash_table): Use them.  Set type_comp_units.
	(read_signatured_type): Ensure section data is available.
	(add_address_entry): Don't record empty ranges.
	(struct signatured_type_index_data): New.
	(write_one_signatured_type): New function.
	(write_psymtabs_to_index): Write type CUs.
	(save_gdb_index_command): Update comment.
	(process_type_comp_unit): Move inititalization of
	from_debug_types...
	(create_debug_types_hash_table): ... here.
2010-07-23 22:15:13 +00:00
Keith Seitz 8fd447e6d3 * dwarf2read.c: Remove unused typedef dwarf2_cu_per_cu_data_ptr
and vector definition.
2010-07-23 14:43:33 +00:00
Jan Kratochvil 96d19272e8 gdb/
* dwarf2read.c: Include completer.h.
	(save_gdb_index_command): Use matching usage command name.
	(_initialize_dwarf2_read): New variable c, initialize it by add_cmd.
	Set filename_completer for it.
2010-07-22 16:24:38 +00:00
Tom Tromey ca1f3406ef * dwarf2read.c (create_debug_types_hash_table): Set objfile on
type signature's per-CU data.
2010-07-22 15:53:48 +00:00
Pedro Alves 23bd0f7c5e gdb/
2010-07-21  Pedro Alves  <pedro@codesourcery.com>

	PR symtab/11827

	Revert:
	2010-05-21  Pierre Muller  <muller@ics.u-strasbg.fr>
	* dwarf2read.c (process_die): Also allow DW_TAG_const_type
	and DW_TAG_volatile_type.
	(new_symbol): Likewise.

gdb/testsuite/
2010-07-21  Pedro Alves  <pedro@codesourcery.com>

	PR symtab/11827

	* gdb.base/printcmds.c (enum some_volatile_enum): New enum.
	(some_volatile_enum): New variable.
	* gdb.base/printcmds.exp (test_print_enums): New.
	<top level>: Call it.
2010-07-21 18:08:27 +00:00
Sami Wagiaalla 29df156df4 Use allocated cplus_specific for cplus symbols.
2010-07-16  Sami Wagiaalla  <swagiaal@redhat.com>

	* symtab.h (symbol_set_demangled_name): Now takes an optional objfile*
	argument.
	(cplus_specific): New struct.
	* symtab.c (symbol_set_demangled_name): Updated.
	Use cplus_specific for cplus symbols.
	(symbol_get_demangled_name): Retrive the name from the cplus_specific
	struct for cplus symbols.
	(symbol_init_language_specific): Set cplus_specific for cplus symbols.
	(symbol_set_names): Pass objfile to symbol_set_demangled_name.
	* symtab.c (symbol_init_cplus_specific): New function.
2010-07-16 19:23:56 +00:00
Sami Wagiaalla b250c185b3 Use setter and getter for demangled_name.
2010-07-16  Sami Wagiaalla  <swagiaal@redhat.com>

	* symtab.h (symbol_set_demangled_name): New function.
	(symbol_get_demangled_name): New function.
	* symtab.c (symbol_set_demangled_name): New function.
	(symbol_get_demangled_name): New function.
	(symbol_init_language_specific): Use demangled_name setter and getter.
	(symbol_set_names): Ditto.
	(symbol_natural_name): Ditto.
	(symbol_demangled_name): Ditto.
	* dwarf2read.c (new_symbol): Ditto.
2010-07-16 19:00:56 +00:00
Sami Wagiaalla afa1672571 Rename cplus_specific mangled_lang.
2010-07-16  Sami Wagiaalla  <swagiaal@redhat.com>

	* symtab.h: Renamed cplus_specific to mangled_lang.
	* symtab.c (symbol_init_language_specific): Updated.
	(symbol_set_names): Updated.
	(symbol_natural_name): Updated.
	(symbol_demangled_name): Updated.
	* ada-lang.c (ada_decode_symbol): Updated.
	* dwarf2read.c (new_symbol): Updated.
2010-07-16 18:39:10 +00:00
Tom Tromey b3b272e108 * dwarf2read.c (dwarf2_read_index): Correctly set 'total_size'. 2010-07-13 22:02:05 +00:00
Tom Tromey bb3fa9d02e * dwarf2read.c (dwarf2_per_cu_text_offset): Fix reference to
objfile.
2010-07-13 21:06:48 +00:00
Tom Tromey dd78685836 * symfile.c (set_initial_language): Update.
(deduce_language_from_filename): Argument type now const.
	* symtab.h (find_main_filename): Update.
	(deduce_language_from_filename): Update.
	* symtab.c (find_main_filename): Make result const.
	* dwarf2read.c (dw2_find_symbol_file): Change return type.
	* psymtab.c (find_symbol_file_from_partial): Change return type.
	* symfile.h (struct quick_symbol_functions) <find_symbol_file>:
	Make result const.
2010-07-13 20:52:52 +00:00
Tom Tromey 9291a0cd80 gdb
* breakpoint.c (save_cmdlist): No longer static.
	* gdbcmd.h (save_cmdlist): Declare.
	* symfile.c (symbol_file_add_with_addrs_or_offsets): Set
	OBJF_READNOW on objfile if readnow_symbol_files.
	* elfread.c (elf_symfile_read): Use dwarf2_initialize_objfile.
	(elf_sym_fns_gdb_index): New global.
	* dwarf2read.c: Include exceptions.h.
	(offset_type): New.
	(struct mapped_index): New.
	(dwarf2_per_cu_data_ptr): New typedef.
	(struct dwarf2_per_objfile) <using_index, index_table, gdb_index>:
	New fields.
	(GDB_INDEX_SECTION): New define.
	(struct dwarf2_per_cu_quick_data): New.
	(struct dwarf2_per_cu_data) <objfile>: New field.
	<psymtab>: Removed.
	<v>: New field.
	(byte_swap): New function.
	(MAYBE_SWAP): New macro.
	(INDEX_SUFFIX): New macro.
	(dw2_do_instantiate_symtab): New function.
	(dw2_instantiate_symtab): Likewise.
	(create_cus_from_index): Likewise.
	(create_addrmap_from_index): Likewise.
	(mapped_index_string_hash): Likewise.
	(find_slot_in_mapped_hash): Likewise.
	(dwarf2_read_index): Likewise.
	(dw2_setup): Likewise.
	(dw2_require_line_header): Likewise.
	(dw2_require_full_path): Likewise.
	(dw2_find_last_source_symtab): Likewise.
	(dw2_forget_cached_source_info): Likewise.
	(dw2_lookup_symtab): Likewise.
	(dw2_lookup_symbol): Likewise.
	(dw2_do_expand_symtabs_matching): Likewise.
	(dw2_pre_expand_symtabs_matching): Likewise.
	(dw2_print_stats): Likewise.
	(dw2_dump): Likewise.
	(dw2_relocate): Likewise.
	(dw2_expand_symtabs_for_function): Likewise.
	(dw2_expand_all_symtabs): Likewise.
	(dw2_expand_symtabs_with_filename): Likewise.
	(dw2_find_symbol_file): Likewise.
	(dw2_map_ada_symtabs): Likewise.
	(dw2_expand_symtabs_matching): Likewise.
	(dw2_find_pc_sect_symtab): Likewise.
	(dw2_map_symbol_names): Likewise.
	(dw2_map_symbol_filenames): Likewise.
	(dw2_has_symbols): Likewise.
	(dwarf2_gdb_index_functions): New global.
	(dwarf2_initialize_objfile): New function.
	(process_psymtab_comp_unit): Update.
	(add_partial_subprogram): Likewise.
	(dwarf2_psymtab_to_symtab): Likewise.
	(psymtab_to_symtab_1): Use dw2_do_instantiate_symtab.
	(process_full_comp_unit): Update.
	(find_file_and_directory): New function.
	(read_file_scope): Use find_file_and_directory.
	(dwarf2_per_cu_objfile): Update.
	(dwarf2_per_cu_addr_size): Update.
	(dwarf2_per_cu_offset_size): Update.
	(dwarf2_free_objfile): Free the index, if needed.
	(dwarf2_per_objfile_free): Unmap the index, if needed.
	(struct strtab_entry): New.
	(hash_strtab_entry): New function.
	(eq_strtab_entry): Likewise.
	(create_strtab): Likewise.
	(add_string): Likewise.
	(struct symtab_index_entry): New.
	(struct mapped_symtab): New.
	(hash_symtab_entry): New function.
	(eq_symtab_entry): Likewise.
	(delete_symtab_entry): Likewise.
	(create_index_table): Likewise.
	(create_mapped_symtab): Likewise.
	(cleanup_mapped_symtab): Likewise.
	(find_slot): Likewise.
	(hash_expand): Likewise.
	(add_index_entry): Likewise.
	(add_indices_to_cpool): Likewise.
	(write_hash_table): Likewise.
	(add_address_entry): Likewise.
	(write_psymbols): Likewise.
	(write_obstack): Likewise.
	(unlink_if_set): Likewise.
	(write_psymtabs_to_index): Likewise.
	(save_gdb_index_command): Likewise.
	(_initialize_dwarf2_read): Install "save gdb-index"
	command.
	(create_all_comp_units): Initialize 'objfile' field of CU.
	(dwarf2_locate_sections): Check for .gdb_index.
	* psymtab.h (dwarf2_gdb_index_functions): Declare.
	* symfile.h (dwarf2_initialize_objfile): Declare.
gdb/doc
	* gdb.texinfo (Index Files): New node.
2010-07-13 20:51:34 +00:00
Tom Tromey 0f5238edfd gdb
PR breakpoints/8357:
	* symtab.h (domain_enum_tag) <LABEL_DOMAIN>: Update comment.
	* linespec.c (decode_line_1): Update comment.  Call decode_label.
	(decode_label): New function.
	(symbol_found): Handle LOC_LABEL.
	* dwarf2read.c (new_symbol) <DW_TAG_label>: Set symbol's type and
	domain.  Call add_symbol_to_list.
gdb/doc
	* gdb.texinfo (Specify Location): Document labels.
gdb/testsuite
	* gdb.base/label.exp: New file.
	* gdb.base/label.c: New file.
2010-07-13 20:07:44 +00:00
Tom Tromey 9aa1f1e339 * dwarf2loc.h (dwarf2_per_cu_text_offset): Declare.
* dwarf2loc.c (find_location_expression): Use
	dwarf2_per_cu_text_offset.
	(dwarf2_evaluate_loc_desc): Likewise.
	(dwarf2_loc_desc_needs_frame): Likewise.
	(compile_dwarf_to_ax): Likewise.
	(loclist_describe_location): Likewise.
	* dwarf2read.c (dwarf2_per_cu_text_offset): New function.
	(dwarf2_per_cu_objfile): Update comment.
2010-07-13 15:09:03 +00:00
Jan Kratochvil 953ac07ed7 gdb/
* dwarf2read.c (read_subrange_type): Call read_subrange_type.
	* p-lang.c (pascal_printstr): Likewise.
2010-07-12 17:07:11 +00:00
Tom Tromey ac56253dde * dwarf2read.c (dwarf2_const_value) <DW_form_addr>: Create a
LOC_COMPUTED symbol.
	* dwarf2loc.c (dwarf2_evaluate_loc_desc): Set new field.
	(dwarf2_loc_desc_needs_frame): Likewise.
	(compile_dwarf_to_ax) <DW_OP_addr>: Use offset.
	* dwarf2expr.h (struct dwarf_expr_context) <offset>: New field.
	* dwarf2expr.c (execute_stack_op) <DW_OP_addr>: Use offset.
	* dwarf2-frame.c (execute_stack_op): Set 'offset' field.  Add
	'offset' argument.
	(struct dwarf2_frame_cache) <text_offset>: New field.
	(dwarf2_frame_cache): Set new field.
	(dwarf2_frame_prev_register): Update.
	(dwarf2_frame_sniffer): Update.
	(dwarf2_frame_base_sniffer): Update.
	(dwarf2_frame_find_fde): Add 'out_offset' argument.
2010-07-07 17:26:38 +00:00
Doug Evans 3863f96c20 PR gdb/11702
* dwarf2read.c (dwarf2_add_field): Only create a symbol if
	DW_AT_external is present.
2010-06-30 05:39:23 +00:00
Doug Evans 254e6b9ed4 PR c++/11702
* NEWS: Add entry.
	* dwarf2read.c (dwarf2_add_field): If DW_AT_const_value is present,
	create a symbol for the field and record the value.
	(new_symbol): Handle DW_TAG_member.
	* gdbtypes.c (field_is_static): Remove FIXME.
	* symtab.c (search_symbols): When searching for VARIABLES_DOMAIN,
	only ignore LOC_CONST symbols that are enums.

	testsuite/
	Test PR c++/11702.
	* gdb.cp/m-static.exp: Add testcase.
	* gdb.cp/m-static.h (gnu_obj_4): Add initialized static const member.
2010-06-29 16:53:10 +00:00
Doug Evans 6e70227d64 * dwarf2read.c: Remove trailing whitespace. 2010-06-29 16:35:28 +00:00
Jan Kratochvil a0d7a4ff13 gdb/
* dwarf2read.c (read_structure_type) <fi.typedef_field_list>: Call
	ALLOCATE_CPLUS_STRUCT_TYPE.
2010-06-28 22:03:31 +00:00
Jan Kratochvil 98751a4113 gdb/
* c-typeprint.c (c_type_print_base): For no fields check include also
	TYPE_TYPEDEF_FIELD_COUNT.  Print new typedefs section.
	* dwarf2read.c (struct typedef_field_list)
	(struct field_info) <typedef_field_list, typedef_field_list_count>: New.
	(dwarf2_add_typedef): New.
	(read_structure_type): Call dwarf2_add_typedef for DW_TAG_typedef.
	Copy also FI.TYPEDEF_FIELD_LIST.
	* gdbtypes.h (struct typedef_field)
	(struct cplus_struct_type) <typedef_field, typedef_field_count>
	(TYPE_TYPEDEF_FIELD_ARRAY, TYPE_TYPEDEF_FIELD, TYPE_TYPEDEF_FIELD_NAME)
	(TYPE_TYPEDEF_FIELD_TYPE, TYPE_TYPEDEF_FIELD_COUNT): New.

gdb/testsuite/
	* gdb.cp/namespace.exp (ptype OtherFileClass typedefs)
	(ptype ::C::OtherFileClass typedefs): New.
	* gdb.cp/namespace1.cc (C::OtherFileClass::cOtherFileClassType2)
	(C::OtherFileClass::cOtherFileClassVar2): New.
	(C::OtherFileClass::cOtherFileClassVar_use): Use also
	cOtherFileClassVar2.
	(C::cOtherFileType2, C::cOtherFileVar2): New.
	(C::cOtherFileVar_use): use also cOtherFileVar2.
	* gdb.cp/userdef.exp (ptype &*c): Permit arbitrary trailing text.
2010-06-28 20:39:30 +00:00
Jan Kratochvil 9655fd1aec gdb/
Fix modification of cplus_struct_default.
	* dwarf2read.c (dwarf2_add_member_fn) <no DW_AT_vtable_elem_location>:
	Call ALLOCATE_CPLUS_STRUCT_TYPE.
	* gdbtypes.c (cplus_struct_default): New empty initializer, comment it.

gdb/testsuite/
	* gdb.cp/virtbase.cc (class RTTI_base, class RTTI_data)
	(main) <rtti_data>: New.
	* gdb.cp/virtbase.exp (print rtti_data): New.
2010-06-28 20:12:53 +00:00
Tom Tromey d3f41bb170 * dwarf2read.c (read_structure_type): Allocate null cleanup later. 2010-06-28 19:05:42 +00:00
Tom Tromey 75079b2b31 * dwarf2read.c (read_base_type): Handle DW_ATE_UTF.
(dwarf_type_encoding_name): Likewise.
2010-06-21 19:49:19 +00:00
Tom Tromey b00fdb7832 * p-valprint.c (pascal_val_print): Use TYPE_ERROR_NAME.
* p-typeprint.c (pascal_type_print_base): Use TYPE_ERROR_NAME.
	* m2-valprint.c (m2_val_print): Use TYPE_ERROR_NAME.
	* gdbtypes.h (TYPE_ERROR_NAME): New macro.
	* f-valprint.c (f_val_print): Use TYPE_ERROR_NAME.
	* f-typeprint.c (f_type_print_base): Use TYPE_ERROR_NAME.
	* dwarf2read.c (tag_type_to_type): Create a new error type on
	failure.
	* c-valprint.c (c_val_print): Use TYPE_ERROR_NAME.
	* c-typeprint.c (c_type_print_base): Use TYPE_ERROR_NAME.
2010-06-21 18:01:51 +00:00
Joel Brobecker ec61707dbb Minor reformatting in dwarf2read.c:psymtabs_addrmap_cleanup.
Really a tiny insignificant detail that just happened to catch my attention.
Fixed thusly.

2010-06-17  Joel Brobecker  <brobecker@adacore.com>

        * dwarf2read.c (psymtabs_addrmap_cleanup): Add empty line after
        last local variable declaration.  No real code change.
2010-06-17 22:36:41 +00:00