(compute_symtab_includes): Remove unnecessary forward declaration.
(die_needs_namespace): Add comment marking group of functions for
dwarf2 name computation.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Put continue after
any successful compare_filenames_for_search or FILENAME_CMP.
* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
* symtab.c (iterate_over_some_symtabs): Likewise.
Fix entry-values in C++ across CUs.
* dwarf2loc.c (call_site_to_target_addr) <FIELD_LOC_KIND_PHYSNAME>: Use
lookup_minimal_symbol. Add a comment.
* dwarf2read.c
(read_call_site_scope) <is_ref_attr> <die_is_declaration>: Prefer
DW_AT_linkage_name.
gdb/testsuite/
Fix entry-values in C++ across CUs.
* gdb.arch/amd64-tailcall-cxx.exp: New file.
* gdb.arch/amd64-tailcall-cxx1.S: New file.
* gdb.arch/amd64-tailcall-cxx1.cc: New file.
* gdb.arch/amd64-tailcall-cxx2.S: New file.
* gdb.arch/amd64-tailcall-cxx2.cc: New file.
* dwarf2read.c (file_file_name): New function with code from
file_full_name.
(file_full_name): Move most of the code to file_file_name.
(macro_start_file): Rename variable full_name to file_name and use
file_file_name for it. Add comp_dir parameter to new_macro_table.
* macrocmd.c (show_pp_source_pos): New variable fullname. Replace any
macro_source_file->filename access by macro_source_fullname call.
* macroscope.c (_initialize_macroscope): Update the new_macro_table
caller.
* macrotab.c (struct macro_table): New field comp_dir.
(macro_include): New variables link_fullname and source_fullname.
Replace any macro_source_file->filename access by macro_source_fullname
call.
(macro_lookup_inclusion): Remove the partial filenames checking code.
(check_for_redefinition): New variables source_fullname and
found_key_fullname. Replace any macro_source_file->filename access by
macro_source_fullname call.
(macro_undef): New variables source_fullname and key_fullname. Replace
any macro_source_file->filename access by macro_source_fullname call.
(macro_lookup_definition): New variables retval and source_fullname.
Replace any macro_source_file->filename access by macro_source_fullname
call.
(foreach_macro): New variable key_fullname. Replace any
macro_source_file->filename access by macro_source_fullname call.
(foreach_macro_in_scope): New variable datum_fullname. Replace any
macro_source_file->filename access by macro_source_fullname call.
(new_macro_table): Add parameter comp_dir. Initialize T with it.
(macro_source_fullname): New function.
* macrotab.h (struct macro_source_file): Extent the filename field
comment.
(new_macro_table): New parameter comp_dir, add a comment for it.
(macro_source_fullname): new declaration.
gdb/testsuite/
* gdb.linespec/base/one/header.h: New file.
* gdb.linespec/base/two/header.h: New file.
* gdb.linespec/macro-relative.c: New file.
* gdb.linespec/macro-relative.exp: New file.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Move variable
this_real_name to outer block. Use it also for
compare_filenames_for_search.
(dw2_expand_symtabs_matching): New variable this_real_name. Use it
with dw2_get_real_path for file_matcher, considering also
BASENAMES_MAY_DIFFER.
(file_full_name): Prepend COMP_DIR even for relative lh->INCLUDE_DIRS.
* dwarf2read.c (dw2_expand_symtabs_matching): Add basenames parameter
to the file_matcher parameter. Pass 0 to it.
(dwarf2_create_include_psymtab): Copy also DIRNAME.
* psymtab.c (partial_map_symtabs_matching_filename): Drop handling of
NULL psymtab_to_fullname result.
(psymtab_to_fullname): Remove variable r. Never return NULL, assemble
an expected filename instead.
(expand_symtabs_matching_via_partial): Add basenames parameter to the
file_matcher parameter. Call also psymtab_to_fullname, after newly
considering BASENAMES_MAY_DIFFER.
* source.c (rewrite_source_path): Remove static.
* source.h (rewrite_source_path): New declaration.
* symfile.h (struct quick_symbol_functions): Add basenames parameter to
the expand_symtabs_matching field. Comment it.
* symtab.c (file_matches): New function comment. Add parameter
basenames, implement it.
(search_symbols_file_matches): Add basenames parameter. Update the
file_matches caller.
(search_symbols): Match FILES also against symtab_to_fullname.
Optimize it for BASENAMES_MAY_DIFFER.
gdb/testsuite/
* gdb.base/fullpath-expand-func.c: New file.
* gdb.base/fullpath-expand.c: New file.
* gdb.base/fullpath-expand.exp: New file.
* gdb.base/realname-expand-real.c: New file.
* gdb.base/realname-expand.c: New file.
* gdb.base/realname-expand.exp: New file.
* ada-lang.c (user_select_syms): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
* breakpoint.c (print_breakpoint_location, resolve_sal_pc): Likewise.
(clear_command): New variable sal_fullname, initialize it. Replace
compare_filenames_for_search by filename_cmp with sal_fullname.
(say_where, update_static_tracepoint): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
* cli/cli-cmds.c (edit_command, list_command, ambiguous_line_spec):
Likewise.
* dwarf2read.c: Include source.h.
(fixup_go_packaging): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* linespec.c (add_sal_to_sals): Rename variable filename to fullname.
Replace symtab->filename refererences by symtab_to_filename_for_display
calls.
(create_sals_line_offset, convert_linespec_to_sals): New variable
fullname, initialize it, replace symtab->filename reference by the
variable.
* linux-fork.c: Include source.h.
(info_checkpoints_command): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* macroscope.c (sal_macro_scope): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
* mdebugread.c: Include source.h.
(psymtab_to_symtab_1): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
(mi_cmd_file_list_exec_source_files): Likewise.
* printcmd.c: Include source.h.
(build_address_symbolic): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* psymtab.c (partial_map_symtabs_matching_filename)
(read_psymtabs_with_fullname): Call compare_filenames_for_search also
with psymtab_to_fullname.
* python/py-symtab.c (stpy_str): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
(stpy_get_filename): New variable filename, initialize it, use instead
of symtab->filename refererences.
(salpy_str): Make variable filename const char *. Replace
symtab->filename refererences by symtab_to_filename_for_display calls.
* skip.c: Include source.h and filenames.h.
(skip_file_command): Remove const from the symtab variable. Replace
symtab->filename refererences by symtab_to_fullname call.
(function_name_is_marked_for_skip): New variables searched_for_fullname
and fullname. Use them to search also with symtab's fullname.
* source.c (find_source_lines): Replace symtab->filename refererences
by symtab_to_filename_for_display calls.
(print_source_lines_base): New variable filename, use it instead of
symtab->filename. Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
(line_info, forward_search_command): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
(reverse_search_command): Replace symtab->filename refererences by
symtab_to_filename_for_display calls. New variable filename for it.
* stack.c (frame_info): Likewise.
* symmisc.c: Include source.h.
(dump_objfile, dump_symtab_1, maintenance_print_symbols)
(maintenance_info_symtabs): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
* symtab.c (iterate_over_some_symtabs): Call
compare_filenames_for_search also with symtab_to_fullname.
(lookup_symbol_aux_quick, basic_lookup_transparent_type_quick): Replace
symtab->filename refererences by symtab_to_filename_for_display calls.
(find_line_symtab): Replace symtab->filename refererences by
symtab_to_filename_for_display calls.
(file_matches): Replace filename_cmp by compare_filenames_for_search.
(print_symbol_info): Make the last parameter const char *. New
variable s_filename. Use it in the function.
(symtab_symbol_info): Make the last_filename variable const char *.
Replace symtab->filename refererences by symtab_to_filename_for_display
calls.
(rbreak_command): New variable fullname. Use it. Replace
symtab->filename refererence by symtab_to_filename_for_display call.
* tracepoint.c (set_traceframe_context, trace_find_line_command)
(print_one_static_tracepoint_marker): Replace symtab->filename
refererences by symtab_to_filename_for_display calls.
* tui/tui-source.c (tui_set_source_content): New variables filename and
s_filename. Replace symtab->filename refererences by this variable.
Replace other symtab->filename refererences by
symtab_to_filename_for_display calls.
Code cleanup.
* dwarf2read.c (dw2_expand_symtabs_with_filename): Rename to ...
(dw2_expand_symtabs_with_fullname): ... here. Rename parameter
filename to fullname. Rename variable this_name to this_fullname.
Lowercase FILENAME_CMP call.
(dw2_find_symbol_file): New comment for the returned string.
(dwarf2_gdb_index_functions): Rename the function to
dw2_expand_symtabs_with_fullname.
* psymtab.c (read_psymtabs_with_filename): Rename to ...
(read_psymtabs_with_fullname): ... here. Rename parameter filename to
fullname.
(psym_functions): Rename the function to read_psymtabs_with_fullname.
* symfile.h (struct quick_symbol_functions): Rename field
expand_symtabs_with_filename to expand_symtabs_with_fullname and its
parameter filename to fullname. Document returned string meaning for
find_symbol_file.
* symtab.c (find_line_symtab): Rename the called function to
expand_symtabs_with_fullname.
Code cleanup.
* breakpoint.c (clear_command): Remove variable is_abs, unify the
call of filename_cmp with compare_filenames_for_search.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable
is_abs, unify the call of FILENAME_CMP with
compare_filenames_for_search. New gdb_asserts for real_path and name.
Unify the call of compare_filenames_for_search with FILENAME_CMP.
* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
* symfile.h (struct quick_symbol_functions): Extend the comment for
map_symtabs_matching_filename.
* symtab.c (compare_filenames_for_search): Remove the function comment
relative path requirement. Handle absolute filenames, with a comment.
(iterate_over_some_symtabs): Remove variable is_abs, unify the call of
FILENAME_CMP with compare_filenames_for_search. New gdb_asserts for
real_path and name. Unify the call of compare_filenames_for_search
with FILENAME_CMP.
(iterate_over_symtabs): New gdb_assert on REAL_PATH.
gdb/testsuite/
* gdb.mi/mi-fullname-deleted.exp: Use double last slash for $srcfileabs.
(compare_filenames_for_search does not match)
(compare_filenames_for_search does match): New tests.
Replace xfullpath calls by gdb_realpath calls.
* cli/cli-cmds.c (find_and_open_script): Remove xfullpath from the
function comment.
* dwarf2read.c (dw2_map_expand_apply): Remove parameter full_path.
Remove it from the iterate_over_some_symtabs call.
(dw2_map_symtabs_matching_filename): Remove parameter full_path.
Remove it from the dw2_map_expand_apply calls, remove a block handling
it.
* psymtab.c (partial_map_expand_apply): Remove parameter full_path.
Remove it from the iterate_over_some_symtabs call.
(partial_map_symtabs_matching_filename): Remove parameter full_path.
Remove it from the partial_map_expand_apply calls, remove a block
handling it. Drop gdb_realpath call and cleanups from the real_path
handling.
* source.c (openp): Drop the comment part about xfullpath. Replace
xfullpath calls by gdb_realpath calls.
(find_and_open_source): Replace xfullpath call by gdb_realpath call.
* symfile.h (struct quick_symbol_functions): Remove parameter full_path
from method map_symtabs_matching_filename and its comment.
* symmisc.c (maintenance_print_msymbols): Replace xfullpath call by
gdb_realpath call.
* symtab.c (iterate_over_some_symtabs): Remove parameter full_path,
remove it also from the function comment, remove a block handling it.
Drop gdb_realpath call and cleanups from the real_path handling.
(iterate_over_symtabs): Drop variable full_path and its use.
* symtab.h (iterate_over_some_symtabs): Remove parameter full_path.
* utils.c (xfullpath): Remove.
* utils.h (xfullpath): Remove.
gdb/testsuite/
* gdb.gdb/xfullpath.exp: Replace xfullpath calls by gdb_realpath calls.
* dwarf2read.c (dwarf2_per_cu_data): Split imported_symtabs and
type_unit_group out of union s. All uses updated.
(read_index_from_section): Watch for index version 8.
(follow_die_sig): If using .gdb_index version <= 7, record the TU as
an imported symtab.
(write_psymtabs_to_index): Increment version number to 8.
doc/
* gdb.texinfo (Index Section Format): Document .gdb_index version 8.
* symfile.c (obsavestring): Remove.
* ada-exp.y: Use obstack_copy0, not obsavestring.
* ada-lang.c: Use obstack_copy0, not obsavestring.
* coffread.c: Use obstack_copy0, not obsavestring.
* cp-namespace.c: Use obstack_copy0, not obsavestring.
* dbxread.c: Use obstack_copy0, not obsavestring.
* dwarf2read.c: Use obstack_copy0, not obsavestring.
* jit.c: Use obstack_copy0, not obsavestring.
* mdebugread.c: Use obstack_copy0, not obsavestring.
* psymtab.c: Use obstack_copy0, not obsavestring.
* stabsread.c: Use obstack_copy0, not obsavestring.
* xcoffread.c: Use obstack_copy0, not obsavestring.
Fix gdb.fortran/common-block.exp crash in PIE mode.
* dwarf2read.c (new_symbol_full) <DW_TAG_common_block>: Use
LOC_COMMON_BLOCK.
* f-valprint.c (info_common_command_for_block): Expect
LOC_COMMON_BLOCK in gdb_assert.
* symtab.h (struct general_symbol_info): Update comment for the
common_block member.
(domain_enum): Extend comment for the COMMON_BLOCK_DOMAIN member.
(enum address_class): New member LOC_COMMON_BLOCK.
Two modifications:
1. The addition of 2013 to the copyright year range for every file;
2. The use of a single year range, instead of potentially multiple
year ranges, as approved by the FSF.
Code cleanup.
* dwarf2read.c (fixup_go_packaging): Do not check symtab->FILENAME for
NULL.
* linespec.c (add_sal_to_sals): Likewise.
* psympriv.h (allocate_psymtab): Add ATTRIBUTE_NONNULL.
* stack.c (print_frame): Do not check symtab->FILENAME for NULL.
* symfile.h (allocate_symtab): Add ATTRIBUTE_NONNULL.
* symtab.h (struct symtab): Add comment it is never NULL for filename.
* tracepoint.c (set_traceframe_context): Do not check symtab->FILENAME
for NULL.
* tui/tui-source.c (tui_set_source_content): Likewise.
Code cleanup.
* breakpoint.c (clear_command): Remove variable sal_name_len and its
initialization, remove it from the compare_filenames_for_search call.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable
name_len and its initialization, remove it from the
compare_filenames_for_search calls.
* psymtab.c (partial_map_symtabs_matching_filename): Likewise.
* symtab.c (compare_filenames_for_search): Remove the search_len
parameter, update the function comment, new variable search_len
initialized from SEARCH_NAME.
(iterate_over_some_symtabs): Remove variable name_len and its
initialization, remove it from the compare_filenames_for_search calls.
* symtab.h (compare_filenames_for_search): Remove the search_len
parameter,
* configure.ac (CC_HAS_LONG_LONG): Replace by AC_MSG_ERROR.
* defs.h (LONGEST, ULONGEST): Remove conditionalization for
CC_HAS_LONG_LONG.
* dwarf2-frame.c (DW64_CIE_ID): Likewise.
* dwarf2read.c (extract_cu_value): Remove the function.
(create_cus_from_index_list): Make the return type void, inline the
extract_cu_value caller, include new gdb_static_assert.
(create_cus_from_index): Make the return type void, update the function
comment, update the create_cus_from_index_list caller.
(create_signatured_type_table_from_index): Make the return type void,
inline the extract_cu_value caller, include new gdb_static_assert.
(dwarf2_read_index): Update the create_cus_from_index and
create_signatured_type_table_from_index caller.
* printcmd.c (ui_printf): Remove conditionalizations for
CC_HAS_LONG_LONG.
* config.in: Regenerate.
* configure: Regenerate.
gdb/doc/
* gdbint.texinfo (Host Definition): Remove CC_HAS_LONG_LONG.
* dwarf2read.c (struct dwarf2_cu): New field producer_is_gcc_lt_4_3.
Update the comment for checked_producer.
(check_producer): New forward declaration.
(producer_is_gcc_lt_4_3): New function.
(find_file_and_directory): Simulate *COMP_DIR only for gcc < 4.3.
(check_producer): Initialize also PRODUCER_IS_GCC_LT_4_3.
gdb/testsuite/
* gdb.dwarf2/dw2-compdir-oldgcc.S: New file.
* gdb.dwarf2/dw2-compdir-oldgcc.exp: New file.
* contrib/cc-with-tweaks.sh: Add -p parameter to invoke dwp.
* dwarf2read.c: #include "elf-bfd.h".
(struct dwarf2_per_objfile): New members dwp_checked, dwp_file.
(dwop_section_names): Renamed from dwo_section names. All uses
updated. Add entries for .debug_cu_index, .debug_tu_index.
(struct dwo_file): Rename dwo_name to name, dwo_bfd to dbfd.
All uses updated.
(struct dwp_sections): New type.
(struct virtual_dwo_sections): New type.
(struct dwp_hash_table): New type.
(struct dwp_file): New type.
(init_cutu_and_read_dies): Ensure DWO info/types section has been
read in. Handle DWOs coming from DWP files.
(lookup_dwo_file_slot): New function.
(dwarf2_locate_dwo_sections): Move definition closer to use.
(create_dwo_debug_info_hash_table_reader): Renamed from
create_debug_info_hash_table_reader. All callers updated.
(create_dwo_debug_info_hash_table): Renamed from
create_debug_info_hash_table. All callers updated.
(create_dwp_hash_table): New function.
(locate_virtual_dwo_sections, create_dwo_in_dwp): New functions.
(lookup_dwo_in_dwp): New function.
(try_open_dwop_file): Renamed from try_open_dwo_file. New parameter
is_dwp. All callers updated.
(open_dwop_file): Renamed from open_dwo_file. All callers updated.
(open_and_init_dwo_file): Renamed from init_dwo_file.
All callers updated.
(lookup_dwo_file): Delete.
(dwarf2_locate_dwp_sections): New function.
(hash_dwp_loaded_cutus, eq_dwp_loaded_cutus): New functions.
(allocate_dwp_loaded_cutus_table): New function.
(open_and_init_dwp_file): New function.
(lookup_dwo_cutu): New function.
(lookup_dwo_comp_unit, lookup_dwo_type_unit): Call it.
(read_common_block): Handle child DIEs with
DW_AT_data_member_location.
(new_symbol_full): Add special case for common blocks.
gdb/testsuite
* gdb.dwarf2/dw2-common-block.S: New file.
* gdb.dwarf2/dw2-common-block.exp: New file.
* dwarf2read.c (dwarf2_locate_sections): Move variable aflag here.
Move the SEC_HAS_CONTENTS check here - for any NAMES use.
(dwarf2_locate_sections) <eh_frame>: Move the variable and check from
here.
SIZE to size_t.
(dwarf2_evaluate_loc_desc): Likewise.
(dwarf2_loc_desc_needs_frame): Likewise.
(locexpr_describe_location_1): Likewise.
* dwarf2loc.h (struct dwarf2_locexpr_baton): Make SIZE as
size_t.
(struct dwarf2_loclist_baton): Likewise.
* dwarf2read.c (struct dwarf_block): Likewise.
(dump_die_shallow): Use pulongest to print dwarf_block.size.
(decode_locdesc): Expand SIZE and I to size_t.
and delete reference to --use-deprecated-index-sections.
* symfile.h (use_deprecated_index_sections): Delete.
* dwarf2read.c (use_deprecated_index_sections): Make static.
(read_index_from_section): Update wording of how to load
deprecated index sections.
(_initialize_dwarf2_read): New options
"set/show use-deprecated-index-sections".
* main.c (captured_main): Delete --use-deprecated-index-sections.
doc/
* gdb.texinfo (Mode Options): Delete --use-deprecated-index-sections.
(Index Files): Document how to control the use of deprecated index
sections.
(Index Section Format): Replace --use-deprecated-index-sections with
"set use-deprecated-index-sections on".
(locate_dwz_sections): Recognize .gdb_index.
(create_cus_from_index_list): New function.
(create_cus_from_index): Use it. Handle .dwz data.
(read_index_from_section): New function, extracted from
dwarf2_read_index.
(dwarf2_read_index): Use it. Read .gdb_index from dwz file,
if needed.
gdb_bfd_unref.
(free_dwo_file): Use gdb_bfd_unref.
* cli/cli-dump.c: Include gdb_bfd.h.
(bfd_openw_with_cleanup): Use gdb_bfd_ref.
(bfd_openr_with_cleanup): Likewise.
* windows-nat.c (windows_make_so): Use gdb_bfd_ref,
gdb_bfd_unref.
* utils.c: Include gdb_bfd.h.
(do_bfd_close_cleanup): Use gdb_bfd_unref.
* symfile.c: Include gdb_bfd.h.
(separate_debug_file_exists): Use gdb_bfd_unref.
(bfd_open_maybe_remote): Use gdb_bfd_ref.
(symfile_bfd_open): Use gdb_bfd_ref, gdb_bfd_unref.
(generic_load): Use gdb_bfd_ref.
(reread_symbols): Use gdb_bfd_unref.
* symfile-mem.c: Include gdb_bfd.h.
(symbol_file_add_from_memory): Use make_cleanup_bfd_close.
* spu-linux-nat.c (spu_bfd_open): Use gdb_bfd_ref, gdb_bfd_unref.
* solib.c: Include gdb_bfd.h.
(solib_bfd_fopen): Use gdb_bfd_ref.
(solib_bfd_open): Use gdb_bfd_unref.
(free_so_symbols): Use gdb_bfd_unref.
(reload_shared_libraries_1): Use gdb_bfd_unref.
* solib-spu.c: Include gdb_bfd.h.
(spu_bfd_fopen): Use gdb_bfd_ref, gdb_bfd_unref.
* solib-pa64.c (pa64_solib_create_inferior_hook): Use gdb_bfd_ref,
gdb_bfd_unref.
* solib-frv.c: Include gdb_bfd.h.
(enable_break2): Use gdb_bfd_unref.
* solib-dsbt.c: Include gdb_bfd.h.
(enable_break2): Use gdb_bfd_unref.
* solib-darwin.c: Include gdb_bfd.h.
(darwin_solib_get_all_image_info_addr_at_init): Use gdb_bfd_ref,
gdb_bfd_unref.
(darwin_bfd_open): Use gdb_bfd_unref.
* rs6000-nat.c (add_vmap): Use gdb_bfd_ref, gdb_bfd_unref.
* remote-mips.c: Include gdb_bfd.h.
(mips_load_srec): Use gdb_bfd_ref.
(pmon_load_fast): Use gdb_bfd_ref.
* remote-m32r-sdi.c: Include gdb_bfd.h.
(m32r_load): Use gdb_bfd_ref.
* record.c: Include gdb_bfd.h.
(record_save_cleanups): Use gdb_bfd_unref.
(cmd_record_save): Use gdb_bfd_unref.
* procfs.c (insert_dbx_link_bpt_in_file): Use gdb_bfd_ref,
gdb_bfd_unref.
* objfiles.h (gdb_bfd_close_or_warn): Remove.
(gdb_bfd_ref, gdb_bfd_unref): Move to gdb_bfd.h.
* objfiles.c: Include gdb_bfd.h.
(free_objfile): Use gdb_bfd_unref.
(gdb_bfd_close_or_warn, gdb_bfd_ref, gdb_bfd_unref): Move to
gdb_bfd.c.
* machoread.c (macho_add_oso_symfile): Use gdb_bfd_unref.
(macho_symfile_read_all_oso): Use gdb_bfd_ref, gdb_bfd_unref.
(macho_check_dsym): Likewise.
* m32r-rom.c: Include gdb_bfd.h.
(m32r_load): Use gdb_bfd_ref.
(m32r_upload_command): Use gdb_bfd_ref.
* jit.c: Include gdb_bfd.h.
(jit_bfd_try_read_symtab): Use gdb_bfd_ref, gdb_bfd_unref.
* gdb_bfd.h: New file.
* gdb_bfd.c: New file.
* gcore.c: Include gdb_bfd.h.
(create_gcore_bfd): Use gdb_bfd_ref.
(do_bfd_delete_cleanup): Use gdb_bfd_unref.
(gcore_command): Use gdb_bfd_unref.
* exec.c: Include gdb_bfd.h.
(exec_close): Use gdb_bfd_unref.
(exec_close_1): Use gdb_bfd_unref.
(exec_file_attach): Use gdb_bfd_ref.
* elfread.c: Include gdb_bfd.h.
(build_id_verify): Use gdb_bfd_unref.
* dsrec.c: Include gdb_bfd.h.
(load_srec): Use gdb_bfd_ref.
* corelow.c: Include gdb_bfd.h.
(core_close): Use gdb_bfd_unref.
(core_open): Use gdb_bfd_ref.
* bfd-target.c: Include gdb_bfd.h.
(target_bfd_xclose): Use gdb_bfd_unref.
(target_bfd_reopen): Use gdb_bfd_ref.
* Makefile.in (SFILES): Add gdb_bfd.c.
(HFILES_NO_SRCDIR): Add gdb_bfd.h.
(COMMON_OBS): Add gdb_bfd.o.
(type_unit_group): Embed "per_cu" member, remove pointer.
New union member "t", move member "tus" into it, all uses updated.
New member "hash", replaces member "line_offset, all uses updated.
(quick_file_names): Replace member "offset" with "hash", all uses
updated.
(hash_stmt_list_entry, eq_stmt_list_entry): New functions.
(hash_file_name_entry, eq_file_name_entry): Call them.
(hash_type_unit_group, eq_type_unit_group): Ditto.
(dw2_get_cu, dw2_get_primary_cu): Replace assert with a better one.
(dw2_get_file_names_reader): Fix file name table calculation for TUs.
(dw2_get_file_names): Update.
(create_type_unit_group): Replace "per_cu" arg with "cu".
All callers updated. Fix "quick" (.gdb_index) handling.
(get_type_unit_group): Replace "per_cu" arg with "cu".
All callers updated.
(build_type_unit_groups): Don't reset tu_stats.
* buildsym.c (end_symtab_1): Split it to ...
(end_symtab_get_static_block): ... this ...
(end_symtab_from_static_block): ... and this function.
(end_symtab, end_expandable_symtab): Call them.
* buildsym.h (end_symtab_get_static_block)
(end_symtab_from_static_block): New declarations.
* dwarf2read.c (process_full_comp_unit): New variable static_block.
Set its valid CU ranges.
gdb/testsuite/
* gdb.dwarf2/dw2-minsym-in-cu.S: New file.
* gdb.dwarf2/dw2-minsym-in-cu.exp: New file.
* dwarf2read.c (dwarf2_per_objfile): New members n_type_unit_groups,
all_type_unit_groups, type_unit_groups, tu_stats.
(dwarf2_per_cu_data): Move "imported_symtabs" into new union "s".
All uses updated. Add type_unit_group to union "s".
(type_unit_group): New struct.
(IS_TYPE_UNIT_GROUP): New macro.
(abbrev_table): Delete unused member "section".
(dw2_do_instantiate_symtab): Early exit if type_unit_group.
(dw2_get_cu): Assert not used with type_unit_group.
(dw2_get_primary_cu): New function.
(dw2_build_type_unit_groups_reader): New function.
(dw2_build_type_unit_groups): New function.
(dw2_get_file_names): Assert not called on type units.
(dw2_map_symtabs_matching_filename): Call dw2_build_type_unit_groups.
Redo loop to iterate over type unit groups instead of type units.
(dw2_expand_symtabs_matching, dw2_map_symbol_filenames): Ditto.
(read_abbrev_offset): New function.
(init_cutu_and_read_dies): New arg "abbrev_table". All callers
updated.
(create_partial_symtab): New function.
(process_psymtab_comp_unit_reader): Assert not used with type units.
Call create_partial_symtab.
(process_psymtab_type_unit): Delete.
(hash_type_unit_group, eq_type_unit_group): New functions.
(allocate_type_unit_groups_table): New function.
(NO_STMT_LIST_TYPE_UNIT_PSYMTAB): New macro.
(NO_STMT_LIST_TYPE_UNIT_PSYMTAB_SIZE): New macro.
(create_type_unit_group, get_type_unit_group): New functions.
(tu_abbrev_offset): New struct.
(sort_tu_by_abbrev_offset): New function.
(add_type_unit_group_to_table): New function.
(build_type_unit_groups): New function.
(build_type_psymtabs_reader): New function.
(build_type_psymtab_dependencies): New function.
(build_type_psymtabs): Rewrite.
(scan_partial_symbols): Flag an error if a DW_TAG_imported_unit
is seen in a type unit.
(process_queue): Move symtab expansion debugging printfs here.
Call process_full_type_unit for type units.
(compute_symtab_includes): Assert not called for type units.
(process_cu_includes): Don't call compute_symtab_includes for
type units.
(process_full_type_unit): New function.
(process_imported_unit_die): Flag an error if called for type units.
(handle_DW_AT_stmt_list): Delete arg "want_line_info". All callers
updated. Assert not called for type units.
(read_file_scope): Call dwarf2_start_symtab.
(setup_type_unit_groups): New function.
(read_type_unit_scope): Rewrite.
(abbrev_table_read_table): Initialize abbrev_table->offset.
(abbrev_table_free_cleanup): New function.
(dwarf2_start_symtab): New function.
(load_full_type_unit): Assert not called for type unit groups.
(init_cutu_and_read_dies): Handle rereading a DWO CU while it's
currently being read. Propagate DW_AT_comp_dir to DWO DIE.
testsuite/
* gdb.dwarf2/fission-reread.S: New file.
* gdb.dwarf2/fission-reread.exp: New file.
(struct abbrev_table): Define.
(dwarf2_cu): Replace members dwarf2_abbrevs, abbrev_obstack with
abbrev_table.
(init_cutu_and_read_dies): Update.
(abbrev_table_alloc_abbrev): New function. Replaces
dwarf_alloc_abbrev. All callers updated.
(abbrev_table_add_abbrev): New function.
(abbrev_table_lookup_abbrev): New function. Replaces
dwarf2_lookup_abbrev. All callers updated.
(abbrev_table_read_table): New function. Contents moved here from
dwarf2_read_abbrevs.
(dwarf2_read_abbrevs): Call it.
(abbrev_table_free): New function.
(dwarf2_free_abbrev_table): Call it.
* NEWS: Document additions to .gdb_index.
* dwarf2read.c: #include "gdb/gdb-index.h".
(DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE): New macro.
(DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE): New macro.
(DW2_GDB_INDEX_CU_SET_VALUE): New macro.
(dwarf2_read_index): Recognize version 7.
(dw2_do_expand_symtabs_matching): New args want_specific_block,
block_kind, domain): All callers updated.
(dw2_find_symbol_file): Handle new index CU values.
(dw2_expand_symtabs_matching): Match symbol kind if requested.
(add_index_entry): New args is_static, kind. All callers updated.
(offset_type_compare, uniquify_cu_indices): New functions
(symbol_kind): New function.
(write_psymtabs_to_index): Remove duplicate CU values.
(write_psymtabs_to_index): Write .gdb_index version 7.
doc/
* gdb.texinfo (Index Section Format): Document version 7 format.
include/gdb/
* gdb-index.h: New file.
Adjust address for DW_OP_GNU_addr_index.
* dwarf2expr.h (dwarf_expr_context): Update comment.
* dwarf2loc.c (locexpr_describe_location_piece): New arg per_cu,
all callers updated. Handle TLS vars described with
DW_OP_GNU_const_index.
(disassemble_dwarf_expression): Handle DW_OP_GNU_addr_index
and DW_OP_GNU_const_index.
* dwarf2read.c (decode_locdesc): Handle DW_OP_GNU_addr_index.
* dwarf2expr.c (execute_stack_op): Support DW_OP_GNU_parameter_ref.
* dwarf2loc.c (call_site_parameter_matches): Support
CALL_SITE_PARAMETER_PARAM_OFFSET.
(needs_dwarf_reg_entry_value): Push stub value.
* dwarf2read.c (read_call_site_scope): New variable origin. Support
CALL_SITE_PARAMETER_PARAM_OFFSET and its DW_AT_abstract_origin.
* gdbtypes.h (enum call_site_parameter_kind): New item
CALL_SITE_PARAMETER_PARAM_OFFSET.
(struct call_site.parameter.u): New field param_offset.
gdb/testsuite/
* gdb.arch/amd64-entry-value-param.S: New file.
* gdb.arch/amd64-entry-value-param.c: New file.
* gdb.arch/amd64-entry-value-param.exp: New file.
Code cleanup: Generalize call_site.parameter key.
* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_entry_value>: Remove
variable dwarf_reg. New variable kind_u. Update parameters to
push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value): Update parameters.
* dwarf2expr.h (enum call_site_parameter_kind)
(union call_site_parameter_u): Forward declarations.
(struct dwarf_expr_context_funcs): Update parameters and their
description for push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value): Update parameters.
* dwarf2loc.c (call_site_parameter_matches): New function.
(dwarf_expr_reg_to_entry_parameter): Update parameters and their
description. Use call_site_parameter_matches.
(dwarf_expr_push_dwarf_reg_entry_value, value_of_dwarf_reg_entry):
Update parameters and their description.
(value_of_dwarf_block_entry): Remove variables dwarf_reg and fb_offset.
New variable kind_u. Adjust the caller for updated parameters.
(needs_dwarf_reg_entry_value): Update parameters.
* dwarf2read.c (read_call_site_scope): New variable loc. Use it
instead of attr. Update for the changed fields of struct
call_site_parameter.
* gdbtypes.h: Include dwarf2expr.h.
(enum call_site_parameter_kind): New.
(struct call_site.parameter): New field kind. Wrap dwarf_reg and
fb_offset into new union u.
* opncls.c (bfd_fopen): Always close fd on failure.
(bfd_fdopenr): Likewise.
gdb/
* symfile.c (symfile_bfd_open): Don't close desc if bfd_fopen
fails.
* solib.c (solib_bfd_fopen): Don't close fd if bfd_fopen fails.
* exec.c (exec_file_attach): Don't close scratch_chan if bfd_fopen
fails.
* dwarf2read.c (try_open_dwo_file): Don't close fd if bfd_fopen
fails.
PR symtab/13277: Resolving opaque structures in ICC generated binaries.
* dwarf2read.c (struct dwarf2_cu) <producer_is_icc>: New field.
(producer_is_gxx_lt_4_6): Move the checking and caching to...
(check_producer): ... this new function, which also checks for ICC
and caches the result.
(producer_is_icc): New function.
(read_structure_type): Don't set TYPE_STUB_SUPPORTED if the
producer was ICC.
gdb/testsuite/
PR symtab/13277: Resolving opaque structures in ICC generated binaries.
* gdb.dwarf2/dw2-icc-opaque.S: New file.
* gdb.dwarf2/dw2-icc-opaque.exp: New file.
"const gdb_byte *".
(struct dwarf2_fde): Make instructions, end "const gdb_byte *".
(execute_cfa_program): Update to match API of leb128 functions.
(read_1_byte, read_4_bytes, read_8_bytes): Make buf parameter
"const gdb_byte *".
(read_unsigned_leb128, read_signed_leb128): Delete.
(read_initial_length): Change type of buf argument to
"const gdb_byte *".
(read_encoded_value): Update to match API of leb128 functions.
(decode_frame_entry): Change result to "const gdb_byte *", and
similarly for "start" parameter.
(decode_frame_entry_1): Ditto. Use new leb128 reader functions.
(dwarf2_build_frame_info): Change local frame_ptr to
"const gdb_byte *".
* dwarf2expr.c (safe_read_uleb128, safe_read_sleb128): Replaces
read_uleb128, read_sleb128. All callers updated.
(safe_skip_leb128): New function.
(dwarf_block_to_dwarf_reg): Update to match API of leb128 functions.
Call gdb_read_uleb128, gdb_skip_leb128 instead of read_uleb128.
(dwarf_block_to_dwarf_reg_deref): Update to match API of leb128
functions. Call gdb_read_uleb128, gdb_read_sleb128 instead of
read_uleb128, read_sleb128.
(dwarf_block_to_fb_offset, dwarf_block_to_sp_offset): Ditto.
(execute_stack_op): Update to match API of leb128 functions.
* dwarf2expr.h: #include "leb128.h".
(read_uleb128, read_sleb128): Delete.
(gdb_read_uleb128, gdb_read_sleb128, gdb_skip_leb128): New functions.
(safe_read_uleb128, safe_read_sleb128, safe_skip_leb128): Declare.
* dwarf2loc.c (debug_loc_kind): New enum.
(decode_debug_loc_addresses): New function.
(decode_debug_loc_dwo_addresses): New function.
(dwarf2_find_location_expression): Rewrite.
(dwarf2_compile_expr_to_ax): Update to match API of leb128 functions.
(locexpr_describe_location_piece): Ditto.
(disassemble_dwarf_expression): Ditto.
(locexpr_describe_location_1): Ditto.
(loclist_describe_location): Rewrite.
* dwarf2loc.h (dwarf2_loclist_baton): New member "from_dwo".
* dwarf2read.c (die_reader_specs): New member "buffer_end".
(dwarf2_section_buffer_overflow_complaint): Renamed from
dwarf2_macros_too_long_complaint. All callers updated.
(skip_leb128): Delete.
(init_cu_die_reader): Initialize reader->buffer_end.
(skip_one_die): Replace call to skip_leb128 with safe_skip_leb128.
(skip_form_bytes): New arg buffer_end. All callers updated.
Replace call to skip_leb128 with gdb_skip_leb128.
(skip_unknown_opcode): New arg mac_end. All callers updated.
(fill_in_loclist_baton): Initialize baton->from_dwo.
directly corresponding to the found psymtab.
* dwarf2read.c (recursively_find_pc_sect_symtab): New function.
(dw2_find_pc_sect_symtab): Use it.
* block.h (blockvector_contains_pc): Declare.
* block.c (find_block_in_blockvector): New function.
(blockvector_for_pc_sect): Use it.
(blockvector_contains_pc): New function.
init_and_read_dies_worker. All callers updated.
(init_cu_and_read_dies, init_tu_and_read_dies): Delete. All calls
replaced with init_cutu_and_read_dies.
(load_partial_comp_unit): Pass 1 for use_existing_cu.
(find_partial_die): Remove FIXME. Don't free current CU.
testsuite/
* gdb.dwarf2/pr13961.S: New file.
* gdb.dwarf2/pr13961.exp: New file.
All callers updated.
(init_cu_die_reader): Verify the section is non-empty.
(dwarf_decode_line_header): Don't dereference section->asection
until we know the section is present.
* symfile.c (default_symfile_relocate): Use sectp->owner instead of
objfile->obfd.
* symfile.h (dwarf2_debug_sections): New member addr.
* dwarf2expr.c (execute_stack_op): New case DW_OP_GNU_addr_index.
(ctx_no_get_addr_index): New function.
* dwarf2expr.h (dwarf_expr_context_funcs): New member get_addr_index.
(ctx_no_get_addr_index): Declare.
* dwarf2-frame.c (dwarf2_frame_ctx_funcs): Update.
* dwarf2loc.c (dwarf_expr_get_addr_index): New function.
(dwarf_expr_ctx_funcs): Update.
(needs_get_addr_index): New function.
(needs_frame_ctx_funcs): Update.
* dwarf2loc.h (dwarf2_read_addr_index): Declare.
* dwarf2read.c: #include "gdbcore.h".
(dwarf2_per_objfile): New members addr, dwo_files.
(dwarf2_elf_names): Add entry for addr.
(struct dwo_section_names): New type.
(dwo_section_names): New static global.
(dwarf2_cu): New members dwo_unit, addr_base, have_addr_base.
(dwarf2_per_cu_data): New member is_debug_types, all boolean uses of
old debug_types_section member updated to use this.
Rename member debug_types_section to info_or_types_section,
all uses updated.
(signatured_type): Rename member type_offset to type_offset_in_tu,
all uses updated. New member type_offset_in_section.
(struct dwo_sections): New type.
(struct dwo_unit): New type.
(struct dwo_file): New type.
(die_reader_specs): New member dwo_file.
(dwarf2_locate_sections): Watch for .debug_addr.
(zlib_decompress_section): Use sectp->owner instead of objfile->obfd.
(dwarf2_read_section): Get bfd of section from bfd's asection,
instead of objfile.
(create_cus_from_index): Initialize the_cu->info_or_types_section.
(create_signatured_type_table_from_index): Initialize
sig_type->info_or_types_section.
(dw2_get_file_names): Statement lists for type units with DWO files
live in the DWO file.
(create_debug_types_hash_table): New function.
(create_all_type_units): Rewrite.
(init_cu_die_reader): New arg dwo_file, all callers updated.
(init_and_read_dies_worker): Get section from
this_cu->info_or_types_section. Set sig_type->type_offset_in_section.
Watch for DW_AT_GNU_dwo_name and if present lookup the file and
continue reading the CU/TU from there.
(init_cutu_and_read_dies_no_follow): New arg dwo_file, all callers
updated. Get section from this_cu->info_or_types_section.
(create_all_comp_units): Initialize this_cu->info_or_types_section.
(skip_one_die): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(hash_dwo_file, eq_dwo_file): New functions.
(allocate_dwo_file_hash_table): New function.
(hash_dwo_unit, eq_dwo_unit): New functions.
(allocate_dwo_unit_table): New function.
(dwarf2_locate_dwo_sections): New function.
(struct create_dwo_info_table_data): New type.
(create_debug_info_hash_table_reader): New function.
(create_debug_info_hash_table): New function.
(try_open_dwo_file, open_dwo_file, init_dwo_file): New function.
(lookup_dwo_file): New function.
(lookup_dwo_comp_unit, lookup_dwo_type_unit): New functions.
(free_dwo_file, free_dwo_file_cleanup): New functions.
(free_dwo_file_from_slot, free_dwo_files): New functions.
(dwarf2_get_pc_bounds): Handle DW_FORM_GNU_addr_index.
(dwarf2_record_block_ranges): Ditto.
(read_partial_die): Ditto.
(process_enumeration_scope): Update to use type_offset_in_section.
(read_full_die_1): New function.
(read_full_die): Rewrite.
(read_attribute_value): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(read_addr_index_1, read_addr_index): New functions.
(read_addr_index_from_leb128): New function.
(struct dwarf2_read_addr_index_data): New type.
(dwarf2_read_addr_index_reader): New function.
(dwarf2_read_addr_index): New function.
(read_str_index): New function.
(leb128_size): New function.
(dwarf_decode_line_header): Delete arg abfd, all callers updated.
If processing a type unit from a DWO file, get the line section
from the DWO file.
(var_decode_location): Watch for DW_OP_GNU_addr_index.
(dwarf2_const_value_attr): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(lookup_die_type): Check whether section offset of type's die is
known before looking it up. Remove assert. Condition can
legimately happen for inter-cu type references.
(dwarf_attr_name): Handle Fission attributes.
(dwarf_form_name): Handle Fission forms.
(dump_die_shallow): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(follow_die_sig): Update to use type_offset_in_section.
(decode_locdesc): New case DW_OP_GNU_addr_index.
(skip_form_bytes): New cases DW_FORM_GNU_addr_index,
DW_FORM_GNU_str_index.
(cu_debug_loc_section): New function.
(fill_in_loclist_baton, dwarf2_symbol_mark_computed): Call it.
(dwarf2_per_objfile_free): Unmap .debug_addr section.
Free DWO files if present.
* xcoffread.c (dwarf2_xcoff_names): Add .debug_addr.
testsuite/
* gdb.dwarf2/dw2-intercu.S (.Ltype_int2_in_cu2): Renamed from
.Ltype_int_in_cu2. Use name "int2" instead of "int".
All uses updated.
* gdb.dwarf2/dw2-intercu.exp: Add "ptype int2" ahead of
"ptype func_cu1" to expand cu2 before cu1.
* dwarf2read.c (dwarf2_per_objfile): Replace members
debug_info_type_hash and debug_types_type_hash with die_type_hash.
(die_reader_specs): New member "die_section". Temporarily make
member "buffer" non-const, pending constifying all info_ptr uses.
(die_reader_func_ftype): New typedef.
(dw2_get_file_names_reader): New function.
(dw2_get_file_names): Rewrite.
(read_and_check_type_unit_head): Rename arg type_offset to
type_offset_in_tu.
(create_all_type_units): Improve debugging message.
Improve dummy type unit check.
(init_cu_die_reader): New arg "section". All callers updated.
(init_and_read_dies_worker): New function.
(init_cu_and_read_dies, init_tu_and_read_dies): New functions.
(init_cutu_and_read_dies_no_follow): New function.
(init_cutu_and_read_dies_simple): New function.
(process_psymtab_comp_unit_reader): New function.
(process_psymtab_comp_unit): Delete args section,
is_debug_types_section. Rewrite. All callers updated.
(process_psymtab_type_unit): Renamed from process_type_comp_unit.
All callers updated. Rewrite.
(load_partial_comp_unit_reader): New function.
(load_partial_comp_unit): Rewrite.
(skip_children): New arg reader. Delete args buffer, cu.
All callers updated.
(skip_one_die): New arg reader. Delete args buffer, cu.
All callers updated.
(locate_pdi_sibling): New arg reader. Delete args buffer, abfd, cu.
All callers updated.
(load_full_comp_unit_reader): New function.
(load_full_comp_unit): Rewrite.
(read_comp_unit): Delete.
(read_die_and_children_1): Delete, contents moved ...
(read_die_and_children): ... here.
(dwarf2_read_abbrevs): New arg abbrev_section. All callers updated.
(load_partial_dies): New arg reader. Delete args abfd, buffer, cu.
All callers updated.
(read_partial_die): New arg reader. Delete args abfd, buffer, cu.
All callers updated.
(find_partial_die): Rewrite load_all_dies support.
(read_attribute_value): New arg reader. Delete args abfd, cu.
All callers updated.
(read_attribute): New arg reader. Delete args abfd, cu.
All callers updated.
(load_full_type_unit): Add assert.
(read_signatured_type_reader): New function.
(read_signatured_type): Rewrite.
(free_stack_comp_unit): Remove call to age_cached_comp_units.
(free_one_cached_comp_unit): Change target_cu arg to target_per_cu.
All callers updated. Set per_cu->cu = NULL after freeing it.
(dwarf2_per_cu_offset_and_type): Renamed from dwarf2_offset_and_type.
(per_cu_offset_and_type_hash): Renamed from offset_and_type_hash.
(per_cu_offset_and_type_eq): Renamed from offset_and_type_eq.
(set_die_type): Update.
(get_die_type_at_offset): Update.
(read_file_scope): Call prepare_one_comp_unit.
(read_type_unit_scope): Ditto.
(prepare_one_comp_unit): Set producer if present.
Fix DW_AT_lower_bound defaults for DWARF-4+.
* dwarf2read.c (read_subrange_type): Remove initialization of low and
high. New variable low_default_is_valid. Implement DWARF-4+
DW_AT_lower_bound defaults. Print complaint for DW_AT_lower_bound with
no default by the DWARF standard.
Fix 64-bit constants on 32-bit hosts.
* dwarf2read.c (read_unsigned_leb128): Change declaration return type
from unsigned long to ULONGEST.
(read_signed_leb128): Change declaration return type from long to
LONGEST.
(dwarf2_const_value_attr): Change declaration parameter value from long
to LONGEST.
(dwarf2_compute_name): Change variable value from long to LONGEST.
(read_unsigned_leb128): Change return type, variable result and some
casts from unsigned long to ULONGEST.
(read_signed_leb128): Change return type, variable result and some
casts from long to LONGEST.
(dwarf2_const_value_data, dwarf2_const_value_attr): Change parameter
value from long to LONGEST.
(dwarf2_const_value): Change variable value from long to LONGEST.
* symmisc.c (print_symbol): Change SYMBOL_VALUE format strings to use
plongest and hex_string.
* symtab.h (struct general_symbol_info): Change ivalue from long to
LONGEST, remove the comment.
* tracepoint.c (validate_actionline, collect_symbol, scope_info):
Change SYMBOL_VALUE format strings to use plongest and hex_string.
PR symtab/7259:
* ada-exp.y (convert_char_literal): Use TYPE_FIELD_ENUMVAL.
* ada-lang.c (ada_discrete_type_high_bound)
(ada_discrete_type_low_bound): Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
(ada_identical_enum_types_p): Use TYPE_FIELD_ENUMVAL.
(pos_atr, value_val_atr): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM.
* ada-typeprint.c (print_enum_type): Change variable lastval to LONGEST.
Use TYPE_FIELD_ENUMVAL.
* ada-valprint.c (print_optional_low_bound, ada_print_scalar)
(ada_val_print_1): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM.
* c-typeprint.c (c_type_print_base): Move variable lastval to inner
block, change it to LONGEST. Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
* coffread.c (coff_read_enum_type): Use SET_FIELD_ENUMVAL.
* dwarf2read.c (process_enumeration_scope): Likewise.
* gdb-gdb.py (TypeFlagsPrinter): Use field.enumval instead of
field.bitpos.
(class StructMainTypePrettyPrinter): Support also
FIELD_LOC_KIND_ENUMVAL.
* gdbtypes.c (get_discrete_bounds): Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
(recursive_dump_type): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM.
(copy_type_recursive): Support also FIELD_LOC_KIND_ENUMVAL.
* gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL.
(struct main_type.flds_bnds.fields.loc): Adjust bitpos comment. New
field enumval.
(struct main_type.flds_bnds.bields): Adjust loc_kind and bitsize to
accommodate enumval.
(struct call_site): Adjust loc_kind to accommodate enumval.
(FIELD_ENUMVAL, FIELD_ENUMVAL_LVAL, SET_FIELD_ENUMVAL)
(TYPE_FIELD_ENUMVAL): New macros.
* m2-typeprint.c (m2_enum): Use TYPE_FIELD_ENUMVAL.
* mdebugread.c (parse_symbol): Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
* p-typeprint.c (pascal_type_print_base): Likewise.
* python/lib/gdb/printing.py (class FlagEnumerationPrinter): Use
enumval.
* python/lib/gdb/types.py (make_enum_dict): Likewise.
* python/py-type.c (convert_field): New variable addrstring. Use
TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM.
(check_types_equal): Support also FIELD_LOC_KIND_ENUMVAL.
* stabsread.c (read_enum_type): Use SET_FIELD_ENUMVAL.
* typepint.c (print_type_scalar): Use TYPE_FIELD_ENUMVAL for
TYPE_CODE_ENUM.
* valprint.c (generic_val_print): Likewise.
gdb/testsuite/
PR symtab/7259:
* gdb.base/enumval.c: New test case.
* gdb.base/enumval.exp: New test case.
* gdb.python/py-type.exp (test_enums): Use field.enumval instead of
field.bitpos.
* gdbtypes.h (FIELD_BITPOS): Rename to ...
(FIELD_BITPOS_LVAL): ... this.
(FIELD_BITPOS): New.
(SET_FIELD_BITPOS): Adjust to use FIELD_BITPOS_LVAL.
* dwarf2read.c (dwarf2_add_field): Use SET_FIELD_BITPOS.
* gdbtypes.c (append_composite_type_field_aligned): Adjust to use
SET_FIELD_BITPOS.
* gnu-v3-abi.c (build_gdb_vtable_type): Adjust to use
SET_FIELD_BITPOS.
* stabsread.c (read_cpp_abbrev, read_one_struct_field)
(read_baseclasses): Adjust to use SET_FIELD_BITPOS.
* target-descriptions.c (tdesc_gdb_type): Adjust to use
SET_FIELD_BITPOS.
local type_sig to sig_type, type_offset to type_offset_in_tu.
(hash_signatured_type): Renamed from hash_type_signature,
all callers updated.
(eq_signatured_type): Renamed from eq_type_signature,
all callers updated.
(create_debug_types_hash_table): Rename local type_sig to sig_type.
(process_enumeration_scope): Ditto.
(lookup_signatured_type_at_offset): Ditto.
(load_full_type_unit, read_signatured_type): Ditto.
(load_partial_dies): Clarify comment.
(find_partial_die): Support rereading type units.
Clarify CU handling, if we know offset is in CU, don't search for the
containing CU. Add comment regarding memory waste.
PR symtab/13777
* dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for
GCC >=4.5.
gdb/testsuite/
PR symtab/13777
* gdb.dwarf2/dw2-skip-prologue.S (DW_AT_producer): Set it to 4.5.0.
PR breakpoints/10738
* dwarf2read.c (use_deprecated_index_sections): New global.
(struct partial_die_info): New member may_be_inlined.
(read_partial_die): Set may_be_inlined where appropriate.
(add_partial_subprogram): Add partial symbols for partial
DIEs that may be inlined.
(new_symbol_full): Add inlined subroutines to the current
scope.
(write_psymtabs_to_index): Bump version number.
(dwarf2_read_index): Read only version 6 indices unless
use_deprecated_index_sections is set.
* linespec.c (symbol_and_data_callback): New structure.
(iterate_inline_only): New function.
(iterate_over_all_matching_symtabs): New argument
"include_inline". If nonzero, also call the callback for
symbols representing inlined subroutines.
(lookup_prefix_sym): Pass extra argument to the above.
(find_function_symbols): Likewise.
(add_matching_symbols_to_info): Likewise.
* NEWS: Mention that GDB can now set breakpoints on inlined
functions.
gdb/doc:
PR breakpoints/10738
* gdb.texinfo (Inline Functions): Remove the now-unnecessary @item
stating that GDB cannot set breakpoints on inlined functions.
(Mode Options): Document --use-deprecated-index-sections.
(Index Section Format): Document new index section version format.
gdb/testsuite:
PR breakpoints/10738
* gdb.opt/inline-break.exp: New file.
* gdb.opt/inline-break.c: Likewise.
* gdb.dwarf2/inline-break.exp: Likewise.
* gdb.dwarf2/inline-break.S: Likewise.
* gdb.base/annota1.exp: Cope with old .gdb_index warnings.
* gdb.base/async-shell.exp: Likewise.
* lib/mi-support.exp (library_loaded_re): Likewise.
Fix CU relative vs. absolute DIE offsets.
* dwarf2loc.h (dwarf2_fetch_die_location_block): Rename parameter
offset to offset_in_cu.
* dwarf2read.c (process_enumeration_scope): Add CU offset to
TYPE_OFFSET.
(dwarf2_fetch_die_location_block): Rename parameter offset to
offset_in_cu. New variable offset, add CU offset to OFFSET_IN_CU.
gdb/testsuite/
Fix CU relative vs. absolute DIE offsets.
* gdb.dwarf2/dw2-op-call.S: New compilation unit preceding the existing
one.
and fields.name members from char * to const char *. All uses updated.
(struct cplus_struct_type): Change type of fn_fieldlists.name member
from char * to const char *. All uses updated.
(type_name_no_tag): Update.
(lookup_unsigned_typename, lookup_signed_typename): Update.
* gdbtypes.c (type_name_no_tag): Change result type
from char * to const char *. All callers updated.
(lookup_unsigned_typename, lookup_signed_typename): Change type of
name parameter from char * to const char *.
* symtab.h (struct cplus_specific): Change type of demangled_name
member from char * to const char *. All uses updated.
(struct general_symbol_info): Change type of name and
mangled_lang.demangled_name members from char * to const char *.
All uses updated.
(symbol_get_demangled_name, symbol_natural_name): Update.
(symbol_demangled_name, symbol_search_name): Update.
* symtab.c (symbol_get_demangled_name): Change result type
from char * to const char *. All callers updated.
(symbol_natural_name, symbol_demangled_name): Ditto.
(symbol_search_name): Ditto.
(completion_list_add_name): Change type of symname,sym_text,
text,word parameters from char * to const char *.
(completion_list_objc_symbol): Change type of sym_text,
text,word parameters from char * to const char *.
* ada-lang.c (find_struct_field): Change type of name parameter
from char * to const char *.
(encoded_ordered_before): Similarly for N0,N1 parameters.
(old_renaming_is_invisible): Similarly for function_name parameter.
(ada_type_name): Change result type from char * to const char *.
All callers updated.
* ada-lang.h (ada_type_name): Update.
* buildsym.c (hashname): Change type of name parameter
from char * to const char *.
* buildsym.h (hashname): Update.
* dbxread.c (end_psymtab): Change type of include_list parameter
from char ** to const char **.
* dwarf2read.c (determine_prefix): Change result type
from char * to const char *. All callers updated.
* f-lang.c (find_common_for_function): Change type of name, funcname
parameters from char * to const char *.
* f-lang.c (find_common_for_function): Update.
* f-valprint.c (list_all_visible_commons): Change type of funcname
parameters from char * to const char *.
* gdbarch.sh (static_transform_name): Change type of name parameter
and result from char * to const char *.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* i386-sol2-tdep.c (i386_sol2_static_transform_name): Change type
of name parameter from char * to const char *.
* jv-lang.c (java_primitive_type_from_name): Ditto.
(java_demangled_signature_length): Similarly for signature parameter.
(java_demangled_signature_copy): Ditto.
(java_demangle_type_signature): Ditto.
* jv-lang.h (java_primitive_type_from_name): Update.
(java_demangle_type_signature): Update.
* objc-lang.c (specialcmp): Change type of a,b parameters
from char * to const char *.
* p-lang.c (is_pascal_string_type): Change type of arrayname parameter
from char * to const char *. All callers updated.
* p-lang.h (is_pascal_string_type): Update.
* solib-frv.c (find_canonical_descriptor_in_load_object): Change type
of name parameter from char * to const char *.
* sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Ditto.
* utils.c (fprintf_symbol_filtered): Ditto.
* defs.h (fprintf_symbol_filtered): Update.
* sparc-tdep.h (sparc_sol2_static_transform_name): Update.
* stabsread.h (end_psymtab): Update.
* stack.c (find_frame_funname): Change type of funname parameter
from char ** to const char **.
* stack.h (find_frame_funname): Update.
* typeprint.c (type_print): Change type of varstring parameter
from char * to const char *.
* value.h (type_print): Update.
* xcoffread.c (xcoff_start_psymtab): Change type of filename parameter
from char * to const char *. All callers updated.
(xcoff_end_psymtab): Change type of include_list parameter
from char ** to const char **. All callers updated.
(swap_sym): Similarly for name parameter. All callers updated.
* coffread.c (patch_type): Add (char*) cast to xfree parameter.
Use xstrdup.
(process_coff_symbol): Use xstrdup.
* stabsread.c (stabs_method_name_from_physname): Renamed from
update_method_name_from_physname. Change result type from void
to char *. All callers updated.
(read_member_functions): In has_destructor case, store name in objfile
obstack instead of malloc space. In !has_stub case, fix mem leak.