class MockFrame

Defined at line 26 of file ../../src/developer/debug/zxdb/client/mock_frame.h

Provides a MockFrame implementation that just returns constant values for everything. Tests can

override this to implement the subset of functionality they need.

Public Methods

void MockFrame (Session * session, Thread * thread, const Location & location, uint64_t sp, uint64_t cfa, std::vector<debug::RegisterValue> regs, uint64_t frame_base, const Frame * physical_frame, bool is_ambiguous_inline)

Session and Thread can be null as long as no code that uses this object needs it.

The physical frame is the non-inlined call frame associated with this one. The pointer must

outlive this class (normally both are owned by the Stack). A null physical frame indicates that

this is not inline.

Defined at line 24 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

void MockFrame (Session * session, Thread * thread, TargetPointer ip, TargetPointer sp, const std::string & func_name, FileLine file_line)

This variant makes a location with a mock function object of the given name and the default

value of everything else. It's usuaully enough for many types of tests. You may pass in a raw

string containing namespaces as in C++ (e.g. "async::Loop::Run" will turn into a parsed

identifier with function name "Run" within two nested namespaces "async" and "Loop".

Defined at line 37 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

void MockFrame (Session * session, Thread * thread, TargetPointer ip, TargetPointer sp, FileLine file_line, std::vector<std::string> absolute_function_name)

This variant is similar to the above, but takes an absolute function name as a vector of

strings, which will mimic the namespace hierarchy of a function. The last element of this

vector is the function name.

Note: Right now all of the strings passed in |absolute_function_name| will create Namespace

symbol objects, except for the final string which is the function name. If we ever require the

function to be nested in a collection/lexical block/etc, this will have to be changed.

Defined at line 55 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

void set_location (Location l)

Use GetLocation() to retrieve the location.

Defined at line 57 of file ../../src/developer/debug/zxdb/client/mock_frame.h

void set_source_file_provider (std::unique_ptr<MockSourceFileProvider> provider)

Defined at line 59 of file ../../src/developer/debug/zxdb/client/mock_frame.h

void ~MockFrame ()

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

void SetAddress (uint64_t address)

Overrides all IPs with a new address, but doesn't change anything else about the location

including the stack or symbols.

Defined at line 65 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

void SetTrust (debug_ipc::StackFrame::Trust trust)

Defined at line 70 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

void set_is_ambiguous_inline (bool ambiguous)

Defined at line 72 of file ../../src/developer/debug/zxdb/client/mock_frame.h

void SetFileLine (const FileLine & file_line)

Overrides the location's file_line with the new value, leaving everything else as-is.

Defined at line 72 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

MockSymbolDataProvider * GetMockSymbolDataProvider ()

Defined at line 77 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

std::unique_ptr<SourceFileProvider> GetSourceFileProvider ()

Defined at line 82 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

Thread * GetThread ()

Frame implementation.

Defined at line 93 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

bool IsInline ()

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

const Frame * GetPhysicalFrame ()

Defined at line 97 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

const Location & GetLocation ()

Defined at line 103 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

uint64_t GetAddress ()

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

debug_ipc::StackFrame::Trust GetTrust ()

Defined at line 105 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

const std::vector<debug::RegisterValue> * GetRegisterCategorySync (debug::RegisterCategory category)

Defined at line 107 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

void GetRegisterCategoryAsync (debug::RegisterCategory category, bool always_request, fit::function<void (const Err &, const std::vector<debug::RegisterValue> &)> cb)

Defined at line 114 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

void WriteRegister (debug::RegisterID id, std::vector<uint8_t> data, fit::callback<void (const Err &)> cb)

Defined at line 128 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

std::optional<uint64_t> GetBasePointer ()

Defined at line 135 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

void GetBasePointerAsync (fit::callback<void (uint64_t)> cb)

Defined at line 137 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

uint64_t GetStackPointer ()

Defined at line 142 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

uint64_t GetCanonicalFrameAddress ()

Defined at line 144 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

fxl::RefPtr<SymbolDataProvider> GetSymbolDataProvider ()

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

fxl::RefPtr<EvalContext> GetEvalContext ()

Defined at line 152 of file ../../src/developer/debug/zxdb/client/mock_frame.cc

bool IsAmbiguousInlineLocation ()

Defined at line 161 of file ../../src/developer/debug/zxdb/client/mock_frame.cc