summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 06:43:31 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 06:43:31 +0000
commit3f606b7063fc7a8b191556365ad343a314719a8d (patch)
tree0f90293cb4aa7d6d99b5e96996a63a5eee17464b /include/ruby
parentd81b5a4ffb9f549cfefdc41581fe9fa7dbb91130 (diff)
* include/ruby/debug.h: provide rb_tracearg_*() APIs,
instead of rb_tracepoint_attr_*(). These APIs are for debuggers/profilers. They will be explained in another docs somtime. * vm_trace.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/debug.h43
1 files changed, 24 insertions, 19 deletions
diff --git a/include/ruby/debug.h b/include/ruby/debug.h
index 19b7090007..8eec34501a 100644
--- a/include/ruby/debug.h
+++ b/include/ruby/debug.h
@@ -26,13 +26,8 @@ extern "C" {
/* Note: This file contains experimental APIs. */
/* APIs can be replaced at Ruby 2.0.1 or later */
-typedef enum {
- RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
- RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
- RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
-} rb_event_hook_flag_t;
+/* Old style set_trace_func APIs */
-/* Safe API. Callback will be called under PUSH_TAG() */
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
int rb_remove_event_hook(rb_event_hook_func_t func);
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
@@ -40,10 +35,6 @@ void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_f
int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
-/* advanced version */
-void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
-void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
-
/* TracePoint APIs */
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
@@ -51,15 +42,29 @@ VALUE rb_tracepoint_enable(VALUE tpval);
VALUE rb_tracepoint_disable(VALUE tpval);
VALUE rb_tracepoint_enabled_p(VALUE tpval);
-VALUE rb_tracepoint_attr_event(VALUE tpval);
-VALUE rb_tracepoint_attr_lineno(VALUE tpval);
-VALUE rb_tracepoint_attr_path(VALUE tpval);
-VALUE rb_tracepoint_attr_method_id(VALUE tpval);
-VALUE rb_tracepoint_attr_defined_class(VALUE tpval);
-VALUE rb_tracepoint_attr_binding(VALUE tpval);
-VALUE rb_tracepoint_attr_self(VALUE tpval);
-VALUE rb_tracepoint_attr_return_value(VALUE tpval);
-VALUE rb_tracepoint_attr_raised_exception(VALUE tpval);
+struct rb_trace_arg_struct;
+struct rb_trace_arg_struct *rb_tracearg_from_tracepoint(VALUE tpval);
+
+VALUE rb_tracearg_event(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_lineno(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_path(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_method_id(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_defined_class(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_binding(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_self(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_return_value(struct rb_trace_arg_struct *trace_arg);
+VALUE rb_tracearg_raised_exception(struct rb_trace_arg_struct *trace_arg);
+
+/* undocumented advanced APIs */
+
+typedef enum {
+ RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
+ RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
+ RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
+} rb_event_hook_flag_t;
+
+void rb_add_event_hook2(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
+void rb_thread_add_event_hook2(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flag);
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility pop