class TestProcessArgs
Defined at line 27 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
This is a "builder"-style object that collects information to be packed into
the processargs message(s).
Public Methods
TestProcessArgs & AddHandle (uint32_t info, zx::handle handle)
Defined at line 32 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddDuplicateHandle (uint32_t info, zx::unowned_handle ref)
This duplicates the handle.
Defined at line 38 of file ../../sdk/lib/ld/testing/test-processargs.cc
template <typename T>
TestProcessArgs & AddHandle (uint32_t info, T && handle)
These work with any zx::foo type.
Defined at line 39 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
template <typename T>
TestProcessArgs & AddDuplicateHandle (uint32_t info, zx::unowned<T> ref)
Defined at line 44 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
TestProcessArgs & AddFd (int fd, zx::handle handle)
This is just a shorthand for using PA_HND(PA_FD, fd).
Defined at line 44 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddFd (int test_fd, fbl::unique_fd local_fd)
Defined at line 48 of file ../../sdk/lib/ld/testing/test-processargs.cc
template <typename T>
TestProcessArgs & AddFd (int fd, T && handle)
Defined at line 49 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
TestProcessArgs & AddName (std::string_view name, uint32_t info, zx::channel handle)
This adds a name table entry along with a handle of the given PA_NS_* type
using the new entry's index.
Defined at line 54 of file ../../sdk/lib/ld/testing/test-processargs.cc
size_t next_name ()
This returns the index of the entry the next AddName call will append.
Defined at line 56 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
TestProcessArgs & AddName (std::string_view name)
Append one name to the name table.
Defined at line 59 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
TestProcessArgs & AddInProcessTestHandles ()
This calls AddProcess and AddThread.
Defined at line 60 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddProcess (zx::unowned_process process)
These add the handles for the process and initial thread.
Defined at line 64 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddThread (zx::unowned_thread thread)
Defined at line 68 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & SetNames (std::initializer_list<std::string_view> names)
This replaces the entire name table.
Defined at line 69 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
TestProcessArgs & AddLdsvc (zx::channel ldsvc)
Add a fuchsia.ldsvc.Loader channel handle. If this is called with a null
handle, it will clone the calling process's own loader service.
Defined at line 72 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & SetArgs (std::initializer_list<std::string_view> args)
Defined at line 74 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
TestProcessArgs & SetEnv (std::initializer_list<std::string_view> env)
Defined at line 79 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
TestProcessArgs & AddAllocationVmar (zx::vmar vmar)
Add the VMAR to use for allocation and loading.
Defined at line 87 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddAllocationVmar (zx::unowned_vmar vmar)
Defined at line 91 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddSelfVmar (zx::vmar vmar)
Add the VMAR for the dynamic linker's load image.
Defined at line 79 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddSelfVmar (zx::unowned_vmar vmar)
Defined at line 83 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddExecutableVmo (zx::vmo vmo)
Add the VMO for the executable.
Defined at line 95 of file ../../sdk/lib/ld/testing/test-processargs.cc
TestProcessArgs & AddStackVmo (zx::vmo vmo)
Add the VMO for the initial stack.
Defined at line 99 of file ../../sdk/lib/ld/testing/test-processargs.cc
void PackBootstrap (zx::unowned_channel bootstrap_sender)
This packs up a message and sends it on the given channel. When this
returns without raising a gtest fatal failure, the state of the object is
cleared out so it it could be used for another call.
Defined at line 103 of file ../../sdk/lib/ld/testing/test-processargs.cc
zx::channel & bootstrap_sender ()
Access the sender channel if one was created by PackBootstrap.
Defined at line 124 of file ../../sdk/lib/ld/testing/include/lib/ld/testing/test-processargs.h
zx::channel PackBootstrap ()
This creates a new channel and returns the receiver end to be passed to
the new process. Before returning, it sends a bootstrap message on the
sender side of the channel and clears the builder state. The sender side
of the channel is retained in this object. If this is called again when a
channel already exists, it sends a second message on that same channel; in
that case it always returns a null handle. If anything went wrong, this
raises a gtest fatal failure.
Defined at line 197 of file ../../sdk/lib/ld/testing/test-processargs.cc
std::optional<size_t> GetStackSize ()
This returns the stack size to use for the initial thread,
if the bootstrap protocol wants to control that.
Defined at line 107 of file ../../sdk/lib/ld/testing/test-processargs.cc