59 </table> |
59 </table> |
60 <h3>Methods</h3> |
60 <h3>Methods</h3> |
61 <table> |
61 <table> |
62 <tr> |
62 <tr> |
63 <td><a href="#DebugClientThreads.__init__">DebugClientThreads</a></td> |
63 <td><a href="#DebugClientThreads.__init__">DebugClientThreads</a></td> |
64 <td>Constructor</td> |
64 <td>Constructor</td> |
65 </tr><tr> |
65 </tr><tr> |
66 <td><a href="#DebugClientThreads.attachThread">attachThread</a></td> |
66 <td><a href="#DebugClientThreads.attachThread">attachThread</a></td> |
67 <td>Public method to setup a thread for DebugClient to debug.</td> |
67 <td>Public method to setup a thread for DebugClient to debug.</td> |
68 </tr><tr> |
68 </tr><tr> |
69 <td><a href="#DebugClientThreads.eventLoop">eventLoop</a></td> |
69 <td><a href="#DebugClientThreads.eventLoop">eventLoop</a></td> |
70 <td>Public method implementing our event loop.</td> |
70 <td>Public method implementing our event loop.</td> |
71 </tr><tr> |
71 </tr><tr> |
72 <td><a href="#DebugClientThreads.lockClient">lockClient</a></td> |
72 <td><a href="#DebugClientThreads.lockClient">lockClient</a></td> |
73 <td>Public method to acquire the lock for this client.</td> |
73 <td>Public method to acquire the lock for this client.</td> |
74 </tr><tr> |
74 </tr><tr> |
75 <td><a href="#DebugClientThreads.setCurrentThread">setCurrentThread</a></td> |
75 <td><a href="#DebugClientThreads.setCurrentThread">setCurrentThread</a></td> |
76 <td>Private method to set the current thread.</td> |
76 <td>Private method to set the current thread.</td> |
77 </tr><tr> |
77 </tr><tr> |
78 <td><a href="#DebugClientThreads.set_quit">set_quit</a></td> |
78 <td><a href="#DebugClientThreads.set_quit">set_quit</a></td> |
79 <td>Private method to do a 'set quit' on all threads.</td> |
79 <td>Private method to do a 'set quit' on all threads.</td> |
80 </tr><tr> |
80 </tr><tr> |
81 <td><a href="#DebugClientThreads.threadTerminated">threadTerminated</a></td> |
81 <td><a href="#DebugClientThreads.threadTerminated">threadTerminated</a></td> |
82 <td>Public method called when a DebugThread has exited.</td> |
82 <td>Public method called when a DebugThread has exited.</td> |
83 </tr><tr> |
83 </tr><tr> |
84 <td><a href="#DebugClientThreads.unlockClient">unlockClient</a></td> |
84 <td><a href="#DebugClientThreads.unlockClient">unlockClient</a></td> |
85 <td>Public method to release the lock for this client.</td> |
85 <td>Public method to release the lock for this client.</td> |
86 </tr> |
86 </tr> |
87 </table> |
87 </table> |
88 <a NAME="DebugClientThreads.__init__" ID="DebugClientThreads.__init__"></a> |
88 <a NAME="DebugClientThreads.__init__" ID="DebugClientThreads.__init__"></a> |
89 <h4>DebugClientThreads (Constructor)</h4> |
89 <h4>DebugClientThreads (Constructor)</h4> |
90 <b>DebugClientThreads</b>(<i></i>) |
90 <b>DebugClientThreads</b>(<i></i>) |
91 <p> |
91 <p> |
92 Constructor |
92 Constructor |
93 </p><a NAME="DebugClientThreads.attachThread" ID="DebugClientThreads.attachThread"></a> |
93 </p><a NAME="DebugClientThreads.attachThread" ID="DebugClientThreads.attachThread"></a> |
94 <h4>DebugClientThreads.attachThread</h4> |
94 <h4>DebugClientThreads.attachThread</h4> |
95 <b>attachThread</b>(<i>target = None, args = None, kwargs = None, mainThread = 0</i>) |
95 <b>attachThread</b>(<i>target = None, args = None, kwargs = None, mainThread = 0</i>) |
96 <p> |
96 <p> |
97 Public method to setup a thread for DebugClient to debug. |
97 Public method to setup a thread for DebugClient to debug. |
98 </p><p> |
98 </p><p> |
99 If mainThread is non-zero, then we are attaching to the already |
99 If mainThread is non-zero, then we are attaching to the already |
100 started mainthread of the app and the rest of the args are ignored. |
100 started mainthread of the app and the rest of the args are ignored. |
101 </p><dl> |
101 </p><dl> |
102 <dt><i>target</i></dt> |
102 <dt><i>target</i></dt> |
103 <dd> |
103 <dd> |
104 the start function of the target thread (i.e. the user code) |
104 the start function of the target thread (i.e. the user code) |
105 </dd><dt><i>args</i></dt> |
105 </dd><dt><i>args</i></dt> |
106 <dd> |
106 <dd> |
107 arguments to pass to target |
107 arguments to pass to target |
108 </dd><dt><i>kwargs</i></dt> |
108 </dd><dt><i>kwargs</i></dt> |
109 <dd> |
109 <dd> |
110 keyword arguments to pass to target |
110 keyword arguments to pass to target |
111 </dd><dt><i>mainThread</i></dt> |
111 </dd><dt><i>mainThread</i></dt> |
112 <dd> |
112 <dd> |
113 non-zero, if we are attaching to the already |
113 non-zero, if we are attaching to the already |
114 started mainthread of the app |
114 started mainthread of the app |
115 </dd> |
115 </dd> |
116 </dl><dl> |
116 </dl><dl> |
117 <dt>Returns:</dt> |
117 <dt>Returns:</dt> |
118 <dd> |
118 <dd> |
119 The identifier of the created thread |
119 The identifier of the created thread |
120 </dd> |
120 </dd> |
121 </dl><a NAME="DebugClientThreads.eventLoop" ID="DebugClientThreads.eventLoop"></a> |
121 </dl><a NAME="DebugClientThreads.eventLoop" ID="DebugClientThreads.eventLoop"></a> |
122 <h4>DebugClientThreads.eventLoop</h4> |
122 <h4>DebugClientThreads.eventLoop</h4> |
123 <b>eventLoop</b>(<i>disablePolling = False</i>) |
123 <b>eventLoop</b>(<i>disablePolling = False</i>) |
124 <p> |
124 <p> |
125 Public method implementing our event loop. |
125 Public method implementing our event loop. |
126 </p><dl> |
126 </p><dl> |
127 <dt><i>disablePolling</i></dt> |
127 <dt><i>disablePolling</i></dt> |
128 <dd> |
128 <dd> |
129 flag indicating to enter an event loop with |
129 flag indicating to enter an event loop with |
130 polling disabled (boolean) |
130 polling disabled (boolean) |
131 </dd> |
131 </dd> |
132 </dl><a NAME="DebugClientThreads.lockClient" ID="DebugClientThreads.lockClient"></a> |
132 </dl><a NAME="DebugClientThreads.lockClient" ID="DebugClientThreads.lockClient"></a> |
133 <h4>DebugClientThreads.lockClient</h4> |
133 <h4>DebugClientThreads.lockClient</h4> |
134 <b>lockClient</b>(<i>blocking = 1</i>) |
134 <b>lockClient</b>(<i>blocking = 1</i>) |
135 <p> |
135 <p> |
136 Public method to acquire the lock for this client. |
136 Public method to acquire the lock for this client. |
137 </p><dl> |
137 </p><dl> |
138 <dt><i>blocking</i></dt> |
138 <dt><i>blocking</i></dt> |
139 <dd> |
139 <dd> |
140 flag to indicating a blocking lock |
140 flag to indicating a blocking lock |
141 </dd> |
141 </dd> |
142 </dl><dl> |
142 </dl><dl> |
143 <dt>Returns:</dt> |
143 <dt>Returns:</dt> |
144 <dd> |
144 <dd> |
145 flag indicating successful locking |
145 flag indicating successful locking |
146 </dd> |
146 </dd> |
147 </dl><a NAME="DebugClientThreads.setCurrentThread" ID="DebugClientThreads.setCurrentThread"></a> |
147 </dl><a NAME="DebugClientThreads.setCurrentThread" ID="DebugClientThreads.setCurrentThread"></a> |
148 <h4>DebugClientThreads.setCurrentThread</h4> |
148 <h4>DebugClientThreads.setCurrentThread</h4> |
149 <b>setCurrentThread</b>(<i>id</i>) |
149 <b>setCurrentThread</b>(<i>id</i>) |
150 <p> |
150 <p> |
151 Private method to set the current thread. |
151 Private method to set the current thread. |
152 </p><dl> |
152 </p><dl> |
153 <dt><i>id</i></dt> |
153 <dt><i>id</i></dt> |
154 <dd> |
154 <dd> |
155 the id the current thread should be set to. |
155 the id the current thread should be set to. |
156 </dd> |
156 </dd> |
157 </dl><a NAME="DebugClientThreads.set_quit" ID="DebugClientThreads.set_quit"></a> |
157 </dl><a NAME="DebugClientThreads.set_quit" ID="DebugClientThreads.set_quit"></a> |
158 <h4>DebugClientThreads.set_quit</h4> |
158 <h4>DebugClientThreads.set_quit</h4> |
159 <b>set_quit</b>(<i></i>) |
159 <b>set_quit</b>(<i></i>) |
160 <p> |
160 <p> |
161 Private method to do a 'set quit' on all threads. |
161 Private method to do a 'set quit' on all threads. |
162 </p><a NAME="DebugClientThreads.threadTerminated" ID="DebugClientThreads.threadTerminated"></a> |
162 </p><a NAME="DebugClientThreads.threadTerminated" ID="DebugClientThreads.threadTerminated"></a> |
163 <h4>DebugClientThreads.threadTerminated</h4> |
163 <h4>DebugClientThreads.threadTerminated</h4> |
164 <b>threadTerminated</b>(<i>dbgThread</i>) |
164 <b>threadTerminated</b>(<i>dbgThread</i>) |
165 <p> |
165 <p> |
166 Public method called when a DebugThread has exited. |
166 Public method called when a DebugThread has exited. |
167 </p><dl> |
167 </p><dl> |
168 <dt><i>dbgThread</i></dt> |
168 <dt><i>dbgThread</i></dt> |
169 <dd> |
169 <dd> |
170 the DebugThread that has exited |
170 the DebugThread that has exited |
171 </dd> |
171 </dd> |
172 </dl><a NAME="DebugClientThreads.unlockClient" ID="DebugClientThreads.unlockClient"></a> |
172 </dl><a NAME="DebugClientThreads.unlockClient" ID="DebugClientThreads.unlockClient"></a> |
173 <h4>DebugClientThreads.unlockClient</h4> |
173 <h4>DebugClientThreads.unlockClient</h4> |
174 <b>unlockClient</b>(<i></i>) |
174 <b>unlockClient</b>(<i></i>) |
175 <p> |
175 <p> |
176 Public method to release the lock for this client. |
176 Public method to release the lock for this client. |
177 </p> |
177 </p> |
178 <div align="right"><a href="#top">Up</a></div> |
178 <div align="right"><a href="#top">Up</a></div> |
179 <hr /><hr /> |
179 <hr /><hr /> |
180 <a NAME="_debugclient_start_new_thread" ID="_debugclient_start_new_thread"></a> |
180 <a NAME="_debugclient_start_new_thread" ID="_debugclient_start_new_thread"></a> |
181 <h2>_debugclient_start_new_thread</h2> |
181 <h2>_debugclient_start_new_thread</h2> |
182 <b>_debugclient_start_new_thread</b>(<i>target, args, kwargs={}</i>) |
182 <b>_debugclient_start_new_thread</b>(<i>target, args, kwargs={}</i>) |
183 <p> |
183 <p> |
184 Module function used to allow for debugging of multiple threads. |
184 Module function used to allow for debugging of multiple threads. |
185 </p><p> |
185 </p><p> |
186 The way it works is that below, we reset thread._start_new_thread to |
186 The way it works is that below, we reset thread._start_new_thread to |
187 this function object. Thus, providing a hook for us to see when |
187 this function object. Thus, providing a hook for us to see when |
188 threads are started. From here we forward the request onto the |
188 threads are started. From here we forward the request onto the |
189 DebugClient which will create a DebugThread object to allow tracing |
189 DebugClient which will create a DebugThread object to allow tracing |
190 of the thread then start up the thread. These actions are always |
190 of the thread then start up the thread. These actions are always |
191 performed in order to allow dropping into debug mode. |
191 performed in order to allow dropping into debug mode. |
192 </p><p> |
192 </p><p> |
193 See DebugClientThreads.attachThread and DebugThread.DebugThread in |
193 See DebugClientThreads.attachThread and DebugThread.DebugThread in |
194 DebugThread.py |
194 DebugThread.py |
195 </p><dl> |
195 </p><dl> |
196 <dt><i>target</i></dt> |
196 <dt><i>target</i></dt> |
197 <dd> |
197 <dd> |
198 the start function of the target thread (i.e. the user code) |
198 the start function of the target thread (i.e. the user code) |
199 </dd><dt><i>args</i></dt> |
199 </dd><dt><i>args</i></dt> |
200 <dd> |
200 <dd> |
201 arguments to pass to target |
201 arguments to pass to target |
202 </dd><dt><i>kwargs</i></dt> |
202 </dd><dt><i>kwargs</i></dt> |
203 <dd> |
203 <dd> |
204 keyword arguments to pass to target |
204 keyword arguments to pass to target |
205 </dd> |
205 </dd> |
206 </dl><dl> |
206 </dl><dl> |
207 <dt>Returns:</dt> |
207 <dt>Returns:</dt> |
208 <dd> |
208 <dd> |
209 The identifier of the created thread |
209 The identifier of the created thread |
210 </dd> |
210 </dd> |
211 </dl> |
211 </dl> |
212 <div align="right"><a href="#top">Up</a></div> |
212 <div align="right"><a href="#top">Up</a></div> |
213 <hr /> |
213 <hr /> |
214 </body></html> |
214 </body></html> |