Class: Debugger::Context

Class | Debugger::Context
In: | lib/ruby-debug-base.rb ext/ruby_debug.c
Parent: | Object

Document-class: Context

## Summary

Debugger keeps a single instance of this class for each Ruby thread.

### Methods

breakpoint dead? frame_args frame_args_info frame_binding frame_binding frame_class frame_file frame_id frame_line frame_locals frame_method frame_self ignored? interrupt resume set_breakpoint stack_size step step_over stop_frame= stop_next= stop_reason suspend suspended? thnum thread tracing tracing=

### External Aliases

frame_binding | -> | __c_frame_binding

### Public Instance methods

context.breakpoint → breakpoint

Returns a context-specific temporary Breakpoint object.

context.dead? → bool

Returns `true` if context doesn‘t represent a live context and is created during post-mortem exception handling.

context.frame_args(frame_position=0) → list

Returns frame‘s argument parameters

context.frame_args_info(frame_position=0) → list
if track_frame_args or nil otherwise

Returns info saved about call arguments (if any saved).

frame_binding(frame)
context.frame_binding(frame_position=0) → binding

Returns frame‘s binding.

context.frame_class(frame_position) → obj

Returns the real class of the frame. It could be different than context.frame_self(frame).class

context.frame_file(frame_position) → string

Returns the name of the file.

context.frame_method(frame_position=0) → sym

Returns the sym of the called method.

context.frame_line(frame_position) → int

Returns the line number in the file.

context.frame_locals(frame) → hash

Returns frame‘s local variables.

context.frame_method(frame_position=0) → sym

Returns the sym of the called method.

context.frame_self(frame_postion=0) → obj

Returns self object of the frame.

context.ignored? → bool

Returns the ignore flag for the current context.

interrupt()
context.resume → nil

Resumes the thread from the suspended mode.

context.set_breakpoint(source, pos, condition = nil) → breakpoint

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.

context.stack_size→ int

Returns the size of the context stack.

context.step(steps, force = false)

Stops the current context after a number of `steps` are made. `force` parameter (if true) ensures that the cursor moves from the current line.

context.step_over(steps, frame = nil, force = false)

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.

context.stop_frame(frame)

Stops when a frame with number `frame` is activated. Implements `up` and `down` commands.

context.step(steps, force = false)

Stops the current context after a number of `steps` are made. `force` parameter (if true) ensures that the cursor moves from the current line.

context.stop_reason → sym

Returns the reason for the stop. It maybe of the following values: :initial, :step, :breakpoint, :catchpoint, :post-mortem

context.suspend → nil

Suspends the thread when it is running.

context.suspended? → bool

Returns `true` if the thread is suspended by debugger.

context.thnum → int

Returns the context‘s number.

context.thread → thread

Returns a thread this context is associated with.

context.tracing → bool

Returns the tracing flag for the current context.

context.tracking = bool

Controls the tracing for this context.

[Validate]