aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
AgeCommit message (Collapse)AuthorFilesLines
2011-12-10 * dwarf2read.c (dwarf2_per_cu_data): Rename debug_type_section toDoug Evans1-32/+32
debug_types_section. All uses updated. (partial_read_comp_unit_head): Rename parameter is_debug_type_section to is_debug_types_section.
2011-12-06the "ambiguous linespec" seriesTom Tromey1-18/+55
gdb 2011-12-06 Joel Brobecker <brobecker@acacore.com> * language.h (struct language_defn): Add new component la_symbol_name_compare. * symfile.h (struct quick_symbol_functions): Update the profile of parameter "name_matcher" for the expand_symtabs_matching method. Update the documentation accordingly. * ada-lang.h (ada_name_for_lookup): Add declaration. * ada-lang.c (ada_name_for_lookup): New function, extracted out from ada_iterate_over_symbols. (ada_iterate_over_symbols): Do not encode symbol name anymore. (ada_expand_partial_symbol_name): Adjust profile. (ada_language_defn): Add value for la_symbol_name_compare field. * linespec.c: #include "ada-lang.h". (iterate_name_matcher): Add language parameter. Replace call to strcmp_iw by call to language->la_symbol_name_compare. (decode_variable): Encode COPY if current language is Ada. * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile of name_matcher parameter. Adjust call to name_matcher. * psymtab.c (expand_symtabs_matching_via_partial): Likewise. (expand_partial_symbol_names): Update profile of parameter "fun". * psymtab.h (expand_partial_symbol_names): Update profile of parameter "fun". * symtab.c (demangle_for_lookup): Update function documentation. (search_symbols_name_matches): Add language parameter. (expand_partial_symbol_name): Likewise. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Add value for la_symbol_name_compare field. * d-lang.c (d_language_defn): Likewise. * f-lang.c (f_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * opencl-lang.c (opencl_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Ditto. 2011-12-06 Tom Tromey <tromey@redhat.com> * linespec.c (iterate_over_all_matching_symtabs): Use LA_ITERATE_OVER_SYMBOLS. (lookup_prefix_sym, add_matching_symbols_to_info): Likewise. (find_function_symbols, decode_variable): Remove Ada special case. * language.h (struct language_defn) <la_iterate_over_symbols>: New field. (LA_ITERATE_OVER_SYMBOLS): New macro. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Update. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Update. * d-lang.c (d_language_defn): Update. * f-lang.c (f_language_defn): Update. * jv-lang.c (java_language_defn): Update. * m2-lang.c (m2_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * opencl-lang.c (opencl_language_defn): Update. * p-lang.c (pascal_language_defn): Update. * ada-lang.c (ada_iterate_over_symbols): New function. (ada_language_defn): Update. 2011-12-06 Tom Tromey <tromey@redhat.com> Joel Brobecker <brobecker@acacore.com> PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366, PR objc/8535, PR breakpoints/11657, PR breakpoints/11970, PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856, PR shlibs/8929, PR shlibs/7393: * python/py-type.c (compare_maybe_null_strings): Rename from compare_strings. (check_types_equal): Update. * utils.c (compare_strings): New function. * tui/tui-winsource.c (tui_update_breakpoint_info): Update for location changes. * tracepoint.c (scope_info): Update. (trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE. * symtab.h (iterate_over_minimal_symbols) (iterate_over_some_symtabs, iterate_over_symtabs) (find_pcs_for_symtab_line, iterate_over_symbols) (demangle_for_lookup): Declare. (expand_line_sal): Remove. * symtab.c (iterate_over_some_symtabs, iterate_over_symtabs) (lookup_symtab_callback): New functions. (lookup_symtab): Rewrite. (demangle_for_lookup): New function, extract from lookup_symbol_in_language. (lookup_symbol_in_language): Use it. (iterate_over_symbols): New function. (find_line_symtab): Update. (find_pcs_for_symtab_line): New functions. (find_line_common): Add 'start' argument. (decode_line_spec): Update. Change argument to 'flags', change interpretation. (append_expanded_sal): Remove. (append_exact_match_to_sals): Remove. (expand_line_sal): Remove. * symfile.h (struct quick_symbol_functions) <lookup_symtab>: Remove. <map_symtabs_matching_filename>: New field. * stack.c (func_command): Only look in the current program space. Use DECODE_LINE_FUNFIRSTLINE. * source.c (line_info): Set pspace on sal. Check program space in the loop. Use DECODE_LINE_LIST_MODE. (select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE. * solib-target.c: Remove DEF_VEC_I(CORE_ADDR). * python/python.c (gdbpy_decode_line): Update. * psymtab.c (partial_map_expand_apply): New function. (partial_map_symtabs_matching_filename): Rename from lookup_partial_symbol. Update arguments. (lookup_symtab_via_partial_symtab): Remove. (psym_functions): Update. * objc-lang.h (parse_selector, parse_method): Don't declare. (find_imps): Update. * objc-lang.c (parse_selector, parse_method): Now static. (find_methods): Change arguments. Fill in a vector of symbol names. (uniquify_strings): New function. (find_imps): Change arguments. * minsyms.c (iterate_over_minimal_symbols): New function. * linespec.h (enum decode_line_flags): New. (struct linespec_sals): New. (struct linespec_result) <canonical>: Remove. <pre_expanded, addr_string, sals>: New fields. (destroy_linespec_result, make_cleanup_destroy_linespec_result) (decode_line_full): Declare. (decode_line_1): Update. * linespec.c (struct address_entry, struct linespec_state, struct collect_info): New types. (add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry) (eq_address_entry, maybe_add_address): New functions. (total_number_of_methods): Remove. (iterate_name_matcher, iterate_over_all_matching_symtabs): New functions. (find_methods): Change arguments. Don't canonicalize input. Simplify logic. (add_matching_methods, add_constructors) (build_canonical_line_spec): Remove. (filter_results, convert_results_to_lsals): New functions. (decode_line_2): Change arguments. Rewrite for new data structures. (decode_line_internal): Rename from decode_line_1. Change arguments. Add cleanups. Update for new data structures. (linespec_state_constructor, linespec_state_destructor) (decode_line_full, decode_line_1): New functions. (decode_indirect): Change arguments. Update. (locate_first_half): Use skip_spaces. (decode_objc): Change arguments. Update for new data structures. Simplify logic. (decode_compound): Change arguments. Add cleanups. Remove fallback code, replace with error. (struct decode_compound_collector): New type. (collect_one_symbol): New function. (lookup_prefix_sym): Change arguments. Update. (compare_symbol_name, add_all_symbol_names_from_pspace) (find_superclass_methods ): New functions. (find_method): Rewrite. (struct symtab_collector): New type. (add_symtabs_to_list, collect_symtabs_from_filename): New functions. (symtabs_from_filename): Change API. Rename from symtab_from_filename. (collect_function_symbols): New function. (find_function_symbols): Change API. Rename from find_function_symbol. Rewrite. (decode_all_digits): Change arguments. Rewrite. (decode_dollar): Change arguments. Use decode_variable. (decode_label): Change arguments. Rewrite. (collect_symbols): New function. (minsym_found): Change arguments. Rewrite. (check_minsym, search_minsyms_for_name) (add_matching_symbols_to_info): New function. (decode_variable): Change arguments. Iterate over all symbols. (symbol_found): Remove. (symbol_to_sal): New function. (init_linespec_result, destroy_linespec_result) (cleanup_linespec_result, make_cleanup_destroy_linespec_result): New functions. (decode_digits_list_mode, decode_digits_ordinary): New functions. * dwarf2read.c (dw2_map_expand_apply): New function. (dw2_map_symtabs_matching_filename): Rename from dw2_lookup_symtab. Change arguments. (dwarf2_gdb_index_functions): Update. * dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR). * defs.h (compare_strings): Declare. * cli/cli-cmds.c (compare_strings): Move to utils.c. (edit_command, list_command): Use DECODE_LINE_LIST_MODE. Call filter_sals. (compare_symtabs, filter_sals): New functions. * breakpoint.h (struct bp_location) <line_number, source_file>: New fields. (struct breakpoint) <line_number, source_file>: Remove. <filter>: New field. * breakpoint.c (print_breakpoint_location, init_raw_breakpoint) (momentary_breakpoint_from_master, add_location_to_breakpoint): Update for changes to locations. (init_breakpoint_sal): Add 'filter' argument. Set 'filter' on breakpoint. (create_breakpoint_sal): Add 'filter' argument. (remove_sal, expand_line_sal_maybe): Remove. (create_breakpoints_sal): Remove 'sals' argument. Handle pre-expanded sals and the filter. (parse_breakpoint_sals): Use decode_line_full. (check_fast_tracepoint_sals): Use get_sal_arch. (create_breakpoint): Create a linespec_sals. Update. (break_range_command): Use decode_line_full. Update. (until_break_command): Update. (clear_command): Update match conditions for linespec.c changes. Use DECODE_LINE_LIST_MODE. (say_where): Update for changes to locations. (bp_location_dtor): Free 'source_file'. (base_breakpoint_dtor): Free 'filter'. Don't free 'source_file'. (update_static_tracepoint): Update for changes to locations. (update_breakpoint_locations): Disable ranged breakpoint if too many locations match. Update. (addr_string_to_sals): Use decode_line_full. Resolve all sal PCs. (breakpoint_re_set_default): Don't call expand_line_sal_maybe. (decode_line_spec_1): Update. Change argument name to 'flags', change interpretation. * block.h (block_containing_function): Declare. * block.c (block_containing_function): New function. * skip.c (skip_function_command): Update. (skip_re_set): Update. * infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE. * mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE. * NEWS: Add entry. 2011-12-06 Tom Tromey <tromey@redhat.com> * elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow breakpoint's pspace to be NULL. * breakpoint.h (struct breakpoint) <pspace>: Update comment. * breakpoint.c (init_raw_breakpoint): Conditionally set breakpoint's pspace. (init_breakpoint_sal): Don't set breakpoint's pspace. (prepare_re_set_context): Conditionally switch program space. (addr_string_to_sals): Check executing_startup on location's program space. 2011-12-06 Tom Tromey <tromey@redhat.com> * breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove. * breakpoint.c (should_be_inserted): Explicitly check if program space is executing startup. (describe_other_breakpoints): Update. (disable_breakpoints_before_startup): Change executing_startup earlier. Remove loop. (enable_breakpoints_after_startup): Likewise. (init_breakpoint_sal): Don't use bp_startup_disabled. (create_breakpoint): Don't use bp_startup_disabled. (update_global_location_list): Use should_be_inserted. (bkpt_re_set): Update. gdb/testsuite 2011-12-06 Joel Brobecker <brobecker@acacore.com> * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs involving a fully qualified function name. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.ada/homonym.exp: Add three breakpoint tests. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.base/solib-weak.exp (do_test): Remove kfail. * gdb.trace/tracecmd.exp: Disable pending breakpoints earlier. * gdb.objc/objcdecode.exp: Update for output changes. * gdb.linespec/linespec.exp: New file. * gdb.linespec/lspec.cc: New file. * gdb.linespec/lspec.h: New file. * gdb.linespec/body.h: New file. * gdb.linespec/base/two/thefile.cc: New file. * gdb.linespec/base/one/thefile.cc: New file. * gdb.linespec/Makefile.in: New file. * gdb.cp/templates.exp (test_template_breakpoints): Update for output changes. * gdb.cp/re-set-overloaded.exp: Remove kfail. * gdb.cp/ovldbreak.exp: Update for output changes. "all" test now makes one breakpoint. * gdb.cp/method2.exp (test_break): Update for output changes. * gdb.cp/mb-templates.exp: Update for output changes. * gdb.cp/mb-inline.exp: Update for output changes. * gdb.cp/mb-ctor.exp: Update for output changes. * gdb.cp/ovsrch.exp: Use fully-qualified names. * gdb.base/solib-symbol.exp: Run to main later. Breakpoint now has multiple matches. * gdb.base/sepdebug.exp: Disable pending breakpoints. Update for error message change. * gdb.base/list.exp (test_list_filename_and_number): Update for error message change. * gdb.base/break.exp: Disable pending breakpoints. Update for output changes. * configure.ac: Add gdb.linespec. * configure: Rebuild. * Makefile.in (ALL_SUBDIRS): Add gdb.linespec. gdb/doc 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Set Breaks): Update for new behavior.
2011-12-02gdb/Jan Kratochvil1-1/+9
PR threads/13448 * dwarf2read.c (decode_locdesc): Handle DW_OP_const8u. For DW_OP_GNU_push_tls_address increment the value, new comment for it. gdb/testsuite/ PR threads/13448 * gdb.dwarf2/dw2-var-zero-addr.S: New file. * gdb.dwarf2/dw2-var-zero-addr.exp: New file. * gdb.threads/tls-var-main.c: New file. * gdb.threads/tls-var.c: New file. * gdb.threads/tls-var.exp: New file.
2011-12-02gdb/Jan Kratochvil1-0/+1
PR breakpoints/13346 * dwarf2read.c (process_psymtab_comp_unit): Set PSYMTABS_ADDRMAP_SUPPORTED. * psympriv.h (struct partial_symtab): Comment textlow and texthigh validity. New field psymtabs_addrmap_supported. * psymtab.c (find_pc_sect_psymtab_closer): New gdb_assert on psymtabs_addrmap_supported. (find_pc_sect_psymtab): Do not fallback to TEXTLOW and TEXTHIGH for !PSYMTABS_ADDRMAP_SUPPORTED. (dump_psymtab, maintenance_info_psymtabs): Print also psymtabs_addrmap_supported. gdb/testsuite/ PR breakpoints/13346 * gdb.dwarf2/dw2-objfile-overlap-inner.S: New file. * gdb.dwarf2/dw2-objfile-overlap-outer.S: New file. * gdb.dwarf2/dw2-objfile-overlap.exp: New file.
2011-11-23 * dwarf2read.c (dw2_lookup_symtab): Add comment.Doug Evans1-0/+5
(dw2_expand_symtabs_with_filename): Ditto. (dw2_expand_symtabs_matching): Ditto. (dw2_map_symbol_filenames): Ditto.
2011-11-15 * NEWS: Mention new parameter basenames-may-differ.Doug Evans1-1/+8
* dwarf2read.c (dw2_lookup_symtab): Avoid calling gdb_realpath if ! basenames_may_differ. * psymtab.c (lookup_partial_symtab): Ditto. * symtab.c (lookup_symtab): Ditto. (basenames_may_differ): New global. (_initialize_symtab): New parameter basenames-may-differ. * symtab.h (basenames_may_differ): Declare. doc/ * gdb.texinfo (Files): Document basenames-may-differ.
2011-11-11 * dwarf2read.c (dw2_map_symbol_filenames): New parameterDoug Evans1-3/+7
`need_fullname'. * psymtab.c (map_symbol_filenames_psymtab): Ditto. (map_partial_symbol_filenames): Ditto. All callers updated. * psymtab.h (map_partial_symbol_filenames): Update prototype. * symfile.h (struct quick_symbol_functions, map_symbol_filenames): New parameter need_fullname.
2011-11-10 * defs.h (is_cplus_marker, set_demangling_style): Moved to ...Doug Evans1-0/+1
* gdb-demangle.h: ... here. New file. * demangle.c: #include "gdb-demangle.h". (_initialize_demangler): Use initialize_file_ftype for prototype. Move "set demangle" and "set asm-demangle" parameters here from utils.c (demangle, show_demangle, asm_demangle, show_asm_demangle): Move here from utils.c * utils.c: Update. #include "gdb-demangle.h". * symtab.h (asm_demangle): Delete. (demangle): Move declaration next to use. * breakpoint.c: #include "gdb-demangle.h" instead of "demangle.h". * dwarf2read.c: #include "gdb-demangle.h". * gnu-v2-abi.c: Ditto. * jv-typeprint.c: Ditto. * mdebugread.c: Ditto. * p-typeprint.c: Ditto. * stabsread.c: Ditto. * printcmd.c: Ditto. (asm_demangle): Delete declaration. * tui/tui-stack.c: #include "gdb-demangle.h".
2011-10-20 * dwarf2read.c (dw2_get_file_names): Move adjustment for typeCary Coutant1-9/+13
section to... (partial_read_comp_unit_head): ...here. Add is_debug_type_section flag. Adjust all callers. (process_psymtab_comp_unit): Remove adjustment for type section.
2011-10-20 * cp-namespace.c (cp_scan_for_anonymous_namespaces): Changed functionAleksandar Ristovski1-1/+1
arguments by adding OBJFILE. Instead of getting objfile from symbol's symtab, use new argument OBJFILE. * cp-support.h (cp_scan_for_anonymous_namespaces): Changed function arguments by adding OBJFILE. * gdb/dwarf2read.c (new_symbol_full): Change call to cp_scan_for_anonymous_namespaces to match new signature. * gdb/stabsread.c (define_symbol): Change call to cp_scan_for_anonymous_namespaces to match new signature.
2011-10-20 * dwarf2read.c (create_debug_types_hash_table): Fix size ofCary Coutant1-1/+1
type_offset field.
2011-10-19 * dwarf2read.c (peek_abbrev_code): New function.Cary Coutant1-0/+56
(dw2_get_file_names): Check for dummy compilation units. (create_debug_types_hash_table): Likewise. (process_psymtab_comp_unit): Likewise. (load_partial_comp_unit): Likewise. (load_full_comp_unit): Likewise.
2011-10-17gdb/Jan Kratochvil1-72/+228
Revert: 2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com> * dwarf2expr.c (ctx_no_read_reg): New function. * dwarf2expr.h (ctx_no_read_reg): New declaration. * dwarf2read.c (read_2_signed_bytes, read_4_signed_bytes): Remove. (decode_locdesc_read_mem, decode_locdesc_ctx_funcs): New. (decode_locdesc): Replace by a caller of dwarf_expr_eval. gdb/testsuite/ * gdb.dwarf2/dw2-simple-locdesc.exp (p &s.shl): KFAIL it. Revert the part of: 2011-07-27 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.dwarf2/dw2-stack-boundary.exp (check partial symtab errors): Change the expected string.
2011-10-13gdb/Jan Kratochvil1-1/+3
* dwarf2read.c (dwarf2_fetch_die_location_block): Initialize .data even if .size is 0.
2011-10-12gdb/Jan Kratochvil1-2/+2
Fix empty DWARF expressions DATA vs. SIZE conditionals. * dwarf2loc.c (dwarf2_find_location_expression): Clear *LOCEXPR_LENGTH. (dwarf_expr_frame_base_1): Indicate unavailability via zero *LENGTH. (locexpr_tracepoint_var_ref): Check only zero SIZE, not zero DATA. (loclist_read_variable, loclist_tracepoint_var_ref): Do not check for zero DATA. * dwarf2loc.h (struct dwarf2_locexpr_baton): Comment DATA vs. SIZE validity. * dwarf2read.c (struct dwarf_block): Comment DATA validity. (dwarf2_fetch_die_location_block, dwarf2_symbol_mark_computed): Do not clear DATA on zero SIZE. gdb/testsuite/ Fix empty DWARF expressions DATA vs. SIZE conditionals. * gdb.dwarf2/dw2-op-call.S (arraycallnoloc, arraynoloc): New DIEs. (loclist): New. (4): New abbrev. * gdb.dwarf2/dw2-op-call.exp: Remove variable srcfile and executable. Use prepare_for_testing, remove clean_restart. (p arraynoloc, p arraycallnoloc): New tests.
2011-10-12 * dwarf2read.c (partial_read_comp_unit_head): Set header->offset,Doug Evans1-16/+8
header->first_die_offset here. All callers updated.
2011-10-112011-10-11 Sterling Augustine <saugustine@google.com>Sterling Augustine1-47/+403
* dwarf2read.c: Undo inadvertent changes in previous commit.
2011-10-11gdb/ChangeLogSterling Augustine1-407/+51
2011-10-11 Sterling Augustine <saugustine@google.com> * dwarf2read.c (partial_die_parent_scope): Rearrange conditional logic. gdb/testsuite/ChangeLog 2011-10-11 Sterling Augustine <saugustine@google.com> * gdb.cp/Makefile.in: Add namespace-enum test. * gdb.cp/namespace-enum.exp: New file. * gdb.cp/namespace-enum.c: New file. * gdb.cp/namespace-enum-main.c: New file.
2011-10-09gdb/Jan Kratochvil1-2/+5
Display @entry parameter values (without references). * dwarf2expr.c (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset): New functions. * dwarf2expr.h (dwarf_block_to_fb_offset, dwarf_block_to_sp_offset): New declarations. * dwarf2loc.c (dwarf2_find_location_expression): Support location list entry record. (dwarf_entry_parameter_to_value, value_of_dwarf_reg_entry) (value_of_dwarf_block_entry, locexpr_read_variable_at_entry): New functions. (dwarf2_locexpr_funcs): Install locexpr_read_variable_at_entry. (loclist_read_variable_at_entry): New function. (dwarf2_loclist_funcs): Install loclist_read_variable_at_entry. * dwarf2read.c (read_call_site_scope): Support also DW_OP_fbreg in DW_AT_location, call dwarf_block_to_sp_offset for it. * frame.h (print_entry_values_no, print_entry_values_only) (print_entry_values_preferred, print_entry_values_if_needed) (print_entry_values_both, print_entry_values_compact) (print_entry_values_default, print_entry_values): New declarations. (struct frame_arg): New field entry_kind. (read_frame_arg): New parameter entryargp. * mi/mi-cmd-stack.c (list_arg_or_local): New gdb_assert for arg->entry_kind. Optionally print the `@entry' suffix. (list_args_or_locals): New variable entryarg, initialize it. Initialize also entry_kind of arg and entryarg. Conditionalize list_arg_or_local for arg, add list_arg_or_local for entryarg. Call xfree for entryarg.error. * stack.c (print_entry_values_no, print_entry_values_only) (print_entry_values_preferred, print_entry_values_if_needed) (print_entry_values_both, print_entry_values_compact) (print_entry_values_default, print_entry_values_choices) (print_entry_values): New variables. (print_frame_arg): New gdb_assert for arg->entry_kind. Optionally print the `@entry' suffix, possibly in combination for print_entry_values_compact. (read_frame_arg): New parameter entryargp, new variables entryval, entryval_error and val_equal. Read in also entryargp, respect print_entry_values, compare the values using val_equal, fill in also argp->entry_kind (together with entryargp->entry_kind). (print_frame_args): New variable entryarg, initialize it. Conditionalize print_frame_arg for arg, add print_frame_arg for entryarg. Call xfree for entryarg.error. (_initialize_stack): Call add_setshow_enum_cmd for `entry-values'. * symtab.h (struct symbol_computed_ops): New field read_variable_at_entry. gdb/doc/ Display @entry parameter values (without references). * gdb.texinfo (Tail Call Frames): Add anchor. Add self tail call example. (Print Settings): New description of set print entry-values and show print entry-values. gdb/testsuite/ Display @entry parameter values (without references). * gdb.arch/amd64-entry-value.cc (locexpr, stacktest, data, data2) (different, validity, invalid): New functions. (main): Call them. * gdb.arch/amd64-entry-value.exp: New breakpoints breakhere_locexpr, stacktest, breakhere_stacktest, different, breakhere_different, breakhere_validity and breakhere_invalid. (entry: bt): Update for @entry. (entry_locexpr: *, entry_stack: *, entry_equal: *, entry_different: *) (entry_validity: *, entry_invalid: *): Many new tests. * gdb.base/break.exp (run until breakpoint set at small function, optimized file): Accept also the @entry suffix. * gdb.mi/Makefile.in (PROGS): Add mi2-amd64-entry-value. * gdb.mi/mi2-amd64-entry-value.c: New files. * gdb.mi/mi2-amd64-entry-value.exp: New files.
2011-10-09gdb/Jan Kratochvil1-0/+47
Tail call sites reader implementation. * dwarf2read.c (read_call_site_scope): Recognize DW_AT_GNU_tail_call, fill in TYPE_TAIL_CALL_LIST. * gdbtypes.h (struct func_type): New field tail_call_list. (struct call_site): New field tail_call_next. (TYPE_TAIL_CALL_LIST): New definition.
2011-10-09gdb/Jan Kratochvil1-11/+218
Implement basic support for DW_TAG_GNU_call_site. * block.c: Include gdbtypes.h and exceptions.h. (call_site_for_pc): New function. * block.h (call_site_for_pc): New declaration. * defs.h: Include hashtab.h. (make_cleanup_htab_delete, core_addr_hash, core_addr_eq): New declarations. * dwarf2-frame.c (dwarf2_frame_ctx_funcs): Install ctx_no_push_dwarf_reg_entry_value. * dwarf2expr.c (read_uleb128, read_sleb128): Support R as NULL. (dwarf_block_to_dwarf_reg): New function. (execute_stack_op) <DW_OP_GNU_entry_value>: Implement it. (ctx_no_push_dwarf_reg_entry_value): New function. * dwarf2expr.h (struct dwarf_expr_context_funcs): New field push_dwarf_reg_entry_value. (ctx_no_push_dwarf_reg_entry_value, dwarf_block_to_dwarf_reg): New declarations. * dwarf2loc.c: Include gdbcmd.h. (dwarf_expr_ctx_funcs): New forward declaration. (entry_values_debug, show_entry_values_debug, call_site_to_target_addr) (dwarf_expr_reg_to_entry_parameter) (dwarf_expr_push_dwarf_reg_entry_value): New. (dwarf_expr_ctx_funcs): Install dwarf_expr_push_dwarf_reg_entry_value. (dwarf2_evaluate_loc_desc_full): Handle NO_ENTRY_VALUE_ERROR. (needs_dwarf_reg_entry_value): New function. (needs_frame_ctx_funcs): Install it. (_initialize_dwarf2loc): New function. * dwarf2loc.h (entry_values_debug): New declaration. * dwarf2read.c (struct dwarf2_cu): New field call_site_htab. (read_call_site_scope): New forward declaration. (process_full_comp_unit): Copy call_site_htab. (process_die): Support DW_TAG_GNU_call_site. (read_call_site_scope): New function. (dwarf2_get_pc_bounds): Support NULL HIGHPC. (dwarf_tag_name): Support DW_TAG_GNU_call_site. (cleanup_htab): Delete. (write_psymtabs_to_index): Use make_cleanup_htab_delete instead of it. * exceptions.h (enum errors): New NO_ENTRY_VALUE_ERROR. * gdb-gdb.py (StructMainTypePrettyPrinter): Support FIELD_LOC_KIND_DWARF_BLOCK. * gdbtypes.h (enum field_loc_kind): New entry FIELD_LOC_KIND_DWARF_BLOCK. (struct main_type): New loc entry dwarf_block. (struct call_site, FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK) (TYPE_FIELD_DWARF_BLOCK): New. * python/py-type.c: Include dwarf2loc.h. (check_types_equal): Support FIELD_LOC_KIND_DWARF_BLOCK. New internal_error call on unknown FIELD_LOC_KIND. * symtab.h (struct symtab): New field call_site_htab. * utils.c (do_htab_delete_cleanup, make_cleanup_htab_delete) (core_addr_hash, core_addr_eq): New functions. gdb/testsuite/ Implement basic support for DW_TAG_GNU_call_site. * gdb.arch/Makefile.in (EXECUTABLES): Add amd64-entry-value. * gdb.arch/amd64-entry-value.cc: New file. * gdb.arch/amd64-entry-value.exp: New file.
2011-10-09gdb/Jan Kratochvil1-0/+17
Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches. * dwarf2-frame.c (execute_stack_op): Initialize ctx->ref_addr_size. * dwarf2expr.c (execute_stack_op) <DW_OP_GNU_implicit_pointer>: Use ctx->ref_addr_size. Handle its invalid value. * dwarf2expr.h (struct dwarf_expr_context): New field ref_addr_size. * dwarf2loc.c (dwarf2_evaluate_loc_desc_full) (dwarf2_loc_desc_needs_frame): Initialize ctx->ref_addr_size. * dwarf2loc.h (dwarf2_per_cu_ref_addr_size): New declaration. * dwarf2read.c (decode_locdesc): Initialize ctx->ref_addr_size. (dwarf2_per_cu_ref_addr_size): New function. gdb/testsuite/ Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches. * gdb.dwarf2/implptr-64bit.S: New file. * gdb.dwarf2/implptr-64bit.exp: New file.
2011-10-09gdb/Jan Kratochvil1-28/+35
Code cleanup. * dwarf2read.c (per_cu_header_read_in): New function. (dwarf2_per_cu_addr_size, dwarf2_per_cu_offset_size): Use it, with new variables cu_header_local and cu_headerp.
2011-10-09gdb/Jan Kratochvil1-1/+15
Fix initial language detection with -readnow. * dwarf2read.c (dw2_find_symbol_file): Handle OBJF_READNOW case. * symfile.h (struct quick_symbol_functions): State find_symbol_file searches only for global symbols. gdb/testsuite/ Fix initial language detection with -readnow. * gdb.cp/readnow-language.cc: New file. * gdb.cp/readnow-language.exp: New file.
2011-10-09gdb/Jan Kratochvil1-7/+68
Fix printed anonymous struct name. * dwarf2read.c (fixup_partial_die): Handle for anonymous structs also DW_TAG_interface_type. Strip for anonymous structs any prefixes. (anonymous_struct_prefix): New function. (determine_prefix): New variables retval. Call anonymous_struct_prefix. (dwarf2_name): Strip for anonymous structs any prefixes. gdb/testsuite/ Fix printed anonymous struct name. * gdb.cp/anon-struct.exp (print type of X::t2): New test.
2011-09-13gdb/Jan Kratochvil1-6/+3
Remove excessive DWARF expressions memory duplication. * dwarf2loc.c (per_cu_dwarf_call): Remove variable back_to and its use for block.data. (indirect_pieced_value): Remove variable result. Remove variable back_to and its use for baton.data. (dwarf2_compile_expr_to_ax): Remove variable back_to and its use for block.data. * dwarf2read.c (dwarf2_fetch_die_location_block): Remove xmemdup. Update the function comment.
2011-09-09gdb/Jan Kratochvil1-48/+1
Code cleanup. * amd64-tdep.c (amd64_skip_prologue): Move the XMM code to ... (amd64_skip_xmm_prologue): ... this new function. Describe its parameters. No longer use amd64_prologue_line_bug. * defs.h (producer_is_gcc_ge_4): New declaration. * dwarf2read.c (producer_is_gcc_ge_4): Move to utils.c. (process_full_comp_unit): Update its caller. Remove amd64_prologue_line_bug initialization. * symtab.h (struct symtab): Remove field amd64_prologue_line_bug. * utils.c (producer_is_gcc_ge_4): Moved here from dwarf2read.c.
2011-09-08gdb/Jan Kratochvil1-0/+3
PR breakpoints/12435 * amd64-tdep.c (amd64_skip_prologue): New variables start_pc_sal, next_sal, buf, offset and xmmreg. Advance PC if it sees the PR. * dwarf2read.c (process_full_comp_unit): Initialize amd64_prologue_line_bug. * symtab.h (struct symtab): New field amd64_prologue_line_bug. gdb/testsuite/ PR breakpoints/12435 * gdb.arch/amd64-prologue-xmm.c: New file. * gdb.arch/amd64-prologue-xmm.exp: New file. * gdb.arch/amd64-prologue-xmm.s: New file.
2011-09-01gdb/Jan Kratochvil1-8/+0
Revert: 2010-05-21 Pierre Muller <muller@ics.u-strasbg.fr> * dwarf2read.c (new_symbol): Handle DW_AT_variable_parameter attribute. gdb/testsuite/ * dw2-ifort-parameter-debug.S: New file. * dw2-ifort-parameter.c: New file. * dw2-ifort-parameter.exp: New file.
2011-07-27gdb/Jan Kratochvil1-228/+71
* dwarf2expr.c (ctx_no_read_reg): New function. * dwarf2expr.h (ctx_no_read_reg): New declaration. * dwarf2read.c (read_2_signed_bytes, read_4_signed_bytes): Remove. (decode_locdesc_read_mem, decode_locdesc_ctx_funcs): New. (decode_locdesc): Replace by a caller of dwarf_expr_eval. gdb/testsuite/ * gdb.dwarf2/dw2-simple-locdesc.S: New file. * gdb.dwarf2/dw2-simple-locdesc.exp: New file. * gdb.dwarf2/dw2-stack-boundary.exp (check partial symtab errors): Change the expected string.
2011-07-27 * xcoffread.c (dwarf2_xcoff_names): Add 'macro' and 'sentinel'Tom Tromey1-1/+2
entries. * symfile.h (struct dwarf2_debug_sections) <sentinel>: New field. * dwarf2read.c (dwarf2_elf_names): Add sentinel entry.
2011-07-26 * symfile.h (struct dwarf2_debug_sections) <macro>: New field.Tom Tromey1-145/+454
* dwarf2read.c (read_indirect_string_at_offset): New function. (read_indirect_string): Use it. (dwarf_decode_macro_bytes): New function, taken from dwarf_decode_macros. Handle DW_MACRO_GNU_*. (dwarf_decode_macros): Use it. handle DW_MACRO_GNU_*. (dwarf_parse_macro_header, skip_form_bytes, skip_unknown_opcode): New functions. (struct dwarf2_per_objfile) <macro>: New field. (dwarf2_elf_names): Add .debug_macro. (dwarf2_macros_too_long_complaint): Add 'section' argument. (dwarf2_locate_sections): Handle new section. (read_file_scope): Handle DW_AT_GNU_macros. (dwarf2_per_objfile_free): Unmap the .debug_macro section.
2011-07-20 * dwarf2read.c (process_enumeration_scope): Do not call new_symbolTom Tromey1-0/+26
in some declaration-only cases.
2011-07-20 PR symtab/12984:Tom Tromey1-118/+172
* dwarf2read.c (dwarf2_section_info_def): New typedef. (struct dwarf2_per_objfile) <types>: Change to a VEC. (struct dwarf2_per_cu_data) <from_debug_types>: Remove. <debug_type_section>: New field. (dwarf2_locate_sections): Push .debug_types sections onto VEC. (load_cu): Use appropriate section. (create_signatured_type_table_from_index): Add 'section' argument. (dwarf2_read_index): Only allow a single .debug_types section. (dw2_get_file_names): Use appropriate section. (read_type_comp_unit_head): Add 'section' argument. (create_debug_types_hash_table): Loop over all .debug_types sections. (init_cu_die_reader): Use appropriate section. (process_psymtab_comp_unit, load_partial_comp_unit) (load_full_comp_unit, read_die_and_children, find_partial_die) (lookup_die_type, determine_prefix, follow_die_offset): Update. (lookup_signatured_type_at_offset): Add 'section' argument. (read_signatured_type_at_offset): Add 'sect' argument. (read_signatured_type): Use appropriate section. (set_die_type, get_die_type_at_offset): Update. (dwarf2_per_objfile_free): Free all .debug_types sections, and VEC. (write_psymtabs_to_index): Don't allow index with more than one .debug_types section.
2011-07-19gdb/Jan Kratochvil1-8/+34
Fix crash if referenced CU is aged out. * dwarf2loc.c (per_cu_dwarf_call): New variable back_to, use to for xfree of block.data. (indirect_pieced_value): New variable back_to, use to for xfree of baton.data. (dwarf2_compile_expr_to_ax): New variable back_to, use to for xfree of block.data. * dwarf2read.c (dwarf2_find_base_address): New prototype. (load_cu): New function from ... (dw2_do_instantiate_symtab): ... the code here ... (process_full_comp_unit): ... and here. (dwarf2_fetch_die_location_block): Call load_cu first. Call xmemdup on retval.data. gdb/testsuite/ Fix crash if referenced CU is aged out. * gdb.dwarf2/dw2-op-call.exp (maintenance set dwarf2 max-cache-age 0): New. * gdb.dwarf2/implptr.exp: Likewise.
2011-07-18 * dwarf2read.c (read_subrange_type): Use attr_form_is_block whenTom Tromey1-2/+2
checking for variable-sized array.
2011-07-12gdb/Jan Kratochvil1-0/+7
Fix occasional crash of CTRL-C during DWARF read in. * dwarf2read.c (dwarf2_mark_helper): Return on NULL CU.
2011-07-11 * dwarf2read.c (handle_DW_AT_stmt_list): New function.Tom Tromey1-18/+34
(read_file_scope, read_type_unit_scope): Use it.
2011-07-05gdbTom Tromey1-0/+3
* gnu-v3-abi.c (gnuv3_rtti_type): Check TYPE_CPLUS_REALLY_JAVA. * gdbtypes.h (struct cplus_struct_type) <is_java>: New field. (TYPE_CPLUS_REALLY_JAVA): New macro. * dwarf2read.c (process_structure_scope): Set TYPE_CPLUS_REALLY_JAVA. gdb/testsuite * gdb.java/jprint.java (jprint.hi): New field. * gdb.java/jprint.exp: Print string.
2011-07-01gdb/Jan Kratochvil1-1/+105
* dwarf2read.c (check_physname): New variable. (dwarf2_physname): Prefer DW_AT_linkage_name over dwarf2_compute_name. (show_check_physname): New function. (_initialize_dwarf2_read): Add `check-physname' for check_physname. gdb/doc/ * gdb.texinfo (Debugging Output): Document set debug check-physname. gdb/testsuite/ * gdb.base/break-interp.exp (reach_1, test_ld): Allow also the prefix __GI_. * gdb.cp/psymtab-parameter.cc (func): Make it a template function. (f): New function. * gdb.cp/psymtab-parameter.exp (complete break 'func(): Rename to ... (complete p 'func<short>(): ... here. * gdb.dwarf2/dw2-linkage-name-trust-main.cc: New file. * gdb.dwarf2/dw2-linkage-name-trust.S: New file. * gdb.dwarf2/dw2-linkage-name-trust.exp: New file. * gdb.cp/temargs.exp (test type of F in k3_m, test value of F in k3_m): Make them KFAIL gcc/49546.
2011-06-29gdb/Jan Kratochvil1-0/+3
Disable epilogue unwinders on recent GCCs. * amd64-tdep.c (amd64_in_function_epilogue_p): New variable symtab, initialize it, return 0 on EPILOGUE_UNWIND_VALID. * dwarf2read.c (process_full_comp_unit): Initialize EPILOGUE_UNWIND_VALID. * i386-tdep.c (i386_in_function_epilogue_p): New variable symtab, initialize it, return 0 on EPILOGUE_UNWIND_VALID. * symtab.h (struct symtab): New field epilogue_unwind_valid.
2011-06-29gdb/Jan Kratochvil1-7/+15
Code cleanup - reformatting. * dwarf2read.c (producer_is_gcc_ge_4_0): Rename to ... (producer_is_gcc_ge_4): ... here, change the return value. (process_full_comp_unit): New variable gcc_4_minor, adjust the value interpretation.
2011-06-29gdb/Jan Kratochvil1-2/+53
Fix non-only rename list for Fortran modules import. * cp-namespace.c (cp_scan_for_anonymous_namespaces): Adjust the cp_add_using_directive caller. (cp_add_using_directive): New parameter excludes, describe it. New variables ix and param. Compare if also excludes match. Allocate NEW with variable size, initialize EXCLUDES there. (cp_lookup_symbol_imports): New variable excludep, test current->EXCLUDES with it. * cp-support.h: Include vec.h. (struct using_direct): New field excludes, describe it. (DEF_VEC_P (const_char_ptr)): New. (cp_add_using_directive): New parameter excludes. * defs.h (const_char_ptr): New typedef. * dwarf2read.c (read_import_statement): New variables child_die, excludes and cleanups, read in excludes. (read_namespace): Adjust the cp_add_using_directive caller. gdb/testsuite/ Fix non-only rename list for Fortran modules import. * gdb.fortran/module.exp (print var_x, print var_y, print var_z): New tests. * gdb.fortran/module.f90 (module moduse): New. (program module): use moduse, test var_x, var_y and var_z.
2011-06-29gdbTom Tromey1-2/+8
PR fortran/10036: * valprint.h (generic_emit_char, generic_printstr): Declare. * valprint.c (wchar_printable, append_string_as_wide) (print_wchar): Move from c-lang.c. (generic_emit_char): New function; mostly taken from c_emit_char. (generic_printstr): New function; mostly taken from c_printstr. * f-valprint.c (f_val_print) <TYPE_CODE_ARRAY>: Handle strings represented as arrays. <TYPE_CODE_CHAR>: Treat as TYPE_CODE_INT; recognize as character type. * f-typeprint.c (f_type_print_base) <TYPE_CODE_CHAR>: Treat identically to TYPE_CODE_INT. * f-lang.c (f_get_encoding): New function. (f_emit_char): Use generic_emit_char. (f_printchar): Replace comment. (f_printstr): Use generic_printstr. * dwarf2read.c (read_base_type) <DW_ATE_unsigned>: Handle Fortran "character" types specially. <DW_ATE_signed_char, DW_ATE_unsigned_char>: Make TYPE_CODE_CHAR for Fortran. * c-lang.c (wchar_printable, append_string_as_wide, print_wchar): Move to valprint.c (c_emit_char): Call generic_emit_char. (c_printstr): Call generic_printstr. gdb/testsuite * gdb.fortran/charset.exp: New file. * gdb.fortran/charset.f90: New file.
2011-06-272011-06-27 Tristan Gingold <gingold@adacore.com>Tristan Gingold1-15/+14
* dwarf2read.c (struct dwarf2_section_info): Replace was_mmapped field by map_addr and map_len. (dwarf2_read_section): Adjust for the new bfd_mmap api. (munmap_section_buffer): Likewise.
2011-06-10gdb/Jan Kratochvil1-2/+1
Code cleanup. * dwarf2read.c (dw2_map_symbol_filenames): Use symbol_filename_ftype for fun. * psymtab.c (map_symbol_filenames_psymtab) (map_partial_symbol_filenames): Likewise. * psymtab.h: Include symfile.h. (map_partial_symbol_filenames): Use symbol_filename_ftype for fun. * symfile.h (symbol_filename_ftype): New. (struct quick_symbol_functions): Use symbol_filename_ftype for fun of map_symbol_filenames, clarify more the naming in comment.
2011-05-31 PR symtab/12704Keith Seitz1-2/+2
* cp-namespace.c (ANONYMOUS_NAMESPACE_LEN): Remove. (cp_scan_for_anonymous_namespaces): Use CP_ANONYMOUS_NAMESPACE_STR and CP_ANONYMOUS_NAMESPACE_LEN. (cp_is_anonymous): Likewise. * cp-support.h (CP_ANONYMOUS_NAMESPACE_STR): Define. (CP_ANONYMOUS_NAMESPACE_LEN): Define. * dwarf2read.c (namespace_name): Likewise. (fixup_partial_die): Likewise. * linespec.c (decode_compound): If CP_ANONYMOUS_NAMESPACE_STR is seen in the input, keep it.
2011-05-262011-05-26 Tristan Gingold <gingold@adacore.com>Tristan Gingold1-34/+51
* symfile.h (struct dwarf2_section_names): New type. (struct dwarf2_debug_sections): New type. (dwarf2_has_info): Add parameter. * dwarf2read.c (dwarf2_elf_names): New variable. (INFO_SECTION, ABBREV_SECTION, LINE_SECTION, LOC_SECTION) (MACINFO_SECTION, STR_SECTION, RANGES_SECTION, TYPES_SECTION) (FRAME_SECTION, EH_FRAME_SECTION, GDB_INDEX_SECTION): Remove. (dwarf2_has_info): Add names parameter. Pass names to dwarf2_locate_sections. (section_is_p): Rewrite using the names parameter. (dwarf2_locate_sections): Use section names from the names parameter. * coffread.c (coff_symfile_read): Adjust call to dwarf2_has_info. * elfread.c (read_psyms): Ditto. * machoread.c (macho_symfile_read): Ditto.
2011-05-242011-05-24 Tristan Gingold <gingold@adacore.com>Tristan Gingold1-7/+13
* symfile.h (enum dwarf2_section_enum): New type. (dwarf2_get_section_info): New prototype. * dwarf2read.c (dwarf2_get_section_info): Replace parameter section_name by sect. Use a switch to select the info. * dwarf2-frame.c (warf2_get_section_info): Remove prototype. (dwarf2_build_frame_info): Adjust calls to dwarf2_get_section_info.
2011-05-20gdb/Jan Kratochvil1-13/+20
Fix -readnow for -gdwarf-4 unused type units. * dwarf2read.c (struct signatured_type): Remove the field offset. (create_signatured_type_table_from_index): Remove its initialization. (create_debug_types_hash_table): Likewise. Initialize per_cu.offset instead. Add a complaint call. (process_psymtab_comp_unit): Change assignment to gdb_assert. (process_type_comp_unit, lookup_die_type, dump_die_shallow) (lookup_signatured_type_at_offset, read_signatured_type) (write_one_signatured_type): Update the field for per_cu. gdb/testsuite/ Fix -readnow for -gdwarf-4 unused type units. * gdb.dwarf2/dw4-sig-type-unused.S: New file. * gdb.dwarf2/dw4-sig-type-unused.exp: New file.