LLVM 22.0.0git
DWARFEmitter.cpp File Reference

The DWARF component of yaml2obj. More...

#include "llvm/ObjectYAML/DWARFEmitter.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/ObjectYAML/DWARFYAML.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/SwapByteOrder.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Host.h"
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <vector>

Go to the source code of this file.

Functions

template<typename T>
static void writeInteger (T Integer, raw_ostream &OS, bool IsLittleEndian)
static Error writeVariableSizedInteger (uint64_t Integer, size_t Size, raw_ostream &OS, bool IsLittleEndian)
static void ZeroFillBytes (raw_ostream &OS, size_t Size)
static void writeInitialLength (const dwarf::DwarfFormat Format, const uint64_t Length, raw_ostream &OS, bool IsLittleEndian)
static void writeDWARFOffset (uint64_t Offset, dwarf::DwarfFormat Format, raw_ostream &OS, bool IsLittleEndian)
static Error emitPubSection (raw_ostream &OS, const DWARFYAML::PubSection &Sect, bool IsLittleEndian, bool IsGNUPubSec=false)
static Expected< uint64_twriteDIE (const DWARFYAML::Data &DI, uint64_t CUIndex, uint64_t AbbrevTableID, const dwarf::FormParams &Params, const DWARFYAML::Entry &Entry, raw_ostream &OS, bool IsLittleEndian)
static void emitFileEntry (raw_ostream &OS, const DWARFYAML::File &File)
static void writeExtendedOpcode (const DWARFYAML::LineTableOpcode &Op, uint8_t AddrSize, bool IsLittleEndian, raw_ostream &OS)
static void writeLineTableOpcode (const DWARFYAML::LineTableOpcode &Op, uint8_t OpcodeBase, uint8_t AddrSize, raw_ostream &OS, bool IsLittleEndian)
static std::vector< uint8_tgetStandardOpcodeLengths (uint16_t Version, std::optional< uint8_t > OpcodeBase)
static Error checkOperandCount (StringRef EncodingString, ArrayRef< yaml::Hex64 > Values, uint64_t ExpectedOperands)
static Error writeListEntryAddress (StringRef EncodingName, raw_ostream &OS, uint64_t Addr, uint8_t AddrSize, bool IsLittleEndian)
static Expected< uint64_twriteDWARFExpression (raw_ostream &OS, const DWARFYAML::DWARFOperation &Operation, uint8_t AddrSize, bool IsLittleEndian)
static Expected< uint64_twriteListEntry (raw_ostream &OS, const DWARFYAML::RnglistEntry &Entry, uint8_t AddrSize, bool IsLittleEndian)
static Expected< uint64_twriteListEntry (raw_ostream &OS, const DWARFYAML::LoclistEntry &Entry, uint8_t AddrSize, bool IsLittleEndian)
template<typename EntryType>
static Error writeDWARFLists (raw_ostream &OS, ArrayRef< DWARFYAML::ListTable< EntryType > > Tables, bool IsLittleEndian, bool Is64BitAddrSize)
static Error emitDebugSectionImpl (const DWARFYAML::Data &DI, StringRef Sec, StringMap< std::unique_ptr< MemoryBuffer > > &OutputBuffers)

Detailed Description

The DWARF component of yaml2obj.

Provided as library code for tests.

Definition in file DWARFEmitter.cpp.

Function Documentation

◆ checkOperandCount()

Error checkOperandCount ( StringRef EncodingString,
ArrayRef< yaml::Hex64 > Values,
uint64_t ExpectedOperands )
static

◆ emitDebugSectionImpl()

◆ emitFileEntry()

void emitFileEntry ( raw_ostream & OS,
const DWARFYAML::File & File )
static

◆ emitPubSection()

◆ getStandardOpcodeLengths()

std::vector< uint8_t > getStandardOpcodeLengths ( uint16_t Version,
std::optional< uint8_t > OpcodeBase )
static

Definition at line 583 of file DWARFEmitter.cpp.

Referenced by llvm::DWARFYAML::emitDebugLine().

◆ writeDIE()

◆ writeDWARFExpression()

◆ writeDWARFLists()

◆ writeDWARFOffset()

◆ writeExtendedOpcode()

void writeExtendedOpcode ( const DWARFYAML::LineTableOpcode & Op,
uint8_t AddrSize,
bool IsLittleEndian,
raw_ostream & OS )
static

◆ writeInitialLength()

◆ writeInteger()

◆ writeLineTableOpcode()

void writeLineTableOpcode ( const DWARFYAML::LineTableOpcode & Op,
uint8_t OpcodeBase,
uint8_t AddrSize,
raw_ostream & OS,
bool IsLittleEndian )
static

◆ writeListEntry() [1/2]

◆ writeListEntry() [2/2]

◆ writeListEntryAddress()

Error writeListEntryAddress ( StringRef EncodingName,
raw_ostream & OS,
uint64_t Addr,
uint8_t AddrSize,
bool IsLittleEndian )
static

◆ writeVariableSizedInteger()

◆ ZeroFillBytes()

void ZeroFillBytes ( raw_ostream & OS,
size_t Size )
static