summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-22 05:12:31 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-22 05:12:31 +0000
commitd28e07d57bc15a4baf08f8f4fb64d27cf927aac7 (patch)
treebfbf87a7fce23415d5560c611a6943ef61dc30ed /proc.c
parent22a173df3f462244103a02261c276eeee8926863 (diff)
* vm_trace.c: support TracePoint. [ruby-trunk - Feature #6895]
* test/ruby/test_settracefunc.rb: add tests for above. * proc.c (rb_binding_new_with_cfp): add an internal function. * vm.c (rb_vm_control_frame_id_and_class): add an internal function. * vm_trace.c: add rb_add_event_hook2() and rb_thread_add_event_hook2(). Give us the good name for them! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/proc.c b/proc.c
index 753464bc32..300c6a0b70 100644
--- a/proc.c
+++ b/proc.c
@@ -310,10 +310,9 @@ binding_clone(VALUE self)
}
VALUE
-rb_binding_new(void)
+rb_binding_new_with_cfp(rb_thread_t *th, rb_control_frame_t *src_cfp)
{
- rb_thread_t *th = GET_THREAD();
- rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp);
+ rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, src_cfp);
VALUE bindval = binding_alloc(rb_cBinding);
rb_binding_t *bind;
@@ -328,6 +327,13 @@ rb_binding_new(void)
return bindval;
}
+VALUE
+rb_binding_new(void)
+{
+ rb_thread_t *th = GET_THREAD();
+ return rb_binding_new_with_cfp(th, th->cfp);
+}
+
/*
* call-seq:
* binding -> a_binding