Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (25 sloc) 0.847 kb
require 'rubygems'; require 'require_relative'
require_relative '../app/iseq'
class Trepan
class CmdProcessor
def show_bytecode(line=@frame.vm_location.line)
meth = @frame.method
start = meth.first_ip_on_line(line)
fin = meth.first_ip_on_line(line+1)
if fin == -1
fin = meth.iseq.size
end
# FIXME: Add section instead of "msg"
msg "Bytecode between #{start} and #{fin-1} for line #{line}"
iseq_decoder = Rubinius::InstructionDecoder.new(meth.iseq)
partial = iseq_decoder.decode_between(start, fin)
ip = start
partial.each do |ins|
inst = Rubinius::CompiledMethod::Instruction.new(ins, meth, ip)
prefix = Trepanning::ISeq::disasm_prefix(ip, frame.next_ip, meth)
msg "#{prefix} #{inst}"
ip += ins.size
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.