Commit Graph

842 Commits

Author SHA1 Message Date
Doug Evans ca69b9e6ad * dwarf2read.c (dwarf2_physname): Move declaration to better spot.
(compute_symtab_includes): Remove unnecessary forward declaration.
	(die_needs_namespace): Add comment marking group of functions for
	dwarf2 name computation.
2013-03-28 17:35:01 +00:00
Tom Tromey 24d6c2a0bb * ax-gdb.c (gen_var_ref): Unconditionally call via computed ops,
if possible.
	* dwarf2read.c (read_func_scope): Remove old FIXME.
	* eval.c (evaluate_subexp_standard): Check SYMBOL_COMPUTED_OPS,
	not LOC_COMPUTED.
	* findvar.c (symbol_read_needs_frame, default_read_var_value):
	Unconditionally call via computed ops, if possible.
	* printcmd.c (address_info): Unconditionally call via computed ops,
	if possible.
	* stack.c (read_frame_arg): Unconditionally call via computed ops,
	if possible.
	* symtab.c (register_symbol_computed_impl): Sanity check 'ops'.
	* tracepoint.c (scope_info): Unconditionally call via computed ops,
	if possible.
2013-03-20 18:35:22 +00:00
Tom Tromey f1e6e0721c 2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey  <tromey@redhat.com>

	PR symtab/8421:
	* coffread.c (coff_register_index): New global.
	(process_coff_symbol, coff_read_enum_type): Set
	SYMBOL_ACLASS_INDEX.
	(_initialize_coffread): Initialize new global.
	* dwarf2loc.c (locexpr_find_frame_base_location)
	(dwarf2_block_frame_base_locexpr_funcs)
	(loclist_find_frame_base_location)
	(dwarf2_block_frame_base_loclist_funcs): New.
	(dwarf_expr_frame_base_1): Call SYMBOL_BLOCK_OPS, remove internal_error.
	(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Add location_has_loclist.
	* dwarf2loc.h (dwarf2_block_frame_base_locexpr_funcs)
	(dwarf2_block_frame_base_loclist_funcs): New.
	* dwarf2read.c (dwarf2_locexpr_index, dwarf2_loclist_index)
	(dwarf2_locexpr_block_index, dwarf2_loclist_block_index): New
	globals.
	(read_func_scope): Update.
	(fixup_go_packaging, mark_common_block_symbol_computed)
	(var_decode_location, new_symbol_full, dwarf2_const_value):
	Set SYMBOL_ACLASS_INDEX.
	(dwarf2_symbol_mark_computed): Likewise.  Add 'is_block' argument.
	(_initialize_dwarf2_read): Initialize new globals.
	* jit.c (finalize_symtab): Set SYMBOL_ACLASS_INDEX.
	* jv-lang.c (add_class_symbol): Set SYMBOL_ACLASS_INDEX.
	* mdebugread.c (mdebug_register_index, mdebug_regparm_index): New
	globals.
	(parse_symbol, psymtab_to_symtab_1): Set SYMBOL_ACLASS_INDEX.
	(_initialize_mdebugread): Initialize new globals.
	* psympriv.h (struct partial_symbol) <aclass>: Update comment.
	* stabsread.c (patch_block_stabs): Set SYMBOL_ACLASS_INDEX.
	(stab_register_index, stab_regparm_index): New globals.
	(define_symbol, read_enum_type, common_block_end): Set
	SYMBOL_ACLASS_INDEX.
	(_initialize_stabsread): Initialize new globals.
	* symtab.c (next_aclass_value, symbol_impl, symbol_impls): New
	globals.
	(MAX_SYMBOL_IMPLS): New define.
	(register_symbol_computed_impl, register_symbol_block_impl)
	(register_symbol_register_impl)
	(initialize_ordinary_address_classes): New functions.
	(_initialize_symtab): Call initialize_ordinary_address_classes.
	* symtab.h (enum address_class) <LOC_FINAL_VALUE>: New constant.
	(struct symbol_impl): New.
	(SYMBOL_ACLASS_BITS): New define.
	(struct symbol) <aclass, ops>: Remove fields.
	<aclass_index>: New field.
	(symbol_impls): Declare.
	(SYMBOL_CLASS, SYMBOL_COMPUTED_OPS, SYMBOL_REGISTER_OPS): Redefine.
	(SYMBOL_IMPL, SYMBOL_ACLASS_INDEX): New defines.
	(register_symbol_computed_impl, register_symbol_block_impl)
	(register_symbol_register_impl): Declare.
	(struct symbol_computed_ops): Add location_has_loclist.
	(struct symbol_block_ops): New.
	(SYMBOL_BLOCK_OPS): New.
	* xcoffread.c (process_xcoff_symbol): Set SYMBOL_ACLASS_INDEX.
2013-03-20 18:33:05 +00:00
Jan Kratochvil 288e77a7ac gdb/
* 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.
2013-03-14 16:36:27 +00:00
Jan Kratochvil 9112db0926 gdb/
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.
2013-03-10 18:04:00 +00:00
Tom Tromey 4c9ad8c2c0 PR gdb/15102:
* dwarf2read.c (read_subrange_type): Use result of
	'check_typedef'.
gdb/testsuite
	* gdb.dwarf2/subrange.exp: New file.
2013-02-18 21:04:28 +00:00
Jan Kratochvil 233d95b548 gdb/
* 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.
2013-02-03 16:25:56 +00:00
Jan Kratochvil da235a7c21 gdb/
* 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.
2013-02-03 16:22:29 +00:00
Jan Kratochvil fbd9ab7433 gdb/
* 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.
2013-02-03 16:20:20 +00:00
Jan Kratochvil 05cba821ad gdb/
* 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.
2013-02-03 16:13:31 +00:00
Jan Kratochvil 652a899601 gdb/
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.
2013-02-03 16:03:07 +00:00
Jan Kratochvil af529f8f61 gdb/
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.
2013-02-03 16:00:36 +00:00
Jan Kratochvil f5b95b5073 gdb/
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.
2013-02-03 15:54:18 +00:00
Tom Tromey 7078baeb17 PR c++/14998:
* dwarf2read.c (read_tag_ptr_to_member_type): Handle
	TYPE_CODE_FUNC.
gdb/testsuite
	* gdb.dwarf2/method-ptr.cc: New file.
	* gdb.dwarf2/method-ptr.exp: New file.
2013-01-31 17:41:09 +00:00
Tom Tromey 7d45515218 * dwarf2read.c (compute_delayed_physnames, read_call_site_scope)
(read_structure_type, read_enumeration_type): Remove cast.
2013-01-30 18:45:39 +00:00
Tom Tromey abee88f21a * dwarf2read.c (read_namespace_type): Remove cast.
(read_typedef): Likewise.
2013-01-30 17:19:57 +00:00
Tom Tromey 8d9878a4ca * dwarf2read.c (free_dwo_file): Remove assert.
gdb/testsuite
	* gdb.dwarf2/fission-reread.exp: Add unload test.
2013-01-29 19:26:22 +00:00
Tom Tromey 4d4ec4e565 * dwarf2read.c (processing_has_namespace_info): Remove.
(struct dwarf2_cu) <processing_has_namespace_info>: New field.
	(process_die, read_func_scope, dwarf2_start_symtab)
	(new_symbol_full): Update.
2013-01-25 17:57:31 +00:00
Tom Tromey 195a3f6cae * cp-namespace.c (cp_set_block_scope): Remove.
* cp-support.h (cp_set_block_scope): Remove.
	* dbxread.c: Include block.h.
	(cp_set_block_scope): New function.
	(process_one_symbol): Update.
	* dwarf2read.c (read_func_scope): Use block_set_scope.
2013-01-25 17:55:24 +00:00
Tom Tromey 12aaed36e3 * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update.
(cp_add_using_directive): Add 'copy_names' argument.
	* cp-support.h (cp_add_using_directive): Update.
	(struct using_direct) <import_src, import_dest, alias,
	declaration>: Now const.
	* dwarf2read.c (read_import_statement): Use obconcat.
	Don't copy names passed to cp_add_using_directive.
2013-01-25 17:36:01 +00:00
Doug Evans 796a7ff823 Work around binutils/15021.
* 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.
2013-01-23 18:47:51 +00:00
Tom Tromey 10f0c4bbfa * symfile.h (obsavestring): Don't declare.
* 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.
2013-01-21 18:13:14 +00:00
Tom Tromey 86f62fd71f * dwarf2read.c (fixup_go_packaging): Save package name
on objfile obstack.
	* gdbtypes.c (init_type): Don't copy name.
2013-01-21 18:10:33 +00:00
Tom Tromey 15d034d05c * dwarf2read.c (struct partial_die_info) <name, scope>: Now
const.
	(struct attribute) <u.str>: Now const.
	(struct fnfieldlist) <name>: Now const.
	(dw2_get_file_names_reader, init_cutu_and_read_dies): Update.
	(partial_die_parent_scope): Make return type const.
	(partial_die_full_name, add_partial_symbol): Update.
	(dwarf2_compute_name, dwarf2_full_name, dwarf2_physname): Make
	'name' const.
	(find_file_and_directory): Make 'name' and 'comp_dir' const.
	(read_file_scope, read_func_scope, dwarf2_add_field)
	(dwarf2_add_member_fn, read_structure_type)
	(process_enumeration_scope, read_array_type, read_module_type)
	(read_base_type, read_subrange_type): Update.
	(dwarf2_start_symtab): Make 'name' and 'comp_dir' const.
	(new_symbol_full, guess_full_die_structure_name): Update.
	(dwarf2_canonicalize_name): Return const type.  Make 'name' const.
	(dwarf2_name): Return const type.
	(dwarf_decode_macro_bytes, dwarf_decode_macros): Make 'comp_dir'
	const.
2013-01-21 18:08:53 +00:00
Tom Tromey cfc594ee56 * dwarf2read.c (new_symbol_full): Remove cast.
* symtab.c (symbol_set_demangled_name): Make 'name' const.
	* symtab.h (symbol_set_demangled_name): Update.
2013-01-21 18:01:34 +00:00
Jan Kratochvil 5a352474f9 gdb/
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.
2013-01-21 16:46:12 +00:00
Yao Qi 257e7a0972 gdb/
* dbxread.c (dbx_psymtab_to_symtab): Delete the declaration.
	(dbx_read_symtab): New declaration.
	(dbx_psymtab_to_symtab): Delete.
	(dbx_read_symtab): Rename from dbx_psymtab_to_symtab.
	Rename parameter PST to SELF.  Exchanged two parameters.
	(start_psymtab): Caller update.
	* dwarf2read.c (dwarf2_psymtab_to_symtab): Delete the declaration.
	(dwarf2_read_symtab): New declaration.
	(dwarf2_psymtab_to_symtab): Delete.
	(dwarf2_read_symtab): Rename from dwarf2_psymtab_to_symtab.
	Rename parameter PST to SELF.  Exchanged two parameters.
	(create_partial_symtab): Caller update.
	* mdebugread.c (mdebug_psymtab_to_symtab): Delete.
	(mdebug_read_symtab): Rename from mdebug_psymtab_to_symtab.
	Rename parameter PST to SELF.  Exchanged two parameters.
	(parse_partial_symbols, new_psymtab): Caller update.
	* psympriv.h (struct partial_symtab) <read_symtab>: Exchange
	two parameters.
	* psymtab.c (psymtab_to_symtab): Caller update.
	* xcoffread.c (xcoff_psymtab_to_symtab): Delete.
	(xcoff_read_symtab): Rename from xcoff_psymtab_to_symtab.
	Rename parameter PST to SELF.  Exchanged two parameters.
	(xcoff_start_psymtab): Caller update.
2013-01-18 03:09:42 +00:00
Doug Evans 848e3e78ef * dwarf2read.c (dw2_build_type_unit_groups_reader): Delete.
(dw2_build_type_unit_groups): Delete.  All uses updated.
2013-01-17 23:21:41 +00:00
Jan Kratochvil 1ed5917465 gdb/
* dwarf2read.c (psymtab_include_file_name): Extend the function comment.
2013-01-15 21:32:36 +00:00
Tom Tromey 06d66ee9d9 PR symtab/14442:
* c-typeprint.c (cp_type_print_method_args): Handle 'restrict'.
	(c_type_print_modifier): Likewise.
	* dwarf2read.c (read_tag_restrict_type): New function.
	(read_type_die_1): Handle DW_TAG_restrict_type.
	* gdbtypes.c (make_restrict_type): New function.
	(recursive_dump_type): Handle TYPE_RESTRICT.
	* gdbtypes.h (enum type_flag_values): Renumber.
	(enum type_instance_flag_value): Add
	TYPE_INSTANCE_FLAG_RESTRICT.
	(TYPE_RESTRICT): New macro.
	(make_restrict_type): Declare.
gdb/testsuite
	* gdb.dwarf2/dw2-restrict.S: New file.
	* gdb.dwarf2/dw2-restrict.c: New file.
	* gdb.dwarf2/dw2-restrict.exp: New file.
2013-01-14 20:59:27 +00:00
Tom Tromey c9bf062262 PR symtab/14931:
* psymtab.c (struct psymtab_state): New.
	(discard_psymtabs_upto, make_cleanup_discard_psymtabs): New
	functions.
	* psympriv.h (make_cleanup_discard_psymtabs): Declare.
	* dwarf2read.c (dwarf2_build_psymtabs): Catch exceptions.
gdb/testsuite
	* gdb.dwarf2/dw2-error.exp: New file.
	* gdb.dwarf2/dw2-error.c: New file.
	* gdb.dwarf2/dw2-error.S: New file.
2013-01-14 20:51:48 +00:00
Yao Qi 442e4d9c87 gdb/
2013-01-14  Yao Qi  <yao@codesourcery.com>

	* dbxread.c (dbx_psymtab_to_symtab_1): Don't check PST is NULL.
	(dbx_psymtab_to_symtab): Likewise.
	* dwarf2read.c (dwarf2_psymtab_to_symtab): Likewise.
	* mdebugread.c (mdebug_psymtab_to_symtab): Likewise.
	* xcoffread.c (xcoff_psymtab_to_symtab_1): Likewise.
2013-01-14 10:39:33 +00:00
Doug Evans da51c34722 * symfile.h (quick_symbol_functions): Delete member
pre_expand_symtabs_matching.  All uses removed.
	* dwarf2read.c (dw2_lookup_symbol): Implement.
	(dw2_do_expand_symtabs_matching): Delete.
	(dw2_pre_expand_symtabs_matching): Delete.
	(struct dw2_symtab_iterator): New type.
	(dw2_symtab_iter_init, dw2_symtab_iter_next): New functions.
	(dw2_expand_symtabs_for_function): Rewrite.
	(dwarf2_gdb_index_functions): Update.
	* psymtab.c (pre_expand_symtabs_matching_psymtabs): Delete.
	(psym_functions): Update.
2013-01-09 20:46:03 +00:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
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.
2013-01-01 06:33:28 +00:00
Jan Kratochvil 4e04028d95 gdb/
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.
2012-12-24 19:42:16 +00:00
Jan Kratochvil b57a636e4b gdb/
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,
2012-12-16 18:57:16 +00:00
Tom Tromey 7d27a96df4 Partial fix for PR c++/14160:
* c-typeprint.c (c_type_print_base): Use TYPE_FN_FIELD_CONSTRUCTOR.
	* dwarf2read.c (dwarf2_is_constructor): New function.
	(dwarf2_add_member_fn): Use it.
	* gnu-v3-abi.c (gnuv3_pass_by_reference): Use
	TYPE_FN_FIELD_CONSTRUCTOR.
	* jv-typeprint.c (java_type_print_base): Use
	TYPE_FN_FIELD_CONSTRUCTOR.
	* gdbtypes.h (struct fn_field) <is_constructor>: New field.
	<dummy>: Shrink.
	(TYPE_FN_FIELD_CONSTRUCTOR): New macro.
testsuite
	* gdb.cp/templates.exp (test_ptype_of_templates): Update kfails.
2012-12-14 20:33:29 +00:00
Tom Tromey 5c80ed9d1e * dbxread.c (read_dbx_symtab): Update.
(end_psymtab, dbx_psymtab_to_symtab_1, dbx_psymtab_to_symtab)
	(read_ofile_symtab): Add 'objfile' argument.
	* dwarf2read.c (process_psymtab_comp_unit_reader)
	(build_type_psymtabs_reader): Update.
	(dwarf2_psymtab_to_symtab): Add 'objfile' argument.
	* mdebugread.c (mdebug_psymtab_to_symtab): Add 'objfile'
	argument.
	(parse_procedure, parse_partial_symbols): Update.
	(psymtab_to_symtab_1): Add 'objfile' argument.
	* psympriv.h (struct partial_symtab) <objfile>: Remove.
	<read_symtab>: Add 'objfile' argument.
	(sort_pst_symbols, discard_psymtab): Update.
	* psymtab.c (partial_map_expand_apply): Update.
	(find_pc_sect_psymtab_closer): Add 'objfile' argument.
	(find_pc_sect_psymtab, find_pc_sect_symtab_from_partial): Update.
	(find_pc_sect_psymbol): Add 'objfile' argument.
	(lookup_symbol_aux_psymtabs): Update.
	(match_partial_symbol, lookup_partial_symbol, psymtab_to_symtab):
	Add 'objfile' argument.
	(find_last_source_symtab_from_partial, dump_psymtab)
	(dump_psymtabs_for_objfile, read_symtabs_for_function)
	(expand_partial_symbol_tables, read_psymtabs_with_filename)
	(find_symbol_file_from_partial, map_matching_symbols_psymtab)
	(expand_symtabs_matching_via_partial): Update.
	(sort_pst_symbols): Add 'objfile' argument.
	(allocate_psymtab): Update.
	(discard_psymtab): Add 'objfile' argument.
	(maintenance_info_psymtabs, maintenance_check_symtabs): Update.
	* stabsread.h (end_psymtab): Update.
	* xcoffread.c (this_symtab_objfile): New global.
	(process_linenos, enter_line_range, xcoff_next_symbol_text):
	Update.
	(read_xcoff_symtab): Add 'objfile' argument.
	(read_symbol, read_symbol_lineno): Update.
	(xcoff_psymtab_to_symtab_1, xcoff_psymtab_to_symtab)
	(xcoff_end_psymtab): Add 'objfile' argument.
	(scan_xcoff_symtab): Update.
2012-12-12 17:03:03 +00:00
Tom Tromey 8d2cc612e5 * dwarf2read.c (dwarf2_get_dwz_file): Set 'dwz_file'. 2012-12-11 19:50:53 +00:00
Doug Evans ab4352599f * dwarf2read.c (dwarf2_cu): Enhance comment.
(dwarf2_get_pc_bounds): Only add ranges_base for DIEs that live in
	the DWO file.
	(dwarf2_record_block_ranges): Ditto.
2012-12-10 22:02:34 +00:00
Doug Evans c766f7ecdd * dwarf2read.c (create_dwo_in_dwp): Tweak comment. 2012-12-10 21:06:00 +00:00
Tom Tromey 8b9737bf8c * dwarf2read.c (dwarf2_fetch_die_loc_sect_off): New function.
(dwarf2_fetch_die_loc_cu_off): Rename from
	dwarf2_fetch_die_location_block.  Rewrite to use
	dwarf2_fetch_die_loc_sect_off.
	* dwarf2loc.h (dwarf2_fetch_die_loc_sect_off): Declare.
	(dwarf2_fetch_die_loc_cu_off): Rename.
	* dwarf2loc.c (indirect_pieced_value): Use
	dwarf2_fetch_die_loc_sect_off.
	* dwarf2expr.h (struct dwarf_expr_context) <len, data>: Update
	comment.
	(struct dwarf_expr_piece) <v.ptr.die>: Now a sect_offset.
	* dwarf2expr.c (add_piece): Update.
	(execute_stack_op) <DW_OP_GNU_implicit_pointer>: Update comment.
testsuite
	* gdb.dwarf2/implptr-64bit.exp: Run tests with two CUs as well.
	(test): Add "two_cu" argument.
	* gdb.dwarf2/implptr-64bit.S: Move subprogram later; use ref_addr
	for types; allow two CUs.
2012-12-10 17:17:29 +00:00
Jan Kratochvil 74a0d9f6a5 gdb/
* 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.
2012-12-09 18:39:59 +00:00
Jan Kratochvil 1b80a9fa75 gdb/
* 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.
2012-12-09 17:35:42 +00:00
Doug Evans 56e6461019 * dwarf2read.c (struct dwarf2_per_objfile): Clarify comment.
(dw2_find_symbol_file): Delete unused local file_data.
2012-12-03 22:31:03 +00:00
Tom Tromey 210bbc17ac * ada-lang.c (user_select_syms): Use SYMBOL_SYMTAB.
* dwarf2read.c (dw2_find_symbol_file, fixup_go_packaging): Use
	SYMBOL_SYMTAB.
	* skip.c (skip_info): Use SYMBOL_SYMTAB.
2012-11-26 15:54:29 +00:00
Pierre Muller 8c042590f9 ARI fixes: sprintf rule.
Replace sprintf function calls for char arrays by
	calls to xsnprintf calls.
	* arm-tdep.c (arm_push_dummy_call): Replace sprintf by xsnprintf.
	(arm_dwarf_reg_to_regnum, arm_return_value): Ditto.
	(arm_neon_quad_read, arm_pseudo_read): Ditto.
	(arm_neon_quad_write, arm_pseudo_write): Ditto.
	* breakpoint.c (condition_completer): Ditto.
	(create_tracepoint_from_upload): Ditto.
	* dwarf2read.c (file_full_name): Ditto.
	* gcore.c (gcore_command): Ditto.
	* gnu-nat.c (proc_string, gnu_pid_to_str): Ditto.
	* go32-nat.c (go32_sysinfo): Ditto.
	* interps.c (interp_set): Ditto.
	* m32c-tdep.c (make_types): Ditto.
	* ppc-linux-nat.c (fetch_register, store_register): Ditto.
	* remote-m32r-sdi.c (m32r_open): Ditto.
	* sol-thread.c (td_err_string): Ditto.
	(td_state_string, solaris_pid_to_str): Ditto.
	* symtab.c (gdb_mangle_name): Ditto.
	* cli/cli-script.c (execute_control_command): Ditto.
	(define_command, document_command): Ditto.
	* tui/tui-io.c (tui_rl_display_match_list): Ditto.
	* tui/tui-stack.c (tui_make_status_line): Ditto.
	* tui/tui-win.c (tui_update_gdb_sizes): Ditto.
2012-11-20 22:51:05 +00:00
Pierre Muller 2792b94d6b ARI xasprintf rule fixes.
* dwarf2read.c (create_dwo_in_dwp): Use xstrprintf function
	instead of xasprintf.
	(open_and_init_dwp_file): Ditto.
2012-11-15 08:31:23 +00:00
Tom Tromey 79d43c6168 * ada-lang.c (user_select_syms, ada_print_subexp): Pass flags
to type-printing functions.
	* ada-lang.h (ada_print_type): Add argument.
	* ada-typeprint.c (print_array_type, print_variant_clauses,
	print_variant_part, print_selected_record_field_types,
	print_record_field_types, print_unchecked_union_type,
	print_func_type, ada_print_type): Add flags argument.
	(ada_print_typedef): Update.
	* c-exp.y (OPERATOR conversion_type_id): Update.
	* c-lang.h (c_print_type, c_type_print_base): Update.
	* c-typeprint.c (c_print_type, c_type_print_varspec_prefix,
	c_type_print_modifier, c_type_print_args,
	c_type_print_varspec_suffix, c_type_print_base): Add flags
	argument.
	* cp-valprint.c (cp_print_class_member): Update.
	* dwarf2read.c (dwarf2_compute_name): Update.
	* f-lang.h (f_print_type): Add argument.
	* f-typeprint.c (f_print_type): Add flags argument.
	* gnu-v3-abi.c (gnuv3_print_method_ptr): Update.
	* go-lang.h (go_print_type): Add argument.
	* go-typeprint.c (go_print_type): Add flags argument.
	* jv-lang.h (java_print_type): Add argument.
	* jv-typeprint.c (java_type_print_base, java_print_type): Add
	flags argument.
	* language.c (unk_lang_print_type): Add flags argument.
	* language.h (struct language_defn) <la_print_type>: Add flags
	argument.
	(LA_PRINT_TYPE): Likewise.
	* m2-lang.h (m2_print_type): Add argument.
	* m2-typeprint.c (m2_print_type, m2_range, m2_typedef,
	m2_array, m2_pointer, m2_ref, m2_procedure, m2_long_set,
	m2_unbounded_array, m2_record_fields): Add flags argument.
	* p-lang.h (pascal_print_type, pascal_type_print_base,
	pascal_type_print_varspec_prefix): Add argument.
	* p-typeprint.c (pascal_print_type,
	pascal_type_print_varspec_prefix, pascal_print_func_args,
	pascal_type_print_varspec_suffix, pascal_type_print_base): Add
	flags argument.
	* symmisc.c (print_symbol): Update.
	* typeprint.c (type_print_raw_options, default_ptype_flags):
	New globals.
	(type_print): Update.
	* typeprint.h (struct type_print_options): New.
	(type_print_raw_options): Declare.
	(c_type_print_varspec_suffix, c_type_print_args): Add argument.
2012-11-12 17:14:55 +00:00
Doug Evans 80626a55b9 Add support for DWP files. http://gcc.gnu.org/wiki/DebugFissionDWP
* 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.
2012-11-05 15:50:22 +00:00
Doug Evans 844226d69a * dwarf2read.c (process_psymtab_comp_unit_reader): Remove duplicate
"0x" prefix on address in log message.
2012-10-11 02:21:50 +00:00
Doug Evans a1855c1db0 * dwarf2read.c (read_1_byte): Add const to buf parameter.
(read_1_signed_byte, read_2_bytes, read_2_signed_bytes): Ditto.
	(read_4_bytes, read_4_signed_bytes, read_8_bytes): Ditto.
	(lookup_dwo_file): Add const to dwo_name parameter.
	(lookup_dwo_comp_unit, lookup_dwo_type_unit): Ditto.
2012-10-11 02:07:22 +00:00
Tom Tromey 0971de02d5 * dwarf2read.c (mark_common_block_symbol_computed): New function.
(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.
2012-09-26 19:50:13 +00:00
Tom Tromey 4357ac6c6f 2012-09-26 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey  <tromey@redhat.com>
	* dwarf2read.c (read_common_block): Rewrite.
	(new_symbol_full): Handle DW_TAG_common_block.
	* f-lang.c (head_common_list, find_common_for_function):
	Remove.
	* f-lang.h (struct common_entry, struct saved_f77_common,
	SAVED_F77_COMMON, SAVED_F77_COMMON_PTR, COMMON_ENTRY,
	COMMON_ENTRY_PTR, head_common_list, find_common_for_function,
	BLANK_COMMON_NAME_LOCAL): Remove.
	(struct common_block): New.
	* f-valprint.c (list_all_visible_commons): Remove.
	(info_common_command_for_block): New function.
	(info_common_command): Use it.
	* stack.c (iterate_over_block_locals): Special case for
	COMMON_BLOCK_DOMAIN.
	* symtab.h (enum domain_enum_tag) <COMMON_BLOCK_DOMAIN>: New
	constant.
	(struct general_symbol_info) <value.common_block>: New field.
	(SYMBOL_VALUE_COMMON_BLOCK): New define.
gdb/testsuite
2012-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
	* gdb.fortran/common-block.exp: New file.
	* gdb.fortran/common-block.f90: New file.
2012-09-26 19:38:32 +00:00
Doug Evans 43c7c83dac * buildsym.h (param_symbols): Delete, unused.
(context_stack): Delete member "params", unused.
	* buildsym.c (push_context): Update.
	* dwarf2read.c (read_func_scope): Update.
2012-09-19 20:06:47 +00:00
Doug Evans a1b64ce14e * dwarf2read.c (dwarf2_read_addr_index): Fix handling the case where
cu == NULL.
2012-09-12 18:57:40 +00:00
Doug Evans 83a788b8b1 * dwarf2read.c (dw2_do_expand_symtabs_matching): Don't examine
.gdb_index symbol attributes if there are none.
2012-09-11 22:42:22 +00:00
Jan Kratochvil dc7650b823 gdb/
* 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.
2012-08-27 16:37:45 +00:00
Tom Tromey 6532ff3697 * dwarf2read.c (macro_start_file): Update.
* objfiles.c (get_objfile_bfd_data): Initialize macro_cache.
	(free_objfile_per_bfd_storage): Destroy macro_cache.
	(allocate_objfile, free_objfile): Update.
	* objfiles.h (struct objfile_per_bfd_storage) <macro_cache>:
	New field.
	(struct objfile) <macro_cache>: Remove.
	* symfile.c (reread_symbols): Update.
	* symmisc.c (print_symbol_bcache_statistics): Update.
	(print_objfile_statistics): Update.
2012-08-22 16:12:50 +00:00
Tom Tromey a036ba48ef * dwarf2read.c (dwarf_decode_macro_bytes)
<DW_MACRO_GNU_transparent_include>: Use pointer to included data
	as hash key.
2012-08-15 14:18:18 +00:00
Yao Qi ccce17b060 gdb/
* dwarf2loc.c (entry_values_debug): Add 'unsigned'.
	(_initialize_dwarf2loc): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* dwarf2loc.h: Update the declaration of 'entry_values_debug'.
	* dwarf2read.c (dwarf2_die_debug): Add 'unsigned'.
	(_initialize_dwarf2_read): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* darwin-nat.c (dwarwin_debug_flag): Add 'unsigned'.
	(_initialize_darwin_inferior): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* frame.c (frame_debug): Add 'unsigned'.
	(_intialize_frame): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* frame.h: Update the declaration of 'frame_debug'.
	* gdbtypes.c (overload_debug): Add 'unsigned'.
	(_initialize_gdbtypes): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* inferior.h: Update declaration of 'debug_infrun'.
	* infrun.c (debug_infrun): Add 'unsigned'.
	(_initialize_infrun): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* jit.c (jit_debug): Add 'unsigned'.
	(_initialize_jit): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* linux-nat.c (debug_linux_nat): Add 'unsigned'.
	(_initialize_linux_nat): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* linux-thread-db.c (libthread_db_debug): Add 'unsigned'.
	(_initialize_thread_db): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* machoread.c (mach_o_debug_level): Add 'unsigned'.
	(_initialize_machoread): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* mi/mi-cmd-var.c: Update the declaration of 'varobjdebug'.
	* microblaze-tdep.c (microblaze_debug_flag): Add 'unsigned'.
	(_initialize_microblaze_tdep): Call add_setshow_zuinteger_cmd
	intead of add_setshow_zinteger_cmd.
	* mips-tdep.c (mips_debug): Add 'unsigned'.
	(_initialize_mips_tdep): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* monitor.c (monitor_debug): Add 'unsigned'.
	(_initialize_remote_monitors): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* observer.c (observer_debug): Add 'unsigned'.
	(_initialize_observer): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* parse.c (expressiondebug): Add 'unsigned'.
	(_initialize_parse): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* record.c (record_debug): Add 'unsigned'.
	(_initialize_record): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* record.h: Update the declaration of 'record_debug'.
	* stap-probe.c (stap_expression_debug): Add 'unsigned'.
	(_initialize_stap_probe): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* serial.c (global_serial_debug_p): Add 'unsigned'.
	(_initialize_serial): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* solib-dsbt.c (solib_dsbt_debug): Add 'unsigned'.
	(_initialize_dsbt_solib): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* solib-frv.c (solib_frv_debug): Add 'unsigned'.
	(_initialize_frv_solib): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* target.c (targetdebug): Add 'unsigned'.
	(initialize_targets): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* valops.c (overload_debug): Add 'unsigned'.
	* varobj.c (varobjdebug): Add 'unsigned'.
	(_initialize_varobj): Call add_setshow_zuinteger_cmd instead of
	add_setshow_zinteger_cmd.
	* xtensa-tdep.c (xtensa_debug_level): Add 'unsigned'.
	(_initialize_xtensa_tdep): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.

	* arch-utils.h: Remove the declaration of 'gdbarch_debug'.
	* gdbarch.sh (gdbarch_debug): Add 'unsigned'.
	(extern void _initialize_gdbarch): Call add_setshow_zuinteger_cmd
	instead of add_setshow_zinteger_cmd.
	* gdbarch.c, gdbarch.h: Re-generated.
2012-08-02 09:36:40 +00:00
Siddhesh Poyarekar 56eb65bdc1 * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Expand parameter
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.
2012-07-26 02:03:16 +00:00
Doug Evans e615022aba * NEWS: Document new options "set/show use-deprecated-index-sections",
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".
2012-07-20 17:38:05 +00:00
Tom Tromey f7a35f025b 2012-07-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey  <tromey@redhat.com>

	* dwarf2read.c (dwarf_decode_macros)
	<DW_MACRO_GNU_define_indirect_alt, DW_MACRO_GNU_undef_indirect_alt,
	DW_MACRO_GNU_transparent_include_alt>: New cases.
	(dwarf_decode_macro_bytes) <DW_MACRO_GNU_define_indirect,
	DW_MACRO_GNU_undef_indirect>: Examine 'section_is_dwz'.
2012-07-20 16:51:51 +00:00
Tom Tromey b81e1ee05c * dwarf2read.c (try_open_dwo_file): Don't call
gdb_bfd_stash_filename.
2012-07-20 16:12:44 +00:00
Doug Evans 0109304504 * dwarf2read.c (dwarf2_ranges_read): Ignore ranges starting at zero if
there's no section at address zero.
	(dwarf2_record_block_ranges): Ditto.
2012-07-19 16:35:48 +00:00
Tom Tromey 2ec9a5e0e2 * dwarf2read.c (struct dwz_file) <gdb_index>: New field.
(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.
2012-07-18 20:01:27 +00:00
Tom Tromey 3658672899 * dwarf2read.c (struct dwarf2_per_objfile) <dwz_file>: New field.
(struct dwarf2_per_cu_data) <length>: No longer bitfield.
	<is_dwz>: New field.
	(struct dwz_file): New.
	(struct partial_die_info) <is_dwz, spec_is_dwz>: New fields.
	(locate_dwz_sections, dwarf2_get_dwz_file)
	(get_abbrev_section_for_cu): New functions.
	(error_check_comp_unit_head, read_and_check_comp_unit_head)
	(read_and_check_type_unit_head): Add abbrev_section argument.
	(create_debug_types_hash_table): Update.
	(init_cutu_and_read_dies): Use proper abbrev section.
	(init_cutu_and_read_dies_no_follow): Likewise.
	(set_partial_user): Do nothing if PST==NULL.
	(read_comp_units_from_section): New function.
	(create_all_comp_units): Use it.
	(scan_partial_symbols, partial_die_parent_scope): Update.
	(skip_one_die): Handle DW_FORM_GNU_ref_alt, DW_FORM_GNU_strp_alt.
	(process_imported_unit_die, read_partial_die): Handle .dwz files.
	(find_partial_die): Add offset_in_dwz argument.  Update.
	(guess_partial_die_structure_name, fixup_partial_die): Update.
	(read_attribute_value): Handle DW_FORM_GNU_ref_alt,
	DW_FORM_GNU_strp_alt.
	(read_indirect_string_from_dwz): New function.
	(dwarf2_const_value_attr): Handle DW_FORM_GNU_strp_alt.
	(dump_die_shallow): Handle DW_FORM_GNU_ref_alt, DW_FORM_GNU_strp_alt.
	(is_ref_attr): Handle DW_FORM_GNU_ref_alt.
	(follow_die_offset): Add offset_in_dwz argument.
	(follow_die_ref, dwarf2_fetch_die_location_block): Update.
	(skip_form_bytes): Handle DW_FORM_GNU_strp_alt.
	(dwarf_decode_macro_bytes): Add section_is_dwz argument.
	Handle new macro forms.
	(dwarf_decode_macros): Update.
	(dwarf2_find_containing_comp_unit): Add offset_in_dwz argument.
	(dwarf2_per_objfile_free): Unref dwz_bfd, if it exists
	(lookup_die_type): Handle DW_FORM_GNU_ref_alt.
	(create_debug_types_hash_table): Use correct abbrev section.
	(get_debug_line_section): New function.
	(dwarf_decode_line_header, dwarf_decode_lines_1): Use it.
	(process_full_comp_unit): Pass 'required' argument to
	end_symtab_get_static_block.
	* buildsym.h (end_symtab_get_static_block): Update.
	* buildsym.c (end_symtab_get_static_block): Add 'required'
	argument.
	(end_symtab, end_expandable_symtab): Update.
2012-07-18 19:59:35 +00:00
Tom Tromey 4bf44c1cf1 * dwarf2read.c: Don't include zlib.h or sys/mman.h.
(pagesize): Remove.
	(struct dwarf2_section_info) <map_addr, map_len>: Remove.
	(zlib_decompress_section): Remove.
	(dwarf2_read_section): Use gdb_bfd_map_section.
	(munmap_section_buffer): Remove.
	(free_dwo_file, dwarf2_per_objfile_free): Don't use
	munmap_section_buffer.
	* gdb_bfd.c: Include zlib.h, sys/mman.h.
	(struct gdb_bfd_section_data): New.
	(free_one_bfd_section): New function.
	(gdb_bfd_close_or_warn): Use free_one_bfd_section.
	(get_section_descriptor, zlib_decompress_section)
	(gdb_bfd_map_section): New functions.
	* gdb_bfd.h (gdb_bfd_map_section): Declare.
2012-07-18 19:57:21 +00:00
Tom Tromey bb39779773 * dwarf2read.c (try_open_dwo_file): use gdb_bfd_open. 2012-07-18 19:53:05 +00:00
Tom Tromey a4453b7e0b * symfile.c (symfile_bfd_open): Don't copy name. Call
gdb_bfd_stash_filename.
	(load_command): Open the new BFD before freeing the old.
	(bfd_open_maybe_remote): Call gdb_bfd_stash_filename.
	* symfile-mem.c (symbol_file_add_from_memory): Don't copy name.
	Call gdb_bfd_stash_filename.
	* spu-linux-nat.c (spu_bfd_open): Don't copy name.
	* solib-spu.c (spu_bfd_fopen): Don't copy name.  Call
	gdb_bfd_stash_filename.
	* solib-darwin.c (darwin_solib_get_all_image_info_addr_at_init):
	Free found_pathname.
	* rs6000-nat.c (add_vmap): Don't copy filename.  Call
	gdb_bfd_stash_filename.
	* remote.c (remote_bfd_open): Call gdb_bfd_stash_filename.
	* machoread.c (macho_add_oso_symfile): Call
	gdb_bfd_stash_filename.
	(macho_symfile_read_all_oso): Arrange to free archive_name.  Call
	gdb_bfd_stash_filename.
	(macho_check_dsym): Don't copy filename.  Call
	gdb_bfd_stash_filename.
	* jit.c (bfd_open_from_target_memory): Don't copy the filename.
	* gdb_bfd.c (gdb_bfd_stash_filename): New function.
	* gdb_bfd.h (gdb_bfd_stash_filename): Declare.
	* gcore.c (create_gcore_bfd): Call gdb_bfd_stash_filename.
	* exec.c (exec_close): Don't free the BFD's filename.
	(exec_file_attach): Don't copy the filename.  Call
	gdb_bfd_stash_filename.
	* corelow.c (core_close): Don't free the BFD's filename.
	(core_open): Call gdb_bfd_stash_filename.
	* corefile.c (reopen_exec_file): Remove #if 0 code.
	* solib.c (solib_bfd_fopen): Call gdb_bfd_stash_filename.  Free
	pathname.
	* dwarf2read.c (try_open_dwo_file): Call gdb_bfd_stash_filename.
2012-07-18 19:34:57 +00:00
Tom Tromey cbb099e886 * dwarf2read.c (try_open_dwo_file): Use gdb_bfd_ref and
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.
2012-07-18 19:33:34 +00:00
Doug Evans 094b34ac0b * dwarf2read.c (stmt_list_hash): New struct.
(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.
2012-07-16 03:22:40 +00:00
Jan Kratochvil 4359dff1c5 gdb/
* 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.
2012-07-13 20:26:11 +00:00
Jan Kratochvil d76b7dbc5f gdb/
* dwarf2read.c (read_call_site_scope): Do not gdb_assert for invalid
	read-in CALL_SITE_PARAMETER_PARAM_OFFSET.
2012-07-13 20:15:03 +00:00
Doug Evans f4dc4d17b0 PR gdb/13498
* 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.
2012-07-10 20:28:32 +00:00
Doug Evans 6721b2ec99 * dwarf2read.c (load_full_type_unit): Simplify. 2012-07-10 01:05:06 +00:00
Doug Evans b4dd56334d * dwarf2read.c (dwarf2_per_objfile): Change type of all_type_units
to struct signatured_type **.  All uses updated.
2012-07-09 20:27:53 +00:00
Doug Evans 45e58e77b7 * dwarf2read.c (dwarf2_attr_no_follow): Delete unused arg "cu".
All callers updated.
2012-07-09 18:21:31 +00:00
Doug Evans 667e0a4be5 * dwarf2read.c (dw2_expand_symtabs_matching): Fix typo. 2012-07-06 00:01:11 +00:00
Doug Evans 0907af0ceb * dwarf2read.c (maybe_queue_comp_unit): Move definition next to others
related to queue management.
2012-07-02 20:02:39 +00:00
Doug Evans 0940620755 * dwarf2read.c (create_debug_types_hash_table): Use "debug dwarf2-read"
instead of "debug dwarf2-die" in debugging printfs.
	(create_debug_info_hash_table_reader): Ditto.
	(create_debug_info_hash_table): Ditto.
	(init_dwo_file): Ditto.
	(init_cutu_and_read_dies): Add debugging printf.
	(init_cutu_and_read_dies_no_follow): Ditto.
	(process_psymtab_comp_unit_reader): Ditto.
2012-07-02 18:13:41 +00:00
Doug Evans 42e7ad6c73 * dwarf2read.c (signatured_type): Make "per_cu" member first.
(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.
2012-07-01 02:05:13 +00:00
Doug Evans 1ce1cefd3d * dwarf2read.c (get_cu_length): New function.
(offset_in_cu_p, error_check_comp_unit_head): Call it.
	(create_debug_types_hash_table): Ditto.
	(init_cutu_and_read_dies): Ditto.
	(init_cutu_and_read_dies_no_follow): Ditto.
2012-06-29 00:52:41 +00:00
Doug Evans 3b80fe9b75 * dwarf2read.c (dwarf2_find_base_address): Move definition. 2012-06-29 00:28:23 +00:00
Doug Evans 7f4c1aab46 remove extraneous blank line 2012-06-29 00:20:37 +00:00
Doug Evans 433df2d4d0 * dwarf2read.c (ABBREV_HASH_SIZE): Remove enclosing #ifndef/#endif.
(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.
2012-06-29 00:06:18 +00:00
Doug Evans 2e3cf129e6 * dwarf2read.c (dwarf2_cu): Add ranges_base.
Delete have_addr_base, unused.  All uses updated.
	(init_cutu_and_read_dies): Process DW_AT_GNU_ranges_base.
	(dwarf2_get_pc_bounds): Add ranges_base.
	(dwarf2_record_block_ranges): Ditto.

	testsuite/
	* gdb.dwarf2/fission-base.c: New file.
	* gdb.dwarf2/fission-base.S: New file.
	* gdb.dwarf2/fission-base.exp: New file.
2012-06-28 01:10:38 +00:00
Doug Evans 0bc3a05c52 * dwarf2read.c (per_cu_header_read_in): Simplify, and handle
type units.
2012-06-27 14:26:09 +00:00
Doug Evans 4bdcc0c114 * dwarf2read.c (read_and_check_comp_unit_head): Delete unnecessary
prototype.
	(error_check_comp_unit_head): New arg abbrev_section.  All callers
	updated.
	(read_and_check_comp_unit_head): Ditto.
	(read_and_check_type_unit_head): Ditto.
2012-06-27 00:35:33 +00:00
Doug Evans 09262596f2 * dwarf2read.c (dwo_section_names): Add macinfo_dwo, macro_dwo.
(dwo_sections): Add macinfo, macro.
	(dwarf2_locate_dwo_sections): Watch for macro sections.
	(dwarf_decode_macros): Remove args lh, abfd, section, section_name.
	All callers updated.  Handle DWO files.
2012-06-26 21:56:46 +00:00
Doug Evans 45cfd46896 * NEWS: Mention new options "set debug dwarf2-read" and
"set debug symtab-create".
	* dwarf2read.c (dwarf2_read_debug): New static global.
	(dwarf2_build_psymtabs_hard): Add debugging printfs.
	(process_queue): Ditto.
	(process_full_comp_unit): Ditto.
	(_initialize_dwarf2_read): Add new option "set debug dwarf2-read".
	* elfread.c (elf_symfile_read): Add debugging printf.
	* minsyms.c (install_minimal_symbols): Ditto.
	* psymtab.c (allocate_psymtab): Ditto.
	* symfile.c (allocate_symtab): Ditto.
	* symtab.c (symtab_create_debug): New global.
	(_initialize_symtab): Add new option "set debug symtab-create".
	* symtab.h (symtab_create_debug): Declare.

	doc/
	* gdb.texinfo (Debugging Output): Document debug options dwarf2-read
	and symtab-create.
2012-06-26 20:14:03 +00:00
Doug Evans 1c658ad5fa * dwarf2read.c (lookup_dwo_comp_unit): Enhance comment.
(lookup_dwo_type_unit): Ditto.
2012-06-26 19:48:13 +00:00
Doug Evans 156942c7d1 PR 14125
* 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.
2012-06-23 22:23:47 +00:00
Doug Evans 49f6c8397d * dwarf2expr.c (execute_stack_op): Handle DW_OP_GNU_const_index.
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.
2012-06-19 00:37:18 +00:00
Jan Kratochvil 1788b2d3be gdb/
* 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.
2012-06-17 19:53:52 +00:00
Jan Kratochvil 24c5c679cb gdb/
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.
2012-06-17 19:50:53 +00:00
Tom Tromey 663b969e68 * dwarf2read.c (dw2_find_symbol_file): Unconditionally use
init_cutu_and_read_dies.
testsuite
	* gdb.cp/namespace.exp: Add "show lang" test.
2012-06-15 16:19:02 +00:00
Tom Tromey 0726159622 * dwarf2read.c (dw2_get_file_names_reader): Ignore partial units. 2012-06-11 20:19:22 +00:00
Tom Tromey 356d9f9d9e * dwarf2read.c (dw2_get_primary_filename_reader): New function.
(dw2_find_symbol_file): Use it.
2012-06-11 18:45:01 +00:00