--- a/Documentation/Source/eric6.DebugClients.Python3.DebugClientBase.html Sun Sep 04 13:51:33 2016 +0200 +++ b/Documentation/Source/eric6.DebugClients.Python3.DebugClientBase.html Sun Sep 04 13:58:11 2016 +0200 @@ -57,27 +57,11 @@ Class implementing the client side of the debugger. </p><p> It provides access to the Python interpeter from a debugger running in - another process whether or not the Qt event loop is running. -</p><p> - The protocol between the debugger and the client assumes that there will be - a single source of debugger commands and a single source of Python - statements. Commands and statement are always exactly one line and may be - interspersed. + another process. </p><p> - 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 Python statement. - See DebugProtocol.py for a listing of valid protocol tokens. -</p><p> - A Python 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. -</p><p> - The client may send any other lines at any other time which should be - interpreted as program output. + 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 @@ -120,9 +104,6 @@ <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.__exceptionRaised">__exceptionRaised</a></td> -<td>Private method called in the case of an exception.</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> @@ -183,6 +164,9 @@ <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.handleLine">handleLine</a></td> <td>Public method to handle the receipt of a complete line.</td> </tr><tr> @@ -195,9 +179,36 @@ <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.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> @@ -210,8 +221,8 @@ <td><a href="#DebugClientBase.startProgInDebugger">startProgInDebugger</a></td> <td>Public method used to start the remote debugger.</td> </tr><tr> -<td><a href="#DebugClientBase.write">write</a></td> -<td>Public method to write data to the output stream.</td> +<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> @@ -306,14 +317,7 @@ the indices of variable types to be filtered (list of int) </dd> -</dl><a NAME="DebugClientBase.__exceptionRaised" ID="DebugClientBase.__exceptionRaised"></a> -<h4>DebugClientBase.__exceptionRaised</h4> -<b>__exceptionRaised</b>(<i></i>) -<p> - Private method called in the case of an exception. -</p><p> - It ensures that the debug server is informed of the raised exception. -</p><a NAME="DebugClientBase.__formatQtVariable" ID="DebugClientBase.__formatQtVariable"></a> +</dl><a NAME="DebugClientBase.__formatQtVariable" ID="DebugClientBase.__formatQtVariable"></a> <h4>DebugClientBase.__formatQtVariable</h4> <b>__formatQtVariable</b>(<i>value, vtype</i>) <p> @@ -609,6 +613,16 @@ <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.handleLine" ID="DebugClientBase.handleLine"></a> <h4>DebugClientBase.handleLine</h4> <b>handleLine</b>(<i>line</i>) @@ -647,13 +661,26 @@ Public method implementing the main method. </p><a NAME="DebugClientBase.progTerminated" ID="DebugClientBase.progTerminated"></a> <h4>DebugClientBase.progTerminated</h4> -<b>progTerminated</b>(<i>status</i>) +<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.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><a NAME="DebugClientBase.run_call" ID="DebugClientBase.run_call"></a> <h4>DebugClientBase.run_call</h4> @@ -676,6 +703,119 @@ <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>exit=True</i>) @@ -766,15 +906,15 @@ flag indicating redirection of stdin, stdout and stderr (boolean) </dd> -</dl><a NAME="DebugClientBase.write" ID="DebugClientBase.write"></a> -<h4>DebugClientBase.write</h4> -<b>write</b>(<i>s</i>) +</dl><a NAME="DebugClientBase.writeReady" ID="DebugClientBase.writeReady"></a> +<h4>DebugClientBase.writeReady</h4> +<b>writeReady</b>(<i>stream</i>) <p> - Public method to write data to the output stream. + Public method called when we are ready to write data. </p><dl> -<dt><i>s</i></dt> +<dt><i>stream</i></dt> <dd> -data to be written (string) +file like object that has data to be written </dd> </dl> <div align="right"><a href="#top">Up</a></div>