eric6/Debugger/DebugViewer.py

Sun, 02 Feb 2020 16:41:40 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 02 Feb 2020 16:41:40 +0100
branch
multi_processing
changeset 7389
770ffcb88be5
parent 7379
72a72fd56494
child 7405
bf6be3cff6cf
permissions
-rw-r--r--

Continued with the multiprocess debugger.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7251
diff changeset
3 # Copyright (c) 2002 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a widget containing various debug related views.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 The views avaliable are:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 <ul>
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
11 <li>selector showing all connected debugger backends</li>
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
12 <li>variables viewer for global variables for the selected debug client</li>
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
13 <li>variables viewer for local variables for the selected debug client</li>
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
14 <li>call stack viewer for the selected debug client</li>
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
15 <li>call trace viewer</li>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 <li>viewer for breakpoints</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 <li>viewer for watch expressions</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 <li>viewer for exceptions</li>
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
19 <li>viewer for threads for the selected debug client</li>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 </ul>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2400
diff changeset
23
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
26 from PyQt5.QtCore import pyqtSignal, Qt
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
27 from PyQt5.QtWidgets import (
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
28 QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, QSizePolicy, QPushButton,
7375
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
29 QComboBox, QLabel, QTreeWidget, QTreeWidgetItem, QHeaderView, QFrame
7251
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
30 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 import UI.PixmapCache
1926
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
33 import Preferences
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 13
diff changeset
35 from E5Gui.E5TabWidget import E5TabWidget
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 821
diff changeset
37
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 class DebugViewer(QWidget):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 """
4309
cc9c62f55413 Changed the Python debugger backends to evaluate statements entered into the shell in the frame selected in the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
40 Class implementing a widget containing various debug related views.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 821
diff changeset
42 The individual tabs contain the interpreter shell (optional),
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
43 the filesystem browser (optional), the two variables viewers
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
44 (global and local), a breakpoint viewer, a watch expression viewer and
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
45 the exception logger. Additionally a list of all threads is shown.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 @signal sourceFile(string, int) emitted to open a source file at a line
7012
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
48 @signal preferencesChanged() emitted to react on changed preferences
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 """
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 464
diff changeset
50 sourceFile = pyqtSignal(str, int)
7012
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
51 preferencesChanged = pyqtSignal()
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 464
diff changeset
52
6987
3371a03ed0a7 Performed some interface cleanups.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
53 def __init__(self, debugServer, parent=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
57 @param debugServer reference to the debug server object (DebugServer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 @param parent parent widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2400
diff changeset
60 super(DebugViewer, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 self.debugServer = debugServer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 self.debugUI = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
65 self.setWindowIcon(UI.PixmapCache.getIcon("eric"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 self.__mainLayout = QVBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
68 self.__mainLayout.setContentsMargins(0, 0, 0, 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 self.setLayout(self.__mainLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70
7375
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
71 # add the viewer showing the connected debug backends
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
72 self.__debuggersLayout = QHBoxLayout()
7375
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
73 self.__debuggersLayout.addWidget(QLabel(self.tr("Debuggers:")))
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
74 self.__debuggersCombo = QComboBox(self)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
75 self.__debuggersCombo.setSizePolicy(
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
76 QSizePolicy.Expanding, QSizePolicy.Fixed)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
77 self.__debuggersLayout.addWidget(self.__debuggersCombo)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
78 self.__mainLayout.addLayout(self.__debuggersLayout)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
79
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
80 self.__debuggersCombo.currentIndexChanged[str].connect(
7375
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
81 self.__debuggerSelected)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
82
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
83 # add a line to separate debugger selector from debugger specific parts
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
84 hline = QFrame(self)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
85 hline.setFrameStyle(QFrame.Sunken)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
86 hline.setFrameShape(QFrame.HLine)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
87 self.__mainLayout.addWidget(hline)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
88
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
89 # add the tab widget containing various debug related views
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 13
diff changeset
90 self.__tabWidget = E5TabWidget()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.__mainLayout.addWidget(self.__tabWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
93 from .VariablesViewer import VariablesViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 # add the global variables viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.glvWidget = QWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.glvWidgetVLayout = QVBoxLayout(self.glvWidget)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
97 self.glvWidgetVLayout.setContentsMargins(0, 0, 0, 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.glvWidgetVLayout.setSpacing(3)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 self.glvWidget.setLayout(self.glvWidgetVLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
101 self.globalsViewer = VariablesViewer(self, True, self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 self.glvWidgetVLayout.addWidget(self.globalsViewer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 self.glvWidgetHLayout = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
105 self.glvWidgetHLayout.setContentsMargins(3, 3, 3, 3)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.globalsFilterEdit = QLineEdit(self.glvWidget)
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
108 self.globalsFilterEdit.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
109 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 self.glvWidgetHLayout.addWidget(self.globalsFilterEdit)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
111 self.globalsFilterEdit.setToolTip(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
112 self.tr("Enter regular expression patterns separated by ';'"
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
113 " to define variable filters. "))
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
114 self.globalsFilterEdit.setWhatsThis(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
115 self.tr("Enter regular expression patterns separated by ';'"
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
116 " to define variable filters. All variables and"
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
117 " class attributes matched by one of the expressions"
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
118 " are not shown in the list above."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
120 self.setGlobalsFilterButton = QPushButton(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
121 self.tr('Set'), self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 self.glvWidgetHLayout.addWidget(self.setGlobalsFilterButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 self.glvWidgetVLayout.addLayout(self.glvWidgetHLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
125 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
126 self.glvWidget,
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
127 UI.PixmapCache.getIcon("globalVariables"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 self.__tabWidget.setTabToolTip(index, self.globalsViewer.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
130 self.setGlobalsFilterButton.clicked.connect(
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
131 self.setGlobalsFilter)
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
132 self.globalsFilterEdit.returnPressed.connect(self.setGlobalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 # add the local variables viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 self.lvWidget = QWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 self.lvWidgetVLayout = QVBoxLayout(self.lvWidget)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
137 self.lvWidgetVLayout.setContentsMargins(0, 0, 0, 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 self.lvWidgetVLayout.setSpacing(3)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 self.lvWidget.setLayout(self.lvWidgetVLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 self.lvWidgetHLayout1 = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
142 self.lvWidgetHLayout1.setContentsMargins(3, 3, 3, 3)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 self.stackComboBox = QComboBox(self.lvWidget)
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
145 self.stackComboBox.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
146 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 self.lvWidgetHLayout1.addWidget(self.stackComboBox)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
149 self.sourceButton = QPushButton(self.tr('Source'), self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 self.lvWidgetHLayout1.addWidget(self.sourceButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 self.sourceButton.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 self.lvWidgetVLayout.addLayout(self.lvWidgetHLayout1)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
154 self.localsViewer = VariablesViewer(self, False, self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 self.lvWidgetVLayout.addWidget(self.localsViewer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 self.lvWidgetHLayout2 = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
158 self.lvWidgetHLayout2.setContentsMargins(3, 3, 3, 3)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 self.localsFilterEdit = QLineEdit(self.lvWidget)
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
161 self.localsFilterEdit.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
162 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 self.lvWidgetHLayout2.addWidget(self.localsFilterEdit)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
164 self.localsFilterEdit.setToolTip(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
165 self.tr(
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
166 "Enter regular expression patterns separated by ';' to define "
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 "variable filters. "))
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
168 self.localsFilterEdit.setWhatsThis(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
169 self.tr(
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
170 "Enter regular expression patterns separated by ';' to define "
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
171 "variable filters. All variables and class attributes matched"
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
172 " by one of the expressions are not shown in the list above."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
174 self.setLocalsFilterButton = QPushButton(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
175 self.tr('Set'), self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 self.lvWidgetHLayout2.addWidget(self.setLocalsFilterButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.lvWidgetVLayout.addLayout(self.lvWidgetHLayout2)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
179 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
180 self.lvWidget,
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
181 UI.PixmapCache.getIcon("localVariables"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 self.__tabWidget.setTabToolTip(index, self.localsViewer.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
184 self.sourceButton.clicked.connect(self.__showSource)
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
185 self.stackComboBox.currentIndexChanged[int].connect(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
186 self.__frameSelected)
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
187 self.setLocalsFilterButton.clicked.connect(self.setLocalsFilter)
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
188 self.localsFilterEdit.returnPressed.connect(self.setLocalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189
7012
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
190 self.preferencesChanged.connect(self.handlePreferencesChanged)
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
191 self.preferencesChanged.connect(self.globalsViewer.preferencesChanged)
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
192 self.preferencesChanged.connect(self.localsViewer.preferencesChanged)
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
193
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
194 from .CallStackViewer import CallStackViewer
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
195 # add the call stack viewer
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
196 self.callStackViewer = CallStackViewer(self.debugServer)
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
197 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
198 self.callStackViewer,
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
199 UI.PixmapCache.getIcon("step"), "")
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
200 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
201 index, self.callStackViewer.windowTitle())
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
202 self.callStackViewer.sourceFile.connect(self.sourceFile)
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
203 self.callStackViewer.frameSelected.connect(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
204 self.__callStackFrameSelected)
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
205
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
206 from .CallTraceViewer import CallTraceViewer
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
207 # add the call trace viewer
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
208 self.callTraceViewer = CallTraceViewer(self.debugServer, self)
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
209 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
210 self.callTraceViewer,
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
211 UI.PixmapCache.getIcon("callTrace"), "")
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
212 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
213 index, self.callTraceViewer.windowTitle())
2171
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
214 self.callTraceViewer.sourceFile.connect(self.sourceFile)
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
215
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
216 from .BreakPointViewer import BreakPointViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 # add the breakpoint viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 self.breakpointViewer = BreakPointViewer()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 self.breakpointViewer.setModel(self.debugServer.getBreakPointModel())
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
220 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
221 self.breakpointViewer,
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
222 UI.PixmapCache.getIcon("breakpoints"), '')
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
223 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
224 index, self.breakpointViewer.windowTitle())
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 464
diff changeset
225 self.breakpointViewer.sourceFile.connect(self.sourceFile)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
227 from .WatchPointViewer import WatchPointViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 # add the watch expression viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 self.watchpointViewer = WatchPointViewer()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 self.watchpointViewer.setModel(self.debugServer.getWatchPointModel())
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
231 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
232 self.watchpointViewer,
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
233 UI.PixmapCache.getIcon("watchpoints"), '')
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
234 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
235 index, self.watchpointViewer.windowTitle())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
237 from .ExceptionLogger import ExceptionLogger
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 # add the exception logger
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 self.exceptionLogger = ExceptionLogger()
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
240 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
241 self.exceptionLogger,
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
242 UI.PixmapCache.getIcon("exceptions"), '')
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
243 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
244 index, self.exceptionLogger.windowTitle())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
246 self.__tabWidget.setCurrentWidget(self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 # add the threads viewer
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
249 self.__mainLayout.addWidget(QLabel(self.tr("Threads:")))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 self.__threadList = QTreeWidget()
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
251 self.__threadList.setHeaderLabels(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
252 [self.tr("ID"), self.tr("Name"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
253 self.tr("State"), ""])
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 self.__threadList.setSortingEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 self.__mainLayout.addWidget(self.__threadList)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 self.__doThreadListUpdate = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
259 self.__threadList.currentItemChanged.connect(self.__threadSelected)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 self.__mainLayout.setStretchFactor(self.__tabWidget, 5)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 self.__mainLayout.setStretchFactor(self.__threadList, 1)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 self.currentStack = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 self.framenr = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266
1926
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
267 self.__autoViewSource = Preferences.getDebugger("AutoViewSourceCode")
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
268 self.sourceButton.setVisible(not self.__autoViewSource)
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
269
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
270 # connect somer debug server signals
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
271 self.debugServer.clientStack.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
272 self.handleClientStack)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
273 self.debugServer.clientThreadList.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
274 self.showThreadList)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
275 self.debugServer.clientDebuggerIds.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
276 self.showDebuggersList)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
277 self.debugServer.passiveDebugStarted.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
278 self.handleDebuggingStarted)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
279 self.debugServer.clientLine.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
280 self.__clientLine)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
281 self.debugServer.clientSyntaxError.connect(
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
282 self.__clientSyntaxError)
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
283 self.debugServer.clientException.connect(
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
284 self.__clientException)
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
285
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
286 self.debugServer.clientException.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
287 self.exceptionLogger.addException)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
288 self.debugServer.passiveDebugStarted.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
289 self.exceptionLogger.debuggingStarted)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
290
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
291 self.debugServer.clientLine.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
292 self.breakpointViewer.highlightBreakpoint)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
293
7012
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
294 def handlePreferencesChanged(self):
1926
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
295 """
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
296 Public slot to handle the preferencesChanged signal.
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
297 """
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
298 self.__autoViewSource = Preferences.getDebugger("AutoViewSourceCode")
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
299 self.sourceButton.setVisible(not self.__autoViewSource)
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
300
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 def setDebugger(self, debugUI):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 Public method to set a reference to the Debug UI.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
305 @param debugUI reference to the DebugUI object (DebugUI)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 self.debugUI = debugUI
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
308 self.callStackViewer.setDebugger(debugUI)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
310 # connect some debugUI signals
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
311 self.debugUI.clientStack.connect(self.handleClientStack)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
312 self.debugUI.debuggingStarted.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
313 self.exceptionLogger.debuggingStarted)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
314 self.debugUI.debuggingStarted.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
315 self.handleDebuggingStarted)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
316
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 def handleResetUI(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 Public method to reset the SBVviewer.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 self.globalsViewer.handleResetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 self.localsViewer.handleResetUI()
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
323 self.setGlobalsFilter()
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
324 self.setLocalsFilter()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 self.sourceButton.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 self.currentStack = None
2766
c413e9eeaf95 Fixed a bug in the debug viewer causing a false indication upon exit of the script being debugged.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2723
diff changeset
327 self.stackComboBox.clear()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 self.__threadList.clear()
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
329 self.__tabWidget.setCurrentWidget(self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 self.breakpointViewer.handleResetUI()
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
331 self.__debuggersCombo.clear()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
333 def initCallStackViewer(self, projectMode):
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
334 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
335 Public method to initialize the call stack viewer.
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
336
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
337 @param projectMode flag indicating to enable the project mode (boolean)
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
338 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
339 self.callStackViewer.clear()
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
340 self.callStackViewer.setProjectMode(projectMode)
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
341
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
342 def isCallTraceEnabled(self):
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
343 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
344 Public method to get the state of the call trace function.
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
345
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
346 @return flag indicating the state of the call trace function (boolean)
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
347 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
348 return self.callTraceViewer.isCallTraceEnabled()
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
349
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
350 def clearCallTrace(self):
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
351 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
352 Public method to clear the recorded call trace.
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
353 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
354 self.callTraceViewer.clear()
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
355
2171
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
356 def setCallTraceToProjectMode(self, enabled):
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
357 """
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
358 Public slot to set the call trace viewer to project mode.
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
359
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
360 In project mode the call trace info is shown with project relative
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
361 path names.
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
362
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
363 @param enabled flag indicating to enable the project mode (boolean)
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
364 """
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
365 self.callTraceViewer.setProjectMode(enabled)
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
366
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
367 def showVariables(self, vlist, showGlobals):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 Public method to show the variables in the respective window.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 @param vlist list of variables to display
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
372 @param showGlobals flag indicating global/local state
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
374 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 self.globalsViewer.showVariables(vlist, self.framenr)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377 self.localsViewer.showVariables(vlist, self.framenr)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
379 def showVariable(self, vlist, showGlobals):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 Public method to show the variables in the respective window.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 @param vlist list of variables to display
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
384 @param showGlobals flag indicating global/local state
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
386 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 self.globalsViewer.showVariable(vlist)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 self.localsViewer.showVariable(vlist)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
391 def showVariablesTab(self, showGlobals):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 Public method to make a variables tab visible.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
395 @param showGlobals flag indicating global/local state
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
397 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 self.__tabWidget.setCurrentWidget(self.glvWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 self.__tabWidget.setCurrentWidget(self.lvWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
402 def handleClientStack(self, stack, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 Public slot to show the call stack of the program being debugged.
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
405
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
406 @param stack list of tuples with call stack data (file name,
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
407 line number, function name, formatted argument/values list)
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
408 @type list of tuples of (str, str, str, str)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
409 @param debuggerId ID of the debugger backend
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
410 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 """
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
412 if debuggerId == self.__debuggersCombo.currentText():
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
413 block = self.stackComboBox.blockSignals(True)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
414 self.framenr = 0
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
415 self.stackComboBox.clear()
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
416 self.currentStack = stack
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
417 self.sourceButton.setEnabled(len(stack) > 0)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
418 for s in stack:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
419 # just show base filename to make it readable
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
420 s = (os.path.basename(s[0]), s[1], s[2])
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
421 self.stackComboBox.addItem('{0}:{1}:{2}'.format(*s))
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
422 self.stackComboBox.blockSignals(block)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
423
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
424 def __clientLine(self, fn, line, debuggerId):
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
425 """
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
426 Private method to handle a change to the current line.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
428 @param fn filename
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
429 @type str
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
430 @param line linenumber
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
431 @type int
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
432 @param debuggerId ID of the debugger backend
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
433 @type str
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
434 """
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
435 self.__setDebuggerIcon(debuggerId, "exceptions")
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
436
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
437 def __clientSyntaxError(self, message, filename, lineNo, characterNo,
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
438 debuggerId):
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
439 """
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
440 Private method to handle a syntax error in the debugged program.
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
441
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
442 @param message message of the syntax error
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
443 @type str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
444 @param filename translated filename of the syntax error position
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
445 @type str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
446 @param lineNo line number of the syntax error position
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
447 @type int
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
448 @param characterNo character number of the syntax error position
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
449 @type int
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
450 @param debuggerId ID of the debugger backend
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
451 @type str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
452 """
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
453 self.__setDebuggerIcon(debuggerId, "syntaxError22")
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
454
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
455 def __clientException(self, exceptionType, exceptionMessage, stackTrace,
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
456 debuggerId):
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
457 """
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
458 Private method to handle an exception of the debugged program.
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
459
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
460 @param exceptionType type of exception raised
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
461 @type str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
462 @param exceptionMessage message given by the exception
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
463 @type (str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
464 @param stackTrace list of stack entries
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
465 @type list of str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
466 @param debuggerId ID of the debugger backend
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
467 @type str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
468 """
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
469 self.__setDebuggerIcon(debuggerId, "exceptions")
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
470
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 def setVariablesFilter(self, globalsFilter, localsFilter):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473 Public slot to set the local variables filter.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
474
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
475 @param globalsFilter filter list for global variable types
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
476 (list of int)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477 @param localsFilter filter list for local variable types (list of int)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 self.globalsFilter = globalsFilter
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 self.localsFilter = localsFilter
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 def __showSource(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 """
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
484 Private slot to handle the source button press to show the selected
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
485 file.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486 """
2766
c413e9eeaf95 Fixed a bug in the debug viewer causing a false indication upon exit of the script being debugged.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2723
diff changeset
487 index = self.stackComboBox.currentIndex()
c413e9eeaf95 Fixed a bug in the debug viewer causing a false indication upon exit of the script being debugged.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2723
diff changeset
488 if index > -1 and self.currentStack:
c413e9eeaf95 Fixed a bug in the debug viewer causing a false indication upon exit of the script being debugged.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2723
diff changeset
489 s = self.currentStack[index]
c413e9eeaf95 Fixed a bug in the debug viewer causing a false indication upon exit of the script being debugged.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2723
diff changeset
490 self.sourceFile.emit(s[0], int(s[1]))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 def __frameSelected(self, frmnr):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
493 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494 Private slot to handle the selection of a new stack frame number.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496 @param frmnr frame number (0 is the current frame) (int)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497 """
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
498 if frmnr >= 0:
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
499 self.framenr = frmnr
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
500 if self.debugServer.isDebugging():
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
501 self.debugServer.remoteClientVariables(
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
502 self.getSelectedDebuggerId(), 0, self.localsFilter, frmnr)
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
503
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
504 if self.__autoViewSource:
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
505 self.__showSource()
1926
474057fbefe0 Added the configurable capability to automatically show the source, when the call frame is changed in the callstack viewer of the local variables viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1843
diff changeset
506
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
507 def setGlobalsFilter(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
508 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
509 Public slot to set the global variable filter.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 """
6431
1842436770c4 Debugger: changed code to prevent the right side bar or toolbox to be shown when the debugger has exited or was restarted via the shell.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6416
diff changeset
511 if self.debugServer.isDebugging():
1842436770c4 Debugger: changed code to prevent the right side bar or toolbox to be shown when the debugger has exited or was restarted via the shell.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6416
diff changeset
512 filterStr = self.globalsFilterEdit.text()
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
513 self.debugServer.remoteClientSetFilter(
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
514 self.getSelectedDebuggerId(), 1, filterStr)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
515 self.debugServer.remoteClientVariables(
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
516 self.getSelectedDebuggerId(), 2, self.globalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
518 def setLocalsFilter(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
520 Public slot to set the local variable filter.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521 """
6431
1842436770c4 Debugger: changed code to prevent the right side bar or toolbox to be shown when the debugger has exited or was restarted via the shell.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6416
diff changeset
522 if self.debugServer.isDebugging():
1842436770c4 Debugger: changed code to prevent the right side bar or toolbox to be shown when the debugger has exited or was restarted via the shell.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6416
diff changeset
523 filterStr = self.localsFilterEdit.text()
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
524 self.debugServer.remoteClientSetFilter(
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
525 self.getSelectedDebuggerId(), 0, filterStr)
6431
1842436770c4 Debugger: changed code to prevent the right side bar or toolbox to be shown when the debugger has exited or was restarted via the shell.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6416
diff changeset
526 if self.currentStack:
1842436770c4 Debugger: changed code to prevent the right side bar or toolbox to be shown when the debugger has exited or was restarted via the shell.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6416
diff changeset
527 self.debugServer.remoteClientVariables(
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
528 self.getSelectedDebuggerId(), 0, self.localsFilter,
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
529 self.framenr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531 def handleDebuggingStarted(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
533 Public slot to handle the start of a debugging session.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 This slot sets the variables filter expressions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
537 self.setGlobalsFilter()
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
538 self.setLocalsFilter()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 self.showVariablesTab(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541 def currentWidget(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
543 Public method to get a reference to the current widget.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 @return reference to the current widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
547 return self.__tabWidget.currentWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548
821
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
549 def setCurrentWidget(self, widget):
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
550 """
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
551 Public slot to set the current page based on the given widget.
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
552
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
553 @param widget reference to the widget (QWidget)
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
554 """
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
555 self.__tabWidget.setCurrentWidget(widget)
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
556
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
557 def showThreadList(self, currentID, threadList, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
559 Public method to show the thread list.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
560
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
561 @param currentID id of the current thread
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
562 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
563 @param threadList list of dictionaries containing the thread data
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
564 @type list of dict
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
565 @param debuggerId ID of the debugger backend
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
566 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567 """
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
568 debugStatus = -1 # i.e. running
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
569
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
570 if debuggerId == self.__debuggersCombo.currentText():
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
571 citm = None
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
572
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
573 self.__threadList.clear()
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
574 for thread in threadList:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
575 if thread.get('except', False):
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
576 state = self.tr("waiting at exception")
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
577 icon = "exceptions"
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
578 debugStatus = 1
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
579 elif thread['broken']:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
580 state = self.tr("waiting at breakpoint")
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
581 icon = "mediaPlaybackPause"
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
582 if debugStatus < 1:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
583 debugStatus = 0
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
584 else:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
585 state = self.tr("running")
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
586 icon = "mediaPlaybackStart"
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
587 itm = QTreeWidgetItem(self.__threadList,
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
588 ["{0:d}".format(thread['id']),
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
589 thread['name'], state])
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
590 itm.setIcon(0, UI.PixmapCache.getIcon(icon))
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
591 if thread['id'] == currentID:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
592 citm = itm
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
593
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
594 self.__threadList.header().resizeSections(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
595 QHeaderView.ResizeToContents)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
596 self.__threadList.header().setStretchLastSection(True)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
597
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
598 if citm:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
599 self.__doThreadListUpdate = False
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
600 self.__threadList.setCurrentItem(citm)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
601 self.__doThreadListUpdate = True
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
602 else:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
603 for thread in threadList:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
604 if thread.get('except', False):
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
605 debugStatus = 1
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
606 elif thread['broken']:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
607 if debugStatus < 1:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
608 debugStatus = 0
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
609
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
610 if debugStatus == -1:
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
611 icon = "mediaPlaybackStart"
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
612 elif debugStatus == 0:
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
613 icon = "mediaPlaybackPause"
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
614 else:
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
615 icon = "exceptions"
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
616 self.__setDebuggerIcon("", icon)
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
617
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618 def __threadSelected(self, current, previous):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
619 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
620 Private slot to handle the selection of a thread in the thread list.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
621
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
622 @param current reference to the new current item (QTreeWidgetItem)
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
623 @param previous reference to the previous current item
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
624 (QTreeWidgetItem)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
625 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
626 if current is not None and self.__doThreadListUpdate:
8
0ae9bd4d2993 Fixed a few bugs introduced introduced by the change to the QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
627 tid = int(current.text(0))
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
628 self.debugServer.remoteSetThread(self.getSelectedDebuggerId(), tid)
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
629
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
630 def __callStackFrameSelected(self, frameNo):
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
631 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
632 Private slot to handle the selection of a call stack entry of the
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
633 call stack viewer.
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
634
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
635 @param frameNo frame number (index) of the selected entry (integer)
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
636 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
637 if frameNo >= 0:
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
638 self.stackComboBox.setCurrentIndex(frameNo)
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
639
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
640 def __debuggerSelected(self, debuggerId):
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
641 """
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
642 Private slot to handle the selection of a debugger backend ID.
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
643
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
644 @param debuggerId ID of the selected debugger backend
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
645 @type str
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
646 """
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
647 if debuggerId:
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
648 self.globalsViewer.handleResetUI()
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
649 self.localsViewer.handleResetUI()
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
650 self.currentStack = None
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
651 self.stackComboBox.clear()
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
652 self.__threadList.clear()
7375
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
653 self.callStackViewer.clear()
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
654
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
655 self.debugUI.getDebuggerData(debuggerId)
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
656
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
657 def showDebuggersList(self, debuggerIds):
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
658 """
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
659 Public slot to receive the list of debugger backend IDs.
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
660
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
661 @param debuggerIds list of debugger backend IDs
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
662 @type list of str
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
663 """
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
664 block = self.__debuggersCombo.blockSignals(True)
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
665
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
666 currentDebuggerId = self.__debuggersCombo.currentText()
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
667 self.__debuggersCombo.clear()
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
668 self.__debuggersCombo.addItems(debuggerIds)
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
669 if currentDebuggerId:
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
670 self.__debuggersCombo.setCurrentText(currentDebuggerId)
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
671 else:
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
672 self.__debuggersCombo.setCurrentIndex(0)
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
673
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
674 self.__debuggersCombo.blockSignals(block)
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
675
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
676 def getSelectedDebuggerId(self):
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
677 """
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
678 Public method to get the currently selected debugger ID.
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
679
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
680 @return selected debugger ID
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
681 @rtype str
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
682 """
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
683 return self.__debuggersCombo.currentText()
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
684
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
685 def __setDebuggerIcon(self, debuggerId, iconName):
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
686 """
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
687 Private method to set the icon for a specific debugger ID.
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
688
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
689 @param debuggerId ID of the debugger backend (empty ID means the
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
690 currently selected one)
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
691 @type str
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
692 @param iconName name of the icon to be used
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
693 @type str
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
694 """
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
695 if debuggerId:
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
696 index = self.__debuggersCombo.findText(debuggerId, Qt.MatchExactly)
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
697 else:
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
698 index = self.__debuggersCombo.currentIndex()
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
699 if index >= 0:
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
700 self.__debuggersCombo.setItemIcon(
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
701 index, UI.PixmapCache.getIcon(iconName))

eric ide

mercurial