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
|
|
|
|
|
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 {
|
2016-04-18 11:17:29 +02:00
|
|
|
class StringRef;
|
2006-02-27 23:37:23 +01:00
|
|
|
|
2006-02-27 13:43:29 +01:00
|
|
|
namespace dwarf {
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2017-02-28 21:24:55 +01:00
|
|
|
// DWARF constants as gleaned from the DWARF Debugging Information Format V.5
|
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.
|
2017-04-20 21:16:51 +02:00
|
|
|
DW_ARANGES_VERSION = 2, // Section version number for .debug_aranges.
|
|
|
|
// Identifiers we use to distinguish vendor extensions.
|
|
|
|
DWARF_VENDOR_DWARF = 0, // Defined in v2 or later of the DWARF standard.
|
|
|
|
DWARF_VENDOR_APPLE = 1,
|
|
|
|
DWARF_VENDOR_BORLAND = 2,
|
|
|
|
DWARF_VENDOR_GNU = 3,
|
|
|
|
DWARF_VENDOR_GOOGLE = 4,
|
|
|
|
DWARF_VENDOR_LLVM = 5,
|
|
|
|
DWARF_VENDOR_MIPS = 6
|
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 {
|
2017-04-20 21:16:51 +02:00
|
|
|
#define HANDLE_DW_TAG(ID, NAME, VERSION, VENDOR) DW_TAG_##NAME = ID,
|
2015-02-03 22:13:16 +01:00
|
|
|
#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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-10-28 20:21:39 +02:00
|
|
|
/// Attributes.
|
2014-03-02 04:20:38 +01:00
|
|
|
enum Attribute : uint16_t {
|
2017-04-20 21:16:51 +02:00
|
|
|
#define HANDLE_DW_AT(ID, NAME, VERSION, VENDOR) DW_AT_##NAME = ID,
|
2016-10-28 20:21:39 +02:00
|
|
|
#include "llvm/Support/Dwarf.def"
|
2012-11-17 00:04:31 +01:00
|
|
|
DW_AT_lo_user = 0x2000,
|
|
|
|
DW_AT_hi_user = 0x3fff,
|
2013-10-21 19:28:37 +02:00
|
|
|
};
|
2009-01-23 23:33:47 +01:00
|
|
|
|
2014-03-02 04:20:38 +01:00
|
|
|
enum Form : uint16_t {
|
2017-04-20 21:16:51 +02:00
|
|
|
#define HANDLE_DW_FORM(ID, NAME, VERSION, VENDOR) DW_FORM_##NAME = ID,
|
2016-10-29 00:56:45 +02:00
|
|
|
#include "llvm/Support/Dwarf.def"
|
|
|
|
DW_FORM_lo_user = 0x1f00, ///< Not specified by DWARF.
|
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 {
|
2017-04-20 21:16:51 +02:00
|
|
|
#define HANDLE_DW_OP(ID, NAME, VERSION, VENDOR) DW_OP_##NAME = ID,
|
2015-02-13 02:04:08 +01:00
|
|
|
#include "llvm/Support/Dwarf.def"
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_OP_lo_user = 0xe0,
|
2016-12-05 19:04:47 +01:00
|
|
|
DW_OP_hi_user = 0xff,
|
|
|
|
DW_OP_LLVM_fragment = 0x1000 ///< Only used in LLVM metadata.
|
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 {
|
2017-04-20 21:16:51 +02:00
|
|
|
#define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID,
|
2015-02-07 00:45:37 +01:00
|
|
|
#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
|
|
|
|
2016-10-28 19:59:50 +02:00
|
|
|
enum DefaultedMemberAttribute {
|
|
|
|
#define HANDLE_DW_DEFAULTED(ID, NAME) DW_DEFAULTED_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
|
|
|
DW_DEFAULTED_max = 0x02
|
|
|
|
};
|
|
|
|
|
2013-10-21 19:28:37 +02:00
|
|
|
enum SourceLanguage {
|
2017-04-20 21:16:51 +02:00
|
|
|
#define HANDLE_DW_LANG(ID, NAME, VERSION, VENDOR) DW_LANG_##NAME = ID,
|
2015-02-06 23:53:19 +01:00
|
|
|
#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
|
2016-06-08 22:34:29 +02:00
|
|
|
#define HANDLE_DW_CC(ID, NAME) DW_CC_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
2006-02-27 13:43:29 +01:00
|
|
|
DW_CC_lo_user = 0x40,
|
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
|
|
|
|
2016-10-29 00:56:59 +02:00
|
|
|
/// Line Number Standard Opcode Encodings.
|
2017-01-10 07:22:49 +01:00
|
|
|
enum LineNumberOps : uint8_t {
|
2016-10-29 00:56:59 +02:00
|
|
|
#define HANDLE_DW_LNS(ID, NAME) DW_LNS_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
2013-10-21 19:28:37 +02:00
|
|
|
};
|
2006-02-27 13:43:29 +01:00
|
|
|
|
2016-10-29 00:57:02 +02:00
|
|
|
/// Line Number Extended Opcode Encodings.
|
2013-10-21 19:28:37 +02:00
|
|
|
enum LineNumberExtendedOps {
|
2016-10-29 00:57:02 +02:00
|
|
|
#define HANDLE_DW_LNE(ID, NAME) DW_LNE_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
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
|
|
|
|
2017-04-20 22:03:03 +02:00
|
|
|
enum LineNumberEntryFormat {
|
|
|
|
#define HANDLE_DW_LNCT(ID, NAME) DW_LNCT_##NAME = ID,
|
2016-10-28 19:59:50 +02:00
|
|
|
#include "llvm/Support/Dwarf.def"
|
|
|
|
DW_LNCT_lo_user = 0x2000,
|
|
|
|
DW_LNCT_hi_user = 0x3fff,
|
|
|
|
};
|
|
|
|
|
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
|
|
|
|
2016-10-28 19:59:50 +02:00
|
|
|
/// DWARF v5 macro information entry type encodings.
|
2015-12-15 22:50:27 +01:00
|
|
|
enum MacroEntryType {
|
2016-10-28 22:32:17 +02:00
|
|
|
#define HANDLE_DW_MACRO(ID, NAME) DW_MACRO_##NAME = ID,
|
2016-10-28 19:59:50 +02:00
|
|
|
#include "llvm/Support/Dwarf.def"
|
2015-12-15 22:50:27 +01:00
|
|
|
DW_MACRO_lo_user = 0xe0,
|
|
|
|
DW_MACRO_hi_user = 0xff
|
|
|
|
};
|
|
|
|
|
2016-10-28 19:59:50 +02:00
|
|
|
/// DWARF v5 range list entry encoding values.
|
|
|
|
enum RangeListEntries {
|
2016-10-28 22:32:17 +02:00
|
|
|
#define HANDLE_DW_RLE(ID, NAME) DW_RLE_##NAME = ID,
|
2016-10-28 19:59:50 +02:00
|
|
|
#include "llvm/Support/Dwarf.def"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-10-29 00:56:53 +02:00
|
|
|
/// Call frame instruction encodings.
|
2013-10-21 19:28:37 +02:00
|
|
|
enum CallFrameInfo {
|
2016-10-29 00:56:53 +02:00
|
|
|
#define HANDLE_DW_CFA(ID, NAME) DW_CFA_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
2006-03-23 19:07:55 +01:00
|
|
|
DW_CFA_extended = 0x00,
|
2016-10-29 00:56:53 +02:00
|
|
|
|
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
|
|
|
|
2016-10-28 19:59:50 +02:00
|
|
|
/// Constants for location lists in DWARF v5.
|
2014-03-25 02:44:02 +01:00
|
|
|
enum LocationListEntry : unsigned char {
|
2016-10-28 19:59:50 +02:00
|
|
|
DW_LLE_end_of_list = 0x00,
|
|
|
|
DW_LLE_base_addressx = 0x01,
|
|
|
|
DW_LLE_startx_endx = 0x02,
|
|
|
|
DW_LLE_startx_length = 0x03,
|
|
|
|
DW_LLE_offset_pair = 0x04,
|
|
|
|
DW_LLE_default_location = 0x05,
|
|
|
|
DW_LLE_base_address = 0x06,
|
|
|
|
DW_LLE_start_end = 0x07,
|
|
|
|
DW_LLE_start_length = 0x08
|
2014-03-25 02:44:02 +01:00
|
|
|
};
|
|
|
|
|
2016-07-14 02:41:18 +02:00
|
|
|
/// Constants for the DW_APPLE_PROPERTY_attributes attribute.
|
2016-10-29 00:56:56 +02:00
|
|
|
/// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind!
|
2013-10-21 19:28:37 +02:00
|
|
|
enum ApplePropertyAttributes {
|
2016-10-29 00:56:56 +02:00
|
|
|
#define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
2006-02-27 13:43:29 +01:00
|
|
|
};
|
|
|
|
|
2017-02-28 21:24:55 +01:00
|
|
|
/// Constants for unit types in DWARF v5.
|
|
|
|
enum UnitType : unsigned char {
|
|
|
|
#define HANDLE_DW_UT(ID, NAME) DW_UT_##NAME = ID,
|
|
|
|
#include "llvm/Support/Dwarf.def"
|
|
|
|
DW_UT_lo_user = 0x80,
|
|
|
|
DW_UT_hi_user = 0xff
|
|
|
|
};
|
|
|
|
|
|
|
|
// Constants for the DWARF v5 Accelerator Table Proposal
|
2013-09-05 20:20:16 +02:00
|
|
|
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.
|
|
|
|
///
|
|
|
|
/// @{
|
2016-10-05 07:59:29 +02:00
|
|
|
StringRef TagString(unsigned Tag);
|
|
|
|
StringRef ChildrenString(unsigned Children);
|
|
|
|
StringRef AttributeString(unsigned Attribute);
|
|
|
|
StringRef FormEncodingString(unsigned Encoding);
|
|
|
|
StringRef OperationEncodingString(unsigned Encoding);
|
|
|
|
StringRef AttributeEncodingString(unsigned Encoding);
|
|
|
|
StringRef DecimalSignString(unsigned Sign);
|
|
|
|
StringRef EndianityString(unsigned Endian);
|
|
|
|
StringRef AccessibilityString(unsigned Access);
|
|
|
|
StringRef VisibilityString(unsigned Visibility);
|
|
|
|
StringRef VirtualityString(unsigned Virtuality);
|
|
|
|
StringRef LanguageString(unsigned Language);
|
|
|
|
StringRef CaseString(unsigned Case);
|
|
|
|
StringRef ConventionString(unsigned Convention);
|
|
|
|
StringRef InlineCodeString(unsigned Code);
|
|
|
|
StringRef ArrayOrderString(unsigned Order);
|
|
|
|
StringRef DiscriminantString(unsigned Discriminant);
|
|
|
|
StringRef LNStandardString(unsigned Standard);
|
|
|
|
StringRef LNExtendedString(unsigned Encoding);
|
|
|
|
StringRef MacinfoString(unsigned Encoding);
|
|
|
|
StringRef CallFrameString(unsigned Encoding);
|
|
|
|
StringRef ApplePropertyString(unsigned);
|
2017-02-28 21:24:55 +01:00
|
|
|
StringRef UnitTypeString(unsigned);
|
2016-10-05 07:59:29 +02:00
|
|
|
StringRef AtomTypeString(unsigned Atom);
|
|
|
|
StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind);
|
|
|
|
StringRef 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-12-10 13:56:35 +01:00
|
|
|
/// \li \a getMacinfo() returns \a DW_MACINFO_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);
|
2016-06-08 22:34:29 +02:00
|
|
|
unsigned getCallingConvention(StringRef LanguageString);
|
2015-02-07 00:46:49 +01:00
|
|
|
unsigned getAttributeEncoding(StringRef EncodingString);
|
2015-12-10 13:56:35 +01:00
|
|
|
unsigned getMacinfo(StringRef MacinfoString);
|
2015-02-06 23:55:13 +01:00
|
|
|
/// @}
|
2015-02-03 22:16:49 +01:00
|
|
|
|
2017-04-20 21:16:51 +02:00
|
|
|
/// \defgroup DwarfConstantsVersioning Dwarf version for constants
|
|
|
|
///
|
|
|
|
/// For constants defined by DWARF, returns the DWARF version when the constant
|
|
|
|
/// was first defined. For vendor extensions, if there is a version-related
|
|
|
|
/// policy for when to emit it, returns a version number for that policy.
|
|
|
|
/// Otherwise returns 0.
|
|
|
|
///
|
|
|
|
/// @{
|
|
|
|
unsigned TagVersion(Tag T);
|
|
|
|
unsigned AttributeVersion(Attribute A);
|
|
|
|
unsigned FormVersion(Form F);
|
|
|
|
unsigned OperationVersion(LocationAtom O);
|
|
|
|
unsigned AttributeEncodingVersion(TypeKind E);
|
|
|
|
unsigned LanguageVersion(SourceLanguage L);
|
|
|
|
/// @}
|
|
|
|
|
|
|
|
/// \defgroup DwarfConstantsVendor Dwarf "vendor" for constants
|
|
|
|
///
|
|
|
|
/// These functions return an identifier describing "who" defined the constant,
|
|
|
|
/// either the DWARF standard itself or the vendor who defined the extension.
|
|
|
|
///
|
|
|
|
/// @{
|
|
|
|
unsigned TagVendor(Tag T);
|
|
|
|
unsigned AttributeVendor(Attribute A);
|
|
|
|
unsigned FormVendor(Form F);
|
|
|
|
unsigned OperationVendor(LocationAtom O);
|
|
|
|
unsigned AttributeEncodingVendor(TypeKind E);
|
|
|
|
unsigned LanguageVendor(SourceLanguage L);
|
|
|
|
/// @}
|
|
|
|
|
|
|
|
/// Tells whether the specified form is defined in the specified version,
|
|
|
|
/// or is an extension if extensions are allowed.
|
|
|
|
bool isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk = true);
|
|
|
|
|
2014-10-23 06:08:38 +02:00
|
|
|
/// \brief Returns the symbolic string representing Val when used as a value
|
|
|
|
/// for attribute Attr.
|
2016-10-05 07:59:29 +02:00
|
|
|
StringRef AttributeValueString(uint16_t Attr, unsigned Val);
|
2014-10-23 06:08:38 +02:00
|
|
|
|
|
|
|
/// \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)) {}
|
2016-12-17 11:15:39 +01:00
|
|
|
uint8_t toBits() const {
|
|
|
|
return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET;
|
|
|
|
}
|
2013-09-20 01:01:29 +02:00
|
|
|
|
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
|
|
|
|
2016-11-11 17:21:37 +01:00
|
|
|
/// Constants that define the DWARF format as 32 or 64 bit.
|
|
|
|
enum DwarfFormat { DWARF32, DWARF64 };
|
|
|
|
|
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
|