include/ruby/debug.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 
00003   ruby/debug.h -
00004 
00005   $Author: ko1 $
00006   created at: Tue Nov 20 20:35:08 2012
00007 
00008   Copyright (C) 2012 Yukihiro Matsumoto
00009 
00010 **********************************************************************/
00011 
00012 #ifndef RB_DEBUG_H
00013 #define RB_DEBUG_H 1
00014 
00015 #if defined(__cplusplus)
00016 extern "C" {
00017 #if 0
00018 } /* satisfy cc-mode */
00019 #endif
00020 #endif
00021 
00022 RUBY_SYMBOL_EXPORT_BEGIN
00023 
00024 /* Note: This file contains experimental APIs. */
00025 /* APIs can be replaced at Ruby 2.0.1 or later */
00026 
00027 
00028 /* profile frames APIs */
00029 int rb_profile_frames(int start, int limit, VALUE *buff, int *lines);
00030 VALUE rb_profile_frame_path(VALUE frame);
00031 VALUE rb_profile_frame_absolute_path(VALUE frame);
00032 VALUE rb_profile_frame_label(VALUE frame);
00033 VALUE rb_profile_frame_base_label(VALUE frame);
00034 VALUE rb_profile_frame_full_label(VALUE frame);
00035 VALUE rb_profile_frame_first_lineno(VALUE frame);
00036 VALUE rb_profile_frame_classpath(VALUE frame);
00037 VALUE rb_profile_frame_singleton_method_p(VALUE frame);
00038 VALUE rb_profile_frame_method_name(VALUE frame);
00039 VALUE rb_profile_frame_qualified_method_name(VALUE frame);
00040 
00041 /* debug inspector APIs */
00042 typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
00043 typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *);
00044 
00045 VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
00046 VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
00047 VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
00048 VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
00049 VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
00050 VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
00051 
00052 /* Old style set_trace_func APIs */
00053 
00054 /* duplicated def of include/ruby/ruby.h */
00055 void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
00056 int rb_remove_event_hook(rb_event_hook_func_t func);
00057 
00058 int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
00059 void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
00060 int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
00061 int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
00062 
00063 /* TracePoint APIs */
00064 
00065 VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
00066 VALUE rb_tracepoint_enable(VALUE tpval);
00067 VALUE rb_tracepoint_disable(VALUE tpval);
00068 VALUE rb_tracepoint_enabled_p(VALUE tpval);
00069 
00070 typedef struct rb_trace_arg_struct rb_trace_arg_t;
00071 rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
00072 
00073 rb_event_flag_t rb_tracearg_event_flag(rb_trace_arg_t *trace_arg);
00074 VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
00075 VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
00076 VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
00077 VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
00078 VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
00079 VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
00080 VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
00081 VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
00082 VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
00083 VALUE rb_tracearg_object(rb_trace_arg_t *trace_arg);
00084 
00085 /* Postponed Job API */
00086 typedef void (*rb_postponed_job_func_t)(void *arg);
00087 int rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data);
00088 int rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data);
00089 
00090 /* undocumented advanced tracing APIs */
00091 
00092 typedef enum {
00093     RUBY_EVENT_HOOK_FLAG_SAFE    = 0x01,
00094     RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
00095     RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
00096 } rb_event_hook_flag_t;
00097 
00098 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);
00099 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);
00100 
00101 RUBY_SYMBOL_EXPORT_END
00102 
00103 #if defined(__cplusplus)
00104 #if 0
00105 { /* satisfy cc-mode */
00106 #endif
00107 }  /* extern "C" { */
00108 #endif
00109 
00110 #endif /* RUBY_DEBUG_H */
00111 

Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7