# eric3.DebugClients.Ruby.Debuggee

File implementing the real debugger, which is connected to the IDE frontend.

### Classes

Client | Class handling the connection to the IDE.
Context | Class defining the current execution context.
DEBUGGER__ | Class defining a singleton object for the debugger.
Mutex | Class implementing a mutex.
SilentObject | Class defining an object that ignores all messages.

### Modules

None

### Functions

None

## Client

Class handling the connection to the IDE.

### Derived from

None

### Methods

eventLoop | Method calling the main event loop.
eventPoll | Method calling the main function polling for an event sent by the IDE.
initialize | Constructor
printf | Method to print something to the IDE.
printf_clear_breakpoint | Method to report the deletion of a temporary breakpoint to the IDE.
printf_clear_watchpoint | Method to report the deletion of a temporary watchpoint to the IDE.
printf_excn | Method to report an exception to the IDE.
printf_exit | Method to report the exit status to the IDE.
printf_line | Method to report the current line and the current stack trace to the IDE.
printf_scriptExcn | Method to report a ScriptError to the IDE.
traceRuby? | Method to check, if we should trace into the Ruby interpreter libraries.

### Client.eventLoop

eventLoop()

Method calling the main event loop.

### Client.eventPoll

eventPoll()

Method calling the main function polling for an event sent by the IDE.

### Client.initialize

initialize()

Constructor

debugger
  reference to the object having the IDE connection.

### Client.printf

printf()

Method to print something to the IDE.

*args
  Arguments to be printed.

### Client.printf_clear_breakpoint

printf_clear_breakpoint(line)

Method to report the deletion of a temporary breakpoint to the IDE.

file
  filename of the breakpoint (String)
line
  line number of the breakpoint (int)

### Client.printf_clear_watchpoint

printf_clear_watchpoint()

Method to report the deletion of a temporary watchpoint to the IDE.

cond
  condition of the watchpoint (String)

### Client.printf_excn

printf_excn()

Method to report an exception to the IDE.

exclist
  info about the exception to be reported

### Client.printf_exit

printf_exit()

Method to report the exit status to the IDE.

status
  exit status of the program (int)

### Client.printf_line

printf_line()

Method to report the current line and the current stack trace to the IDE.

frames
  reference to the array containing the stack trace.

### Client.printf_scriptExcn

printf_scriptExcn()

Method to report a ScriptError to the IDE.

exclist
  info about the exception to be reported

### Client.traceRuby?

traceRuby?()

Method to check, if we should trace into the Ruby interpreter libraries.

Up

## Context

Class defining the current execution context.

### Derived from

None

### Methods

add_break_point | Method to add a breakpoint.
add_watch_point | Method to add a watchpoint.
attached? | Method returning the attached state.
break_points | Method to return the list of breakpoints
check_break_points | Method to check, if the given position contains an active breakpoint.
check_suspend | Method to check the suspend state.
clear_break_point | Method to delete a specific breakpoint.
clear_suspend | Method to clear the suspend state.
clear_watch_point | Method to delete a specific watchpoint.
context | Method returning the context of a thread.
current_binding | Method returning the binding object of the current execution frame.
current_frame | Method returning the current execution frame.
debug_command | Method to execute the next debug command.
debug_silent_eval | Method to eval a string without output.
delete_break_point | Method to delete a breakpoint.
delete_watch_point | Method to delete a watchpoint.
enable_break_point | Method to set the enabled state of a breakpoint.
enable_watch_point | Method to set the enabled state of a watchpoint.
eventLoop | Method calling the main event loop.
eventPoll | Method calling the main function polling for an event sent by the IDE.
excn_handle | Method to handle an exception
frame_set_pos | Method to set the frame position of the current frame.
get_binding | Method returning the binding object of a specific execution frame.
get_frame | Method returning a specific execution frame.
ignore_break_point | Method to set the ignore count of a breakpoint.
ignore_watch_point | Method to set the ignore count of a watchpoint.
initialize | Constructor
resume_all | Method to resume all threads.
set_last_thread | Method to remember the last thread.
set_suspend | Method to suspend all threads.
skip_it? | Method to filter out debugger files.
stdout | Method returning the stdout object.
step_continue | Method to continue execution until next breakpoint or watchpoint.
step_out | Method to set the next stop point after the function call returns.
step_over | Method to set the next stop point skipping function calls.
step_quit | Method to stop debugging.
stop_next | Method to set the next stop point (i.e. stop at next line).
suspend_all | Method to suspend all threads.
thnum | Method returning the thread number of the current thread.
traceRuby? | Method to check, if we should trace into the Ruby interpreter libraries.
trace_func | Method executed by the tracing facility.

### Context.add_break_point

add_break_point(pos, temp = false, cond = nil)

Method to add a breakpoint.

cond
  condition of a conditional breakpoint (String)
file
  filename for the breakpoint (String)
pos
  line number for the breakpoint (int)
temp
  flag indicating a temporary breakpoint (boolean)

### Context.add_watch_point

add_watch_point(temp = false)

Method to add a watchpoint.

cond
  condition of the watchpoint (String)
temp
  flag indicating a temporary watchpoint (boolean)

### Context.attached?

attached?()

Method returning the attached state.

Returns:
  flag indicating, whether the debugger is attached to the IDE.

### Context.break_points

break_points()

Method to return the list of breakpoints

Returns:
  Array containing all breakpoints.

### Context.check_break_points

check_break_points(pos, binding, id)

Method to check, if the given position contains an active breakpoint.

binding
  current binding object
file
  filename containing the currently executed line (String)
id
  (ignored)
pos
  line number currently executed (int)

Returns:
  flag indicating an active breakpoint (boolean)

### Context.check_suspend

check_suspend()

Method to check the suspend state.

### Context.clear_break_point

clear_break_point(pos)

Method to delete a specific breakpoint.

file
  filename containing the breakpoint (String)
pos
  line number containing the breakpoint (int)

### Context.clear_suspend

clear_suspend()

Method to clear the suspend state.

### Context.clear_watch_point

clear_watch_point()

Method to delete a specific watchpoint.

cond
  condition specifying the watchpoint (String)

### Context.context

context()

Method returning the context of a thread.

th
  thread object to get the context for

Returns:
  the context for the thread

### Context.current_binding

current_binding()

Method returning the binding object of the current execution frame.

Returns:
  binding object of the current execution frame

### Context.current_frame

current_frame()

Method returning the current execution frame.

Returns:
  current execution frame

### Context.debug_command

debug_command(line, id, binding)

Method to execute the next debug command.

### Context.debug_silent_eval

debug_silent_eval(binding)

Method to eval a string without output.

binding
  the binding for the evaluation
str
  String containing the expression to be evaluated

Returns:
  the result of the evaluation

### Context.delete_break_point

delete_break_point(pos)

Method to delete a breakpoint.

file
  filename of the breakpoint (String)
pos
  line number of the breakpoint (int)

### Context.delete_watch_point

delete_watch_point()

Method to delete a watchpoint.

cond
  condition of the watchpoint (String)

### Context.enable_break_point

enable_break_point(pos, enable)

Method to set the enabled state of a breakpoint.

enable
  flag indicating the new enabled state (boolean)
file
  filename of the breakpoint (String)
pos
  line number of the breakpoint (int)

### Context.enable_watch_point

enable_watch_point(enable)

Method to set the enabled state of a watchpoint.

cond
  condition of the watchpoint (String)
enable
  flag indicating the new enabled state (boolean)

### Context.eventLoop

eventLoop()

Method calling the main event loop.

### Context.eventPoll

eventPoll()

Method calling the main function polling for an event sent by the IDE.

### Context.excn_handle

excn_handle(line, id, binding)

Method to handle an exception

binding
  current binding object
file
  filename containing the currently executed line (String)
id
  (ignored)
pos
  line number currently executed (int)

### Context.frame_set_pos

frame_set_pos(line)

Method to set the frame position of the current frame.

### Context.get_binding

get_binding()

Method returning the binding object of a specific execution frame.

frameno
  frame number of the frame (int)

Returns:
  the requested binding object

### Context.get_frame

get_frame()

Method returning a specific execution frame.

frameno
  frame number of the frame to be returned (int)

Returns:
  the requested execution frame

### Context.ignore_break_point

ignore_break_point(pos, count)

Method to set the ignore count of a breakpoint.

count
  ignore count to be set (int)
file
  filename of the breakpoint (String)
pos
  line number of the breakpoint (int)

### Context.ignore_watch_point

ignore_watch_point(count)

Method to set the ignore count of a watchpoint.

cond
  condition of the watchpoint (String)
count
  ignore count to be set (int)

### Context.initialize

initialize()

Constructor

### Context.resume_all

resume_all()

Method to resume all threads.

### Context.set_last_thread

set_last_thread()

Method to remember the last thread.

th
  thread to be remembered.

### Context.set_suspend

set_suspend()

Method to suspend all threads.

### Context.skip_it?

skip_it?()

Method to filter out debugger files.

Tracing is turned off for files that are part of the debugger that are called from the application being debugged.

file
  name of the file to be checked (String)

Returns:
  flag indicating, whether the file should be skipped (boolean)

### Context.stdout

stdout()

Method returning the stdout object.

Returns:
  reference to the stdout object

### Context.step_continue

step_continue()

Method to continue execution until next breakpoint or watchpoint.

### Context.step_out

step_out()

Method to set the next stop point after the function call returns.

### Context.step_over

step_over()

Method to set the next stop point skipping function calls.

counter
  defining the stop point (int)

### Context.step_quit

step_quit()

Method to stop debugging.

### Context.stop_next

stop_next()

Method to set the next stop point (i.e. stop at next line).

counter
  defining the stop point (int)

### Context.suspend_all

suspend_all()

Method to suspend all threads.

### Context.thnum

thnum()

Method returning the thread number of the current thread.

Returns:
  thread number of the current thread.

### Context.traceRuby?

traceRuby?()

Method to check, if we should trace into the Ruby interpreter libraries.

### Context.trace_func

trace_func(file, line, id, binding, klass)

Method executed by the tracing facility.

binding
  a binding object
event
  the tracing event (String)
file
  the name of the file being traced (String)
id
  object id
klass
  name of a class
line
  the line number being traced (int)

Up

## DEBUGGER__

Class defining a singleton object for the debugger.

### Derived from

None

### Methods

attach | Method to connect the debugger to the IDE.
attached? | Method returning the attached state.
break_points | Method to return the list of breakpoints
client | Method returning a reference to the client object.
context | Method returning the context of a thread.
debug_thread_info | Method handling the thread related debug commands.
eventLoop | Method calling the main event loop.
eventPoll | Method calling the main function polling for an event sent by the IDE.
get_thread | Method returning a thread by number.
interrupt | Method to stop execution at the next instruction.
last_thread | Method returning the last active thread.
make_thread_list | Method to create a thread list.
quit | Method to quit the debugger.
resume | Method to resume the program being debugged.
set_client | Method to set the client handling the connection.
set_last_thread | Method to remember the last thread.
stdout | Method returning the stdout object.
stdout= | Method to set the stdout object.
suspend | Method to suspend the program being debugged.
thread_list | Method to list the state of a thread.
thread_list_all | Method to list the state of all threads.
traceRuby? | Method to check, if we should trace into the Ruby interpreter libraries.
waiting | Method returning the waiting list.

### DEBUGGER__.attach

attach()

Method to connect the debugger to the IDE.

debugger
  reference to the object handling the communication with the IDE.

### DEBUGGER__.attached?

attached?()

Method returning the attached state.

Returns:
  flag indicating, whether the debugger is attached to the IDE.

### DEBUGGER__.break_points

break_points()

Method to return the list of breakpoints

Returns:
  Array containing all breakpoints.

### DEBUGGER__.client

client()

Method returning a reference to the client object.

Returns:
  reference to the client object.

### DEBUGGER__.context

context()

Method returning the context of a thread.

th
  threat the context is requested for

Returns:
  context object for the thread

### DEBUGGER__.debug_thread_info

debug_thread_info(binding)

Method handling the thread related debug commands.

binding
  reference to the binding object
input
  debug command (String)

### DEBUGGER__.eventLoop

eventLoop()

Method calling the main event loop.

### DEBUGGER__.eventPoll

eventPoll()

Method calling the main function polling for an event sent by the IDE.

### DEBUGGER__.get_thread

get_thread()

Method returning a thread by number.

num
  thread number (int)

Returns:
  thread with the requested number

### DEBUGGER__.interrupt

interrupt()

Method to stop execution at the next instruction.

### DEBUGGER__.last_thread

last_thread()

Method returning the last active thread.

Returns:
  active thread

### DEBUGGER__.make_thread_list

make_thread_list()

Method to create a thread list.

### DEBUGGER__.quit

quit()

Method to quit the debugger.

status
  exit status of the program

### DEBUGGER__.resume

resume()

Method to resume the program being debugged.

### DEBUGGER__.set_client

set_client()

Method to set the client handling the connection.

debugger
  reference to the object handling the connection

### DEBUGGER__.set_last_thread

set_last_thread()

Method to remember the last thread.

th
  thread to be remembered.

### DEBUGGER__.stdout

stdout()

Method returning the stdout object.

Returns:
  reference to the stdout object

### DEBUGGER__.stdout=

stdout=()

Method to set the stdout object.

s
  reference to the stdout object

### DEBUGGER__.suspend

suspend()

Method to suspend the program being debugged.

### DEBUGGER__.thread_list

thread_list()

Method to list the state of a thread.

num
  thread number (int)

### DEBUGGER__.thread_list_all

thread_list_all()

Method to list the state of all threads.

### DEBUGGER__.traceRuby?

traceRuby?()

Method to check, if we should trace into the Ruby interpreter libraries.

### DEBUGGER__.waiting

waiting()

Method returning the waiting list.

Returns:
  the waiting list

Up

## Mutex

Class implementing a mutex.

### Derived from

None

### Methods

initialize | Constructor
lock | Method to lock the mutex.
locked? | Method returning the locked state.
unlock | Method to unlock the mutex.

### Mutex.initialize

initialize()

Constructor

### Mutex.lock

lock()

Method to lock the mutex.

Returns:
  the mutex

### Mutex.locked?

locked?()

Method returning the locked state.

Returns:
  flag indicating the locked state (boolean)

### Mutex.unlock

unlock()

Method to unlock the mutex.

Returns:
  the mutex

Up

## SilentObject

Class defining an object that ignores all messages.

### Derived from

None

### Methods

method_missing | Method invoked for all messages it cannot handle.

### SilentObject.method_missing

method_missing(*a, &b)

Method invoked for all messages it cannot handle.

&b
  unknown
*a
  arguments passed to the missing method
msg_id
  symbol for the method called

Up