2012-11-21 08:54:36 -05:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
ruby/debug.h -
|
|
|
|
|
|
|
|
$Author: ko1 $
|
|
|
|
created at: Tue Nov 20 20:35:08 2012
|
|
|
|
|
|
|
|
Copyright (C) 2012 Yukihiro Matsumoto
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef RB_DEBUG_H
|
|
|
|
#define RB_DEBUG_H 1
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#if 0
|
|
|
|
} /* satisfy cc-mode */
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2013-04-05 06:29:38 -04:00
|
|
|
RUBY_SYMBOL_EXPORT_BEGIN
|
2012-11-21 08:54:36 -05:00
|
|
|
|
|
|
|
/* Note: This file contains experimental APIs. */
|
|
|
|
/* APIs can be replaced at Ruby 2.0.1 or later */
|
|
|
|
|
2013-10-07 03:21:11 -04:00
|
|
|
|
|
|
|
/* profile frames APIs */
|
|
|
|
int rb_profile_frames(int start, int limit, VALUE *buff, int *lines);
|
|
|
|
VALUE rb_profile_frame_path(VALUE frame);
|
|
|
|
VALUE rb_profile_frame_absolute_path(VALUE frame);
|
|
|
|
VALUE rb_profile_frame_label(VALUE frame);
|
|
|
|
VALUE rb_profile_frame_base_label(VALUE frame);
|
2013-10-08 20:21:51 -04:00
|
|
|
VALUE rb_profile_frame_full_label(VALUE frame);
|
2013-10-07 03:21:11 -04:00
|
|
|
VALUE rb_profile_frame_first_lineno(VALUE frame);
|
|
|
|
VALUE rb_profile_frame_classpath(VALUE frame);
|
|
|
|
VALUE rb_profile_frame_singleton_method_p(VALUE frame);
|
2013-10-08 08:08:20 -04:00
|
|
|
VALUE rb_profile_frame_method_name(VALUE frame);
|
|
|
|
VALUE rb_profile_frame_qualified_method_name(VALUE frame);
|
2013-10-07 03:21:11 -04:00
|
|
|
|
2012-11-29 02:05:27 -05:00
|
|
|
/* debug inspector APIs */
|
|
|
|
typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
|
|
|
|
typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *, void *);
|
|
|
|
|
|
|
|
VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
|
2013-01-29 03:25:32 -05:00
|
|
|
VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
|
2013-01-28 04:02:19 -05:00
|
|
|
VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
|
2013-01-29 03:25:32 -05:00
|
|
|
VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
|
2013-01-28 04:02:19 -05:00
|
|
|
VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
|
2012-11-29 02:05:27 -05:00
|
|
|
VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
|
|
|
|
|
2012-11-29 01:43:31 -05:00
|
|
|
/* Old style set_trace_func APIs */
|
2012-11-21 08:54:36 -05:00
|
|
|
|
2012-11-29 17:28:16 -05:00
|
|
|
/* duplicated def of include/ruby/ruby.h */
|
2012-11-21 08:54:36 -05:00
|
|
|
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);
|
2012-11-29 17:28:16 -05:00
|
|
|
|
2012-11-21 08:54:36 -05:00
|
|
|
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
|
|
|
|
void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
|
|
|
|
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);
|
|
|
|
|
|
|
|
/* TracePoint APIs */
|
|
|
|
|
|
|
|
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
|
|
|
|
VALUE rb_tracepoint_enable(VALUE tpval);
|
|
|
|
VALUE rb_tracepoint_disable(VALUE tpval);
|
|
|
|
VALUE rb_tracepoint_enabled_p(VALUE tpval);
|
|
|
|
|
2012-12-21 04:48:15 -05:00
|
|
|
typedef struct rb_trace_arg_struct rb_trace_arg_t;
|
|
|
|
rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
|
|
|
|
|
2013-05-26 20:21:02 -04:00
|
|
|
rb_event_flag_t rb_tracearg_event_flag(rb_trace_arg_t *trace_arg);
|
2012-12-21 04:48:15 -05:00
|
|
|
VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
|
|
|
|
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
|
|
|
|
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
|
|
|
|
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg);
|
2017-11-16 02:41:33 -05:00
|
|
|
VALUE rb_tracearg_callee_id(rb_trace_arg_t *trace_arg);
|
2012-12-21 04:48:15 -05:00
|
|
|
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg);
|
|
|
|
VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg);
|
|
|
|
VALUE rb_tracearg_self(rb_trace_arg_t *trace_arg);
|
|
|
|
VALUE rb_tracearg_return_value(rb_trace_arg_t *trace_arg);
|
|
|
|
VALUE rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg);
|
2013-05-26 20:21:02 -04:00
|
|
|
VALUE rb_tracearg_object(rb_trace_arg_t *trace_arg);
|
2012-11-29 01:43:31 -05:00
|
|
|
|
2018-10-22 23:47:45 -04:00
|
|
|
/*
|
|
|
|
* Postponed Job API
|
|
|
|
* rb_postponed_job_register and rb_postponed_job_register_one are
|
|
|
|
* async-signal-safe and used via SIGPROF by the "stackprof" RubyGem
|
|
|
|
*/
|
2013-05-26 17:30:44 -04:00
|
|
|
typedef void (*rb_postponed_job_func_t)(void *arg);
|
|
|
|
int rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data);
|
|
|
|
int rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data);
|
|
|
|
|
2012-11-29 02:05:27 -05:00
|
|
|
/* undocumented advanced tracing APIs */
|
2012-11-29 01:43:31 -05:00
|
|
|
|
|
|
|
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);
|
2012-11-21 08:54:36 -05:00
|
|
|
|
2013-04-05 06:29:38 -04:00
|
|
|
RUBY_SYMBOL_EXPORT_END
|
2012-11-21 08:54:36 -05:00
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
#if 0
|
|
|
|
{ /* satisfy cc-mode */
|
|
|
|
#endif
|
|
|
|
} /* extern "C" { */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* RUBY_DEBUG_H */
|