Ruby
2.4.2p198(2017-09-14revision59899)
|
Go to the source code of this file.
Macros | |
#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 | RUBY_VM_IFUNC_P(ptr) (RB_TYPE_P((VALUE)(ptr), T_IMEMO) && imemo_type((VALUE)ptr) == imemo_ifunc) |
#define | HAVE_BACKTRACE 0 |
#define | rb_dump_machine_register(ctx) ((void)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 (const rb_env_t *env, const 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, const 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 (const void *ctx) |
#define LIMITED_NAME_LENGTH | ( | s | ) | (((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 rb_dump_machine_register | ( | ctx | ) | ((void)0) |
Definition at line 927 of file vm_dump.c.
Referenced by rb_print_backtrace(), and rb_vm_bugreport().
#define RUBY_VM_IFUNC_P | ( | ptr | ) | (RB_TYPE_P((VALUE)(ptr), T_IMEMO) && imemo_type((VALUE)ptr) == imemo_ifunc) |
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().
|
static |
Definition at line 28 of file vm_dump.c.
References rb_iseq_struct::body, rb_callable_method_entry_struct::def, rb_control_frame_struct::ep, rb_control_frame_struct::iseq, rb_iseq_constant_body::iseq_encoded, rb_iseq_location_struct::label, rb_iseq_constant_body::location, MAX_POSBUF, NULL, rb_method_definition_struct::original_id, rb_iseq_location_struct::path, rb_control_frame_struct::pc, PRIdPTRDIFF, PRIxPTRDIFF, rb_id2name(), rb_inspect(), rb_sym2str, rb_vm_frame_method_entry(), 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, SYMBOL_P, VM_FRAME_FINISHED_P(), 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, and VM_FRAME_TYPE().
Referenced by rb_vmdebug_stack_dump_raw(), and rb_vmdebug_stack_dump_th().
void rb_print_backtrace | ( | void | ) |
Definition at line 679 of file vm_dump.c.
References buf, cnt, ERR, free(), NULL, rb_dump_machine_register, and snprintf.
Referenced by rb_vm_bugreport(), and ruby_only_for_internal_use().
void rb_vm_bugreport | ( | const void * | ctx | ) |
Definition at line 931 of file vm_dump.c.
References CLASS_OF, feof, GET_VM, rb_trace_arg_struct::klass, len, LIMITED_NAME_LENGTH, rb_vm_struct::loaded_features, name, NULL, rb_vm_struct::progname, RARRAY_AREF, RARRAY_LEN, rb_backtrace_print_as_bugreport(), rb_class_real(), rb_dump_machine_register, rb_obj_class(), rb_print_backtrace(), rb_search_class_path(), RB_TYPE_P, RSTRING_PTR, SDR, T_CLASS, T_MODULE, and T_STRING.
Referenced by rb_assert_failure(), and sdr().
void rb_vmdebug_debug_print_post | ( | rb_thread_t * | th, |
rb_control_frame_t * | cfp | ||
) |
Definition at line 373 of file vm_dump.c.
References rb_thread_struct::cfp, rb_inspect(), rb_vmdebug_debug_print_register(), SDR2, and StringValueCStr.
Referenced by VM_BH_FROM_PROC().
void rb_vmdebug_debug_print_pre | ( | rb_thread_t * | th, |
rb_control_frame_t * | cfp, | ||
const VALUE * | _pc | ||
) |
Definition at line 344 of file vm_dump.c.
References rb_iseq_struct::body, rb_control_frame_struct::iseq, rb_iseq_constant_body::iseq_encoded, rb_iseq_disasm_insn(), rb_iseq_original_iseq(), rb_vmdebug_debug_print_register(), rb_control_frame_struct::sp, rb_thread_struct::stack, and VM_CFP_CNT.
Referenced by VM_BH_FROM_PROC().
void rb_vmdebug_debug_print_register | ( | rb_thread_t * | th | ) |
Definition at line 315 of file vm_dump.c.
References rb_iseq_struct::body, rb_thread_struct::cfp, rb_control_frame_struct::ep, rb_control_frame_struct::iseq, rb_iseq_constant_body::iseq_encoded, rb_control_frame_struct::pc, PRIdPTRDIFF, rb_control_frame_struct::sp, rb_thread_struct::stack, rb_thread_struct::stack_size, and VM_FRAME_RUBYFRAME_P().
Referenced by rb_vmdebug_debug_print_post(), rb_vmdebug_debug_print_pre(), and rb_vmdebug_thread_dump_regs().
Definition at line 185 of file vm_dump.c.
References rb_env_t::env, rb_env_t::env_size, PRIxVALUE, and rb_vm_env_prev_env().
Referenced by rb_vmdebug_proc_dump_raw().
void rb_vmdebug_proc_dump_raw | ( | rb_proc_t * | proc | ) |
Definition at line 204 of file vm_dump.c.
References rb_proc_t::block, env, rb_inspect(), rb_vmdebug_env_dump_raw(), StringValueCStr, val, vm_block_ep(), vm_block_self(), and VM_ENV_ENVVAL_PTR().
void rb_vmdebug_stack_dump_raw | ( | rb_thread_t * | th, |
rb_control_frame_t * | cfp | ||
) |
Definition at line 146 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, and rb_thread_struct::stack_size.
Referenced by rb_vmdebug_stack_dump_raw_current(), rb_vmdebug_stack_dump_th(), and VM_BH_FROM_PROC().
void rb_vmdebug_stack_dump_raw_current | ( | void | ) |
Definition at line 178 of file vm_dump.c.
References rb_thread_struct::cfp, GET_THREAD, rb_vmdebug_stack_dump_raw(), and rb_trace_arg_struct::th.
void rb_vmdebug_stack_dump_th | ( | VALUE | thval | ) |
Definition at line 218 of file vm_dump.c.
References argc, rb_iseq_struct::body, bp, rb_thread_struct::cfp, rb_trace_arg_struct::cfp, control_frame_dump(), rb_control_frame_struct::ep, GetThreadPtr, rb_control_frame_struct::iseq, rb_iseq_constant_body::lead_num, rb_iseq_constant_body::param, PRIdPTRDIFF, rb_bug(), rb_inspect(), rb_str_new2, rb_vmdebug_stack_dump_raw(), RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_control_frame_struct::sp, rb_thread_struct::stack, StringValueCStr, T_IMEMO, T_UNDEF, rb_trace_arg_struct::th, rb_iseq_constant_body::type, TYPE, vm_base_ptr(), VM_ENV_DATA_SIZE, VM_FRAME_FINISHED_P(), 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_RUBYFRAME_P(), and VM_FRAME_TYPE().
void rb_vmdebug_thread_dump_regs | ( | VALUE | thval | ) |
Definition at line 336 of file vm_dump.c.
References GetThreadPtr, rb_vmdebug_debug_print_register(), and rb_trace_arg_struct::th.
Definition at line 408 of file vm_dump.c.
References buf, rb_thread_struct::cfp, rb_trace_arg_struct::cfp, rb_control_frame_struct::ep, GetThreadPtr, rb_control_frame_struct::pc, Qnil, size, rb_control_frame_struct::sp, and rb_trace_arg_struct::th.