eric6/Debugger/DebugViewer.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 7986
2971d5d19951
child 8043
0acf98cd089a
child 8143
2c730d5fd177
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

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
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7920
diff changeset
3 # Copyright (c) 2002 - 2021 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>
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
11 <li>selector showing all connected debugger backends with associated
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
12 threads</li>
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
13 <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
14 <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
15 <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
16 <li>call trace viewer</li>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 <li>viewer for breakpoints</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 <li>viewer for watch expressions</li>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 <li>viewer for exceptions</li>
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
20 <li>viewer for a code disassembly for an exception<li>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 </ul>
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
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
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
26 from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QCoreApplication
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,
7878
b210470f54b3 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7862
diff changeset
29 QComboBox, QLabel, QTreeWidget, QTreeWidgetItem, QHeaderView, QSplitter
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
7418
6214fa980a9d DebugViewer: don't show the thread ID anymore because it is meaningless for the user.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7412
diff changeset
53 ThreadIdRole = Qt.UserRole + 1
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
54 DebuggerStateRole = Qt.UserRole + 2
7418
6214fa980a9d DebugViewer: don't show the thread ID anymore because it is meaningless for the user.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7412
diff changeset
55
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
56 # Map debug state to icon name
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
57 StateIcon = {
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
58 "broken": "break",
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
59 "exception": "exceptions",
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
60 "running": "mediaPlaybackStart",
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
61 "syntax": "syntaxError22",
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
62 }
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
63
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
64 # Map debug state to user message
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
65 StateMessage = {
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
66 "broken": QCoreApplication.translate(
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
67 "DebugViewer", "waiting at breakpoint"),
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
68 "exception": QCoreApplication.translate(
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
69 "DebugViewer", "waiting at exception"),
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
70 "running": QCoreApplication.translate(
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
71 "DebugViewer", "running"),
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
72 "syntax": QCoreApplication.translate(
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
73 "DebugViewer", "syntax error"),
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
74 }
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
75
6987
3371a03ed0a7 Performed some interface cleanups.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
76 def __init__(self, debugServer, parent=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
80 @param debugServer reference to the debug server object
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
81 @type DebugServer
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
82 @param parent parent widget
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
83 @type QWidget
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 """
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
85 super(DebugViewer, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.debugServer = debugServer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 self.debugUI = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7475
diff changeset
90 self.setWindowIcon(UI.PixmapCache.getIcon("eric"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 self.__mainLayout = QVBoxLayout()
7407
a0b6acee2c20 Continued with the multiprocess debugger. Started with QProcess support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7405
diff changeset
93 self.__mainLayout.setContentsMargins(0, 3, 0, 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.setLayout(self.__mainLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95
7878
b210470f54b3 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7862
diff changeset
96 self.__mainSplitter = QSplitter(Qt.Vertical, self)
b210470f54b3 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7862
diff changeset
97 self.__mainLayout.addWidget(self.__mainSplitter)
b210470f54b3 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7862
diff changeset
98
7375
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
99 # add the viewer showing the connected debug backends
7879
7be93de6b532 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
100 self.__debuggersWidget = QWidget()
7be93de6b532 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
101 self.__debuggersLayout = QVBoxLayout(self.__debuggersWidget)
7be93de6b532 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
102 self.__debuggersLayout.setContentsMargins(0, 0, 0, 0)
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
103 self.__debuggersLayout.addWidget(
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
104 QLabel(self.tr("Debuggers and Threads:")))
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
105 self.__debuggersList = QTreeWidget()
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
106 self.__debuggersList.setHeaderLabels(
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
107 [self.tr("ID"), self.tr("State"), ""])
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
108 self.__debuggersList.header().setStretchLastSection(True)
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
109 self.__debuggersList.setSortingEnabled(True)
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
110 self.__debuggersList.setRootIsDecorated(True)
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
111 self.__debuggersList.setAlternatingRowColors(True)
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
112 self.__debuggersLayout.addWidget(self.__debuggersList)
7879
7be93de6b532 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7876
diff changeset
113 self.__mainSplitter.addWidget(self.__debuggersWidget)
7375
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
114
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
115 self.__debuggersList.currentItemChanged.connect(
7375
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
116 self.__debuggerSelected)
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
117
af2500ced7e0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7374
diff changeset
118 # 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
119 self.__tabWidget = E5TabWidget()
7878
b210470f54b3 DebugViewer: changed the layout to use a QSplitter to offer more flexibility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7862
diff changeset
120 self.__mainSplitter.addWidget(self.__tabWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
122 from .VariablesViewer import VariablesViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 # add the global variables viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.glvWidget = QWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.glvWidgetVLayout = QVBoxLayout(self.glvWidget)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
126 self.glvWidgetVLayout.setContentsMargins(0, 0, 0, 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 self.glvWidgetVLayout.setSpacing(3)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 self.glvWidget.setLayout(self.glvWidgetVLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
130 self.globalsViewer = VariablesViewer(self, True, self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 self.glvWidgetVLayout.addWidget(self.globalsViewer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 self.glvWidgetHLayout = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
134 self.glvWidgetHLayout.setContentsMargins(3, 3, 3, 3)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 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
137 self.globalsFilterEdit.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
138 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 self.glvWidgetHLayout.addWidget(self.globalsFilterEdit)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
140 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
141 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
142 " to define variable filters. "))
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
143 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
144 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
145 " 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
146 " 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
147 " are not shown in the list above."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
149 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
150 self.tr('Set'), self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 self.glvWidgetHLayout.addWidget(self.setGlobalsFilterButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 self.glvWidgetVLayout.addLayout(self.glvWidgetHLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
154 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
155 self.glvWidget,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7475
diff changeset
156 UI.PixmapCache.getIcon("globalVariables"), '')
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
157 self.__tabWidget.setTabToolTip(
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
158 index,
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
159 self.tr("Shows the list of global variables and their values."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
161 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
162 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
163 self.globalsFilterEdit.returnPressed.connect(self.setGlobalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 # add the local variables viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 self.lvWidget = QWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 self.lvWidgetVLayout = QVBoxLayout(self.lvWidget)
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
168 self.lvWidgetVLayout.setContentsMargins(0, 0, 0, 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 self.lvWidgetVLayout.setSpacing(3)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 self.lvWidget.setLayout(self.lvWidgetVLayout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 self.lvWidgetHLayout1 = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
173 self.lvWidgetHLayout1.setContentsMargins(3, 3, 3, 3)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 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
176 self.stackComboBox.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
177 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 self.lvWidgetHLayout1.addWidget(self.stackComboBox)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
180 self.sourceButton = QPushButton(self.tr('Source'), self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 self.lvWidgetHLayout1.addWidget(self.sourceButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 self.sourceButton.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 self.lvWidgetVLayout.addLayout(self.lvWidgetHLayout1)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
185 self.localsViewer = VariablesViewer(self, False, self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.lvWidgetVLayout.addWidget(self.localsViewer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 self.lvWidgetHLayout2 = QHBoxLayout()
2824
858412c29c34 Replaced the obsoleted method setMargin() with setContentsMargins().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2766
diff changeset
189 self.lvWidgetHLayout2.setContentsMargins(3, 3, 3, 3)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 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
192 self.localsFilterEdit.setSizePolicy(
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
193 QSizePolicy.Expanding, QSizePolicy.Fixed)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 self.lvWidgetHLayout2.addWidget(self.localsFilterEdit)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
195 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
196 self.tr(
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
197 "Enter regular expression patterns separated by ';' to define "
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 "variable filters. "))
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 482
diff changeset
199 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
200 self.tr(
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
201 "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
202 "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
203 " 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
204
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
205 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
206 self.tr('Set'), self.lvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 self.lvWidgetHLayout2.addWidget(self.setLocalsFilterButton)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 self.lvWidgetVLayout.addLayout(self.lvWidgetHLayout2)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
210 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
211 self.lvWidget,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7475
diff changeset
212 UI.PixmapCache.getIcon("localVariables"), '')
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
213 self.__tabWidget.setTabToolTip(
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
214 index,
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
215 self.tr("Shows the list of local variables and their values."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
217 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
218 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
219 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
220 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
221 self.localsFilterEdit.returnPressed.connect(self.setLocalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222
7012
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
223 self.preferencesChanged.connect(self.handlePreferencesChanged)
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
224 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
225 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
226
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
227 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
228 # 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
229 self.callStackViewer = CallStackViewer(self.debugServer)
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
230 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
231 self.callStackViewer,
7475
33fbefbb5057 Modified some Breeze icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
232 UI.PixmapCache.getIcon("callStack"), "")
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
233 self.__tabWidget.setTabToolTip(
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
234 index,
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
235 self.tr("Shows the current call stack."))
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
236 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
237 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
238 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
239
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
240 from .CallTraceViewer import CallTraceViewer
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
241 # add the call trace viewer
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
242 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
243 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
244 self.callTraceViewer,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7475
diff changeset
245 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
246 self.__tabWidget.setTabToolTip(
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
247 index,
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
248 self.tr("Shows a trace of the program flow."))
2171
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
249 self.callTraceViewer.sourceFile.connect(self.sourceFile)
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
250
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
251 from .BreakPointViewer import BreakPointViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 # add the breakpoint viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 self.breakpointViewer = BreakPointViewer()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 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
255 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
256 self.breakpointViewer,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7475
diff changeset
257 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
258 self.__tabWidget.setTabToolTip(
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
259 index,
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
260 self.tr("Shows a list of defined breakpoints."))
476
121633976eca Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 464
diff changeset
261 self.breakpointViewer.sourceFile.connect(self.sourceFile)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
263 from .WatchPointViewer import WatchPointViewer
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 # add the watch expression viewer
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 self.watchpointViewer = WatchPointViewer()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 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
267 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
268 self.watchpointViewer,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7475
diff changeset
269 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
270 self.__tabWidget.setTabToolTip(
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
271 index,
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
272 self.tr("Shows a list of defined watchpoints."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
274 from .ExceptionLogger import ExceptionLogger
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 # add the exception logger
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 self.exceptionLogger = ExceptionLogger()
3021
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
277 index = self.__tabWidget.addTab(
801289962f4e Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2988
diff changeset
278 self.exceptionLogger,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7475
diff changeset
279 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
280 self.__tabWidget.setTabToolTip(
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
281 index,
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
282 self.tr("Shows a list of raised exceptions."))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283
7707
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
284 from UI.PythonDisViewer import PythonDisViewer, PythonDisViewerModes
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
285 # add the Python disassembly viewer
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
286 self.disassemblyViewer = PythonDisViewer(
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
287 None, mode=PythonDisViewerModes.TracebackMode)
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
288 index = self.__tabWidget.addTab(
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
289 self.disassemblyViewer,
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
290 UI.PixmapCache.getIcon("disassembly"), '')
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
291 self.__tabWidget.setTabToolTip(
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
292 index,
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
293 self.tr("Shows a code disassembly in case of an exception."))
7707
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
294
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
295 self.__tabWidget.setCurrentWidget(self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
297 self.__doDebuggersListUpdate = True
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
299 self.__mainSplitter.setSizes([100, 700])
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 self.currentStack = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 self.framenr = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303
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
304 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
305 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
306
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
307 # connect some debug server signals
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
308 self.debugServer.clientStack.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
309 self.handleClientStack)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
310 self.debugServer.clientThreadList.connect(
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
311 self.__addThreadList)
7412
0a995393d2ba Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
312 self.debugServer.clientDebuggerId.connect(
0a995393d2ba Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
313 self.__clientDebuggerId)
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
314 self.debugServer.passiveDebugStarted.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 self.debugServer.clientLine.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
317 self.__clientLine)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
318 self.debugServer.clientSyntaxError.connect(
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
319 self.__clientSyntaxError)
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
320 self.debugServer.clientException.connect(
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
321 self.__clientException)
7410
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
322 self.debugServer.clientExit.connect(
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
323 self.__clientExit)
7932
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7931
diff changeset
324 self.debugServer.clientDisconnected.connect(
c4c6b2784eec Debugger: fixed an issue related to multiprocessing on Windows and macOS because these use the 'spawn' method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7931
diff changeset
325 self.__removeDebugger)
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
326
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
327 self.debugServer.clientException.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
328 self.exceptionLogger.addException)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
329 self.debugServer.passiveDebugStarted.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
330 self.exceptionLogger.debuggingStarted)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
331
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
332 self.debugServer.clientLine.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
333 self.breakpointViewer.highlightBreakpoint)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
334
7012
cc3f83d1a605 Colors for highlighting are configurable through Debugger->General
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 6942
diff changeset
335 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
336 """
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
337 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
338 """
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
339 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
340 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
341
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 def setDebugger(self, debugUI):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 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
345
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
346 @param debugUI reference to the DebugUI object
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
347 @type DebugUI
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 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
350 self.callStackViewer.setDebugger(debugUI)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
352 # connect some debugUI signals
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
353 self.debugUI.clientStack.connect(self.handleClientStack)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
354 self.debugUI.debuggingStarted.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
355 self.exceptionLogger.debuggingStarted)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
356 self.debugUI.debuggingStarted.connect(
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
357 self.handleDebuggingStarted)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
358
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
359 def handleResetUI(self, fullReset):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 """
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
361 Public method to reset the viewer.
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
362
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
363 @param fullReset flag indicating a full reset is required
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
364 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 self.globalsViewer.handleResetUI()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 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
368 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
369 self.setLocalsFilter()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 self.sourceButton.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 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
372 self.stackComboBox.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
373 self.__tabWidget.setCurrentWidget(self.glvWidget)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 self.breakpointViewer.handleResetUI()
7928
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
375 if fullReset:
a78ce4578fed Debugger: some more fixes
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
376 self.__debuggersList.clear()
7707
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
377 self.disassemblyViewer.clear()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
379 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
380 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
381 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
382
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
383 @param projectMode flag indicating to enable the project mode
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
384 @type bool
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
385 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
386 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
387 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
388
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
389 def isCallTraceEnabled(self):
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
390 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
391 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
392
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
393 @return flag indicating the state of the call trace function
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
394 @rtype bool
2170
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
395 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
396 return self.callTraceViewer.isCallTraceEnabled()
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
397
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
398 def clearCallTrace(self):
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
399 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
400 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
401 """
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
402 self.callTraceViewer.clear()
f4e0f6133ace Started implementing the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1926
diff changeset
403
2171
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
404 def setCallTraceToProjectMode(self, enabled):
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
405 """
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
406 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
407
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
408 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
409 path names.
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
410
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
411 @param enabled flag indicating to enable the project mode
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
412 @type bool
2171
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
413 """
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
414 self.callTraceViewer.setProjectMode(enabled)
c7dd548d67d8 Finished the coding part of the call trace functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2170
diff changeset
415
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
416 def showVariables(self, vlist, showGlobals):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 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
419
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 @param vlist list of variables to display
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
421 @type list
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
422 @param showGlobals flag indicating global/local state
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
423 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
425 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 self.globalsViewer.showVariables(vlist, self.framenr)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 self.localsViewer.showVariables(vlist, self.framenr)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
430 def showVariable(self, vlist, showGlobals):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 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
433
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 @param vlist list of variables to display
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
435 @type list
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
436 @param showGlobals flag indicating global/local state
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
437 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
439 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440 self.globalsViewer.showVariable(vlist)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 self.localsViewer.showVariable(vlist)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
444 def showVariablesTab(self, showGlobals):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 Public method to make a variables tab visible.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
448 @param showGlobals flag indicating global/local state
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
449 @type bool
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 """
5587
ea526b78ee6c Started to fix code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
451 if showGlobals:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 self.__tabWidget.setCurrentWidget(self.glvWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 self.__tabWidget.setCurrentWidget(self.lvWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
456 def handleClientStack(self, stack, debuggerId):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 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
459
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
460 @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
461 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
462 @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
463 @param debuggerId ID of the debugger backend
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
464 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 """
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
466 if debuggerId == self.getSelectedDebuggerId():
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
467 block = self.stackComboBox.blockSignals(True)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
468 self.framenr = 0
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
469 self.stackComboBox.clear()
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
470 self.currentStack = stack
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
471 self.sourceButton.setEnabled(len(stack) > 0)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
472 for s in stack:
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
473 # just show base filename to make it readable
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
474 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
475 self.stackComboBox.addItem('{0}:{1}:{2}'.format(*s))
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
476 self.stackComboBox.blockSignals(block)
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
477
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
478 def __clientLine(self, fn, line, debuggerId, threadName):
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
479 """
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
480 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
481
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
482 @param fn filename
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
483 @type str
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
484 @param line linenumber
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
485 @type int
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
486 @param debuggerId ID of the debugger backend
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
487 @type str
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
488 @param threadName name of the thread signaling the event
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
489 @type str
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
490 """
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
491 self.__setDebuggerIconAndState(debuggerId, "broken")
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
492 self.__setThreadIconAndState(debuggerId, threadName, "broken")
7410
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
493 if debuggerId != self.getSelectedDebuggerId():
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
494 self.__setCurrentDebugger(debuggerId)
7410
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
495
7421
4a9900aef04e Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7418
diff changeset
496 @pyqtSlot(str, int, str, bool, str)
4a9900aef04e Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7418
diff changeset
497 def __clientExit(self, program, status, message, quiet, debuggerId):
7410
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
498 """
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
499 Private method to handle the debugged program terminating.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500
7421
4a9900aef04e Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7418
diff changeset
501 @param program name of the exited program
4a9900aef04e Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7418
diff changeset
502 @type str
7410
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
503 @param status exit code of the debugged program
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
504 @type int
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
505 @param message exit message of the debugged program
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
506 @type str
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
507 @param quiet flag indicating to suppress exit info display
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
508 @type bool
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
509 @param debuggerId ID of the debugger backend
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
510 @type str
401791e6f50f Continued with the multiprocess debugger. Implemented QProcess.startDetached() wrapper.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7407
diff changeset
511 """
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
512 if not self.isOnlyDebugger():
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
513 if debuggerId == self.getSelectedDebuggerId():
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
514 # the current client has exited
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
515 self.globalsViewer.handleResetUI()
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
516 self.localsViewer.handleResetUI()
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
517 self.setGlobalsFilter()
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
518 self.setLocalsFilter()
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
519 self.sourceButton.setEnabled(False)
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
520 self.currentStack = None
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
521 self.stackComboBox.clear()
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
522
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
523 self.__removeDebugger(debuggerId)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
524
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
525 def __clientSyntaxError(self, message, filename, lineNo, characterNo,
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
526 debuggerId, threadName):
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
527 """
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
528 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
529
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
530 @param message message of the syntax error
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
531 @type str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
532 @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
533 @type str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
534 @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
535 @type int
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
536 @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
537 @type int
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
538 @param debuggerId ID of the debugger backend
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
539 @type str
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
540 @param threadName name of the thread signaling the event
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
541 @type str
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
542 """
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
543 self.__setDebuggerIconAndState(debuggerId, "syntax")
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
544 self.__setThreadIconAndState(debuggerId, threadName, "syntax")
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
545
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
546 def __clientException(self, exceptionType, exceptionMessage, stackTrace,
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
547 debuggerId, threadName):
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
548 """
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
549 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
550
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
551 @param exceptionType type of exception raised
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
552 @type str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
553 @param exceptionMessage message given by the exception
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
554 @type (str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
555 @param stackTrace list of stack entries
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
556 @type list of str
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
557 @param debuggerId ID of the debugger backend
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
558 @type str
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
559 @param threadName name of the thread signaling the event
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
560 @type str
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
561 """
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
562 self.__setDebuggerIconAndState(debuggerId, "exception")
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
563 self.__setThreadIconAndState(debuggerId, threadName, "exception")
7377
cc920e534ac0 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7376
diff changeset
564
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 def setVariablesFilter(self, globalsFilter, localsFilter):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
566 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
567 Public slot to set the local variables filter.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
568
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
569 @param globalsFilter filter list for global variable types
7862
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
570 @type list of str
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
571 @param localsFilter filter list for local variable types
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
572 @type list of str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
573 """
7862
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
574 self.__globalsFilter = globalsFilter
817ef8e0fa66 Debugger: changed the handling of variable type filters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
575 self.__localsFilter = localsFilter
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
576
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
577 def __showSource(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
578 """
2988
f53c03574697 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2953
diff changeset
579 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
580 file.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
581 """
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
582 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
583 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
584 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
585 self.sourceFile.emit(s[0], int(s[1]))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
586
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
587 def __frameSelected(self, frmnr):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
588 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
589 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
590
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
591 @param frmnr frame number (0 is the current frame)
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
592 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
593 """
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
594 if frmnr >= 0:
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
595 self.framenr = frmnr
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
596 if self.debugServer.isDebugging():
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
597 self.debugServer.remoteClientVariables(
7863
6725d2549801 Merged with the default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802 7862
diff changeset
598 self.getSelectedDebuggerId(), 0, self.__localsFilter,
6725d2549801 Merged with the default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802 7862
diff changeset
599 frmnr)
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
600
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
601 if self.__autoViewSource:
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
602 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
603
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
604 def setGlobalsFilter(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
605 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
606 Public slot to set the global variable filter.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
607 """
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
608 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
609 filterStr = self.globalsFilterEdit.text()
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
610 self.debugServer.remoteClientSetFilter(
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
611 self.getSelectedDebuggerId(), 1, filterStr)
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
612 self.debugServer.remoteClientVariables(
7863
6725d2549801 Merged with the default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802 7862
diff changeset
613 self.getSelectedDebuggerId(), 2, self.__globalsFilter)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
614
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
615 def setLocalsFilter(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
616 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
617 Public slot to set the local variable filter.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
618 """
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
619 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
620 filterStr = self.localsFilterEdit.text()
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
621 self.debugServer.remoteClientSetFilter(
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
622 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
623 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
624 self.debugServer.remoteClientVariables(
7863
6725d2549801 Merged with the default branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7802 7862
diff changeset
625 self.getSelectedDebuggerId(), 0, self.__localsFilter,
7379
72a72fd56494 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7377
diff changeset
626 self.framenr)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
627
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
628 def handleDebuggingStarted(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
629 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
630 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
631
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
632 This slot sets the variables filter expressions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
633 """
5165
37691caeec1a Added the capability to refresh the variables viewer via the context menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
634 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
635 self.setLocalsFilter()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
636 self.showVariablesTab(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
637
7707
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
638 self.disassemblyViewer.clear()
6abcf4275d0e Added a viewer to visualize Python byte code generated from a Python traceback of an exception as an additional tab of the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
639
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
640 def currentWidget(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
641 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
642 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
643
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
644 @return reference to the current widget
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
645 @rtype QWidget
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
646 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647 return self.__tabWidget.currentWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
648
821
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
649 def setCurrentWidget(self, widget):
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
650 """
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
651 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
652
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
653 @param widget reference to the widget
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
654 @type QWidget
821
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
655 """
4c4a4525e69a Added the forgotten "setCurrentWidget" slot to the debug viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
656 self.__tabWidget.setCurrentWidget(widget)
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
657
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
658 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
659 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
660 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
661 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
662
7882
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
663 @param frameNo frame number (index) of the selected entry
617cc27f11af Updated some source docu strings and added TODO markers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7881
diff changeset
664 @type int
2622
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
665 """
08cc2f31c983 Added a viewer for the call stack leading to the current line.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
666 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
667 self.stackComboBox.setCurrentIndex(frameNo)
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
668
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
669 def __debuggerSelected(self, current, previous):
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
670 """
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
671 Private slot to handle the selection of a debugger backend in the
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
672 debuggers list.
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
673
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
674 @param current reference to the new current item
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
675 @type QTreeWidgetItem
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
676 @param previous reference to the previous current item
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
677 @type QTreeWidgetItem
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
678 """
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
679 if current is not None and self.__doDebuggersListUpdate:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
680 if current.parent() is None:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
681 # it is a debugger item
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
682 debuggerId = current.text(0)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
683 self.globalsViewer.handleResetUI()
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
684 self.localsViewer.handleResetUI()
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
685 self.currentStack = None
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
686 self.stackComboBox.clear()
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
687 self.callStackViewer.clear()
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
688
7933
ca1b44d522b9 Debugger: did some fine tuning.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7932
diff changeset
689 self.debugServer.remoteSetThread(debuggerId, -1)
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
690 self.__showSource()
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
691 else:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
692 # it is a thread item
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
693 tid = current.data(0, self.ThreadIdRole)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
694 self.debugServer.remoteSetThread(
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
695 self.getSelectedDebuggerId(), tid)
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
696
7412
0a995393d2ba Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
697 def __clientDebuggerId(self, debuggerId):
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
698 """
7412
0a995393d2ba Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
699 Private slot to receive the ID of a newly connected debugger backend.
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
700
7412
0a995393d2ba Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
701 @param debuggerId ID of a newly connected debugger backend
0a995393d2ba Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
702 @type str
0a995393d2ba Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7411
diff changeset
703 """
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
704 itm = QTreeWidgetItem(self.__debuggersList, [debuggerId])
7903
827d89937c30 Fixed a few issues with the new multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7892
diff changeset
705 if self.__debuggersList.topLevelItemCount() > 1:
827d89937c30 Fixed a few issues with the new multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7892
diff changeset
706 self.debugUI.showNotification(
827d89937c30 Fixed a few issues with the new multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7892
diff changeset
707 self.tr("<p>Debugger with ID <b>{0}</b> has been connected."
827d89937c30 Fixed a few issues with the new multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7892
diff changeset
708 "</p>")
827d89937c30 Fixed a few issues with the new multi process debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7892
diff changeset
709 .format(debuggerId))
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
710
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
711 self.__debuggersList.header().resizeSections(
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
712 QHeaderView.ResizeToContents)
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
713
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
714 if self.__debuggersList.topLevelItemCount() == 1:
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
715 # it is the only item, select it as the current one
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
716 self.__debuggersList.setCurrentItem(itm)
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
717
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
718 def __setCurrentDebugger(self, debuggerId):
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
719 """
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
720 Private method to set the current debugger based on the given ID.
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
721
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
722 @param debuggerId ID of the debugger to set as current debugger
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
723 @type str
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
724 """
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
725 debuggerItems = self.__debuggersList.findItems(
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
726 debuggerId, Qt.MatchExactly)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
727 if debuggerItems:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
728 debuggerItem = debuggerItems[0]
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
729 currentItem = self.__debuggersList.currentItem()
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
730 if currentItem is debuggerItem:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
731 # nothing to do
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
732 return
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
733
7931
a761160bfde9 DebugViewer: fixed a bug selecting a debugger entry when there is no current item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
734 if currentItem:
a761160bfde9 DebugViewer: fixed a bug selecting a debugger entry when there is no current item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
735 currentParent = currentItem.parent()
a761160bfde9 DebugViewer: fixed a bug selecting a debugger entry when there is no current item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
736 else:
a761160bfde9 DebugViewer: fixed a bug selecting a debugger entry when there is no current item.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7928
diff changeset
737 currentParent = None
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
738 if currentParent is None:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
739 # current is a debugger item
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
740 self.__debuggersList.setCurrentItem(debuggerItem)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
741 elif currentParent is debuggerItem:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
742 # nothing to do
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
743 return
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
744 else:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
745 self.__debuggersList.setCurrentItem(debuggerItem)
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
746
7915
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
747 def isOnlyDebugger(self):
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
748 """
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
749 Public method to test, if only one debugger is connected.
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
750
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
751 @return flag indicating that only one debugger is connected
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
752 @rtype bool
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
753 """
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
754 return self.__debuggersList.topLevelItemCount() == 1
e68f5c568aee Debugger: fixed a few bugs introduced by the multi process debugger changes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7903
diff changeset
755
7374
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
756 def getSelectedDebuggerId(self):
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
757 """
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
758 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
759
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
760 @return selected debugger ID
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
761 @rtype str
5401ae8ddaa1 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
762 """
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
763 itm = self.__debuggersList.currentItem()
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
764 if itm:
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
765 if itm.parent() is None:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
766 # it is a debugger item
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
767 return itm.text(0)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
768 else:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
769 # it is a thread item
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
770 return itm.parent().text(0)
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
771 else:
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
772 return ""
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
773
7405
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
774 def getSelectedDebuggerState(self):
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
775 """
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
776 Public method to get the currently selected debugger's state.
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
777
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
778 @return selected debugger's state (broken, exception, running)
7405
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
779 @rtype str
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
780 """
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
781 itm = self.__debuggersList.currentItem()
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
782 if itm:
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
783 if itm.parent() is None:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
784 # it is a debugger item
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
785 return itm.data(0, self.DebuggerStateRole)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
786 else:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
787 # it is a thread item
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
788 return itm.parent().data(0, self.DebuggerStateRole)
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
789 else:
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
790 return ""
7405
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
791
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
792 def __setDebuggerIconAndState(self, debuggerId, state):
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
793 """
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
794 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
795
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
796 @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
797 currently selected one)
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
798 @type str
7411
6d8dcb3551b3 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7410
diff changeset
799 @param state state of the debugger (broken, exception, running)
7405
bf6be3cff6cf Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7389
diff changeset
800 @type str
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
801 """
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
802 debuggerItem = None
7389
770ffcb88be5 Continued with the multiprocess debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7379
diff changeset
803 if debuggerId:
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
804 foundItems = self.__debuggersList.findItems(
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
805 debuggerId, Qt.MatchExactly)
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
806 if foundItems:
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
807 debuggerItem = foundItems[0]
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
808 if debuggerItem is None:
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
809 debuggerItem = self.__debuggersList.currentItem()
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
810 if debuggerItem is not None:
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
811 try:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
812 iconName = DebugViewer.StateIcon[state]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
813 except KeyError:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
814 iconName = "question"
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
815 try:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
816 stateText = DebugViewer.StateMessage[state]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
817 except KeyError:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
818 stateText = self.tr("unknown state ({0})").format(state)
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
819 debuggerItem.setIcon(0, UI.PixmapCache.getIcon(iconName))
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
820 debuggerItem.setData(0, self.DebuggerStateRole, state)
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
821 debuggerItem.setText(1, stateText)
7881
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
822
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
823 self.__debuggersList.header().resizeSections(
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
824 QHeaderView.ResizeToContents)
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
825
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
826 def __removeDebugger(self, debuggerId):
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
827 """
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
828 Private method to remove a debugger given its ID.
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
829
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
830 @param debuggerId ID of the debugger to be removed from the list
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
831 @type str
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
832 """
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
833 foundItems = self.__debuggersList.findItems(
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
834 debuggerId, Qt.MatchExactly)
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
835 if foundItems:
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
836 index = self.__debuggersList.indexOfTopLevelItem(foundItems[0])
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
837 itm = self.__debuggersList.takeTopLevelItem(index)
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
838 # __IGNORE_WARNING__
6c09c023cda5 DebugViewer: changed the debugger selector to a list.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7879
diff changeset
839 del itm
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
840
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
841 def __addThreadList(self, currentID, threadList, debuggerId):
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
842 """
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
843 Private method to add the list of threads to a debugger entry.
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
844
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
845 @param currentID id of the current thread
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
846 @type int
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
847 @param threadList list of dictionaries containing the thread data
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
848 @type list of dict
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
849 @param debuggerId ID of the debugger backend
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
850 @type str
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
851 """
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
852 debugStatus = -1 # i.e. running
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
853
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
854 debuggerItems = self.__debuggersList.findItems(
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
855 debuggerId, Qt.MatchExactly)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
856 if debuggerItems:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
857 debuggerItem = debuggerItems[0]
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
858
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
859 currentItem = self.__debuggersList.currentItem()
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
860 if currentItem.parent() is debuggerItem:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
861 currentChild = currentItem.text(0)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
862 else:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
863 currentChild = ""
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
864 self.__doDebuggersListUpdate = False
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
865 debuggerItem.takeChildren()
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
866 for thread in threadList:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
867 if thread.get('except', False):
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
868 stateText = DebugViewer.StateMessage["exception"]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
869 iconName = DebugViewer.StateIcon["exception"]
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
870 debugStatus = 1
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
871 elif thread['broken']:
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
872 stateText = DebugViewer.StateMessage["broken"]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
873 iconName = DebugViewer.StateIcon["broken"]
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
874 if debugStatus < 1:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
875 debugStatus = 0
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
876 else:
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
877 stateText = DebugViewer.StateMessage["running"]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
878 iconName = DebugViewer.StateIcon["running"]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
879 itm = QTreeWidgetItem(debuggerItem,
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
880 [thread['name'], stateText])
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
881 itm.setData(0, self.ThreadIdRole, thread['id'])
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
882 itm.setIcon(0, UI.PixmapCache.getIcon(iconName))
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
883 if currentChild == thread['name']:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
884 self.__debuggersList.setCurrentItem(itm)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
885 if thread['id'] == currentID:
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
886 font = debuggerItem.font(0)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
887 font.setItalic(True)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
888 itm.setFont(0, font)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
889
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
890 debuggerItem.setExpanded(debuggerItem.childCount() > 0)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
891
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
892 self.__debuggersList.header().resizeSections(
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
893 QHeaderView.ResizeToContents)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
894 self.__debuggersList.header().setStretchLastSection(True)
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
895 self.__doDebuggersListUpdate = True
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
896
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
897 if debugStatus == -1:
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
898 debuggerState = "running"
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
899 elif debugStatus == 0:
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
900 debuggerState = "broken"
7920
322d1ee01510 DebugViewer: united the debuggers and threads lists.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7915
diff changeset
901 else:
7986
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
902 debuggerState = "exception"
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
903 self.__setDebuggerIconAndState(debuggerId, debuggerState)
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
904
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
905 def __setThreadIconAndState(self, debuggerId, threadName, state):
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
906 """
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
907 Private method to set the icon for a specific thread name and
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
908 debugger ID.
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
909
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
910 @param debuggerId ID of the debugger backend (empty ID means the
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
911 currently selected one)
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
912 @type str
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
913 @param threadName name of the thread signaling the event
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
914 @type str
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
915 @param state state of the debugger (broken, exception, running)
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
916 @type str
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
917 """
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
918 debuggerItem = None
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
919 if debuggerId:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
920 foundItems = self.__debuggersList.findItems(
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
921 debuggerId, Qt.MatchExactly)
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
922 if foundItems:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
923 debuggerItem = foundItems[0]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
924 if debuggerItem is None:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
925 debuggerItem = self.__debuggersList.currentItem()
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
926 if debuggerItem is not None:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
927 for index in range(debuggerItem.childCount()):
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
928 childItem = debuggerItem.child(index)
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
929 if childItem.text(0) == threadName:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
930 break
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
931 else:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
932 childItem = None
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
933
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
934 if childItem is not None:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
935 try:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
936 iconName = DebugViewer.StateIcon[state]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
937 except KeyError:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
938 iconName = "question"
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
939 try:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
940 stateText = DebugViewer.StateMessage[state]
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
941 except KeyError:
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
942 stateText = self.tr("unknown state ({0})").format(state)
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
943 childItem.setIcon(0, UI.PixmapCache.getIcon(iconName))
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
944 childItem.setText(1, stateText)
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
945
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
946 self.__debuggersList.header().resizeSections(
2971d5d19951 Fixed a few thread related issues in the debugger.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7933
diff changeset
947 QHeaderView.ResizeToContents)

eric ide

mercurial