|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.UI.PythonDisViewer</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.UI.PythonDisViewer</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a widget to visualize the Python Disassembly for some |
|
13 Python sources. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 |
|
17 <table> |
|
18 <tr><td>None</td></tr> |
|
19 </table> |
|
20 <h3>Classes</h3> |
|
21 |
|
22 <table> |
|
23 |
|
24 <tr> |
|
25 <td><a href="#PythonDisViewer">PythonDisViewer</a></td> |
|
26 <td>Class implementing a widget to visualize the Python Disassembly for some Python sources.</td> |
|
27 </tr> |
|
28 <tr> |
|
29 <td><a href="#PythonDisViewerModes">PythonDisViewerModes</a></td> |
|
30 <td>Class implementing the disassembly viewer operation modes.</td> |
|
31 </tr> |
|
32 </table> |
|
33 <h3>Functions</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#linestarts">linestarts</a></td> |
|
39 <td>Function to get the line starts for the given code object.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#tryCompile">tryCompile</a></td> |
|
43 <td>Function to attempt to compile the given source, first as an expression and then as a statement if the first approach fails.</td> |
|
44 </tr> |
|
45 </table> |
|
46 <hr /> |
|
47 <hr /> |
|
48 <a NAME="PythonDisViewer" ID="PythonDisViewer"></a> |
|
49 <h2>PythonDisViewer</h2> |
|
50 |
|
51 <p> |
|
52 Class implementing a widget to visualize the Python Disassembly for some |
|
53 Python sources. |
|
54 </p> |
|
55 <h3>Derived from</h3> |
|
56 QWidget, Ui_PythonDisViewer |
|
57 <h3>Class Attributes</h3> |
|
58 |
|
59 <table> |
|
60 <tr><td>CodeInfoRole</td></tr><tr><td>EndLineRole</td></tr><tr><td>StartLineRole</td></tr> |
|
61 </table> |
|
62 <h3>Class Methods</h3> |
|
63 |
|
64 <table> |
|
65 <tr><td>None</td></tr> |
|
66 </table> |
|
67 <h3>Methods</h3> |
|
68 |
|
69 <table> |
|
70 |
|
71 <tr> |
|
72 <td><a href="#PythonDisViewer.__init__">PythonDisViewer</a></td> |
|
73 <td>Constructor</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#PythonDisViewer.__clearSelection">__clearSelection</a></td> |
|
77 <td>Private method to clear all selected items.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#PythonDisViewer.__codeInfoContextMenuRequested">__codeInfoContextMenuRequested</a></td> |
|
81 <td>Private slot to show the context menu of the code info widget.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#PythonDisViewer.__collapseAllCodeInfo">__collapseAllCodeInfo</a></td> |
|
85 <td>Private slot to collapse all items of the code info widget.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#PythonDisViewer.__collapseAllDis">__collapseAllDis</a></td> |
|
89 <td>Private slot to collapse all items of the disassembly widget.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#PythonDisViewer.__configure">__configure</a></td> |
|
93 <td>Private method to open the configuration dialog.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#PythonDisViewer.__createCodeInfo">__createCodeInfo</a></td> |
|
97 <td>Private method to create a dictionary containing the code info data.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#PythonDisViewer.__createErrorItem">__createErrorItem</a></td> |
|
101 <td>Private method to create a top level error item.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#PythonDisViewer.__createInstructionItem">__createInstructionItem</a></td> |
|
105 <td>Private method to create an item for the given instruction.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#PythonDisViewer.__createTitleItem">__createTitleItem</a></td> |
|
109 <td>Private method to create a title item.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#PythonDisViewer.__disContextMenuRequested">__disContextMenuRequested</a></td> |
|
113 <td>Private slot to show the context menu of the disassembly widget.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#PythonDisViewer.__disItemClicked">__disItemClicked</a></td> |
|
117 <td>Private slot handling a user click on a Disassembly node item.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#PythonDisViewer.__disViewerStateChanged">__disViewerStateChanged</a></td> |
|
121 <td>Private slot to toggle the display of the Disassembly viewer.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#PythonDisViewer.__disassembleObject">__disassembleObject</a></td> |
|
125 <td>Private method to disassemble the given code object recursively.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#PythonDisViewer.__editorChanged">__editorChanged</a></td> |
|
129 <td>Private slot to handle a change of the current editor.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#PythonDisViewer.__editorLanguageChanged">__editorLanguageChanged</a></td> |
|
133 <td>Private slot to handle a change of the editor language.</td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td><a href="#PythonDisViewer.__editorLineChanged">__editorLineChanged</a></td> |
|
137 <td>Private slot to handle a mouse button double click in the editor.</td> |
|
138 </tr> |
|
139 <tr> |
|
140 <td><a href="#PythonDisViewer.__editorSaved">__editorSaved</a></td> |
|
141 <td>Private slot to reload the Disassembly after the connected editor was saved.</td> |
|
142 </tr> |
|
143 <tr> |
|
144 <td><a href="#PythonDisViewer.__expandAllCodeInfo">__expandAllCodeInfo</a></td> |
|
145 <td>Private slot to expand all items of the code info widget.</td> |
|
146 </tr> |
|
147 <tr> |
|
148 <td><a href="#PythonDisViewer.__expandAllDis">__expandAllDis</a></td> |
|
149 <td>Private slot to expand all items of the disassembly widget.</td> |
|
150 </tr> |
|
151 <tr> |
|
152 <td><a href="#PythonDisViewer.__lastEditorClosed">__lastEditorClosed</a></td> |
|
153 <td>Private slot to handle the last editor closed signal of the view manager.</td> |
|
154 </tr> |
|
155 <tr> |
|
156 <td><a href="#PythonDisViewer.__loadDIS">__loadDIS</a></td> |
|
157 <td>Private method to generate the Disassembly from the source of the current editor and visualize it.</td> |
|
158 </tr> |
|
159 <tr> |
|
160 <td><a href="#PythonDisViewer.__resizeCodeInfoColumns">__resizeCodeInfoColumns</a></td> |
|
161 <td>Private method to resize the columns of the code info widget to suitable values.</td> |
|
162 </tr> |
|
163 <tr> |
|
164 <td><a href="#PythonDisViewer.__resizeDisColumns">__resizeDisColumns</a></td> |
|
165 <td>Private method to resize the columns of the disassembly widget to suitable values.</td> |
|
166 </tr> |
|
167 <tr> |
|
168 <td><a href="#PythonDisViewer.__selectChildren">__selectChildren</a></td> |
|
169 <td>Private method to select children of the given item covering the given line number.</td> |
|
170 </tr> |
|
171 <tr> |
|
172 <td><a href="#PythonDisViewer.__selectItemForEditorLine">__selectItemForEditorLine</a></td> |
|
173 <td>Private slot to select the items corresponding with the cursor line of the current editor.</td> |
|
174 </tr> |
|
175 <tr> |
|
176 <td><a href="#PythonDisViewer.__showCodeInfo">__showCodeInfo</a></td> |
|
177 <td>Private slot handling the context menu action to show code info.</td> |
|
178 </tr> |
|
179 <tr> |
|
180 <td><a href="#PythonDisViewer.__showCodeInfoData">__showCodeInfoData</a></td> |
|
181 <td>Private method to show the passed code info data.</td> |
|
182 </tr> |
|
183 <tr> |
|
184 <td><a href="#PythonDisViewer.__styleLabels">__styleLabels</a></td> |
|
185 <td>Private method to style the info labels iaw.</td> |
|
186 </tr> |
|
187 <tr> |
|
188 <td><a href="#PythonDisViewer.__updateItemEndLine">__updateItemEndLine</a></td> |
|
189 <td>Private method to update an items end line based on its children.</td> |
|
190 </tr> |
|
191 <tr> |
|
192 <td><a href="#PythonDisViewer.clear">clear</a></td> |
|
193 <td>Public method to clear the display.</td> |
|
194 </tr> |
|
195 <tr> |
|
196 <td><a href="#PythonDisViewer.createCodeInfoItems">createCodeInfoItems</a></td> |
|
197 <td>Function to create code info items for the given list.</td> |
|
198 </tr> |
|
199 <tr> |
|
200 <td><a href="#PythonDisViewer.hide">hide</a></td> |
|
201 <td>Public slot to hide the DIS viewer.</td> |
|
202 </tr> |
|
203 <tr> |
|
204 <td><a href="#PythonDisViewer.preferencesChanged">preferencesChanged</a></td> |
|
205 <td>Public slot handling changes of the Disassembly viewer settings.</td> |
|
206 </tr> |
|
207 <tr> |
|
208 <td><a href="#PythonDisViewer.resizeEvent">resizeEvent</a></td> |
|
209 <td>Protected method to handle resize events.</td> |
|
210 </tr> |
|
211 <tr> |
|
212 <td><a href="#PythonDisViewer.show">show</a></td> |
|
213 <td>Public slot to show the DIS viewer.</td> |
|
214 </tr> |
|
215 <tr> |
|
216 <td><a href="#PythonDisViewer.showDisassembly">showDisassembly</a></td> |
|
217 <td>Public slot to receive a code disassembly from the debug client.</td> |
|
218 </tr> |
|
219 <tr> |
|
220 <td><a href="#PythonDisViewer.shutdown">shutdown</a></td> |
|
221 <td>Public method to perform shutdown actions.</td> |
|
222 </tr> |
|
223 </table> |
|
224 <h3>Static Methods</h3> |
|
225 |
|
226 <table> |
|
227 <tr><td>None</td></tr> |
|
228 </table> |
|
229 |
|
230 <a NAME="PythonDisViewer.__init__" ID="PythonDisViewer.__init__"></a> |
|
231 <h4>PythonDisViewer (Constructor)</h4> |
|
232 <b>PythonDisViewer</b>(<i>viewmanager, mode=PythonDisViewerModes.SOURCEDISASSEMBLY, parent=None</i>) |
|
233 |
|
234 <p> |
|
235 Constructor |
|
236 </p> |
|
237 <dl> |
|
238 |
|
239 <dt><i>viewmanager</i> (ViewManager)</dt> |
|
240 <dd> |
|
241 reference to the viewmanager object |
|
242 </dd> |
|
243 <dt><i>mode</i> (int)</dt> |
|
244 <dd> |
|
245 operation mode of the viewer |
|
246 </dd> |
|
247 <dt><i>parent</i> (QWidget)</dt> |
|
248 <dd> |
|
249 reference to the parent widget |
|
250 </dd> |
|
251 </dl> |
|
252 <a NAME="PythonDisViewer.__clearSelection" ID="PythonDisViewer.__clearSelection"></a> |
|
253 <h4>PythonDisViewer.__clearSelection</h4> |
|
254 <b>__clearSelection</b>(<i></i>) |
|
255 |
|
256 <p> |
|
257 Private method to clear all selected items. |
|
258 </p> |
|
259 <a NAME="PythonDisViewer.__codeInfoContextMenuRequested" ID="PythonDisViewer.__codeInfoContextMenuRequested"></a> |
|
260 <h4>PythonDisViewer.__codeInfoContextMenuRequested</h4> |
|
261 <b>__codeInfoContextMenuRequested</b>(<i>coord</i>) |
|
262 |
|
263 <p> |
|
264 Private slot to show the context menu of the code info widget. |
|
265 </p> |
|
266 <dl> |
|
267 |
|
268 <dt><i>coord</i> (QPoint)</dt> |
|
269 <dd> |
|
270 position of the mouse pointer |
|
271 </dd> |
|
272 </dl> |
|
273 <a NAME="PythonDisViewer.__collapseAllCodeInfo" ID="PythonDisViewer.__collapseAllCodeInfo"></a> |
|
274 <h4>PythonDisViewer.__collapseAllCodeInfo</h4> |
|
275 <b>__collapseAllCodeInfo</b>(<i></i>) |
|
276 |
|
277 <p> |
|
278 Private slot to collapse all items of the code info widget. |
|
279 </p> |
|
280 <a NAME="PythonDisViewer.__collapseAllDis" ID="PythonDisViewer.__collapseAllDis"></a> |
|
281 <h4>PythonDisViewer.__collapseAllDis</h4> |
|
282 <b>__collapseAllDis</b>(<i></i>) |
|
283 |
|
284 <p> |
|
285 Private slot to collapse all items of the disassembly widget. |
|
286 </p> |
|
287 <a NAME="PythonDisViewer.__configure" ID="PythonDisViewer.__configure"></a> |
|
288 <h4>PythonDisViewer.__configure</h4> |
|
289 <b>__configure</b>(<i></i>) |
|
290 |
|
291 <p> |
|
292 Private method to open the configuration dialog. |
|
293 </p> |
|
294 <a NAME="PythonDisViewer.__createCodeInfo" ID="PythonDisViewer.__createCodeInfo"></a> |
|
295 <h4>PythonDisViewer.__createCodeInfo</h4> |
|
296 <b>__createCodeInfo</b>(<i>co</i>) |
|
297 |
|
298 <p> |
|
299 Private method to create a dictionary containing the code info data. |
|
300 </p> |
|
301 <dl> |
|
302 |
|
303 <dt><i>co</i> (code)</dt> |
|
304 <dd> |
|
305 reference to the code object to generate the info for |
|
306 </dd> |
|
307 </dl> |
|
308 <dl> |
|
309 <dt>Return:</dt> |
|
310 <dd> |
|
311 dictionary containing the code info data |
|
312 </dd> |
|
313 </dl> |
|
314 <dl> |
|
315 <dt>Return Type:</dt> |
|
316 <dd> |
|
317 dict |
|
318 </dd> |
|
319 </dl> |
|
320 <a NAME="PythonDisViewer.__createErrorItem" ID="PythonDisViewer.__createErrorItem"></a> |
|
321 <h4>PythonDisViewer.__createErrorItem</h4> |
|
322 <b>__createErrorItem</b>(<i>error</i>) |
|
323 |
|
324 <p> |
|
325 Private method to create a top level error item. |
|
326 </p> |
|
327 <dl> |
|
328 |
|
329 <dt><i>error</i> (str)</dt> |
|
330 <dd> |
|
331 error message |
|
332 </dd> |
|
333 </dl> |
|
334 <dl> |
|
335 <dt>Return:</dt> |
|
336 <dd> |
|
337 generated item |
|
338 </dd> |
|
339 </dl> |
|
340 <dl> |
|
341 <dt>Return Type:</dt> |
|
342 <dd> |
|
343 QTreeWidgetItem |
|
344 </dd> |
|
345 </dl> |
|
346 <a NAME="PythonDisViewer.__createInstructionItem" ID="PythonDisViewer.__createInstructionItem"></a> |
|
347 <h4>PythonDisViewer.__createInstructionItem</h4> |
|
348 <b>__createInstructionItem</b>(<i>instr, parent, lasti=-1</i>) |
|
349 |
|
350 <p> |
|
351 Private method to create an item for the given instruction. |
|
352 </p> |
|
353 <dl> |
|
354 |
|
355 <dt><i>instr</i> (dis.Instruction)</dt> |
|
356 <dd> |
|
357 instruction the item should be based on |
|
358 </dd> |
|
359 <dt><i>parent</i> (QTreeWidgetItem)</dt> |
|
360 <dd> |
|
361 reference to the parent item |
|
362 </dd> |
|
363 <dt><i>lasti</i> (int)</dt> |
|
364 <dd> |
|
365 index of the instruction of a traceback |
|
366 </dd> |
|
367 </dl> |
|
368 <dl> |
|
369 <dt>Return:</dt> |
|
370 <dd> |
|
371 generated item |
|
372 </dd> |
|
373 </dl> |
|
374 <dl> |
|
375 <dt>Return Type:</dt> |
|
376 <dd> |
|
377 QTreeWidgetItem |
|
378 </dd> |
|
379 </dl> |
|
380 <a NAME="PythonDisViewer.__createTitleItem" ID="PythonDisViewer.__createTitleItem"></a> |
|
381 <h4>PythonDisViewer.__createTitleItem</h4> |
|
382 <b>__createTitleItem</b>(<i>title, line, parentItem</i>) |
|
383 |
|
384 <p> |
|
385 Private method to create a title item. |
|
386 </p> |
|
387 <dl> |
|
388 |
|
389 <dt><i>title</i> (str)</dt> |
|
390 <dd> |
|
391 titel string for the item |
|
392 </dd> |
|
393 <dt><i>line</i> (int)</dt> |
|
394 <dd> |
|
395 start line of the titled disassembly |
|
396 </dd> |
|
397 <dt><i>parentItem</i> (QTreeWidget or QTreeWidgetItem)</dt> |
|
398 <dd> |
|
399 reference to the parent item |
|
400 </dd> |
|
401 </dl> |
|
402 <dl> |
|
403 <dt>Return:</dt> |
|
404 <dd> |
|
405 generated item |
|
406 </dd> |
|
407 </dl> |
|
408 <dl> |
|
409 <dt>Return Type:</dt> |
|
410 <dd> |
|
411 QTreeWidgetItem |
|
412 </dd> |
|
413 </dl> |
|
414 <a NAME="PythonDisViewer.__disContextMenuRequested" ID="PythonDisViewer.__disContextMenuRequested"></a> |
|
415 <h4>PythonDisViewer.__disContextMenuRequested</h4> |
|
416 <b>__disContextMenuRequested</b>(<i>coord</i>) |
|
417 |
|
418 <p> |
|
419 Private slot to show the context menu of the disassembly widget. |
|
420 </p> |
|
421 <dl> |
|
422 |
|
423 <dt><i>coord</i> (QPoint)</dt> |
|
424 <dd> |
|
425 position of the mouse pointer |
|
426 </dd> |
|
427 </dl> |
|
428 <a NAME="PythonDisViewer.__disItemClicked" ID="PythonDisViewer.__disItemClicked"></a> |
|
429 <h4>PythonDisViewer.__disItemClicked</h4> |
|
430 <b>__disItemClicked</b>(<i>itm, column</i>) |
|
431 |
|
432 <p> |
|
433 Private slot handling a user click on a Disassembly node item. |
|
434 </p> |
|
435 <dl> |
|
436 |
|
437 <dt><i>itm</i> (QTreeWidgetItem)</dt> |
|
438 <dd> |
|
439 reference to the clicked item |
|
440 </dd> |
|
441 <dt><i>column</i> (int)</dt> |
|
442 <dd> |
|
443 column number of the click |
|
444 </dd> |
|
445 </dl> |
|
446 <a NAME="PythonDisViewer.__disViewerStateChanged" ID="PythonDisViewer.__disViewerStateChanged"></a> |
|
447 <h4>PythonDisViewer.__disViewerStateChanged</h4> |
|
448 <b>__disViewerStateChanged</b>(<i>on</i>) |
|
449 |
|
450 <p> |
|
451 Private slot to toggle the display of the Disassembly viewer. |
|
452 </p> |
|
453 <dl> |
|
454 |
|
455 <dt><i>on</i> (bool)</dt> |
|
456 <dd> |
|
457 flag indicating to show the Disassembly |
|
458 </dd> |
|
459 </dl> |
|
460 <a NAME="PythonDisViewer.__disassembleObject" ID="PythonDisViewer.__disassembleObject"></a> |
|
461 <h4>PythonDisViewer.__disassembleObject</h4> |
|
462 <b>__disassembleObject</b>(<i>co, parentItem, parentName="", lasti=-1</i>) |
|
463 |
|
464 <p> |
|
465 Private method to disassemble the given code object recursively. |
|
466 </p> |
|
467 <dl> |
|
468 |
|
469 <dt><i>co</i> (code object)</dt> |
|
470 <dd> |
|
471 code object to be disassembled |
|
472 </dd> |
|
473 <dt><i>parentItem</i> (QTreeWidget or QTreeWidgetItem)</dt> |
|
474 <dd> |
|
475 reference to the parent item |
|
476 </dd> |
|
477 <dt><i>parentName</i> (str)</dt> |
|
478 <dd> |
|
479 name of the parent code object |
|
480 </dd> |
|
481 <dt><i>lasti</i> (int)</dt> |
|
482 <dd> |
|
483 index of the instruction of a traceback |
|
484 </dd> |
|
485 </dl> |
|
486 <a NAME="PythonDisViewer.__editorChanged" ID="PythonDisViewer.__editorChanged"></a> |
|
487 <h4>PythonDisViewer.__editorChanged</h4> |
|
488 <b>__editorChanged</b>(<i>editor</i>) |
|
489 |
|
490 <p> |
|
491 Private slot to handle a change of the current editor. |
|
492 </p> |
|
493 <dl> |
|
494 |
|
495 <dt><i>editor</i> (Editor)</dt> |
|
496 <dd> |
|
497 reference to the current editor |
|
498 </dd> |
|
499 </dl> |
|
500 <a NAME="PythonDisViewer.__editorLanguageChanged" ID="PythonDisViewer.__editorLanguageChanged"></a> |
|
501 <h4>PythonDisViewer.__editorLanguageChanged</h4> |
|
502 <b>__editorLanguageChanged</b>(<i>editor</i>) |
|
503 |
|
504 <p> |
|
505 Private slot to handle a change of the editor language. |
|
506 </p> |
|
507 <dl> |
|
508 |
|
509 <dt><i>editor</i> (Editor)</dt> |
|
510 <dd> |
|
511 reference to the editor which changed language |
|
512 </dd> |
|
513 </dl> |
|
514 <a NAME="PythonDisViewer.__editorLineChanged" ID="PythonDisViewer.__editorLineChanged"></a> |
|
515 <h4>PythonDisViewer.__editorLineChanged</h4> |
|
516 <b>__editorLineChanged</b>(<i>editor, lineno</i>) |
|
517 |
|
518 <p> |
|
519 Private slot to handle a mouse button double click in the editor. |
|
520 </p> |
|
521 <dl> |
|
522 |
|
523 <dt><i>editor</i> (Editor)</dt> |
|
524 <dd> |
|
525 reference to the editor, that emitted the signal |
|
526 </dd> |
|
527 <dt><i>lineno</i> (int)</dt> |
|
528 <dd> |
|
529 line number of the editor's cursor (zero based) |
|
530 </dd> |
|
531 </dl> |
|
532 <a NAME="PythonDisViewer.__editorSaved" ID="PythonDisViewer.__editorSaved"></a> |
|
533 <h4>PythonDisViewer.__editorSaved</h4> |
|
534 <b>__editorSaved</b>(<i>editor</i>) |
|
535 |
|
536 <p> |
|
537 Private slot to reload the Disassembly after the connected editor was |
|
538 saved. |
|
539 </p> |
|
540 <dl> |
|
541 |
|
542 <dt><i>editor</i> (Editor)</dt> |
|
543 <dd> |
|
544 reference to the editor that performed a save action |
|
545 </dd> |
|
546 </dl> |
|
547 <a NAME="PythonDisViewer.__expandAllCodeInfo" ID="PythonDisViewer.__expandAllCodeInfo"></a> |
|
548 <h4>PythonDisViewer.__expandAllCodeInfo</h4> |
|
549 <b>__expandAllCodeInfo</b>(<i></i>) |
|
550 |
|
551 <p> |
|
552 Private slot to expand all items of the code info widget. |
|
553 </p> |
|
554 <a NAME="PythonDisViewer.__expandAllDis" ID="PythonDisViewer.__expandAllDis"></a> |
|
555 <h4>PythonDisViewer.__expandAllDis</h4> |
|
556 <b>__expandAllDis</b>(<i></i>) |
|
557 |
|
558 <p> |
|
559 Private slot to expand all items of the disassembly widget. |
|
560 </p> |
|
561 <a NAME="PythonDisViewer.__lastEditorClosed" ID="PythonDisViewer.__lastEditorClosed"></a> |
|
562 <h4>PythonDisViewer.__lastEditorClosed</h4> |
|
563 <b>__lastEditorClosed</b>(<i></i>) |
|
564 |
|
565 <p> |
|
566 Private slot to handle the last editor closed signal of the view |
|
567 manager. |
|
568 </p> |
|
569 <a NAME="PythonDisViewer.__loadDIS" ID="PythonDisViewer.__loadDIS"></a> |
|
570 <h4>PythonDisViewer.__loadDIS</h4> |
|
571 <b>__loadDIS</b>(<i></i>) |
|
572 |
|
573 <p> |
|
574 Private method to generate the Disassembly from the source of the |
|
575 current editor and visualize it. |
|
576 </p> |
|
577 <a NAME="PythonDisViewer.__resizeCodeInfoColumns" ID="PythonDisViewer.__resizeCodeInfoColumns"></a> |
|
578 <h4>PythonDisViewer.__resizeCodeInfoColumns</h4> |
|
579 <b>__resizeCodeInfoColumns</b>(<i></i>) |
|
580 |
|
581 <p> |
|
582 Private method to resize the columns of the code info widget to |
|
583 suitable values. |
|
584 </p> |
|
585 <a NAME="PythonDisViewer.__resizeDisColumns" ID="PythonDisViewer.__resizeDisColumns"></a> |
|
586 <h4>PythonDisViewer.__resizeDisColumns</h4> |
|
587 <b>__resizeDisColumns</b>(<i></i>) |
|
588 |
|
589 <p> |
|
590 Private method to resize the columns of the disassembly widget to |
|
591 suitable values. |
|
592 </p> |
|
593 <a NAME="PythonDisViewer.__selectChildren" ID="PythonDisViewer.__selectChildren"></a> |
|
594 <h4>PythonDisViewer.__selectChildren</h4> |
|
595 <b>__selectChildren</b>(<i>itm, lineno</i>) |
|
596 |
|
597 <p> |
|
598 Private method to select children of the given item covering the given |
|
599 line number. |
|
600 </p> |
|
601 <dl> |
|
602 |
|
603 <dt><i>itm</i> (QTreeWidgetItem)</dt> |
|
604 <dd> |
|
605 reference to the item |
|
606 </dd> |
|
607 <dt><i>lineno</i> (int)</dt> |
|
608 <dd> |
|
609 line number to base the selection on |
|
610 </dd> |
|
611 </dl> |
|
612 <a NAME="PythonDisViewer.__selectItemForEditorLine" ID="PythonDisViewer.__selectItemForEditorLine"></a> |
|
613 <h4>PythonDisViewer.__selectItemForEditorLine</h4> |
|
614 <b>__selectItemForEditorLine</b>(<i></i>) |
|
615 |
|
616 <p> |
|
617 Private slot to select the items corresponding with the cursor line |
|
618 of the current editor. |
|
619 </p> |
|
620 <a NAME="PythonDisViewer.__showCodeInfo" ID="PythonDisViewer.__showCodeInfo"></a> |
|
621 <h4>PythonDisViewer.__showCodeInfo</h4> |
|
622 <b>__showCodeInfo</b>(<i></i>) |
|
623 |
|
624 <p> |
|
625 Private slot handling the context menu action to show code info. |
|
626 </p> |
|
627 <a NAME="PythonDisViewer.__showCodeInfoData" ID="PythonDisViewer.__showCodeInfoData"></a> |
|
628 <h4>PythonDisViewer.__showCodeInfoData</h4> |
|
629 <b>__showCodeInfoData</b>(<i>codeInfo</i>) |
|
630 |
|
631 <p> |
|
632 Private method to show the passed code info data. |
|
633 </p> |
|
634 <dl> |
|
635 |
|
636 <dt><i>codeInfo</i> (dict)</dt> |
|
637 <dd> |
|
638 dictionary containing the code info data |
|
639 </dd> |
|
640 </dl> |
|
641 <a NAME="PythonDisViewer.__styleLabels" ID="PythonDisViewer.__styleLabels"></a> |
|
642 <h4>PythonDisViewer.__styleLabels</h4> |
|
643 <b>__styleLabels</b>(<i></i>) |
|
644 |
|
645 <p> |
|
646 Private method to style the info labels iaw. selected colors. |
|
647 </p> |
|
648 <a NAME="PythonDisViewer.__updateItemEndLine" ID="PythonDisViewer.__updateItemEndLine"></a> |
|
649 <h4>PythonDisViewer.__updateItemEndLine</h4> |
|
650 <b>__updateItemEndLine</b>(<i>itm</i>) |
|
651 |
|
652 <p> |
|
653 Private method to update an items end line based on its children. |
|
654 </p> |
|
655 <dl> |
|
656 |
|
657 <dt><i>itm</i> (QTreeWidgetItem)</dt> |
|
658 <dd> |
|
659 reference to the item to be updated |
|
660 </dd> |
|
661 </dl> |
|
662 <a NAME="PythonDisViewer.clear" ID="PythonDisViewer.clear"></a> |
|
663 <h4>PythonDisViewer.clear</h4> |
|
664 <b>clear</b>(<i></i>) |
|
665 |
|
666 <p> |
|
667 Public method to clear the display. |
|
668 </p> |
|
669 <a NAME="PythonDisViewer.createCodeInfoItems" ID="PythonDisViewer.createCodeInfoItems"></a> |
|
670 <h4>PythonDisViewer.createCodeInfoItems</h4> |
|
671 <b>createCodeInfoItems</b>(<i>infoList</i>) |
|
672 |
|
673 <p> |
|
674 Function to create code info items for the given list. |
|
675 </p> |
|
676 <dl> |
|
677 |
|
678 <dt><i>title</i> (str)</dt> |
|
679 <dd> |
|
680 title string for the list |
|
681 </dd> |
|
682 <dt><i>infoList</i> (list of str)</dt> |
|
683 <dd> |
|
684 list of info strings |
|
685 </dd> |
|
686 </dl> |
|
687 <a NAME="PythonDisViewer.hide" ID="PythonDisViewer.hide"></a> |
|
688 <h4>PythonDisViewer.hide</h4> |
|
689 <b>hide</b>(<i></i>) |
|
690 |
|
691 <p> |
|
692 Public slot to hide the DIS viewer. |
|
693 </p> |
|
694 <a NAME="PythonDisViewer.preferencesChanged" ID="PythonDisViewer.preferencesChanged"></a> |
|
695 <h4>PythonDisViewer.preferencesChanged</h4> |
|
696 <b>preferencesChanged</b>(<i></i>) |
|
697 |
|
698 <p> |
|
699 Public slot handling changes of the Disassembly viewer settings. |
|
700 </p> |
|
701 <a NAME="PythonDisViewer.resizeEvent" ID="PythonDisViewer.resizeEvent"></a> |
|
702 <h4>PythonDisViewer.resizeEvent</h4> |
|
703 <b>resizeEvent</b>(<i>evt</i>) |
|
704 |
|
705 <p> |
|
706 Protected method to handle resize events. |
|
707 </p> |
|
708 <dl> |
|
709 |
|
710 <dt><i>evt</i> (QResizeEvent)</dt> |
|
711 <dd> |
|
712 resize event |
|
713 </dd> |
|
714 </dl> |
|
715 <a NAME="PythonDisViewer.show" ID="PythonDisViewer.show"></a> |
|
716 <h4>PythonDisViewer.show</h4> |
|
717 <b>show</b>(<i></i>) |
|
718 |
|
719 <p> |
|
720 Public slot to show the DIS viewer. |
|
721 </p> |
|
722 <a NAME="PythonDisViewer.showDisassembly" ID="PythonDisViewer.showDisassembly"></a> |
|
723 <h4>PythonDisViewer.showDisassembly</h4> |
|
724 <b>showDisassembly</b>(<i>disassembly</i>) |
|
725 |
|
726 <p> |
|
727 Public slot to receive a code disassembly from the debug client. |
|
728 </p> |
|
729 <dl> |
|
730 |
|
731 <dt><i>disassembly</i> (dict)</dt> |
|
732 <dd> |
|
733 dictionary containing the disassembly information |
|
734 </dd> |
|
735 </dl> |
|
736 <a NAME="PythonDisViewer.shutdown" ID="PythonDisViewer.shutdown"></a> |
|
737 <h4>PythonDisViewer.shutdown</h4> |
|
738 <b>shutdown</b>(<i></i>) |
|
739 |
|
740 <p> |
|
741 Public method to perform shutdown actions. |
|
742 </p> |
|
743 <div align="right"><a href="#top">Up</a></div> |
|
744 <hr /> |
|
745 <hr /> |
|
746 <a NAME="PythonDisViewerModes" ID="PythonDisViewerModes"></a> |
|
747 <h2>PythonDisViewerModes</h2> |
|
748 |
|
749 <p> |
|
750 Class implementing the disassembly viewer operation modes. |
|
751 </p> |
|
752 <h3>Derived from</h3> |
|
753 enum.Enum |
|
754 <h3>Class Attributes</h3> |
|
755 |
|
756 <table> |
|
757 <tr><td>SOURCEDISASSEMBLY</td></tr><tr><td>TRACEBACK</td></tr> |
|
758 </table> |
|
759 <h3>Class Methods</h3> |
|
760 |
|
761 <table> |
|
762 <tr><td>None</td></tr> |
|
763 </table> |
|
764 <h3>Methods</h3> |
|
765 |
|
766 <table> |
|
767 <tr><td>None</td></tr> |
|
768 </table> |
|
769 <h3>Static Methods</h3> |
|
770 |
|
771 <table> |
|
772 <tr><td>None</td></tr> |
|
773 </table> |
|
774 |
|
775 <div align="right"><a href="#top">Up</a></div> |
|
776 <hr /> |
|
777 <hr /> |
|
778 <a NAME="linestarts" ID="linestarts"></a> |
|
779 <h2>linestarts</h2> |
|
780 <b>linestarts</b>(<i>co, filename="", getall=True</i>) |
|
781 |
|
782 <p> |
|
783 Function to get the line starts for the given code object. |
|
784 </p> |
|
785 <dl> |
|
786 |
|
787 <dt><i>co</i> (code object or str)</dt> |
|
788 <dd> |
|
789 reference to the compiled code object or the source code |
|
790 </dd> |
|
791 <dt><i>filename</i> (str)</dt> |
|
792 <dd> |
|
793 name of the source file (optional) |
|
794 </dd> |
|
795 <dt><i>getall</i> (bool)</dt> |
|
796 <dd> |
|
797 flag indicating to get all line starts recursively |
|
798 </dd> |
|
799 </dl> |
|
800 <dl> |
|
801 <dt>Return:</dt> |
|
802 <dd> |
|
803 list of lines starting some byte code instruction block |
|
804 </dd> |
|
805 </dl> |
|
806 <dl> |
|
807 <dt>Return Type:</dt> |
|
808 <dd> |
|
809 list of int |
|
810 </dd> |
|
811 </dl> |
|
812 <div align="right"><a href="#top">Up</a></div> |
|
813 <hr /> |
|
814 <hr /> |
|
815 <a NAME="tryCompile" ID="tryCompile"></a> |
|
816 <h2>tryCompile</h2> |
|
817 <b>tryCompile</b>(<i>source, name</i>) |
|
818 |
|
819 <p> |
|
820 Function to attempt to compile the given source, first as an |
|
821 expression and then as a statement if the first approach fails. |
|
822 </p> |
|
823 <dl> |
|
824 |
|
825 <dt><i>source</i> (str)</dt> |
|
826 <dd> |
|
827 source code string to be compiled |
|
828 </dd> |
|
829 <dt><i>name</i> (str)</dt> |
|
830 <dd> |
|
831 name of the file containing the source |
|
832 </dd> |
|
833 </dl> |
|
834 <dl> |
|
835 <dt>Return:</dt> |
|
836 <dd> |
|
837 compiled code |
|
838 </dd> |
|
839 </dl> |
|
840 <dl> |
|
841 <dt>Return Type:</dt> |
|
842 <dd> |
|
843 code object |
|
844 </dd> |
|
845 </dl> |
|
846 <div align="right"><a href="#top">Up</a></div> |
|
847 <hr /> |
|
848 </body></html> |