Class: YTLJit::StepHandler

Inherits:
Object show all
Defined in:
lib/ytljit/asm.rb,
ext/ytljit.c

Instance Method Summary collapse

Instance Method Details

#backtrace(bp) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ytljit/asm.rb', line 20

def backtrace(bp)
  bp = memref(bp)
  pc = memref(bp + AsmType::MACHINE_WORD.size)
  frame_struct_tab = VM::Node::TopTopNode.get_frame_struct_tab
  if frame_struct_tab[pc] then
    STDERR.print frame_struct_tab[pc][0].class, "\n"
    STDERR.print frame_struct_tab[pc][0].debug_info, "\n"
    STDERR.print frame_struct_tab[pc][3], "\n"
    STDERR.print frame_struct_tab[pc][2].map {|n| n.class}, "\n"
    bp = memref(bp)
    backtrace(bp)
  end
end

#step_handler(*regval) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ytljit/asm.rb', line 34

def step_handler(*regval)
 STDERR.print "#{regval[1].to_s(16)} "
 STDERR.print CodeSpace.disasm_cache[regval[1].to_s(16)], "\n"
 frame_struct_tab = VM::Node::TopTopNode.get_frame_struct_tab
 STDERR.print frame_struct_tab[regval[1]][0].debug_info, "\n"
 STDERR.print frame_struct_tab[regval[1]][2].map {|n| n.class}, "\n"
 STDERR.print frame_struct_tab[regval[1]][3], "\n"
 REGS.each do |rname, no|
   STDERR.print rname
   STDERR.print ": 0x"
   STDERR.print regval[no].to_s(16)
   STDERR.print " "
 end
 STDERR.print "\nbacktrace\n"
 backtrace(regval[5])
 STDERR.print "\n"
end