class Process
Defined at line 462 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
A Process is a Task and also has threads and memory.
Public Methods
uint64_t dump_page_size ()
Return the size of memory pages in this process, always a power of two.
For a live process, this returns zx_system_get_page_size(). In a dump,
it's determined from the PT_LOAD segments found (even if the dump elides
the actual memory). If the dump had no memory segments and no system
information to indicate the page size post mortem, this is 1 to maintain
the power-of-two invariant.
Defined at line 476 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
elfldltl::ElfMachine dump_machine ()
Return the machine architecture of this process.
In a dump, it's determined by the ELF file header.
Defined at line 480 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
void ~Process ()
Defined at line 812 of file ../../src/lib/zxdump/read.cc
fit::result<Error, std::reference_wrapper<ThreadMap>> threads ()
This is the same as what you'd get from get_info
<ZX
_INFO_PROCESS_THREADS>
and then get_child on each KOID, but pre-cached. Note the returned map is
not const so the Thread references can be non-const, but the caller must
not modify the map itself.
Defined at line 826 of file ../../src/lib/zxdump/read.cc
fit::result<Error, std::reference_wrapper<Task>> find (zx_koid_t koid)
Find a task by KOID: this process or one of its threads.
Defined at line 247 of file ../../src/lib/zxdump/task.cc
template <typename T = std::byte, class View = std::span<const T>>
fit::result<Error, Buffer<T, View>> read_memory (uint64_t vaddr, size_t count, ReadMemorySize size_mode)
Read process memory at the given vaddr. This tries to read at least count
contiguous elements of type T, and succeeds if that was valid memory of
type T in the process. The optional size_mode argument can permit it to
return a buffer with more or less data than the exact size requested; see
the enum definition above for details. In all modes it can return an
empty buffer if the memory was elided from the dump. The success return
value is a move-only type; see
<zxdump
/buffer.h> for full details.
Defined at line 502 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
template <typename T>
fit::result<Error, T> read_memory (uint64_t vaddr)
This just reads a single datum of type T from dumped process memory at
vaddr, and simply returns it by value.
Defined at line 532 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
fit::result<Error, std::string> read_memory_string (uint64_t vaddr, size_t limit)
Convenience function to read a C-style NUL-terminated string, while
reading no more than limit chars total. No string is returned if no NUL
terminator is found, but the std::string returned does not include the NUL
terminator in its size() value (though of course its c_str() value is
NUL-terminated). If the memory is accessible but no NUL terminator is
found before the size limit is reached, the error result will use
ZX_ERR_OUT_OF_RANGE. If the necessary memory was simply elided from the
dump, the error result will use ZX_ERR_NOT_SUPPORTED.
Defined at line 555 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
fit::result<Error, std::u8string> read_memory_u8string (uint64_t vaddr, size_t limit)
The same thing is provided in u8string, u16string, u32string, and wstring
variants.
Defined at line 563 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
fit::result<Error, std::u16string> read_memory_u16string (uint64_t vaddr, size_t limit)
Defined at line 569 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
fit::result<Error, std::u32string> read_memory_u32string (uint64_t vaddr, size_t limit)
Defined at line 575 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
fit::result<Error, std::wstring> read_memory_wstring (uint64_t vaddr, size_t limit)
Defined at line 581 of file ../../src/lib/zxdump/include/lib/zxdump/task.h
fit::result<Error, std::reference_wrapper<Thread>> get_child (zx_koid_t koid)
zxdump::Object::get_child actually just dispatches to this method.
Defined at line 1570 of file ../../src/lib/zxdump/read.cc
Friends
class TaskHolder