eric6/Debugger/DebugViewer.py

Sun, 02 Feb 2020 11:04:32 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 02 Feb 2020 11:04:32 +0100
changeset 7380
c99320e859ca
parent 7360
9190402e4505
child 7374
5401ae8ddaa1
child 7475
33fbefbb5057
permissions
-rw-r--r--

Fixed an issue related to showing the application name in the menu bar of Gnome desktop under Wayland.

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>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 <li>variables viewer for global variables</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 <li>variables viewer for local variables</li>
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
13 <li>call trace viewer</li>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 <li>viewer for breakpoints</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 <li>viewer for watch expressions</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 <li>viewer for exceptions</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 <li>viewer for threads</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 <li>a file browser (optional)</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 <li>an interpreter shell (optional)</li>
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
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
26 from PyQt5.QtCore import pyqtSignal
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,
bc5b1b00560a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
29 QComboBox, QLabel, QTreeWidget, QTreeWidgetItem, QHeaderView
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
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png"))
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
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 13
diff changeset
71 self.__tabWidget = E5TabWidget()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.__mainLayout.addWidget(self.__tabWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
74 from .VariablesViewer import VariablesViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 # add the global variables viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 self.glvWidget = QWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.glvWidgetVLayout = QVBoxLayout(self.glvWidget)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
78 self.glvWidgetVLayout.setContentsMargins(0, 0, 0, 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.glvWidgetVLayout.setSpacing(3)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 self.glvWidget.setLayout(self.glvWidgetVLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
82 self.globalsViewer = VariablesViewer(self, True, self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.glvWidgetVLayout.addWidget(self.globalsViewer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 self.glvWidgetHLayout = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
86 self.glvWidgetHLayout.setContentsMargins(3, 3, 3, 3)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 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
89 self.globalsFilterEdit.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
90 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.glvWidgetHLayout.addWidget(self.globalsFilterEdit)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
92 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
93 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
94 " to define variable filters. "))
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
95 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
96 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
97 " 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
98 " 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
99 " are not shown in the list above."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
101 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
102 self.tr('Set'), self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 self.glvWidgetHLayout.addWidget(self.setGlobalsFilterButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 self.glvWidgetVLayout.addLayout(self.glvWidgetHLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
106 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
107 self.glvWidget,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 UI.PixmapCache.getIcon("globalVariables.png"), '')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.__tabWidget.setTabToolTip(index, self.globalsViewer.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
111 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
112 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
113 self.globalsFilterEdit.returnPressed.connect(self.setGlobalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 # add the local variables viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 self.lvWidget = QWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 self.lvWidgetVLayout = QVBoxLayout(self.lvWidget)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
118 self.lvWidgetVLayout.setContentsMargins(0, 0, 0, 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 self.lvWidgetVLayout.setSpacing(3)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 self.lvWidget.setLayout(self.lvWidgetVLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 self.lvWidgetHLayout1 = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
123 self.lvWidgetHLayout1.setContentsMargins(3, 3, 3, 3)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 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
126 self.stackComboBox.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
127 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 self.lvWidgetHLayout1.addWidget(self.stackComboBox)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
130 self.sourceButton = QPushButton(self.tr('Source'), self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 self.lvWidgetHLayout1.addWidget(self.sourceButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 self.sourceButton.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 self.lvWidgetVLayout.addLayout(self.lvWidgetHLayout1)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
135 self.localsViewer = VariablesViewer(self, False, self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 self.lvWidgetVLayout.addWidget(self.localsViewer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 self.lvWidgetHLayout2 = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
139 self.lvWidgetHLayout2.setContentsMargins(3, 3, 3, 3)
0
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.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
142 self.localsFilterEdit.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
143 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 self.lvWidgetHLayout2.addWidget(self.localsFilterEdit)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
145 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
146 self.tr(
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
147 "Enter regular expression patterns separated by ';' to define "
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 "variable filters. "))
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
149 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
150 self.tr(
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
151 "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
152 "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
153 " 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
154
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
155 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
156 self.tr('Set'), self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 self.lvWidgetHLayout2.addWidget(self.setLocalsFilterButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 self.lvWidgetVLayout.addLayout(self.lvWidgetHLayout2)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
160 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
161 self.lvWidget,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 UI.PixmapCache.getIcon("localVariables.png"), '')
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 self.__tabWidget.setTabToolTip(index, self.localsViewer.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
165 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
166 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
167 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
168 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
169 self.localsFilterEdit.returnPressed.connect(self.setLocalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170
7012
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
171 self.preferencesChanged.connect(self.handlePreferencesChanged)
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
172 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
173 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
174
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
175 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
176 # 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
177 self.callStackViewer = CallStackViewer(self.debugServer)
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
178 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
179 self.callStackViewer,
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
180 UI.PixmapCache.getIcon("step.png"), "")
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
181 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
182 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
183 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
184 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
185 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
186
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
187 from .CallTraceViewer import CallTraceViewer
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
188 # add the call trace viewer
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
189 self.callTraceViewer = CallTraceViewer(self.debugServer)
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
190 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
191 self.callTraceViewer,
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
192 UI.PixmapCache.getIcon("callTrace.png"), "")
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
193 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
194 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
195 self.callTraceViewer.sourceFile.connect(self.sourceFile)
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
196
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
197 from .BreakPointViewer import BreakPointViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 # add the breakpoint viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 self.breakpointViewer = BreakPointViewer()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 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
201 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
202 self.breakpointViewer,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 UI.PixmapCache.getIcon("breakpoints.png"), '')
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
204 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
205 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
206 self.breakpointViewer.sourceFile.connect(self.sourceFile)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
208 from .WatchPointViewer import WatchPointViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 # add the watch expression viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 self.watchpointViewer = WatchPointViewer()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 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
212 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
213 self.watchpointViewer,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 UI.PixmapCache.getIcon("watchpoints.png"), '')
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
215 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
216 index, self.watchpointViewer.windowTitle())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
218 from .ExceptionLogger import ExceptionLogger
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 # add the exception logger
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 self.exceptionLogger = ExceptionLogger()
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
221 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
222 self.exceptionLogger,
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 UI.PixmapCache.getIcon("exceptions.png"), '')
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
224 self.__tabWidget.setTabToolTip(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
225 index, self.exceptionLogger.windowTitle())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226
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
227 self.__tabWidget.setCurrentWidget(self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 # 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
230 self.__mainLayout.addWidget(QLabel(self.tr("Threads:")))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 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
232 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
233 [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
234 self.tr("State"), ""])
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 self.__threadList.setSortingEnabled(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 self.__mainLayout.addWidget(self.__threadList)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 self.__doThreadListUpdate = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239
482
4650a72c307a Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 481
diff changeset
240 self.__threadList.currentItemChanged.connect(self.__threadSelected)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 self.__mainLayout.setStretchFactor(self.__tabWidget, 5)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 self.__mainLayout.setStretchFactor(self.__threadList, 1)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 self.currentStack = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 self.framenr = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
248 self.debugServer.clientStack.connect(self.handleClientStack)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249
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
250 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
251 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
252
7012
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
253 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
254 """
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
255 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
256 """
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
257 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
258 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
259
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 def setDebugger(self, debugUI):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 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
263
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
264 @param debugUI reference to the DebugUI object (DebugUI)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 self.debugUI = debugUI
481
ad71812ba395 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 476
diff changeset
267 self.debugUI.clientStack.connect(self.handleClientStack)
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
268 self.callStackViewer.setDebugger(debugUI)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 def handleResetUI(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 Public method to reset the SBVviewer.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 self.globalsViewer.handleResetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 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
276 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
277 self.setLocalsFilter()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 self.sourceButton.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 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
280 self.stackComboBox.clear()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 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
282 self.__tabWidget.setCurrentWidget(self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 self.breakpointViewer.handleResetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
285 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
286 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
287 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
288
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
289 @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
290 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
291 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
292 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
293
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
294 def isCallTraceEnabled(self):
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
295 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
296 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
297
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
298 @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
299 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
300 return self.callTraceViewer.isCallTraceEnabled()
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
301
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
302 def clearCallTrace(self):
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
303 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
304 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
305 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
306 self.callTraceViewer.clear()
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
307
2171
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
308 def setCallTraceToProjectMode(self, enabled):
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
309 """
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
310 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
311
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
312 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
313 path names.
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
314
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
315 @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
316 """
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
317 self.callTraceViewer.setProjectMode(enabled)
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
318
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
319 def showVariables(self, vlist, showGlobals):
0
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 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
322
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 @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
324 @param showGlobals flag indicating global/local state
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
326 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 self.globalsViewer.showVariables(vlist, self.framenr)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 self.localsViewer.showVariables(vlist, self.framenr)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
331 def showVariable(self, vlist, showGlobals):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 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
334
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 @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
336 @param showGlobals flag indicating global/local state
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
338 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 self.globalsViewer.showVariable(vlist)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 self.localsViewer.showVariable(vlist)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
343 def showVariablesTab(self, showGlobals):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 Public method to make a variables tab visible.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
347 @param showGlobals flag indicating global/local state
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
349 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 self.__tabWidget.setCurrentWidget(self.glvWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 self.__tabWidget.setCurrentWidget(self.lvWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 def handleClientStack(self, stack):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 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
357
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
358 @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
359 line number, function name, formatted argument/values list)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 """
2723
f6ad272bf486 Fixed a bug in the debug viewer causing some items being shown multiple times.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2622
diff changeset
361 block = self.stackComboBox.blockSignals(True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 self.framenr = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 self.stackComboBox.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 self.currentStack = stack
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 self.sourceButton.setEnabled(len(stack) > 0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 for s in stack:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 # just show base filename to make it readable
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 s = (os.path.basename(s[0]), s[1], s[2])
406
eacf81fad150 Started converting the string formatting stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 96
diff changeset
369 self.stackComboBox.addItem('{0}:{1}:{2}'.format(*s))
2723
f6ad272bf486 Fixed a bug in the debug viewer causing some items being shown multiple times.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2622
diff changeset
370 self.stackComboBox.blockSignals(block)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 def setVariablesFilter(self, globalsFilter, localsFilter):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 Public slot to set the local variables filter.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
376 @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
377 (list of int)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378 @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
379 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 self.globalsFilter = globalsFilter
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 self.localsFilter = localsFilter
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 def __showSource(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 """
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
385 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
386 file.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 """
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
388 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
389 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
390 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
391 self.sourceFile.emit(s[0], int(s[1]))
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 def __frameSelected(self, frmnr):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 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
396
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 @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
398 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 self.framenr = frmnr
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
400 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
401 self.debugServer.remoteClientVariables(0, self.localsFilter, frmnr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402
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
403 if 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
404 self.__showSource()
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
405
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
406 def setGlobalsFilter(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
408 Public slot to set the global variable filter.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 """
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
410 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
411 filterStr = self.globalsFilterEdit.text()
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
412 self.debugServer.remoteClientSetFilter(1, filterStr)
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
413 self.debugServer.remoteClientVariables(2, self.globalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
415 def setLocalsFilter(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
417 Public slot to set the local variable filter.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 """
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
419 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
420 filterStr = self.localsFilterEdit.text()
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
421 self.debugServer.remoteClientSetFilter(0, filterStr)
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
422 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
423 self.debugServer.remoteClientVariables(
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
424 0, self.localsFilter, self.framenr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 def handleDebuggingStarted(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 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
429
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 This slot sets the variables filter expressions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
432 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
433 self.setLocalsFilter()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 self.showVariablesTab(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 def currentWidget(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 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
439
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440 @return reference to the current widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 return self.__tabWidget.currentWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443
821
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
444 def setCurrentWidget(self, widget):
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
445 """
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
446 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
447
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
448 @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
449 """
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
450 self.__tabWidget.setCurrentWidget(widget)
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
451
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 def showThreadList(self, currentID, threadList):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 Public method to show the thread list.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 @param currentID id of the current thread (integer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 @param threadList list of dictionaries containing the thread data
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 citm = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 self.__threadList.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 for thread in threadList:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 if thread['broken']:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
464 state = self.tr("waiting at breakpoint")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
466 state = self.tr("running")
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 821
diff changeset
467 itm = QTreeWidgetItem(self.__threadList,
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
468 ["{0:d}".format(thread['id']),
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
469 thread['name'], state])
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 if thread['id'] == currentID:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 citm = itm
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 self.__threadList.header().resizeSections(QHeaderView.ResizeToContents)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
474 self.__threadList.header().setStretchLastSection(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
475
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 if citm:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477 self.__doThreadListUpdate = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 self.__threadList.setCurrentItem(citm)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 self.__doThreadListUpdate = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 def __threadSelected(self, current, previous):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 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
484
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485 @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
486 @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
487 (QTreeWidgetItem)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489 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
490 tid = int(current.text(0))
821
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
491 self.debugServer.remoteSetThread(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
492
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
493 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
494 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
495 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
496 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
497
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
498 @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
499 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
500 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
501 self.stackComboBox.setCurrentIndex(frameNo)

eric ide

mercurial