~mcfletch/eric/update-to-4.5.13

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html><head>
<title>eric4.DebugClients.Python3.DebugClientThreads</title>
<style>
body {
    background:white;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #4FA4FF; }
h2 { color: white; background: #4FA4FF; }
h3 { color: white; background: #00557F; }
h4 { color: white; background: #00557F; }
    
a { color: #AA5500; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric4.DebugClients.Python3.DebugClientThreads</h1>
<p>
Module implementing the multithreaded version of the debug client.
</p>
<h3>Global Attributes</h3>
<table>
<tr><td>_original_start_thread</td></tr>
</table>
<h3>Classes</h3>
<table>
<tr>
<td><a href="#DebugClientThreads">DebugClientThreads</a></td>
<td>Class implementing the client side of the debugger.</td>
</tr>
</table>
<h3>Functions</h3>
<table>
<tr>
<td><a href="#_debugclient_start_new_thread">_debugclient_start_new_thread</a></td>
<td>Module function used to allow for debugging of multiple threads.</td>
</tr>
</table>
<hr /><hr />
<a NAME="DebugClientThreads" ID="DebugClientThreads"></a>
<h2>DebugClientThreads</h2>
<p>
    Class implementing the client side of the debugger.
</p><p>
    This variant of the debugger implements a threaded debugger client
    by subclassing all relevant base classes.
</p>
<h3>Derived from</h3>
DebugClientBase.DebugClientBase, AsyncIO
<h3>Class Attributes</h3>
<table>
<tr><td>debugClient</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#DebugClientThreads.__init__">DebugClientThreads</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#DebugClientThreads.attachThread">attachThread</a></td>
<td>Public method to setup a thread for DebugClient to debug.</td>
</tr><tr>
<td><a href="#DebugClientThreads.eventLoop">eventLoop</a></td>
<td>Public method implementing our event loop.</td>
</tr><tr>
<td><a href="#DebugClientThreads.lockClient">lockClient</a></td>
<td>Public method to acquire the lock for this client.</td>
</tr><tr>
<td><a href="#DebugClientThreads.setCurrentThread">setCurrentThread</a></td>
<td>Private method to set the current thread.</td>
</tr><tr>
<td><a href="#DebugClientThreads.set_quit">set_quit</a></td>
<td>Private method to do a 'set quit' on all threads.</td>
</tr><tr>
<td><a href="#DebugClientThreads.threadTerminated">threadTerminated</a></td>
<td>Public method called when a DebugThread has exited.</td>
</tr><tr>
<td><a href="#DebugClientThreads.unlockClient">unlockClient</a></td>
<td>Public method to release the lock for this client.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="DebugClientThreads.__init__" ID="DebugClientThreads.__init__"></a>
<h4>DebugClientThreads (Constructor)</h4>
<b>DebugClientThreads</b>(<i></i>)
<p>
        Constructor
</p><a NAME="DebugClientThreads.attachThread" ID="DebugClientThreads.attachThread"></a>
<h4>DebugClientThreads.attachThread</h4>
<b>attachThread</b>(<i>target = None, args = None, kwargs = None, mainThread = False</i>)
<p>
        Public method to setup a thread for DebugClient to debug.
</p><p>
        If mainThread is non-zero, 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="DebugClientThreads.eventLoop" ID="DebugClientThreads.eventLoop"></a>
<h4>DebugClientThreads.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="DebugClientThreads.lockClient" ID="DebugClientThreads.lockClient"></a>
<h4>DebugClientThreads.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></dt>
<dd>
flag to indicating a blocking lock
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
flag indicating successful locking
</dd>
</dl><a NAME="DebugClientThreads.setCurrentThread" ID="DebugClientThreads.setCurrentThread"></a>
<h4>DebugClientThreads.setCurrentThread</h4>
<b>setCurrentThread</b>(<i>id</i>)
<p>
        Private method to set the current thread.
</p><dl>
<dt><i>id</i></dt>
<dd>
the id the current thread should be set to.
</dd>
</dl><a NAME="DebugClientThreads.set_quit" ID="DebugClientThreads.set_quit"></a>
<h4>DebugClientThreads.set_quit</h4>
<b>set_quit</b>(<i></i>)
<p>
        Private method to do a 'set quit' on all threads.
</p><a NAME="DebugClientThreads.threadTerminated" ID="DebugClientThreads.threadTerminated"></a>
<h4>DebugClientThreads.threadTerminated</h4>
<b>threadTerminated</b>(<i>dbgThread</i>)
<p>
        Public method called when a DebugThread has exited.
</p><dl>
<dt><i>dbgThread</i></dt>
<dd>
the DebugThread that has exited
</dd>
</dl><a NAME="DebugClientThreads.unlockClient" ID="DebugClientThreads.unlockClient"></a>
<h4>DebugClientThreads.unlockClient</h4>
<b>unlockClient</b>(<i></i>)
<p>
        Public method to release the lock for this client.
</p>
<div align="right"><a href="#top">Up</a></div>
<hr /><hr />
<a NAME="_debugclient_start_new_thread" ID="_debugclient_start_new_thread"></a>
<h2>_debugclient_start_new_thread</h2>
<b>_debugclient_start_new_thread</b>(<i>target, args, kwargs = {}</i>)
<p>
    Module function used to allow for debugging of multiple threads.
</p><p>
    The way it works is that below, we reset _thread._start_new_thread to 
    this function object. Thus, providing a hook for us to see when
    threads are started. From here we forward the request onto the 
    DebugClient which will create a DebugThread object to allow tracing
    of the thread then start up the thread. These actions are always
    performed in order to allow dropping into debug mode.
</p><p>
    See DebugClientThreads.attachThread and DebugThread.DebugThread in 
    DebugThread.py
</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>
</dl><dl>
<dt>Returns:</dt>
<dd>
The identifier of the created thread
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>