Debugger/DebugViewer.py

branch
Py2 comp.
changeset 2791
a9577f248f04
parent 2677
3d4277929fb3
parent 2766
c413e9eeaf95
child 2847
1843ef6e2656
equal deleted inserted replaced
2790:6686a3326df8 2791:a9577f248f04
276 """ 276 """
277 Public method to reset the SBVviewer. 277 Public method to reset the SBVviewer.
278 """ 278 """
279 self.globalsViewer.handleResetUI() 279 self.globalsViewer.handleResetUI()
280 self.localsViewer.handleResetUI() 280 self.localsViewer.handleResetUI()
281 self.stackComboBox.clear()
282 self.sourceButton.setEnabled(False) 281 self.sourceButton.setEnabled(False)
283 self.currentStack = None 282 self.currentStack = None
283 self.stackComboBox.clear()
284 self.__threadList.clear() 284 self.__threadList.clear()
285 if self.embeddedShell: 285 if self.embeddedShell:
286 self.__tabWidget.setCurrentWidget(self.shellAssembly) 286 self.__tabWidget.setCurrentWidget(self.shellAssembly)
287 else: 287 else:
288 if self.embeddedBrowser: 288 if self.embeddedBrowser:
386 Public slot to show the call stack of the program being debugged. 386 Public slot to show the call stack of the program being debugged.
387 387
388 @param stack list of tuples with call stack data (file name, line number, 388 @param stack list of tuples with call stack data (file name, line number,
389 function name, formatted argument/values list) 389 function name, formatted argument/values list)
390 """ 390 """
391 block = self.stackComboBox.blockSignals(True)
391 self.framenr = 0 392 self.framenr = 0
392 self.stackComboBox.clear() 393 self.stackComboBox.clear()
393 self.currentStack = stack 394 self.currentStack = stack
394 self.sourceButton.setEnabled(len(stack) > 0) 395 self.sourceButton.setEnabled(len(stack) > 0)
395 for s in stack: 396 for s in stack:
396 # just show base filename to make it readable 397 # just show base filename to make it readable
397 s = (os.path.basename(s[0]), s[1], s[2]) 398 s = (os.path.basename(s[0]), s[1], s[2])
398 self.stackComboBox.addItem('{0}:{1}:{2}'.format(*s)) 399 self.stackComboBox.addItem('{0}:{1}:{2}'.format(*s))
400 self.stackComboBox.blockSignals(block)
399 401
400 def setVariablesFilter(self, globalsFilter, localsFilter): 402 def setVariablesFilter(self, globalsFilter, localsFilter):
401 """ 403 """
402 Public slot to set the local variables filter. 404 Public slot to set the local variables filter.
403 405
409 411
410 def __showSource(self): 412 def __showSource(self):
411 """ 413 """
412 Private slot to handle the source button press to show the selected file. 414 Private slot to handle the source button press to show the selected file.
413 """ 415 """
414 s = self.currentStack[self.stackComboBox.currentIndex()] 416 index = self.stackComboBox.currentIndex()
415 self.sourceFile.emit(s[0], int(s[1])) 417 if index > -1 and self.currentStack:
418 s = self.currentStack[index]
419 self.sourceFile.emit(s[0], int(s[1]))
416 420
417 def __frameSelected(self, frmnr): 421 def __frameSelected(self, frmnr):
418 """ 422 """
419 Private slot to handle the selection of a new stack frame number. 423 Private slot to handle the selection of a new stack frame number.
420 424

eric ide

mercurial