first_die_offset. All uses updated.
Delete unused members cu_head_ptr, next.
Move members base_known, base_address to ...
(dwarf2_cu) ... here. All uses updated.
variable.
(process_full_comp_unit): Do not set processing_current_prefix.
(dwarf2_full_name): New function.
(read_func_scope): Do not set processing_current_prefix. Use
determine_prefix.
(read_structure_type): Do not set processing_current_prefix. Remove
unused inner cleanup.
(process_structure_scope): Do not set processing_current_prefix.
(read_enumeration_type): Use dwarf2_full_name.
(determine_class_name): Return a const char *. Put the result
on the objfile obstack. Use dwarf2_full_name.
(read_namespace_type): New function.
(read_namespace): Do not create the type here. Use
determine_prefix.
(read_typedef): Use dwarf2_full_name. Do not pass the name
to init_type.
(read_base_type): Do not pass the name to init_type. Handle
TYPE_FLAG_NOSIGN.
(read_unspecified_type): Do not pass the name to init_type.
(new_symbol): Use dwarf2_full_name instead of
processing_current_prefix.
(read_type_die): Do not set processing_current_prefix. Handle
DW_TAG_namespace.
(determine_prefix): Handle specifications. Return the result
on the objfile obstack. Handle unions correctly.
cp_scan_for_anonymous_namespaces here.
(finish_block): Do not call cp_set_block_scope here.
* cp-namespace.c (processing_has_namespace_info)
(processing_current_prefix): Delete.
(cp_initialize_namespace): Do not initialize
processing_has_namespace_info.
(cp_scan_for_anonymous_namespaces): Use SYMBOL_DEMANGLED_NAME. Do
not check processing_has_namespace_info.
(cp_set_block_scope): Take prefix and namespace info flag as
arguments. Honor namespaces regardless of a demangled name.
* cp-support.h (processing_has_namespace_info)
(processing_current_prefix): Delete declarations.
(cp_set_block_scope): Update prototype.
* dwarf2read.c (processing_has_namespace_info)
(processing_current_prefix): New static variables.
(read_file_scope): Initialize processing_has_namespace_info.
(read_func_scope): Call cp_set_block_scope for C++.
(new_symbol): Call cp_scan_for_anonymous_namespaces for C++.
* symtab.c (symbol_demangled_name): Accept a const argument.
* symtab.h (symbol_demangled_name): Update prototype.
* blockframe.c (find_pc_partial_function): Likewise.
* buildsym.c (find_symbol_in_list): Likewise.
* c-valprint.c (c_val_print): Likewise.
* coffread.c (patch_opaque_types, process_coff_symbol): Likewise.
(coff_read_enum_type): Likewise. Use SYMBOL_SET_LINKAGE_NAME.
* cp-support.c (cp_remove_params): Renamed from remove_params and
made global.
(overload_list_add_symbol): Update call to remove_params.
* cp-support.h (cp_remove_params): Declare.
* dwarf2read.c (process_enumeration_scope): Use SYMBOL_LINKAGE_NAME.
(dwarf2_const_value): Use SYMBOL_PRINT_NAME.
* expprint.c (dump_subexp_body_standard): Likewise.
* f-valprint.c (info_common_command, there_is_a_visible_common_named):
Use SYMBOL_LINKAGE_NAME to find symbols and SYMBOL_PRINT_NAME
for messages.
* findvar.c (read_var_value): Use SYMBOL_LINKAGE_NAME.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline)
(hppa_hpux_skip_trampoline_code): Use SYMBOL_LINKAGE_NAME to find
symbols and SYMBOL_PRINT_NAME for messages.
* jv-lang.c (add_class_symbol): Use SYMBOL_SET_LINKAGE_NAME.
* linespec.c (decode_line_2): Use SYMBOL_LINKAGE_NAME.
* mdebugread.c (parse_symbol): Use SYMBOL_LINKAGE_NAME and
SYMBOL_SET_LINKAGE_NAME.
(mylookup_symbol): Use SYMBOL_LINKAGE_NAME.
* minsyms.c (add_minsym_to_demangled_hash_table): Use
SYMBOL_SEARCH_NAME.
(lookup_minimal_symbol): Use SYMBOL_LINKAGE_NAME or
SYMBOL_MATCHES_SEARCH_NAME, depending on the pass.
* objfiles.h (ALL_OBJFILE_MSYMBOLS): Use SYMBOL_LINKAGE_NAME.
* printcmd.c (build_address_symbolic): Use SYMBOL_LINKAGE_NAME.
(address_info): Use SYMBOL_PRINT_NAME for messages and
SYMBOL_LINKAGE_NAME for lookups.
* sol-thread.c (info_cb): Use SYMBOL_PRINT_NAME for messages.
* stabsread.c (patch_block_stabs, define_symbol)
(read_type, read_enum_type, common_block_end)
(cleanup_undefined_types_1, scan_file_globals): Use
SYMBOL_LINKAGE_NAME, SYMBOL_SET_LINKAGE_NAME, ALL_OBJFILE_MSYMBOLS,
and SYMBOL_PRINT_NAME.
* stack.c (print_frame_args): Use SYMBOL_LINKAGE_NAME.
(print_frame, frame_info): Use SYMBOL_PRINT_NAME for output. Use
cp_remove_params instead of cplus_demangle.
(print_block_frame_labels, print_frame_arg_vars): Use
SYMBOL_LINKAGE_NAME.
* symmisc.c (dump_msymbols): Use ALL_OBJFILE_MSYMBOLS and
SYMBOL_LINKAGE_NAME.
(dump_symtab_1, print_symbol, print_partial_symbols)
(maintenance_check_symtabs): Use SYMBOL_LINKAGE_NAME.
* symtab.h (DEPRECATED_SYMBOL_NAME): Delete.
(SYMBOL_SET_LINKAGE_NAME): New.
(SYMBOL_SET_NAMES): Add a comment.
* tracepoint.c (set_traceframe_context, validate_actionline)
(collect_symbol, scope_info): Use SYMBOL_LINKAGE_NAME for
lookups and SYMBOL_PRINT_NAME for output.
* typeprint.c (typedef_print): Use SYMBOL_LINKAGE_NAME.
* xcoffread.c (process_xcoff_symbol): Use SYMBOL_SET_LINKAGE_NAME.
Make the dwarf2_cu * parameter output as well as input. Update it if
we follow a reference to another CU.
(read_func_scope, determine_class_name, namespace_name, dwarf2_attr)
(die_type, die_containing_type): Update calls to changed functions.
Use the returned CU along with the returned DIE.
(read_namespace): Use dwarf2_attr instead of dwarf2_extension.
in the DIEs here.
(process_queue): Do not read in the DIEs here.
(psymtab_to_symtab_1): Update call to queue_comp_unit.
(read_full_die): Do not call queue_comp_unit from here.
(maybe_queue_comp_unit): New function.
(follow_die_ref): Use it.
(struct die_info): Change attrs to a trailing array.
(dwarf_alloc_die): Take the number of attributes. Allocate space
for them.
(read_full_die): Update call to dwarf_alloc_die. Do not manually
allocate attributes.
(struct dwarf2_cu): Replace die_ref_table with die_hash.
(struct die_info): Remove next_ref.
(store_in_ref_table): Remove offset argument. Rewrite to use
htab_find_slot_with_hash.
(die_hash, die_eq): New.
(read_comp_unit): Allocate the die_hash.
(read_die_and_children): Update call to store_die_ref.
(follow_die_ref): Rewrite to use htab_find_with_hash.
(dwarf_alloc_die): Take a CU argument. Allocate the new DIE
on the obstack.
(read_full_die): Update call to dwarf_alloc_die. Allocate
attributes on the CU obstack.
(free_one_comp_unit): Do not call free_die_list.
(read_die_and_siblings): Likewise. Do not add padding DIEs to the
sibling list.
(read_full_die): Do not allocate DIEs for abbrev 0.
(follow_die_ref): Correct error message.
2008-05-15 Pedro Alves <pedro@codesourcery.com>
Ulrich Weigand <uweigand@de.ibm.com>
* minsyms.c (lookup_minimal_symbol_by_pc_name): New function.
* symtab.h (lookup_minimal_symbol_by_pc_name): Add prototype.
* symtab.c (fixup_section): Remove prototype. Add ADDR parameter;
use it instead of ginfo->value.address. Look up minimal symbol by
address and name. Assume OBJFILE is non-NULL.
(fixup_symbol_section): Ensure we always have an objfile to look
into. Extract and pass to fixup_section the symbol's address that
will match the minimal symbol's address.
(fixup_psymbol_section): Likewise.
(find_pc_sect_psymtab): Fall back to non-addrmap case when debugging
overlays and the addrmap returned the wrong section.
* dwarf2read.c (var_decode_location): Set SYMBOL_CLASS before
calling fixup_symbol_section.
gdb/testsuite/
2008-05-15 Pedro Alves <pedro@codesourcery.com>
* gdb.base/fixsection.exp: New file.
* gdb.base/fixsection0.c: New file.
* gdb.base/fixsection1.c: New file.
instead of matching the symbol domain explictly.
* dwarf2read.c (add_partial_symbol): Do not add new psym for
STRUCT_DOMAIN. Make sure you recognize c++ struct and java and ada
class as typedefs. See lookup_partial_symbol function.
(new_symbol): Similar to add_partial_symbol, do not create
symbol for the typedef. See lookup_block_symbol.
* symtab.c (symbol_matches_domain): New function, takes care
of dual meaning of STRUCT_DOMAIN symbol for c++, ada and java.
(lookup_partial_symbol): Use symbol_matches_domain to see if the
found psym domain matches the given domain.
(lookup_block_symbol): Likewise.
(struct die_info): Remove type.
(read_type_die, read_typedef, read_base_type, read_subrange_type)
(read_structure_type, read_enumeration_type, read_array_type)
(read_tag_pointer_type, read_tag_ptr_to_member_type)
(read_tag_reference_type, read_tag_const_type, read_tag_volatile_type)
(read_tag_string_type, read_subroutine_type, read_set_type)
(read_unspecified_type): Delete prototypes. Remove check for
already-loaded type. Return the new type.
(set_die_type): Return the new type.
(reset_die_and_siblings_types): Delete.
(load_comp_unit, load_full_comp_unit): Set type_hash.
(process_queue): Remove call to reset_die_and_siblings_types.
(process_die): Do not read most types here. Use read_type_die
for others.
(read_func_scope, dwarf2_add_member_fn): Use read_type_die.
(quirk_gcc_member_function_pointer): Return the new type.
(process_structure_scope, process_enumeration_scope): Use
get_die_type and read the DIE's type.
(read_full_die): Do not initialize die->type.
(tag_type_to_type): Use read_type_die.
(read_type_die): Check for already defined types. Return the
type.
(determine_prefix): Use get_die_type.
(set_die_type): Return the type.
(get_die_type): Take a CU argument. Check for no type_hash.
* Makefile.in: Update dependencies.
* dwarf2read.c: Include "addrmap.h"
(struct dwarf2_cu): New fields RANGES_OFFSET and HAS_RANGES_OFFSET.
(dwarf2_ranges_read): New prototype.
(dwarf2_build_psymtabs_hard): Initialize and prepare PSYMTABS_ADDRMAP.
Add discontiguous range to PSYMTABS_ADDRMAP by DWARF2_RANGES_READ on
HAS_RANGES_OFFSET, otherwise add there the contiguous range.
(dwarf2_ranges_read): New parameter RANGES_PST, update the function
comment for it. Add the found ranges to RANGES_PST. New variable
BASEADDR, initialize it the common way.
(dwarf2_get_pc_bounds): Update the caller for the new parameter.
(read_partial_die): `DW_AT_ranges' now only sets RANGES_OFFSET and
HAS_RANGES_OFFSET for the later processing.
* objfiles.h (struct objfile): New field PSYMTABS_ADDRMAP.
* symtab.c: Include "addrmap.h"
(find_pc_sect_psymtab): Support reading the field PSYMTABS_ADDRMAP.
Move the psymtab locator into ...
(find_pc_sect_psymtab_closer): ... a new function.
gdb/testsuite/
* gdb.dwarf2/dw2-ranges.S: Merge the secondary section with `.fini'.
* gdb.dwarf2/dw2-ranges.exp: Compile also `dw2-ranges2.S' and
`dw2-ranges3.S' and test also their MAIN2, FUNC2 and MAIN3 symbols.
* gdb.dwarf2/dw2-ranges2.S, gdb.dwarf2/dw2-ranges3.S: New files.
* dwarf2read.c (read_partial_die): New variables BASE_ADDRESS and
BASE_ADDRESS_TYPE. Set these variables from DW_AT_LOW_PC and
DW_AT_ENTRY_PC. Set CU->HEADER.BASE_KNOWN and CU->HEADER.BASE_ADDRESS
from these variables if it was still unset.
* config.in, configure: Regenerate.
* dwarf2read.c: Include zlib.h if present.
Modified *_SECTION macros.
(section_is_p): New.
(dwarf2_locate_sections): Use section_is_p instead of strcmp
(dwarf2_resize_section): New.
to determine whether a given section has a given name.
(zlib_decompress_section): New.
(dwarf2_read_section): Read the compressed section if present
in the binary.
* testsuite/gdb.dwarf2/dw2-compressed.S: New file.
* testsuite/gdb.dwarf2/dw2-compressed.exp: New file.
* MAINTAINERS: Added myself to section Write After Approval.
for char and unsigned char types of Ada compilation units.
* ada-lang.c (ada_is_character_type): Always return true if
the type code is TYPE_CODE_CHAR.
(add_partial_symbol, pdi_needs_namespace, process_die)
(is_type_tag_for_partial, load_partial_dies, new_symbol)
(read_type_die, determine_prefix): Extend the current code of
`DW_TAG_class_type' also for `DW_TAG_interface_type'.
(dwarf2_add_field): Use it and attr_form_is_section_offset to
recognize DW_AT_data_member_location attributes. Use
dwarf2_get_attr_constant_value when the attribute is a constant.
* dwarf2read.c (attr_form_is_section_offset): New function.
(dwarf_add_member_fn, read_common_block, read_partial_die)
(dwarf2_symbol_mark_computed): Use it, instead of writing it out.
non-contiguous address ranges.
* addrmap.c, addrmap.h: New files.
* block.h (struct addrmap): New forward declaration.
(struct blockvector): New member, 'map'.
(BLOCKVECTOR_MAP): New accessor macro.
* block.c: #include "addrmap.h"
(blockvector_for_pc_sect): If the blockvector we've found has
an address map, use it instead of searching the blocks.
* buildsym.c: #include "addrmap.h"
(pending_addrmap_obstack, pending_addrmap_interesting): New static
variables.
(really_free_pendings): If we have a pending addrmap, free it too.
(record_block_range): New function.
(make_blockvector): If we have an interesting pending addrmap,
record it in the new blockvector.
(start_symtab, buildsym_init): Assert that there is no pending
addrmap now; we should have cleaned up any addrmaps we'd built
previously.
(end_symtab): If there is a pending addrmap left over that didn't
get included in the blockvector, free it.
* buildsym.h (struct addrmap): New forward declaration.
(record_block_range): New prototype.
* objfiles.c: #include "addrmap.h".
(objfile_relocate): Relocate the blockvector's address map, if
present.
* dwarf2read.c (dwarf2_record_block_ranges): New function.
(read_func_scope, read_lexical_block_scope): Call it.
* Makefile.in (SFILES): Add addrmap.c.
(addrmap_h): New header dependency variable.
(COMMON_OBS): Add addrmap.o.
(addrmap.o): New rule.l
(block.o, objfiles.o, buildsym.o): Depend on $(addrmap_h).
* block.c (blockvector_for_pc, blockvector_for_pc_sect): Return a
pointer to the block, not its index in the blockvector.
(block_for_pc_sect): Use the returned block, instead of looking it
up ourselves.
* block.h (blockvector_for_pc, blockvector_for_pc_sect): Update
declarations.
* breakpoint.c (resolve_sal_pc): Use returned block, instead of
looking it up ourselves.
* stack.c (print_frame_label_vars): Disable function, which
depends on the block's index.
* buildsym.c (finish_block): Return the block we've built.
* buildsym.h (finish_block): Update prototype.
* defs.h (CORE_ADDR_MAX): New constant.
of FT_INTEGER fundamental type for array range index type.
(decode_base_type): Use builtin types of current_gdbarch
instead of fundamental types.
* dwarf2read.c (struct dwarf2_cu): Remove ftypes member.
(read_file_scope): Do not initialize ftypes member.
(dwarf_base_type, dwarf2_fundamental_types): Remove functions.
(read_array_type): Use builtin_type_int32 instead of FT_INTEGER
fundamental type for array range index type.
(read_tag_string_type): Likewise for string range index type.
Also, do not overwrite FT_CHAR type with new string type.
(read_base_type): If DW_AT_name is missing, create unnamed type
with given properties instead of looking for a fundamental type.
Create new types as TYPE_TARGET_TYPE for DW_ATE_address and
DW_ATE_complex_float types.
(read_subrange_type): Create new type to represent missing
DW_AT_type instead of looking for a fundamental type.
(die_type): Use builtin type to represent "void" instead of
looking for a fundamental type.
* stabsread.c (define_symbol): Use builtin types to represent
'r' and 'i' floating-point and integer constants.
* gdbtypes.c (lookup_fundamental_type): Remove.
* gdbtypes.h (lookup_fundamental_type): Remove prototype.
(FT_VOID, FT_BOOLEAN, FT_CHAR, FT_SIGNED_CHAR, FT_UNSIGNED_CHAR,
FT_SHORT, FT_SIGNED_SHORT, FT_UNSIGNED_SHORT, FT_INTEGER,
FT_SIGNED_INTEGER, FT_UNSIGNED_INTEGER, FT_LONG, FT_SIGNED_LONG,
FT_UNSIGNED_LONG, FT_LONG_LONG, FT_SIGNED_LONG_LONG,
FT_UNSIGNED_LONG_LONG, FT_FLOAT, FT_DBL_PREC_FLOAT, FT_EXT_PREC_FLOAT,
FT_COMPLEX, FT_DBL_PREC_COMPLEX, FT_EXT_PREC_COMPLEX, FT_STRING,
FT_FIXED_DECIMAL, FT_FLOAT_DECIMAL, FT_BYTE, FT_UNSIGNED_BYTE,
FT_TEMPLATE_ARG, FT_DECFLOAT, FT_DBL_PREC_DECFLOAT,
FT_EXT_PREC_DECFLOAT, FT_NUM_MEMBERS): Remove macros.
* objfiles.c (struct objfile): Remove fundamental_types member.
* symfile.c (reread_symbols): Do not clear fundamental_types.
* language.h (struct language_defn): Remove la_fund_type member.
(create_fundamental_type): Remove.
* language.c (unk_lang_create_fundamental_type): Remove.
(unknown_language_defn, auto_language_defn,
local_language_defn): Adapt initializer.
* ada-lang.c (ada_create_fundamental_type): Remove.
(ada_language_defn): Adapt initializer.
* c-lang.h (c_create_fundamental_type): Remove prototype.
* c-lang.c (c_create_fundamental_type): Remove.
(c_language_defn, cplus_language_defn, asm_language_defn,
minimal_language_defn): Adapt initializer.
* f-lang.c (f_create_fundamental_type): Remove.
(f_language_defn): Adapt initializer.
* jv-lang.c (java_create_fundamental_type): Remove.
(java_language_defn): Adapt initializer.
* m2-lang.c (m2_create_fundamental_type): Remove.
(m2_language_defn): Adapt initializer.
* objc-lang.c (objc_create_fundamental_type): Remove.
(objc_language_defn): Adapt initializer.
* p-lang.h (pascal_create_fundamental_type): Remove prototype.
* p-lang.c (pascal_create_fundamental_type): Remove.
(pascal_language_defn): Adapt initializer.
* scm-lang.c (scm_language_defn): Adapt initializer.
* dwarf2read.c (dwarf2_get_pc_bounds): Moved the `DW_AT_ranges' parsing
code with its variables OBJFILE, CU_HEADER and OBFD into ...
(dwarf2_ranges_read): ... a new function.
(read_partial_die): Implemented the parsing of `DW_AT_ranges'.
gdb/testsuite/
* gdb.dwarf2/dw2-ranges.S, gdb.dwarf2/dw2-ranges.exp: New files.
Thiago Jung Bauermann <bauerman@br.ibm.com>
* c-lang.c (c_create_fundamental_type): Create fundamental
types for DFP.
* c-typeprint.c (c_type_print_varspec_prefix): Add
TYPE_CODE_DECFLOAT to no prefix needed case.
(c_type_print_varspec_suffix): Add TYPE_CODE_DECFLOAT to no
suffix needed case.
* c-valprint.c (c_val_print): Call print_decimal_floating to
print DFP values.
* dwarf2read.c (read_base_type): Read DW_ATE_decimal_float
attribute code and return TYPE_CODE_DECFLOAT.
(dwarf_base_type): Set dwarf2_fundamental_type for DFP values.
* gdbtypes.c (gdbtypes_post_init): Initialize builtin_decfloat,
builtin_decdouble and builtin_declong.
* gdbtypes.h (enum type_code): Add TYPE_CODE_DECFLOAT as a
type code for DFP.
(FT_DECFLOAT, FT_DBL_PREC_DECFLOAT, FT_EXT_PREC_DECFLOAT): New
types, for decimal floating point.
(FT_NUM_MEMBERS): Increment, new types added.
(struct builtin_type): Add builtin_decfloat, builtin_decdouble
and builtin_declong.
* valprint.c (print_decimal_floating): New function to print DFP
values.
* value.h (print_decimal_floating): Prototype.