Class: Debugger::Context
- Inherits:
-
Object
- Object
- Debugger::Context
- Defined in:
- lib/ruby-debug-base.rb,
ext/ruby_debug/ruby_debug.c
Instance Method Summary collapse
- #__c_frame_binding ⇒ Object
-
#breakpoint ⇒ Object
Returns a context-specific temporary Breakpoint object.
-
#dead? ⇒ Boolean
Returns
true
if context doesn’t represent a live context and is created during post-mortem exception handling. -
#frame_args(frame_position = 0) ⇒ Object
Returns frame’s argument parameters.
-
#frame_args_info(*args) ⇒ Object
Returns info saved about call arguments (if any saved).
-
#frame_binding(frame_position = 0) ⇒ Binding
Returns frame’s binding.
-
#frame_class(frame_position) ⇒ Object
Returns the real class of the frame.
-
#frame_file(frame_position) ⇒ String
Returns the name of the file.
-
#frame_method(frame_position = 0) ⇒ Object
Returns the sym of the called method.
-
#frame_line(frame_position) ⇒ Integer
Returns the line number in the file.
-
#frame_locals(frame) ⇒ Hash
Returns frame’s local variables.
-
#frame_method(frame_position = 0) ⇒ Object
Returns the sym of the called method.
-
#frame_self(frame_postion = 0) ⇒ Object
Returns self object of the frame.
-
#ignored? ⇒ Boolean
Returns the ignore flag for the current context.
- #interrupt ⇒ Object
-
#jump(line, file) ⇒ Boolean
Returns
true
if jump toline
in filenamefile
was successful. -
#break ⇒ Boolean
Returns
true
if context is currently running and set flag to break it at next line. -
#resume ⇒ nil
Resumes the thread from the suspended mode.
-
#set_breakpoint(source, pos, condition = nil) ⇒ Object
Sets a context-specific temporary breakpoint, which can be used to implement ‘Run to Cursor’ debugger function.
-
#stack_size ⇒ Object
Returns the size of the context stack.
-
#step(steps, force = false) ⇒ Object
Stops the current context after a number of
steps
are made. -
#step_over(steps, frame = nil, force = false) ⇒ Object
Steps over a
steps
number of times. -
#stop_frame(frame) ⇒ Object
Stops when a frame with number
frame
is activated. -
#step(steps, force = false) ⇒ Object
Stops the current context after a number of
steps
are made. -
#stop_reason ⇒ Object
Returns the reason for the stop.
-
#suspend ⇒ nil
Suspends the thread when it is running.
-
#suspended? ⇒ Boolean
Returns
true
if the thread is suspended by debugger. -
#thnum ⇒ Integer
Returns the context’s number.
-
#thread ⇒ Object
Returns a thread this context is associated with.
-
#tracing ⇒ Boolean
Returns the tracing flag for the current context.
-
#tracing=(bool) ⇒ Object
Controls the tracing for this context.
Instance Method Details
#__c_frame_binding ⇒ Object
19 |
# File 'lib/ruby-debug-base.rb', line 19 alias __c_frame_binding frame_binding |
#breakpoint ⇒ Object
Returns a context-specific temporary Breakpoint object.
267 268 269 270 271 272 273 274 275 276 |
# File 'ext/ruby_debug/breakpoint.c', line 267
VALUE
context_breakpoint(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
return debug_context->breakpoint;
}
|
#dead? ⇒ Boolean
Returns true
if context doesn’t represent a live context and is created during post-mortem exception handling.
2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 |
# File 'ext/ruby_debug/ruby_debug.c', line 2340
static VALUE
context_dead(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
return CTX_FL_TEST(debug_context, CTX_FL_DEAD) ? Qtrue : Qfalse;
}
|
#frame_args(frame_position = 0) ⇒ Object
Returns frame’s argument parameters
2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 |
# File 'ext/ruby_debug/ruby_debug.c', line 2075
static VALUE
context_frame_args(int argc, VALUE *argv, VALUE self)
{
VALUE frame;
debug_context_t *debug_context;
debug_frame_t *debug_frame;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
debug_frame = GET_FRAME;
if (debug_frame->dead)
return debug_frame->info.copy.args;
else
return context_copy_args(debug_frame);
}
|
#frame_args_info(frame_position = 0) ⇒ Object #track_frame_args ⇒ Object
Returns info saved about call arguments (if any saved).
1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 |
# File 'ext/ruby_debug/ruby_debug.c', line 1805
static VALUE
context_frame_args_info(int argc, VALUE *argv, VALUE self)
{
VALUE frame;
debug_context_t *debug_context;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
return RTEST(track_frame_args) ? GET_FRAME->arg_ary : Qnil;
}
|
#frame_binding(frame_position = 0) ⇒ Binding
Returns frame’s binding.
1824 1825 1826 |
# File 'ext/ruby_debug/ruby_debug.c', line 1824 def frame_binding(frame) __c_frame_binding(frame) || hbinding(frame) end |
#frame_class(frame_position) ⇒ Object
Returns the real class of the frame. It could be different than context.frame_self(frame).class
2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 |
# File 'ext/ruby_debug/ruby_debug.c', line 2121
static VALUE
context_frame_class(int argc, VALUE *argv, VALUE self)
{
VALUE klass;
VALUE frame;
debug_context_t *debug_context;
debug_frame_t *debug_frame;
rb_control_frame_t *cfp;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
debug_frame = GET_FRAME;
cfp = debug_frame->info.runtime.cfp;
klass = real_class(cfp->iseq->klass);
if(TYPE(klass) == T_CLASS || TYPE(klass) == T_MODULE)
return klass;
return Qnil;
}
|
#frame_file(frame_position) ⇒ String
Returns the name of the file.
1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 |
# File 'ext/ruby_debug/ruby_debug.c', line 1895
static VALUE
context_frame_file(int argc, VALUE *argv, VALUE self)
{
VALUE frame;
debug_context_t *debug_context;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
return rb_str_new_cstr(GET_FRAME->file);
//return(GET_FRAME->info.runtime.cfp->iseq->filename);
}
|
#frame_method(frame_position = 0) ⇒ Object
Returns the sym of the called method.
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 |
# File 'ext/ruby_debug/ruby_debug.c', line 1842
static VALUE
context_frame_id(int argc, VALUE *argv, VALUE self)
{
ID id;
VALUE frame;
debug_context_t *debug_context;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
id = GET_FRAME->info.runtime.cfp->iseq->defined_method_id;
return id ? ID2SYM(id): Qnil;
}
|
#frame_line(frame_position) ⇒ Integer
Returns the line number in the file.
1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 |
# File 'ext/ruby_debug/ruby_debug.c', line 1863
static VALUE
context_frame_line(int argc, VALUE *argv, VALUE self)
{
VALUE frame;
debug_context_t *debug_context;
rb_thread_t *th;
rb_control_frame_t *cfp;
VALUE *pc;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
GetThreadPtr(context_thread_0(debug_context), th);
pc = GET_FRAME->info.runtime.last_pc;
cfp = GET_FRAME->info.runtime.cfp;
while (cfp >= th->cfp)
{
if ((cfp->iseq != NULL) && (pc >= cfp->iseq->iseq_encoded) && (pc < cfp->iseq->iseq_encoded + cfp->iseq->iseq_size))
return(INT2FIX(rb_vm_get_sourceline(cfp)));
cfp = RUBY_VM_NEXT_CONTROL_FRAME(cfp);
}
return(INT2FIX(0));
}
|
#frame_locals(frame) ⇒ Hash
Returns frame’s local variables.
2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 |
# File 'ext/ruby_debug/ruby_debug.c', line 2051
static VALUE
context_frame_locals(int argc, VALUE *argv, VALUE self)
{
VALUE frame;
debug_context_t *debug_context;
debug_frame_t *debug_frame;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
debug_frame = GET_FRAME;
if (debug_frame->dead)
return debug_frame->info.copy.locals;
else
return context_copy_locals(debug_context, debug_frame, self);
}
|
#frame_method(frame_position = 0) ⇒ Object
Returns the sym of the called method.
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 |
# File 'ext/ruby_debug/ruby_debug.c', line 1842
static VALUE
context_frame_id(int argc, VALUE *argv, VALUE self)
{
ID id;
VALUE frame;
debug_context_t *debug_context;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
id = GET_FRAME->info.runtime.cfp->iseq->defined_method_id;
return id ? ID2SYM(id): Qnil;
}
|
#frame_self(frame_postion = 0) ⇒ Object
Returns self object of the frame.
2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 |
# File 'ext/ruby_debug/ruby_debug.c', line 2099
static VALUE
context_frame_self(int argc, VALUE *argv, VALUE self)
{
VALUE frame;
debug_context_t *debug_context;
debug_frame_t *debug_frame;
debug_check_started();
frame = optional_frame_position(argc, argv);
Data_Get_Struct(self, debug_context_t, debug_context);
debug_frame = GET_FRAME;
return(debug_frame->self);
}
|
#ignored? ⇒ Boolean
Returns the ignore flag for the current context.
2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 |
# File 'ext/ruby_debug/ruby_debug.c', line 2322
static VALUE
context_ignored(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
return CTX_FL_TEST(debug_context, CTX_FL_IGNORE) ? Qtrue : Qfalse;
}
|
#interrupt ⇒ Object
15 16 17 |
# File 'lib/ruby-debug-base.rb', line 15 def interrupt self.stop_next = 1 end |
#jump(line, file) ⇒ Boolean
Returns true
if jump to line
in filename file
was successful.
2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 |
# File 'ext/ruby_debug/ruby_debug.c', line 2460
static VALUE
context_jump(VALUE self, VALUE line, VALUE file)
{
debug_context_t *debug_context;
debug_frame_t *debug_frame;
unsigned i;
rb_thread_t *th;
rb_control_frame_t *cfp;
rb_control_frame_t *cfp_end;
rb_control_frame_t *cfp_start = NULL;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
GetThreadPtr(context_thread_0(debug_context), th);
debug_frame = get_top_frame(debug_context);
if (debug_frame == NULL)
rb_raise(rb_eRuntimeError, "No frames collected.");
line = FIX2INT(line);
/* find topmost frame of the debugged code */
cfp = th->cfp;
cfp_end = RUBY_VM_END_CONTROL_FRAME(th);
while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, cfp_end))
{
if (cfp->pc == debug_frame->info.runtime.last_pc)
{
cfp_start = cfp;
if ((unsigned)(cfp->pc - cfp->iseq->iseq_encoded) >= (cfp->iseq->iseq_size - 1))
return(INT2FIX(1)); /* no space for opt_call_c_function hijack */
break;
}
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
}
if (cfp_start == NULL)
return(INT2FIX(2)); /* couldn't find frame; should never happen */
/* find target frame to jump to */
while (RUBY_VM_VALID_CONTROL_FRAME_P(cfp, cfp_end))
{
#ifdef HAVE_RB_ISEQ_T_LOCATION
if ((cfp->iseq != NULL) && (rb_str_cmp(file, cfp->iseq->location.path) == 0))
#else
if ((cfp->iseq != NULL) && (rb_str_cmp(file, cfp->iseq->filename) == 0))
#endif
{
#ifdef HAVE_RB_ISEQ_T_LINE_INFO_SIZE
for (i = 0; i < cfp->iseq->line_info_size; i++)
#else
for (i = 0; i < cfp->iseq->insn_info_size; i++)
#endif
{
#ifdef HAVE_RB_ISEQ_T_LINE_INFO_SIZE
if (cfp->iseq->line_info_table[i].line_no != line)
#else
if (cfp->iseq->insn_info_table[i].line_no != line)
#endif
continue;
/* hijack the currently running code so that we can change the frame PC */
debug_context->saved_jump_ins[0] = cfp_start->pc[0];
debug_context->saved_jump_ins[1] = cfp_start->pc[1];
cfp_start->pc[0] = opt_call_c_function;
cfp_start->pc[1] = (VALUE)do_jump;
debug_context->jump_cfp = cfp;
#ifdef HAVE_RB_ISEQ_T_LINE_INFO_SIZE
debug_context->jump_pc =
cfp->iseq->iseq_encoded + cfp->iseq->line_info_table[i].position;
#else
debug_context->jump_pc =
cfp->iseq->iseq_encoded + cfp->iseq->insn_info_table[i].position;
#endif
return(INT2FIX(0)); /* success */
}
}
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
}
return(INT2FIX(3)); /* couldn't find a line and file frame match */
}
|
#break ⇒ Boolean
Returns true
if context is currently running and set flag to break it at next line
2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 |
# File 'ext/ruby_debug/ruby_debug.c', line 2552
static VALUE
context_pause(VALUE self)
{
debug_context_t *debug_context;
rb_thread_t *th;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
if (CTX_FL_TEST(debug_context, CTX_FL_DEAD))
return(Qfalse);
GetThreadPtr(context_thread_0(debug_context), th);
if (th == GET_THREAD())
return(Qfalse);
debug_context->thread_pause = 1;
return(Qtrue);
}
|
#resume ⇒ nil
Resumes the thread from the suspended mode.
2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 |
# File 'ext/ruby_debug/ruby_debug.c', line 2264
static VALUE
context_resume(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
if(!CTX_FL_TEST(debug_context, CTX_FL_SUSPEND))
rb_raise(rb_eRuntimeError, "Thread is not suspended.");
context_resume_0(debug_context);
return Qnil;
}
|
#set_breakpoint(source, pos, condition = nil) ⇒ Object
Sets a context-specific temporary breakpoint, which can be used to implement ‘Run to Cursor’ debugger function. When this breakpoint is reached, it will be cleared out.
source is a name of a file or a class. pos is a line number or a method name if source is a class name. condition is a string which is evaluated to true
when this breakpoint is activated.
291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'ext/ruby_debug/breakpoint.c', line 291
VALUE
context_set_breakpoint(int argc, VALUE *argv, VALUE self)
{
VALUE result;
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
result = create_breakpoint_from_args(argc, argv, 0);
debug_context->breakpoint = result;
return result;
}
|
#stack_size ⇒ Object
Returns the size of the context stack.
2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 |
# File 'ext/ruby_debug/ruby_debug.c', line 2151
static VALUE
context_stack_size(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
return INT2FIX(debug_context->stack_size);
}
|
#step(steps, force = false) ⇒ Object
Stops the current context after a number of steps
are made. force
parameter (if true) ensures that the cursor moves from the current line.
1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 |
# File 'ext/ruby_debug/ruby_debug.c', line 1690
static VALUE
context_stop_next(int argc, VALUE *argv, VALUE self)
{
VALUE steps, force;
debug_context_t *debug_context;
debug_check_started();
rb_scan_args(argc, argv, "11", &steps, &force);
if(FIX2INT(steps) < 0)
rb_raise(rb_eRuntimeError, "Steps argument can't be negative.");
Data_Get_Struct(self, debug_context_t, debug_context);
debug_context->stop_next = FIX2INT(steps);
if(RTEST(force))
CTX_FL_SET(debug_context, CTX_FL_FORCE_MOVE);
else
CTX_FL_UNSET(debug_context, CTX_FL_FORCE_MOVE);
return steps;
}
|
#step_over(steps, frame = nil, force = false) ⇒ Object
Steps over a steps
number of times. Make step over operation on frame
, by default the current frame. force
parameter (if true) ensures that the cursor moves from the current line.
1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 |
# File 'ext/ruby_debug/ruby_debug.c', line 1720
static VALUE
context_step_over(int argc, VALUE *argv, VALUE self)
{
VALUE lines, frame, force;
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
if(debug_context->stack_size == 0)
rb_raise(rb_eRuntimeError, "No frames collected.");
rb_scan_args(argc, argv, "12", &lines, &frame, &force);
debug_context->stop_line = FIX2INT(lines);
CTX_FL_UNSET(debug_context, CTX_FL_STEPPED);
if(frame == Qnil)
{
debug_context->dest_frame = debug_context->stack_size;
}
else
{
if(FIX2INT(frame) < 0 && FIX2INT(frame) >= debug_context->stack_size)
rb_raise(rb_eRuntimeError, "Destination frame is out of range.");
debug_context->dest_frame = debug_context->stack_size - FIX2INT(frame);
}
if(RTEST(force))
CTX_FL_SET(debug_context, CTX_FL_FORCE_MOVE);
else
CTX_FL_UNSET(debug_context, CTX_FL_FORCE_MOVE);
return Qnil;
}
|
#stop_frame(frame) ⇒ Object
Stops when a frame with number frame
is activated. Implements finish
and next
commands.
1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 |
# File 'ext/ruby_debug/ruby_debug.c', line 1758
static VALUE
context_stop_frame(VALUE self, VALUE frame)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
if(FIX2INT(frame) < 0 && FIX2INT(frame) >= debug_context->stack_size)
rb_raise(rb_eRuntimeError, "Stop frame is out of range.");
debug_context->stop_frame = debug_context->stack_size - FIX2INT(frame);
return frame;
}
|
#step(steps, force = false) ⇒ Object
Stops the current context after a number of steps
are made. force
parameter (if true) ensures that the cursor moves from the current line.
1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 |
# File 'ext/ruby_debug/ruby_debug.c', line 1690
static VALUE
context_stop_next(int argc, VALUE *argv, VALUE self)
{
VALUE steps, force;
debug_context_t *debug_context;
debug_check_started();
rb_scan_args(argc, argv, "11", &steps, &force);
if(FIX2INT(steps) < 0)
rb_raise(rb_eRuntimeError, "Steps argument can't be negative.");
Data_Get_Struct(self, debug_context_t, debug_context);
debug_context->stop_next = FIX2INT(steps);
if(RTEST(force))
CTX_FL_SET(debug_context, CTX_FL_FORCE_MOVE);
else
CTX_FL_UNSET(debug_context, CTX_FL_FORCE_MOVE);
return steps;
}
|
#stop_reason ⇒ Object
Returns the reason for the stop. It maybe of the following values: :initial, :step, :breakpoint, :catchpoint, :post-mortem
2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 |
# File 'ext/ruby_debug/ruby_debug.c', line 2358
static VALUE
context_stop_reason(VALUE self)
{
debug_context_t *debug_context;
const char * sym_name;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
switch(debug_context->stop_reason)
{
case CTX_STOP_STEP:
sym_name = "step";
break;
case CTX_STOP_BREAKPOINT:
sym_name = "breakpoint";
break;
case CTX_STOP_CATCHPOINT:
sym_name = "catchpoint";
break;
case CTX_STOP_NONE:
default:
sym_name = "none";
}
if(CTX_FL_TEST(debug_context, CTX_FL_DEAD))
sym_name = "post-mortem";
return ID2SYM(rb_intern(sym_name));
}
|
#suspend ⇒ nil
Suspends the thread when it is running.
2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 |
# File 'ext/ruby_debug/ruby_debug.c', line 2227
static VALUE
context_suspend(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
if(CTX_FL_TEST(debug_context, CTX_FL_SUSPEND))
rb_raise(rb_eRuntimeError, "Already suspended.");
context_suspend_0(debug_context);
return Qnil;
}
|
#suspended? ⇒ Boolean
Returns true
if the thread is suspended by debugger.
2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 |
# File 'ext/ruby_debug/ruby_debug.c', line 2247
static VALUE
context_is_suspended(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
return CTX_FL_TEST(debug_context, CTX_FL_SUSPEND) ? Qtrue : Qfalse;
}
|
#thnum ⇒ Integer
Returns the context’s number.
2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 |
# File 'ext/ruby_debug/ruby_debug.c', line 2185
static VALUE
context_thnum(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
return INT2FIX(debug_context->thnum);
}
|
#thread ⇒ Object
Returns a thread this context is associated with.
2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 |
# File 'ext/ruby_debug/ruby_debug.c', line 2168
static VALUE
context_thread(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
return(id2ref(debug_context->thread_id));
}
|
#tracing ⇒ Boolean
Returns the tracing flag for the current context.
2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 |
# File 'ext/ruby_debug/ruby_debug.c', line 2284
static VALUE
context_tracing(VALUE self)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
return CTX_FL_TEST(debug_context, CTX_FL_TRACING) ? Qtrue : Qfalse;
}
|
#tracing=(bool) ⇒ Object
Controls the tracing for this context.
2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 |
# File 'ext/ruby_debug/ruby_debug.c', line 2301
static VALUE
context_set_tracing(VALUE self, VALUE value)
{
debug_context_t *debug_context;
debug_check_started();
Data_Get_Struct(self, debug_context_t, debug_context);
if(RTEST(value))
CTX_FL_SET(debug_context, CTX_FL_TRACING);
else
CTX_FL_UNSET(debug_context, CTX_FL_TRACING);
return value;
}
|