File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,12 @@ di_body(const rb_debug_inspector_t *dc, void *ptr)
7676 rb_debug_inspector_frame_binding_get (dc , i ),
7777 iseq ,
7878 rb_debug_inspector_frame_class_get (dc , i ),
79- INT2FIX (len - i ));
79+ #ifdef RB_DEBUG_INSPECTOR_FRAME_DEPTH
80+ rb_debug_inspector_frame_depth (dc , i )
81+ #else
82+ INT2FIX (len - i )
83+ #endif
84+ );
8085 rb_ary_push (ary , e );
8186 }
8287
@@ -89,13 +94,22 @@ capture_frames(VALUE self, VALUE skip_path_prefix)
8994 return rb_debug_inspector_open (di_body , (void * )skip_path_prefix );
9095}
9196
97+ #ifdef RB_DEBUG_INSPECTOR_FRAME_DEPTH
98+ static VALUE
99+ frame_depth (VALUE self )
100+ {
101+ return rb_debug_inspector_current_depth ();
102+ }
103+ #else
92104static VALUE
93105frame_depth (VALUE self )
94106{
95107 // TODO: more efficient API
96108 VALUE bt = rb_make_backtrace ();
97109 return INT2FIX (RARRAY_LEN (bt ));
98110}
111+ #endif
112+
99113
100114// iseq
101115
You can’t perform that action at this time.
0 commit comments