15#ifndef LLVM_OBJECTYAML_DWARFYAML_H
16#define LLVM_OBJECTYAML_DWARFYAML_H
26#include <unordered_map>
39 std::optional<yaml::Hex64>
Code;
46 std::optional<uint64_t>
ID;
74 std::optional<llvm::yaml::Hex64>
Offset;
242 std::optional<std::vector<EntryType>>
Entries;
253 std::optional<std::vector<yaml::Hex64>>
Offsets;
254 std::vector<ListEntries<EntryType>>
Lists;
291 mutable std::unordered_map<uint64_t, AbbrevTableInfo> AbbrevTableInfoMap;
292 mutable std::unordered_map<uint64_t, std::string> AbbrevTableContents;
335template <>
struct MappingTraits<DWARFYAML::
Data> {
336 LLVM_ABI static void mapping(IO &IO, DWARFYAML::Data &DWARF);
340 LLVM_ABI static void mapping(IO &IO, DWARFYAML::AbbrevTable &AbbrevTable);
344 LLVM_ABI static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev);
347template <>
struct MappingTraits<DWARFYAML::AttributeAbbrev> {
348 LLVM_ABI static void mapping(IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev);
351template <>
struct MappingTraits<DWARFYAML::ARangeDescriptor> {
352 LLVM_ABI static void mapping(IO &IO, DWARFYAML::ARangeDescriptor &Descriptor);
356 LLVM_ABI static void mapping(IO &IO, DWARFYAML::ARange &ARange);
360 LLVM_ABI static void mapping(IO &IO, DWARFYAML::RangeEntry &Entry);
364 LLVM_ABI static void mapping(IO &IO, DWARFYAML::Ranges &Ranges);
368 LLVM_ABI static void mapping(IO &IO, DWARFYAML::PubEntry &Entry);
372 LLVM_ABI static void mapping(IO &IO, DWARFYAML::PubSection &Section);
376 LLVM_ABI static void mapping(IO &IO, DWARFYAML::Unit &Unit);
379template <>
struct MappingTraits<DWARFYAML::DebugNamesSection> {
380 LLVM_ABI static void mapping(IO &IO, DWARFYAML::DebugNamesSection &);
383 LLVM_ABI static void mapping(IO &IO, DWARFYAML::DebugNameEntry &);
385template <>
struct MappingTraits<DWARFYAML::DebugNameAbbreviation> {
386 LLVM_ABI static void mapping(IO &IO, DWARFYAML::DebugNameAbbreviation &);
389 LLVM_ABI static void mapping(IO &IO, DWARFYAML::IdxForm &);
393 LLVM_ABI static void mapping(IO &IO, DWARFYAML::Entry &Entry);
397 LLVM_ABI static void mapping(IO &IO, DWARFYAML::FormValue &FormValue);
401 LLVM_ABI static void mapping(IO &IO, DWARFYAML::File &File);
405 LLVM_ABI static void mapping(IO &IO, DWARFYAML::LnctForm &);
408template <>
struct MappingTraits<DWARFYAML::LineTableOpcode> {
409 LLVM_ABI static void mapping(IO &IO,
410 DWARFYAML::LineTableOpcode &LineTableOpcode);
414 LLVM_ABI static void mapping(IO &IO, DWARFYAML::LineTable &LineTable);
418 LLVM_ABI static void mapping(IO &IO, DWARFYAML::SegAddrPair &SegAddrPair);
422 LLVM_ABI static void mapping(IO &IO,
423 DWARFYAML::DWARFOperation &DWARFOperation);
426template <
typename EntryType>
428 static void mapping(IO &IO, DWARFYAML::ListTable<EntryType> &ListTable);
431template <
typename EntryType>
433 static void mapping(IO &IO, DWARFYAML::ListEntries<EntryType> &ListEntries);
435 DWARFYAML::ListEntries<EntryType> &ListEntries);
439 LLVM_ABI static void mapping(IO &IO, DWARFYAML::RnglistEntry &RnglistEntry);
443 LLVM_ABI static void mapping(IO &IO, DWARFYAML::LoclistEntry &LoclistEntry);
447 LLVM_ABI static void mapping(IO &IO, DWARFYAML::AddrTableEntry &AddrTable);
450template <>
struct MappingTraits<DWARFYAML::StringOffsetsTable> {
451 LLVM_ABI static void mapping(IO &IO,
452 DWARFYAML::StringOffsetsTable &StrOffsetsTable);
462#define HANDLE_DW_TAG(unused, name, unused2, unused3, unused4) \
463 io.enumCase(value, "DW_TAG_" #name, dwarf::DW_TAG_##name);
466 static void enumeration(IO &io,
dwarf::Tag &value) {
467#include "llvm/BinaryFormat/Dwarf.def"
468 io.enumFallback<Hex16>(value);
472#define HANDLE_DW_LNS(unused, name) \
473 io.enumCase(value, "DW_LNS_" #name, dwarf::DW_LNS_##name);
477#include "llvm/BinaryFormat/Dwarf.def"
478 io.enumFallback<Hex8>(value);
482#define HANDLE_DW_LNE(unused, name) \
483 io.enumCase(value, "DW_LNE_" #name, dwarf::DW_LNE_##name);
487#include "llvm/BinaryFormat/Dwarf.def"
488 io.enumFallback<Hex16>(value);
492#define HANDLE_DW_LNCT(unused, name) \
493 io.enumCase(value, "DW_LNCT_" #name, dwarf::DW_LNCT_##name);
497#include "llvm/BinaryFormat/Dwarf.def"
498 io.enumFallback<Hex16>(value);
502#define HANDLE_DW_AT(unused, name, unused2, unused3) \
503 io.enumCase(value, "DW_AT_" #name, dwarf::DW_AT_##name);
507#include "llvm/BinaryFormat/Dwarf.def"
508 io.enumFallback<Hex16>(value);
512#define HANDLE_DW_FORM(unused, name, unused2, unused3) \
513 io.enumCase(value, "DW_FORM_" #name, dwarf::DW_FORM_##name);
516 static void enumeration(IO &io,
dwarf::Form &value) {
517#include "llvm/BinaryFormat/Dwarf.def"
518 io.enumFallback<Hex16>(value);
522#define HANDLE_DW_IDX(unused, name) \
523 io.enumCase(value, "DW_IDX_" #name, dwarf::DW_IDX_##name);
527#include "llvm/BinaryFormat/Dwarf.def"
528 io.enumFallback<Hex16>(value);
532#define HANDLE_DW_UT(unused, name) \
533 io.enumCase(value, "DW_UT_" #name, dwarf::DW_UT_##name);
537#include "llvm/BinaryFormat/Dwarf.def"
538 io.enumFallback<Hex8>(value);
546 io.enumFallback<Hex16>(value);
550#define HANDLE_DW_RLE(unused, name) \
551 io.enumCase(value, "DW_RLE_" #name, dwarf::DW_RLE_##name);
555#include "llvm/BinaryFormat/Dwarf.def"
559#define HANDLE_DW_LLE(unused, name) \
560 io.enumCase(value, "DW_LLE_" #name, dwarf::DW_LLE_##name);
564#include "llvm/BinaryFormat/Dwarf.def"
568#define HANDLE_DW_OP(id, name, operands, arity, version, vendor) \
569 io.enumCase(value, "DW_OP_" #name, dwarf::DW_OP_##name);
573#include "llvm/BinaryFormat/Dwarf.def"
574 io.enumFallback<yaml::Hex8>(value);
This file contains constants used for implementing Dwarf debug support.
This file implements a set that has insertion order iteration characteristics.
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
Utility for declaring that a std::vector of a particular type should be considered a YAML sequence.
Tagged union holding either a T or a Error.
A vector that has set insertion semantics.
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
LineNumberOps
Line Number Standard Opcode Encodings.
LoclistEntries
DWARF v5 loc list entry encoding values.
UnitType
Constants for unit types in DWARF v5.
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
RnglistEntries
DWARF v5 range list entry encoding values.
LineNumberExtendedOps
Line Number Extended Opcode Encodings.
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
llvm::yaml::Hex64 Address
std::optional< yaml::Hex64 > Length
dwarf::DwarfFormat Format
std::vector< ARangeDescriptor > Descriptors
std::optional< yaml::Hex8 > AddrSize
std::vector< Abbrev > Table
std::optional< uint64_t > ID
std::vector< AttributeAbbrev > Attributes
std::optional< yaml::Hex64 > Code
llvm::dwarf::Constants Children
std::optional< yaml::Hex64 > Length
std::optional< yaml::Hex8 > AddrSize
dwarf::DwarfFormat Format
yaml::Hex8 SegSelectorSize
std::vector< SegAddrPair > SegAddrPairs
llvm::dwarf::Attribute Attribute
Class that contains helpful context information when mapping YAML into DWARF data structures.
std::vector< yaml::Hex64 > Values
dwarf::LocationAtom Operator
std::vector< Unit > Units
std::vector< LineTable > DebugLines
std::optional< std::vector< AddrTableEntry > > DebugAddr
std::optional< std::vector< Ranges > > DebugRanges
std::optional< std::vector< ListTable< LoclistEntry > > > DebugLoclists
std::vector< AbbrevTable > DebugAbbrev
LLVM_ABI Expected< AbbrevTableInfo > getAbbrevTableInfoByID(uint64_t ID) const
std::optional< PubSection > GNUPubNames
std::optional< std::vector< ARange > > DebugAranges
LLVM_ABI StringRef getAbbrevTableContentByIndex(uint64_t Index) const
std::optional< PubSection > GNUPubTypes
LLVM_ABI SetVector< StringRef > getNonEmptySectionNames() const
std::optional< std::vector< StringOffsetsTable > > DebugStrOffsets
std::optional< std::vector< StringRef > > DebugStrings
std::optional< std::vector< ListTable< RnglistEntry > > > DebugRnglists
std::optional< PubSection > PubNames
std::optional< DebugNamesSection > DebugNames
std::optional< PubSection > PubTypes
LLVM_ABI bool isEmpty() const
std::vector< IdxForm > Indices
std::vector< yaml::Hex64 > Values
std::vector< DebugNameAbbreviation > Abbrevs
std::vector< DebugNameEntry > Entries
std::vector< FormValue > Values
llvm::yaml::Hex32 AbbrCode
dwarf::LineNumberOps Opcode
std::optional< uint64_t > ExtLen
std::vector< llvm::yaml::Hex64 > StandardOpcodeData
dwarf::LineNumberExtendedOps SubOpcode
std::vector< llvm::yaml::Hex8 > UnknownOpcodeData
uint8_t FileNameEntryFormatCount
std::vector< std::vector< FormValue > > FileNames
std::optional< uint64_t > Length
std::optional< uint8_t > OpcodeBase
std::vector< LineTableOpcode > Opcodes
std::optional< uint64_t > PrologueLength
dwarf::DwarfFormat Format
std::vector< File > Files
uint64_t DirectoriesCount
std::vector< StringRef > IncludeDirs
std::vector< LnctForm > DirectoryEntryFormat
std::vector< LnctForm > FileNameEntryFormat
std::optional< std::vector< uint8_t > > StandardOpcodeLengths
uint8_t DirectoryEntryFormatCount
uint8_t SegmentSelectorSize
std::vector< std::vector< FormValue > > Directories
std::optional< std::vector< EntryType > > Entries
std::optional< yaml::BinaryRef > Content
std::optional< yaml::Hex8 > AddrSize
std::optional< std::vector< yaml::Hex64 > > Offsets
yaml::Hex8 SegSelectorSize
dwarf::DwarfFormat Format
std::vector< ListEntries< EntryType > > Lists
std::optional< uint32_t > OffsetEntryCount
std::optional< yaml::Hex64 > Length
std::vector< yaml::Hex64 > Values
std::optional< yaml::Hex64 > DescriptionsLength
dwarf::LoclistEntries Operator
std::vector< DWARFOperation > Descriptions
llvm::yaml::Hex8 Descriptor
llvm::yaml::Hex32 DieOffset
dwarf::DwarfFormat Format
std::vector< PubEntry > Entries
Class that describes a range list entry, or a base address selection entry within a range list in the...
llvm::yaml::Hex64 HighOffset
llvm::yaml::Hex64 LowOffset
Class that describes a single range list inside the .debug_ranges section.
std::vector< RangeEntry > Entries
std::optional< llvm::yaml::Hex64 > Offset
std::optional< llvm::yaml::Hex8 > AddrSize
std::vector< yaml::Hex64 > Values
dwarf::RnglistEntries Operator
std::optional< yaml::Hex64 > Length
std::vector< yaml::Hex64 > Offsets
dwarf::DwarfFormat Format
std::optional< uint64_t > AbbrevTableID
dwarf::DwarfFormat Format
std::optional< yaml::Hex64 > Length
yaml::Hex64 TypeSignatureOrDwoID
std::optional< uint8_t > AddrSize
llvm::dwarf::UnitType Type
std::vector< Entry > Entries
std::optional< yaml::Hex64 > AbbrOffset
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
This class should be specialized by any integral type that converts to/from a YAML scalar where there...