9#include "../microfmt.hpp"
31using memory_reader_fn_t = size_t (*)(
void *ctx, uintptr_t src_addr, uint8_t *dst_buf,
size_t max_len)
noexcept;
38 uintptr_t base_addr{0};
39 span<const uint8_t> direct_data{};
40 void *reader_ctx{
nullptr};
43 uint8_t bytes_per_line{16};
44 bool show_ascii{
true};
45 bool show_address{
true};
46 bool uppercase{
false};
53 uint8_t bytes_per_line = 16,
bool show_ascii =
true) noexcept {
55 nullptr, data.size(), bytes_per_line == 0 ?
static_cast<uint8_t
>(16) : bytes_per_line,
56 show_ascii,
true,
false};
63RELOCO_BEGIN_UNSAFE_CODE
65 void *ctx =
nullptr, uint8_t bytes_per_line = 16,
66 bool show_ascii =
true) noexcept {
68 reader, total_len, bytes_per_line == 0 ?
static_cast<uint8_t
>(16) : bytes_per_line,
69 show_ascii,
true,
false};
92#if MICROFMT_SHARED_PROVIDE_DEFINITIONS
101 uint8_t line_buffer[32] = {};
106inline void hexdump_to(
const sink &out, span<const uint8_t> data, uintptr_t base_address = 0) noexcept {
108 f.format(
hexdump(data, base_address), out);
Definition microfmt.hpp:881
#define MICROFMT_API_CLASS
Definition compat.hpp:181
#define MICROFMT_API
Definition compat.hpp:135
void hexdump_to(const sink &out, span< const uint8_t > data, uintptr_t base_address=0) noexcept
Definition hexdump.hpp:106
reloco::sink sink
Type-erased, zero-allocation output sink.
Definition microfmt.hpp:46
RELOCO_BEGIN_UNSAFE_CODE constexpr hexdump_view hexdump_checked(uintptr_t base_addr, size_t total_len, memory_reader_fn_t reader, void *ctx=nullptr, uint8_t bytes_per_line=16, bool show_ascii=true) noexcept
Helper for dumping memory via a fault-checked accessor probe.
Definition hexdump.hpp:64
RELOCO_END_UNSAFE_CODE MICROFMT_API void format_hexdump(const hexdump_view &h, span< uint8_t > line_buffer, const sink &out) noexcept
Formats a hex dump using caller-provided line storage.
constexpr hexdump_view hexdump(span< const uint8_t > data, uintptr_t base_addr=0, uint8_t bytes_per_line=16, bool show_ascii=true) noexcept
Helper for dumping safe, direct in-memory buffers (zero overhead).
Definition hexdump.hpp:52
size_t(*)(void *ctx, uintptr_t src_addr, uint8_t *dst_buf, size_t max_len) noexcept memory_reader_fn_t
Function signature for a safe/probed memory reader.
Definition hexdump.hpp:31
RELOCO_END_UNSAFE_CODE
Definition remote_object.hpp:132
Definition hexdump.hpp:37