Documentation/Source/eric6.DebugClients.Python.DebugClientBase.html

Sun, 24 Dec 2017 15:19:00 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 24 Dec 2017 15:19:00 +0100
changeset 6040
dcf8c50ed06a
parent 5966
3325ecd87c7c
child 6903
0d4e1033731b
permissions
-rw-r--r--

Fixed an issue in the debug client causing it to enter an inifinite loop if the frontend crashed.

<!DOCTYPE html>
<html><head>
<title>eric6.DebugClients.Python.DebugClientBase</title>
<meta charset="UTF-8">
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric6.DebugClients.Python.DebugClientBase</h1>
<p>
Module implementing a debug client base class.
</p>
<h3>Global Attributes</h3>
<table>
<tr><td>DebugClientInstance</td></tr>
</table>
<h3>Classes</h3>
<table>
<tr>
<td><a href="#DebugClientBase">DebugClientBase</a></td>
<td>Class implementing the client side of the debugger.</td>
</tr>
</table>
<h3>Functions</h3>
<table>
<tr>
<td><a href="#DebugClientClose">DebugClientClose</a></td>
<td>Replacement for the standard os.close(fd).</td>
</tr><tr>
<td><a href="#DebugClientFork">DebugClientFork</a></td>
<td>Replacement for the standard os.fork().</td>
</tr><tr>
<td><a href="#DebugClientInput">DebugClientInput</a></td>
<td>Replacement for the standard input builtin.</td>
</tr><tr>
<td><a href="#DebugClientRawInput">DebugClientRawInput</a></td>
<td>Replacement for the standard raw_input builtin.</td>
</tr><tr>
<td><a href="#DebugClientSetRecursionLimit">DebugClientSetRecursionLimit</a></td>
<td>Replacement for the standard sys.setrecursionlimit(limit).</td>
</tr>
</table>
<hr /><hr />
<a NAME="DebugClientBase" ID="DebugClientBase"></a>
<h2>DebugClientBase</h2>
<p>
    Class implementing the client side of the debugger.
</p><p>
    It provides access to the Python interpeter from a debugger running in
    another process.
</p><p>
    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.
</p><p>
    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.
</p><p>
    <b>Note</b>: This class is meant to be subclassed by individual
    DebugClient classes. Do not instantiate it directly.
</p>
<h3>Derived from</h3>
object
<h3>Class Attributes</h3>
<table>
<tr><td>Indicators</td></tr><tr><td>clientCapabilities</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#DebugClientBase.__init__">DebugClientBase</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#DebugClientBase.__clientCapabilities">__clientCapabilities</a></td>
<td>Private method to determine the clients capabilities.</td>
</tr><tr>
<td><a href="#DebugClientBase.__compileFileSource">__compileFileSource</a></td>
<td>Private method to compile source code read from a file.</td>
</tr><tr>
<td><a href="#DebugClientBase.__completionList">__completionList</a></td>
<td>Private slot to handle the request for a commandline completion list.</td>
</tr><tr>
<td><a href="#DebugClientBase.__dumpVariable">__dumpVariable</a></td>
<td>Private method to return the variables of a frame to the debug server.</td>
</tr><tr>
<td><a href="#DebugClientBase.__dumpVariables">__dumpVariables</a></td>
<td>Private method to return the variables of a frame to the debug server.</td>
</tr><tr>
<td><a href="#DebugClientBase.__extractIndicators">__extractIndicators</a></td>
<td>Private method to extract the indicator string from a variable text.</td>
</tr><tr>
<td><a href="#DebugClientBase.__formatQtVariable">__formatQtVariable</a></td>
<td>Private method to produce a formatted output of a simple Qt4/Qt5 type.</td>
</tr><tr>
<td><a href="#DebugClientBase.__formatVariablesList">__formatVariablesList</a></td>
<td>Private method to produce a formated variables list.</td>
</tr><tr>
<td><a href="#DebugClientBase.__generateFilterObjects">__generateFilterObjects</a></td>
<td>Private slot to convert a filter string to a list of filter objects.</td>
</tr><tr>
<td><a href="#DebugClientBase.__getCompletionList">__getCompletionList</a></td>
<td>Private method to create a completions list.</td>
</tr><tr>
<td><a href="#DebugClientBase.__getSysPath">__getSysPath</a></td>
<td>Private slot to calculate a path list including the PYTHONPATH environment variable.</td>
</tr><tr>
<td><a href="#DebugClientBase.__interact">__interact</a></td>
<td>Private method to interact with the debugger.</td>
</tr><tr>
<td><a href="#DebugClientBase.__interceptSignals">__interceptSignals</a></td>
<td>Private method to intercept common signals.</td>
</tr><tr>
<td><a href="#DebugClientBase.__resolveHost">__resolveHost</a></td>
<td>Private method to resolve a hostname to an IP address.</td>
</tr><tr>
<td><a href="#DebugClientBase.__setCoding">__setCoding</a></td>
<td>Private method to set the coding used by a python file.</td>
</tr><tr>
<td><a href="#DebugClientBase.__signalHandler">__signalHandler</a></td>
<td>Private method to handle signals.</td>
</tr><tr>
<td><a href="#DebugClientBase.__unhandled_exception">__unhandled_exception</a></td>
<td>Private method called to report an uncaught exception.</td>
</tr><tr>
<td><a href="#DebugClientBase.absPath">absPath</a></td>
<td>Public method to convert a filename to an absolute name.</td>
</tr><tr>
<td><a href="#DebugClientBase.close">close</a></td>
<td>Public method implementing a close method as a replacement for os.close().</td>
</tr><tr>
<td><a href="#DebugClientBase.connectDebugger">connectDebugger</a></td>
<td>Public method to establish a session with the debugger.</td>
</tr><tr>
<td><a href="#DebugClientBase.eventLoop">eventLoop</a></td>
<td>Public method implementing our event loop.</td>
</tr><tr>
<td><a href="#DebugClientBase.eventPoll">eventPoll</a></td>
<td>Public method to poll for events like 'set break point'.</td>
</tr><tr>
<td><a href="#DebugClientBase.fork">fork</a></td>
<td>Public method implementing a fork routine deciding which branch to follow.</td>
</tr><tr>
<td><a href="#DebugClientBase.getCoding">getCoding</a></td>
<td>Public method to return the current coding.</td>
</tr><tr>
<td><a href="#DebugClientBase.getRunning">getRunning</a></td>
<td>Public method to return the main script we are currently running.</td>
</tr><tr>
<td><a href="#DebugClientBase.handleJsonCommand">handleJsonCommand</a></td>
<td>Public method to handle a command serialized as a JSON string.</td>
</tr><tr>
<td><a href="#DebugClientBase.input">input</a></td>
<td>Public method to implement input() (Python 2) using the event loop.</td>
</tr><tr>
<td><a href="#DebugClientBase.main">main</a></td>
<td>Public method implementing the main method.</td>
</tr><tr>
<td><a href="#DebugClientBase.progTerminated">progTerminated</a></td>
<td>Public method to tell the debugger that the program has terminated.</td>
</tr><tr>
<td><a href="#DebugClientBase.raw_input">raw_input</a></td>
<td>Public method to implement raw_input() / input() using the event loop.</td>
</tr><tr>
<td><a href="#DebugClientBase.readReady">readReady</a></td>
<td>Public method called when there is data ready to be read.</td>
</tr><tr>
<td><a href="#DebugClientBase.run_call">run_call</a></td>
<td>Public method used to start the remote debugger and call a function.</td>
</tr><tr>
<td><a href="#DebugClientBase.sendCallTrace">sendCallTrace</a></td>
<td>Public method to send a call trace entry.</td>
</tr><tr>
<td><a href="#DebugClientBase.sendClearTemporaryBreakpoint">sendClearTemporaryBreakpoint</a></td>
<td>Public method to signal the deletion of a temporary breakpoint.</td>
</tr><tr>
<td><a href="#DebugClientBase.sendClearTemporaryWatch">sendClearTemporaryWatch</a></td>
<td>Public method to signal the deletion of a temporary watch expression.</td>
</tr><tr>
<td><a href="#DebugClientBase.sendException">sendException</a></td>
<td>Public method to send information for an exception.</td>
</tr><tr>
<td><a href="#DebugClientBase.sendJsonCommand">sendJsonCommand</a></td>
<td>Public method to send a single command or response to the IDE.</td>
</tr><tr>
<td><a href="#DebugClientBase.sendPassiveStartup">sendPassiveStartup</a></td>
<td>Public method to send the passive start information.</td>
</tr><tr>
<td><a href="#DebugClientBase.sendResponseLine">sendResponseLine</a></td>
<td>Public method to send the current call stack.</td>
</tr><tr>
<td><a href="#DebugClientBase.sendSyntaxError">sendSyntaxError</a></td>
<td>Public method to send information for a syntax error.</td>
</tr><tr>
<td><a href="#DebugClientBase.sessionClose">sessionClose</a></td>
<td>Public method to close the session with the debugger and optionally terminate.</td>
</tr><tr>
<td><a href="#DebugClientBase.startDebugger">startDebugger</a></td>
<td>Public method used to start the remote debugger.</td>
</tr><tr>
<td><a href="#DebugClientBase.startProgInDebugger">startProgInDebugger</a></td>
<td>Public method used to start the remote debugger.</td>
</tr><tr>
<td><a href="#DebugClientBase.writeReady">writeReady</a></td>
<td>Public method called when we are ready to write data.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="DebugClientBase.__init__" ID="DebugClientBase.__init__"></a>
<h4>DebugClientBase (Constructor)</h4>
<b>DebugClientBase</b>(<i></i>)
<p>
        Constructor
</p><a NAME="DebugClientBase.__clientCapabilities" ID="DebugClientBase.__clientCapabilities"></a>
<h4>DebugClientBase.__clientCapabilities</h4>
<b>__clientCapabilities</b>(<i></i>)
<p>
        Private method to determine the clients capabilities.
</p><dl>
<dt>Returns:</dt>
<dd>
client capabilities (integer)
</dd>
</dl><a NAME="DebugClientBase.__compileFileSource" ID="DebugClientBase.__compileFileSource"></a>
<h4>DebugClientBase.__compileFileSource</h4>
<b>__compileFileSource</b>(<i>filename, mode='exec'</i>)
<p>
        Private method to compile source code read from a file.
</p><dl>
<dt><i>filename</i></dt>
<dd>
name of the source file (string)
</dd><dt><i>mode</i></dt>
<dd>
kind of code to be generated (string, exec or eval)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
compiled code object (None in case of errors)
</dd>
</dl><a NAME="DebugClientBase.__completionList" ID="DebugClientBase.__completionList"></a>
<h4>DebugClientBase.__completionList</h4>
<b>__completionList</b>(<i>text</i>)
<p>
        Private slot to handle the request for a commandline completion list.
</p><dl>
<dt><i>text</i></dt>
<dd>
the text to be completed (string)
</dd>
</dl><a NAME="DebugClientBase.__dumpVariable" ID="DebugClientBase.__dumpVariable"></a>
<h4>DebugClientBase.__dumpVariable</h4>
<b>__dumpVariable</b>(<i>var, frmnr, scope, filterList, maxSize</i>)
<p>
        Private method to return the variables of a frame to the debug server.
</p><dl>
<dt><i>var</i> (list of strings)</dt>
<dd>
list encoded name of the requested variable
</dd><dt><i>frmnr</i> (int)</dt>
<dd>
distance of frame reported on. 0 is the current frame
</dd><dt><i>scope</i></dt>
<dd>
1 to report global variables, 0 for local variables (int)
</dd><dt><i>filterList</i> (list of int)</dt>
<dd>
the indices of variable types to be filtered
</dd><dt><i>maxSize</i> (int)</dt>
<dd>
maximum size the formatted value of a variable will
            be shown. If it is bigger than that, a 'too big' indication will
            be given.
</dd>
</dl><a NAME="DebugClientBase.__dumpVariables" ID="DebugClientBase.__dumpVariables"></a>
<h4>DebugClientBase.__dumpVariables</h4>
<b>__dumpVariables</b>(<i>frmnr, scope, filterList, maxSize</i>)
<p>
        Private method to return the variables of a frame to the debug server.
</p><dl>
<dt><i>frmnr</i> (int)</dt>
<dd>
distance of frame reported on. 0 is the current frame
</dd><dt><i>scope</i> (int)</dt>
<dd>
1 to report global variables, 0 for local variables
</dd><dt><i>filterList</i> (list of int)</dt>
<dd>
the indices of variable types to be filtered
</dd><dt><i>maxSize</i> (int)</dt>
<dd>
maximum size the formatted value of a variable will
            be shown. If it is bigger than that, a 'too big' indication will
            be given.
</dd>
</dl><a NAME="DebugClientBase.__extractIndicators" ID="DebugClientBase.__extractIndicators"></a>
<h4>DebugClientBase.__extractIndicators</h4>
<b>__extractIndicators</b>(<i>var</i>)
<p>
        Private method to extract the indicator string from a variable text.
</p><dl>
<dt><i>var</i> (str)</dt>
<dd>
variable text
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
tuple containing the variable text without indicators and the
            indicator string
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
tuple of two str
</dd>
</dl><a NAME="DebugClientBase.__formatQtVariable" ID="DebugClientBase.__formatQtVariable"></a>
<h4>DebugClientBase.__formatQtVariable</h4>
<b>__formatQtVariable</b>(<i>value, qttype</i>)
<p>
        Private method to produce a formatted output of a simple Qt4/Qt5 type.
</p><dl>
<dt><i>value</i></dt>
<dd>
variable to be formatted
</dd><dt><i>qttype</i></dt>
<dd>
type of the Qt variable to be formatted (string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
A tuple consisting of a list of formatted variables. Each
            variable entry is a tuple of three elements, the variable name,
            its type and value.
</dd>
</dl><a NAME="DebugClientBase.__formatVariablesList" ID="DebugClientBase.__formatVariablesList"></a>
<h4>DebugClientBase.__formatVariablesList</h4>
<b>__formatVariablesList</b>(<i>keylist, dict_, scope, filterList=None, formatSequences=False, maxSize=0</i>)
<p>
        Private method to produce a formated variables list.
</p><p>
        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.
</p><dl>
<dt><i>keylist</i> (list of str)</dt>
<dd>
keys of the dictionary to be formatted
</dd><dt><i>dict_</i> (dict)</dt>
<dd>
the dictionary to be scanned
</dd><dt><i>scope</i> (int)</dt>
<dd>
1 to filter using the globals filter, 0 using the locals
            filter.
            Variables are only added to the list, if their name do not match
            any of the filter expressions.
</dd><dt><i>filterList</i> (list of int)</dt>
<dd>
the indices of variable types to be filtered.
            Variables are only added to the list, if their type is not
            contained in the filter list.
</dd><dt><i>formatSequences</i> (bool)</dt>
<dd>
flag indicating, that sequence or dictionary
            variables should be formatted. If it is 0 (or false), just the
            number of items contained in these variables is returned.
</dd><dt><i>maxSize</i> (int)</dt>
<dd>
maximum size the formatted value of a variable will
            be shown. If it is bigger than that, a 'too big' indication will
            be placed in the value field.
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
A tuple consisting of a list of formatted variables. Each
            variable entry is a tuple of three elements, the variable name,
            its type and value.
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
list of tuple of (str, str, str)
</dd>
</dl><a NAME="DebugClientBase.__generateFilterObjects" ID="DebugClientBase.__generateFilterObjects"></a>
<h4>DebugClientBase.__generateFilterObjects</h4>
<b>__generateFilterObjects</b>(<i>scope, filterString</i>)
<p>
        Private slot to convert a filter string to a list of filter objects.
</p><dl>
<dt><i>scope</i></dt>
<dd>
1 to generate filter for global variables, 0 for local
            variables (int)
</dd><dt><i>filterString</i></dt>
<dd>
string of filter patterns separated by ';'
</dd>
</dl><a NAME="DebugClientBase.__getCompletionList" ID="DebugClientBase.__getCompletionList"></a>
<h4>DebugClientBase.__getCompletionList</h4>
<b>__getCompletionList</b>(<i>text, completer, completions</i>)
<p>
        Private method to create a completions list.
</p><dl>
<dt><i>text</i></dt>
<dd>
text to complete (string)
</dd><dt><i>completer</i></dt>
<dd>
completer methode
</dd><dt><i>completions</i></dt>
<dd>
set where to add new completions strings (set)
</dd>
</dl><a NAME="DebugClientBase.__getSysPath" ID="DebugClientBase.__getSysPath"></a>
<h4>DebugClientBase.__getSysPath</h4>
<b>__getSysPath</b>(<i>firstEntry</i>)
<p>
        Private slot to calculate a path list including the PYTHONPATH
        environment variable.
</p><dl>
<dt><i>firstEntry</i></dt>
<dd>
entry to be put first in sys.path (string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
path list for use as sys.path (list of strings)
</dd>
</dl><a NAME="DebugClientBase.__interact" ID="DebugClientBase.__interact"></a>
<h4>DebugClientBase.__interact</h4>
<b>__interact</b>(<i></i>)
<p>
        Private method to interact with the debugger.
</p><a NAME="DebugClientBase.__interceptSignals" ID="DebugClientBase.__interceptSignals"></a>
<h4>DebugClientBase.__interceptSignals</h4>
<b>__interceptSignals</b>(<i></i>)
<p>
        Private method to intercept common signals.
</p><a NAME="DebugClientBase.__resolveHost" ID="DebugClientBase.__resolveHost"></a>
<h4>DebugClientBase.__resolveHost</h4>
<b>__resolveHost</b>(<i>host</i>)
<p>
        Private method to resolve a hostname to an IP address.
</p><dl>
<dt><i>host</i></dt>
<dd>
hostname of the debug server (string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
IP address (string)
</dd>
</dl><a NAME="DebugClientBase.__setCoding" ID="DebugClientBase.__setCoding"></a>
<h4>DebugClientBase.__setCoding</h4>
<b>__setCoding</b>(<i>filename</i>)
<p>
        Private method to set the coding used by a python file.
</p><dl>
<dt><i>filename</i></dt>
<dd>
name of the file to inspect (string)
</dd>
</dl><a NAME="DebugClientBase.__signalHandler" ID="DebugClientBase.__signalHandler"></a>
<h4>DebugClientBase.__signalHandler</h4>
<b>__signalHandler</b>(<i>signalNumber, stackFrame</i>)
<p>
        Private method to handle signals.
</p><dl>
<dt><i>signalNumber</i> (int)</dt>
<dd>
number of the signal to be handled
</dd><dt><i>stackFrame</i> (frame object)</dt>
<dd>
current stack frame
</dd>
</dl><a NAME="DebugClientBase.__unhandled_exception" ID="DebugClientBase.__unhandled_exception"></a>
<h4>DebugClientBase.__unhandled_exception</h4>
<b>__unhandled_exception</b>(<i>exctype, excval, exctb</i>)
<p>
        Private method called to report an uncaught exception.
</p><dl>
<dt><i>exctype</i></dt>
<dd>
the type of the exception
</dd><dt><i>excval</i></dt>
<dd>
data about the exception
</dd><dt><i>exctb</i></dt>
<dd>
traceback for the exception
</dd>
</dl><a NAME="DebugClientBase.absPath" ID="DebugClientBase.absPath"></a>
<h4>DebugClientBase.absPath</h4>
<b>absPath</b>(<i>fn</i>)
<p>
        Public method to convert a filename to an absolute name.
</p><p>
        sys.path is used as a set of possible prefixes. The name stays
        relative if a file could not be found.
</p><dl>
<dt><i>fn</i></dt>
<dd>
filename (string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
the converted filename (string)
</dd>
</dl><a NAME="DebugClientBase.close" ID="DebugClientBase.close"></a>
<h4>DebugClientBase.close</h4>
<b>close</b>(<i>fd</i>)
<p>
        Public method implementing a close method as a replacement for
        os.close().
</p><p>
        It prevents the debugger connections from being closed.
</p><dl>
<dt><i>fd</i></dt>
<dd>
file descriptor to be closed (integer)
</dd>
</dl><a NAME="DebugClientBase.connectDebugger" ID="DebugClientBase.connectDebugger"></a>
<h4>DebugClientBase.connectDebugger</h4>
<b>connectDebugger</b>(<i>port, remoteAddress=None, redirect=True</i>)
<p>
        Public method to establish a session with the debugger.
</p><p>
        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.
</p><dl>
<dt><i>port</i></dt>
<dd>
the port number to connect to (int)
</dd><dt><i>remoteAddress</i></dt>
<dd>
the network address of the debug server host
            (string)
</dd><dt><i>redirect</i></dt>
<dd>
flag indicating redirection of stdin, stdout and
            stderr (boolean)
</dd>
</dl><a NAME="DebugClientBase.eventLoop" ID="DebugClientBase.eventLoop"></a>
<h4>DebugClientBase.eventLoop</h4>
<b>eventLoop</b>(<i>disablePolling=False</i>)
<p>
        Public method implementing our event loop.
</p><dl>
<dt><i>disablePolling</i></dt>
<dd>
flag indicating to enter an event loop with
            polling disabled (boolean)
</dd>
</dl><a NAME="DebugClientBase.eventPoll" ID="DebugClientBase.eventPoll"></a>
<h4>DebugClientBase.eventPoll</h4>
<b>eventPoll</b>(<i></i>)
<p>
        Public method to poll for events like 'set break point'.
</p><a NAME="DebugClientBase.fork" ID="DebugClientBase.fork"></a>
<h4>DebugClientBase.fork</h4>
<b>fork</b>(<i></i>)
<p>
        Public method implementing a fork routine deciding which branch
        to follow.
</p><dl>
<dt>Returns:</dt>
<dd>
process ID (integer)
</dd>
</dl><a NAME="DebugClientBase.getCoding" ID="DebugClientBase.getCoding"></a>
<h4>DebugClientBase.getCoding</h4>
<b>getCoding</b>(<i></i>)
<p>
        Public method to return the current coding.
</p><dl>
<dt>Returns:</dt>
<dd>
codec name (string)
</dd>
</dl><a NAME="DebugClientBase.getRunning" ID="DebugClientBase.getRunning"></a>
<h4>DebugClientBase.getRunning</h4>
<b>getRunning</b>(<i></i>)
<p>
        Public method to return the main script we are currently running.
</p><dl>
<dt>Returns:</dt>
<dd>
flag indicating a running debug session (boolean)
</dd>
</dl><a NAME="DebugClientBase.handleJsonCommand" ID="DebugClientBase.handleJsonCommand"></a>
<h4>DebugClientBase.handleJsonCommand</h4>
<b>handleJsonCommand</b>(<i>jsonStr</i>)
<p>
        Public method to handle a command serialized as a JSON string.
</p><dl>
<dt><i>jsonStr</i> (str)</dt>
<dd>
string containing the command received from the IDE
</dd>
</dl><a NAME="DebugClientBase.input" ID="DebugClientBase.input"></a>
<h4>DebugClientBase.input</h4>
<b>input</b>(<i>prompt</i>)
<p>
        Public method to implement input() (Python 2) using the event loop.
</p><dl>
<dt><i>prompt</i></dt>
<dd>
the prompt to be shown (string)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
the entered string evaluated as a Python expresion
</dd>
</dl><a NAME="DebugClientBase.main" ID="DebugClientBase.main"></a>
<h4>DebugClientBase.main</h4>
<b>main</b>(<i></i>)
<p>
        Public method implementing the main method.
</p><a NAME="DebugClientBase.progTerminated" ID="DebugClientBase.progTerminated"></a>
<h4>DebugClientBase.progTerminated</h4>
<b>progTerminated</b>(<i>status, message=""</i>)
<p>
        Public method to tell the debugger that the program has terminated.
</p><dl>
<dt><i>status</i> (int)</dt>
<dd>
return status
</dd><dt><i>message</i> (str)</dt>
<dd>
status message
</dd>
</dl><a NAME="DebugClientBase.raw_input" ID="DebugClientBase.raw_input"></a>
<h4>DebugClientBase.raw_input</h4>
<b>raw_input</b>(<i>prompt, echo</i>)
<p>
        Public method to implement raw_input() / input() using the event loop.
</p><dl>
<dt><i>prompt</i></dt>
<dd>
the prompt to be shown (string)
</dd><dt><i>echo</i></dt>
<dd>
Flag indicating echoing of the input (boolean)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
the entered string
</dd>
</dl><a NAME="DebugClientBase.readReady" ID="DebugClientBase.readReady"></a>
<h4>DebugClientBase.readReady</h4>
<b>readReady</b>(<i>stream</i>)
<p>
        Public method called when there is data ready to be read.
</p><dl>
<dt><i>stream</i></dt>
<dd>
file like object that has data to be written
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
flag indicating an error condition
</dd>
</dl><dl>
<dt>Return Type:</dt>
<dd>
bool
</dd>
</dl><a NAME="DebugClientBase.run_call" ID="DebugClientBase.run_call"></a>
<h4>DebugClientBase.run_call</h4>
<b>run_call</b>(<i>scriptname, func, *args</i>)
<p>
        Public method used to start the remote debugger and call a function.
</p><dl>
<dt><i>scriptname</i></dt>
<dd>
name of the script to be debugged (string)
</dd><dt><i>func</i></dt>
<dd>
function to be called
</dd><dt><i>*args</i></dt>
<dd>
arguments being passed to func
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
result of the function call
</dd>
</dl><a NAME="DebugClientBase.sendCallTrace" ID="DebugClientBase.sendCallTrace"></a>
<h4>DebugClientBase.sendCallTrace</h4>
<b>sendCallTrace</b>(<i>event, fromInfo, toInfo</i>)
<p>
        Public method to send a call trace entry.
</p><dl>
<dt><i>event</i> (str)</dt>
<dd>
trace event (call or return)
</dd><dt><i>fromInfo</i> (dict with 'filename', 'linenumber' and 'codename')</dt>
<dd>
dictionary containing the origin info
            as keys
</dd><dt><i>toInfo</i> (dict with 'filename', 'linenumber' and 'codename')</dt>
<dd>
dictionary containing the target info
            as keys
</dd>
</dl><a NAME="DebugClientBase.sendClearTemporaryBreakpoint" ID="DebugClientBase.sendClearTemporaryBreakpoint"></a>
<h4>DebugClientBase.sendClearTemporaryBreakpoint</h4>
<b>sendClearTemporaryBreakpoint</b>(<i>filename, lineno</i>)
<p>
        Public method to signal the deletion of a temporary breakpoint.
</p><dl>
<dt><i>filename</i> (str)</dt>
<dd>
name of the file the bp belongs to
</dd><dt><i>lineno</i> (int)</dt>
<dd>
linenumber of the bp
</dd>
</dl><a NAME="DebugClientBase.sendClearTemporaryWatch" ID="DebugClientBase.sendClearTemporaryWatch"></a>
<h4>DebugClientBase.sendClearTemporaryWatch</h4>
<b>sendClearTemporaryWatch</b>(<i>condition</i>)
<p>
        Public method to signal the deletion of a temporary watch expression.
</p><dl>
<dt><i>condition</i> (str)</dt>
<dd>
condition of the watch expression to be cleared
</dd>
</dl><a NAME="DebugClientBase.sendException" ID="DebugClientBase.sendException"></a>
<h4>DebugClientBase.sendException</h4>
<b>sendException</b>(<i>exceptionType, exceptionMessage, stack</i>)
<p>
        Public method to send information for an exception.
</p><dl>
<dt><i>exceptionType</i> (str)</dt>
<dd>
type of exception raised
</dd><dt><i>exceptionMessage</i> (str)</dt>
<dd>
message of the exception
</dd><dt><i>stack</i> (list)</dt>
<dd>
stack trace information
</dd>
</dl><a NAME="DebugClientBase.sendJsonCommand" ID="DebugClientBase.sendJsonCommand"></a>
<h4>DebugClientBase.sendJsonCommand</h4>
<b>sendJsonCommand</b>(<i>method, params</i>)
<p>
        Public method to send a single command or response to the IDE.
</p><dl>
<dt><i>method</i> (str)</dt>
<dd>
command or response command name to be sent
</dd><dt><i>params</i> (dict)</dt>
<dd>
dictionary of named parameters for the command or
            response
</dd>
</dl><a NAME="DebugClientBase.sendPassiveStartup" ID="DebugClientBase.sendPassiveStartup"></a>
<h4>DebugClientBase.sendPassiveStartup</h4>
<b>sendPassiveStartup</b>(<i>filename, exceptions</i>)
<p>
        Public method to send the passive start information.
</p><dl>
<dt><i>filename</i> (str)</dt>
<dd>
name of the script
</dd><dt><i>exceptions</i> (bool)</dt>
<dd>
flag to enable exception reporting of the IDE
</dd>
</dl><a NAME="DebugClientBase.sendResponseLine" ID="DebugClientBase.sendResponseLine"></a>
<h4>DebugClientBase.sendResponseLine</h4>
<b>sendResponseLine</b>(<i>stack</i>)
<p>
        Public method to send the current call stack.
</p><dl>
<dt><i>stack</i> (list)</dt>
<dd>
call stack
</dd>
</dl><a NAME="DebugClientBase.sendSyntaxError" ID="DebugClientBase.sendSyntaxError"></a>
<h4>DebugClientBase.sendSyntaxError</h4>
<b>sendSyntaxError</b>(<i>message, filename, lineno, charno</i>)
<p>
        Public method to send information for a syntax error.
</p><dl>
<dt><i>message</i> (str)</dt>
<dd>
syntax error message
</dd><dt><i>filename</i> (str)</dt>
<dd>
name of the faulty file
</dd><dt><i>lineno</i> (int)</dt>
<dd>
line number info
</dd><dt><i>charno</i> (int)</dt>
<dd>
character number info
</dd>
</dl><a NAME="DebugClientBase.sessionClose" ID="DebugClientBase.sessionClose"></a>
<h4>DebugClientBase.sessionClose</h4>
<b>sessionClose</b>(<i>terminate=True</i>)
<p>
        Public method to close the session with the debugger and optionally
        terminate.
</p><dl>
<dt><i>terminate</i></dt>
<dd>
flag indicating to terminate (boolean)
</dd>
</dl><a NAME="DebugClientBase.startDebugger" ID="DebugClientBase.startDebugger"></a>
<h4>DebugClientBase.startDebugger</h4>
<b>startDebugger</b>(<i>filename=None, host=None, port=None, enableTrace=True, exceptions=True, tracePython=False, redirect=True</i>)
<p>
        Public method used to start the remote debugger.
</p><dl>
<dt><i>filename</i></dt>
<dd>
the program to be debugged (string)
</dd><dt><i>host</i></dt>
<dd>
hostname of the debug server (string)
</dd><dt><i>port</i></dt>
<dd>
portnumber of the debug server (int)
</dd><dt><i>enableTrace</i></dt>
<dd>
flag to enable the tracing function (boolean)
</dd><dt><i>exceptions</i></dt>
<dd>
flag to enable exception reporting of the IDE
            (boolean)
</dd><dt><i>tracePython</i></dt>
<dd>
flag to enable tracing into the Python library
            (boolean)
</dd><dt><i>redirect</i></dt>
<dd>
flag indicating redirection of stdin, stdout and
            stderr (boolean)
</dd>
</dl><a NAME="DebugClientBase.startProgInDebugger" ID="DebugClientBase.startProgInDebugger"></a>
<h4>DebugClientBase.startProgInDebugger</h4>
<b>startProgInDebugger</b>(<i>progargs, wd='', host=None, port=None, exceptions=True, tracePython=False, redirect=True</i>)
<p>
        Public method used to start the remote debugger.
</p><dl>
<dt><i>progargs</i></dt>
<dd>
commandline for the program to be debugged
            (list of strings)
</dd><dt><i>wd</i></dt>
<dd>
working directory for the program execution (string)
</dd><dt><i>host</i></dt>
<dd>
hostname of the debug server (string)
</dd><dt><i>port</i></dt>
<dd>
portnumber of the debug server (int)
</dd><dt><i>exceptions</i></dt>
<dd>
flag to enable exception reporting of the IDE
            (boolean)
</dd><dt><i>tracePython</i></dt>
<dd>
flag to enable tracing into the Python library
            (boolean)
</dd><dt><i>redirect</i></dt>
<dd>
flag indicating redirection of stdin, stdout and
            stderr (boolean)
</dd>
</dl><a NAME="DebugClientBase.writeReady" ID="DebugClientBase.writeReady"></a>
<h4>DebugClientBase.writeReady</h4>
<b>writeReady</b>(<i>stream</i>)
<p>
        Public method called when we are ready to write data.
</p><dl>
<dt><i>stream</i></dt>
<dd>
file like object that has data to be written
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="DebugClientClose" ID="DebugClientClose"></a>
<h2>DebugClientClose</h2>
<b>DebugClientClose</b>(<i>fd</i>)
<p>
    Replacement for the standard os.close(fd).
</p><dl>
<dt><i>fd</i></dt>
<dd>
open file descriptor to be closed (integer)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="DebugClientFork" ID="DebugClientFork"></a>
<h2>DebugClientFork</h2>
<b>DebugClientFork</b>(<i></i>)
<p>
    Replacement for the standard os.fork().
</p><dl>
<dt>Returns:</dt>
<dd>
result of the fork() call
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="DebugClientInput" ID="DebugClientInput"></a>
<h2>DebugClientInput</h2>
<b>DebugClientInput</b>(<i>prompt="", echo=True</i>)
<p>
    Replacement for the standard input builtin.
</p><p>
    This function works with the split debugger.
</p><dl>
<dt><i>prompt</i></dt>
<dd>
prompt to be shown (string)
</dd><dt><i>echo</i></dt>
<dd>
flag indicating to echo the output (boolean)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
result of the input() call
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="DebugClientRawInput" ID="DebugClientRawInput"></a>
<h2>DebugClientRawInput</h2>
<b>DebugClientRawInput</b>(<i>prompt="", echo=True</i>)
<p>
    Replacement for the standard raw_input builtin.
</p><p>
    This function works with the split debugger.
</p><dl>
<dt><i>prompt</i></dt>
<dd>
prompt to be shown. (string)
</dd><dt><i>echo</i></dt>
<dd>
flag indicating echoing of the input (boolean)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
result of the raw_input() call
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="DebugClientSetRecursionLimit" ID="DebugClientSetRecursionLimit"></a>
<h2>DebugClientSetRecursionLimit</h2>
<b>DebugClientSetRecursionLimit</b>(<i>limit</i>)
<p>
    Replacement for the standard sys.setrecursionlimit(limit).
</p><dl>
<dt><i>limit</i></dt>
<dd>
recursion limit (integer)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial