eric6/Debugger/DebugViewer.py

branch
multi_processing
changeset 7405
bf6be3cff6cf
parent 7389
770ffcb88be5
child 7407
a0b6acee2c20
equal deleted inserted replaced
7404:663f1c3d6f53 7405:bf6be3cff6cf
430 @param line linenumber 430 @param line linenumber
431 @type int 431 @type int
432 @param debuggerId ID of the debugger backend 432 @param debuggerId ID of the debugger backend
433 @type str 433 @type str
434 """ 434 """
435 self.__setDebuggerIcon(debuggerId, "exceptions") 435 self.__setDebuggerIconAndState(debuggerId, "mediaPlaybackPause", "broken")
436 436
437 def __clientSyntaxError(self, message, filename, lineNo, characterNo, 437 def __clientSyntaxError(self, message, filename, lineNo, characterNo,
438 debuggerId): 438 debuggerId):
439 """ 439 """
440 Private method to handle a syntax error in the debugged program. 440 Private method to handle a syntax error in the debugged program.
448 @param characterNo character number of the syntax error position 448 @param characterNo character number of the syntax error position
449 @type int 449 @type int
450 @param debuggerId ID of the debugger backend 450 @param debuggerId ID of the debugger backend
451 @type str 451 @type str
452 """ 452 """
453 self.__setDebuggerIcon(debuggerId, "syntaxError22") 453 self.__setDebuggerIconAndState(debuggerId, "syntaxError22", "exception")
454 454
455 def __clientException(self, exceptionType, exceptionMessage, stackTrace, 455 def __clientException(self, exceptionType, exceptionMessage, stackTrace,
456 debuggerId): 456 debuggerId):
457 """ 457 """
458 Private method to handle an exception of the debugged program. 458 Private method to handle an exception of the debugged program.
464 @param stackTrace list of stack entries 464 @param stackTrace list of stack entries
465 @type list of str 465 @type list of str
466 @param debuggerId ID of the debugger backend 466 @param debuggerId ID of the debugger backend
467 @type str 467 @type str
468 """ 468 """
469 self.__setDebuggerIcon(debuggerId, "exceptions") 469 self.__setDebuggerIconAndState(debuggerId, "exceptions", "exception")
470 470
471 def setVariablesFilter(self, globalsFilter, localsFilter): 471 def setVariablesFilter(self, globalsFilter, localsFilter):
472 """ 472 """
473 Public slot to set the local variables filter. 473 Public slot to set the local variables filter.
474 474
607 if debugStatus < 1: 607 if debugStatus < 1:
608 debugStatus = 0 608 debugStatus = 0
609 609
610 if debugStatus == -1: 610 if debugStatus == -1:
611 icon = "mediaPlaybackStart" 611 icon = "mediaPlaybackStart"
612 state = "running"
612 elif debugStatus == 0: 613 elif debugStatus == 0:
613 icon = "mediaPlaybackPause" 614 icon = "mediaPlaybackPause"
615 state = "broken"
614 else: 616 else:
615 icon = "exceptions" 617 icon = "exceptions"
616 self.__setDebuggerIcon("", icon) 618 state = "exception"
619 self.__setDebuggerIconAndState("", icon, state)
617 620
618 def __threadSelected(self, current, previous): 621 def __threadSelected(self, current, previous):
619 """ 622 """
620 Private slot to handle the selection of a thread in the thread list. 623 Private slot to handle the selection of a thread in the thread list.
621 624
651 self.stackComboBox.clear() 654 self.stackComboBox.clear()
652 self.__threadList.clear() 655 self.__threadList.clear()
653 self.callStackViewer.clear() 656 self.callStackViewer.clear()
654 657
655 self.debugUI.getDebuggerData(debuggerId) 658 self.debugUI.getDebuggerData(debuggerId)
659 self.debugUI.setDebugActionsEnabled(
660 self.getSelectedDebuggerState() != "running")
661 self.__showSource()
656 662
657 def showDebuggersList(self, debuggerIds): 663 def showDebuggersList(self, debuggerIds):
658 """ 664 """
659 Public slot to receive the list of debugger backend IDs. 665 Public slot to receive the list of debugger backend IDs.
660 666
680 @return selected debugger ID 686 @return selected debugger ID
681 @rtype str 687 @rtype str
682 """ 688 """
683 return self.__debuggersCombo.currentText() 689 return self.__debuggersCombo.currentText()
684 690
685 def __setDebuggerIcon(self, debuggerId, iconName): 691 def getSelectedDebuggerState(self):
692 """
693 Public method to get the currently selected debugger's state.
694
695 @return selected debugger's state (running, broken, exception)
696 @rtype str
697 """
698 return self.__debuggersCombo.currentData()
699
700 def __setDebuggerIconAndState(self, debuggerId, iconName, state):
686 """ 701 """
687 Private method to set the icon for a specific debugger ID. 702 Private method to set the icon for a specific debugger ID.
688 703
689 @param debuggerId ID of the debugger backend (empty ID means the 704 @param debuggerId ID of the debugger backend (empty ID means the
690 currently selected one) 705 currently selected one)
691 @type str 706 @type str
692 @param iconName name of the icon to be used 707 @param iconName name of the icon to be used
708 @type str
709 @param state state of the debugger (running, broken, exception)
693 @type str 710 @type str
694 """ 711 """
695 if debuggerId: 712 if debuggerId:
696 index = self.__debuggersCombo.findText(debuggerId, Qt.MatchExactly) 713 index = self.__debuggersCombo.findText(debuggerId, Qt.MatchExactly)
697 else: 714 else:
698 index = self.__debuggersCombo.currentIndex() 715 index = self.__debuggersCombo.currentIndex()
699 if index >= 0: 716 if index >= 0:
700 self.__debuggersCombo.setItemIcon( 717 self.__debuggersCombo.setItemIcon(
701 index, UI.PixmapCache.getIcon(iconName)) 718 index, UI.PixmapCache.getIcon(iconName))
719 self.__debuggersCombo.setItemData(index, state)

eric ide

mercurial