Checked in by Elena Zannoni <ezannoni@redhat.com>
* dwarf2read.c (read_structure_type): Add IBM XL C++
specific code to set TYPE_VPTR_FIELDNO and TYPE_VPTR_BASETYPE
of a virtual class if a field named "__vfp" is found.
Checked in by Elena Zannoni <ezannoni@redhat.com>
* dwarf2read.c (file_full_name): Cope with file numbers that are
out of range for the given line header.
Committed by Elena Zannoni <ezannoni@redhat.com>
* dwarf2read.c (dwarf2_build_psymtabs_hard): Adjust
info_ptr before building psymtabs for included files.
(create_all_comp_units): Initailize initial length size of
compilation header to zero.
(read_initial_length): Complain if both 32-bit and 64-bit DWARF
sections are encountered within the same compilation header.
(dwarf_decode_line_header): Pass compilation header in call to
read_initial_length.
(die_ref_table): Remove.
(struct dwarf2_cu): Add DIES, DEPENDENCIES, and DIE_REF_TABLE.
(struct dwarf2_per_cu_data): Add PSYMTAB. Add a comment describing
the usage of this type.
(struct dwarf2_per_objfile): Update comment for ALL_COMP_UNITS.
(struct dwarf2_pinfo, PST_PRIVATE, DWARF_INFO_OFFSET): Remove.
(struct dwarf2_queue_item, dwarf2_queue, dwarf2_queue_tail): New.
(dwarf2_create_include_psymtab): Update comment.
(find_partial_die): Remove third argument. Remove unreachable call
to error ().
(dwarf2_find_containing_comp_unit): Update comments. Change one
assertion to an error. Remove an unreachable error.
(dwarf2_find_comp_unit): Update comments.
(type_at_offset): Remove dead code.
(make_cleanup_free_die_list, dwarf2_empty_hash_tables): Remove.
(store_in_ref_table): Add CU argument.
(follow_die_ref): Take DIE, attribute, and CU arguments. Handle
inter-compilation-unit references.
(load_full_comp_unit, process_full_comp_unit): New functions, based
on psymtab_to_symtab_1.
(psymtab_to_symtab_1): Use them.
(dwarf2_add_dependence): New function.
(dwarf2_build_psymtabs_hard): Set the psymtab in per_cu. Always create
a per_cu structure, and save it in READ_PSYMTAB_PRIVATE.
(partial_die_parent_scope, guess_structure_name): Update for changes
to find_partial_die.
(dwarf2_psymtab_to_symtab): Initialize dwarf2_per_objfile here.
(queue_comp_unit, process_queue, dwarf2_release_queue): New.
(read_comp_unit): Don't call dwarf2_empty_hash_tables.
(read_die_and_children): Update call to store_in_ref_table.
(do_free_die_list_cleanup): Remove.
(fixup_partial_die): Update for changes to find_partial_die.
(read_full_die): Handle queueing absolute references.
(read_attribute_value): Use DW_ADDR for all DW_FORM_ref* forms.
(dwarf2_attr, die_specification, die_type)
(die_containing_type, dwarf2_extension): Update calls to
follow_die_ref.
(dump_die): Update DW_FORM_ref* handling.
(dwarf2_get_ref_die_offset): Likewise.
(free_one_comp_unit): Release the dies list.
(dwarf2_mark_helper): New function.
(dwarf2_mark): Use it.
* dwarf2read.c (typename_concat): Change prototype to accept obstack
and dwarf2_cu struct pointer as arguments. Change function to use
obstack if provided and use dwarf2_cu to determine language-specific
separator.
(partial_die_parent_scope): Change comment to include java. Use
new version of typename_concat instead of obconcat.
(partial_die_full_name): Use typename_concat.
(read_namespace): Ditto.
(read_enumeration_type): Use typename_concat instead of obconcat.
(new_symbol): Ditto.
(add_partial_symbol): Enhance tests for C++ to also test for Java.
(guess_structure_name): Ditto.
(read_subroutine_type): Ditto.
(read_structure_type): Ditto.
(is_vtable_name): Add Java support.
(determine_class_name): Switch to new typename_concat call.
(determine_prefix): Switch to new typename_concat call.
* jv-exp.y (FuncStart): New pattern.
(MethodInvocation): Add support for simple function calls. Change
warning message for other forms of inferior call currently not
supported.
* valarith.c (value_subscript): Treat an array with upper-bound
of -1 as unknown size.
* objfiles.h (struct entry_info): Delete entry_func_lowpc and
entry_func_highpc fields.
* objfiles.c (init_entry_point_info): Do not clear
entry_func_lowpc and entry_func_highpc.
(objfile_relocate): Do not relocate entry_func_lowpc and
entry_func_highpc.
* dwarfread.c (read_func_scope): Do not set entry_func_lowpc and
entry_func_highpc.
* dwarf2read.c (read_func_scope): Do not set entry_func_lowpc and
entry_func_highpc.
* blockframe.c (legacy_frame_chain_valid): Replace tests against
entry_func_lowpc and entry_func_highpc with call to
inside_entry_func.
failure detected by recent versions of GCC.
(psymtab_to_symtab_1): No longer use the PST_PRIVATE macro
to be consistent with the usage in dwarf2_create_include_psymtab.
field file_names.
(partial_die_info): New field has_stmt_list. New field line_offset.
(dwarf2_create_include_psymtab): New function.
(dwarf2_build_include_psymtabs): New function.
(add_file_name): Add forward declaration. Initialize new field.
(dwarf_decode_lines): Add new parameter. Enhance this procedure
to be able to determine the list of files included by the
given unit, and build their associated psymtabs.
(dwarf2_build_psymtabs_hard): Build the psymtabs for the included
files as well.
(psymtab_to_symtab_1): Build the symtabs of all dependencies as well.
(read_file_scope): Update call to dwarf_decode_lines.
(read_partial_die): Handle DW_AT_stmt_list attributes.
Delete.
(dwarf_alloc_block): Take a CU argument. Use the comp_unit_obstack.
(read_attribute_value): Update calls to dwarf_alloc_block.
(dwarf2_build_psymtabs_hard): Don't initialize or clean up
dwarf2_tmp_obstack.
(psymtab_to_symtab_1): Likewise. Clean up using
free_stack_comp_unit.
(add_to_cu_func_list): Use the comp_unit_obstack.
(struct dwarf2_cu): Add partial_dies, comp_unit_obstack,
has_namespace_info.
(struct partial_die_info): Add comments. Use bitfields to reduce
memory footprint. Add scope, scope_set, has_specification,
spec_offset, die_parent, die_child, and die_sibling.
(peek_die_abbrev): Add prototype.
(partial_read_comp_unit_head): New function, broken out from
dwarf2_build_psymtabs_hard.
(dwarf2_build_psymtabs_hard): Remove unused variable abbrev_ptr.
Use partial_read_comp_unit_head. Initialize the CU and
comp_unit_obstack. Update calls to read_partial_die and
scan_partial_symbols. Use free_stack_comp_unit and
load_partial_dies.
(scan_partial_symbols): Change PDI to a pointer. Use the child and
sibling pointers to walk partial DIEs. Call fixup_partial_die.
Update calls to helper functions. Remove NAMESPACE argument.
Update comments.
(partial_die_parent_scope, partial_die_full_name): New functions.
(add_partial_symbol): Remove namespace argument. Update call to
pdi_needs_namespace. Use partial_die_full_name. Handle
DW_TAG_namespace. Check has_namespace_info flag.
(pdi_needs_namespace): Remove NAMESPACE argument. Just check the
tag. Handle namespaces.
(add_partial_namespace, add_partial_enumeration): Simplify.
(guess_structure_name): New function, derived from
add_partial_structure.
(add_partial_structure): Remove.
(determine_class_name): Update comment.
(dwarf2_read_abbrevs): Set has_namespace_info flag.
(is_type_tag_for_partial, load_partial_dies): New functions.
(read_partial_die): Pass abbrev and abbrev_len as arguments.
Record specifications instead of following them immediately.
(find_partial_die_in_comp_unit, find_partial_die)
(fixup_partial_die, free_stack_comp_unit)
(hashtab_obstack_allocate, dummy_obstack_deallocate)
(partial_die_hash, partial_die_eq): New functions.
* Makefile.in (hashtab_h): Define.
(dwarf2read.o): Update dependencies.
(observer_inc, observer_h): Move to the correct section.
Fix for PR c++/1553:
* dwarf2read.c (read_structure_type): Determine type name by
calling determine_class_name.
(determine_class_name): New.
(determine_prefix): Look at TYPE_TAG_NAME and call
determine_class_name when appropriate.
(determine_prefix_aux, class_name): Delete.
read_structure_scope. Don't create a symbol or call process_die.
Return immediately if die->type is set. Call read_type_die before
dwarf2_add_member_fn.
(process_structure_scope): New function.
(read_enumeration_type, process_enumeration_scope): New functions,
broken out from read_enumeration. Don't create the enumeration
type if it has already been created.
(read_enumeration): Removed.
(process_die): Call read_structure_type, process_structure_scope,
read_enumeration_type, and process_enumeration_scope. Just call
new_symbol for base and subrange types. Add a comment about other
type dies.
(read_type_die): Call read_enumeration_type.
(add_partial_structure, new_symbol): Update comments.
(struct dwarf2_cu): Add abbrev_obstack and dwarf2_abbrevs
pointer. Update comment about comp_unit_head.
(struct abbrev_info): Shorten two int flags.
(dwarf_alloc_abbrev): Take a CU argument.
(dwarf2_build_psymtabs_hard): Call dwarf2_free_abbrev_table
each time through the loop. Update cleanup argument.
(psymtab_to_symtab_1): Update cleanup call.
(dwarf2_read_abbrevs, dwarf2_alloc_abbrev): Allocate on the
abbrev_obstack.
(dwarf2_free_abbrev_table): Renamed from dwarf2_empty_abbrev_table.
Just call obstack_free and clear the pointer.