Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

debug.h
Go to the documentation of this file.
1 /**********************************************************************
2
3 ruby/debug.h -
4
5 $Author: ko1 $
6 created at: Tue Nov 20 20:35:08 2012
7
8 Copyright (C) 2012 Yukihiro Matsumoto
9
10 **********************************************************************/
11
12 #ifndef RB_DEBUG_H
13 #define RB_DEBUG_H 1
14
15 #if defined(__cplusplus)
16 extern "C" {
17 #if 0
18 } /* satisfy cc-mode */
19 #endif
20 #endif
21
22 #if defined __GNUC__ && __GNUC__ >= 4
23 #pragma GCC visibility push(default)
24 #endif
25
26 /* Note: This file contains experimental APIs. */
27 /* APIs can be replaced at Ruby 2.0.1 or later */
28
29 /* debug inspector APIs */
30 typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
31 typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *);
32
33 VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
34 VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
35 VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
36 VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
37 VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
38 VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
39
40 /* Old style set_trace_func APIs */
41
42 /* duplicated def of include/ruby/ruby.h */
43 void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
44 int rb_remove_event_hook(rb_event_hook_func_t func);
45
46 int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
47 void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
48 int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
49 int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
50
51 /* TracePoint APIs */
52
53 VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
54 VALUE rb_tracepoint_enable(VALUE tpval);
55 VALUE rb_tracepoint_disable(VALUE tpval);
56 VALUE rb_tracepoint_enabled_p(VALUE tpval);
57
58 typedef struct rb_trace_arg_struct rb_trace_arg_t;
59 rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
60
61 VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
62 VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
63 VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
64 VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
65 VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
66 VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
67 VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
68 VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
69 VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
70
71 /* undocumented advanced tracing APIs */
72
73 typedef enum {
74 RUBY_EVENT_HOOK_FLAG_SAFE = 0x01,
75 RUBY_EVENT_HOOK_FLAG_DELETED = 0x02,
76 RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04
77 } rb_event_hook_flag_t;
78
79 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);
80 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);
81
82 #if defined __GNUC__ && __GNUC__ >= 4
83 #pragma GCC visibility pop
84 #endif
85
86 #if defined(__cplusplus)
87 #if 0
88 { /* satisfy cc-mode */
89 #endif
90 } /* extern "C" { */
91 #endif
92
93 #endif /* RUBY_DEBUG_H */
94