class MockFrame
Defined at line 23 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 20 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 33 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 51 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
void set_location (Location l)
Use GetLocation() to retrieve the location.
Defined at line 54 of file ../../src/developer/debug/zxdb/client/mock_frame.h
void ~MockFrame ()
Defined at line 59 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 61 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
void set_is_ambiguous_inline (bool ambiguous)
Defined at line 65 of file ../../src/developer/debug/zxdb/client/mock_frame.h
void SetTrust (debug_ipc::StackFrame::Trust trust)
Defined at line 66 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
void SetFileLine (const FileLine & file_line)
Overrides the location's file_line with the new value, leaving everything else as-is.
Defined at line 68 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
MockSymbolDataProvider * GetMockSymbolDataProvider ()
Defined at line 73 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
Thread * GetThread ()
Frame implementation.
Defined at line 78 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
bool IsInline ()
Defined at line 80 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
const Frame * GetPhysicalFrame ()
Defined at line 82 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
const Location & GetLocation ()
Defined at line 88 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
uint64_t GetAddress ()
Defined at line 89 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
debug_ipc::StackFrame::Trust GetTrust ()
Defined at line 90 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
const std::vector<debug::RegisterValue> * GetRegisterCategorySync (debug::RegisterCategory category)
Defined at line 92 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 99 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 113 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
std::optional<uint64_t> GetBasePointer ()
Defined at line 120 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
void GetBasePointerAsync (fit::callback<void (uint64_t)> cb)
Defined at line 122 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
uint64_t GetStackPointer ()
Defined at line 127 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
uint64_t GetCanonicalFrameAddress ()
Defined at line 129 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
fxl::RefPtr<SymbolDataProvider> GetSymbolDataProvider ()
Defined at line 131 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
fxl::RefPtr<EvalContext> GetEvalContext ()
Defined at line 137 of file ../../src/developer/debug/zxdb/client/mock_frame.cc
bool IsAmbiguousInlineLocation ()
Defined at line 146 of file ../../src/developer/debug/zxdb/client/mock_frame.cc