/** *PlaysbackaSkSLdebugtrace,allowingitscontentstobeviewedlikeatraditionaldebugger.
*/ class SkSLDebugTracePlayer { public: /** Resets playback to the start of the trace. Breakpoints are not cleared. */ void reset(sk_sp<DebugTracePriv> trace);
/** Advances the simulation to the next Line op. */ void step();
/** Advances the simulation until we hit a breakpoint, or the trace completes. */ void run();
/** Breakpoints will force the simulation to stop whenever a desired line is reached. */ void setBreakpoints(std::unordered_set<int> breakpointLines); void addBreakpoint(int line); void removeBreakpoint(int line); using BreakpointSet = std::unordered_set<int>; const BreakpointSet& getBreakpoints() { return fBreakpointLines; }
/** Returns true if we have reached the end of the trace. */ bool traceHasCompleted() const;
/** Returns true if there is a breakpoint set at the current line. */ bool atBreakpoint() const;
/** Returns variables from a stack frame, or from global scope. */ struct VariableData { int fSlotIndex; bool fDirty; // has this slot been written-to since the last step call? double fValue; // value in slot (with type-conversion applied)
};
std::vector<VariableData> getLocalVariables(int stackFrameIndex) const;
std::vector<VariableData> getGlobalVariables() const;
/** Updates fWriteTime for the entire variable at a given slot. */ void updateVariableWriteTime(int slotIdx, size_t writeTime);
/** Returns a vector of the indices and values of each slot that is enabled in `bits`. */
std::vector<VariableData> getVariablesForDisplayMask(const SkBitSet& bits) const;
struct StackFrame {
int32_t fFunction; // from fFuncInfo
int32_t fLine; // our current line number within the function
SkBitSet fDisplayMask; // the variable slots which have been touched in this function
}; struct Slot {
int32_t fValue; // values in each slot int fScope; // the scope value of each slot
size_t fWriteTime; // when was the variable in this slot most recently written? // (by cursor position)
};
sk_sp<DebugTracePriv> fDebugTrace;
size_t fCursor = 0; // position of the read head int fScope = 0; // the current scope depth (as tracked by // trace_scope)
std::vector<Slot> fSlots; // the array of all slots
std::vector<StackFrame> fStack; // the execution stack
std::optional<SkBitSet> fDirtyMask; // variable slots touched during the most-recently // executed step
std::optional<SkBitSet> fReturnValues; // variable slots containing return values
LineNumberMap fLineNumbers; // holds [line number, the remaining number of // times to reach this line during the trace]
BreakpointSet fBreakpointLines; // all breakpoints set by setBreakpointLines
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.