aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
AgeCommit message (Collapse)AuthorFilesLines
2010-06-21 * dwarf2read.c (read_base_type): Handle DW_ATE_UTF.Tom Tromey1-0/+8
(dwarf_type_encoding_name): Likewise.
2010-06-21 * p-valprint.c (pascal_val_print): Use TYPE_ERROR_NAME.Tom Tromey1-3/+12
* 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-17Minor reformatting in dwarf2read.c:psymtabs_addrmap_cleanup.Joel Brobecker1-0/+1
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 * dwarf2read.c (psymtabs_addrmap_cleanup): New function.Tom Tromey1-3/+18
(dwarf2_build_psymtabs_hard): Use it. Create addrmap on a temporary obstack.
2010-06-11 * dwarf2read.c (dwarf2_add_member_fn): Handle correct form ofTom Tromey1-30/+35
DW_AT_vtable_elem_location even when GCC extension is seen.
2010-06-07gdb/Jan Kratochvil1-16/+63
Fix PR 10640. * dwarf2-frame.c (no_dwarf_call): New function. (execute_stack_op): Set CTX->DWARF_CALL. * dwarf2expr.c (execute_stack_op) <DW_OP_call2, DW_OP_call4>: New. * dwarf2expr.h (struct dwarf_expr_context) <dwarf_call>: New. (struct dwarf_expr_context) <get_subr>: Remove the #if0-ed field. * dwarf2loc.c (per_cu_dwarf_call, dwarf_expr_dwarf_call): New functions. (dwarf2_evaluate_loc_desc): Initialize CTX->DWARF_CALL. (needs_frame_dwarf_call): New function. (dwarf2_loc_desc_needs_frame): Initialize CTX->DWARF_CALL. * dwarf2read.c (follow_die_offset): Based on former follow_die_ref. Update the comment. Move variables die, offset and error call to ... (follow_die_ref): ... a new function. (dwarf2_fetch_die_location_block): New function. * dwarf2loc.h (dwarf2_fetch_die_location_block): New prototype. gdb/testsuite/ Test PR 10640. * gdb.dwarf2/dw2-op-call.exp, gdb.dwarf2/dw2-op-call.S: New.
2010-06-07gdb/Jan Kratochvil1-1/+2
* dwarf2loc.c (struct dwarf_expr_baton) Replace objfile by per_cu. (dwarf_expr_tls_address): Use per_cu instead of objfile. (dwarf2_evaluate_loc_desc): Drop initialization of BATON.OBJFILE. Initialize new BATON.PER_CU. Adjust CTX->GDBARCH initialization for this change. (struct needs_frame_baton): New field per_cu. (dwarf2_loc_desc_needs_frame): Initialize new BATON.PER_CU. * dwarf2read.c (struct dwarf2_per_cu_data) <cu>: Extend the comment.
2010-06-05gdb/Jan Kratochvil1-12/+97
Fix duplicate types for single DIE. * dwarf2read.c (read_structure_type): Move set_descriptive_type after set_die_type. (read_array_type): Remove type initialization. Recheck get_die_type after initial die_type. Move set_die_type before set_descriptive_type. (read_set_type): New variable domain_type. Recheck get_die_type after initial die_type. Move attr initialization later. (read_tag_pointer_type, read_tag_reference_type): New variable target_type. Recheck get_die_type after initial die_type. (read_tag_ptr_to_member_type): Recheck get_die_type after initial die_type and die_containing_type. (read_tag_const_type, read_tag_volatile_type, read_subroutine_type): Recheck get_die_type after initial die_type. (read_subrange_type): Recheck get_die_type after initial die_type. Move set_die_type before set_descriptive_type. (set_die_type): Extend the function comment. Call complaint if DIE has some type already set.
2010-06-03Remove redundant naming of symbol from new_symbol.Sami Wagiaalla1-26/+0
2010-06-03 Sami Wagiaalla <swagiaal@redhat.com> * dwarf2read.c (new_symbol): Remove redundant naming of symbol.
2010-06-02gdb/Jan Kratochvil1-41/+110
Support DW_TAG_module as separate namespaces. * dwarf2read.c (typename_concat): New parameter physname. (read_module_type): New function and declaration. (scan_partial_symbols): Scan also DW_TAG_module children. (partial_die_parent_scope): Accept scope even from DW_TAG_module. Pass to typename_concat backward compatible physname value 0. (partial_die_full_name, read_namespace_type): Pass to typename_concat backward compatible physname value 0. (add_partial_module, read_module): Remove FIXME comment. (process_die) <DW_TAG_module>: Set PROCESSING_HAS_NAMESPACE_INFO. (die_needs_namespace) <DW_TAG_variable>: Allow returning true even for DIEs under DW_TAG_module. (dwarf2_compute_name): Move the ada block for DW_AT_linkage_name and DW_AT_MIPS_linkage_name first, extend it for language_fortran && physname and return there instead of just setting NAME. Extend the main block for language_fortran. Pass physname parameter to the typename_concat call. (read_import_statement, read_func_scope, get_scope_pc_bounds) (load_partial_dies, determine_prefix): Support also DW_TAG_module. (new_symbol): Fill in cplus_specific.demangled_name if it is still missing from SYMBOL_SET_NAMES in the language_fortran case. (new_symbol) <DW_TAG_variable>: Force LOC_UNRESOLVED for gfortran module variables. (read_type_die) <DW_TAG_module>: New. (MAX_SEP_LEN): Increase to 7. (typename_concat): New parameter physname. New variable lead. Support also language_fortran. * f-exp.y (yylex): Consider : also as a symbol name character class. * f-lang.c: Include cp-support.h. (f_word_break_characters, f_make_symbol_completion_list): New functions. (f_language_defn): Use cp_lookup_symbol_nonlocal, f_word_break_characters and f_make_symbol_completion_list. * f-typeprint.c (f_type_print_base) <TYPE_CODE_MODULE>: New. * gdbtypes.h (enum type_code) <TYPE_CODE_MODULE>: New. * symtab.c (symbol_init_language_specific): Support language_fortran. (symbol_find_demangled_name): New comment on language_fortran. (symbol_natural_name, symbol_demangled_name): Use demangled_name even for language_fortran. (lookup_symbol_aux_local): Check imports also for language_fortran. (default_make_symbol_completion_list): Rename to ... (default_make_symbol_completion_list_break_on): ... this name. New parameter break_on, use it. (default_make_symbol_completion_list): New stub. * symtab.h (default_make_symbol_completion_list_break_on): New prototype. gdb/testsuite/ Support DW_TAG_module as separate namespaces. * gdb.fortran/library-module.exp, gdb.fortran/library-module-main.f90, gdb.fortran/library-module-lib.f90: New. * gdb.fortran/module.exp: Replace startup by a prepare_for_testing call. (print i): Remove. (continue to breakpoint: i-is-1, print var_i value 1) (continue to breakpoint: i-is-2, print var_i value 2) (continue to breakpoint: a-b-c-d, print var_a, print var_b, print var_c) (print var_d, print var_i value 14, ptype modmany, complete `modm) (complete `modmany, complete `modmany`, complete `modmany`var) (show language, setting breakpoint at module): New tests. * gdb.fortran/module.f90 (module mod): Remove. (module mod1, module mod2, module modmany, subroutine sub1) (subroutine sub2, program module): New.
2010-06-02gdb/Jan Kratochvil1-1/+1
* dwarf2read.c (typename_concat): Add const to the variable sep.
2010-06-02gdbTom Tromey1-20/+55
* dwarf2loc.h (dwarf2_per_cu_data): Declare. * dwarf2read.c (dwarf_stack_op_name): No longer static. Return type is const. Add 'def' argument. Add missing operators, remove unhandled ones. (decode_locdesc): Update. (dwarf2_always_disassemble): New global. (show_dwarf2_always_disassemble): New function. (_initialize_dwarf2_read): Add always-disassemble. (dwarf2_per_cu_offset_size): New function. * dwarf2loc.c (dwarf2_always_disassemble): Declare. (piece_end_p): New function. (locexpr_describe_location_piece): Replace 'size' argument with 'end'. Use piece_end_p. Rewrite recognition of TLS. Recognize some constants. Remove errors. (disassemble_dwarf_expression): New function. (locexpr_describe_location_1): Use disassemble_dwarf_expression. Add 'offset_size' argument. (loclist_describe_location): Change output formatting. * dwarf2expr.h (dwarf_stack_op_name): Declare. gdb/doc * gdb.texinfo (Maintenance Commands): Document maint set dwarf2 always-disassemble.
2010-06-02 * dwarf2read.c (read_subrange_type): Handle missing base typePierre Muller1-11/+51
according to Dwarf-2 specifications.
2010-06-01 * dwarf2read.c (read_func_scope): Do not complain forPierre Muller1-3/+5
external function if bounds are not found.
2010-05-21 * dwarf2read.c (new_symbol): Handle DW_AT_variable_parameterPierre Muller1-0/+9
attribute.
2010-05-21 * dwarf2read.c (process_die): Also allow DW_TAG_const_typePierre Muller1-0/+4
and DW_TAG_volatile_type. (new_symbol): Likewise.
2010-05-17 * dwarf2read.c (read_set_type): Set type length ifPierre Muller1-0/+3
DW_AT_byte_size attribute is present.
2010-05-142010-05-14 Michael Snyder <msnyder@vmware.com>Michael Snyder1-5/+45
* dbxread.c: White space. * dcache.c: White space. * disasm.c: White space. * doublest.c: White space. * dsrec.c: White space. * dummy-frame.c: White space. * dwarf2expr.c: White space. * dwarf2-frame.c: White space. * dwarf2loc.c: White space. * dwarf2read.c: White space.
2010-05-13gdb/Jan Kratochvil1-33/+9
Code cleanup. * dwarf2read.c (die_type, die_descriptive_type): Remove variable type. Remove check of NULL returned by tag_type_to_type. (die_containing_type): Remove variable type. Remove type_die variable initialization. Remove check of NULL returned by tag_type_to_type.
2010-05-08gdb/Jan Kratochvil1-1/+1
* dwarf2read.c (typename_concat): Use (char *) NULL terminated stdarg list for the obconcat call. * mdebugread.c (parse_symbol): Likewise. * stabsread.c (define_symbol, read_member_functions, read_cpp_abbrev): Likewise. * symfile.c (obconcat): Replace the s1, s2 and s3 parameters by `...'. New variable ap. Remove variables len and val. * symfile.h (obconcat): Likewise for the prototype.
2010-05-052010-05-05 Michael Snyder <msnyder@vmware.com>Michael Snyder1-27/+3
* elfread.c (elf_symtab_read): Delete unused variable. (find_separate_debug_file_by_buildid): Delete unused variables. (elf_symfile_read): Delete unused variable. * coffread.c (coff_symfile_read): Delete unused variables. * coff-pe-read.c (add_pe_exported_sym): Delete unused variable. (read_pe_exported_syms): Delete unused variable. * stabsread.c (define_symbol): Delete unused variable. * dwarf2read.c (read_type_comp_unit_head): Delete unused variable. (process_psymtab_comp_unit): Delete unused variable. (dwarf2_build_psymtabs_hard): Delete unused variable. (load_partial_comp_unit): Delete unused variable. (create_all_comp_units): Delete unused variable. (scan_partial_symbols): Delete unused variable. (add_partial_symbol): Delete unused variable. (add_partial_namespace): Delete unused variable. (add_partial_enumeration): Delete unused variable. (load_full_comp_unit): Delete unused variable. (process_full_comp_unit): Delete unused variable. (read_file_scope): Delete unused variable. (read_type_unit_scope): Delete unused variable. (process_structure_scope): Delete unused variable. (process_enumeration_scope): Delete unused variable. (read_tag_ptr_to_member_type): Delete unused variable. (read_typedef): Delete unused variable. (read_partial_die): Delete unused variable. (decode_locdesc): Delete unused variable. (zeroed_partial_die): Delete unused global variable.
2010-04-29D language support.Joel Brobecker1-0/+3
gdb/ChangeLog: D language support. * Makefile.in (SFILES): Add d-lang.c d-valprint.c. (COMMON_OBS): Add d-lang.o d-valprint.o. (HFILES_NO_SRCDIR): Add d-lang.h. * NEWS: Mention D language support. * c-lang.c (c_emit_char, exp_descriptor_c): Make public. * c-lang.h (c_emit_char, exp_descriptor_c): Add declaration. * d-lang.c: New file. * d-lang.h: New file. * d-valprint.c: New file. * defs.h (enum language): Add language_d. * dwarf2read.c (set_cu_language): Add DW_LANG_D. * language.c (binop_result_type, integral_type, character_type) (string_type, boolean_type, structured_type): Add language_d. * symfile.c (init_filename_language_table): Add language_d. * symtab.c: Include d-lang.h. (symbol_init_language_specific, symbol_find_demangled_name) (symbol_natural_name, lookup_symbol_in_language) (symbol_demangled_name, symbol_matches_domain): Add language_d. gdb/doc/ChangeLog: * gdb.texinfo: (Summary) Add mention about D language support. (Filenames): Add D suffixes. (D): New node. gdb/testsuite/ChangeLog: * gdb.base/default.exp: Fix "set language" test.
2010-04-20 * dwarf2read.c (dwarf2_compute_name): Handle DW_AT_linkage_name.Tom Tromey1-1/+9
(read_partial_die): Likewise. (dwarf_attr_name): Likewise.
2010-04-20 * dwarf2-frame.c (decode_frame_entry_1): Handle CIE version 4.Tom Tromey1-14/+79
(struct dwarf2_cie) <segment_size>: New field. * dwarf2read.c (partial_read_comp_unit_head): Accept DWARF 4. (skip_one_die): Handle DW_FORM_flag_present, DW_FORM_sec_offset, DW_FORM_exprloc. (read_attribute_value): Handle DW_FORM_flag_present, DW_FORM_sec_offset, DW_FORM_exprloc. (dump_die_shallow): Likewise. (attr_form_is_section_offset): Handle DW_FORM_sec_offset. (dwarf2_const_value): Handle DW_FORM_exprloc. (attr_form_is_block): Likewise. (struct line_header) <maximum_ops_per_instruction>: New field. (dwarf_decode_line_header): Set new field. (dwarf_decode_lines): Handle new field.
2010-04-02gdb/Jan Kratochvil1-3/+1
* dwarf2read.c (read_namespace_type): Use common "return set_die_type" code form.
2010-03-31gdb/Jan Kratochvil1-2/+9
Fix crash on reading wrong function declaration DWARF. * dwarf2read.c (read_subroutine_type): New variable void_type. Pre-fill all TYPE_FIELD_TYPEs. Move nparams and iparams initialization more close to their use. gdb/testsuite/ * gdb.dwarf2/dw2-bad-parameter-type.exp, gdb.dwarf2/dw2-bad-parameter-type.S: New.
2010-03-26 * dwarf2read.c (read_func_scope): Also scan specification DIEsUlrich Weigand1-0/+25
for DW_TAG_imported_module children.
2010-03-26ChangeLog:Ulrich Weigand1-9/+26
* dwarf2read.c (dwarf2_name): Work around GCC bugzilla debug/41828 by ignoring spurious DW_AT_name attributes for unnamed structs or unions. * completer.c (add_struct_fields): Fix inverted logic. testsuite/ChangeLog: * gdb.cp/inherit.exp (test_ptype_si): XFAIL test for GCC versions that do not provide the tagless_struct type name at all. (test_print_anon_union): Do not check value of uninitialized union member. Do not use cp_test_ptype_class, so we can accept "long" as well as "long int".
2010-03-25 * dwarf2read.c (read_subroutine_type): If the compilation unitKeith Seitz1-1/+40
language is Java, mark any formal parameter named "this" as artificial (GCC/43521). (dwarf2_name): Add special handling for Java constructors.
2010-03-24 * dwarf2-frame.c (dwarf2_frame_find_quirks): Use producer_is_realview.Daniel Jacobowitz1-0/+17
* dwarf2read.c (load_full_comp_unit): Read DW_AT_producer. (read_structure_type): For RealView, set TYPE_STUB on structures with no byte size and no children. (read_subroutine_type): Mark functions as prototyped by default. * symtab.c (producer_is_realview): New function. * symtab.h (expand_line_sal): Fix declaration formatting. (producer_is_realview): Declare. testsuite/ * gdb.base/callfuncs.exp (do_function_calls): Add XFAILs for RealView. * gdb.base/ptype.exp (ptype_maybe_prototyped): Add overprototyped argument. Handle "short" and "long". (Top level): Pass overprototyped output for old_fptr and xptr.
2010-03-22 * dwarf2read.c (partial_die_parent_scope): Work around buggyUlrich Weigand1-0/+19
GCC 4.1 debug info generation (GCC PR c++/28460). (determine_prefix): Likewise.
2010-03-18[dwarf] Anonymous nested function causes SEGV during psymbol readJoel Brobecker1-5/+22
According to the DWARF3 standard, a function always has a name attribute (Section 3.3 - Subroutine and Entry Point Entries). The only exception is when a DW_AT_abstract_origin attribute is provided, in which case the name may be inherited from the referenced DIE. The problem occured because our compiler generated a subprogram DIE for a nested function where the name attribute was missing (and no abstract-origin either). Our code in add_partial_symbol is not prepared to deal with the situation, and happily just tries to compute the length of the (NULL) function name. This normally cannot happen, because there is already a guard in scan_partial_symbols, where we (silently!) ignore anonymous dies, including anonymous subprograms. Unfortunately, there is a flaw that affects Ada and other languages that allow nested subprograms. For nested subprograms, we do not go through scan_partial_symbols and thus we are missing the name check. This patch adds the name check in the nested subprogram case. It also adds a complaint which is emitted during the psymtab->symtab conversion phase. gdb/ChangeLog: * dwarf2read.c (add_partial_subprogram): Make sure the subprogram DIE has a name before creating the associated partial symbol. (read_func_scope): Emit a complaint if the subprogram does not have a name or when we can't extract the subprogram PC bounds. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-anonymous-func.S: New file. * gdb.dwarf2/dw2-anonymous-func.exp: New testcase. Tested on x86_64-linux, no regression. Note that the testcase also verifies that the psymtab->symtab conversion does not crash (this is the purpose of the "list file1.txt:1" test.
2010-03-17 * dwarf2read.c (dwarf2_get_section_info): Handle case where noTom Tromey1-0/+10
DWARF data is available.
2010-03-16gdb/Jan Kratochvil1-0/+6
* dwarf2read.c (read_subrange_type): Set TYPE_HIGH_BOUND_UNDEFINED. * valarith.c (value_subscripted_rvalue): Suppress error if TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED.
2010-03-15 * dwarf2read.c (die_needs_namespace): Also return 0 forTom Tromey1-1/+2
DW_TAG_subprogram.
2010-03-15 2010-03-15 Sami Wagiaalla <swagiaal@redhat.com>Sami Wagiaalla1-13/+19
PR c++/7936: * cp-support.h: Added char *declaration element to using_direct data struct. (cp_add_using): Added char *declaration argument. (cp_add_using_directive): Ditto. (cp_lookup_symbol_imports): made extern. * cp-namespace.c: Updated with the above changes. * dwarf2read.c (read_import_statement): Ditto. (read_namespace): Ditto. (read_import_statement): Support import declarations. * cp-namespace.c (cp_lookup_symbol_imports): Check for imported declarations. Added support for 'declaration_only' search. (cp_lookup_symbol_namespace): Attempt to search for the name as is before consideration of imports. * symtab.c (lookup_symbol_aux_local): Added a 'declaration_only' search at every block level search. Now takes language argument. (lookup_symbol_aux): Updated. 2010-03-15 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/shadow.exp: Removed kfail; test has been fix. * gdb.cp/nsusing.exp: Ditto.
2010-03-13gdbTom Tromey1-6/+22
PR c++/9708: * dwarf2read.c (die_needs_namespace) <DW_TAG_variable>: A variable in a lexical block does not need a namespace. (new_symbol) <DW_TAG_variable>: Put extern variables on list_in_scope in all cases. gdb/testsuite PR c++/9708: * gdb.cp/m-static.exp: Add regression test. * gdb.cp/m-static.cc (method): New method. (main): Call it.
2010-03-10 * dwarf2read.c (struct pubnames_header): Remove.Tom Tromey1-100/+1
(_PUBNAMES_HEADER): Remove. (_ACTUAL_PUBNAMES_HEADER_SIZE): Remove. (struct aranges_header): Remove. (_ARANGES_HEADER, _ACTUAL_ARANGES_HEADER_SIZE): Remove. (struct dwarf2_per_objfile) <pubnames, aranges>: Remove. (PUBNAMES_SECTION): Remove. (ARANGES_SECTION): Remove. (dwarf2_locate_sections): Don't handle pubnames or aranges. (dwarf2_build_psymtabs): Remove dead code. (dwarf2_build_psymtabs_easy): Remove.
2010-03-10 * elfread.c (elf_symfile_read): Don't callTom Tromey1-26/+59
dwarf2_build_frame_info. * dwarf2read.c (struct dwarf2_section_info) <readin>: New field. (struct dwarf2_per_objfile) <objfile>: New field. (dwarf2_has_info): Now idempotent. Set objfile field. (dwarf2_read_section): Check and set readin field. Call posix_madvise. (dwarf2_build_psymtabs): Don't read all sections. (read_type_comp_unit_head): Read types section. (create_debug_types_hash_table): Likewise. (init_cu_die_reader): Add asserts. (process_type_comp_unit): Add assert. (dwarf2_build_psymtabs_hard): Read info section. (load_partial_comp_unit): Add assert. (create_all_comp_units): Read info section. (load_full_comp_unit): Likewise. (dwarf2_ranges_read): Read ranges section. (dwarf2_record_block_ranges): Add assert. (dwarf2_read_abbrevs): Read abbrev section. (read_indirect_string): Read str section. (dwarf_decode_line_header): Read line section. (read_signatured_type_at_offset): Read types section. (dwarf_decode_macros): Read macinfo section. (dwarf2_symbol_mark_computed): Read loc section. * dwarf2-frame.c (dwarf2_frame_find_fde): Call dwarf2_build_frame_info. (dwarf2_build_frame_info): Unconditionally set dwarf2_frame_objfile_data on the objfile. * configure.ac: Check for posix_madvise. * config.in, configure: Rebuild.
2010-03-10 * xcoffread.c (xcoff_start_psymtab): Update.Tom Tromey1-2/+2
(xcoff_end_psymtab): Update. * psymtab.c (allocate_psymtab): Remove dead code. * psympriv.h (struct partial_symtab) <read_symtab_private>: Now void*. * mdebugread.c (parse_partial_symbols): Update. (new_psymtab): Likewise. * dwarf2read.c (process_psymtab_comp_unit): Update. (psymtab_to_symtab_1): Update. * dbxread.c (start_psymtab): Update. (end_psymtab): Likewise.
2010-03-10gdbTom Tromey1-0/+1
* xcoffread.c: Include psymtab.h. (xcoff_sym_fns): Update. * symtab.h (struct partial_symbol): Remove. (PSYMBOL_DOMAIN, PSYMBOL_CLASS): Remove. (struct partial_symtab): Remove. (PSYMTAB_TO_SYMTAB): Remove. (lookup_partial_symbol, lookup_partial_symtab, find_pc_psymtab) (find_pc_sect_psymtab): Remove. (find_pc_sect_symtab_via_partial): Declare. (find_pc_psymtab, find_pc_sect_psymbol, psymtab_to_symtab) (find_main_psymtab): Remove. (find_main_filename): Declare. (fixup_psymbol_section): Remove. (fixup_section): Declare. * symtab.c: Include psymtab.h. (lookup_symtab): Use lookup_symtab method. (lookup_partial_symtab): Remove. (find_pc_sect_psymtab_closer): Remove. (find_pc_sect_psymtab): Remove. (find_pc_sect_symtab_via_partial): New function. (find_pc_psymtab, find_pc_sect_psymbol, find_pc_psymbol): Remove. (fixup_section): No longer static. (fixup_psymbol_section): Remove. (lookup_symbol_aux): Use lookup_symbol_aux_quick. (lookup_global_symbol_from_objfile): Likewise. (lookup_symbol_aux_psymtabs): Remove. (lookup_symbol_aux_quick): New function. (lookup_symbol_global): Use lookup_symbol_aux_quick. (lookup_partial_symbol): Remove. (basic_lookup_transparent_type_quick): New function. (basic_lookup_transparent_type): Use it. (find_main_psymtab): Remove. (find_main_filename): New function. (find_pc_sect_symtab): Use find_pc_sect_symtab method. (find_line_symtab): Use expand_symtabs_with_filename method. (output_partial_symbol_filename): New function. (sources_info): Use map_partial_symbol_filenames. (struct search_symbols_data): New type. (search_symbols_file_matches): New function. (search_symbols_name_matches): Likewise. (search_symbols): Use expand_symtabs_matching method. (struct add_name_data): Rename from add_macro_name_data. (add_macro_name): Update. (add_partial_symbol_name): New function. (default_make_symbol_completion_list): Use map_partial_symbol_names. (struct add_partial_symbol_name): New type. (maybe_add_partial_symtab_filename): New function. (make_source_files_completion_list): Use map_partial_symbol_filenames. (expand_line_sal): Use expand_symtabs_with_filename method. * symmisc.c: Include psymtab.h. (print_objfile_statistics): Use print_stats method. (dump_objfile): Use dump method. (dump_psymtab, maintenance_print_psymbols) (maintenance_info_psymtabs, maintenance_check_symtabs) (extend_psymbol_list): Remove. * symfile.h (struct quick_symbol_functions): New struct. (struct sym_fns) <qf>: New field. (sort_pst_symbols): Remove. (increment_reading_symtab): Declare. * symfile.c: Include psymtab.h. (compare_psymbols, sort_pst_symbols): Remove. (psymtab_to_symtab): Remove. (increment_reading_symtab): New function. (symbol_file_add_with_addrs_or_offsets): Use expand_all_symtabs method. (set_initial_language): Use find_main_filename. (allocate_psymtab, discard_psymtab, cashier_psymtab): Remove. (free_named_symtabs): Remove unused code. (start_psymtab_common, add_psymbol_to_bcache) (append_psymbol_to_list, add_psymbol_to_list, init_psymbol_list): Remove. * stack.c: Include psymtab.h, symfile.h. (backtrace_command_1): Use find_pc_sect_symtab_via_partial. * source.h (psymtab_to_fullname): Don't declare. * source.c: Include psymtab.h. (select_source_symtab): Use find_last_source_symtab method. (forget_cached_source_info): Use forget_cached_source_info method. (find_and_open_source): No longer static. (psymtab_to_fullname): Remove. * somread.c: Include psymtab.h. (som_sym_fns): Update. * psympriv.h: New file. * psymtab.h: New file. * psymtab.c: New file. * objfiles.h: (ALL_OBJFILE_PSYMTABS): Remove. (ALL_PSYMTABS, ALL_PSPACE_PSYMTABS): Likewise. * objfiles.c: Include psymtab.h. (objfile_relocate1): Use relocate method. (objfile_has_partial_symbols): Use has_symbols method. * mipsread.c: Include psymtab.h. (ecoff_sym_fns): Update. * mi/mi-cmd-file.c: Include psymtab.h. (print_partial_file_name): New function. (mi_cmd_file_list_exec_source_files): Use map_partial_symbol_filenames. * mdebugread.c: Include psympriv.h. * machoread.c: Include psympriv.h. (macho_sym_fns): Update. * m2-exp.y (yylex): Use lookup_symtab. * elfread.c: Include psympriv.h. (elf_sym_fns): Update. * dwarf2read.c: Include psympriv.h. * dbxread.c: Include psympriv.h. (aout_sym_fns): Update. * cp-support.c: Include psymtab.h. (read_in_psymtabs): Remove. (make_symbol_overload_list_qualified): Use expand_symtabs_for_function method. * coffread.c: Include psympriv.h. (coff_sym_fns): Update. * blockframe.c: Include psymtab.h. (find_pc_partial_function): Use find_pc_sect_symtab method. * ada-lang.h (ada_update_initial_language): Update. * ada-lang.c: Include psymtab.h. (ada_update_initial_language): Remove 'main_pst' argument. (ada_lookup_partial_symbol): Remove. (struct ada_psym_data): New type. (ada_add_psyms): New function. (ada_add_non_local_symbols): Use map_ada_symtabs method. (struct add_partial_datum): New type. (ada_add_partial_symbol_completions): New function. (ada_make_symbol_completion_list): Use map_partial_symbol_names. (ada_exception_support_info_sniffer): Update. * Makefile.in (SFILES): Add psymtab.c. (COMMON_OBS): Add psymtab.o. (HFILES_NO_SRCDIR): Add psymtab.h, psympriv.h. gdb/doc * gdbint.texinfo (Symbol Handling): Update.
2010-03-10 2010-03-09 Sami Wagiaalla <swagiaal@redhat.com>Sami Wagiaalla1-5/+6
PR C++/11236: * cp-namespace.c (cp_add_using): Deleted. (cp_add_using_directive): Use obstack allocations. Merged the function cp_add_using into this one. Added 'struct obstack *' argument. (cp_scan_for_anonymous_namespaces): Updated. * cp-support.h: Updated. * dwarf2read.c (read_import_statement): Updated. (read_namespace): Updated.
2010-03-10Adjust handling of Ada DIEs after dwarf2_physname patch.Joel Brobecker1-0/+16
* dwarf2read.c (dwarf2_compute_name): Add handling of Ada DIEs.
2010-03-09dwarf2_physname patchset:Keith Seitz1-180/+171
Based on work from Daniel Jacobowitz <dan@codesourcery.com> * c-typeprint.c (cp_type_print_method_args): For non-static methods, print out const or volatile qualifiers, too. (c_type_print_args): Add parameters show_artificial and language. Skip artificial parameters when requested. Use the appropriate language printer. (c_type_print_varspec): Tell c_type_print_args to skip artificial parameters and pass language_c. * dwarf2read.c (die_list): New file global. (struct partial_die_info): Update comments for name field. (pdi_needs_namespace): Renamed to ... (die_needs_namespace): ... this. Rewrite. (dwarf2_linkage_name): Remove. (add_partial_symbol): Do not predicate the call to partial_die_full_name based on pdi_needs_namespace. Remove call to cp_check_possible_namespace_symbols and associated outdated comments. (guess_structure_name): Do not inspect child subprogram DIEs. (dwarf2_fullname): Update comments. Use die_needs_namespace to assist in computing the name. (read_func_scope): Use dwarf2_name to get the DIE's name. Use dwarf2_physname to get the "linkage name" of the DIE. (dwarf2_add_member_field): Use dwarf2_physname instead of dwarf2_linkage_name. (read_structure_type): For structs and classes, set TYPE_NAME, too. (determine_class): Remove. (read_partial_die): Ignore DW_AT_MIPS_linkage_name for all languages except Ada. (new_symbol): Unconditionally call dwarf2_name. Compute the "linkage name" using dwarf2_physname. Use dwarf2_name instead of dwarf2_full_name for enumerator DIEs. When determining to scan for anonymous C++ namespaces, ignore the linkage name. (dwarf2_physname): New function. (dwarf2_full_name): Move content to new function and call that. (dwarf2_compute_name): "New" function. (_initialize_dwarf2_read): Initialize die_list. * gnu-v3-eabi.c (gnu_v3_find_method_in): Remove unused variable physname. (gnu_v3_print_method_ptr): Use the physname for virtual methods without a demangled name. Print out type information for non-virtual methods. * linespec.c (decode_line_1): Force ANY string using "::" (or "." for java) to use decode_compound, and clean up any stray quoting. If we found a file symtab, re-evaluate whether the remainder is_quoted. (decode_compound): Stop consuming at an open parenthesis. Keep template parameters. Keep any overload information. Keep keywords like "const". Remove paren_pointer. Move is_quoted check from set_flags to here. Remove #if 0 code from 2000. Ten years is long enough. (find_method): Before comparing symbol names, canonicalize the string from the user. If a specific overload is requested, find it. Otherwise throw an error. (find_method_overload_end): New function. (set_flags): Remove. (decode_compound): Assume that parentheses are matched. It's a lot easier. * symtab.c (symbol_find_demangled_name): Add DMGL_VERBOSE flag to cplus_demangle. * linespec.c (decode_line_1): Keep important keywords like "const" and "volatile". * symtab.h (SYMBOL_CPLUS_DEMANGLED_NAME): Remove. * typeprint.h (c_type_print_args): Add declaration. * ui-file.c (do_ui_file_obsavestring): New function. (ui_file_obsavestring): New function. * ui-file.h (ui_file_obsavestring): Add declaration. * valops.c (find_overload_match): Resolve the object to a non-pointer type. If the object is a data member, search the object for the member and return with staticp set. Use SYMBOL_NATURAL_NAME instead of SYMBOL_CPLUS_DEMANGLED_NAME. Do not attempt to extract a function name from non-function types. If the extracted function name and the original name are the same, we don't have a C++ method. From Jan Kratochvil <jan.kratochvil@redhat.com>: * dwarf2read.c (new_symbol <DW_TAG_enumerator>): Call dwarf2_full_name. * ada-lang.c (ada_lookup_symbol): Remove linkage_name parameters and arguments from symbol lookups. * ax-gdb.c (gen_expr): Likewise. * cp-namespace.c (cp_lookup_symbol_nonlocal, lookup_namespace_scope, cp_lookup_symbol_namespace, lookup_symbol_file, lookup_nested_type, lookup_possible_namespace_symbol): Likewise. * cp-support.c (read_in_psymtabs): Likewise. * cp-support.h (cp_lookup_symbol_nonlocal): Likewise. * language.h (la_lookup_symbol_nonlocal): Likewise. * scm-valprint.c (scm_inferior_print): Likewise. * solib-darwin.c (darwin_relocate_section_addresses): Likewise. * solib-svr.c (elf_lookup_lib): Likewise. * solib.c (show_auto_solib_add): Likewise. * solist.h (lookup_lib_global, solib_global_lookup): Likewise. * symmisc.c (maintenance_check_symtabs): Likewise. * symtab.c (lookup_symbol_in_language, lookup_symbol_aux, lookup_symbol_aux_local, lookup_symbol_aux_block, lookup_symbol_from_objfile, lookup_symbol_aux_symtabs, lookup_symbol_aux_psymtabs,basic_lookup_symbol_nonlocal, lookup_symbol_static, lookup_symbol_global, symbol_matches_domain, basic_lookup_transparent_type, find_main_psymtab, lookup_block_symbol): Likewise. * symtab.h (basic_lookp_symbol_nonlocal, lookup_symbol_static, lookup_symbol_global, lookup_symbol_aux_block, lookup_symbol_partial_symbol, lookup_block_symbol, lookup_global_symbol, value_maybe_namespace_elt): Likewise.
2010-03-04 * dwarf2read.c (skip_one_die) <DW_FORM_ref_addr>: Use offset sizeTom Tromey1-2/+15
in DWARF 3 and later. (read_attribute_value) <DW_FORM_ref_addr>: Likewise.
2010-03-02 * dwarf2read.c (add_partial_subprogram): Add missing baseaddr toDoug Evans1-1/+2
lowpc,highpc args to addrmap_set_empty.
2010-02-15 * dwarf2read.c (guess_structure_name): Allocate name on theTom Tromey1-1/+1
objfile obstack.
2010-02-052010-02-05 Sami Wagiaalla <swagiaal@redhat.com>Sami Wagiaalla1-4/+11
PR c++/7935: * gdb.cp/namespace-using.exp: Removed kfail; bug has been fixed. 2010-02-05 Sami Wagiaalla <swagiaal@redhat.com> PR c++/7935: * cp-support.h: Added char* alias element to using_direct data struct. (cp_add_using): Added char* alias argument. (cp_add_using_directive): Ditto. * cp-namespace.c: Updated with the above changes. (cp_lookup_symbol_imports): Check for aliases. * dwarf2read.c (read_import_statement): Figure out local alias for the import and pass it on to cp_add_using. (read_namespace): Pass alias argument to cp_add_using.
2010-02-032010-02-03 Tristan Gingold <gingold@adacore.com>Tristan Gingold1-1/+1
* symfile.h (struct sym_fns): Add sym_relocate field. (default_symfile_relocate): New prototype. (symfile_relocate_debug_section): First argument is now an objfile. * symfile.c (default_symfile_relocate): Rename from symfile_relocate_debug_section, first argument is now an objfile. (symfile_relocate_debug_section): New function. * coffread.c (coff_sym_fns): Set sym_relocate field. * somread.c (som_sym_fns): Ditto. * mipsread.c (ecoff_sym_fns): Ditto. * machoread.c (macho_sym_fns): Ditto. * elfread.c (elf_sym_fns): Ditto. * dwarf2read.c (dwarf2_read_section): Ditto. * xcoffread.c (xcoff_sym_fns): Ditto. * dbxread.c (aout_sym_fns): Ditto. (dbx_psymtab_to_symtab): Adjust call to symfile_relocate_debug_section. (elfstab_build_psymtabs): Ditto.
2010-02-02gdbTom Tromey1-2/+3
* m2-typeprint.c (m2_record_fields): Don't use TYPE_DECLARED_TYPE. * gdbtypes.h (TYPE_DECLARED_CLASS): New macro. (struct main_type) <flag_declared_class>: New field. (struct cplus_struct_type) <declared_type>: Remove. <ntemplate_args>: Move earlier. (DECLARED_TYPE_CLASS, DECLARED_TYPE_UNION, DECLARED_TYPE_STRUCT) (DECLARED_TYPE_TEMPLATE): Remove. (TYPE_DECLARED_TYPE): Remove. * gdbtypes.c (lookup_union): Don't use TYPE_DECLARED_TYPE. * dwarf2read.c (read_structure_type): Set TYPE_DECLARED_CLASS. * c-typeprint.c (c_type_print_base): Use TYPE_DECLARED_CLASS, not TYPE_DECLARED_TYPE. gdb/testsuite * gdb.dwarf2/member-ptr-forwardref.exp: Update expected result for type-printing change.