vm_dump.c File Reference

#include "ruby/ruby.h"
#include "addr2line.h"
#include "vm_core.h"
#include "internal.h"

Go to the source code of this file.

Defines

#define VMDEBUG   0
#define MAX_POSBUF   128
#define VM_CFP_CNT(th, cfp)   ((rb_control_frame_t *)((th)->stack + (th)->stack_size) - (rb_control_frame_t *)(cfp))
#define HAVE_BACKTRACE   0
#define LIMITED_NAME_LENGTH(s)   (((len = RSTRING_LEN(s)) > max_name_length) ? max_name_length : (int)len)

Functions

static void control_frame_dump (rb_thread_t *th, rb_control_frame_t *cfp)
void rb_vmdebug_stack_dump_raw (rb_thread_t *th, rb_control_frame_t *cfp)
void rb_vmdebug_stack_dump_raw_current (void)
void rb_vmdebug_env_dump_raw (rb_env_t *env, VALUE *ep)
void rb_vmdebug_proc_dump_raw (rb_proc_t *proc)
void rb_vmdebug_stack_dump_th (VALUE thval)
void rb_vmdebug_debug_print_register (rb_thread_t *th)
void rb_vmdebug_thread_dump_regs (VALUE thval)
void rb_vmdebug_debug_print_pre (rb_thread_t *th, rb_control_frame_t *cfp, VALUE *_pc)
void rb_vmdebug_debug_print_post (rb_thread_t *th, rb_control_frame_t *cfp)
VALUE rb_vmdebug_thread_dump_state (VALUE self)
void rb_print_backtrace (void)
void rb_vm_bugreport (void)


Define Documentation

#define HAVE_BACKTRACE   0

Definition at line 503 of file vm_dump.c.

#define LIMITED_NAME_LENGTH (  )     (((len = RSTRING_LEN(s)) > max_name_length) ? max_name_length : (int)len)

Referenced by rb_vm_bugreport().

#define MAX_POSBUF   128

Definition at line 22 of file vm_dump.c.

Referenced by control_frame_dump().

#define VM_CFP_CNT ( th,
cfp   )     ((rb_control_frame_t *)((th)->stack + (th)->stack_size) - (rb_control_frame_t *)(cfp))

Definition at line 24 of file vm_dump.c.

Referenced by rb_vmdebug_debug_print_pre().

#define VMDEBUG   0

Definition at line 19 of file vm_dump.c.

Referenced by rb_vm_make_proc(), vm_pop_frame(), and vm_push_frame().


Function Documentation

static void control_frame_dump ( rb_thread_t th,
rb_control_frame_t cfp 
) [static]

Definition at line 28 of file vm_dump.c.

References rb_control_frame_struct::block_iseq, BUILTIN_TYPE, rb_method_entry_struct::def, rb_control_frame_struct::ep, rb_control_frame_struct::iseq, rb_iseq_struct::iseq_encoded, rb_iseq_location_struct::label, rb_iseq_struct::location, MAX_POSBUF, rb_control_frame_struct::me, rb_method_definition_struct::original_id, rb_iseq_location_struct::path, rb_control_frame_struct::pc, PRIdPTRDIFF, PRIxPTRDIFF, rb_id2name(), rb_inspect(), rb_vm_get_sourceline(), RSTRING_PTR, RUBY_VM_IFUNC_P, rb_control_frame_struct::self, snprintf, rb_control_frame_struct::sp, rb_thread_struct::stack, rb_thread_struct::stack_size, StringValueCStr, T_NODE, VALUE, VM_FRAME_MAGIC_BLOCK, VM_FRAME_MAGIC_CFUNC, VM_FRAME_MAGIC_CLASS, VM_FRAME_MAGIC_EVAL, VM_FRAME_MAGIC_IFUNC, VM_FRAME_MAGIC_LAMBDA, VM_FRAME_MAGIC_METHOD, VM_FRAME_MAGIC_PROC, VM_FRAME_MAGIC_RESCUE, VM_FRAME_MAGIC_TOP, VM_FRAME_TYPE, and VM_FRAME_TYPE_FINISH_P.

Referenced by rb_vmdebug_stack_dump_raw().

void rb_print_backtrace ( void   ) 

Definition at line 685 of file vm_dump.c.

References free.

Referenced by rb_vm_bugreport().

void rb_vm_bugreport ( void   ) 

Definition at line 713 of file vm_dump.c.

References CLASS_OF, feof, GET_VM, len, LIMITED_NAME_LENGTH, rb_vm_struct::loaded_features, rb_vm_struct::progname, RARRAY_AREF, RARRAY_LEN, rb_backtrace_print_as_bugreport(), rb_class_name(), rb_print_backtrace(), RB_TYPE_P, RSTRING_PTR, SDR, T_CLASS, T_MODULE, T_STRING, type, and VALUE.

void rb_vmdebug_debug_print_post ( rb_thread_t th,
rb_control_frame_t cfp 
)

Definition at line 385 of file vm_dump.c.

References rb_thread_struct::cfp, rb_inspect(), rb_vmdebug_debug_print_register(), SDR2, StringValueCStr, and VALUE.

void rb_vmdebug_debug_print_pre ( rb_thread_t th,
rb_control_frame_t cfp,
VALUE *  _pc 
)

Definition at line 357 of file vm_dump.c.

References rb_iseq_struct::iseq, rb_control_frame_struct::iseq, rb_iseq_struct::iseq_encoded, rb_iseq_disasm_insn(), rb_vmdebug_debug_print_register(), rb_control_frame_struct::sp, rb_thread_struct::stack, VALUE, and VM_CFP_CNT.

void rb_vmdebug_debug_print_register ( rb_thread_t th  ) 

Definition at line 328 of file vm_dump.c.

References rb_thread_struct::cfp, rb_control_frame_struct::ep, rb_control_frame_struct::iseq, rb_iseq_struct::iseq_encoded, rb_control_frame_struct::pc, PRIdPTRDIFF, RUBY_VM_NORMAL_ISEQ_P, rb_control_frame_struct::sp, rb_thread_struct::stack, and rb_thread_struct::stack_size.

Referenced by rb_vmdebug_debug_print_post(), rb_vmdebug_debug_print_pre(), and rb_vmdebug_thread_dump_regs().

void rb_vmdebug_env_dump_raw ( rb_env_t env,
VALUE *  ep 
)

Definition at line 180 of file vm_dump.c.

References rb_env_t::env, rb_env_t::env_size, GetEnvPtr, if(), rb_env_t::local_size, rb_env_t::prev_envval, and PRIxVALUE.

Referenced by rb_vmdebug_proc_dump_raw().

void rb_vmdebug_proc_dump_raw ( rb_proc_t proc  ) 

Definition at line 206 of file vm_dump.c.

References rb_proc_t::block, env, rb_proc_t::envval, rb_block_struct::ep, GetEnvPtr, rb_inspect(), rb_vmdebug_env_dump_raw(), rb_block_struct::self, StringValueCStr, val, and VALUE.

void rb_vmdebug_stack_dump_raw ( rb_thread_t th,
rb_control_frame_t cfp 
)

Definition at line 141 of file vm_dump.c.

References control_frame_dump(), rb_control_frame_struct::ep, GC_GUARDED_PTR_REF, PRIxVALUE, rb_control_frame_struct::sp, rb_thread_struct::stack, rb_thread_struct::stack_size, and VALUE.

Referenced by rb_vmdebug_stack_dump_raw_current(), and rb_vmdebug_stack_dump_th().

void rb_vmdebug_stack_dump_raw_current ( void   ) 

Definition at line 173 of file vm_dump.c.

References rb_thread_struct::cfp, GET_THREAD(), and rb_vmdebug_stack_dump_raw().

void rb_vmdebug_stack_dump_th ( VALUE  thval  ) 

Definition at line 220 of file vm_dump.c.

References rb_thread_struct::cfp, GetThreadPtr, and rb_vmdebug_stack_dump_raw().

void rb_vmdebug_thread_dump_regs ( VALUE  thval  ) 

Definition at line 349 of file vm_dump.c.

References GetThreadPtr, and rb_vmdebug_debug_print_register().

VALUE rb_vmdebug_thread_dump_state ( VALUE  self  ) 

Definition at line 420 of file vm_dump.c.

References rb_thread_struct::cfp, rb_control_frame_struct::ep, GetThreadPtr, rb_control_frame_struct::pc, Qnil, and rb_control_frame_struct::sp.


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7