class SyntaxTree::YARV::VM::STDOUTEvents
This is a simple implementation of tracing that prints to STDOUT.
Attributes
disassembler[R]
Public Class Methods
new()
click to toggle source
# File lib/syntax_tree/yarv/vm.rb, line 140 def initialize @disassembler = Disassembler.new end
Public Instance Methods
publish_frame_change(frame)
click to toggle source
# File lib/syntax_tree/yarv/vm.rb, line 144 def publish_frame_change(frame) puts "%-16s %s" % ["frame-change", "#{frame.iseq.file}@#{frame.line}"] end
publish_instruction(iseq, insn)
click to toggle source
# File lib/syntax_tree/yarv/vm.rb, line 148 def publish_instruction(iseq, insn) disassembler.current_iseq = iseq puts "%-16s %s" % ["instruction", insn.disasm(disassembler)] end
publish_stack_change(stack)
click to toggle source
# File lib/syntax_tree/yarv/vm.rb, line 153 def publish_stack_change(stack) puts "%-16s %s" % ["stack-change", stack.values.inspect] end
publish_tracepoint(event)
click to toggle source
# File lib/syntax_tree/yarv/vm.rb, line 157 def publish_tracepoint(event) puts "%-16s %s" % ["tracepoint", event.inspect] end