15#ifndef LLVM_OBJECTYAML_DWARFYAML_H
16#define LLVM_OBJECTYAML_DWARFYAML_H
25#include <unordered_map>
38 std::optional<yaml::Hex64>
Code;
45 std::optional<uint64_t>
ID;
73 std::optional<llvm::yaml::Hex64>
Offset;
221 std::optional<std::vector<EntryType>>
Entries;
232 std::optional<std::vector<yaml::Hex64>>
Offsets;
233 std::vector<ListEntries<EntryType>>
Lists;
270 mutable std::unordered_map<uint64_t, AbbrevTableInfo> AbbrevTableInfoMap;
271 mutable std::unordered_map<uint64_t, std::string> AbbrevTableContents;
312template <>
struct MappingTraits<DWARFYAML::
Data> {
313 static void mapping(IO &IO, DWARFYAML::Data &DWARF);
316template <>
struct MappingTraits<DWARFYAML::AbbrevTable> {
317 static void mapping(IO &IO, DWARFYAML::AbbrevTable &AbbrevTable);
320template <>
struct MappingTraits<DWARFYAML::Abbrev> {
321 static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev);
324template <>
struct MappingTraits<DWARFYAML::AttributeAbbrev> {
325 static void mapping(IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev);
328template <>
struct MappingTraits<DWARFYAML::ARangeDescriptor> {
329 static void mapping(IO &IO, DWARFYAML::ARangeDescriptor &Descriptor);
332template <>
struct MappingTraits<DWARFYAML::ARange> {
333 static void mapping(IO &IO, DWARFYAML::ARange &ARange);
336template <>
struct MappingTraits<DWARFYAML::RangeEntry> {
337 static void mapping(IO &IO, DWARFYAML::RangeEntry &Entry);
340template <>
struct MappingTraits<DWARFYAML::
Ranges> {
341 static void mapping(IO &IO, DWARFYAML::Ranges &Ranges);
344template <>
struct MappingTraits<DWARFYAML::PubEntry> {
345 static void mapping(IO &IO, DWARFYAML::PubEntry &Entry);
348template <>
struct MappingTraits<DWARFYAML::PubSection> {
349 static void mapping(IO &IO, DWARFYAML::PubSection &Section);
352template <>
struct MappingTraits<DWARFYAML::Unit> {
353 static void mapping(IO &IO, DWARFYAML::Unit &Unit);
356template <>
struct MappingTraits<DWARFYAML::DebugNamesSection> {
357 static void mapping(IO &IO, DWARFYAML::DebugNamesSection &);
359template <>
struct MappingTraits<DWARFYAML::DebugNameEntry> {
360 static void mapping(IO &IO, DWARFYAML::DebugNameEntry &);
362template <>
struct MappingTraits<DWARFYAML::DebugNameAbbreviation> {
363 static void mapping(IO &IO, DWARFYAML::DebugNameAbbreviation &);
365template <>
struct MappingTraits<DWARFYAML::IdxForm> {
366 static void mapping(IO &IO, DWARFYAML::IdxForm &);
369template <>
struct MappingTraits<DWARFYAML::
Entry> {
370 static void mapping(IO &IO, DWARFYAML::Entry &Entry);
373template <>
struct MappingTraits<DWARFYAML::FormValue> {
374 static void mapping(IO &IO, DWARFYAML::FormValue &FormValue);
377template <>
struct MappingTraits<DWARFYAML::
File> {
378 static void mapping(IO &IO, DWARFYAML::File &File);
381template <>
struct MappingTraits<DWARFYAML::LineTableOpcode> {
382 static void mapping(IO &IO, DWARFYAML::LineTableOpcode &LineTableOpcode);
385template <>
struct MappingTraits<DWARFYAML::LineTable> {
386 static void mapping(IO &IO, DWARFYAML::LineTable &LineTable);
389template <>
struct MappingTraits<DWARFYAML::SegAddrPair> {
390 static void mapping(IO &IO, DWARFYAML::SegAddrPair &SegAddrPair);
393template <>
struct MappingTraits<DWARFYAML::DWARFOperation> {
394 static void mapping(IO &IO, DWARFYAML::DWARFOperation &DWARFOperation);
397template <
typename EntryType>
398struct MappingTraits<DWARFYAML::ListTable<EntryType>> {
399 static void mapping(IO &IO, DWARFYAML::ListTable<EntryType> &ListTable);
402template <
typename EntryType>
403struct MappingTraits<DWARFYAML::ListEntries<EntryType>> {
404 static void mapping(IO &IO, DWARFYAML::ListEntries<EntryType> &ListEntries);
406 DWARFYAML::ListEntries<EntryType> &ListEntries);
409template <>
struct MappingTraits<DWARFYAML::RnglistEntry> {
410 static void mapping(IO &IO, DWARFYAML::RnglistEntry &RnglistEntry);
413template <>
struct MappingTraits<DWARFYAML::LoclistEntry> {
414 static void mapping(IO &IO, DWARFYAML::LoclistEntry &LoclistEntry);
417template <>
struct MappingTraits<DWARFYAML::AddrTableEntry> {
418 static void mapping(IO &IO, DWARFYAML::AddrTableEntry &AddrTable);
421template <>
struct MappingTraits<DWARFYAML::StringOffsetsTable> {
422 static void mapping(IO &IO, DWARFYAML::StringOffsetsTable &StrOffsetsTable);
425template <>
struct ScalarEnumerationTraits<dwarf::
DwarfFormat> {
426 static void enumeration(IO &IO, dwarf::DwarfFormat &Format) {
427 IO.enumCase(Format,
"DWARF32", dwarf::DWARF32);
428 IO.enumCase(Format,
"DWARF64", dwarf::DWARF64);
432#define HANDLE_DW_TAG(unused, name, unused2, unused3, unused4) \
433 io.enumCase(value, "DW_TAG_" #name, dwarf::DW_TAG_##name);
435template <>
struct ScalarEnumerationTraits<dwarf::
Tag> {
436 static void enumeration(IO &io, dwarf::Tag &
value) {
437#include "llvm/BinaryFormat/Dwarf.def"
438 io.enumFallback<Hex16>(
value);
442#define HANDLE_DW_LNS(unused, name) \
443 io.enumCase(value, "DW_LNS_" #name, dwarf::DW_LNS_##name);
445template <>
struct ScalarEnumerationTraits<dwarf::
LineNumberOps> {
446 static void enumeration(IO &io, dwarf::LineNumberOps &
value) {
447#include "llvm/BinaryFormat/Dwarf.def"
448 io.enumFallback<Hex8>(
value);
452#define HANDLE_DW_LNE(unused, name) \
453 io.enumCase(value, "DW_LNE_" #name, dwarf::DW_LNE_##name);
456 static void enumeration(IO &io, dwarf::LineNumberExtendedOps &
value) {
457#include "llvm/BinaryFormat/Dwarf.def"
458 io.enumFallback<Hex16>(
value);
462#define HANDLE_DW_AT(unused, name, unused2, unused3) \
463 io.enumCase(value, "DW_AT_" #name, dwarf::DW_AT_##name);
465template <>
struct ScalarEnumerationTraits<dwarf::
Attribute> {
466 static void enumeration(IO &io, dwarf::Attribute &
value) {
467#include "llvm/BinaryFormat/Dwarf.def"
468 io.enumFallback<Hex16>(
value);
472#define HANDLE_DW_FORM(unused, name, unused2, unused3) \
473 io.enumCase(value, "DW_FORM_" #name, dwarf::DW_FORM_##name);
475template <>
struct ScalarEnumerationTraits<dwarf::
Form> {
476 static void enumeration(IO &io, dwarf::Form &
value) {
477#include "llvm/BinaryFormat/Dwarf.def"
478 io.enumFallback<Hex16>(
value);
482#define HANDLE_DW_IDX(unused, name) \
483 io.enumCase(value, "DW_IDX_" #name, dwarf::DW_IDX_##name);
485template <>
struct ScalarEnumerationTraits<dwarf::
Index> {
486 static void enumeration(IO &io, dwarf::Index &
value) {
487#include "llvm/BinaryFormat/Dwarf.def"
488 io.enumFallback<Hex16>(
value);
492#define HANDLE_DW_UT(unused, name) \
493 io.enumCase(value, "DW_UT_" #name, dwarf::DW_UT_##name);
495template <>
struct ScalarEnumerationTraits<dwarf::
UnitType> {
496 static void enumeration(IO &io, dwarf::UnitType &
value) {
497#include "llvm/BinaryFormat/Dwarf.def"
498 io.enumFallback<Hex8>(
value);
502template <>
struct ScalarEnumerationTraits<dwarf::
Constants> {
503 static void enumeration(IO &io, dwarf::Constants &
value) {
504 io.enumCase(
value,
"DW_CHILDREN_no", dwarf::DW_CHILDREN_no);
505 io.enumCase(
value,
"DW_CHILDREN_yes", dwarf::DW_CHILDREN_yes);
506 io.enumFallback<Hex16>(
value);
510#define HANDLE_DW_RLE(unused, name) \
511 io.enumCase(value, "DW_RLE_" #name, dwarf::DW_RLE_##name);
513template <>
struct ScalarEnumerationTraits<dwarf::
RnglistEntries> {
514 static void enumeration(IO &io, dwarf::RnglistEntries &
value) {
515#include "llvm/BinaryFormat/Dwarf.def"
519#define HANDLE_DW_LLE(unused, name) \
520 io.enumCase(value, "DW_LLE_" #name, dwarf::DW_LLE_##name);
522template <>
struct ScalarEnumerationTraits<dwarf::
LoclistEntries> {
523 static void enumeration(IO &io, dwarf::LoclistEntries &
value) {
524#include "llvm/BinaryFormat/Dwarf.def"
528#define HANDLE_DW_OP(id, name, operands, arity, version, vendor) \
529 io.enumCase(value, "DW_OP_" #name, dwarf::DW_OP_##name);
531template <>
struct ScalarEnumerationTraits<dwarf::
LocationAtom> {
532 static void enumeration(IO &io, dwarf::LocationAtom &
value) {
533#include "llvm/BinaryFormat/Dwarf.def"
534 io.enumFallback<yaml::Hex8>(
value);
Given that RA is a live 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)
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.
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.
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
Expected< AbbrevTableInfo > getAbbrevTableInfoByID(uint64_t ID) const
std::optional< PubSection > GNUPubNames
std::optional< std::vector< ARange > > DebugAranges
StringRef getAbbrevTableContentByIndex(uint64_t Index) const
std::optional< PubSection > GNUPubTypes
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
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
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
std::vector< StringRef > IncludeDirs
std::optional< std::vector< uint8_t > > StandardOpcodeLengths
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