struct CfiEntry
Defined at line 143 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
Public Methods
template <class Elf = Elf<>, class Diagnostics, typename... ErrorArgs>
std::optional<CfiEntry> Read (Diagnostics & diag, std::span<const std::byte> bytes, ErrorArgs &&... error_args)
Read a single CFI entry (either CIE or FDE) from the byte stream.
Failures will be sent to the diagnostics object with any error_args
appended to the basic details in the FormatError call. The Elf template
parameter indicates the byte order.
Defined at line 150 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
void NormalizeEhFrame (uint64_t vaddr)
After Read yields an entry from .eh_frame, normalize it to standard DWARF
CFI format as used in .debug_frame. The argument must be the virtual
address that corresponds to the beginning of the buffer passed to Read.
Defined at line 183 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
template <class Elf = Elf<>, class Diagnostics, typename... ErrorArgs>
std::optional<CfiEntry> ReadEhFrame (Diagnostics & diag, std::span<const std::byte> bytes, typename Elf::size_type vaddr, ErrorArgs &&... error_args)
Like Read, but with NormalizeEhFrame applied to the results.
Defined at line 207 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
template <class Elf = Elf<>, class Diagnostics, typename... ErrorArgs, auto& memory>
std::optional<CfiEntry> ReadEhFrameFromMemory (Diagnostics & diag, MemoryReader<typename Elf::size_type, std::byte> auto & memory, typename Elf::size_type vaddr, ErrorArgs &&... error_args)
This does ReadEhFrame, but using a Memory object to read the FDE at vaddr.
The error_args do not need to include reporting the FDE vaddr passed here.
Defined at line 220 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
size_t size_bytes ()
Defined at line 233 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
bool IsCie ()
Returns true if this is a CIE, false if it's an FDE.
Defined at line 236 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
std::optional<uint64_t> cie_pointer ()
Returns std::nullopt for a CIE, or the CIE pointer for an FDE.
Defined at line 239 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
template <class Elf = Elf<>, class Diagnostics, typename... ErrorArgs, auto& memory>
std::optional<CfiEntry> ReadEhFrameCieFromMemory (Diagnostics & diag, MemoryReader<typename Elf::size_type, std::byte> auto & memory, ErrorArgs &&... error_args)
Read the CIE referenced by this FDE. The Memory object is used to read
from virtual addresses in the same address space used in NormalizeEhFrame
on this object.
Defined at line 250 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
template <class Elf = Elf<>, class Diagnostics, typename... ErrorArgs>
std::optional<CfiCie> DecodeCie (Diagnostics & diag, uint64_t vaddr, ErrorArgs &&... error_args)
Decode a CIE into the internal form described above. The vaddr should be
that of the CIE itself if in .eh_frame format, where "PC-relative"
encodings might be used. The error_args do not need to include reporting
the CIE vaddr passed here.
Defined at line 283 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h
template <class Elf = Elf<>, class Diagnostics, typename... ErrorArgs>
std::optional<CfiFde> DecodeFde (Diagnostics & diag, uint64_t vaddr, const CfiCie & cie, ErrorArgs &&... error_args)
Decode an FDE into the internal form described above, after the CIE it
points to has already been decoded. The vaddr should be that of the FDE
itself if in .eh_frame format, where "PC-relative" encodings might be
used. The error_args do not need to include reporting the FDE vaddr passed
here.
Defined at line 496 of file ../../src/lib/elfldltl/include/lib/elfldltl/dwarf/cfi-entry.h