Sat, 25 Feb 2017 19:41:53 +0100
Updated source docu.
<!DOCTYPE html> <html><head> <title>eric6.DebugClients.Python.ThreadExtension</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.ThreadExtension</h1> <p> Module implementing an import hook patching thread modules to get debugged too. </p> <h3>Global Attributes</h3> <table> <tr><td>_qtThreadNumber</td></tr> </table> <h3>Classes</h3> <table> <tr> <td><a href="#QThreadWrapper">QThreadWrapper</a></td> <td>Wrapper class for *.QThread.</td> </tr><tr> <td><a href="#ThreadExtension">ThreadExtension</a></td> <td>Class implementing the thread support for the debugger.</td> </tr><tr> <td><a href="#ThreadWrapper">ThreadWrapper</a></td> <td>Wrapper class for threading.Thread.</td> </tr> </table> <h3>Functions</h3> <table> <tr><td>None</td></tr> </table> <hr /><hr /> <a NAME="QThreadWrapper" ID="QThreadWrapper"></a> <h2>QThreadWrapper</h2> <p> Wrapper class for *.QThread. </p> <h3>Derived from</h3> module.QThread <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#QThreadWrapper.__init__">QThreadWrapper</a></td> <td></td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="QThreadWrapper.__init__" ID="QThreadWrapper.__init__"></a> <h4>QThreadWrapper (Constructor)</h4> <b>QThreadWrapper</b>(<i>*args, **kwargs</i>) <div align="right"><a href="#top">Up</a></div> <hr /><hr /> <a NAME="ThreadExtension" ID="ThreadExtension"></a> <h2>ThreadExtension</h2> <p> Class implementing the thread support for the debugger. </p><p> Provides methods for intercepting thread creation, retriving the running threads and their name and state. </p> <h3>Derived from</h3> object <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#ThreadExtension.__init__">ThreadExtension</a></td> <td>Constructor</td> </tr><tr> <td><a href="#ThreadExtension._bootstrap">_bootstrap</a></td> <td>Bootstrap for threading, which reports exceptions correctly.</td> </tr><tr> <td><a href="#ThreadExtension._bootstrapQThread">_bootstrapQThread</a></td> <td>Bootstrap for QThread, which reports exceptions correctly.</td> </tr><tr> <td><a href="#ThreadExtension.attachThread">attachThread</a></td> <td>Public method to setup a standard thread for DebugClient to debug.</td> </tr><tr> <td><a href="#ThreadExtension.dumpThreadList">dumpThreadList</a></td> <td>Public method to send the list of threads.</td> </tr><tr> <td><a href="#ThreadExtension.find_module">find_module</a></td> <td>Public method returning the module loader.</td> </tr><tr> <td><a href="#ThreadExtension.getExecutedFrame">getExecutedFrame</a></td> <td>Public method to return the currently executed frame.</td> </tr><tr> <td><a href="#ThreadExtension.load_module">load_module</a></td> <td>Public method to load a module.</td> </tr><tr> <td><a href="#ThreadExtension.lockClient">lockClient</a></td> <td>Public method to acquire the lock for this client.</td> </tr><tr> <td><a href="#ThreadExtension.setCurrentThread">setCurrentThread</a></td> <td>Public method to set the current thread.</td> </tr><tr> <td><a href="#ThreadExtension.threadTerminated">threadTerminated</a></td> <td>Public method called when a DebugThread has exited.</td> </tr><tr> <td><a href="#ThreadExtension.unlockClient">unlockClient</a></td> <td>Public method to release the lock for this client.</td> </tr><tr> <td><a href="#ThreadExtension.updateThreadList">updateThreadList</a></td> <td>Public method to update the list of running threads.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="ThreadExtension.__init__" ID="ThreadExtension.__init__"></a> <h4>ThreadExtension (Constructor)</h4> <b>ThreadExtension</b>(<i></i>) <p> Constructor </p><a NAME="ThreadExtension._bootstrap" ID="ThreadExtension._bootstrap"></a> <h4>ThreadExtension._bootstrap</h4> <b>_bootstrap</b>(<i>run</i>) <p> Bootstrap for threading, which reports exceptions correctly. </p><dl> <dt><i>run</i> (method pointer)</dt> <dd> the run method of threading.Thread </dd> </dl><a NAME="ThreadExtension._bootstrapQThread" ID="ThreadExtension._bootstrapQThread"></a> <h4>ThreadExtension._bootstrapQThread</h4> <b>_bootstrapQThread</b>(<i>run</i>) <p> Bootstrap for QThread, which reports exceptions correctly. </p><dl> <dt><i>run</i> (method pointer)</dt> <dd> the run method of *.QThread </dd> </dl><a NAME="ThreadExtension.attachThread" ID="ThreadExtension.attachThread"></a> <h4>ThreadExtension.attachThread</h4> <b>attachThread</b>(<i>target=None, args=None, kwargs={}, mainThread=False</i>) <p> Public method to setup a standard thread for DebugClient to debug. </p><p> If mainThread is True, then we are attaching to the already started mainthread of the app and the rest of the args are ignored. </p><dl> <dt><i>target</i></dt> <dd> the start function of the target thread (i.e. the user code) </dd><dt><i>args</i></dt> <dd> arguments to pass to target </dd><dt><i>kwargs</i></dt> <dd> keyword arguments to pass to target </dd><dt><i>mainThread</i></dt> <dd> True, if we are attaching to the already started mainthread of the app </dd> </dl><dl> <dt>Returns:</dt> <dd> identifier of the created thread </dd> </dl><a NAME="ThreadExtension.dumpThreadList" ID="ThreadExtension.dumpThreadList"></a> <h4>ThreadExtension.dumpThreadList</h4> <b>dumpThreadList</b>(<i></i>) <p> Public method to send the list of threads. </p><a NAME="ThreadExtension.find_module" ID="ThreadExtension.find_module"></a> <h4>ThreadExtension.find_module</h4> <b>find_module</b>(<i>fullname, path=None</i>) <p> Public method returning the module loader. </p><dl> <dt><i>fullname</i> (str)</dt> <dd> name of the module to be loaded </dd><dt><i>path</i> (str)</dt> <dd> path to resolve the module name </dd> </dl><dl> <dt>Returns:</dt> <dd> module loader object </dd> </dl><dl> <dt>Return Type:</dt> <dd> object </dd> </dl><a NAME="ThreadExtension.getExecutedFrame" ID="ThreadExtension.getExecutedFrame"></a> <h4>ThreadExtension.getExecutedFrame</h4> <b>getExecutedFrame</b>(<i>frame</i>) <p> Public method to return the currently executed frame. </p><dl> <dt><i>frame</i> (frame object)</dt> <dd> the current frame </dd> </dl><dl> <dt>Returns:</dt> <dd> the frame which is excecuted (without debugger frames) </dd> </dl><dl> <dt>Return Type:</dt> <dd> frame object </dd> </dl><a NAME="ThreadExtension.load_module" ID="ThreadExtension.load_module"></a> <h4>ThreadExtension.load_module</h4> <b>load_module</b>(<i>fullname</i>) <p> Public method to load a module. </p><dl> <dt><i>fullname</i> (str)</dt> <dd> name of the module to be loaded </dd> </dl><dl> <dt>Returns:</dt> <dd> reference to the loaded module </dd> </dl><dl> <dt>Return Type:</dt> <dd> module </dd> </dl><a NAME="ThreadExtension.lockClient" ID="ThreadExtension.lockClient"></a> <h4>ThreadExtension.lockClient</h4> <b>lockClient</b>(<i>blocking=True</i>) <p> Public method to acquire the lock for this client. </p><dl> <dt><i>blocking</i> (bool)</dt> <dd> flag to indicating a blocking lock </dd> </dl><dl> <dt>Returns:</dt> <dd> flag indicating successful locking </dd> </dl><dl> <dt>Return Type:</dt> <dd> bool </dd> </dl><a NAME="ThreadExtension.setCurrentThread" ID="ThreadExtension.setCurrentThread"></a> <h4>ThreadExtension.setCurrentThread</h4> <b>setCurrentThread</b>(<i>id</i>) <p> Public method to set the current thread. </p><dl> <dt><i>id</i> (int)</dt> <dd> the id the current thread should be set to. </dd> </dl><a NAME="ThreadExtension.threadTerminated" ID="ThreadExtension.threadTerminated"></a> <h4>ThreadExtension.threadTerminated</h4> <b>threadTerminated</b>(<i>threadId</i>) <p> Public method called when a DebugThread has exited. </p><dl> <dt><i>threadId</i> (int)</dt> <dd> id of the DebugThread that has exited </dd> </dl><a NAME="ThreadExtension.unlockClient" ID="ThreadExtension.unlockClient"></a> <h4>ThreadExtension.unlockClient</h4> <b>unlockClient</b>(<i></i>) <p> Public method to release the lock for this client. </p><a NAME="ThreadExtension.updateThreadList" ID="ThreadExtension.updateThreadList"></a> <h4>ThreadExtension.updateThreadList</h4> <b>updateThreadList</b>(<i></i>) <p> Public method to update the list of running threads. </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> <a NAME="ThreadWrapper" ID="ThreadWrapper"></a> <h2>ThreadWrapper</h2> <p> Wrapper class for threading.Thread. </p> <h3>Derived from</h3> module.Thread <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> </table> <h3>Class Methods</h3> <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> <table> <tr> <td><a href="#ThreadWrapper.__init__">ThreadWrapper</a></td> <td></td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> <a NAME="ThreadWrapper.__init__" ID="ThreadWrapper.__init__"></a> <h4>ThreadWrapper (Constructor)</h4> <b>ThreadWrapper</b>(<i>*args, **kwargs</i>) <div align="right"><a href="#top">Up</a></div> <hr /> </body></html>