Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
debug.h
Go to the documentation of this file.
1#ifndef RB_DEBUG_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RB_DEBUG_H 1
14#include "ruby/internal/event.h"
15#include "ruby/internal/value.h"
16
18
19/* Note: This file contains experimental APIs. */
20/* APIs can be replaced at Ruby 2.0.1 or later */
21
22
23/* profile frames APIs */
24int rb_profile_frames(int start, int limit, VALUE *buff, int *lines);
35
36/* debug inspector APIs */
39
46
47/* Old style set_trace_func APIs */
48
49/* duplicated def of include/ruby/ruby.h */
52
57
58/* TracePoint APIs */
59
60VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
64
67
80
81/*
82 * Postponed Job API
83 * rb_postponed_job_register and rb_postponed_job_register_one are
84 * async-signal-safe and used via SIGPROF by the "stackprof" RubyGem
85 */
86typedef void (*rb_postponed_job_func_t)(void *arg);
87int rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data);
88int rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data);
89
90/* undocumented advanced tracing APIs */
91
92typedef enum {
97
100
102
103#endif /* RUBY_DEBUG_H */
int rb_profile_frames(int start, int limit, VALUE *buff, int *lines)
VALUE rb_profile_frame_full_label(VALUE frame)
VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:917
void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
Definition: vm_trace.c:161
VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index)
VALUE rb_tracepoint_enabled_p(VALUE tpval)
Definition: vm_trace.c:1347
VALUE rb_tracearg_object(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:1018
VALUE rb_tracearg_callee_id(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:903
VALUE rb_profile_frame_method_name(VALUE frame)
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:910
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void(*func)(VALUE, void *), void *data)
Definition: vm_trace.c:1407
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)
Definition: vm_trace.c:168
VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:952
void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
Definition: vm_trace.c:155
VALUE rb_profile_frame_qualified_method_name(VALUE frame)
VALUE rb_profile_frame_label(VALUE frame)
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)
Definition: vm_trace.c:174
VALUE rb_tracepoint_disable(VALUE tpval)
Definition: vm_trace.c:1233
int rb_remove_event_hook(rb_event_hook_func_t func)
Definition: vm_trace.c:265
VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:931
int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func)
Definition: vm_trace.c:253
VALUE rb_profile_frame_singleton_method_p(VALUE frame)
VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc)
VALUE rb_profile_frame_absolute_path(VALUE frame)
int rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data)
Definition: vm_trace.c:1627
VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data)
VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:937
rb_event_flag_t rb_tracearg_event_flag(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:802
VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index)
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:828
int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data)
Definition: vm_trace.c:259
VALUE rb_tracepoint_enable(VALUE tpval)
Definition: vm_trace.c:1125
VALUE(* rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *)
Definition: debug.h:38
VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index)
rb_event_hook_flag_t
Definition: debug.h:92
@ RUBY_EVENT_HOOK_FLAG_DELETED
Definition: debug.h:94
@ RUBY_EVENT_HOOK_FLAG_SAFE
Definition: debug.h:93
@ RUBY_EVENT_HOOK_FLAG_RAW_ARG
Definition: debug.h:95
int rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data)
Definition: vm_trace.c:1608
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:896
VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index)
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data)
Definition: vm_trace.c:271
VALUE rb_profile_frame_classpath(VALUE frame)
rb_trace_arg_t * rb_tracearg_from_tracepoint(VALUE tpval)
Definition: vm_trace.c:796
VALUE rb_profile_frame_path(VALUE frame)
VALUE rb_profile_frame_first_lineno(VALUE frame)
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:822
void(* rb_postponed_job_func_t)(void *arg)
Definition: debug.h:86
VALUE rb_profile_frame_base_label(VALUE frame)
VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg)
Definition: vm_trace.c:808
Tewaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
Debugging and tracing APIs.
void(* rb_event_hook_func_t)(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE klass)
Definition: event.h:67
uint32_t rb_event_flag_t
Definition: event.h:66
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#define const
Definition: strftime.c:108
Defines VALUE and ID.
unsigned long VALUE
Definition: value.h:38