class Object

Defined at line 234 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

Forward declarations for below.

Public Methods

zx_koid_t koid ()

Every task has a KOID. This is just shorthand for extracting it from

ZX_INFO_HANDLE_BASIC. The fake root job returns zero (ZX_KOID_INVALID).

Defined at line 90 of file ../../src/lib/zxdump/task.cc

zx_obj_type_t type ()

The only objects on which get_info

<ZX

_INFO_HANDLE_BASIC> can fail are the

fake root job and the fake root resource; type() on those returns zero

(ZX_OBJ_TYPE_NONE).

Defined at line 92 of file ../../src/lib/zxdump/task.cc

fit::result<Error, std::reference_wrapper<Object>> get_child (zx_koid_t koid)

This is provided for parity with zx::object::get_child, but just using

Process::threads, Job::children, or Job::processes is much more convenient

for iterating through the lists reported by get_info. However, on live

tasks either get_child or find to reach specific known KOIDs can be much

more efficient than accessing the one of the child-list methods, which

will acquire all the child handles implicitly, not just the matching one.

**Notes for live objects:** Unlike zx::object::get_child, this does not

take a zx_rights_t parameter even when referring to a live object.

Instead, it always requests the full suite of rights that are necessary to

do get_info, get_property, read_memory, read_state, etc.--everything the

dumper usually needs. There is only ever a single Object for each KOID,

so returning live object handle with lesser rights once would mean later

calls couldn't use greater rights on the same KOID later.

Defined at line 209 of file ../../src/lib/zxdump/task.cc

fit::result<Error, std::reference_wrapper<Object>> find (zx_koid_t koid)

Find a task by KOID: this task or a descendent task.

Defined at line 234 of file ../../src/lib/zxdump/task.cc

fit::result<Error, ByteView> get_info (zx_object_info_topic_t topic, bool refresh_live, size_t record_size)

This gets the full info block for this topic, whatever its size. Note the

data is not necessarily aligned in memory, so it can't be safely accessed

with reinterpret_cast.

**Notes for live objects:** When called on a live object, this ordinarily

gets each topic just once and then returns the cached value; the optional

refresh_live flag says to ignore any cached data and always get fresh data

now (which will be cached for later calls without the flag). Note that a

failed call with refresh_live will *not* remove old cached data, so it

might be retrieved by calling again without the flag even if something

prevents getting new info.

Defined at line 96 of file ../../src/lib/zxdump/task.cc

fit::result<Error, ByteView> get_property (uint32_t property)

This gets the property, whatever its size. Note the data is not

necessarily aligned in memory, so it can't be safely accessed with

reinterpret_cast.

Defined at line 146 of file ../../src/lib/zxdump/task.cc

void Object (const Object & )

None of the Object types can be constructed in any way.

They are only used via references returned by the owning TaskHolder.

Defined at line 238 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

void Object (TaskHolder::JobTree & tree, LiveHandle live)

The subclass constructors need to be public so that they can be called by

the std::optional and std::map emplace methods, but they are intended as

private so none of these objects can exist outside the TaskHolder. Since

the JobTree

&

is a required argument in the subclass constructors and the

class is private, outside code cannot construct new objects.

Defined at line 245 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

void Object (TaskHolder::JobTree & tree, LiveHandle live)

The subclass constructors need to be public so that they can be called by

the std::optional and std::map emplace methods, but they are intended as

private so none of these objects can exist outside the TaskHolder. Since

the JobTree

&

is a required argument in the subclass constructors and the

class is private, outside code cannot construct new objects.

Defined at line 245 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

fit::result<Error> wait_many (WaitItemVector & wait_items)

Defined at line 255 of file ../../src/lib/zxdump/task.cc

time_t date ()

This returns the timestamp of the dump, which may be zero.

Defined at line 272 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

template <zx_object_info_topic_t Topic>
fit::result<Error, InfoTraitsType<Topic>> get_info (bool refresh_live)

Get statically-typed info for a topic chosen at a compile time. Some

types return a single `zx_info_*_t` object. Others return a span of const

type that points into storage permanently cached for the lifetime of the

containing TaskHolder. See

<lib

/zxdump/types.h> for topic->type mappings.

Defined at line 312 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

template <uint32_t Property>
fit::result<Error, PropertyTraitsType<Property>> get_property ()

Get a statically-typed property chosen at compile time.

See

<lib

/zxdump/types.h> for property->type mappings.

Defined at line 347 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

bool is_live ()

Defined at line 363 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

const std::vector<std::pair<std::string_view, ByteView>> & remarks ()

A job or process can have dump remarks, stored as a vector of {name, data}

pairs.

Defined at line 370 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

Resource & info_resource ()

As a convenience, TaskHolder::info_resource() is proxied by every Object.

Defined at line 796 of file ../../src/lib/zxdump/read.cc

Protected Methods

void Object ()

The class is abstract. Only the subclasses can be created and destroyed.

Defined at line 374 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

void Object (Object && )

Move construction and assignment are only used during initial creation.

Defined at line 377 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

Object & operator= (Object && )

Defined at line 378 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

LiveHandle & live ()

Defined at line 382 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

TaskHolder::JobTree & tree ()

Defined at line 384 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

bool empty ()

Defined at line 386 of file ../../src/lib/zxdump/include/lib/zxdump/task.h

void ~Object ()

Defined at line 806 of file ../../src/lib/zxdump/read.cc

std::byte * GetBuffer (size_t size)

Defined at line 830 of file ../../src/lib/zxdump/read.cc

void TakeBuffer (std::unique_ptr<std::byte[]> buffer)

Defined at line 832 of file ../../src/lib/zxdump/read.cc

Records

Friends

class JobTree