class DirectMemory

Defined at line 287 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

This does direct memory access to an ELF load image already mapped in.

Addresses in the ELF metadata are relative to a given base address that

corresponds to the beginning of the image this object points to.

Public Methods

void DirectMemory ()

Defined at line 289 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void DirectMemory (const DirectMemory & )

The Memory API is always used by lvalue reference, so Memory objects don't

need to be either copyable or movable. But DirectMemory is really just a

pointer holder, so it can be easily copied.

Defined at line 294 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void DirectMemory (std::span<std::byte> image, uintptr_t base)

This takes a memory image and the file-relative address it corresponds to.

The one-argument form can be used to use the File API before the base is

known. Then set_base must be called before using the Memory API.

Defined at line 299 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void DirectMemory (std::span<std::byte> image, uintptr_t base)

This takes a memory image and the file-relative address it corresponds to.

The one-argument form can be used to use the File API before the base is

known. Then set_base must be called before using the Memory API.

Defined at line 299 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void DirectMemory (std::span<std::byte> image, uintptr_t base)

This takes a memory image and the file-relative address it corresponds to.

The one-argument form can be used to use the File API before the base is

known. Then set_base must be called before using the Memory API.

Defined at line 299 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void DirectMemory (std::span<std::byte> image, uintptr_t base)

This takes a memory image and the file-relative address it corresponds to.

The one-argument form can be used to use the File API before the base is

known. Then set_base must be called before using the Memory API.

Defined at line 299 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void DirectMemory (std::span<std::byte> image, uintptr_t base)

This takes a memory image and the file-relative address it corresponds to.

The one-argument form can be used to use the File API before the base is

known. Then set_base must be called before using the Memory API.

Defined at line 299 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

DirectMemory & operator= (const DirectMemory & )

Defined at line 302 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

std::span<std::byte> image ()

Defined at line 304 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void set_image (std::span<std::byte> image)

Defined at line 305 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void set_image (std::span<std::byte> image)

Defined at line 305 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void set_image (std::span<std::byte> image)

Defined at line 305 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void set_image (std::span<std::byte> image)

Defined at line 305 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void set_image (std::span<std::byte> image)

Defined at line 305 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

uintptr_t base ()

Defined at line 307 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void set_base (uintptr_t base)

Defined at line 308 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void set_base (uintptr_t base)

Defined at line 308 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

void set_base (uintptr_t base)

Defined at line 308 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
T * GetPointer (uintptr_t ptr)

This returns an address in memory for an address in the loaded ELF file.

Defined at line 312 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
T * GetPointer (uintptr_t ptr)

This returns an address in memory for an address in the loaded ELF file.

Defined at line 312 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
T * GetPointer (uintptr_t ptr)

This returns an address in memory for an address in the loaded ELF file.

Defined at line 312 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (std::span<const T> data)

Given a an address range previously handed out by GetPointer,

ReadArrayFromFile, or ReadArray, yield the address value that

must have been passed to ReadArray et al.

Defined at line 324 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (std::span<const T> data)

Given a an address range previously handed out by GetPointer,

ReadArrayFromFile, or ReadArray, yield the address value that

must have been passed to ReadArray et al.

Defined at line 324 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (std::span<const T> data)

Given a an address range previously handed out by GetPointer,

ReadArrayFromFile, or ReadArray, yield the address value that

must have been passed to ReadArray et al.

Defined at line 324 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (std::span<const T> data)

Given a an address range previously handed out by GetPointer,

ReadArrayFromFile, or ReadArray, yield the address value that

must have been passed to ReadArray et al.

Defined at line 324 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (std::span<const T> data)

Given a an address range previously handed out by GetPointer,

ReadArrayFromFile, or ReadArray, yield the address value that

must have been passed to ReadArray et al.

Defined at line 324 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (const T * ptr)

Defined at line 337 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (const T * ptr)

Defined at line 337 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (const T * ptr)

Defined at line 337 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (const T * ptr)

Defined at line 337 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<uintptr_t> GetVaddr (const T * ptr)

Defined at line 337 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::reference_wrapper<const T>> ReadFromFile (size_t offset)

File API assumes this file's first segment has page-aligned p_offset of 0.

Defined at line 344 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::reference_wrapper<const T>> ReadFromFile (size_t offset)

File API assumes this file's first segment has page-aligned p_offset of 0.

Defined at line 344 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::reference_wrapper<const T>> ReadFromFile (size_t offset)

File API assumes this file's first segment has page-aligned p_offset of 0.

Defined at line 344 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::reference_wrapper<const T>> ReadFromFile (size_t offset)

File API assumes this file's first segment has page-aligned p_offset of 0.

Defined at line 344 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::reference_wrapper<const T>> ReadFromFile (size_t offset)

File API assumes this file's first segment has page-aligned p_offset of 0.

Defined at line 344 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename Allocator>
std::optional<std::span<const T>> ReadArrayFromFile (size_t offset, Allocator && allocator, size_t count)

Defined at line 356 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename Allocator>
std::optional<std::span<const T>> ReadArrayFromFile (size_t offset, Allocator && allocator, size_t count)

Defined at line 356 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename Allocator>
std::optional<std::span<const T>> ReadArrayFromFile (size_t offset, Allocator && allocator, size_t count)

Defined at line 356 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename Allocator>
std::optional<std::span<const T>> ReadArrayFromFile (size_t offset, Allocator && allocator, size_t count)

Defined at line 356 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename Allocator>
std::optional<std::span<const T>> ReadArrayFromFile (size_t offset, Allocator && allocator, size_t count)

Defined at line 356 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr, size_t count)

Memory API assumes the image represents the PT_LOAD segment layout of the

file by p_vaddr relative to the base address (not the raw file image by

p_offset).

Defined at line 370 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr, size_t count)

Memory API assumes the image represents the PT_LOAD segment layout of the

file by p_vaddr relative to the base address (not the raw file image by

p_offset).

Defined at line 370 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr, size_t count)

Memory API assumes the image represents the PT_LOAD segment layout of the

file by p_vaddr relative to the base address (not the raw file image by

p_offset).

Defined at line 370 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr, size_t count)

Memory API assumes the image represents the PT_LOAD segment layout of the

file by p_vaddr relative to the base address (not the raw file image by

p_offset).

Defined at line 370 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr, size_t count)

Memory API assumes the image represents the PT_LOAD segment layout of the

file by p_vaddr relative to the base address (not the raw file image by

p_offset).

Defined at line 370 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr)

Defined at line 378 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr)

Defined at line 378 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr)

Defined at line 378 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr)

Defined at line 378 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T>
std::optional<std::span<const T>> ReadArray (uintptr_t ptr)

Defined at line 378 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename U>
bool Store (uintptr_t ptr, U value)

Note the argument is not of type T so that T can never be deduced from the

argument: the caller must use Store

<T

> explicitly to avoid accidentally

using the wrong type since lots of integer types are silently coercible to

other ones. (The caller doesn't need to supply the U template parameter.)

Defined at line 394 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename U>
bool Store (uintptr_t ptr, U value)

Note the argument is not of type T so that T can never be deduced from the

argument: the caller must use Store

<T

> explicitly to avoid accidentally

using the wrong type since lots of integer types are silently coercible to

other ones. (The caller doesn't need to supply the U template parameter.)

Defined at line 394 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename U>
bool Store (uintptr_t ptr, U value)

Note the argument is not of type T so that T can never be deduced from the

argument: the caller must use Store

<T

> explicitly to avoid accidentally

using the wrong type since lots of integer types are silently coercible to

other ones. (The caller doesn't need to supply the U template parameter.)

Defined at line 394 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename U>
bool StoreAdd (uintptr_t ptr, U value)

Note the argument is not of type T so that T can never be deduced from the

argument: the caller must use Store

<T

> explicitly to avoid accidentally

using the wrong type since lots of integer types are silently coercible to

other ones. (The caller doesn't need to supply the U template parameter.)

Defined at line 407 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename U>
bool StoreAdd (uintptr_t ptr, U value)

Note the argument is not of type T so that T can never be deduced from the

argument: the caller must use Store

<T

> explicitly to avoid accidentally

using the wrong type since lots of integer types are silently coercible to

other ones. (The caller doesn't need to supply the U template parameter.)

Defined at line 407 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h

template <typename T, typename U>
bool StoreAdd (uintptr_t ptr, U value)

Note the argument is not of type T so that T can never be deduced from the

argument: the caller must use Store

<T

> explicitly to avoid accidentally

using the wrong type since lots of integer types are silently coercible to

other ones. (The caller doesn't need to supply the U template parameter.)

Defined at line 407 of file ../../src/lib/elfldltl/include/lib/elfldltl/memory.h