Debugger/DebugViewer.py

changeset 2622
08cc2f31c983
parent 2400
c1726b754f96
child 2677
3d4277929fb3
child 2723
f6ad272bf486
equal deleted inserted replaced
2621:ab5918079c38 2622:08cc2f31c983
174 index = self.__tabWidget.addTab(self.lvWidget, 174 index = self.__tabWidget.addTab(self.lvWidget,
175 UI.PixmapCache.getIcon("localVariables.png"), '') 175 UI.PixmapCache.getIcon("localVariables.png"), '')
176 self.__tabWidget.setTabToolTip(index, self.localsViewer.windowTitle()) 176 self.__tabWidget.setTabToolTip(index, self.localsViewer.windowTitle())
177 177
178 self.sourceButton.clicked[()].connect(self.__showSource) 178 self.sourceButton.clicked[()].connect(self.__showSource)
179 self.stackComboBox.activated[int].connect(self.__frameSelected) 179 self.stackComboBox.currentIndexChanged[int].connect(self.__frameSelected)
180 self.setLocalsFilterButton.clicked[()].connect(self.__setLocalsFilter) 180 self.setLocalsFilterButton.clicked[()].connect(self.__setLocalsFilter)
181 self.localsFilterEdit.returnPressed.connect(self.__setLocalsFilter) 181 self.localsFilterEdit.returnPressed.connect(self.__setLocalsFilter)
182
183 from .CallStackViewer import CallStackViewer
184 # add the call stack viewer
185 self.callStackViewer = CallStackViewer(self.debugServer)
186 index = self.__tabWidget.addTab(self.callStackViewer,
187 UI.PixmapCache.getIcon("step.png"), "")
188 self.__tabWidget.setTabToolTip(index, self.callStackViewer.windowTitle())
189 self.callStackViewer.sourceFile.connect(self.sourceFile)
190 self.callStackViewer.frameSelected.connect(self.__callStackFrameSelected)
182 191
183 from .CallTraceViewer import CallTraceViewer 192 from .CallTraceViewer import CallTraceViewer
184 # add the call trace viewer 193 # add the call trace viewer
185 self.callTraceViewer = CallTraceViewer(self.debugServer) 194 self.callTraceViewer = CallTraceViewer(self.debugServer)
186 index = self.__tabWidget.addTab(self.callTraceViewer, 195 index = self.__tabWidget.addTab(self.callTraceViewer,
253 262
254 def setDebugger(self, debugUI): 263 def setDebugger(self, debugUI):
255 """ 264 """
256 Public method to set a reference to the Debug UI. 265 Public method to set a reference to the Debug UI.
257 266
258 @param debugUI reference to the DebugUI objectTrees 267 @param debugUI reference to the DebugUI object (DebugUI)
259 """ 268 """
260 self.debugUI = debugUI 269 self.debugUI = debugUI
261 self.debugUI.clientStack.connect(self.handleClientStack) 270 self.debugUI.clientStack.connect(self.handleClientStack)
271 self.callStackViewer.setDebugger(debugUI)
262 272
263 def handleResetUI(self): 273 def handleResetUI(self):
264 """ 274 """
265 Public method to reset the SBVviewer. 275 Public method to reset the SBVviewer.
266 """ 276 """
285 """ 295 """
286 if self.embeddedShell: 296 if self.embeddedShell:
287 self.saveCurrentPage() 297 self.saveCurrentPage()
288 self.__tabWidget.setCurrentWidget(self.shellAssembly) 298 self.__tabWidget.setCurrentWidget(self.shellAssembly)
289 299
300 def initCallStackViewer(self, projectMode):
301 """
302 Public method to initialize the call stack viewer.
303
304 @param projectMode flag indicating to enable the project mode (boolean)
305 """
306 self.callStackViewer.clear()
307 self.callStackViewer.setProjectMode(projectMode)
308
290 def isCallTraceEnabled(self): 309 def isCallTraceEnabled(self):
291 """ 310 """
292 Public method to get the state of the call trace function. 311 Public method to get the state of the call trace function.
293 312
294 @return flag indicating the state of the call trace function (boolean) 313 @return flag indicating the state of the call trace function (boolean)
361 self.__tabWidget.setCurrentWidget(self.currPage) 380 self.__tabWidget.setCurrentWidget(self.currPage)
362 381
363 def handleClientStack(self, stack): 382 def handleClientStack(self, stack):
364 """ 383 """
365 Public slot to show the call stack of the program being debugged. 384 Public slot to show the call stack of the program being debugged.
385
386 @param stack list of tuples with call stack data (file name, line number,
387 function name, formatted argument/values list)
366 """ 388 """
367 self.framenr = 0 389 self.framenr = 0
368 self.stackComboBox.clear() 390 self.stackComboBox.clear()
369 self.currentStack = stack 391 self.currentStack = stack
370 self.sourceButton.setEnabled(len(stack) > 0) 392 self.sourceButton.setEnabled(len(stack) > 0)
482 @param previous reference to the previous current item (QTreeWidgetItem) 504 @param previous reference to the previous current item (QTreeWidgetItem)
483 """ 505 """
484 if current is not None and self.__doThreadListUpdate: 506 if current is not None and self.__doThreadListUpdate:
485 tid = int(current.text(0)) 507 tid = int(current.text(0))
486 self.debugServer.remoteSetThread(tid) 508 self.debugServer.remoteSetThread(tid)
509
510 def __callStackFrameSelected(self, frameNo):
511 """
512 Private slot to handle the selection of a call stack entry of the
513 call stack viewer.
514
515 @param frameNo frame number (index) of the selected entry (integer)
516 """
517 if frameNo >= 0:
518 self.stackComboBox.setCurrentIndex(frameNo)

eric ide

mercurial