Ruby
2.0.0p598(2014-11-13revision48408)
|
#include "ruby/ruby.h"
#include "ruby/encoding.h"
#include "ruby/debug.h"
#include "internal.h"
#include "vm_core.h"
#include "eval_intern.h"
#include "iseq.h"
Go to the source code of this file.
Data Structures | |
struct | rb_backtrace_location_struct |
struct | valued_frame_info |
struct | rb_backtrace_struct |
struct | bt_iter_arg |
struct | oldbt_arg |
struct | rb_debug_inspector_struct |
struct | collect_caller_bindings_data |
Typedefs | |
typedef struct rb_backtrace_location_struct | rb_backtrace_location_t |
typedef struct rb_backtrace_struct | rb_backtrace_t |
Enumerations | |
enum | { CALLER_BINDING_SELF, CALLER_BINDING_CLASS, CALLER_BINDING_BINDING, CALLER_BINDING_ISEQ, CALLER_BINDING_CFP } |
Variables | |
static VALUE | rb_cBacktrace |
static VALUE | rb_cBacktraceLocation |
VALUE | ruby_engine_name |
static const rb_data_type_t | location_data_type |
static const rb_data_type_t | backtrace_data_type |
typedef struct rb_backtrace_location_struct rb_backtrace_location_t |
typedef struct rb_backtrace_struct rb_backtrace_t |
anonymous enum |
Enumerator | |
---|---|
CALLER_BINDING_SELF | |
CALLER_BINDING_CLASS | |
CALLER_BINDING_BINDING | |
CALLER_BINDING_ISEQ | |
CALLER_BINDING_CFP |
Definition at line 1034 of file vm_backtrace.c.
Definition at line 419 of file vm_backtrace.c.
References obj, and TypedData_Make_Struct.
Referenced by bt_init(), and Init_vm_backtrace().
|
static |
Definition at line 538 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace, rb_backtrace_struct::backtrace_size, func, i, n, rb_ary_new(), rb_ary_push(), rb_bug(), and UNLIKELY.
Referenced by backtrace_to_location_ary(), and backtrace_to_str_ary().
Definition at line 633 of file vm_backtrace.c.
References rb_backtrace_to_str_ary(), and str.
Referenced by Init_vm_backtrace().
|
static |
Definition at line 427 of file vm_backtrace.c.
References rb_thread_struct::cfp, i, RUBY_VM_END_CONTROL_FRAME, RUBY_VM_NEXT_CONTROL_FRAME, RUBYVM_CFUNC_FRAME_P, and size.
Referenced by backtrace_object(), collect_caller_bindings(), rb_backtrace_print_as_bugreport(), and vm_backtrace_print().
Definition at line 391 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace, rb_backtrace_struct::backtrace_base, and ruby_xfree().
Definition at line 640 of file vm_backtrace.c.
References GetCoreDataFromValue, str, and rb_backtrace_struct::strary.
Referenced by Init_vm_backtrace().
Definition at line 377 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace, rb_backtrace_struct::backtrace_size, i, location_mark_entry(), rb_gc_mark(), s, and rb_backtrace_struct::strary.
Definition at line 401 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace_size.
|
static |
Definition at line 517 of file vm_backtrace.c.
References backtrace_each(), bt_init(), bt_iter_cfunc(), bt_iter_iseq(), bt_iter_arg::btobj, and bt_iter_arg::prev_loc.
Referenced by rb_vm_backtrace_object(), vm_backtrace_location_ary(), vm_backtrace_str_ary(), and vm_backtrace_to_ary().
Definition at line 611 of file vm_backtrace.c.
References backtrace_collect(), rb_backtrace_struct::backtrace_size, GetCoreDataFromValue, location_create(), Qnil, r, RB_GC_GUARD, and size.
Referenced by vm_backtrace_location_ary(), and vm_backtrace_to_ary().
Definition at line 564 of file vm_backtrace.c.
References backtrace_collect(), rb_backtrace_struct::backtrace_size, bt_iter_arg::bt, GetCoreDataFromValue, location_to_str_dmyarg(), Qnil, r, RB_GC_GUARD, and size.
Referenced by rb_backtrace_to_str_ary(), vm_backtrace_str_ary(), and vm_backtrace_to_ary().
Definition at line 484 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace, backtrace_alloc(), rb_backtrace_struct::backtrace_base, rb_backtrace_struct::backtrace_size, bt_iter_arg::bt, bt_iter_arg::btobj, GetCoreDataFromValue, rb_cBacktrace, and ruby_xmalloc().
Referenced by backtrace_object().
|
static |
Definition at line 507 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace, rb_backtrace_struct::backtrace_size, rb_backtrace_location_struct::body, bt_iter_arg::bt, rb_backtrace_location_struct::cfunc, bt_iter_arg::prev_loc, and rb_backtrace_location_struct::type.
Referenced by backtrace_object().
|
static |
Definition at line 494 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace, rb_backtrace_struct::backtrace_size, rb_backtrace_location_struct::body, bt_iter_arg::bt, rb_backtrace_location_struct::iseq, rb_iseq_struct::iseq, rb_control_frame_struct::iseq, rb_control_frame_struct::pc, bt_iter_arg::prev_loc, and rb_backtrace_location_struct::type.
Referenced by backtrace_object().
Definition at line 27 of file vm_backtrace.c.
References rb_iseq_struct::iseq_encoded, and rb_iseq_line_no().
Referenced by location_lineno(), location_to_str(), oldbt_iter_iseq(), and rb_vm_get_sourceline().
|
static |
Definition at line 1100 of file vm_backtrace.c.
References collect_caller_bindings_data::ary, backtrace_each(), CALLER_BINDING_BINDING, collect_caller_bindings_cfunc(), collect_caller_bindings_init(), collect_caller_bindings_iseq(), GC_GUARDED_PTR_REF, i, NIL_P(), RARRAY_LEN, rb_ary_entry(), rb_ary_new(), rb_ary_reverse(), rb_ary_store(), rb_binding_new_with_cfp(), and result.
Referenced by rb_debug_inspector_open().
|
static |
Definition at line 1085 of file vm_backtrace.c.
References collect_caller_bindings_data::ary, CALLER_BINDING_BINDING, CALLER_BINDING_CFP, CALLER_BINDING_CLASS, CALLER_BINDING_ISEQ, CALLER_BINDING_SELF, data, GC_GUARDED_PTR, get_klass(), Qnil, rb_ary_new2(), rb_ary_push(), rb_ary_store(), and rb_control_frame_struct::self.
Referenced by collect_caller_bindings().
Definition at line 1047 of file vm_backtrace.c.
Referenced by collect_caller_bindings().
|
static |
Definition at line 1070 of file vm_backtrace.c.
References collect_caller_bindings_data::ary, CALLER_BINDING_BINDING, CALLER_BINDING_CFP, CALLER_BINDING_CLASS, CALLER_BINDING_ISEQ, CALLER_BINDING_SELF, data, GC_GUARDED_PTR, get_klass(), rb_control_frame_struct::iseq, Qnil, rb_ary_new2(), rb_ary_push(), rb_ary_store(), rb_iseq_struct::self, and rb_control_frame_struct::self.
Referenced by collect_caller_bindings().
|
static |
Definition at line 1165 of file vm_backtrace.c.
References rb_debug_inspector_struct::backtrace_size, rb_debug_inspector_struct::contexts, rb_ary_entry(), rb_eArgError, and rb_raise().
Referenced by rb_debug_inspector_frame_binding_get(), rb_debug_inspector_frame_class_get(), rb_debug_inspector_frame_iseq_get(), and rb_debug_inspector_frame_self_get().
|
static |
Definition at line 1053 of file vm_backtrace.c.
References klass, Qnil, RB_TYPE_P, rb_vm_control_frame_id_and_class(), RBASIC, and T_ICLASS.
Referenced by collect_caller_bindings_cfunc(), and collect_caller_bindings_iseq().
Definition at line 946 of file vm_backtrace.c.
References backtrace_alloc(), backtrace_dump_data(), backtrace_load_data(), CLASS_OF, location_absolute_path_m(), location_base_label_m(), location_inspect_m(), location_label_m(), location_lineno_m(), location_path_m(), location_to_str_m(), rb_cArray, rb_cBacktrace, rb_cBacktraceLocation, rb_cObject, rb_cThread, rb_define_alloc_func(), rb_define_class_under(), rb_define_global_function(), rb_define_method(), rb_f_caller(), rb_f_caller_locations(), rb_marshal_define_compat(), rb_undef_alloc_func(), and rb_undef_method().
Referenced by Init_VM().
|
static |
Definition at line 269 of file vm_backtrace.c.
References rb_backtrace_location_struct::body, rb_backtrace_location_struct::cfunc, rb_backtrace_location_struct::iseq, rb_iseq_struct::iseq, Qnil, rb_bug(), rb_backtrace_location_struct::type, and UNREACHABLE.
Referenced by location_absolute_path_m().
Definition at line 293 of file vm_backtrace.c.
References location_absolute_path(), and location_ptr().
Referenced by Init_vm_backtrace().
|
static |
Definition at line 209 of file vm_backtrace.c.
References rb_backtrace_location_struct::body, rb_backtrace_location_struct::cfunc, ID2SYM, rb_backtrace_location_struct::iseq, rb_iseq_struct::iseq, rb_bug(), rb_sym_to_s(), rb_backtrace_location_struct::type, and UNREACHABLE.
Referenced by location_base_label_m().
Definition at line 230 of file vm_backtrace.c.
References location_base_label(), and location_ptr().
Referenced by Init_vm_backtrace().
|
static |
Definition at line 598 of file vm_backtrace.c.
References valued_frame_info::btobj, valued_frame_info::loc, obj, rb_cBacktraceLocation, and TypedData_Make_Struct.
Referenced by backtrace_to_location_ary().
Definition at line 299 of file vm_backtrace.c.
References rb_enc_compatible(), rb_enc_sprintf(), and RSTRING_PTR.
Referenced by location_to_str().
Definition at line 97 of file vm_backtrace.c.
References ruby_xfree().
Definition at line 364 of file vm_backtrace.c.
References location_ptr(), location_to_str(), and rb_str_inspect().
Referenced by Init_vm_backtrace().
|
static |
Definition at line 160 of file vm_backtrace.c.
References rb_backtrace_location_struct::body, rb_backtrace_location_struct::cfunc, rb_backtrace_location_struct::iseq, rb_iseq_struct::iseq, rb_bug(), rb_id2str(), rb_backtrace_location_struct::type, and UNREACHABLE.
Referenced by location_label_m().
Definition at line 203 of file vm_backtrace.c.
References location_label(), and location_ptr().
Referenced by Init_vm_backtrace().
|
static |
Definition at line 126 of file vm_backtrace.c.
References rb_backtrace_location_struct::body, calc_lineno(), rb_backtrace_location_struct::cfunc, rb_backtrace_location_struct::iseq, rb_iseq_struct::iseq, rb_bug(), rb_backtrace_location_struct::type, and UNREACHABLE.
Referenced by location_lineno_m(), and location_to_str().
Definition at line 154 of file vm_backtrace.c.
References INT2FIX, location_lineno(), and location_ptr().
Referenced by Init_vm_backtrace().
Definition at line 73 of file vm_backtrace.c.
References valued_frame_info::btobj, and rb_gc_mark().
|
static |
Definition at line 82 of file vm_backtrace.c.
References rb_backtrace_location_struct::body, rb_backtrace_location_struct::iseq, rb_iseq_struct::iseq, rb_gc_mark(), and rb_backtrace_location_struct::type.
Referenced by backtrace_mark().
Definition at line 106 of file vm_backtrace.c.
|
static |
Definition at line 236 of file vm_backtrace.c.
References rb_backtrace_location_struct::body, rb_backtrace_location_struct::cfunc, rb_backtrace_location_struct::iseq, rb_iseq_struct::iseq, Qnil, rb_bug(), rb_backtrace_location_struct::type, and UNREACHABLE.
Referenced by location_path_m().
Definition at line 263 of file vm_backtrace.c.
References location_path(), and location_ptr().
Referenced by Init_vm_backtrace().
|
inlinestatic |
Definition at line 118 of file vm_backtrace.c.
References GetCoreDataFromValue, and valued_frame_info::loc.
Referenced by location_absolute_path_m(), location_base_label_m(), location_inspect_m(), location_label_m(), location_lineno_m(), location_path_m(), and location_to_str_m().
|
static |
Definition at line 312 of file vm_backtrace.c.
References rb_backtrace_location_struct::body, calc_lineno(), rb_backtrace_location_struct::cfunc, GET_THREAD(), INT2FIX, rb_backtrace_location_struct::iseq, rb_iseq_struct::iseq, lineno, location_format(), location_lineno(), name, rb_vm_struct::progname, rb_bug(), rb_id2str(), ruby_engine_name, th, rb_backtrace_location_struct::type, and rb_thread_struct::vm.
Referenced by location_inspect_m(), location_to_str_dmyarg(), and location_to_str_m().
|
static |
Definition at line 558 of file vm_backtrace.c.
References location_to_str().
Referenced by backtrace_to_str_ary().
Definition at line 354 of file vm_backtrace.c.
References location_ptr(), and location_to_str().
Referenced by Init_vm_backtrace().
Definition at line 733 of file vm_backtrace.c.
References oldbt_arg::filename, NIL_P(), and RSTRING_PTR.
Referenced by rb_backtrace_print_as_bugreport().
Definition at line 670 of file vm_backtrace.c.
References oldbt_arg::filename, GET_THREAD(), oldbt_arg::lineno, rb_vm_struct::progname, ruby_engine_name, and rb_thread_struct::vm.
Referenced by rb_backtrace_print_as_bugreport(), and vm_backtrace_print().
|
static |
Definition at line 693 of file vm_backtrace.c.
References oldbt_arg::data, oldbt_arg::filename, oldbt_arg::func, oldbt_arg::lineno, lineno, name, and rb_id2str().
Referenced by rb_backtrace_print_as_bugreport(), and vm_backtrace_print().
|
static |
Definition at line 680 of file vm_backtrace.c.
References calc_lineno(), oldbt_arg::data, oldbt_arg::filename, oldbt_arg::func, rb_control_frame_struct::iseq, rb_iseq_location_struct::label, oldbt_arg::lineno, lineno, rb_iseq_struct::location, name, rb_iseq_location_struct::path, and rb_control_frame_struct::pc.
Referenced by rb_backtrace_print_as_bugreport(), and vm_backtrace_print().
Definition at line 704 of file vm_backtrace.c.
References NIL_P(), and RSTRING_PTR.
Referenced by vm_backtrace_print().
Definition at line 766 of file vm_backtrace.c.
References vm_backtrace_print().
Referenced by load_lock(), and rescue_callback().
Definition at line 413 of file vm_backtrace.c.
References rb_typeddata_is_kind_of().
Referenced by exc_backtrace(), rb_check_backtrace(), and set_backtrace().
Definition at line 750 of file vm_backtrace.c.
References backtrace_each(), oldbt_arg::data, oldbt_arg::func, GET_THREAD(), i, oldbt_bugreport(), oldbt_init(), oldbt_iter_cfunc(), and oldbt_iter_iseq().
Referenced by rb_vm_bugreport().
Definition at line 586 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace_size, backtrace_to_str_ary(), bt_iter_arg::bt, GetCoreDataFromValue, and rb_backtrace_struct::strary.
Referenced by backtrace_dump_data(), exc_backtrace(), and set_backtrace().
VALUE rb_debug_inspector_backtrace_locations | ( | const rb_debug_inspector_t * | dc | ) |
Definition at line 1202 of file vm_backtrace.c.
References rb_debug_inspector_struct::backtrace.
VALUE rb_debug_inspector_frame_binding_get | ( | const rb_debug_inspector_t * | dc, |
long | index | ||
) |
Definition at line 1188 of file vm_backtrace.c.
References CALLER_BINDING_BINDING, frame_get(), and rb_ary_entry().
VALUE rb_debug_inspector_frame_class_get | ( | const rb_debug_inspector_t * | dc, |
long | index | ||
) |
Definition at line 1181 of file vm_backtrace.c.
References CALLER_BINDING_CLASS, frame_get(), and rb_ary_entry().
VALUE rb_debug_inspector_frame_iseq_get | ( | const rb_debug_inspector_t * | dc, |
long | index | ||
) |
Definition at line 1195 of file vm_backtrace.c.
References CALLER_BINDING_ISEQ, frame_get(), and rb_ary_entry().
VALUE rb_debug_inspector_frame_self_get | ( | const rb_debug_inspector_t * | dc, |
long | index | ||
) |
Definition at line 1174 of file vm_backtrace.c.
References CALLER_BINDING_SELF, frame_get(), and rb_ary_entry().
VALUE rb_debug_inspector_open | ( | rb_debug_inspector_func_t | func, |
void * | data | ||
) |
Definition at line 1136 of file vm_backtrace.c.
References rb_debug_inspector_struct::backtrace, rb_debug_inspector_struct::backtrace_size, rb_thread_struct::cfp, rb_debug_inspector_struct::cfp, collect_caller_bindings(), rb_debug_inspector_struct::contexts, data, EXEC_TAG, GET_THREAD(), JUMP_TAG, RARRAY_LEN, result, state, rb_debug_inspector_struct::th, th, TH_POP_TAG, TH_PUSH_TAG, UNINITIALIZED_VAR, and vm_backtrace_location_ary().
Definition at line 911 of file vm_backtrace.c.
References GET_THREAD(), and vm_backtrace_to_ary().
Referenced by Init_vm_backtrace().
Definition at line 939 of file vm_backtrace.c.
References GET_THREAD(), and vm_backtrace_to_ary().
Referenced by Init_vm_backtrace().
Definition at line 772 of file vm_backtrace.c.
References GET_THREAD(), and vm_backtrace_str_ary().
Referenced by argument_error(), and parser_set_encode().
Definition at line 532 of file vm_backtrace.c.
References backtrace_object(), and GET_THREAD().
Referenced by setup_exception().
int rb_vm_get_sourceline | ( | const rb_control_frame_t * | cfp | ) |
Definition at line 33 of file vm_backtrace.c.
References calc_lineno(), rb_control_frame_struct::iseq, lineno, rb_control_frame_struct::pc, and RUBY_VM_NORMAL_ISEQ_P.
Referenced by control_frame_dump(), fill_path_and_lineno(), rb_add_method(), rb_sourceline(), rb_thread_current_status(), and rb_vm_make_binding().
Definition at line 849 of file vm_backtrace.c.
References GetThreadPtr, Qnil, rb_thread_struct::status, th, THREAD_KILLED, rb_thread_struct::to_kill, and vm_backtrace_to_ary().
Referenced by vm_thread_backtrace(), and vm_thread_backtrace_locations().
VALUE vm_backtrace_location_ary | ( | rb_thread_t * | th, |
long | lev, | ||
long | n | ||
) |
Definition at line 655 of file vm_backtrace.c.
References backtrace_object(), and backtrace_to_location_ary().
Referenced by rb_debug_inspector_open().
Definition at line 719 of file vm_backtrace.c.
References backtrace_each(), oldbt_arg::data, oldbt_arg::func, GET_THREAD(), oldbt_init(), oldbt_iter_cfunc(), oldbt_iter_iseq(), and oldbt_print().
Referenced by rb_backtrace().
VALUE vm_backtrace_str_ary | ( | rb_thread_t * | th, |
long | lev, | ||
long | n | ||
) |
Definition at line 649 of file vm_backtrace.c.
References backtrace_object(), and backtrace_to_str_ary().
Referenced by eval_string_with_cref(), and rb_make_backtrace().
|
static |
Definition at line 778 of file vm_backtrace.c.
References backtrace_object(), rb_backtrace_struct::backtrace_size, backtrace_to_location_ary(), backtrace_to_str_ary(), GetCoreDataFromValue, len, level, n, NIL_P(), NUM2LONG, Qfalse, Qnil, r, rb_ary_new(), rb_eArgError, RB_GC_GUARD, rb_raise(), rb_range_beg_len(), and rb_scan_args().
Referenced by rb_f_caller(), rb_f_caller_locations(), and thread_backtrace_to_ary().
Definition at line 861 of file vm_backtrace.c.
References thread_backtrace_to_ary().
Referenced by rb_thread_backtrace_m().
Definition at line 867 of file vm_backtrace.c.
References thread_backtrace_to_ary().
Referenced by rb_thread_backtrace_locations_m().
|
static |
Definition at line 407 of file vm_backtrace.c.
|
static |
Definition at line 112 of file vm_backtrace.c.
|
static |
Definition at line 21 of file vm_backtrace.c.
Referenced by bt_init(), and Init_vm_backtrace().
|
static |
Definition at line 22 of file vm_backtrace.c.
Referenced by Init_vm_backtrace(), and location_create().
VALUE ruby_engine_name |
Definition at line 73 of file version.c.
Referenced by Init_version(), location_to_str(), and oldbt_init().