class MockRemoteAPI

Defined at line 24 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

A mock for RemoteAPI that saves messages and sends replies.

Not all of the messages are handled here. Only the ones that are needed by the tests that use

this mock are necessary. The default implementation of RemoteAPI will assert for calls that

aren't overridden, so if you get one you should implement it here.

Public Methods

void MockRemoteAPI ()

Defined at line 17 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void ~MockRemoteAPI ()

Defined at line 18 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

int GetAndResetResumeCount ()

Defined at line 20 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void AddMemory (uint64_t address, std::vector<uint8_t> data)

Sets a memory value that will be returned when requested.

Defined at line 26 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

const std::optional<debug_ipc::AttachRequest> & last_attach ()

Attach.

Defined at line 30 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void SetRegisterCategory (debug::RegisterCategory cat, std::vector<debug::RegisterValue> regs)

Sets the register reply for a given category.

Defined at line 30 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void set_resume_quits_loop (bool quit)

Resume. By default Resume() counts the number of calls, but many tests also want to opt-in to

an implicit MessageLoop exit when this happens so they can continue testing from after the IPC

message is sent.

Defined at line 35 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void Attach (const debug_ipc::AttachRequest & request, fit::callback<void (const Err &, debug_ipc::AttachReply)> cb)

RemoteAPI implementation.

Defined at line 35 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

const debug_ipc::ResumeRequest & last_resume ()

Defined at line 37 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void set_thread_status_reply (const debug_ipc::ThreadStatusReply & reply)

Thread status.

Defined at line 40 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

const std::optional<debug_ipc::ThreadStatusReply> & thread_status_reply ()

Defined at line 43 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void AddOrChangeBreakpoint (const debug_ipc::AddOrChangeBreakpointRequest & request, fit::callback<void (const Err &, debug_ipc::AddOrChangeBreakpointReply)> cb)

Defined at line 46 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

int breakpoint_add_count ()

Breakpoints.

Defined at line 48 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

int breakpoint_remove_count ()

Defined at line 49 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

const debug_ipc::AddOrChangeBreakpointRequest & last_breakpoint_add ()

Defined at line 50 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

uint64_t last_breakpoint_id ()

Defined at line 53 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

uint64_t last_breakpoint_address ()

Defined at line 54 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void AddressSpace (const debug_ipc::AddressSpaceRequest & request, fit::callback<void (const Err &, debug_ipc::AddressSpaceReply)> cb)

Defined at line 56 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void RemoveBreakpoint (const debug_ipc::RemoveBreakpointRequest & request, fit::callback<void (const Err &, debug_ipc::RemoveBreakpointReply)> cb)

Defined at line 63 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

size_t read_memory_count ()

Defined at line 64 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

uint64_t read_memory_total_bytes ()

Defined at line 65 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

const std::vector<debug_ipc::ReadMemoryRequest> & read_memory_requests ()

Defined at line 66 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void ResetReadMemoryMetrics ()

Defined at line 69 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void ThreadStatus (const debug_ipc::ThreadStatusRequest & request, fit::callback<void (const Err &, debug_ipc::ThreadStatusReply)> cb)

Defined at line 71 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

const debug_ipc::WriteRegistersRequest & last_write_registers ()

Defined at line 77 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void set_pause_reply (const debug_ipc::PauseReply & reply)

Sets pause reply.

Defined at line 82 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void set_address_space_reply (const debug_ipc::AddressSpaceReply & reply)

Sets AddressSpace reply.

Defined at line 85 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void Pause (const debug_ipc::PauseRequest & request, fit::callback<void (const Err &, debug_ipc::PauseReply)> cb)

Defined at line 87 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void Resume (const debug_ipc::ResumeRequest & request, fit::callback<void (const Err &, debug_ipc::ResumeReply)> cb)

Defined at line 95 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void ReadMemory (const debug_ipc::ReadMemoryRequest & request, fit::callback<void (const Err &, debug_ipc::ReadMemoryReply)> cb)

Defined at line 109 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void Threads (const debug_ipc::ThreadsRequest & , fit::callback<void (const Err &, debug_ipc::ThreadsReply)> )

No-op for now.

TODO(donosoc): The client will detect underlying exceptions by analyzing the threads it

receives upon process attaching, so this will be filled then.

Currently we need this to not assert existing tests.

Defined at line 123 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

void ReadRegisters (const debug_ipc::ReadRegistersRequest & request, fit::callback<void (const Err &, debug_ipc::ReadRegistersReply)> cb)

Defined at line 133 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void WriteRegisters (const debug_ipc::WriteRegistersRequest & request, fit::callback<void (const Err &, debug_ipc::WriteRegistersReply)> cb)

Defined at line 146 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void Detach (const debug_ipc::DetachRequest & request, fit::callback<void (const Err &, debug_ipc::DetachReply)> cb)

Defined at line 156 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void Kill (const debug_ipc::KillRequest & request, fit::callback<void (const Err &, debug_ipc::KillReply)> cb)

Defined at line 162 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void Modules (const debug_ipc::ModulesRequest & request, fit::callback<void (const Err &, debug_ipc::ModulesReply)> cb)

Defined at line 168 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc