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 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 a TraceStep record class.
      Parameters:
      stdout - the value for the stdout record component
      stderr - the value for the stderr record component
      event - the value for the event record component
      funcName - the value for the funcName record component
      line - the value for the line record component
      stackToRender - the value for the stackToRender record component
      globals - the value for the globals record component
      globalsAttrs - the value for the globalsAttrs record component
      orderedGlobals - the value for the orderedGlobals record component
      heap - the value for the heap record component
      heapAttrs - the value for the heapAttrs record component
      file - the value for the file record component
      stdinConsumed - the value for the stdinConsumed record component
      stdinOffset - the value for the stdinOffset record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • stdout

      @SerializedName("stdout") public String stdout()
      Returns the value of the stdout record component.
      Returns:
      the value of the stdout record component
    • stderr

      @SerializedName("stderr") public String stderr()
      Returns the value of the stderr record component.
      Returns:
      the value of the stderr record component
    • event

      @SerializedName("event") public String event()
      Returns the value of the event record component.
      Returns:
      the value of the event record component
    • funcName

      @SerializedName("func_name") public String funcName()
      Returns the value of the funcName record component.
      Returns:
      the value of the funcName record component
    • line

      @SerializedName("line") public long line()
      Returns the value of the line record component.
      Returns:
      the value of the line record component
    • stackToRender

      @SerializedName("stack_to_render") public List<RenderStackFrame> stackToRender()
      Returns the value of the stackToRender record component.
      Returns:
      the value of the stackToRender record component
    • globals

      @SerializedName("globals") public Map<String,Object> globals()
      Returns the value of the globals record component.
      Returns:
      the value of the globals record component
    • globalsAttrs

      @SerializedName("globals_attrs") public Map<String,Object> globalsAttrs()
      Returns the value of the globalsAttrs record component.
      Returns:
      the value of the globalsAttrs record component
    • orderedGlobals

      @SerializedName("ordered_globals") public List<String> orderedGlobals()
      Returns the value of the orderedGlobals record component.
      Returns:
      the value of the orderedGlobals record component
    • heap

      @SerializedName("heap") public Map<String,Object> heap()
      Returns the value of the heap record component.
      Returns:
      the value of the heap record component
    • heapAttrs

      @SerializedName("heap_attrs") public Map<String,Object> heapAttrs()
      Returns the value of the heapAttrs record component.
      Returns:
      the value of the heapAttrs record component
    • file

      @SerializedName("file") public String file()
      Returns the value of the file record component.
      Returns:
      the value of the file record component
    • stdinConsumed

      @SerializedName("stdinConsumed") public String stdinConsumed()
      Returns the value of the stdinConsumed record component.
      Returns:
      the value of the stdinConsumed record component
    • stdinOffset

      @SerializedName("stdinOffset") public int stdinOffset()
      Returns the value of the stdinOffset record component.
      Returns:
      the value of the stdinOffset record component