Module implementing a debug client base class.
DebugClientInstance |
DebugClientBase | Class implementing the client side of the debugger. |
DebugClientClose | Replacement for the standard os.close(fd). |
DebugClientInput | Replacement for the standard input() builtin. |
DebugClientSetRecursionLimit | Replacement for the standard sys.setrecursionlimit(limit). |
Class implementing the client side of the debugger.
It provides access to the Python interpeter from a debugger running in another process.
The protocol between the debugger and the client is based on JSONRPC 2.0 PDUs. Each one is sent on a single line, i.e. commands or responses are separated by a linefeed character.
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 class is meant to be subclassed by individual DebugClient classes. Do not instantiate it directly.
Type2Indicators |
clientCapabilities |
None |
DebugClientBase | Constructor |
__clientCapabilities | Private method to determine the clients capabilities. |
__compileCommand | Private method to compile source code. |
__compileFileSource | Private method to compile source code read from a file. |
__completionList | Private slot to handle the request for a commandline completion list. |
__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. |
__formatVariablesList | Private method to produce a formated variables list. |
__generateFilterObjects | Private slot to convert a filter string to a list of filter objects. |
__getCompletionList | Private method to create a completions list. |
__getSysPath | Private slot to calculate a path list including the PYTHONPATH environment variable. |
__interact | Private method to interact with the debugger. |
__interceptSignals | Private method to intercept common signals. |
__resolveHost | Private method to resolve a hostname to an IP address. |
__setCoding | Private method to set the coding used by a python file. |
__signalHandler | Private method to handle signals. |
__unhandled_exception | Private method called to report an uncaught exception. |
absPath | Public method to convert a filename to an absolute name. |
checkExceptionHook | Public method to check, that 'sys.excepthook' is still our hook. |
close | Public method implementing a close method as a replacement for os.close(). |
connectDebugger | Public method to establish a session with the debugger. |
eventLoop | Public method implementing our event loop. |
eventPoll | Public method to poll for events like 'set break point'. |
getCoding | Public method to return the current coding. |
getRunning | Public method to return the main script we are currently running. |
handleJsonCommand | Public method to handle a command serialized as a JSON string. |
input | Public method to implement input() using the event loop. |
main | Public method implementing the main method. |
progTerminated | Public method to tell the debugger that the program has terminated. |
readReady | Public method called when there is data ready to be read. |
run_call | Public method used to start the remote debugger and call a function. |
sendCallTrace | Public method to send a call trace entry. |
sendClearTemporaryBreakpoint | Public method to signal the deletion of a temporary breakpoint. |
sendClearTemporaryWatch | Public method to signal the deletion of a temporary watch expression. |
sendDebuggerId | Public method to send the debug client id. |
sendException | Public method to send information for an exception. |
sendJsonCommand | Public method to send a single command or response to the IDE. |
sendPassiveStartup | Public method to send the passive start information. |
sendResponseLine | Public method to send the current call stack. |
sendSyntaxError | Public method to send information for a syntax error. |
sessionClose | Public method to close the session with the debugger and optionally terminate. |
setDisassembly | Public method to store a disassembly of the code object raising an exception. |
skipMultiProcessDebugging | Public method to check, if the given script is eligible for debugging. |
startDebugger | Public method used to start the remote debugger. |
startProgInDebugger | Public method used to start the remote debugger. |
writeReady | Public method called when we are ready to write data. |
None |
Constructor
Private method to determine the clients capabilities.
Private method to compile source code.
Private method to compile source code read from a file.
Private slot to handle the request for a commandline completion list.
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 to produce a formated variables list.
The dictionary 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 tuples of 3 values) is returned.
Private slot to convert a filter string to a list of filter objects.
Private method to create a completions list.
Private slot to calculate a path list including the PYTHONPATH environment variable.
Private method to interact with the debugger.
Private method to intercept common signals.
Private method to resolve a hostname to an IP address.
Private method to set the coding used by a python file.
Private method to handle signals.
Private method called to report an uncaught exception.
Public method to convert a filename to an absolute name.
sys.path is used as a set of possible prefixes. The name stays relative if a file could not be found.
Public method to check, that 'sys.excepthook' is still our hook.
If the exception hook has been changed by the program being debugger, save that hook and set it to ours again. The program's hook is called in our '__unhandled_exception()' method.
Public method implementing a close method as a replacement for os.close().
It prevents the debugger connections from being closed.
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.
Public method implementing our event loop.
Public method to poll for events like 'set break point'.
Public method to return the current coding.
Public method to return the main script we are currently running.
Public method to handle a command serialized as a JSON string.
Public method to implement input() using the event loop.
Public method implementing the main method.
Public method to tell the debugger that the program has terminated.
Public method called when there is data ready to be read.
Public method used to start the remote debugger and call a function.
Public method to send a call trace entry.
Public method to signal the deletion of a temporary breakpoint.
Public method to signal the deletion of a temporary watch expression.
Public method to send the debug client id.
Public method to send information for an exception.
Public method to send a single command or response to the IDE.
Public method to send the passive start information.
Public method to send the current call stack.
Public method to send information for a syntax error.
Public method to close the session with the debugger and optionally terminate.
Public method to store a disassembly of the code object raising an exception.
Public method to check, if the given script is eligible for debugging.
Public method used to start the remote debugger.
Public method used to start the remote debugger.
Public method called when we are ready to write data.
Replacement for the standard os.close(fd).
Replacement for the standard input() builtin.
This function works with the split debugger.
Replacement for the standard sys.setrecursionlimit(limit).