# eric4.Debugger.DebuggerInterfaceRuby

Module implementing the Ruby debugger interface for the debug server.

### Classes

DebuggerInterfaceRuby | Class implementing the Ruby debugger interface for the debug server.

### Functions

getRegistryData | Module function to get characterising data for the debugger interface.

## DebuggerInterfaceRuby

Class implementing the Ruby debugger interface for the debug server.

### Derived from

QObject

### Methods

DebuggerInterfaceRuby | Constructor
__identityTranslation | Private method to perform the identity path translation.
__parseClientLine | Private method to handle data from the client.
__remoteTranslation | Private method to perform the path translation.
__sendCommand | Private method to send a single line command to the client.
__startProcess | Private method to start the debugger client process.
flush | Public slot to flush the queue.
getClientCapabilities | Public method to retrieve the debug clients capabilities.
isConnected | Public method to test, if a debug client has connected.
newConnection | Public slot to handle a new connection.
remoteBanner | Public slot to get the banner info of the remote client.
remoteBreakpoint | Public method to set or clear a breakpoint.
remoteBreakpointEnable | Public method to enable or disable a breakpoint.
remoteBreakpointIgnore | Public method to ignore a breakpoint the next couple of occurrences.
remoteCapabilities | Public slot to get the debug clients capabilities.
remoteClientSetFilter | Public method to set a variables filter list.
remoteClientVariable | Public method to request the variables of the debugged program.
remoteClientVariables | Public method to request the variables of the debugged program.
remoteCompletion | Public slot to get the a list of possible commandline completions from the remote client.
remoteContinue | Public method to continue the debugged program.
remoteCoverage | Public method to load a new program to collect coverage data.
remoteCyclops | Public method to load a new program to collect profiling data.
remoteEnvironment | Public method to set the environment for a program to debug, run, ...
remoteEval | Public method to evaluate arg in the current context of the debugged program.
remoteExec | Public method to execute stmt in the current context of the debugged program.
remoteLoad | Public method to load a new program to debug.
remoteProfile | Public method to load a new program to collect profiling data.
remoteRawInput | Public method to send the raw input to the debugged program.
remoteRun | Public method to load a new program to run.
remoteStatement | Public method to execute a Ruby statement.
remoteStep | Public method to single step the debugged program.
remoteStepOut | Public method to step out the debugged program.
remoteStepOver | Public method to step over the debugged program.
remoteStepQuit | Public method to stop the debugged program.
remoteUTPrepare | Public method to prepare a new unittest run.
remoteUTRun | Public method to start a unittest run.
remoteUTStop | public method to stop a unittest run.
remoteWatchpoint | Public method to set or clear a watch expression.
remoteWatchpointEnable | Public method to enable or disable a watch expression.
remoteWatchpointIgnore | Public method to ignore a watch expression the next couple of occurrences.
shutdown | Public method to cleanly shut down.
startRemote | Public method to start a remote Ruby interpreter.
startRemoteForProject | Public method to start a remote Ruby interpreter for a project.

#### DebuggerInterfaceRuby (Constructor)

DebuggerInterfaceRuby(debugServer, passive)

Constructor

debugServer
  reference to the debug server (DebugServer)
passive
  flag indicating passive connection mode (boolean)

#### DebuggerInterfaceRuby.__identityTranslation

__identityTranslation(fn, remote2local = True)

Private method to perform the identity path translation.

fn
  filename to be translated (string or QString)
remote2local
  flag indicating the direction of translation (False = local to remote, True = remote to local [default])

Returns:
  translated filename (string)

#### DebuggerInterfaceRuby.__parseClientLine

__parseClientLine()

Private method to handle data from the client.

#### DebuggerInterfaceRuby.__remoteTranslation

__remoteTranslation(fn, remote2local = True)

Private method to perform the path translation.

fn
  filename to be translated (string or QString)
remote2local
  flag indicating the direction of translation (False = local to remote, True = remote to local [default])

Returns:
  translated filename (string)

#### DebuggerInterfaceRuby.__sendCommand

__sendCommand(cmd)

Private method to send a single line command to the client.

cmd
  command to send to the debug client (string)

#### DebuggerInterfaceRuby.__startProcess

__startProcess(program, arguments, environment = None)

Private method to start the debugger client process.

program
  name of the executable to start (string)
arguments
  arguments to be passed to the program (list of string)
environment
  dictionary of environment settings to pass (dict of string)

Returns:
  the process object (QProcess) or None

#### DebuggerInterfaceRuby.flush

flush()

Public slot to flush the queue.

#### DebuggerInterfaceRuby.getClientCapabilities

getClientCapabilities()

Public method to retrieve the debug clients capabilities.

Returns:
  debug client capabilities (integer)

#### DebuggerInterfaceRuby.isConnected

isConnected()

Public method to test, if a debug client has connected.

Returns:
  flag indicating the connection status (boolean)

#### DebuggerInterfaceRuby.newConnection

newConnection(sock)

Public slot to handle a new connection.

sockreference
  to the socket object (QTcpSocket)

Returns:
  flag indicating success (boolean)

#### DebuggerInterfaceRuby.remoteBanner

remoteBanner()

Public slot to get the banner info of the remote client.

#### DebuggerInterfaceRuby.remoteBreakpoint

remoteBreakpoint(fn, line, set, cond = None, temp = False)

Public method to set or clear a breakpoint.

fn
  filename the breakpoint belongs to (string)
line
  linenumber of the breakpoint (int)
set
  flag indicating setting or resetting a breakpoint (boolean)
cond
  condition of the breakpoint (string)
temp
  flag indicating a temporary breakpoint (boolean)

#### DebuggerInterfaceRuby.remoteBreakpointEnable

remoteBreakpointEnable(fn, line, enable)

Public method to enable or disable a breakpoint.

fn
  filename the breakpoint belongs to (string)
line
  linenumber of the breakpoint (int)
enable
  flag indicating enabling or disabling a breakpoint (boolean)

#### DebuggerInterfaceRuby.remoteBreakpointIgnore

remoteBreakpointIgnore(fn, line, count)

Public method to ignore a breakpoint the next couple of occurrences.

fn
  filename the breakpoint belongs to (string)
line
  linenumber of the breakpoint (int)
count
  number of occurrences to ignore (int)

#### DebuggerInterfaceRuby.remoteCapabilities

remoteCapabilities()

Public slot to get the debug clients capabilities.

#### DebuggerInterfaceRuby.remoteClientSetFilter

remoteClientSetFilter(scope, filter)

Public method to set a variables filter list.

scope
  the scope of the variables (0 = local, 1 = global)
filter
  regexp string for variable names to filter out (string)

#### DebuggerInterfaceRuby.remoteClientVariable

remoteClientVariable(scope, filter, var, framenr = 0)

Public method to request the variables of the debugged program.

scope
  the scope of the variables (0 = local, 1 = global)
filter
  list of variable types to filter out (list of int)
var
  list encoded name of variable to retrieve (string)
framenr
  framenumber of the variables to retrieve (int)

#### DebuggerInterfaceRuby.remoteClientVariables

remoteClientVariables(scope, filter, framenr = 0)

Public method to request the variables of the debugged program.

scope
  the scope of the variables (0 = local, 1 = global)
filter
  list of variable types to filter out (list of int)
framenr
  framenumber of the variables to retrieve (int)

#### DebuggerInterfaceRuby.remoteCompletion

remoteCompletion(text)

Public slot to get the a list of possible commandline completions from the remote client.

text
  the text to be completed (string or QString)

#### DebuggerInterfaceRuby.remoteContinue

remoteContinue(special = False)

Public method to continue the debugged program.

special
  flag indicating a special continue operation

#### DebuggerInterfaceRuby.remoteCoverage

remoteCoverage(fn, argv, wd, erase = False, exclude = "")

Public method to load a new program to collect coverage data.

fn
  the filename to run (string)
argv
  the commandline arguments to pass to the program (string or QString)
wd
  the working directory for the program (string)
erase=
  flag indicating that coverage info should be cleared first (boolean)
exclude=
  searchpattern marking line to exclude from coverage

#### DebuggerInterfaceRuby.remoteCyclops

remoteCyclops(fn, argv, wd, modfunc, reports)

Public method to load a new program to collect profiling data.

fn
  the filename to run (string)
argv
  the commandline arguments to pass to the program (string or QString)
wd
  the working directory for the program (string)
modfunc
  name of a module function which is the main entry point (string)
reports
  bit mask specifying the reports wanted (integer)

#### DebuggerInterfaceRuby.remoteEnvironment

remoteEnvironment(env)

Public method to set the environment for a program to debug, run, ...

env
  environment settings (dictionary)

#### DebuggerInterfaceRuby.remoteEval

remoteEval(arg)

Public method to evaluate arg in the current context of the debugged program.

arg
  the arguments to evaluate (string)

#### DebuggerInterfaceRuby.remoteExec

remoteExec(stmt)

Public method to execute stmt in the current context of the debugged program.

stmt
  statement to execute (string)

#### DebuggerInterfaceRuby.remoteLoad

remoteLoad(fn, argv, wd, traceInterpreter = False, autoContinue = True)

Public method to load a new program to debug.

fn
  the filename to debug (string)
argv
  the commandline arguments to pass to the program (string or QString)
wd
  the working directory for the program (string)
traceInterpreter=
  flag indicating if the interpreter library should be traced as well (boolean)
autoContinue=
  flag indicating, that the debugger should not stop at the first executable line (boolean)

#### DebuggerInterfaceRuby.remoteProfile

remoteProfile(fn, argv, wd, erase = False)

Public method to load a new program to collect profiling data.

fn
  the filename to run (string)
argv
  the commandline arguments to pass to the program (string or QString)
wd
  the working directory for the program (string)
erase=
  flag indicating that timing info should be cleared first (boolean)

#### DebuggerInterfaceRuby.remoteRawInput

remoteRawInput(s)

Public method to send the raw input to the debugged program.

s
  the raw input (string)

#### DebuggerInterfaceRuby.remoteRun

remoteRun(fn, argv, wd)

Public method to load a new program to run.

fn
  the filename to run (string)
argv
  the commandline arguments to pass to the program (string or QString)
wd
  the working directory for the program (string)

#### DebuggerInterfaceRuby.remoteStatement

remoteStatement(stmt)

Public method to execute a Ruby statement.

stmt
  the Ruby statement to execute (string). It should not have a trailing newline.

#### DebuggerInterfaceRuby.remoteStep

remoteStep()

Public method to single step the debugged program.

#### DebuggerInterfaceRuby.remoteStepOut

remoteStepOut()

Public method to step out the debugged program.

#### DebuggerInterfaceRuby.remoteStepOver

remoteStepOver()

Public method to step over the debugged program.

#### DebuggerInterfaceRuby.remoteStepQuit

remoteStepQuit()

Public method to stop the debugged program.

#### DebuggerInterfaceRuby.remoteUTPrepare

remoteUTPrepare(fn, tn, tfn, cov, covname, coverase)

Public method to prepare a new unittest run.

fn
  the filename to load (string)
tn
  the testname to load (string)
tfn
  the test function name to load tests from (string)
cov
  flag indicating collection of coverage data is requested
covname
  filename to be used to assemble the coverage caches filename
coverase
  flag indicating erasure of coverage data is requested

#### DebuggerInterfaceRuby.remoteUTRun

remoteUTRun()

Public method to start a unittest run.

#### DebuggerInterfaceRuby.remoteUTStop

remoteUTStop()

public method to stop a unittest run.

#### DebuggerInterfaceRuby.remoteWatchpoint

remoteWatchpoint(cond, set, temp = False)

Public method to set or clear a watch expression.

cond
  expression of the watch expression (string)
set
  flag indicating setting or resetting a watch expression (boolean)
temp
  flag indicating a temporary watch expression (boolean)

#### DebuggerInterfaceRuby.remoteWatchpointEnable

remoteWatchpointEnable(cond, enable)

Public method to enable or disable a watch expression.

cond
  expression of the watch expression (string)
enable
  flag indicating enabling or disabling a watch expression (boolean)

#### DebuggerInterfaceRuby.remoteWatchpointIgnore

remoteWatchpointIgnore(cond, count)

Public method to ignore a watch expression the next couple of occurrences.

cond
  expression of the watch expression (string)
count
  number of occurrences to ignore (int)

#### DebuggerInterfaceRuby.shutdown

shutdown()

Public method to cleanly shut down.

It closes our socket and shuts down the debug client. (Needed on Win OS)

#### DebuggerInterfaceRuby.startRemote

startRemote(port)

Public method to start a remote Ruby interpreter.

port
  portnumber the debug server is listening on (integer)

Returns:
  client process object (QProcess) and a flag to indicate a network connection (boolean)

#### DebuggerInterfaceRuby.startRemoteForProject

startRemoteForProject(port)

Public method to start a remote Ruby interpreter for a project.

port
  portnumber the debug server is listening on (integer)

Returns:
  pid of the client process (integer) and a flag to indicate a network connection (boolean)

Up

## getRegistryData

getRegistryData()

Module function to get characterising data for the debugger interface.

Returns:
  list of the following data. Client type (string), client capabilities (integer), client type association (list of strings)

Up