Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby32/include/ruby
File: debug.h
#ifndef RB_DEBUG_H /*-*-C++-*-vi:se ft=cpp:*/
[0] Fix | Delete
#define RB_DEBUG_H 1
[1] Fix | Delete
/**
[2] Fix | Delete
* @file
[3] Fix | Delete
* @author $Author: ko1 $
[4] Fix | Delete
* @date Tue Nov 20 20:35:08 2012
[5] Fix | Delete
* @copyright Copyright (C) 2012 Yukihiro Matsumoto
[6] Fix | Delete
* @copyright This file is a part of the programming language Ruby.
[7] Fix | Delete
* Permission is hereby granted, to either redistribute and/or
[8] Fix | Delete
* modify this file, provided that the conditions mentioned in the
[9] Fix | Delete
* file COPYING are met. Consult the file for details.
[10] Fix | Delete
*/
[11] Fix | Delete
#include "ruby/internal/attr/nonnull.h"
[12] Fix | Delete
#include "ruby/internal/attr/returns_nonnull.h"
[13] Fix | Delete
#include "ruby/internal/dllexport.h"
[14] Fix | Delete
#include "ruby/internal/event.h"
[15] Fix | Delete
#include "ruby/internal/value.h"
[16] Fix | Delete
[17] Fix | Delete
RBIMPL_SYMBOL_EXPORT_BEGIN()
[18] Fix | Delete
[19] Fix | Delete
/* Note: This file contains experimental APIs. */
[20] Fix | Delete
/* APIs can be replaced at Ruby 2.0.1 or later */
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* @name Frame-profiling APIs
[24] Fix | Delete
*
[25] Fix | Delete
* @{
[26] Fix | Delete
*/
[27] Fix | Delete
[28] Fix | Delete
RBIMPL_ATTR_NONNULL((3))
[29] Fix | Delete
/**
[30] Fix | Delete
* Queries mysterious "frame"s of the given range.
[31] Fix | Delete
*
[32] Fix | Delete
* The returned values are opaque backtrace pointers, which you are allowed to
[33] Fix | Delete
* issue a very limited set of operations listed below. Don't call arbitrary
[34] Fix | Delete
* ruby methods.
[35] Fix | Delete
*
[36] Fix | Delete
* @param[in] start Start position (0 means the topmost).
[37] Fix | Delete
* @param[in] limit Number objects of `buff`.
[38] Fix | Delete
* @param[out] buff Return buffer.
[39] Fix | Delete
* @param[out] lines Return buffer.
[40] Fix | Delete
* @return Number of objects filled into `buff`.
[41] Fix | Delete
* @post `buff` is filled with backtrace pointers.
[42] Fix | Delete
* @post `lines` is filled with `__LINE__` of each backtraces.
[43] Fix | Delete
*
[44] Fix | Delete
* @internal
[45] Fix | Delete
*
[46] Fix | Delete
* @shyouhei doesn't like this abuse of ::VALUE. It should have been
[47] Fix | Delete
* `const struct rb_callable_method_entry_struct *`.
[48] Fix | Delete
*/
[49] Fix | Delete
int rb_profile_frames(int start, int limit, VALUE *buff, int *lines);
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Queries the path of the passed backtrace.
[53] Fix | Delete
*
[54] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[55] Fix | Delete
* @retval RUBY_Qnil The frame is implemented in C etc.
[56] Fix | Delete
* @retval otherwise Where `frame` is running.
[57] Fix | Delete
*/
[58] Fix | Delete
VALUE rb_profile_frame_path(VALUE frame);
[59] Fix | Delete
[60] Fix | Delete
/**
[61] Fix | Delete
* Identical to rb_profile_frame_path(), except it tries to expand the
[62] Fix | Delete
* returning path. In case the path is `require`-d from something else
[63] Fix | Delete
* rb_profile_frame_path() can return relative paths. This one tries to avoid
[64] Fix | Delete
* that.
[65] Fix | Delete
*
[66] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[67] Fix | Delete
* @retval "<cfunc>" The frame is in C.
[68] Fix | Delete
* @retval RUBY_Qnil Can't infer real path (inside of `eval` etc.).
[69] Fix | Delete
* @retval otherwise Where `frame` is running.
[70] Fix | Delete
*/
[71] Fix | Delete
VALUE rb_profile_frame_absolute_path(VALUE frame);
[72] Fix | Delete
[73] Fix | Delete
/**
[74] Fix | Delete
* Queries human-readable "label" string. This is `"<main>"` for the toplevel,
[75] Fix | Delete
* `"<compiled>"` for evaluated ones, method name for methods, class name for
[76] Fix | Delete
* classes.
[77] Fix | Delete
*
[78] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[79] Fix | Delete
* @retval RUBY_Qnil Can't infer the label (C etc.).
[80] Fix | Delete
* @retval "<main>" The frame is global toplevel.
[81] Fix | Delete
* @retval "<compiled>" The frame is dynamic.
[82] Fix | Delete
* @retval otherwise Label of the frame.
[83] Fix | Delete
*/
[84] Fix | Delete
VALUE rb_profile_frame_label(VALUE frame);
[85] Fix | Delete
[86] Fix | Delete
/**
[87] Fix | Delete
* Identical to rb_profile_frame_label(), except it does not "qualify" the
[88] Fix | Delete
* result. Consider the following backtrace:
[89] Fix | Delete
*
[90] Fix | Delete
* ```ruby
[91] Fix | Delete
* def bar
[92] Fix | Delete
* caller_locations
[93] Fix | Delete
* end
[94] Fix | Delete
*
[95] Fix | Delete
* def foo
[96] Fix | Delete
* [1].map { bar }.first
[97] Fix | Delete
* end
[98] Fix | Delete
*
[99] Fix | Delete
* obj = foo.first
[100] Fix | Delete
* obj.label # => "block in foo"
[101] Fix | Delete
* obj.base_label # => "foo"
[102] Fix | Delete
* ```
[103] Fix | Delete
*
[104] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[105] Fix | Delete
* @retval RUBY_Qnil Can't infer the label (C etc.).
[106] Fix | Delete
* @retval "<main>" The frame is global toplevel.
[107] Fix | Delete
* @retval "<compiled>" The frame is dynamic.
[108] Fix | Delete
* @retval otherwise Base label of the frame.
[109] Fix | Delete
*/
[110] Fix | Delete
VALUE rb_profile_frame_base_label(VALUE frame);
[111] Fix | Delete
[112] Fix | Delete
/**
[113] Fix | Delete
* Identical to rb_profile_frame_label(), except it returns a qualified result.
[114] Fix | Delete
*
[115] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[116] Fix | Delete
* @retval RUBY_Qnil Can't infer the label (C etc.).
[117] Fix | Delete
* @retval "<main>" The frame is global toplevel.
[118] Fix | Delete
* @retval "<compiled>" The frame is dynamic.
[119] Fix | Delete
* @retval otherwise Qualified label of the frame.
[120] Fix | Delete
*
[121] Fix | Delete
* @internal
[122] Fix | Delete
*
[123] Fix | Delete
* As of writing there is no way to obtain this return value from a Ruby
[124] Fix | Delete
* script. This may change in future (it took 8 years and still no progress,
[125] Fix | Delete
* though).
[126] Fix | Delete
*/
[127] Fix | Delete
VALUE rb_profile_frame_full_label(VALUE frame);
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* Queries the first line of the method of the passed frame pointer. Can be
[131] Fix | Delete
* handy when for instance a debugger want to display the frame in question.
[132] Fix | Delete
*
[133] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[134] Fix | Delete
* @retval RUBY_Qnil Can't infer the line (C etc.).
[135] Fix | Delete
* @retval otherwise Line number of the method in question.
[136] Fix | Delete
*/
[137] Fix | Delete
VALUE rb_profile_frame_first_lineno(VALUE frame);
[138] Fix | Delete
[139] Fix | Delete
/**
[140] Fix | Delete
* Queries the class path of the method that the passed frame represents.
[141] Fix | Delete
*
[142] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[143] Fix | Delete
* @retval RUBY_Qnil Can't infer the class (global toplevel etc.).
[144] Fix | Delete
* @retval otherwise Class path as in rb_class_path().
[145] Fix | Delete
*/
[146] Fix | Delete
VALUE rb_profile_frame_classpath(VALUE frame);
[147] Fix | Delete
[148] Fix | Delete
/**
[149] Fix | Delete
* Queries if the method of the passed frame is a singleton class.
[150] Fix | Delete
*
[151] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[152] Fix | Delete
* @retval RUBY_Qtrue It is a singleton method.
[153] Fix | Delete
* @retval RUBY_Qfalse Otherwise (normal method/non-method).
[154] Fix | Delete
*/
[155] Fix | Delete
VALUE rb_profile_frame_singleton_method_p(VALUE frame);
[156] Fix | Delete
[157] Fix | Delete
/**
[158] Fix | Delete
* Queries the name of the method of the passed frame.
[159] Fix | Delete
*
[160] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[161] Fix | Delete
* @retval RUBY_Qnil The frame in question is not a method.
[162] Fix | Delete
* @retval otherwise Name of the method of the frame.
[163] Fix | Delete
*/
[164] Fix | Delete
VALUE rb_profile_frame_method_name(VALUE frame);
[165] Fix | Delete
[166] Fix | Delete
/**
[167] Fix | Delete
* Identical to rb_profile_frame_method_name(), except it "qualifies" the
[168] Fix | Delete
* return value with its defining class.
[169] Fix | Delete
*
[170] Fix | Delete
* @param[in] frame What rb_profile_frames() returned.
[171] Fix | Delete
* @retval RUBY_Qnil The frame in question is not a method.
[172] Fix | Delete
* @retval otherwise Qualified name of the method of the frame.
[173] Fix | Delete
*/
[174] Fix | Delete
VALUE rb_profile_frame_qualified_method_name(VALUE frame);
[175] Fix | Delete
[176] Fix | Delete
/** @} */
[177] Fix | Delete
[178] Fix | Delete
/**
[179] Fix | Delete
* @name Debug inspector APIs
[180] Fix | Delete
*
[181] Fix | Delete
* @{
[182] Fix | Delete
*/
[183] Fix | Delete
[184] Fix | Delete
/** Opaque struct representing a debug inspector. */
[185] Fix | Delete
typedef struct rb_debug_inspector_struct rb_debug_inspector_t;
[186] Fix | Delete
[187] Fix | Delete
/**
[188] Fix | Delete
* Type of the callback function passed to rb_debug_inspector_open().
[189] Fix | Delete
* Inspection shall happen only inside of them. The passed pointers gets
[190] Fix | Delete
* invalidated once after the callback returns.
[191] Fix | Delete
*
[192] Fix | Delete
* @param[in] dc A debug context.
[193] Fix | Delete
* @param[in,out] data What was passed to rb_debug_inspector_open().
[194] Fix | Delete
* @return What would be the return value of rb_debug_inspector_open().
[195] Fix | Delete
*/
[196] Fix | Delete
typedef VALUE (*rb_debug_inspector_func_t)(const rb_debug_inspector_t *dc, void *data);
[197] Fix | Delete
[198] Fix | Delete
/**
[199] Fix | Delete
* Prepares, executes, then cleans up a debug session.
[200] Fix | Delete
*
[201] Fix | Delete
* @param[in] func A callback to run inside of a debug session.
[202] Fix | Delete
* @param[in,out] data Passed as-is to `func`.
[203] Fix | Delete
* @return What was returned from `func`.
[204] Fix | Delete
*/
[205] Fix | Delete
VALUE rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data);
[206] Fix | Delete
[207] Fix | Delete
/**
[208] Fix | Delete
* Queries the backtrace object of the context. This is as if you call
[209] Fix | Delete
* `caller_locations` at the point of debugger.
[210] Fix | Delete
*
[211] Fix | Delete
* @param[in] dc A debug context.
[212] Fix | Delete
* @return An array of `Thread::Backtrace::Location` which represents the
[213] Fix | Delete
* current point of execution at `dc`.
[214] Fix | Delete
[215] Fix | Delete
*/
[216] Fix | Delete
VALUE rb_debug_inspector_backtrace_locations(const rb_debug_inspector_t *dc);
[217] Fix | Delete
[218] Fix | Delete
/**
[219] Fix | Delete
* Queries the current receiver of the passed context's upper frame.
[220] Fix | Delete
*
[221] Fix | Delete
* @param[in] dc A debug context.
[222] Fix | Delete
* @param[in] index Index of the frame from top to bottom.
[223] Fix | Delete
* @exception rb_eArgError `index` out of range.
[224] Fix | Delete
* @return The current receiver at `index`-th frame.
[225] Fix | Delete
*/
[226] Fix | Delete
VALUE rb_debug_inspector_frame_self_get(const rb_debug_inspector_t *dc, long index);
[227] Fix | Delete
[228] Fix | Delete
/**
[229] Fix | Delete
* Queries the current class of the passed context's upper frame.
[230] Fix | Delete
*
[231] Fix | Delete
* @param[in] dc A debug context.
[232] Fix | Delete
* @param[in] index Index of the frame from top to bottom.
[233] Fix | Delete
* @exception rb_eArgError `index` out of range.
[234] Fix | Delete
* @return The current class at `index`-th frame.
[235] Fix | Delete
*/
[236] Fix | Delete
VALUE rb_debug_inspector_frame_class_get(const rb_debug_inspector_t *dc, long index);
[237] Fix | Delete
[238] Fix | Delete
/**
[239] Fix | Delete
* Queries the binding of the passed context's upper frame.
[240] Fix | Delete
*
[241] Fix | Delete
* @param[in] dc A debug context.
[242] Fix | Delete
* @param[in] index Index of the frame from top to bottom.
[243] Fix | Delete
* @exception rb_eArgError `index` out of range.
[244] Fix | Delete
* @return The binding at `index`-th frame.
[245] Fix | Delete
*/
[246] Fix | Delete
VALUE rb_debug_inspector_frame_binding_get(const rb_debug_inspector_t *dc, long index);
[247] Fix | Delete
[248] Fix | Delete
/**
[249] Fix | Delete
* Queries the instruction sequence of the passed context's upper frame.
[250] Fix | Delete
*
[251] Fix | Delete
* @param[in] dc A debug context.
[252] Fix | Delete
* @param[in] index Index of the frame from top to bottom.
[253] Fix | Delete
* @exception rb_eArgError `index` out of range.
[254] Fix | Delete
* @retval RUBY_Qnil `index`-th frame is not in Ruby (C etc.).
[255] Fix | Delete
* @retval otherwise An instance of `RubyVM::InstructionSequence` which
[256] Fix | Delete
* represents the instruction sequence at `index`-th
[257] Fix | Delete
* frame.
[258] Fix | Delete
*/
[259] Fix | Delete
VALUE rb_debug_inspector_frame_iseq_get(const rb_debug_inspector_t *dc, long index);
[260] Fix | Delete
[261] Fix | Delete
/**
[262] Fix | Delete
* Queries the depth of the passed context's upper frame.
[263] Fix | Delete
*
[264] Fix | Delete
* Note that the depth is not same as the frame index because debug_inspector
[265] Fix | Delete
* skips some special frames but the depth counts all frames.
[266] Fix | Delete
*
[267] Fix | Delete
* @param[in] dc A debug context.
[268] Fix | Delete
* @param[in] index Index of the frame from top to bottom.
[269] Fix | Delete
* @exception rb_eArgError `index` out of range.
[270] Fix | Delete
* @retval The depth at `index`-th frame in Integer.
[271] Fix | Delete
*/
[272] Fix | Delete
VALUE rb_debug_inspector_frame_depth(const rb_debug_inspector_t *dc, long index);
[273] Fix | Delete
[274] Fix | Delete
// A macro to recognize `rb_debug_inspector_frame_depth()` is available or not
[275] Fix | Delete
#define RB_DEBUG_INSPECTOR_FRAME_DEPTH(dc, index) rb_debug_inspector_frame_depth(dc, index)
[276] Fix | Delete
[277] Fix | Delete
/**
[278] Fix | Delete
* Return current frmae depth.
[279] Fix | Delete
*
[280] Fix | Delete
* @retval The depth of the current frame in Integer.
[281] Fix | Delete
*/
[282] Fix | Delete
VALUE rb_debug_inspector_current_depth(void);
[283] Fix | Delete
[284] Fix | Delete
/** @} */
[285] Fix | Delete
[286] Fix | Delete
/**
[287] Fix | Delete
* @name Old style set_trace_func APIs
[288] Fix | Delete
*
[289] Fix | Delete
* @{
[290] Fix | Delete
*/
[291] Fix | Delete
[292] Fix | Delete
/* duplicated def of include/ruby/ruby.h */
[293] Fix | Delete
#include "ruby/internal/event.h"
[294] Fix | Delete
[295] Fix | Delete
/**
[296] Fix | Delete
* Identical to rb_remove_event_hook(), except it additionally takes the data
[297] Fix | Delete
* argument. This extra argument is the same as that of rb_add_event_hook(),
[298] Fix | Delete
* and this function removes the hook which matches both arguments at once.
[299] Fix | Delete
*
[300] Fix | Delete
* @param[in] func A callback.
[301] Fix | Delete
* @param[in] data What to be passed to `func`.
[302] Fix | Delete
* @return Number of deleted event hooks.
[303] Fix | Delete
* @note As multiple events can share the same `func` it is quite
[304] Fix | Delete
* possible for the return value to become more than one.
[305] Fix | Delete
*/
[306] Fix | Delete
int rb_remove_event_hook_with_data(rb_event_hook_func_t func, VALUE data);
[307] Fix | Delete
[308] Fix | Delete
/**
[309] Fix | Delete
* Identical to rb_add_event_hook(), except its effect is limited to the passed
[310] Fix | Delete
* thread. Other threads are not affected by this.
[311] Fix | Delete
*
[312] Fix | Delete
* @param[in] thval An instance of ::rb_cThread.
[313] Fix | Delete
* @param[in] func A callback.
[314] Fix | Delete
* @param[in] events A set of events that `func` should run.
[315] Fix | Delete
* @param[in] data Passed as-is to `func`.
[316] Fix | Delete
* @exception rb_eTypeError `thval` is not a thread.
[317] Fix | Delete
*/
[318] Fix | Delete
void rb_thread_add_event_hook(VALUE thval, rb_event_hook_func_t func, rb_event_flag_t events, VALUE data);
[319] Fix | Delete
[320] Fix | Delete
/**
[321] Fix | Delete
* Identical to rb_remove_event_hook(), except it additionally takes a thread
[322] Fix | Delete
* argument. This extra argument is the same as that of
[323] Fix | Delete
* rb_thread_add_event_hook(), and this function removes the hook which matches
[324] Fix | Delete
* both arguments at once.
[325] Fix | Delete
*
[326] Fix | Delete
* @param[in] thval An instance of ::rb_cThread.
[327] Fix | Delete
* @param[in] func A callback.
[328] Fix | Delete
* @exception rb_eTypeError `thval` is not a thread.
[329] Fix | Delete
* @return Number of deleted event hooks.
[330] Fix | Delete
* @note As multiple events can share the same `func` it is quite
[331] Fix | Delete
* possible for the return value to become more than one.
[332] Fix | Delete
*/
[333] Fix | Delete
int rb_thread_remove_event_hook(VALUE thval, rb_event_hook_func_t func);
[334] Fix | Delete
[335] Fix | Delete
/**
[336] Fix | Delete
* Identical to rb_thread_remove_event_hook(), except it additionally takes the
[337] Fix | Delete
* data argument. It can also be seen as a routine identical to
[338] Fix | Delete
* rb_remove_event_hook_with_data(), except it additionally takes the thread.
[339] Fix | Delete
* This function deletes hooks that satisfy all three criteria.
[340] Fix | Delete
*
[341] Fix | Delete
* @param[in] thval An instance of ::rb_cThread.
[342] Fix | Delete
* @param[in] func A callback.
[343] Fix | Delete
* @param[in] data What to be passed to `func`.
[344] Fix | Delete
* @exception rb_eTypeError `thval` is not a thread.
[345] Fix | Delete
* @return Number of deleted event hooks.
[346] Fix | Delete
* @note As multiple events can share the same `func` it is quite
[347] Fix | Delete
* possible for the return value to become more than one.
[348] Fix | Delete
*/
[349] Fix | Delete
int rb_thread_remove_event_hook_with_data(VALUE thval, rb_event_hook_func_t func, VALUE data);
[350] Fix | Delete
[351] Fix | Delete
/** @} */
[352] Fix | Delete
[353] Fix | Delete
/**
[354] Fix | Delete
* @name TracePoint APIs
[355] Fix | Delete
*
[356] Fix | Delete
* @{
[357] Fix | Delete
*/
[358] Fix | Delete
[359] Fix | Delete
/**
[360] Fix | Delete
* Creates a tracepoint by registering a callback function for one or more
[361] Fix | Delete
* tracepoint events. Once the tracepoint is created, you can use
[362] Fix | Delete
* rb_tracepoint_enable to enable the tracepoint.
[363] Fix | Delete
*
[364] Fix | Delete
* @param[in] target_thread_not_supported_yet Meant for picking the
[365] Fix | Delete
* thread in which the tracepoint is to be created.
[366] Fix | Delete
* However, current implementation ignore this
[367] Fix | Delete
* parameter, tracepoint is created for all threads.
[368] Fix | Delete
* Simply specify Qnil.
[369] Fix | Delete
* @param[in] events Event(s) to listen to.
[370] Fix | Delete
* @param[in] func A callback function.
[371] Fix | Delete
* @param[in,out] data Void pointer that will be passed to the callback
[372] Fix | Delete
* function.
[373] Fix | Delete
*
[374] Fix | Delete
* When the callback function is called, it will be passed 2 parameters:
[375] Fix | Delete
* 1. `VALUE tpval` - the TracePoint object from which trace args can be
[376] Fix | Delete
* extracted.
[377] Fix | Delete
* 1. `void *data` - A void pointer which helps to share scope with the
[378] Fix | Delete
* callback function.
[379] Fix | Delete
*
[380] Fix | Delete
* It is important to note that you cannot register callbacks for normal events
[381] Fix | Delete
* and internal events simultaneously because they are different purpose. You
[382] Fix | Delete
* can use any Ruby APIs (calling methods and so on) on normal event hooks.
[383] Fix | Delete
* However, in internal events, you can not use any Ruby APIs (even object
[384] Fix | Delete
* creations). This is why we can't specify internal events by TracePoint
[385] Fix | Delete
* directly. Limitations are MRI version specific.
[386] Fix | Delete
*
[387] Fix | Delete
* Example:
[388] Fix | Delete
*
[389] Fix | Delete
* ```CXX
[390] Fix | Delete
* rb_tracepoint_new(
[391] Fix | Delete
* Qnil,
[392] Fix | Delete
* RUBY_INTERNAL_EVENT_NEWOBJ | RUBY_INTERNAL_EVENT_FREEOBJ,
[393] Fix | Delete
* obj_event_i,
[394] Fix | Delete
* data);
[395] Fix | Delete
* ```
[396] Fix | Delete
*
[397] Fix | Delete
* In this example, a callback function `obj_event_i` will be registered for
[398] Fix | Delete
* internal events #RUBY_INTERNAL_EVENT_NEWOBJ and
[399] Fix | Delete
* #RUBY_INTERNAL_EVENT_FREEOBJ.
[400] Fix | Delete
*/
[401] Fix | Delete
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void (*func)(VALUE, void *), void *data);
[402] Fix | Delete
[403] Fix | Delete
/**
[404] Fix | Delete
* Starts (enables) trace(s) defined by the passed object. A TracePoint object
[405] Fix | Delete
* does not immediately take effect on creation. You have to explicitly call
[406] Fix | Delete
* this API.
[407] Fix | Delete
*
[408] Fix | Delete
* @param[in] tpval An instance of TracePoint.
[409] Fix | Delete
* @exception rb_eArgError A trace is already running.
[410] Fix | Delete
* @return Undefined value. Forget this. It should have returned `void`.
[411] Fix | Delete
* @post Trace(s) defined by `tpval` start.
[412] Fix | Delete
*/
[413] Fix | Delete
VALUE rb_tracepoint_enable(VALUE tpval);
[414] Fix | Delete
[415] Fix | Delete
/**
[416] Fix | Delete
* Stops (disables) an already running instance of TracePoint.
[417] Fix | Delete
*
[418] Fix | Delete
* @param[in] tpval An instance of TracePoint.
[419] Fix | Delete
* @return Undefined value. Forget this. It should have returned `void`.
[420] Fix | Delete
* @post Trace(s) defined by `tpval` stop.
[421] Fix | Delete
*/
[422] Fix | Delete
VALUE rb_tracepoint_disable(VALUE tpval);
[423] Fix | Delete
[424] Fix | Delete
/**
[425] Fix | Delete
* Queries if the passed TracePoint is up and running.
[426] Fix | Delete
*
[427] Fix | Delete
* @param[in] tpval An instance of TracePoint.
[428] Fix | Delete
* @retval RUBY_Qtrue It is.
[429] Fix | Delete
* @retval RUBY_Qfalse It isn't.
[430] Fix | Delete
*/
[431] Fix | Delete
VALUE rb_tracepoint_enabled_p(VALUE tpval);
[432] Fix | Delete
[433] Fix | Delete
/**
[434] Fix | Delete
* Type that represents a specific trace event. Roughly resembles the
[435] Fix | Delete
* tracepoint object that is passed to the block of `TracePoint.new`:
[436] Fix | Delete
*
[437] Fix | Delete
* ```ruby
[438] Fix | Delete
* TracePoint.new(*events) do |obj|
[439] Fix | Delete
* ... # ^^^^^ Resembles this object.
[440] Fix | Delete
* end
[441] Fix | Delete
* ```
[442] Fix | Delete
*/
[443] Fix | Delete
typedef struct rb_trace_arg_struct rb_trace_arg_t;
[444] Fix | Delete
[445] Fix | Delete
RBIMPL_ATTR_RETURNS_NONNULL()
[446] Fix | Delete
/**
[447] Fix | Delete
* Queries the current event of the passed tracepoint.
[448] Fix | Delete
*
[449] Fix | Delete
* @param[in] tpval An instance of TracePoint.
[450] Fix | Delete
* @exception rb_eRuntimeError `tpval` is disabled.
[451] Fix | Delete
* @return The current event.
[452] Fix | Delete
*
[453] Fix | Delete
* @internal
[454] Fix | Delete
*
[455] Fix | Delete
* `tpval` is a fake. There is only one instance of ::rb_trace_arg_t at one
[456] Fix | Delete
* time. This function just returns that global variable.
[457] Fix | Delete
*/
[458] Fix | Delete
rb_trace_arg_t *rb_tracearg_from_tracepoint(VALUE tpval);
[459] Fix | Delete
[460] Fix | Delete
RBIMPL_ATTR_NONNULL(())
[461] Fix | Delete
/**
[462] Fix | Delete
* Queries the event of the passed trace.
[463] Fix | Delete
*
[464] Fix | Delete
* @param[in] trace_arg A trace instance.
[465] Fix | Delete
* @return Its event.
[466] Fix | Delete
*/
[467] Fix | Delete
rb_event_flag_t rb_tracearg_event_flag(rb_trace_arg_t *trace_arg);
[468] Fix | Delete
[469] Fix | Delete
RBIMPL_ATTR_NONNULL(())
[470] Fix | Delete
/**
[471] Fix | Delete
* Identical to rb_tracearg_event_flag(), except it returns the name of the
[472] Fix | Delete
* event in Ruby's symbol.
[473] Fix | Delete
*
[474] Fix | Delete
* @param[in] trace_arg A trace instance.
[475] Fix | Delete
* @return Its event, in Ruby level Symbol object.
[476] Fix | Delete
*/
[477] Fix | Delete
VALUE rb_tracearg_event(rb_trace_arg_t *trace_arg);
[478] Fix | Delete
[479] Fix | Delete
RBIMPL_ATTR_NONNULL(())
[480] Fix | Delete
/**
[481] Fix | Delete
* Queries the line of the point where the trace is at.
[482] Fix | Delete
*
[483] Fix | Delete
* @param[in] trace_arg A trace instance.
[484] Fix | Delete
* @retval 0 The trace is not at Ruby frame.
[485] Fix | Delete
* @return otherwise Its line number.
[486] Fix | Delete
*/
[487] Fix | Delete
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg);
[488] Fix | Delete
[489] Fix | Delete
RBIMPL_ATTR_NONNULL(())
[490] Fix | Delete
/**
[491] Fix | Delete
* Queries the file name of the point where the trace is at.
[492] Fix | Delete
*
[493] Fix | Delete
* @param[in] trace_arg A trace instance.
[494] Fix | Delete
* @retval RUBY_Qnil The trace is not at Ruby frame.
[495] Fix | Delete
* @retval otherwise Its path.
[496] Fix | Delete
*/
[497] Fix | Delete
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg);
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function