Adds most of the DWARF5 names to dwarf.h

This commit is contained in:
David Anderson
2015-01-30 10:43:47 -08:00
parent 585d0100cc
commit 5547cefffb
6 changed files with 151 additions and 62 deletions

View File

@@ -1,5 +1,8 @@
2015-01-29 David Anderson
* cmplrs/dwarf_addr_finder.h: Fixed indents.
2015-01-30 David Anderson
* dwarf.h: Adding some DWARF5 defines.
Use with caution: DWARF5 is not yet final.
* gennames.c: Local array needed to be bigger
due to a longer attribute list.
2015-01-28 David Anderson
* libdwarf2.1.mm: Fixed .H 2 to .H 3 on
dwarf_get_TAG_name etc.

View File

@@ -1,7 +1,7 @@
/*
Copyright (C) 2000,2001,2003,2004,2005,2006 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2002-2010 Sun Microsystems, Inc. All rights reserved.
Portions Copyright 2007-2012 David Anderson. All rights reserved.
Portions Copyright 2007-2015 David Anderson. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
@@ -23,15 +23,6 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
@@ -132,7 +123,12 @@ extern "C" {
#define DW_TAG_type_unit 0x41 /* DWARF4 */
#define DW_TAG_rvalue_reference_type 0x42 /* DWARF4 */
#define DW_TAG_template_alias 0x43 /* DWARF4 */
#define DW_TAG_coarray_type 0x44 /* DWARF5 */
#define DW_TAG_generic_subrange 0x45 /* DWARF5 */
#define DW_TAG_dynamic_type 0x46 /* DWARF5 */
#define DW_TAG_atomic_type 0x47 /* DWARF5 */
#define DW_TAG_call_site 0x48 /* DWARF5 */
#define DW_TAG_call_site_parameter 0x49 /* DWARF5 */
#define DW_TAG_lo_user 0x4080
#define DW_TAG_MIPS_loop 0x4081
@@ -224,7 +220,10 @@ extern "C" {
#define DW_FORM_flag_present 0x19 /* DWARF4 */
#define DW_FORM_strx 0x1a /* DWARF5 */
#define DW_FORM_addrx 0x1b /* DWARF5 */
/* 0x1c thru 0x1f were left unused accidentally. Reserved for future use. */
#define DW_FORM_ref_sup 0x1c /* DWARF5 */
#define DW_FORM_strp_sup 0x1d /* DWARF5 */
#define DW_FORM_data16 0x1e /* DWARF5 */
/* 0x1f was left unused accidentally. Reserved for future use. */
#define DW_FORM_ref_sig8 0x20 /* DWARF4 */
#define DW_FORM_GNU_addr_index 0x1f01 /* GNU extension in debug_info.dwo.*/
#define DW_FORM_GNU_str_index 0x1f02 /* GNU extension, somewhat like DW_FORM_strp */
@@ -283,7 +282,7 @@ extern "C" {
#define DW_AT_frame_base 0x40
#define DW_AT_friend 0x41
#define DW_AT_identifier_case 0x42
#define DW_AT_macro_info 0x43
#define DW_AT_macro_info 0x43 /* DWARF2-DWARF4, not DWARF5 */
#define DW_AT_namelist_item 0x44
#define DW_AT_priority 0x45
#define DW_AT_segment 0x46
@@ -339,6 +338,22 @@ extern "C" {
#define DW_AT_reference 0x77 /* DWARF5 */
#define DW_AT_rvalue_reference 0x78 /* DWARF5 */
#define DW_AT_macros 0x79 /* DWARF5 */
#define DW_AT_call_all_calls 0x7a /* DWARF5 */
#define DW_AT_call_all_source_calls 0x7b /* DWARF5 */
#define DW_AT_call_all_tail_calls 0x7c /* DWARF5 */
#define DW_AT_call_return_pc 0x7d /* DWARF5 */
#define DW_AT_call_value 0x7e /* DWARF5 */
#define DW_AT_call_origin 0x7f /* DWARF5 */
#define DW_AT_call_parameter 0x80 /* DWARF5 */
#define DW_AT_call_call_pc 0x81 /* DWARF5 */
#define DW_AT_call_call_tail_call 0x82 /* DWARF5 */
#define DW_AT_call_target 0x83 /* DWARF5 */
#define DW_AT_call_target_clobbered 0x84 /* DWARF5 */
#define DW_AT_call_data_location 0x85 /* DWARF5 */
#define DW_AT_call_data_value 0x86 /* DWARF5 */
#define DW_AT_noreturn 0x87 /* DWARF5 */
#define DW_AT_alignment 0x88 /* DWARF5 */
#define DW_AT_export_symbols 0x89 /* DWARF5 */
/* In extensions, we attempt to include the vendor extension
in the name even when the vendor leaves it out. */
@@ -679,6 +694,13 @@ extern "C" {
#define DW_OP_implicit_pointer 0xa0 /* DWARF5 */
#define DW_OP_addrx 0xa1 /* DWARF5 */
#define DW_OP_constx 0xa2 /* DWARF5 */
#define DW_OP_entry_value 0xa3 /* DWARF5 */
#define DW_OP_const_type 0xa4 /* DWARF5 */
#define DW_OP_regval_type 0xa5 /* DWARF5 */
#define DW_OP_deref_type 0xa6 /* DWARF5 */
#define DW_OP_xderef_type 0xa7 /* DWARF5 */
#define DW_OP_convert 0xa8 /* DWARF5 */
#define DW_OP_reinterpret 0xa9 /* DWARF5 */
/* GNU extensions. */
@@ -718,21 +740,24 @@ extern "C" {
#define DW_OP_hi_user 0xff
#define DW_ATE_address 0x1
#define DW_ATE_boolean 0x2
#define DW_ATE_complex_float 0x3
#define DW_ATE_float 0x4
#define DW_ATE_signed 0x5
#define DW_ATE_signed_char 0x6
#define DW_ATE_unsigned 0x7
#define DW_ATE_unsigned_char 0x8
#define DW_ATE_imaginary_float 0x9 /* DWARF3 */
#define DW_ATE_packed_decimal 0xa /* DWARF3f */
#define DW_ATE_numeric_string 0xb /* DWARF3f */
#define DW_ATE_edited 0xc /* DWARF3f */
#define DW_ATE_signed_fixed 0xd /* DWARF3f */
#define DW_ATE_unsigned_fixed 0xe /* DWARF3f */
#define DW_ATE_decimal_float 0xf /* DWARF3f */
#define DW_ATE_address 0x01
#define DW_ATE_boolean 0x02
#define DW_ATE_complex_float 0x03
#define DW_ATE_float 0x04
#define DW_ATE_signed 0x05
#define DW_ATE_signed_char 0x06
#define DW_ATE_unsigned 0x07
#define DW_ATE_unsigned_char 0x08
#define DW_ATE_imaginary_float 0x09 /* DWARF3 */
#define DW_ATE_packed_decimal 0x0a /* DWARF3f */
#define DW_ATE_numeric_string 0x0b /* DWARF3f */
#define DW_ATE_edited 0x0c /* DWARF3f */
#define DW_ATE_signed_fixed 0x0d /* DWARF3f */
#define DW_ATE_unsigned_fixed 0x0e /* DWARF3f */
#define DW_ATE_decimal_float 0x0f /* DWARF3f */
#define DW_ATE_UTF 0x10 /* DWARF4 */
#define DW_ATE_UCS 0x11 /* DWARF5 */
#define DW_ATE_ASCII 0x12 /* DWARF5 */
/* ALTIUM extensions. x80, x81 */
@@ -761,6 +786,19 @@ extern "C" {
#define DW_ATE_hi_user 0xff
/* DWARF5 Location List Entries in Split Objects */
#define DW_LLE_end_of_list_entry 0x0 /* DWARF5 */
#define DW_LLE_base_address_selection_entry 0x01 /* DWARF5 */
#define DW_LLE_start_end_entry 0x02 /* DWARF5 */
#define DW_LLE_start_length_entry 0x03 /* DWARF5 */
#define DW_LLE_offset_pair_entry 0x04 /* DWARF5 */
/* DWARF5 Unit header unit type encodings */
#define DW_UT_compile 0x01 /* DWARF5 */
#define DW_UT_type 0x02 /* DWARF5 */
#define DW_UT_partial 0x03 /* DWARF5 */
/* DWARF5 DebugFission object section id values
for .dwp object section offsets hash table.
0 is reserved, not used.
@@ -854,6 +892,13 @@ extern "C" {
#define DW_LANG_C_plus_plus_11 0x001a /* DWARF5 */
#define DW_LANG_OCaml 0x001b /* DWARF5 */
#define DW_LANG_Rust 0x001c /* DWARF5 */
#define DW_LANG_C11 0x001d /* DWARF5 */
#define DW_LANG_Swift 0x001e /* DWARF5 */
#define DW_LANG_Julia 0x001f /* DWARF5 */
#define DW_LANG_Dylan 0x0020 /* DWARF5 */
#define DW_LANG_C_plus_plus_14 0x0021 /* DWARF5 */
#define DW_LANG_Fortran03 0x0022 /* DWARF5 */
#define DW_LANG_Fortran08 0x0023 /* DWARF5 */
#define DW_LANG_lo_user 0x8000
#define DW_LANG_Mips_Assembler 0x8001 /* MIPS */
#define DW_LANG_Upc 0x8765 /* UPC, use
@@ -866,6 +911,13 @@ extern "C" {
#define DW_LANG_hi_user 0xffff
/* DWARF5 Line number header entry format name */
#define DW_LNCT_path 0x1 /* DWARF5 */
#define DW_LNCT_directory_index 0x2 /* DWARF5 */
#define DW_LNCT_timestamp 0x3 /* DWARF5 */
#define DW_LNCT_size 0x4 /* DWARF5 */
#define DW_LNCT_MD5 0x5 /* DWARF5 */
/* Identifier case name. */
#define DW_ID_case_sensitive 0x00
#define DW_ID_up_case 0x01
@@ -956,25 +1008,30 @@ extern "C" {
#define DW_ISA_ARM_thumb 1 /* ARM ISA */
#define DW_ISA_ARM_arm 2 /* ARM ISA */
/* Macro information. */
/* Macro information, DWARF5 */
#define DW_MACRO_define 0x01 /* DWARF5 */
#define DW_MACRO_undef 0x02 /* DWARF5 */
#define DW_MACRO_start_file 0x03 /* DWARF5 */
#define DW_MACRO_end_file 0x04 /* DWARF5 */
#define DW_MACRO_define_indirect 0x05 /* DWARF5 */
#define DW_MACRO_undef_indirect 0x06 /* DWARF5 */
#define DW_MACRO_transparent_include 0x07 /* DWARF5 */
#define DW_MACRO_define_indirect_sup 0x08 /* DWARF5 */
#define DW_MACRO_undef_indirect_sup 0x09 /* DWARF5 */
#define DW_MACRO_transparent_include_sup 0x0a /* DWARF5 */
#define DW_MACRO_define_indirectx 0x0b /* DWARF5 */
#define DW_MACRO_undef_indirectx 0x0c /* DWARF5 */
#define DW_MACRO_lo_user 0xe0
#define DW_MACRO_hi_user 0xff
/* Macro information, DWARF2-DWARF4. */
#define DW_MACINFO_define 0x01
#define DW_MACINFO_undef 0x02
#define DW_MACINFO_start_file 0x03
#define DW_MACINFO_end_file 0x04
#define DW_MACINFO_vendor_ext 0xff
#define DW_MACRO_define 0x01
#define DW_MACRO_undef 0x02
#define DW_MACRO_start_file 0x03
#define DW_MACRO_end_file 0x04
#define DW_MACRO_define_indirect 0x05
#define DW_MACRO_undef_indirect 0x06
#define DW_MACRO_transparent_include 0x07
#define DW_MACRO_define_indirectx 0x0b
#define DW_MACRO_undef_indirectx 0x0c
#define DW_MACRO_lo_user 0xe0
#define DW_MACRO_hi_user 0xff
/* CFA operator compaction (a space saving measure, see
the DWARF standard) means DW_CFA_extended and DW_CFA_nop
have the same value here. */
@@ -1006,7 +1063,6 @@ extern "C" {
#define DW_CFA_val_offset 0x14 /* DWARF3f */
#define DW_CFA_val_offset_sf 0x15 /* DWARF3f */
#define DW_CFA_val_expression 0x16 /* DWARF3f */
#define DW_CFA_lo_user 0x1c
#define DW_CFA_low_user 0x1c /* Incorrect spelling, do not use. */

View File

@@ -184,8 +184,8 @@ int dwarf_get_xu_index_section_type(Dwarf_Xu_Index_Header xuhdr,
/* Index values 0 to M-1 are valid. */
int dwarf_get_xu_hash_entry(Dwarf_Xu_Index_Header xuhdr,
Dwarf_Unsigned index,
/* returns the hash integer. 64 bits. */
Dwarf_Unsigned * hash_value,
/* returns the hash value. 64 bits. */
Dwarf_Sig8 * hash_value,
/* returns the index into rows of offset/size tables. */
Dwarf_Unsigned * index_to_sections,
@@ -198,24 +198,30 @@ int dwarf_get_xu_hash_entry(Dwarf_Xu_Index_Header xuhdr,
xuhdr->gx_index_table_offset;
Dwarf_Small *indexentry = 0;
Dwarf_Small *hashentry = 0;
Dwarf_Unsigned hashval = 0;
Dwarf_Sig8 hashval;
Dwarf_Unsigned indexval = 0;
/*FIXME: what if no hash. */
memset(&hashval,0,sizeof(hashval));
if (xuhdr->gx_slots_in_hash > 0) {
if (index >= xuhdr->gx_slots_in_hash) {
_dwarf_error(dbg, err, DW_DLE_XU_HASH_ROW_ERROR);
return DW_DLV_ERROR;
}
hashentry = hashtab + (index * HASHSIGNATURELEN);
memcpy(&hashval,hashentry,sizeof(hashval));
}
indexentry = indextab + (index * LEN32BIT);
READ_UNALIGNED(dbg,hashval,Dwarf_Unsigned,hashentry,
HASHSIGNATURELEN);
memcpy(hash_value,&hashval,sizeof(hashval));
READ_UNALIGNED(dbg,indexval,Dwarf_Unsigned, indexentry,
LEN32BIT);
if (indexval > xuhdr->gx_units_in_index) {
_dwarf_error(dbg, err, DW_DLE_XU_HASH_INDEX_ERROR);
return DW_DLV_ERROR;
}
*hash_value = hashval;
*index_to_sections = indexval;
return DW_DLV_OK;
}

View File

@@ -94,7 +94,7 @@ static void ParseDefinitionsAndWriteOutput(void);
/* We don't need really long lines: the input file is simple. */
#define MAX_LINE_SIZE 1000
/* We don't need a variable array size, it just has to be big enough. */
#define ARRAY_SIZE 256
#define ARRAY_SIZE 300
/* To store entries from dwarf.h */
typedef struct {

View File

@@ -2513,6 +2513,12 @@ int dwarf_get_debugfission_for_die(Dwarf_Die /* die */,
Dwarf_Debug_Fission_Per_CU * /* percu_out */,
Dwarf_Error * /* err */);
/* Given a key from a .o, find the per-cu information
for the CU with that key. */
int dwarf_get_debugfission_for_key(Dwarf_Unsigned /* key */,
Dwarf_Debug_Fission_Per_CU * /* percu_out */,
Dwarf_Error * /* err */);
/* END debugfission dwp .debug_cu_index and .debug_tu_index operations. */

View File

@@ -8,7 +8,7 @@ n\."
.nr Hb 5
\." ==============================================
\." Put current date in the following at each rev
.ds vE rev 2.25, January 28, 2015
.ds vE rev 2.26, January 29, 2015
\." ==============================================
\." ==============================================
.ds | |
@@ -7085,7 +7085,8 @@ We name things "xu" as these sections have the same format
so we let "x" stand for either section.
These functions get access to the index functions needed
to access and print the contents of an object file
which is an aggregate of .dwo objects. These
which is an aggregate of .dwo objects.
These
sections are implemented in gcc/gdb and are proposed
to be part of DWARF5 (As of July 2014 DWARF5 is not finished).
The idea is that much debug information can be separated
@@ -7096,6 +7097,9 @@ yet allow good debugging.
.P
For additional information, see
"https://gcc.gnu.org/wiki/DebugFissionDWP",
"https://gcc.gnu.org/wiki/DebugFission",
and
"http://www.bayarea.net/~cary/dwarf/Accelerated%20Access%20Diagram.png"
and eventually, the DWARF5 standard.
.P
There are FORM access functions related
@@ -7106,15 +7110,29 @@ and
\f(CWdwarf_get_debug_addr_index()\fP
and
\f(CWdwarf_get_debug_str_index()\fP.
.P
The interfaces here are necessary if one wants to print
the section. To access DIE, macro, etc information
The FORM with the hash value (for a reference
to a CU) is
\f(CWDW_FORM_ref_sig8\fP.
FIXME FISSION
.P
To look up a name in the hash (to find
which CU(s) it exists in).
FIXME FISSION
.P
.P
The second group of interfaces here
are necessary if one wants to print
a .debug_tu_index or .debug_cu_index section.
.P
To access DIE, macro, etc information
the support is built into DIE, Macro, etc operations
so applications usually won't need to use these
operations at all.
.P
FIXME first FISSION function group here.
.H 3 "dwarf_get_xu_index_header()"
.DS
int dwarf_get_xu_index_header(Dwarf_Debug dbg,
@@ -7266,7 +7284,7 @@ stale and unusable.
int dwarf_get_xu_hash_entry(
Dwarf_Xu_Index_Header xuhdr,
Dwarf_Unsigned index,
Dwarf_Unsigned * hash_value,
Dwarf_Sig8 * hash_value,
Dwarf_Unsigned * index_to_sections,
Dwarf_Error * error);
.DE