Package cs1302.tracer.model.pytutor
Record Class TraceStep
java.lang.Object
java.lang.Record
cs1302.tracer.model.pytutor.TraceStep
- Record Components:
stdout- Standard output captured up to this point.stderr- Standard error captured up to this point.event- The trace event type (e.g. "step_line").funcName- The name of the executing function/method.line- The source line number where the snapshot was taken.stackToRender- The call stack frames to render.globals- The static/global variables.globalsAttrs- Type attributes of static/global variables.orderedGlobals- The ordered names of static/global variables.heap- The heap objects map.heapAttrs- Type and structural attributes of heap objects.file- The optional relative source file path for multi-file programs.stdinConsumed- Standard input consumed up to this step.stdinOffset- Character offset reached in standard input up to this step.
public record TraceStep(String stdout, String stderr, String event, String funcName, long line, List<RenderStackFrame> stackToRender, Map<String,Object> globals, Map<String,Object> globalsAttrs, List<String> orderedGlobals, Map<String,Object> heap, Map<String,Object> heapAttrs, String file, String stdinConsumed, int stdinOffset)
extends Record
Represents a single execution step / memory snapshot in a PyTutor trace.
-
Constructor Summary
ConstructorsConstructorDescriptionTraceStep(String stdout, String stderr, String event, String funcName, long line, List<RenderStackFrame> stackToRender, Map<String, Object> globals, Map<String, Object> globalsAttrs, List<String> orderedGlobals, Map<String, Object> heap, Map<String, Object> heapAttrs) Constructs a single-file trace step without a file path and defaulting stdin tracking.TraceStep(String stdout, String stderr, String event, String funcName, long line, List<RenderStackFrame> stackToRender, Map<String, Object> globals, Map<String, Object> globalsAttrs, List<String> orderedGlobals, Map<String, Object> heap, Map<String, Object> heapAttrs, String file) Constructs a trace step with a file path and defaulting stdin tracking.TraceStep(String stdout, String stderr, String event, String funcName, long line, List<RenderStackFrame> stackToRender, Map<String, Object> globals, Map<String, Object> globalsAttrs, List<String> orderedGlobals, Map<String, Object> heap, Map<String, Object> heapAttrs, String file, String stdinConsumed, int stdinOffset) Creates an instance of aTraceSteprecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.event()Returns the value of theeventrecord component.file()Returns the value of thefilerecord component.funcName()Returns the value of thefuncNamerecord component.globals()Returns the value of theglobalsrecord component.Returns the value of theglobalsAttrsrecord component.final inthashCode()Returns a hash code value for this object.heap()Returns the value of theheaprecord component.Returns the value of theheapAttrsrecord component.longline()Returns the value of thelinerecord component.Returns the value of theorderedGlobalsrecord component.Returns the value of thestackToRenderrecord component.stderr()Returns the value of thestderrrecord component.Returns the value of thestdinConsumedrecord component.intReturns the value of thestdinOffsetrecord component.stdout()Returns the value of thestdoutrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TraceStep
public TraceStep(String stdout, String stderr, String event, String funcName, long line, List<RenderStackFrame> stackToRender, Map<String, Object> globals, Map<String, Object> globalsAttrs, List<String> orderedGlobals, Map<String, Object> heap, Map<String, Object> heapAttrs) Constructs a single-file trace step without a file path and defaulting stdin tracking.- Parameters:
stdout- Captured standard output.stderr- Captured standard error.event- Event type string.funcName- Executing function name.line- Line number.stackToRender- Stack frames to render.globals- Global variables.globalsAttrs- Global variable attributes.orderedGlobals- Ordered global names.heap- Heap objects map.heapAttrs- Heap attributes.
-
TraceStep
public TraceStep(String stdout, String stderr, String event, String funcName, long line, List<RenderStackFrame> stackToRender, Map<String, Object> globals, Map<String, Object> globalsAttrs, List<String> orderedGlobals, Map<String, Object> heap, Map<String, Object> heapAttrs, String file) Constructs a trace step with a file path and defaulting stdin tracking.- Parameters:
stdout- Captured standard output.stderr- Captured standard error.event- Event type string.funcName- Executing function name.line- Line number.stackToRender- Stack frames to render.globals- Global variables.globalsAttrs- Global variable attributes.orderedGlobals- Ordered global names.heap- Heap objects map.heapAttrs- Heap attributes.file- Relative source file path.
-
TraceStep
public TraceStep(String stdout, String stderr, String event, String funcName, long line, List<RenderStackFrame> stackToRender, Map<String, Object> globals, Map<String, Object> globalsAttrs, List<String> orderedGlobals, Map<String, Object> heap, Map<String, Object> heapAttrs, String file, String stdinConsumed, int stdinOffset) Creates an instance of aTraceSteprecord class.- Parameters:
stdout- the value for thestdoutrecord componentstderr- the value for thestderrrecord componentevent- the value for theeventrecord componentfuncName- the value for thefuncNamerecord componentline- the value for thelinerecord componentstackToRender- the value for thestackToRenderrecord componentglobals- the value for theglobalsrecord componentglobalsAttrs- the value for theglobalsAttrsrecord componentorderedGlobals- the value for theorderedGlobalsrecord componentheap- the value for theheaprecord componentheapAttrs- the value for theheapAttrsrecord componentfile- the value for thefilerecord componentstdinConsumed- the value for thestdinConsumedrecord componentstdinOffset- the value for thestdinOffsetrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
stdout
Returns the value of thestdoutrecord component.- Returns:
- the value of the
stdoutrecord component
-
stderr
Returns the value of thestderrrecord component.- Returns:
- the value of the
stderrrecord component
-
event
Returns the value of theeventrecord component.- Returns:
- the value of the
eventrecord component
-
funcName
Returns the value of thefuncNamerecord component.- Returns:
- the value of the
funcNamerecord component
-
line
@SerializedName("line") public long line()Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
stackToRender
Returns the value of thestackToRenderrecord component.- Returns:
- the value of the
stackToRenderrecord component
-
globals
Returns the value of theglobalsrecord component.- Returns:
- the value of the
globalsrecord component
-
globalsAttrs
Returns the value of theglobalsAttrsrecord component.- Returns:
- the value of the
globalsAttrsrecord component
-
orderedGlobals
Returns the value of theorderedGlobalsrecord component.- Returns:
- the value of the
orderedGlobalsrecord component
-
heap
Returns the value of theheaprecord component.- Returns:
- the value of the
heaprecord component
-
heapAttrs
Returns the value of theheapAttrsrecord component.- Returns:
- the value of the
heapAttrsrecord component
-
file
Returns the value of thefilerecord component.- Returns:
- the value of the
filerecord component
-
stdinConsumed
Returns the value of thestdinConsumedrecord component.- Returns:
- the value of the
stdinConsumedrecord component
-
stdinOffset
@SerializedName("stdinOffset") public int stdinOffset()Returns the value of thestdinOffsetrecord component.- Returns:
- the value of the
stdinOffsetrecord component
-