case DW_TAG_unspecified_type: return "DW_TAG_unspecified_type";
case DW_TAG_partial_unit: return "DW_TAG_partial_unit";
case DW_TAG_imported_unit: return "DW_TAG_imported_unit";
+ case DW_TAG_condition: return "DW_TAG_condition";
+ case DW_TAG_shared_type: return "DW_TAG_shared_type";
+ /* DWARF 4 values. */
+ case DW_TAG_type_unit: return "DW_TAG_type_unit";
+ case DW_TAG_rvalue_reference_type: return "DW_TAG_rvalue_reference_type";
+ case DW_TAG_template_alias: return "DW_TAG_template_alias";
/* UPC values. */
case DW_TAG_upc_shared_type: return "DW_TAG_upc_shared_type";
case DW_TAG_upc_strict_type: return "DW_TAG_upc_strict_type";
case DW_FORM_ref8: return "DW_FORM_ref8";
case DW_FORM_ref_udata: return "DW_FORM_ref_udata";
case DW_FORM_indirect: return "DW_FORM_indirect";
+ /* DWARF 4 values. */
+ case DW_FORM_sec_offset: return "DW_FORM_sec_offset";
+ case DW_FORM_exprloc: return "DW_FORM_exprloc";
+ case DW_FORM_flag_present: return "DW_FORM_flag_present";
+ case DW_FORM_ref_sig8: return "DW_FORM_ref_sig8";
default:
{
static char buffer[100];
/* Handled above. */
break;
+ case DW_FORM_ref_sig8:
+ if (!do_loc)
+ {
+ int i;
+ printf (" signature: ");
+ for (i = 0; i < 8; i++)
+ {
+ printf ("%02x", (unsigned) byte_get (data, 1));
+ data += 1;
+ }
+ }
+ else
+ data += 8;
+ break;
+
default:
warn (_("Unrecognized form: %lu\n"), form);
break;
case DW_LANG_ObjC_plus_plus: printf ("(Objective C++)"); break;
case DW_LANG_UPC: printf ("(Unified Parallel C)"); break;
case DW_LANG_D: printf ("(D)"); break;
+ /* DWARF 4 values. */
+ case DW_LANG_Python: printf ("(Python)"); break;
/* MIPS extension. */
case DW_LANG_Mips_Assembler: printf ("(MIPS assembler)"); break;
/* UPC extension. */
case DW_AT_import:
{
+ if (form == DW_FORM_ref_sig8)
+ break;
+
if (form == DW_FORM_ref1
|| form == DW_FORM_ref2
|| form == DW_FORM_ref4)
case DW_AT_elemental: return "DW_AT_elemental";
case DW_AT_pure: return "DW_AT_pure";
case DW_AT_recursive: return "DW_AT_recursive";
+ /* DWARF 4 values. */
+ case DW_AT_signature: return "DW_AT_signature";
+ case DW_AT_main_subprogram: return "DW_AT_main_subprogram";
+ case DW_AT_data_bit_offset: return "DW_AT_data_bit_offset";
+ case DW_AT_const_expr: return "DW_AT_const_expr";
+ case DW_AT_enum_class: return "DW_AT_enum_class";
+ case DW_AT_linkage_name: return "DW_AT_linkage_name";
/* HP and SGI/MIPS extensions. */
case DW_AT_MIPS_loop_begin: return "DW_AT_MIPS_loop_begin";
case DW_AT_MIPS_fde: return "DW_AT_MIPS_fde or DW_AT_HP_unmodifiable";
/* GNU extensions. */
- case DW_AT_sf_names: return "DW_AT_sf_names";
- case DW_AT_src_info: return "DW_AT_src_info";
- case DW_AT_mac_info: return "DW_AT_mac_info";
- case DW_AT_src_coords: return "DW_AT_src_coords";
- case DW_AT_body_begin: return "DW_AT_body_begin";
- case DW_AT_body_end: return "DW_AT_body_end";
- case DW_AT_GNU_vector: return "DW_AT_GNU_vector";
+ case DW_AT_sf_names: return "DW_AT_sf_names";
+ case DW_AT_src_info: return "DW_AT_src_info";
+ case DW_AT_mac_info: return "DW_AT_mac_info";
+ case DW_AT_src_coords: return "DW_AT_src_coords";
+ case DW_AT_body_begin: return "DW_AT_body_begin";
+ case DW_AT_body_end: return "DW_AT_body_end";
+ case DW_AT_GNU_vector: return "DW_AT_GNU_vector";
+ case DW_AT_GNU_guarded_by: return "DW_AT_GNU_guarded_by";
+ case DW_AT_GNU_pt_guarded_by: return "DW_AT_GNU_pt_guarded_by";
+ case DW_AT_GNU_guarded: return "DW_AT_GNU_guarded";
+ case DW_AT_GNU_pt_guarded: return "DW_AT_GNU_pt_guarded";
+ case DW_AT_GNU_locks_excluded: return "DW_AT_GNU_locks_excluded";
+ case DW_AT_GNU_exclusive_locks_required: return "DW_AT_GNU_exclusive_locks_required";
+ case DW_AT_GNU_shared_locks_required: return "DW_AT_GNU_shared_locks_required";
+ case DW_AT_GNU_odr_signature: return "DW_AT_GNU_odr_signature";
/* UPC extension. */
case DW_AT_upc_threads_scaled: return "DW_AT_upc_threads_scaled";
/* Process the contents of a .debug_info section. If do_loc is non-zero
then we are scanning for location lists and we do not want to display
- anything to the user. */
+ anything to the user. If do_types is non-zero, we are processing
+ a .debug_types section instead of a .debug_info section. */
static int
process_debug_info (struct dwarf_section *section,
void *file,
- int do_loc)
+ int do_loc,
+ int do_types)
{
unsigned char *start = section->start;
unsigned char *end = start + section->size;
unsigned int num_units = 0;
if ((do_loc || do_debug_loc || do_debug_ranges)
- && num_debug_info_entries == 0)
+ && num_debug_info_entries == 0
+ && ! do_types)
{
unsigned long length;
unsigned long cu_offset;
int offset_size;
int initial_length_size;
+ unsigned char signature[8];
+ unsigned long type_offset = 0;
hdrptr = start;
compunit.cu_pointer_size = byte_get (hdrptr, 1);
hdrptr += 1;
+
+ if (do_types)
+ {
+ int i;
+
+ for (i = 0; i < 8; i++)
+ {
+ signature[i] = byte_get (hdrptr, 1);
+ hdrptr += 1;
+ }
+
+ type_offset = byte_get (hdrptr, offset_size);
+ hdrptr += offset_size;
+ }
+
if ((do_loc || do_debug_loc || do_debug_ranges)
- && num_debug_info_entries == 0)
+ && num_debug_info_entries == 0
+ && ! do_types)
{
debug_information [unit].cu_offset = cu_offset;
debug_information [unit].pointer_size
printf (_(" Version: %d\n"), compunit.cu_version);
printf (_(" Abbrev Offset: %ld\n"), compunit.cu_abbrev_offset);
printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size);
+ if (do_types)
+ {
+ int i;
+ printf (_(" Signature: "));
+ for (i = 0; i < 8; i++)
+ printf ("%02x", signature[i]);
+ printf ("\n");
+ printf (_(" Type Offset: 0x%lx\n"), type_offset);
+ }
}
if (cu_offset + compunit.cu_length + initial_length_size
/* Set num_debug_info_entries here so that it can be used to check if
we need to process .debug_loc and .debug_ranges sections. */
if ((do_loc || do_debug_loc || do_debug_ranges)
- && num_debug_info_entries == 0)
+ && num_debug_info_entries == 0
+ && ! do_types)
num_debug_info_entries = num_units;
if (!do_loc)
return num_debug_info_entries;
if (load_debug_section (info, file)
- && process_debug_info (&debug_displays [info].section, file, 1))
+ && process_debug_info (&debug_displays [info].section, file, 1, 0))
return num_debug_info_entries;
num_debug_info_entries = DEBUG_INFO_UNAVAILABLE;
static int
display_debug_info (struct dwarf_section *section, void *file)
{
- return process_debug_info (section, file, 0);
+ return process_debug_info (section, file, 0, 0);
}
+static int
+display_debug_types (struct dwarf_section *section, void *file)
+{
+ return process_debug_info (section, file, 0, 1);
+}
static int
display_debug_aranges (struct dwarf_section *section,
{ { ".debug_static_vars", ".zdebug_static_vars", NULL, NULL, 0, 0 },
display_debug_not_supported, NULL, 0 },
{ { ".debug_types", ".zdebug_types", NULL, NULL, 0, 0 },
- display_debug_not_supported, NULL, 0 },
+ display_debug_types, &do_debug_info, 1 },
{ { ".debug_weaknames", ".zdebug_weaknames", NULL, NULL, 0, 0 },
display_debug_not_supported, NULL, 0 }
};
DW_TAG_shared_type = 0x40,
/* DWARF 4. */
DW_TAG_type_unit = 0x41,
+ DW_TAG_rvalue_reference_type = 0x42,
+ DW_TAG_template_alias = 0x43,
DW_TAG_lo_user = 0x4080,
DW_TAG_hi_user = 0xffff,
DW_FORM_sec_offset = 0x17,
DW_FORM_exprloc = 0x18,
DW_FORM_flag_present = 0x19,
- DW_FORM_sig8 = 0x20
+ DW_FORM_ref_sig8 = 0x20
+#define DW_FORM_sig8 DW_FORM_ref_sig8 /* Note: The use of DW_FORM_sig8 is deprecated. */
};
/* Attribute names and codes. */
DW_AT_pure = 0x67,
DW_AT_recursive = 0x68,
/* DWARF 4. */
- DW_AT_signature = 0x69,
+ DW_AT_signature = 0x69,
+ DW_AT_main_subprogram = 0x6a,
+ DW_AT_data_bit_offset = 0x6b,
+ DW_AT_const_expr = 0x6c,
+ DW_AT_enum_class = 0x6d,
+ DW_AT_linkage_name = 0x6e,
DW_AT_lo_user = 0x2000, /* Implementation-defined range start. */
DW_AT_hi_user = 0x3ff0, /* Implementation-defined range end. */
DW_AT_body_begin = 0x2105,
DW_AT_body_end = 0x2106,
DW_AT_GNU_vector = 0x2107,
+ /* Thread-safety annotations.
+ See http://gcc.gnu.org/wiki/ThreadSafetyAnnotation . */
+ DW_AT_GNU_guarded_by = 0x2108,
+ DW_AT_GNU_pt_guarded_by = 0x2109,
+ DW_AT_GNU_guarded = 0x210a,
+ DW_AT_GNU_pt_guarded = 0x210b,
+ DW_AT_GNU_locks_excluded = 0x210c,
+ DW_AT_GNU_exclusive_locks_required = 0x210d,
+ DW_AT_GNU_shared_locks_required = 0x210e,
+ /* One-definition rule violation detection.
+ See http://gcc.gnu.org/wiki/DwarfSeparateTypeInfo . */
+ DW_AT_GNU_odr_signature = 0x210f,
/* Template template argument name.
See http://gcc.gnu.org/wiki/TemplateParmsDwarf . */
DW_AT_GNU_template_name = 0x2110,
DW_LANG_ObjC_plus_plus = 0x0011,
DW_LANG_UPC = 0x0012,
DW_LANG_D = 0x0013,
+ DW_LANG_Python = 0x0014,
DW_LANG_lo_user = 0x8000, /* Implementation-defined range start. */
DW_LANG_hi_user = 0xffff, /* Implementation-defined range start. */