Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Typedefs | Enumerations | Functions
vm_trace.c File Reference
#include "internal.h"
#include "ruby/debug.h"
#include "vm_core.h"
#include "eval_intern.h"

Go to the source code of this file.

Data Structures

struct  rb_event_hook_struct
 
struct  rb_tp_struct
 
struct  rb_postponed_job_struct
 

Macros

#define MAX_EVENT_NUM   32
 
#define C(name, NAME)   case RUBY_EVENT_##NAME: CONST_ID(id, #name); return id;
 
#define C(name, NAME)   CONST_ID(id, #name); if (sym == ID2SYM(id)) return RUBY_EVENT_##NAME
 
#define MAX_POSTPONED_JOB   1000
 
#define MAX_POSTPONED_JOB_SPECIAL_ADDITION   24
 

Typedefs

typedef struct rb_event_hook_struct rb_event_hook_t
 
typedef void(* rb_event_hook_raw_arg_func_t) (VALUE data, const rb_trace_arg_t *arg)
 
typedef struct rb_tp_struct rb_tp_t
 
typedef struct rb_postponed_job_struct rb_postponed_job_t
 

Enumerations

enum  postponed_job_register_result { PJRR_SUCESS = 0, PJRR_FULL = 1, PJRR_INTERRUPTED = 2 }
 

Functions

void rb_vm_trace_mark_event_hooks (rb_hook_list_t *hooks)
 
void rb_thread_add_event_hook (VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
 
void rb_add_event_hook (rb_event_hook_func_t func, rb_event_flag_t events, VALUE data)
 
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_flags)
 
void rb_add_event_hook2 (rb_event_hook_func_t func, rb_event_flag_t events, VALUE data, rb_event_hook_flag_t hook_flags)
 
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)
 
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)
 
void rb_clear_trace_func (void)
 
void rb_threadptr_exec_event_hooks_and_pop_frame (rb_trace_arg_t *trace_arg)
 
void rb_threadptr_exec_event_hooks (rb_trace_arg_t *trace_arg)
 
VALUE rb_suppress_tracing (VALUE(*func)(VALUE), VALUE arg)
 
struct rb_trace_arg_structrb_tracearg_from_tracepoint (VALUE tpval)
 
rb_event_flag_t rb_tracearg_event_flag (rb_trace_arg_t *trace_arg)
 
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)
 
VALUE rb_tracearg_callee_id (rb_trace_arg_t *trace_arg)
 
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)
 
VALUE rb_tracearg_object (rb_trace_arg_t *trace_arg)
 
VALUE rb_tracepoint_enable (VALUE tpval)
 
VALUE rb_tracepoint_disable (VALUE tpval)
 
VALUE rb_tracepoint_enabled_p (VALUE tpval)
 
VALUE rb_tracepoint_new (VALUE target_thval, rb_event_flag_t events, void(*func)(VALUE, void *), void *data)
 
void Init_vm_trace (void)
 
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)
 
void rb_postponed_job_flush (rb_vm_t *vm)
 

Macro Definition Documentation

◆ C [1/2]

#define C (   name,
  NAME 
)    case RUBY_EVENT_##NAME: CONST_ID(id, #name); return id;

◆ C [2/2]

#define C (   name,
  NAME 
)    CONST_ID(id, #name); if (sym == ID2SYM(id)) return RUBY_EVENT_##NAME

◆ MAX_EVENT_NUM

#define MAX_EVENT_NUM   32

Definition at line 42 of file vm_trace.c.

◆ MAX_POSTPONED_JOB

#define MAX_POSTPONED_JOB   1000

Definition at line 1506 of file vm_trace.c.

◆ MAX_POSTPONED_JOB_SPECIAL_ADDITION

#define MAX_POSTPONED_JOB_SPECIAL_ADDITION   24

Definition at line 1507 of file vm_trace.c.

Typedef Documentation

◆ rb_event_hook_raw_arg_func_t

typedef void(* rb_event_hook_raw_arg_func_t) (VALUE data, const rb_trace_arg_t *arg)

Definition at line 40 of file vm_trace.c.

◆ rb_event_hook_t

◆ rb_postponed_job_t

◆ rb_tp_t

typedef struct rb_tp_struct rb_tp_t

Enumeration Type Documentation

◆ postponed_job_register_result

Enumerator
PJRR_SUCESS 
PJRR_FULL 
PJRR_INTERRUPTED 

Definition at line 1517 of file vm_trace.c.

Function Documentation

◆ Init_vm_trace()

void Init_vm_trace ( void  )

Definition at line 1402 of file vm_trace.c.

References rb_define_global_function().

◆ rb_add_event_hook()

void rb_add_event_hook ( rb_event_hook_func_t  func,
rb_event_flag_t  events,
VALUE  data 
)

Definition at line 135 of file vm_trace.c.

◆ rb_add_event_hook2()

void rb_add_event_hook2 ( rb_event_hook_func_t  func,
rb_event_flag_t  events,
VALUE  data,
rb_event_hook_flag_t  hook_flags 
)

Definition at line 148 of file vm_trace.c.

Referenced by rb_set_coverages().

◆ rb_clear_trace_func()

void rb_clear_trace_func ( void  )

Definition at line 206 of file vm_trace.c.

References GET_VM, and rb_vm_struct::living_threads.

Referenced by ruby_options().

◆ rb_postponed_job_flush()

void rb_postponed_job_flush ( rb_vm_t vm)

◆ rb_postponed_job_register()

int rb_postponed_job_register ( unsigned int  flags,
rb_postponed_job_func_t  func,
void *  data 
)

Definition at line 1551 of file vm_trace.c.

References GET_THREAD, and rb_thread_struct::vm.

◆ rb_postponed_job_register_one()

int rb_postponed_job_register_one ( unsigned int  flags,
rb_postponed_job_func_t  func,
void *  data 
)

◆ rb_remove_event_hook()

int rb_remove_event_hook ( rb_event_hook_func_t  func)

Definition at line 194 of file vm_trace.c.

◆ rb_remove_event_hook_with_data()

int rb_remove_event_hook_with_data ( rb_event_hook_func_t  func,
VALUE  data 
)

Definition at line 200 of file vm_trace.c.

◆ rb_suppress_tracing()

VALUE rb_suppress_tracing ( VALUE(*)(VALUE func,
VALUE  arg 
)

Definition at line 376 of file vm_trace.c.

◆ rb_thread_add_event_hook()

void rb_thread_add_event_hook ( VALUE  thval,
rb_event_hook_func_t  func,
rb_event_flag_t  events,
VALUE  data 
)

Definition at line 129 of file vm_trace.c.

◆ rb_thread_add_event_hook2()

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_flags 
)

Definition at line 142 of file vm_trace.c.

◆ rb_thread_remove_event_hook()

int rb_thread_remove_event_hook ( VALUE  thval,
rb_event_hook_func_t  func 
)

Definition at line 182 of file vm_trace.c.

◆ rb_thread_remove_event_hook_with_data()

int rb_thread_remove_event_hook_with_data ( VALUE  thval,
rb_event_hook_func_t  func,
VALUE  data 
)

Definition at line 188 of file vm_trace.c.

◆ rb_threadptr_exec_event_hooks()

void rb_threadptr_exec_event_hooks ( rb_trace_arg_t trace_arg)

Definition at line 370 of file vm_trace.c.

◆ rb_threadptr_exec_event_hooks_and_pop_frame()

void rb_threadptr_exec_event_hooks_and_pop_frame ( rb_trace_arg_t trace_arg)

Definition at line 364 of file vm_trace.c.

◆ rb_tracearg_binding()

VALUE rb_tracearg_binding ( rb_trace_arg_t trace_arg)

◆ rb_tracearg_callee_id()

VALUE rb_tracearg_callee_id ( rb_trace_arg_t trace_arg)

Definition at line 793 of file vm_trace.c.

◆ rb_tracearg_defined_class()

VALUE rb_tracearg_defined_class ( rb_trace_arg_t trace_arg)

Definition at line 800 of file vm_trace.c.

◆ rb_tracearg_event()

VALUE rb_tracearg_event ( rb_trace_arg_t trace_arg)

Definition at line 729 of file vm_trace.c.

References ID2SYM.

◆ rb_tracearg_event_flag()

rb_event_flag_t rb_tracearg_event_flag ( rb_trace_arg_t trace_arg)

Definition at line 723 of file vm_trace.c.

References rb_trace_arg_struct::event.

◆ rb_tracearg_from_tracepoint()

struct rb_trace_arg_struct* rb_tracearg_from_tracepoint ( VALUE  tpval)

Definition at line 717 of file vm_trace.c.

◆ rb_tracearg_lineno()

VALUE rb_tracearg_lineno ( rb_trace_arg_t trace_arg)

Definition at line 752 of file vm_trace.c.

◆ rb_tracearg_method_id()

VALUE rb_tracearg_method_id ( rb_trace_arg_t trace_arg)

Definition at line 786 of file vm_trace.c.

◆ rb_tracearg_object()

VALUE rb_tracearg_object ( rb_trace_arg_t trace_arg)

◆ rb_tracearg_path()

VALUE rb_tracearg_path ( rb_trace_arg_t trace_arg)

Definition at line 758 of file vm_trace.c.

◆ rb_tracearg_raised_exception()

VALUE rb_tracearg_raised_exception ( rb_trace_arg_t trace_arg)

◆ rb_tracearg_return_value()

VALUE rb_tracearg_return_value ( rb_trace_arg_t trace_arg)

◆ rb_tracearg_self()

VALUE rb_tracearg_self ( rb_trace_arg_t trace_arg)

Definition at line 821 of file vm_trace.c.

References rb_trace_arg_struct::self.

◆ rb_tracepoint_disable()

VALUE rb_tracepoint_disable ( VALUE  tpval)

Definition at line 1030 of file vm_trace.c.

◆ rb_tracepoint_enable()

VALUE rb_tracepoint_enable ( VALUE  tpval)

Definition at line 1011 of file vm_trace.c.

◆ rb_tracepoint_enabled_p()

VALUE rb_tracepoint_enabled_p ( VALUE  tpval)

Definition at line 1158 of file vm_trace.c.

◆ rb_tracepoint_new()

VALUE rb_tracepoint_new ( VALUE  target_thval,
rb_event_flag_t  events,
void(*)(VALUE, void *)  func,
void *  data 
)

Definition at line 1211 of file vm_trace.c.

References NULL, and RTEST.

◆ rb_vm_trace_mark_event_hooks()

void rb_vm_trace_mark_event_hooks ( rb_hook_list_t hooks)