File implementing a debug client base module.
None |
None |
DebugClientBase | Module implementing the client side of the debugger. |
None |
Module implementing the client side of the debugger.
It provides access to the Ruby interpeter from a debugger running in another process.
The protocol between the debugger and the client assumes that there will be a single source of debugger commands and a single source of Ruby statements. Commands and statement are always exactly one line and may be interspersed.
The protocol is as follows. First the client opens a connection to the debugger and then sends a series of one line commands. A command is either >Load<, >Step<, >StepInto<, ... or a Ruby statement. See DebugProtocol.rb for a listing of valid protocol tokens.
A Ruby statement consists of the statement to execute, followed (in a separate line) by >OK?<. If the statement was incomplete then the response is >Continue<. If there was an exception then the response is >Exception<. Otherwise the response is >OK<. The reason for the >OK?< part is to provide a sentinal (ie. the responding >OK<) after any possible output as a result of executing the command.
The client may send any other lines at any other time which should be interpreted as program output.
If the debugger closes the session there is no response from the client. The client may close the session at any time as a result of the script being debugged closing or crashing.
Note: This module is meant to be mixed in by individual DebugClient classes. Do not use it directly.
@@clientCapabilities |
None |
canEval? | Private method to check if the buffer's contents can be evaluated. |
completionList | Method used to handle the command completion request |
connectDebugger | Public method to establish a session with the debugger. |
dumpVariable | Private method to return the variables of a frame to the debug server. |
dumpVariables | Private method to return the variables of a frame to the debug server. |
eventLoop | Private method implementing our event loop. |
eventPoll | Private method to poll for events like 'set break point'. |
extractAddress | Private method to extract the address part of an object description. |
extractTypeAndAddress | Private method to extract the address and type parts of an object description. |
formatVariablesList | Private method to produce a formated variables list. |
generateFilterObjects | Private method to convert a filter string to a list of filter objects. |
handleException | Private method called in the case of an exception |
handleLine | Private method to handle the receipt of a complete line. |
inFilter? | Private method to check, if a variable is to be filtered based on its type. |
initializeDebugClient | Method to initialize the module |
interact | Private method to Interact with the debugger. |
main | Public method implementing the main method. |
progTerminated | Private method to tell the debugger that the program has terminated. |
sessionClose | Privat method to close the session with the debugger and terminate. |
startProgInDebugger | Method used to start the remote debugger. |
trace_func | Method executed by the tracing facility. |
unhandled_exception | Private method to report an unhandled exception. |
write | Private method to write data to the output stream. |
Private method to check if the buffer's contents can be evaluated.
Method used to handle the command completion request
Public method to establish a session with the debugger.
It opens a network connection to the debugger, connects it to stdin, stdout and stderr and saves these file objects in case the application being debugged redirects them itself.
Private method to return the variables of a frame to the debug server.
Private method to return the variables of a frame to the debug server.
Private method implementing our event loop.
Private method to poll for events like 'set break point'.
Private method to extract the address part of an object description.
Private method to extract the address and type parts of an object description.
Private method to produce a formated variables list.
The binding passed in to it is scanned. Variables are only added to the list, if their type is not contained in the filter list and their name doesn't match any of the filter expressions. The formated variables list (a list of lists of 3 values) is returned.
Private method to convert a filter string to a list of filter objects.
Private method called in the case of an exception
It ensures that the debug server is informed of the raised exception.
Private method to handle the receipt of a complete line.
It first looks for a valid protocol token at the start of the line. Thereafter it trys to execute the lines accumulated so far.
Private method to check, if a variable is to be filtered based on its type.
Method to initialize the module
Private method to Interact with the debugger.
Public method implementing the main method.
Private method to tell the debugger that the program has terminated.
Privat method to close the session with the debugger and terminate.
Method used to start the remote debugger.
Method executed by the tracing facility.
It is used to save the execution context of an exception.
Private method to report an unhandled exception.
Private method to write data to the output stream.