2006-01-26 15:45:22 +01:00
|
|
|
//===-- llvm/Support/Dwarf.h ---Dwarf Constants------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:59:42 +01:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-01-26 15:45:22 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2014-10-23 06:08:38 +02:00
|
|
|
// \file
|
|
|
|
// \brief This file contains constants used for implementing Dwarf
|
|
|
|
// debug support.
|
|
|
|
//
|
|
|
|
// For details on the Dwarf specfication see the latest DWARF Debugging
|
|
|
|
// Information Format standard document on http://www.dwarfstd.org. This
|
|
|
|
// file often includes support for non-released standard features.
|
2009-02-20 23:51:36 +01:00
|
|
|
//
|
2006-01-26 15:45:22 +01:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_SUPPORT_DWARF_H
|
|
|
|
#define LLVM_SUPPORT_DWARF_H
|
|
|
|
|
2015-02-03 22:16:49 +01:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2013-09-24 01:26:57 +02:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2013-02-06 00:30:58 +01:00
|
|
|
#include "llvm/Support/DataTypes.h"
|
|
|
|
|
2006-02-27 23:37:23 +01:00
|
|
|
namespace llvm {
|
|
|
|
|
2006-02-27 13:43:29 +01:00
|
|
|
namespace dwarf {
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2013-01-08 01:16:33 +01:00
|
|
|
// Dwarf constants as gleaned from the DWARF Debugging Information Format V.4
|
2013-12-18 22:48:14 +01:00
|
|
|
// reference manual http://www.dwarfstd.org/.
|
2006-02-27 13:43:29 +01:00
|
|
|
//
|
2006-03-01 21:39:36 +01:00
|
|
|
|
|
|
|
// Do not mix the following two enumerations sets. DW_TAG_invalid changes the
|
|
|
|
// enumeration base type.
|
|
|
|
|
2014-03-02 04:20:38 +01:00
|
|
|
enum LLVMConstants : uint32_t {
|
2015-02-03 22:13:16 +01:00
|
|
|
// LLVM mock tags (see also llvm/Support/Dwarf.def).
|
2015-02-07 01:37:15 +01:00
|
|
|
DW_TAG_invalid = ~0U, // Tag for invalid results.
|
|
|
|
DW_VIRTUALITY_invalid = ~0U, // Virtuality for invalid results.
|
2015-11-12 10:38:54 +01:00
|
|
|
DW_MACINFO_invalid = ~0U, // Macinfo type for invalid results.
|
2009-02-20 23:51:36 +01:00
|
|
|
|
2015-02-03 22:13:16 +01:00
|
|
|
// Other constants.
|
2013-09-05 02:01:17 +02:00
|
|
|
DWARF_VERSION = 4, // Default dwarf version we output.
|
|
|
|
DW_PUBTYPES_VERSION = 2, // Section version number for .debug_pubtypes.
|
2013-09-20 01:21:01 +02:00
|
|
|
DW_PUBNAMES_VERSION = 2, // Section version number for .debug_pubnames.
|
|
|
|
DW_ARANGES_VERSION = 2 // Section version number for .debug_aranges.
|
2006-03-01 21:39:36 +01:00
|
|
|
};
|
|
|
|
|
2013-02-06 00:30:58 +01:00
|
|
|
// Special ID values that distinguish a CIE from a FDE in DWARF CFI.
|
|
|
|
// Not inside an enum because a 64-bit value is needed.
|
|
|
|
const uint32_t DW_CIE_ID = UINT32_MAX;
|
|
|
|
const uint64_t DW64_CIE_ID = UINT64_MAX;
|
|
|
|
|
2014-03-02 04:20:38 +01:00
|
|
|
enum Tag : uint16_t {
|
2015-02-03 22:13:16 +01:00
|
|
|
#define HANDLE_DW_TAG(ID, NAME) DW_TAG_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_TAG_lo_user = 0x4080,
|
2015-02-03 22:13:16 +01:00
|
|
|
DW_TAG_hi_user = 0xffff,
|
|
|
|
DW_TAG_user_base = 0x1000 // Recommended base for user tags.
|
2013-10-21 19:28:37 +02:00
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-25 20:38:43 +02:00
|
|
|
inline bool isType(Tag T) {
|
|
|
|
switch (T) {
|
|
|
|
case DW_TAG_array_type:
|
|
|
|
case DW_TAG_class_type:
|
|
|
|
case DW_TAG_interface_type:
|
|
|
|
case DW_TAG_enumeration_type:
|
|
|
|
case DW_TAG_pointer_type:
|
|
|
|
case DW_TAG_reference_type:
|
|
|
|
case DW_TAG_rvalue_reference_type:
|
|
|
|
case DW_TAG_string_type:
|
|
|
|
case DW_TAG_structure_type:
|
|
|
|
case DW_TAG_subroutine_type:
|
|
|
|
case DW_TAG_union_type:
|
|
|
|
case DW_TAG_ptr_to_member_type:
|
|
|
|
case DW_TAG_set_type:
|
|
|
|
case DW_TAG_subrange_type:
|
|
|
|
case DW_TAG_base_type:
|
|
|
|
case DW_TAG_const_type:
|
|
|
|
case DW_TAG_file_type:
|
|
|
|
case DW_TAG_packed_type:
|
|
|
|
case DW_TAG_volatile_type:
|
|
|
|
case DW_TAG_typedef:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-02 04:20:38 +01:00
|
|
|
enum Attribute : uint16_t {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Attributes
|
|
|
|
DW_AT_sibling = 0x01,
|
|
|
|
DW_AT_location = 0x02,
|
|
|
|
DW_AT_name = 0x03,
|
|
|
|
DW_AT_ordering = 0x09,
|
|
|
|
DW_AT_byte_size = 0x0b,
|
|
|
|
DW_AT_bit_offset = 0x0c,
|
|
|
|
DW_AT_bit_size = 0x0d,
|
|
|
|
DW_AT_stmt_list = 0x10,
|
|
|
|
DW_AT_low_pc = 0x11,
|
|
|
|
DW_AT_high_pc = 0x12,
|
|
|
|
DW_AT_language = 0x13,
|
|
|
|
DW_AT_discr = 0x15,
|
|
|
|
DW_AT_discr_value = 0x16,
|
|
|
|
DW_AT_visibility = 0x17,
|
|
|
|
DW_AT_import = 0x18,
|
|
|
|
DW_AT_string_length = 0x19,
|
|
|
|
DW_AT_common_reference = 0x1a,
|
|
|
|
DW_AT_comp_dir = 0x1b,
|
|
|
|
DW_AT_const_value = 0x1c,
|
|
|
|
DW_AT_containing_type = 0x1d,
|
|
|
|
DW_AT_default_value = 0x1e,
|
|
|
|
DW_AT_inline = 0x20,
|
|
|
|
DW_AT_is_optional = 0x21,
|
|
|
|
DW_AT_lower_bound = 0x22,
|
|
|
|
DW_AT_producer = 0x25,
|
|
|
|
DW_AT_prototyped = 0x27,
|
|
|
|
DW_AT_return_addr = 0x2a,
|
|
|
|
DW_AT_start_scope = 0x2c,
|
|
|
|
DW_AT_bit_stride = 0x2e,
|
|
|
|
DW_AT_upper_bound = 0x2f,
|
|
|
|
DW_AT_abstract_origin = 0x31,
|
|
|
|
DW_AT_accessibility = 0x32,
|
|
|
|
DW_AT_address_class = 0x33,
|
|
|
|
DW_AT_artificial = 0x34,
|
|
|
|
DW_AT_base_types = 0x35,
|
|
|
|
DW_AT_calling_convention = 0x36,
|
|
|
|
DW_AT_count = 0x37,
|
|
|
|
DW_AT_data_member_location = 0x38,
|
|
|
|
DW_AT_decl_column = 0x39,
|
|
|
|
DW_AT_decl_file = 0x3a,
|
|
|
|
DW_AT_decl_line = 0x3b,
|
|
|
|
DW_AT_declaration = 0x3c,
|
|
|
|
DW_AT_discr_list = 0x3d,
|
|
|
|
DW_AT_encoding = 0x3e,
|
|
|
|
DW_AT_external = 0x3f,
|
|
|
|
DW_AT_frame_base = 0x40,
|
|
|
|
DW_AT_friend = 0x41,
|
|
|
|
DW_AT_identifier_case = 0x42,
|
|
|
|
DW_AT_macro_info = 0x43,
|
|
|
|
DW_AT_namelist_item = 0x44,
|
|
|
|
DW_AT_priority = 0x45,
|
|
|
|
DW_AT_segment = 0x46,
|
|
|
|
DW_AT_specification = 0x47,
|
|
|
|
DW_AT_static_link = 0x48,
|
|
|
|
DW_AT_type = 0x49,
|
|
|
|
DW_AT_use_location = 0x4a,
|
|
|
|
DW_AT_variable_parameter = 0x4b,
|
|
|
|
DW_AT_virtuality = 0x4c,
|
|
|
|
DW_AT_vtable_elem_location = 0x4d,
|
|
|
|
DW_AT_allocated = 0x4e,
|
|
|
|
DW_AT_associated = 0x4f,
|
|
|
|
DW_AT_data_location = 0x50,
|
|
|
|
DW_AT_byte_stride = 0x51,
|
|
|
|
DW_AT_entry_pc = 0x52,
|
|
|
|
DW_AT_use_UTF8 = 0x53,
|
|
|
|
DW_AT_extension = 0x54,
|
|
|
|
DW_AT_ranges = 0x55,
|
|
|
|
DW_AT_trampoline = 0x56,
|
|
|
|
DW_AT_call_column = 0x57,
|
|
|
|
DW_AT_call_file = 0x58,
|
|
|
|
DW_AT_call_line = 0x59,
|
|
|
|
DW_AT_description = 0x5a,
|
|
|
|
DW_AT_binary_scale = 0x5b,
|
|
|
|
DW_AT_decimal_scale = 0x5c,
|
|
|
|
DW_AT_small = 0x5d,
|
|
|
|
DW_AT_decimal_sign = 0x5e,
|
|
|
|
DW_AT_digit_count = 0x5f,
|
|
|
|
DW_AT_picture_string = 0x60,
|
|
|
|
DW_AT_mutable = 0x61,
|
|
|
|
DW_AT_threads_scaled = 0x62,
|
|
|
|
DW_AT_explicit = 0x63,
|
|
|
|
DW_AT_object_pointer = 0x64,
|
|
|
|
DW_AT_endianity = 0x65,
|
|
|
|
DW_AT_elemental = 0x66,
|
|
|
|
DW_AT_pure = 0x67,
|
|
|
|
DW_AT_recursive = 0x68,
|
2011-09-15 06:23:44 +02:00
|
|
|
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,
|
2012-11-17 00:04:31 +01:00
|
|
|
|
2013-12-18 22:48:14 +01:00
|
|
|
// New in DWARF 5:
|
|
|
|
DW_AT_string_length_bit_size = 0x6f,
|
|
|
|
DW_AT_string_length_byte_size = 0x70,
|
|
|
|
DW_AT_rank = 0x71,
|
|
|
|
DW_AT_str_offsets_base = 0x72,
|
|
|
|
DW_AT_addr_base = 0x73,
|
|
|
|
DW_AT_ranges_base = 0x74,
|
|
|
|
DW_AT_dwo_id = 0x75,
|
|
|
|
DW_AT_dwo_name = 0x76,
|
|
|
|
DW_AT_reference = 0x77,
|
|
|
|
DW_AT_rvalue_reference = 0x78,
|
|
|
|
|
2012-11-17 00:04:31 +01:00
|
|
|
DW_AT_lo_user = 0x2000,
|
|
|
|
DW_AT_hi_user = 0x3fff,
|
|
|
|
|
2011-09-15 07:21:03 +02:00
|
|
|
DW_AT_MIPS_loop_begin = 0x2002,
|
|
|
|
DW_AT_MIPS_tail_loop_begin = 0x2003,
|
|
|
|
DW_AT_MIPS_epilog_begin = 0x2004,
|
|
|
|
DW_AT_MIPS_loop_unroll_factor = 0x2005,
|
|
|
|
DW_AT_MIPS_software_pipeline_depth = 0x2006,
|
2006-08-21 23:18:10 +02:00
|
|
|
DW_AT_MIPS_linkage_name = 0x2007,
|
2011-09-15 07:21:03 +02:00
|
|
|
DW_AT_MIPS_stride = 0x2008,
|
|
|
|
DW_AT_MIPS_abstract_name = 0x2009,
|
|
|
|
DW_AT_MIPS_clone_origin = 0x200a,
|
|
|
|
DW_AT_MIPS_has_inlines = 0x200b,
|
|
|
|
DW_AT_MIPS_stride_byte = 0x200c,
|
|
|
|
DW_AT_MIPS_stride_elem = 0x200d,
|
|
|
|
DW_AT_MIPS_ptr_dopetype = 0x200e,
|
|
|
|
DW_AT_MIPS_allocatable_dopetype = 0x200f,
|
|
|
|
DW_AT_MIPS_assumed_shape_dopetype = 0x2010,
|
2012-11-17 00:04:31 +01:00
|
|
|
|
|
|
|
// This one appears to have only been implemented by Open64 for
|
|
|
|
// fortran and may conflict with other extensions.
|
|
|
|
DW_AT_MIPS_assumed_size = 0x2011,
|
|
|
|
|
|
|
|
// GNU extensions
|
2011-09-15 07:21:03 +02:00
|
|
|
DW_AT_sf_names = 0x2101,
|
2006-06-15 22:51:43 +02:00
|
|
|
DW_AT_src_info = 0x2102,
|
|
|
|
DW_AT_mac_info = 0x2103,
|
|
|
|
DW_AT_src_coords = 0x2104,
|
|
|
|
DW_AT_body_begin = 0x2105,
|
|
|
|
DW_AT_body_end = 0x2106,
|
|
|
|
DW_AT_GNU_vector = 0x2107,
|
2011-09-15 07:30:55 +02:00
|
|
|
DW_AT_GNU_template_name = 0x2110,
|
2012-11-17 00:04:31 +01:00
|
|
|
|
2013-07-15 00:02:31 +02:00
|
|
|
DW_AT_GNU_odr_signature = 0x210f,
|
|
|
|
|
2012-11-17 00:04:31 +01:00
|
|
|
// Extensions for Fission proposal.
|
|
|
|
DW_AT_GNU_dwo_name = 0x2130,
|
|
|
|
DW_AT_GNU_dwo_id = 0x2131,
|
|
|
|
DW_AT_GNU_ranges_base = 0x2132,
|
|
|
|
DW_AT_GNU_addr_base = 0x2133,
|
|
|
|
DW_AT_GNU_pubnames = 0x2134,
|
|
|
|
DW_AT_GNU_pubtypes = 0x2135,
|
2015-11-11 19:08:18 +01:00
|
|
|
DW_AT_GNU_discriminator = 0x2136,
|
2009-01-23 23:33:47 +01:00
|
|
|
|
2015-11-11 19:47:36 +01:00
|
|
|
// Borland extensions.
|
|
|
|
DW_AT_BORLAND_property_read = 0x3b11,
|
|
|
|
DW_AT_BORLAND_property_write = 0x3b12,
|
|
|
|
DW_AT_BORLAND_property_implements = 0x3b13,
|
|
|
|
DW_AT_BORLAND_property_index = 0x3b14,
|
|
|
|
DW_AT_BORLAND_property_default = 0x3b15,
|
|
|
|
DW_AT_BORLAND_Delphi_unit = 0x3b20,
|
|
|
|
DW_AT_BORLAND_Delphi_class = 0x3b21,
|
|
|
|
DW_AT_BORLAND_Delphi_record = 0x3b22,
|
|
|
|
DW_AT_BORLAND_Delphi_metaclass = 0x3b23,
|
|
|
|
DW_AT_BORLAND_Delphi_constructor = 0x3b24,
|
|
|
|
DW_AT_BORLAND_Delphi_destructor = 0x3b25,
|
|
|
|
DW_AT_BORLAND_Delphi_anonymous_method = 0x3b26,
|
|
|
|
DW_AT_BORLAND_Delphi_interface = 0x3b27,
|
|
|
|
DW_AT_BORLAND_Delphi_ABI = 0x3b28,
|
|
|
|
DW_AT_BORLAND_Delphi_return = 0x3b29,
|
|
|
|
DW_AT_BORLAND_Delphi_frameptr = 0x3b30,
|
|
|
|
DW_AT_BORLAND_closure = 0x3b31,
|
|
|
|
|
2015-06-30 04:13:04 +02:00
|
|
|
// LLVM project extensions.
|
|
|
|
DW_AT_LLVM_include_path = 0x3e00,
|
|
|
|
DW_AT_LLVM_config_macros = 0x3e01,
|
|
|
|
DW_AT_LLVM_isysroot = 0x3e02,
|
|
|
|
|
2009-01-23 23:33:47 +01:00
|
|
|
// Apple extensions.
|
|
|
|
DW_AT_APPLE_optimized = 0x3fe1,
|
|
|
|
DW_AT_APPLE_flags = 0x3fe2,
|
2009-05-11 23:58:01 +02:00
|
|
|
DW_AT_APPLE_isa = 0x3fe3,
|
|
|
|
DW_AT_APPLE_block = 0x3fe4,
|
2009-02-17 23:43:44 +01:00
|
|
|
DW_AT_APPLE_major_runtime_vers = 0x3fe5,
|
|
|
|
DW_AT_APPLE_runtime_class = 0x3fe6,
|
2010-04-19 21:14:02 +02:00
|
|
|
DW_AT_APPLE_omit_frame_ptr = 0x3fe7,
|
2011-04-16 02:11:51 +02:00
|
|
|
DW_AT_APPLE_property_name = 0x3fe8,
|
|
|
|
DW_AT_APPLE_property_getter = 0x3fe9,
|
|
|
|
DW_AT_APPLE_property_setter = 0x3fea,
|
|
|
|
DW_AT_APPLE_property_attribute = 0x3feb,
|
2011-05-12 23:29:42 +02:00
|
|
|
DW_AT_APPLE_objc_complete_type = 0x3fec,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_AT_APPLE_property = 0x3fed
|
|
|
|
};
|
2009-01-23 23:33:47 +01:00
|
|
|
|
2014-03-02 04:20:38 +01:00
|
|
|
enum Form : uint16_t {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Attribute form encodings
|
|
|
|
DW_FORM_addr = 0x01,
|
|
|
|
DW_FORM_block2 = 0x03,
|
|
|
|
DW_FORM_block4 = 0x04,
|
|
|
|
DW_FORM_data2 = 0x05,
|
|
|
|
DW_FORM_data4 = 0x06,
|
|
|
|
DW_FORM_data8 = 0x07,
|
|
|
|
DW_FORM_string = 0x08,
|
|
|
|
DW_FORM_block = 0x09,
|
|
|
|
DW_FORM_block1 = 0x0a,
|
|
|
|
DW_FORM_data1 = 0x0b,
|
|
|
|
DW_FORM_flag = 0x0c,
|
|
|
|
DW_FORM_sdata = 0x0d,
|
|
|
|
DW_FORM_strp = 0x0e,
|
|
|
|
DW_FORM_udata = 0x0f,
|
|
|
|
DW_FORM_ref_addr = 0x10,
|
|
|
|
DW_FORM_ref1 = 0x11,
|
|
|
|
DW_FORM_ref2 = 0x12,
|
|
|
|
DW_FORM_ref4 = 0x13,
|
|
|
|
DW_FORM_ref8 = 0x14,
|
|
|
|
DW_FORM_ref_udata = 0x15,
|
|
|
|
DW_FORM_indirect = 0x16,
|
2011-09-15 06:23:44 +02:00
|
|
|
DW_FORM_sec_offset = 0x17,
|
|
|
|
DW_FORM_exprloc = 0x18,
|
|
|
|
DW_FORM_flag_present = 0x19,
|
|
|
|
DW_FORM_ref_sig8 = 0x20,
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2012-11-17 00:04:31 +01:00
|
|
|
// Extensions for Fission proposal
|
|
|
|
DW_FORM_GNU_addr_index = 0x1f01,
|
2015-05-19 22:29:28 +02:00
|
|
|
DW_FORM_GNU_str_index = 0x1f02,
|
|
|
|
|
|
|
|
// Alternate debug sections proposal (output of "dwz" tool).
|
|
|
|
DW_FORM_GNU_ref_alt = 0x1f20,
|
|
|
|
DW_FORM_GNU_strp_alt = 0x1f21
|
2013-10-21 19:28:37 +02:00
|
|
|
};
|
2012-11-17 00:04:31 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum LocationAtom {
|
2015-02-13 02:04:08 +01:00
|
|
|
#define HANDLE_DW_OP(ID, NAME) DW_OP_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_OP_lo_user = 0xe0,
|
2015-02-13 02:04:08 +01:00
|
|
|
DW_OP_hi_user = 0xff
|
2013-10-21 19:28:37 +02:00
|
|
|
};
|
2012-11-17 00:04:31 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum TypeKind {
|
2015-02-07 00:45:37 +01:00
|
|
|
#define HANDLE_DW_ATE(ID, NAME) DW_ATE_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_ATE_lo_user = 0x80,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_ATE_hi_user = 0xff
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum DecimalSignEncoding {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Decimal sign attribute values
|
|
|
|
DW_DS_unsigned = 0x01,
|
|
|
|
DW_DS_leading_overpunch = 0x02,
|
|
|
|
DW_DS_trailing_overpunch = 0x03,
|
|
|
|
DW_DS_leading_separate = 0x04,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_DS_trailing_separate = 0x05
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum EndianityEncoding {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Endianity attribute values
|
|
|
|
DW_END_default = 0x00,
|
|
|
|
DW_END_big = 0x01,
|
|
|
|
DW_END_little = 0x02,
|
|
|
|
DW_END_lo_user = 0x40,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_END_hi_user = 0xff
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum AccessAttribute {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Accessibility codes
|
|
|
|
DW_ACCESS_public = 0x01,
|
|
|
|
DW_ACCESS_protected = 0x02,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_ACCESS_private = 0x03
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum VisibilityAttribute {
|
2009-02-20 23:51:36 +01:00
|
|
|
// Visibility codes
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_VIS_local = 0x01,
|
|
|
|
DW_VIS_exported = 0x02,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_VIS_qualified = 0x03
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum VirtualityAttribute {
|
2015-02-07 01:36:23 +01:00
|
|
|
#define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
|
|
|
DW_VIRTUALITY_max = 0x02
|
2013-10-21 19:28:37 +02:00
|
|
|
};
|
2009-02-20 23:51:36 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum SourceLanguage {
|
2015-02-06 23:53:19 +01:00
|
|
|
#define HANDLE_DW_LANG(ID, NAME) DW_LANG_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_LANG_lo_user = 0x8000,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_LANG_hi_user = 0xffff
|
|
|
|
};
|
2009-02-20 23:51:36 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum CaseSensitivity {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Identifier case codes
|
|
|
|
DW_ID_case_sensitive = 0x00,
|
|
|
|
DW_ID_up_case = 0x01,
|
|
|
|
DW_ID_down_case = 0x02,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_ID_case_insensitive = 0x03
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum CallingConvention {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Calling convention codes
|
|
|
|
DW_CC_normal = 0x01,
|
|
|
|
DW_CC_program = 0x02,
|
|
|
|
DW_CC_nocall = 0x03,
|
|
|
|
DW_CC_lo_user = 0x40,
|
2015-11-11 19:47:36 +01:00
|
|
|
DW_CC_GNU_borland_fastcall_i386 = 0x41,
|
|
|
|
DW_CC_BORLAND_safecall = 0xb0,
|
|
|
|
DW_CC_BORLAND_stdcall = 0xb1,
|
|
|
|
DW_CC_BORLAND_pascal = 0xb2,
|
|
|
|
DW_CC_BORLAND_msfastcall = 0xb3,
|
|
|
|
DW_CC_BORLAND_msreturn = 0xb4,
|
|
|
|
DW_CC_BORLAND_thiscall = 0xb5,
|
|
|
|
DW_CC_BORLAND_fastcall = 0xb6,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_CC_hi_user = 0xff
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum InlineAttribute {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Inline codes
|
|
|
|
DW_INL_not_inlined = 0x00,
|
|
|
|
DW_INL_inlined = 0x01,
|
|
|
|
DW_INL_declared_not_inlined = 0x02,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_INL_declared_inlined = 0x03
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum ArrayDimensionOrdering {
|
2009-02-20 23:51:36 +01:00
|
|
|
// Array ordering
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_ORD_row_major = 0x00,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_ORD_col_major = 0x01
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum DiscriminantList {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Discriminant descriptor values
|
|
|
|
DW_DSC_label = 0x00,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_DSC_range = 0x01
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum LineNumberOps {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Line Number Standard Opcode Encodings
|
2010-09-30 19:16:09 +02:00
|
|
|
DW_LNS_extended_op = 0x00,
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_LNS_copy = 0x01,
|
|
|
|
DW_LNS_advance_pc = 0x02,
|
|
|
|
DW_LNS_advance_line = 0x03,
|
|
|
|
DW_LNS_set_file = 0x04,
|
|
|
|
DW_LNS_set_column = 0x05,
|
|
|
|
DW_LNS_negate_stmt = 0x06,
|
|
|
|
DW_LNS_set_basic_block = 0x07,
|
|
|
|
DW_LNS_const_add_pc = 0x08,
|
|
|
|
DW_LNS_fixed_advance_pc = 0x09,
|
|
|
|
DW_LNS_set_prologue_end = 0x0a,
|
|
|
|
DW_LNS_set_epilogue_begin = 0x0b,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_LNS_set_isa = 0x0c
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum LineNumberExtendedOps {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Line Number Extended Opcode Encodings
|
|
|
|
DW_LNE_end_sequence = 0x01,
|
|
|
|
DW_LNE_set_address = 0x02,
|
|
|
|
DW_LNE_define_file = 0x03,
|
2011-09-15 06:23:44 +02:00
|
|
|
DW_LNE_set_discriminator = 0x04,
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_LNE_lo_user = 0x80,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_LNE_hi_user = 0xff
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum MacinfoRecordType {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Macinfo Type Encodings
|
|
|
|
DW_MACINFO_define = 0x01,
|
|
|
|
DW_MACINFO_undef = 0x02,
|
|
|
|
DW_MACINFO_start_file = 0x03,
|
|
|
|
DW_MACINFO_end_file = 0x04,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_MACINFO_vendor_ext = 0xff
|
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum CallFrameInfo {
|
2006-02-27 13:43:29 +01:00
|
|
|
// Call frame instruction encodings
|
2006-03-23 19:07:55 +01:00
|
|
|
DW_CFA_extended = 0x00,
|
2009-08-21 23:03:57 +02:00
|
|
|
DW_CFA_nop = 0x00,
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_CFA_advance_loc = 0x40,
|
|
|
|
DW_CFA_offset = 0x80,
|
|
|
|
DW_CFA_restore = 0xc0,
|
|
|
|
DW_CFA_set_loc = 0x01,
|
|
|
|
DW_CFA_advance_loc1 = 0x02,
|
|
|
|
DW_CFA_advance_loc2 = 0x03,
|
|
|
|
DW_CFA_advance_loc4 = 0x04,
|
|
|
|
DW_CFA_offset_extended = 0x05,
|
|
|
|
DW_CFA_restore_extended = 0x06,
|
|
|
|
DW_CFA_undefined = 0x07,
|
|
|
|
DW_CFA_same_value = 0x08,
|
|
|
|
DW_CFA_register = 0x09,
|
|
|
|
DW_CFA_remember_state = 0x0a,
|
|
|
|
DW_CFA_restore_state = 0x0b,
|
|
|
|
DW_CFA_def_cfa = 0x0c,
|
|
|
|
DW_CFA_def_cfa_register = 0x0d,
|
|
|
|
DW_CFA_def_cfa_offset = 0x0e,
|
|
|
|
DW_CFA_def_cfa_expression = 0x0f,
|
|
|
|
DW_CFA_expression = 0x10,
|
|
|
|
DW_CFA_offset_extended_sf = 0x11,
|
|
|
|
DW_CFA_def_cfa_sf = 0x12,
|
|
|
|
DW_CFA_def_cfa_offset_sf = 0x13,
|
|
|
|
DW_CFA_val_offset = 0x14,
|
|
|
|
DW_CFA_val_offset_sf = 0x15,
|
|
|
|
DW_CFA_val_expression = 0x16,
|
2011-09-15 07:21:03 +02:00
|
|
|
DW_CFA_MIPS_advance_loc8 = 0x1d,
|
|
|
|
DW_CFA_GNU_window_save = 0x2d,
|
|
|
|
DW_CFA_GNU_args_size = 0x2e,
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_CFA_lo_user = 0x1c,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_CFA_hi_user = 0x3f
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Constants {
|
|
|
|
// Children flag
|
|
|
|
DW_CHILDREN_no = 0x00,
|
|
|
|
DW_CHILDREN_yes = 0x01,
|
2007-02-01 17:31:34 +01:00
|
|
|
|
|
|
|
DW_EH_PE_absptr = 0x00,
|
|
|
|
DW_EH_PE_omit = 0xff,
|
|
|
|
DW_EH_PE_uleb128 = 0x01,
|
|
|
|
DW_EH_PE_udata2 = 0x02,
|
|
|
|
DW_EH_PE_udata4 = 0x03,
|
|
|
|
DW_EH_PE_udata8 = 0x04,
|
|
|
|
DW_EH_PE_sleb128 = 0x09,
|
|
|
|
DW_EH_PE_sdata2 = 0x0A,
|
|
|
|
DW_EH_PE_sdata4 = 0x0B,
|
|
|
|
DW_EH_PE_sdata8 = 0x0C,
|
|
|
|
DW_EH_PE_signed = 0x08,
|
|
|
|
DW_EH_PE_pcrel = 0x10,
|
|
|
|
DW_EH_PE_textrel = 0x20,
|
|
|
|
DW_EH_PE_datarel = 0x30,
|
|
|
|
DW_EH_PE_funcrel = 0x40,
|
|
|
|
DW_EH_PE_aligned = 0x50,
|
2013-10-21 19:28:37 +02:00
|
|
|
DW_EH_PE_indirect = 0x80
|
|
|
|
};
|
2011-04-16 02:11:51 +02:00
|
|
|
|
2014-04-01 01:50:20 +02:00
|
|
|
// Constants for debug_loc.dwo in the DWARF5 Split Debug Info Proposal
|
2014-03-25 02:44:02 +01:00
|
|
|
enum LocationListEntry : unsigned char {
|
|
|
|
DW_LLE_end_of_list_entry,
|
|
|
|
DW_LLE_base_address_selection_entry,
|
|
|
|
DW_LLE_start_end_entry,
|
|
|
|
DW_LLE_start_length_entry,
|
|
|
|
DW_LLE_offset_pair_entry
|
|
|
|
};
|
|
|
|
|
2014-10-08 16:59:44 +02:00
|
|
|
/// Contstants for the DW_APPLE_PROPERTY_attributes attribute.
|
|
|
|
/// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind.
|
2013-10-21 19:28:37 +02:00
|
|
|
enum ApplePropertyAttributes {
|
2011-04-16 02:11:51 +02:00
|
|
|
// Apple Objective-C Property Attributes
|
|
|
|
DW_APPLE_PROPERTY_readonly = 0x01,
|
2014-10-08 16:59:44 +02:00
|
|
|
DW_APPLE_PROPERTY_getter = 0x02,
|
2011-04-16 02:11:51 +02:00
|
|
|
DW_APPLE_PROPERTY_assign = 0x04,
|
2014-10-08 16:59:44 +02:00
|
|
|
DW_APPLE_PROPERTY_readwrite = 0x08,
|
|
|
|
DW_APPLE_PROPERTY_retain = 0x10,
|
|
|
|
DW_APPLE_PROPERTY_copy = 0x20,
|
|
|
|
DW_APPLE_PROPERTY_nonatomic = 0x40,
|
|
|
|
DW_APPLE_PROPERTY_setter = 0x80,
|
|
|
|
DW_APPLE_PROPERTY_atomic = 0x100,
|
|
|
|
DW_APPLE_PROPERTY_weak = 0x200,
|
|
|
|
DW_APPLE_PROPERTY_strong = 0x400,
|
|
|
|
DW_APPLE_PROPERTY_unsafe_unretained = 0x800
|
2006-02-27 13:43:29 +01:00
|
|
|
};
|
|
|
|
|
2013-09-05 20:20:16 +02:00
|
|
|
// Constants for the DWARF5 Accelerator Table Proposal
|
|
|
|
enum AcceleratorTable {
|
|
|
|
// Data layout descriptors.
|
|
|
|
DW_ATOM_null = 0u, // Marker as the end of a list of atoms.
|
|
|
|
DW_ATOM_die_offset = 1u, // DIE offset in the debug_info section.
|
2013-09-09 22:03:08 +02:00
|
|
|
DW_ATOM_cu_offset = 2u, // Offset of the compile unit header that contains the
|
2013-09-05 20:20:16 +02:00
|
|
|
// item in question.
|
2013-09-09 22:03:08 +02:00
|
|
|
DW_ATOM_die_tag = 3u, // A tag entry.
|
2013-09-05 20:20:16 +02:00
|
|
|
DW_ATOM_type_flags = 4u, // Set of flags for a type.
|
|
|
|
|
|
|
|
// DW_ATOM_type_flags values.
|
|
|
|
|
|
|
|
// Always set for C++, only set for ObjC if this is the @implementation for a
|
|
|
|
// class.
|
|
|
|
DW_FLAG_type_implementation = 2u,
|
|
|
|
|
|
|
|
// Hash functions.
|
|
|
|
|
|
|
|
// Daniel J. Bernstein hash.
|
|
|
|
DW_hash_function_djb = 0u
|
|
|
|
};
|
|
|
|
|
2013-09-09 22:03:11 +02:00
|
|
|
// Constants for the GNU pubnames/pubtypes extensions supporting gdb index.
|
2013-09-19 22:40:26 +02:00
|
|
|
enum GDBIndexEntryKind {
|
|
|
|
GIEK_NONE,
|
|
|
|
GIEK_TYPE,
|
|
|
|
GIEK_VARIABLE,
|
|
|
|
GIEK_FUNCTION,
|
|
|
|
GIEK_OTHER,
|
|
|
|
GIEK_UNUSED5,
|
|
|
|
GIEK_UNUSED6,
|
2013-09-20 01:21:07 +02:00
|
|
|
GIEK_UNUSED7
|
2013-09-09 22:03:11 +02:00
|
|
|
};
|
|
|
|
|
2013-09-19 22:40:26 +02:00
|
|
|
enum GDBIndexEntryLinkage {
|
|
|
|
GIEL_EXTERNAL,
|
|
|
|
GIEL_STATIC
|
|
|
|
};
|
|
|
|
|
2014-10-23 06:08:38 +02:00
|
|
|
/// \defgroup DwarfConstantsDumping Dwarf constants dumping functions
|
|
|
|
///
|
|
|
|
/// All these functions map their argument's value back to the
|
|
|
|
/// corresponding enumerator name or return nullptr if the value isn't
|
|
|
|
/// known.
|
|
|
|
///
|
|
|
|
/// @{
|
|
|
|
const char *TagString(unsigned Tag);
|
|
|
|
const char *ChildrenString(unsigned Children);
|
|
|
|
const char *AttributeString(unsigned Attribute);
|
|
|
|
const char *FormEncodingString(unsigned Encoding);
|
|
|
|
const char *OperationEncodingString(unsigned Encoding);
|
|
|
|
const char *AttributeEncodingString(unsigned Encoding);
|
|
|
|
const char *DecimalSignString(unsigned Sign);
|
|
|
|
const char *EndianityString(unsigned Endian);
|
|
|
|
const char *AccessibilityString(unsigned Access);
|
|
|
|
const char *VisibilityString(unsigned Visibility);
|
|
|
|
const char *VirtualityString(unsigned Virtuality);
|
|
|
|
const char *LanguageString(unsigned Language);
|
|
|
|
const char *CaseString(unsigned Case);
|
|
|
|
const char *ConventionString(unsigned Convention);
|
|
|
|
const char *InlineCodeString(unsigned Code);
|
|
|
|
const char *ArrayOrderString(unsigned Order);
|
|
|
|
const char *DiscriminantString(unsigned Discriminant);
|
|
|
|
const char *LNStandardString(unsigned Standard);
|
|
|
|
const char *LNExtendedString(unsigned Encoding);
|
|
|
|
const char *MacinfoString(unsigned Encoding);
|
|
|
|
const char *CallFrameString(unsigned Encoding);
|
|
|
|
const char *ApplePropertyString(unsigned);
|
|
|
|
const char *AtomTypeString(unsigned Atom);
|
|
|
|
const char *GDBIndexEntryKindString(GDBIndexEntryKind Kind);
|
2013-09-20 02:33:15 +02:00
|
|
|
const char *GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
|
2014-10-23 06:08:38 +02:00
|
|
|
/// @}
|
2013-09-20 00:19:37 +02:00
|
|
|
|
2015-02-06 23:55:13 +01:00
|
|
|
/// \defgroup DwarfConstantsParsing Dwarf constants parsing functions
|
|
|
|
///
|
|
|
|
/// These functions map their strings back to the corresponding enumeration
|
2015-02-07 01:37:15 +01:00
|
|
|
/// value or return 0 if there is none, except for these exceptions:
|
|
|
|
///
|
|
|
|
/// \li \a getTag() returns \a DW_TAG_invalid on invalid input.
|
|
|
|
/// \li \a getVirtuality() returns \a DW_VIRTUALITY_invalid on invalid input.
|
2015-02-06 23:55:13 +01:00
|
|
|
///
|
|
|
|
/// @{
|
2015-02-03 22:16:49 +01:00
|
|
|
unsigned getTag(StringRef TagString);
|
2015-02-13 02:05:00 +01:00
|
|
|
unsigned getOperationEncoding(StringRef OperationEncodingString);
|
2015-02-07 01:37:15 +01:00
|
|
|
unsigned getVirtuality(StringRef VirtualityString);
|
2015-02-06 23:55:13 +01:00
|
|
|
unsigned getLanguage(StringRef LanguageString);
|
2015-02-07 00:46:49 +01:00
|
|
|
unsigned getAttributeEncoding(StringRef EncodingString);
|
2015-02-06 23:55:13 +01:00
|
|
|
/// @}
|
2015-02-03 22:16:49 +01:00
|
|
|
|
2014-10-23 06:08:38 +02:00
|
|
|
/// \brief Returns the symbolic string representing Val when used as a value
|
|
|
|
/// for attribute Attr.
|
|
|
|
const char *AttributeValueString(uint16_t Attr, unsigned Val);
|
|
|
|
|
|
|
|
/// \brief Decsribes an entry of the various gnu_pub* debug sections.
|
2015-08-10 06:22:09 +02:00
|
|
|
///
|
2013-09-19 22:40:26 +02:00
|
|
|
/// The gnu_pub* kind looks like:
|
|
|
|
///
|
|
|
|
/// 0-3 reserved
|
|
|
|
/// 4-6 symbol kind
|
|
|
|
/// 7 0 == global, 1 == static
|
|
|
|
///
|
|
|
|
/// A gdb_index descriptor includes the above kind, shifted 24 bits up with the
|
|
|
|
/// offset of the cu within the debug_info section stored in those 24 bits.
|
|
|
|
struct PubIndexEntryDescriptor {
|
|
|
|
GDBIndexEntryKind Kind;
|
2013-09-20 01:01:29 +02:00
|
|
|
GDBIndexEntryLinkage Linkage;
|
|
|
|
PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
|
|
|
|
: Kind(Kind), Linkage(Linkage) {}
|
2013-09-19 22:40:26 +02:00
|
|
|
/* implicit */ PubIndexEntryDescriptor(GDBIndexEntryKind Kind)
|
2013-09-20 01:01:29 +02:00
|
|
|
: Kind(Kind), Linkage(GIEL_EXTERNAL) {}
|
2013-09-19 22:40:26 +02:00
|
|
|
explicit PubIndexEntryDescriptor(uint8_t Value)
|
|
|
|
: Kind(static_cast<GDBIndexEntryKind>((Value & KIND_MASK) >>
|
|
|
|
KIND_OFFSET)),
|
2013-09-20 01:01:29 +02:00
|
|
|
Linkage(static_cast<GDBIndexEntryLinkage>((Value & LINKAGE_MASK) >>
|
|
|
|
LINKAGE_OFFSET)) {}
|
|
|
|
uint8_t toBits() { return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET; }
|
|
|
|
|
2013-09-19 22:40:26 +02:00
|
|
|
private:
|
2013-09-19 23:30:00 +02:00
|
|
|
enum {
|
|
|
|
KIND_OFFSET = 4,
|
|
|
|
KIND_MASK = 7 << KIND_OFFSET,
|
2013-09-20 00:19:37 +02:00
|
|
|
LINKAGE_OFFSET = 7,
|
|
|
|
LINKAGE_MASK = 1 << LINKAGE_OFFSET
|
2013-09-19 23:30:00 +02:00
|
|
|
};
|
2013-09-19 22:40:26 +02:00
|
|
|
};
|
2013-09-09 22:03:11 +02:00
|
|
|
|
2006-02-27 13:43:29 +01:00
|
|
|
} // End of namespace dwarf
|
2006-01-26 15:45:22 +01:00
|
|
|
|
2006-02-27 23:37:23 +01:00
|
|
|
} // End of namespace llvm
|
|
|
|
|
2006-01-26 15:45:22 +01:00
|
|
|
#endif
|