Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
set print pretty on
set pagination off
define ruby_thread
set $ruby_thread = ruby_current_vm->running_thread
printf "running_thread set $ruby_thread \n"
end
define vm_cfp_cnt
printf "cfp_cnt %d \n", ((rb_control_frame_t *)(($arg0)->stack + ($arg0)->stack_size) - (rb_control_frame_t *)($arg1))
end
document vm_cfp_cnt
cfp_cnt ruby_thread and cfp(from https://github.com/ruby/ruby/blob/202bbda2bf5f25343e286099140fb9282880ecba/vm_dump.c#L24)
end
define vm_frame_type
printf "vm_frame_type %x ", (((rb_control_frame_t *)($arg0))->flag & ~(~(VALUE)0<<8))
set $cfp_flag = (((rb_control_frame_t *)($arg0))->flag & ~(~(VALUE)0<<8))
if $cfp_flag == 0x41
printf " %s \n", "TOP"
else
if $cfp_flag == 0x11
printf " %s \n", "METHOD"
else
if $cfp_flag == 0x31
printf " %s \n", "CLASS"
else
if $cfp_flag == 0x21
printf " %s \n", "BLOCK"
else
if $cfp_flag == 0x61
printf " %s \n", "CFUNC"
else
if $cfp_flag == 0x71
printf " %s \n", "PROC"
else
if $cfp_flag == 0xa1
printf " %s \n", "LAMBDA"
else
if $cfp_flag == 0x81
printf " %s \n", "IFUNC"
else
if $cfp_flag == 0x91
printf " %s \n", "EVAL"
else
if $cfp_flag == 0xb1
printf " %s \n", "RESCUE"
else
if $cfp_flag == 0
printf " %s \n", "------"
else
printf " %s \n", "(none)"
end
end
end
end
end
end
end
end
end
end
end
end
document vm_frame_type
vm_frame_type cfp (from https://github.com/ruby/ruby/blob/202bbda2bf5f25343e286099140fb9282880ecba/vm_dump.c#L46)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment