Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Typedefs | Enumerations | Functions
debug.h File Reference

Go to the source code of this file.

## Typedefs
typedef struct rb_debug_inspector_struct | rb_debug_inspector_t
typedef VALUE(* | rb_debug_inspector_func_t) (const rb_debug_inspector_t *, void *)
typedef struct rb_trace_arg_struct | rb_trace_arg_t
typedef void(* | rb_postponed_job_func_t) (void *arg)

## Enumerations
enum | rb_event_hook_flag_t { RUBY_EVENT_HOOK_FLAG_SAFE = 0x01, RUBY_EVENT_HOOK_FLAG_DELETED = 0x02, RUBY_EVENT_HOOK_FLAG_RAW_ARG = 0x04 }

## Functions
RUBY_SYMBOL_EXPORT_BEGIN 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)
VALUE | rb_profile_frame_full_label (VALUE frame)
VALUE | rb_profile_frame_first_lineno (VALUE frame)
VALUE | rb_profile_frame_classpath (VALUE frame)
VALUE | rb_profile_frame_singleton_method_p (VALUE frame)
VALUE | rb_profile_frame_method_name (VALUE frame)
VALUE | rb_profile_frame_qualified_method_name (VALUE frame)
VALUE | rb_debug_inspector_open (rb_debug_inspector_func_t func, void *data)
VALUE | rb_debug_inspector_frame_self_get (const rb_debug_inspector_t *dc, long index)
VALUE | rb_debug_inspector_frame_class_get (const rb_debug_inspector_t *dc, long index)
VALUE | rb_debug_inspector_frame_binding_get (const rb_debug_inspector_t *dc, long index)
VALUE | rb_debug_inspector_frame_iseq_get (const rb_debug_inspector_t *dc, long index)
VALUE | rb_debug_inspector_backtrace_locations (const rb_debug_inspector_t *dc)
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)
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)
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)
rb_trace_arg_t * | rb_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)
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_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)

## Typedef Documentation

## ◆ rb_debug_inspector_func_t

typedef VALUE(* rb_debug_inspector_func_t) (const rb_debug_inspector_t *, void *)

Definition at line 43 of file debug.h.

## ◆ rb_debug_inspector_t

typedef struct rb_debug_inspector_struct rb_debug_inspector_t

Definition at line 42 of file debug.h.

## ◆ rb_postponed_job_func_t

typedef void(* rb_postponed_job_func_t) (void *arg)

Definition at line 91 of file debug.h.

## ◆ rb_trace_arg_t

typedef struct rb_trace_arg_struct rb_trace_arg_t

Definition at line 70 of file debug.h.

## Enumeration Type Documentation

## ◆ rb_event_hook_flag_t

enum rb_event_hook_flag_t

Enumerator
RUBY_EVENT_HOOK_FLAG_SAFE |
RUBY_EVENT_HOOK_FLAG_DELETED |
RUBY_EVENT_HOOK_FLAG_RAW_ARG |

Definition at line 97 of file debug.h.

## Function Documentation

## ◆ 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 157 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_flag
| ) |  |

Definition at line 170 of file vm_trace.c.

## ◆ rb_debug_inspector_backtrace_locations()

VALUE rb_debug_inspector_backtrace_locations | ( | const rb_debug_inspector_t * | dc | ) |

Definition at line 1302 of file vm_backtrace.c.

References rb_debug_inspector_struct::backtrace.

## ◆ rb_debug_inspector_frame_binding_get()

VALUE rb_debug_inspector_frame_binding_get | ( | const rb_debug_inspector_t * | dc,
|  | long | index
| ) |  |

Definition at line 1286 of file vm_backtrace.c.

## ◆ rb_debug_inspector_frame_class_get()

VALUE rb_debug_inspector_frame_class_get | ( | const rb_debug_inspector_t * | dc,
|  | long | index
| ) |  |

Definition at line 1279 of file vm_backtrace.c.

## ◆ rb_debug_inspector_frame_iseq_get()

VALUE rb_debug_inspector_frame_iseq_get | ( | const rb_debug_inspector_t * | dc,
|  | long | index
| ) |  |

Definition at line 1293 of file vm_backtrace.c.

## ◆ rb_debug_inspector_frame_self_get()

VALUE rb_debug_inspector_frame_self_get | ( | const rb_debug_inspector_t * | dc,
|  | long | index
| ) |  |

Definition at line 1272 of file vm_backtrace.c.

## ◆ rb_debug_inspector_open()

VALUE rb_debug_inspector_open | ( | rb_debug_inspector_func_t | func,
|  | void * | data
| ) |  |

Definition at line 1231 of file vm_backtrace.c.

References GET_EC, and MAYBE_UNUSED.

## ◆ rb_postponed_job_register()

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

Definition at line 1589 of file vm_trace.c.

References GET_EC.

## ◆ rb_postponed_job_register_one()

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

Definition at line 1608 of file vm_trace.c.

References GET_EC.

## ◆ rb_profile_frame_absolute_path()

VALUE rb_profile_frame_absolute_path | ( | VALUE | frame | ) |

Definition at line 1375 of file vm_backtrace.c.

References iseq.

## ◆ rb_profile_frame_base_label()

VALUE rb_profile_frame_base_label | ( | VALUE | frame | ) |

Definition at line 1389 of file vm_backtrace.c.

References iseq.

Referenced by rb_profile_frame_full_label().

## ◆ rb_profile_frame_classpath()

VALUE rb_profile_frame_classpath | ( | VALUE | frame | ) |

Definition at line 1418 of file vm_backtrace.c.

References klass.

## ◆ rb_profile_frame_first_lineno()

VALUE rb_profile_frame_first_lineno | ( | VALUE | frame | ) |

Definition at line 1396 of file vm_backtrace.c.

References iseq.

## ◆ rb_profile_frame_full_label()

VALUE rb_profile_frame_full_label | ( | VALUE | frame | ) |

Definition at line 1481 of file vm_backtrace.c.

References NIL_P, PRIsVALUE, rb_long2int, rb_profile_frame_base_label(), rb_profile_frame_label(), rb_profile_frame_qualified_method_name(), rb_sprintf(), RSTRING_LEN, and RSTRING_PTR.

## ◆ rb_profile_frame_label()

VALUE rb_profile_frame_label | ( | VALUE | frame | ) |

Definition at line 1382 of file vm_backtrace.c.

References iseq.

Referenced by rb_profile_frame_full_label().

## ◆ rb_profile_frame_method_name()

VALUE rb_profile_frame_method_name | ( | VALUE | frame | ) |

Definition at line 1452 of file vm_backtrace.c.

References iseq.

## ◆ rb_profile_frame_path()

VALUE rb_profile_frame_path | ( | VALUE | frame | ) |

Definition at line 1368 of file vm_backtrace.c.

References iseq.

## ◆ rb_profile_frame_qualified_method_name()

VALUE rb_profile_frame_qualified_method_name | ( | VALUE | frame | ) |

Definition at line 1459 of file vm_backtrace.c.

Referenced by rb_profile_frame_full_label().

## ◆ rb_profile_frame_singleton_method_p()

VALUE rb_profile_frame_singleton_method_p | ( | VALUE | frame | ) |

Definition at line 1439 of file vm_backtrace.c.

References klass.

## ◆ rb_profile_frames()

RUBY_SYMBOL_EXPORT_BEGIN int rb_profile_frames | ( | int | start,
|  | int | limit,
|  | VALUE * | buff,
|  | int * | lines
| ) |  |

Definition at line 1308 of file vm_backtrace.c.

References rb_execution_context_struct::cfp, cfp, GET_EC, and i.

## ◆ rb_remove_event_hook()

int rb_remove_event_hook | ( | rb_event_hook_func_t | func | ) |

Definition at line 262 of file vm_trace.c.

Referenced by rb_reset_coverages().

## ◆ rb_remove_event_hook_with_data()

int rb_remove_event_hook_with_data | ( | rb_event_hook_func_t | func,
|  | VALUE | data
| ) |  |

Definition at line 268 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 151 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_flag
| ) |  |

Definition at line 164 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 250 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 256 of file vm_trace.c.

## ◆ rb_tracearg_binding()

VALUE rb_tracearg_binding | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 907 of file vm_trace.c.

References rb_trace_arg_struct::cfp, cfp, rb_trace_arg_struct::ec, Qnil, rb_vm_get_binding_creatable_next_cfp(), and rb_vm_make_binding().

## ◆ rb_tracearg_callee_id()

VALUE rb_tracearg_callee_id | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 893 of file vm_trace.c.

## ◆ rb_tracearg_defined_class()

VALUE rb_tracearg_defined_class | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 900 of file vm_trace.c.

## ◆ rb_tracearg_event()

VALUE rb_tracearg_event | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 798 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 792 of file vm_trace.c.

References rb_trace_arg_struct::event.

## ◆ rb_tracearg_from_tracepoint()

rb_trace_arg_t* rb_tracearg_from_tracepoint | ( | VALUE | tpval | ) |

Definition at line 786 of file vm_trace.c.

## ◆ rb_tracearg_lineno()

VALUE rb_tracearg_lineno | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 812 of file vm_trace.c.

## ◆ rb_tracearg_method_id()

VALUE rb_tracearg_method_id | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 886 of file vm_trace.c.

## ◆ rb_tracearg_object()

VALUE rb_tracearg_object | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 1008 of file vm_trace.c.

References rb_trace_arg_struct::data, rb_trace_arg_struct::event, Qundef, rb_bug(), rb_eRuntimeError, rb_raise(), RUBY_INTERNAL_EVENT_FREEOBJ, and RUBY_INTERNAL_EVENT_NEWOBJ.

## ◆ rb_tracearg_path()

VALUE rb_tracearg_path | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 818 of file vm_trace.c.

## ◆ rb_tracearg_raised_exception()

VALUE rb_tracearg_raised_exception | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 942 of file vm_trace.c.

References rb_trace_arg_struct::data, rb_trace_arg_struct::event, Qundef, rb_bug(), rb_eRuntimeError, rb_raise(), and RUBY_EVENT_RAISE.

## ◆ rb_tracearg_return_value()

VALUE rb_tracearg_return_value | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 927 of file vm_trace.c.

References rb_trace_arg_struct::data, rb_trace_arg_struct::event, Qundef, rb_bug(), rb_eRuntimeError, rb_raise(), RUBY_EVENT_B_RETURN, RUBY_EVENT_C_RETURN, and RUBY_EVENT_RETURN.

## ◆ rb_tracearg_self()

VALUE rb_tracearg_self | ( | rb_trace_arg_t * | trace_arg | ) |

Definition at line 921 of file vm_trace.c.

References rb_trace_arg_struct::self.

## ◆ rb_tracepoint_disable()

VALUE rb_tracepoint_disable | ( | VALUE | tpval | ) |

Definition at line 1221 of file vm_trace.c.

## ◆ rb_tracepoint_enable()

VALUE rb_tracepoint_enable | ( | VALUE | tpval | ) |

Definition at line 1113 of file vm_trace.c.

## ◆ rb_tracepoint_enabled_p()

VALUE rb_tracepoint_enabled_p | ( | VALUE | tpval | ) |

Definition at line 1335 of file vm_trace.c.

## ◆ rb_tracepoint_new()

VALUE rb_tracepoint_new | ( | VALUE | target_thread_not_supported_yet,
|  | rb_event_flag_t | events,
|  | void(*)(VALUE, void *) | func,
|  | void * | data
| ) |  |

Definition at line 1394 of file vm_trace.c.

References NULL, and RTEST.