|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.DebugClients.Python.MultiProcessDebugExtension</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.DebugClients.Python.MultiProcessDebugExtension</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a function to patch the process creation functions to |
|
13 support multiprocess debugging. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 |
|
17 <table> |
|
18 <tr><td>_debugClient</td></tr> |
|
19 </table> |
|
20 <h3>Classes</h3> |
|
21 |
|
22 <table> |
|
23 <tr><td>None</td></tr> |
|
24 </table> |
|
25 <h3>Functions</h3> |
|
26 |
|
27 <table> |
|
28 |
|
29 <tr> |
|
30 <td><a href="#_shallPatch">_shallPatch</a></td> |
|
31 <td>Function to determine, if the multiprocessing patches should be done.</td> |
|
32 </tr> |
|
33 <tr> |
|
34 <td><a href="#createCreateProcess">createCreateProcess</a></td> |
|
35 <td>Function to patch the 'CreateProcess' process creation function of Windows.</td> |
|
36 </tr> |
|
37 <tr> |
|
38 <td><a href="#createExecl">createExecl</a></td> |
|
39 <td>Function to patch the 'execl' process creation functions.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#createExecv">createExecv</a></td> |
|
43 <td>Function to patch the 'execv' process creation functions.</td> |
|
44 </tr> |
|
45 <tr> |
|
46 <td><a href="#createExecve">createExecve</a></td> |
|
47 <td>Function to patch the 'execve' process creation functions.</td> |
|
48 </tr> |
|
49 <tr> |
|
50 <td><a href="#createFork">createFork</a></td> |
|
51 <td>Function to patch the 'fork' process creation functions.</td> |
|
52 </tr> |
|
53 <tr> |
|
54 <td><a href="#createForkExec">createForkExec</a></td> |
|
55 <td>Function to patch the 'fork_exec' process creation functions.</td> |
|
56 </tr> |
|
57 <tr> |
|
58 <td><a href="#createPosixSpawn">createPosixSpawn</a></td> |
|
59 <td>Function to patch the 'posix_spawn' process creation functions.</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#createSpawnl">createSpawnl</a></td> |
|
63 <td>Function to patch the 'spawnl' process creation functions.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#createSpawnv">createSpawnv</a></td> |
|
67 <td>Function to patch the 'spawnv' process creation functions.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#createSpawnve">createSpawnve</a></td> |
|
71 <td>Function to patch the 'spawnve' process creation functions.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#newCreateProcess">newCreateProcess</a></td> |
|
75 <td>Function replacing the 'CreateProcess' function of the _subprocess or _winapi module.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#newExecl">newExecl</a></td> |
|
79 <td>Function replacing the 'execl' functions of the os module.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#newExecv">newExecv</a></td> |
|
83 <td>Function replacing the 'execv' functions of the os module.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#newExecve">newExecve</a></td> |
|
87 <td>Function replacing the 'execve' functions of the os module.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#newFork">newFork</a></td> |
|
91 <td>Function replacing the 'fork' function of the os module.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#newForkExec">newForkExec</a></td> |
|
95 <td>Function replacing the 'fork_exec' functions of the _posixsubprocess module.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#newPosixSpawn">newPosixSpawn</a></td> |
|
99 <td>Function replacing the 'posix_spawn' functions of the os module.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#newSpawnl">newSpawnl</a></td> |
|
103 <td>Function replacing the 'spawnl' functions of the os module.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#newSpawnv">newSpawnv</a></td> |
|
107 <td>Function replacing the 'spawnv' functions of the os module.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#newSpawnve">newSpawnve</a></td> |
|
111 <td>Function replacing the 'spawnve' functions of the os module.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#patchModule">patchModule</a></td> |
|
115 <td>Function to replace a function of a module with a modified one.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#patchNewProcessFunctions">patchNewProcessFunctions</a></td> |
|
119 <td>Function to patch the process creation functions to support multiprocess debugging.</td> |
|
120 </tr> |
|
121 </table> |
|
122 <hr /> |
|
123 <hr /> |
|
124 <a NAME="_shallPatch" ID="_shallPatch"></a> |
|
125 <h2>_shallPatch</h2> |
|
126 <b>_shallPatch</b>(<i></i>) |
|
127 |
|
128 <p> |
|
129 Function to determine, if the multiprocessing patches should be done. |
|
130 </p> |
|
131 <dl> |
|
132 <dt>Return:</dt> |
|
133 <dd> |
|
134 flag indicating patching should be performed |
|
135 </dd> |
|
136 </dl> |
|
137 <dl> |
|
138 <dt>Return Type:</dt> |
|
139 <dd> |
|
140 bool |
|
141 </dd> |
|
142 </dl> |
|
143 <div align="right"><a href="#top">Up</a></div> |
|
144 <hr /> |
|
145 <hr /> |
|
146 <a NAME="createCreateProcess" ID="createCreateProcess"></a> |
|
147 <h2>createCreateProcess</h2> |
|
148 <b>createCreateProcess</b>(<i>originalName</i>) |
|
149 |
|
150 <p> |
|
151 Function to patch the 'CreateProcess' process creation function of |
|
152 Windows. |
|
153 </p> |
|
154 <dl> |
|
155 |
|
156 <dt><i>originalName</i> (str)</dt> |
|
157 <dd> |
|
158 original name of the function to be patched |
|
159 </dd> |
|
160 </dl> |
|
161 <dl> |
|
162 <dt>Return:</dt> |
|
163 <dd> |
|
164 function replacing the original one |
|
165 </dd> |
|
166 </dl> |
|
167 <dl> |
|
168 <dt>Return Type:</dt> |
|
169 <dd> |
|
170 function |
|
171 </dd> |
|
172 </dl> |
|
173 <div align="right"><a href="#top">Up</a></div> |
|
174 <hr /> |
|
175 <hr /> |
|
176 <a NAME="createExecl" ID="createExecl"></a> |
|
177 <h2>createExecl</h2> |
|
178 <b>createExecl</b>(<i>originalName</i>) |
|
179 |
|
180 <p> |
|
181 Function to patch the 'execl' process creation functions. |
|
182 </p> |
|
183 <p> |
|
184 <ul> |
|
185 <li>os.execl(path, arg0, arg1, ...)</li> |
|
186 <li>os.execle(path, arg0, arg1, ..., env)</li> |
|
187 <li>os.execlp(file, arg0, arg1, ...)</li> |
|
188 <li>os.execlpe(file, arg0, arg1, ..., env)</li> |
|
189 </ul> |
|
190 </p> |
|
191 <dl> |
|
192 |
|
193 <dt><i>originalName</i> (str)</dt> |
|
194 <dd> |
|
195 original name of the function to be patched |
|
196 </dd> |
|
197 </dl> |
|
198 <dl> |
|
199 <dt>Return:</dt> |
|
200 <dd> |
|
201 function replacing the original one |
|
202 </dd> |
|
203 </dl> |
|
204 <dl> |
|
205 <dt>Return Type:</dt> |
|
206 <dd> |
|
207 function |
|
208 </dd> |
|
209 </dl> |
|
210 <div align="right"><a href="#top">Up</a></div> |
|
211 <hr /> |
|
212 <hr /> |
|
213 <a NAME="createExecv" ID="createExecv"></a> |
|
214 <h2>createExecv</h2> |
|
215 <b>createExecv</b>(<i>originalName</i>) |
|
216 |
|
217 <p> |
|
218 Function to patch the 'execv' process creation functions. |
|
219 </p> |
|
220 <p> |
|
221 <ul> |
|
222 <li>os.execv(path, args)</li> |
|
223 <li>os.execvp(file, args)</li> |
|
224 </ul> |
|
225 </p> |
|
226 <dl> |
|
227 |
|
228 <dt><i>originalName</i> (str)</dt> |
|
229 <dd> |
|
230 original name of the function to be patched |
|
231 </dd> |
|
232 </dl> |
|
233 <dl> |
|
234 <dt>Return:</dt> |
|
235 <dd> |
|
236 function replacing the original one |
|
237 </dd> |
|
238 </dl> |
|
239 <dl> |
|
240 <dt>Return Type:</dt> |
|
241 <dd> |
|
242 function |
|
243 </dd> |
|
244 </dl> |
|
245 <div align="right"><a href="#top">Up</a></div> |
|
246 <hr /> |
|
247 <hr /> |
|
248 <a NAME="createExecve" ID="createExecve"></a> |
|
249 <h2>createExecve</h2> |
|
250 <b>createExecve</b>(<i>originalName</i>) |
|
251 |
|
252 <p> |
|
253 Function to patch the 'execve' process creation functions. |
|
254 </p> |
|
255 <p> |
|
256 <ul> |
|
257 <li>os.execve(path, args, env)</li> |
|
258 <li>os.execvpe(file, args, env)</li> |
|
259 </ul> |
|
260 </p> |
|
261 <dl> |
|
262 |
|
263 <dt><i>originalName</i> (str)</dt> |
|
264 <dd> |
|
265 original name of the function to be patched |
|
266 </dd> |
|
267 </dl> |
|
268 <dl> |
|
269 <dt>Return:</dt> |
|
270 <dd> |
|
271 function replacing the original one |
|
272 </dd> |
|
273 </dl> |
|
274 <dl> |
|
275 <dt>Return Type:</dt> |
|
276 <dd> |
|
277 function |
|
278 </dd> |
|
279 </dl> |
|
280 <div align="right"><a href="#top">Up</a></div> |
|
281 <hr /> |
|
282 <hr /> |
|
283 <a NAME="createFork" ID="createFork"></a> |
|
284 <h2>createFork</h2> |
|
285 <b>createFork</b>(<i>originalName</i>) |
|
286 |
|
287 <p> |
|
288 Function to patch the 'fork' process creation functions. |
|
289 </p> |
|
290 <p> |
|
291 <ul> |
|
292 <li>os.fork()</li> |
|
293 </ul> |
|
294 </p> |
|
295 <dl> |
|
296 |
|
297 <dt><i>originalName</i> (str)</dt> |
|
298 <dd> |
|
299 original name of the function to be patched |
|
300 </dd> |
|
301 </dl> |
|
302 <dl> |
|
303 <dt>Return:</dt> |
|
304 <dd> |
|
305 function replacing the original one |
|
306 </dd> |
|
307 </dl> |
|
308 <dl> |
|
309 <dt>Return Type:</dt> |
|
310 <dd> |
|
311 function |
|
312 </dd> |
|
313 </dl> |
|
314 <div align="right"><a href="#top">Up</a></div> |
|
315 <hr /> |
|
316 <hr /> |
|
317 <a NAME="createForkExec" ID="createForkExec"></a> |
|
318 <h2>createForkExec</h2> |
|
319 <b>createForkExec</b>(<i>originalName</i>) |
|
320 |
|
321 <p> |
|
322 Function to patch the 'fork_exec' process creation functions. |
|
323 </p> |
|
324 <p> |
|
325 <ul> |
|
326 <li>_posixsubprocess.fork_exec(args, executable_list, close_fds, |
|
327 ... (13 more))</li> |
|
328 </ul> |
|
329 </p> |
|
330 <dl> |
|
331 |
|
332 <dt><i>originalName</i> (str)</dt> |
|
333 <dd> |
|
334 original name of the function to be patched |
|
335 </dd> |
|
336 </dl> |
|
337 <dl> |
|
338 <dt>Return:</dt> |
|
339 <dd> |
|
340 function replacing the original one |
|
341 </dd> |
|
342 </dl> |
|
343 <dl> |
|
344 <dt>Return Type:</dt> |
|
345 <dd> |
|
346 function |
|
347 </dd> |
|
348 </dl> |
|
349 <div align="right"><a href="#top">Up</a></div> |
|
350 <hr /> |
|
351 <hr /> |
|
352 <a NAME="createPosixSpawn" ID="createPosixSpawn"></a> |
|
353 <h2>createPosixSpawn</h2> |
|
354 <b>createPosixSpawn</b>(<i>originalName</i>) |
|
355 |
|
356 <p> |
|
357 Function to patch the 'posix_spawn' process creation functions. |
|
358 </p> |
|
359 <p> |
|
360 <ul> |
|
361 <li>os.posix_spawn(path, argv, env, *, file_actions=None, ... |
|
362 (6 more))</li> |
|
363 <li>os.posix_spawnp(path, argv, env, *, file_actions=None, ... |
|
364 (6 more))</li> |
|
365 </ul> |
|
366 </p> |
|
367 <dl> |
|
368 |
|
369 <dt><i>originalName</i> (str)</dt> |
|
370 <dd> |
|
371 original name of the function to be patched |
|
372 </dd> |
|
373 </dl> |
|
374 <dl> |
|
375 <dt>Return:</dt> |
|
376 <dd> |
|
377 function replacing the original one |
|
378 </dd> |
|
379 </dl> |
|
380 <dl> |
|
381 <dt>Return Type:</dt> |
|
382 <dd> |
|
383 function |
|
384 </dd> |
|
385 </dl> |
|
386 <div align="right"><a href="#top">Up</a></div> |
|
387 <hr /> |
|
388 <hr /> |
|
389 <a NAME="createSpawnl" ID="createSpawnl"></a> |
|
390 <h2>createSpawnl</h2> |
|
391 <b>createSpawnl</b>(<i>originalName</i>) |
|
392 |
|
393 <p> |
|
394 Function to patch the 'spawnl' process creation functions. |
|
395 </p> |
|
396 <p> |
|
397 <ul> |
|
398 <li>os.spawnl(mode, path, arg0, arg1, ...)</li> |
|
399 <li>os.spawnlp(mode, file, arg0, arg1, ...)</li> |
|
400 </ul> |
|
401 </p> |
|
402 <dl> |
|
403 |
|
404 <dt><i>originalName</i> (str)</dt> |
|
405 <dd> |
|
406 original name of the function to be patched |
|
407 </dd> |
|
408 </dl> |
|
409 <dl> |
|
410 <dt>Return:</dt> |
|
411 <dd> |
|
412 function replacing the original one |
|
413 </dd> |
|
414 </dl> |
|
415 <dl> |
|
416 <dt>Return Type:</dt> |
|
417 <dd> |
|
418 function |
|
419 </dd> |
|
420 </dl> |
|
421 <div align="right"><a href="#top">Up</a></div> |
|
422 <hr /> |
|
423 <hr /> |
|
424 <a NAME="createSpawnv" ID="createSpawnv"></a> |
|
425 <h2>createSpawnv</h2> |
|
426 <b>createSpawnv</b>(<i>originalName</i>) |
|
427 |
|
428 <p> |
|
429 Function to patch the 'spawnv' process creation functions. |
|
430 </p> |
|
431 <p> |
|
432 <ul> |
|
433 <li>os.spawnv(mode, path, args)</li> |
|
434 <li>os.spawnvp(mode, file, args)</li> |
|
435 </ul> |
|
436 </p> |
|
437 <dl> |
|
438 |
|
439 <dt><i>originalName</i> (str)</dt> |
|
440 <dd> |
|
441 original name of the function to be patched |
|
442 </dd> |
|
443 </dl> |
|
444 <dl> |
|
445 <dt>Return:</dt> |
|
446 <dd> |
|
447 function replacing the original one |
|
448 </dd> |
|
449 </dl> |
|
450 <dl> |
|
451 <dt>Return Type:</dt> |
|
452 <dd> |
|
453 function |
|
454 </dd> |
|
455 </dl> |
|
456 <div align="right"><a href="#top">Up</a></div> |
|
457 <hr /> |
|
458 <hr /> |
|
459 <a NAME="createSpawnve" ID="createSpawnve"></a> |
|
460 <h2>createSpawnve</h2> |
|
461 <b>createSpawnve</b>(<i>originalName</i>) |
|
462 |
|
463 <p> |
|
464 Function to patch the 'spawnve' process creation functions. |
|
465 </p> |
|
466 <p> |
|
467 <ul> |
|
468 <li>os.spawnve(mode, path, args, env)</li> |
|
469 <li>os.spawnvpe(mode, file, args, env)</li> |
|
470 </ul> |
|
471 </p> |
|
472 <dl> |
|
473 |
|
474 <dt><i>originalName</i> (str)</dt> |
|
475 <dd> |
|
476 original name of the function to be patched |
|
477 </dd> |
|
478 </dl> |
|
479 <dl> |
|
480 <dt>Return:</dt> |
|
481 <dd> |
|
482 function replacing the original one |
|
483 </dd> |
|
484 </dl> |
|
485 <dl> |
|
486 <dt>Return Type:</dt> |
|
487 <dd> |
|
488 function |
|
489 </dd> |
|
490 </dl> |
|
491 <div align="right"><a href="#top">Up</a></div> |
|
492 <hr /> |
|
493 <hr /> |
|
494 <a NAME="newCreateProcess" ID="newCreateProcess"></a> |
|
495 <h2>newCreateProcess</h2> |
|
496 <b>newCreateProcess</b>(<i>appName, cmdline, *args</i>) |
|
497 |
|
498 <p> |
|
499 Function replacing the 'CreateProcess' function of the _subprocess |
|
500 or _winapi module. |
|
501 </p> |
|
502 <div align="right"><a href="#top">Up</a></div> |
|
503 <hr /> |
|
504 <hr /> |
|
505 <a NAME="newExecl" ID="newExecl"></a> |
|
506 <h2>newExecl</h2> |
|
507 <b>newExecl</b>(<i>path, *args</i>) |
|
508 |
|
509 <p> |
|
510 Function replacing the 'execl' functions of the os module. |
|
511 </p> |
|
512 <div align="right"><a href="#top">Up</a></div> |
|
513 <hr /> |
|
514 <hr /> |
|
515 <a NAME="newExecv" ID="newExecv"></a> |
|
516 <h2>newExecv</h2> |
|
517 <b>newExecv</b>(<i>path, args</i>) |
|
518 |
|
519 <p> |
|
520 Function replacing the 'execv' functions of the os module. |
|
521 </p> |
|
522 <div align="right"><a href="#top">Up</a></div> |
|
523 <hr /> |
|
524 <hr /> |
|
525 <a NAME="newExecve" ID="newExecve"></a> |
|
526 <h2>newExecve</h2> |
|
527 <b>newExecve</b>(<i>path, args, env</i>) |
|
528 |
|
529 <p> |
|
530 Function replacing the 'execve' functions of the os module. |
|
531 </p> |
|
532 <div align="right"><a href="#top">Up</a></div> |
|
533 <hr /> |
|
534 <hr /> |
|
535 <a NAME="newFork" ID="newFork"></a> |
|
536 <h2>newFork</h2> |
|
537 <b>newFork</b>(<i></i>) |
|
538 |
|
539 <p> |
|
540 Function replacing the 'fork' function of the os module. |
|
541 </p> |
|
542 <div align="right"><a href="#top">Up</a></div> |
|
543 <hr /> |
|
544 <hr /> |
|
545 <a NAME="newForkExec" ID="newForkExec"></a> |
|
546 <h2>newForkExec</h2> |
|
547 <b>newForkExec</b>(<i>args, *other_args</i>) |
|
548 |
|
549 <p> |
|
550 Function replacing the 'fork_exec' functions of the _posixsubprocess |
|
551 module. |
|
552 </p> |
|
553 <div align="right"><a href="#top">Up</a></div> |
|
554 <hr /> |
|
555 <hr /> |
|
556 <a NAME="newPosixSpawn" ID="newPosixSpawn"></a> |
|
557 <h2>newPosixSpawn</h2> |
|
558 <b>newPosixSpawn</b>(<i>path, argv, env, **kwargs</i>) |
|
559 |
|
560 <p> |
|
561 Function replacing the 'posix_spawn' functions of the os module. |
|
562 </p> |
|
563 <div align="right"><a href="#top">Up</a></div> |
|
564 <hr /> |
|
565 <hr /> |
|
566 <a NAME="newSpawnl" ID="newSpawnl"></a> |
|
567 <h2>newSpawnl</h2> |
|
568 <b>newSpawnl</b>(<i>mode, path, *args</i>) |
|
569 |
|
570 <p> |
|
571 Function replacing the 'spawnl' functions of the os module. |
|
572 </p> |
|
573 <div align="right"><a href="#top">Up</a></div> |
|
574 <hr /> |
|
575 <hr /> |
|
576 <a NAME="newSpawnv" ID="newSpawnv"></a> |
|
577 <h2>newSpawnv</h2> |
|
578 <b>newSpawnv</b>(<i>mode, path, args</i>) |
|
579 |
|
580 <p> |
|
581 Function replacing the 'spawnv' functions of the os module. |
|
582 </p> |
|
583 <div align="right"><a href="#top">Up</a></div> |
|
584 <hr /> |
|
585 <hr /> |
|
586 <a NAME="newSpawnve" ID="newSpawnve"></a> |
|
587 <h2>newSpawnve</h2> |
|
588 <b>newSpawnve</b>(<i>mode, path, args, env</i>) |
|
589 |
|
590 <p> |
|
591 Function replacing the 'spawnve' functions of the os module. |
|
592 </p> |
|
593 <div align="right"><a href="#top">Up</a></div> |
|
594 <hr /> |
|
595 <hr /> |
|
596 <a NAME="patchModule" ID="patchModule"></a> |
|
597 <h2>patchModule</h2> |
|
598 <b>patchModule</b>(<i>module, functionName, createFunction</i>) |
|
599 |
|
600 <p> |
|
601 Function to replace a function of a module with a modified one. |
|
602 </p> |
|
603 <dl> |
|
604 |
|
605 <dt><i>module</i> (types.ModuleType)</dt> |
|
606 <dd> |
|
607 reference to the module |
|
608 </dd> |
|
609 <dt><i>functionName</i> (str)</dt> |
|
610 <dd> |
|
611 name of the function to be replaced |
|
612 </dd> |
|
613 <dt><i>createFunction</i> (types.FunctionType)</dt> |
|
614 <dd> |
|
615 function creating the replacement |
|
616 </dd> |
|
617 </dl> |
|
618 <div align="right"><a href="#top">Up</a></div> |
|
619 <hr /> |
|
620 <hr /> |
|
621 <a NAME="patchNewProcessFunctions" ID="patchNewProcessFunctions"></a> |
|
622 <h2>patchNewProcessFunctions</h2> |
|
623 <b>patchNewProcessFunctions</b>(<i>multiprocessEnabled, debugClient</i>) |
|
624 |
|
625 <p> |
|
626 Function to patch the process creation functions to support multiprocess |
|
627 debugging. |
|
628 </p> |
|
629 <dl> |
|
630 |
|
631 <dt><i>multiprocessEnabled</i> (bool)</dt> |
|
632 <dd> |
|
633 flag indicating multiprocess support |
|
634 </dd> |
|
635 <dt><i>debugClient</i> (DebugClient)</dt> |
|
636 <dd> |
|
637 reference to the debug client object |
|
638 </dd> |
|
639 </dl> |
|
640 <div align="right"><a href="#top">Up</a></div> |
|
641 <hr /> |
|
642 </body></html> |