class MockRemoteAPI

Defined at line 21 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 13 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void ~MockRemoteAPI ()

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

int GetAndResetResumeCount ()

Defined at line 16 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 22 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

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

Sets the register reply for a given category.

Defined at line 26 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 29 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

const debug_ipc::ResumeRequest & last_resume ()

Defined at line 31 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 31 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

void set_thread_status_reply (const debug_ipc::ThreadStatusReply & reply)

Thread status.

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

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

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

int breakpoint_add_count ()

Breakpoints.

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

int breakpoint_remove_count ()

Defined at line 41 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 41 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

const debug_ipc::AddOrChangeBreakpointRequest & last_breakpoint_add ()

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

uint64_t last_breakpoint_id ()

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

uint64_t last_breakpoint_address ()

Defined at line 46 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 51 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

const debug_ipc::WriteRegistersRequest & last_write_registers ()

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

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

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

void set_pause_reply (const debug_ipc::PauseReply & reply)

Sets pause reply.

Defined at line 63 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 66 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 67 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

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

Defined at line 83 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 91 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc

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

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 104 of file ../../src/developer/debug/zxdb/client/mock_remote_api.h

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

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

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

Defined at line 128 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 141 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 151 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 157 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 163 of file ../../src/developer/debug/zxdb/client/mock_remote_api.cc