# eric7.Debugger.DebugUI

Module implementing the debugger UI.

### Global Attributes

None

### Classes

DebugUI | Class implementing the debugger part of the UI.

### Functions

None

## DebugUI

Class implementing the debugger part of the UI.

### Signals

clientStack(stack, debuggerId)
  emitted at breaking after a reported exception
debuggingFinished
  emitted to signal the end of a debugging session
debuggingStarted(filename)
  emitted when a debugging session was started
exceptionInterrupt()
  emitted after the execution was interrupted by an exception and acknowledged by the user
processChangedProjectFiles()
  emitted to indicate, that changed project files should be processed
resetUI(full)
  emitted to reset the UI partially or fully

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

DebugUI | Constructor
__applyVariablesFilters | Private slot to apply the given variables filter lists.
__breakpointSelected | Private method to handle the breakpoint selected signal.
__checkActions | Private slot to check some actions for their enable/disable status.
__clearBreakpoints | Private slot to handle the 'Clear breakpoints' action.
__clientBreakConditionError | Private method to handle a condition error of a breakpoint.
__clientDebuggerId | Private slot to track the list of connected debuggers.
__clientDisconnected | Private slot to handle a debug client disconnecting its control socket.
__clientException | Private method to handle an exception of the debugged program.
__clientExit | Private slot to handle the debugged program terminating.
__clientGone | Private method to handle the disconnection of the debugger client.
__clientLine | Private method to handle a change to the current line.
__clientSignal | Private method to handle a signal generated on the client side.
__clientSyntaxError | Private method to handle a syntax error in the debugged program.
__clientThreadSet | Private method to handle a change of the client's current thread.
__clientVariable | Private method to write the contents of a clients classvariable to the user interface.
__clientVariables | Private method to write the clients variables to the user interface.
__clientWatchConditionError | Private method to handle a expression error of a watch expression.
__configureExceptionsFilter | Private slot for displaying the exception filter dialog.
__configureIgnoredExceptions | Private slot for displaying the ignored exceptions dialog.
__configureVariablesFilters | Private slot for displaying the variables filter configuration dialog.
__continue | Private method to handle the Continue action.
__coverageProject | Private slot to handle the coverage of project action.
__coverageScript | Private slot to handle the coverage of script action.
__cursorChanged | Private slot handling the cursorChanged signal of the viewmanager.
__debugProject | Private slot to handle the debug project action.
__debugScript | Private slot to handle the debug script action.
__doRestart | Private slot to handle the restart action to restart the last debugged file.
__editBreakpoint | Private slot to handle the 'Edit breakpoint' action.
__editorOpened | Private slot to handle the editorOpened signal.
__enterRemote | Private method to update the user interface.
__getClientDisassembly | Private method to ask the client for the latest traceback disassembly.
__getClientVariables | Private method to request the global and local variables.
__getThreadList | Private method to get the list of threads from the client.
__lastEditorClosed | Private slot to handle the closeProgram signal.
__mainClientExit | Private slot handling the exit of the last client.
__moveInstructionPointer | Private method to move the instruction pointer to a different line.
__nextBreakpoint | Private slot to handle the 'Next breakpoint' action.
__passiveDebugStarted | Private slot to handle a passive debug session start.
__previousBreakpoint | Private slot to handle the 'Previous breakpoint' action.
__profileProject | Private slot to handle the profile project action.
__profileScript | Private slot to handle the profile script action.
__projectClosed | Private slot to handle the projectClosed signal.
__projectOpened | Private slot to handle the projectOpened signal.
__resetUI | Private slot to reset the user interface.
__runProject | Private slot to handle the run project action.
__runScript | Private slot to handle the run script action.
__runToCursor | Private method to handle the Run to Cursor action.
__runUntil | Private method to handle the Run Until action.
__showBreakpointsMenu | Private method to handle the show breakpoints menu signal.
__showDebugMenu | Private method to set up the debug menu.
__showNotConnectedWarning | Private method to show a warning about a not connected eric-ide server.
__specialContinue | Private method to handle the Special Continue action.
__step | Private method to handle the Step action.
__stepOut | Private method to handle the Step Out action.
__stepOver | Private method to handle the Step Over action.
__stepQuit | Private method to handle the Step Quit action.
__stopScript | Private slot to stop the running script.
__toggleBreakpoint | Private slot to handle the 'Set/Reset breakpoint' action.
clearHistories | Public method to clear the various debug histories.
debugInternalScript | Public method to run an internal script with debugger support.
doCoverage | Public method to handle the coverage actions.
doDebug | Public method to handle the debug actions.
doProfile | Public method to handle the profile actions.
doRun | Public method to handle the run actions.
getActions | Public method to get a list of all actions.
getProjectEnvironmentString | Public method to get the string for the project environment.
getSelectedDebuggerId | Public method to get the currently selected debugger ID.
initActions | Public method defining the user interface actions.
initMenus | Public slot to initialize the project menu.
initToolbars | Public slot to initialize the debug toolbars.
setArgvHistory | Public slot to initialize the argv history.
setAutoClearShell | Public slot to initialize the autoClearShell flag.
setAutoContinue | Public slot to initialize the autoContinue flag.
setDebugActionsEnabled | Public method to set the enabled state of the debug actions.
setEnableGlobalConfigOverride | Public method to initialize the global config override data.
setEnableMultiprocess | Public slot to initialize the enableMultiprocess flag.
setEnvHistory | Public slot to initialize the env history.
setExcIgnoreList | Public slot to initialize the ignored exceptions type list.
setExcList | Public slot to initialize the exceptions type list.
setExceptionReporting | Public slot to initialize the exception reporting flag.
setMultiprocessNoDebugHistory | Public slot to initialize the no debug list history.
setScriptsHistory | Public slot to initialize the scripts history.
setTracePython | Public slot to initialize the trace Python flag.
setWdHistory | Public slot to initialize the wd history.
showNotification | Public method to show some notification message.
shutdown | Public method to perform shutdown actions.
shutdownServer | Public method to shut down the debug server.
variablesFilter | Public method to get the variables filter for a scope.

### Static Methods

None

#### DebugUI (Constructor)

DebugUI(ui, vm, debugServer, debugViewer, project)

Constructor

ui (UserInterface)
  reference to the main UI
vm (ViewManager)
  reference to the viewmanager
debugServer (DebugServer)
  reference to the debug server
debugViewer (DebugViewer)
  reference to the debug viewer widget
project (Project)
  reference to the project object

#### DebugUI.__applyVariablesFilters

__applyVariablesFilters(localsFilter, globalsFilter)

Private slot to apply the given variables filter lists.

localsFilter (list of str)
  variables filter for the local variables
globalsFilter (list of str)
  variables filter for the global variables

#### DebugUI.__breakpointSelected

__breakpointSelected(act)

Private method to handle the breakpoint selected signal.

act (QAction)
  reference to the action that triggered

#### DebugUI.__checkActions

__checkActions(editor)

Private slot to check some actions for their enable/disable status.

editor (Editor)
  editor window

#### DebugUI.__clearBreakpoints

__clearBreakpoints()

Private slot to handle the 'Clear breakpoints' action.

#### DebugUI.__clientBreakConditionError

__clientBreakConditionError(filename, lineno, _debuggerId)

Private method to handle a condition error of a breakpoint.

filename (str)
  filename of the breakpoint
lineno (int)
  line umber of the breakpoint
_debuggerId (str)
  ID of the debugger backend (unused)

#### DebugUI.__clientDebuggerId

__clientDebuggerId(debuggerId)

Private slot to track the list of connected debuggers.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__clientDisconnected

__clientDisconnected(debuggerId)

Private slot to handle a debug client disconnecting its control socket.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__clientException

__clientException(exceptionType, exceptionMessage, stackTrace, debuggerId)

Private method to handle an exception of the debugged program.

exceptionType (str)
  type of exception raised
exceptionMessage ((str)
  message given by the exception
stackTrace (list of str)
  list of stack entries
debuggerId (str)
  ID of the debugger backend

#### DebugUI.__clientExit

__clientExit(program, status, message, quiet, debuggerId)

Private slot to handle the debugged program terminating.

program (str)
  name of the exited program
status (int)
  exit code of the debugged program
message (str)
  exit message of the debugged program
quiet (bool)
  flag indicating to suppress exit info display
debuggerId (str)
  ID of the debugger backend

#### DebugUI.__clientGone

__clientGone(unplanned)

Private method to handle the disconnection of the debugger client.

unplanned (bool)
  True if the client died, False otherwise

#### DebugUI.__clientLine

__clientLine(fn, line, debuggerId, _threadName, forStack)

Private method to handle a change to the current line.

fn (str)
  filename
line (int)
  linenumber
debuggerId (str)
  ID of the debugger backend
_threadName (str)
  name of the thread signaling the event (unused)
forStack (bool)
  flag indicating this is for a stack dump

#### DebugUI.__clientSignal

__clientSignal(message, filename, lineNo, _funcName, _funcArgs, _debuggerId)

Private method to handle a signal generated on the client side.

message (str)
  message of the syntax error
filename (str)
  translated filename of the syntax error position
lineNo (int)
  line number of the syntax error position
_funcName (str)
  name of the function causing the signal (unused)
_funcArgs (str)
  function arguments (unused)
_debuggerId (str)
  ID of the debugger backend (unused)

#### DebugUI.__clientSyntaxError

__clientSyntaxError(message, filename, lineNo, characterNo)

Private method to handle a syntax error in the debugged program.

message (str)
  message of the syntax error
filename (str)
  translated filename of the syntax error position
lineNo (int)
  line number of the syntax error position
characterNo (int)
  character number of the syntax error position

#### DebugUI.__clientThreadSet

__clientThreadSet(debuggerId)

Private method to handle a change of the client's current thread.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__clientVariable

__clientVariable(scope, variables, debuggerId)

Private method to write the contents of a clients classvariable to the user interface.

scope (int)
  scope of the variables (-1 = empty locals, 1 = global, 0 = local)
variables (list)
  the list of variables from the client
debuggerId (str)
  ID of the debugger backend

#### DebugUI.__clientVariables

__clientVariables(scope, variables, debuggerId)

Private method to write the clients variables to the user interface.

scope (int)
  scope of the variables (-2 = no frame found, -1 = empty locals, 1 = global, 0 = local)
variables (list)
  the list of variables from the client
debuggerId (str)
  ID of the debugger backend

#### DebugUI.__clientWatchConditionError

__clientWatchConditionError(cond, _debuggerId)

Private method to handle a expression error of a watch expression.

Note: This can only happen for normal watch expressions

cond (str)
  expression of the watch expression
_debuggerId (str)
  ID of the debugger backend (unused)

#### DebugUI.__configureExceptionsFilter

__configureExceptionsFilter()

Private slot for displaying the exception filter dialog.

#### DebugUI.__configureIgnoredExceptions

__configureIgnoredExceptions()

Private slot for displaying the ignored exceptions dialog.

#### DebugUI.__configureVariablesFilters

__configureVariablesFilters()

Private slot for displaying the variables filter configuration dialog.

#### DebugUI.__continue

__continue(debuggerId="")

Private method to handle the Continue action.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__coverageProject

__coverageProject()

Private slot to handle the coverage of project action.

#### DebugUI.__coverageScript

__coverageScript()

Private slot to handle the coverage of script action.

#### DebugUI.__cursorChanged

__cursorChanged(editor)

Private slot handling the cursorChanged signal of the viewmanager.

editor (Editor)
  editor window

#### DebugUI.__debugProject

__debugProject()

Private slot to handle the debug project action.

#### DebugUI.__debugScript

__debugScript()

Private slot to handle the debug script action.

#### DebugUI.__doRestart

__doRestart()

Private slot to handle the restart action to restart the last debugged file.

#### DebugUI.__editBreakpoint

__editBreakpoint()

Private slot to handle the 'Edit breakpoint' action.

#### DebugUI.__editorOpened

__editorOpened(fn)

Private slot to handle the editorOpened signal.

fn (str)
  filename of the opened editor

#### DebugUI.__enterRemote

__enterRemote()

Private method to update the user interface.

This method is called just prior to executing some of the program being debugged.

#### DebugUI.__getClientDisassembly

__getClientDisassembly(debuggerId)

Private method to ask the client for the latest traceback disassembly.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__getClientVariables

__getClientVariables(debuggerId)

Private method to request the global and local variables.

In the first step, the global variables are requested from the client. Once these have been received, the local variables are requested. This happens in the method '__clientVariables'.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__getThreadList

__getThreadList(debuggerId)

Private method to get the list of threads from the client.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__lastEditorClosed

__lastEditorClosed()

Private slot to handle the closeProgram signal.

#### DebugUI.__mainClientExit

__mainClientExit()

Private slot handling the exit of the last client.

#### DebugUI.__moveInstructionPointer

__moveInstructionPointer(debuggerId="")

Private method to move the instruction pointer to a different line.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__nextBreakpoint

__nextBreakpoint()

Private slot to handle the 'Next breakpoint' action.

#### DebugUI.__passiveDebugStarted

__passiveDebugStarted(fn, exc)

Private slot to handle a passive debug session start.

fn (str)
  filename of the debugged script
exc (bool)
  flag to enable exception reporting of the IDE

#### DebugUI.__previousBreakpoint

__previousBreakpoint()

Private slot to handle the 'Previous breakpoint' action.

#### DebugUI.__profileProject

__profileProject()

Private slot to handle the profile project action.

#### DebugUI.__profileScript

__profileScript()

Private slot to handle the profile script action.

#### DebugUI.__projectClosed

__projectClosed()

Private slot to handle the projectClosed signal.

#### DebugUI.__projectOpened

__projectOpened()

Private slot to handle the projectOpened signal.

#### DebugUI.__resetUI

__resetUI(fullReset=True)

Private slot to reset the user interface.

fullReset (bool)
  flag indicating a full reset is required

#### DebugUI.__runProject

__runProject()

Private slot to handle the run project action.

#### DebugUI.__runScript

__runScript()

Private slot to handle the run script action.

#### DebugUI.__runToCursor

__runToCursor(debuggerId="")

Private method to handle the Run to Cursor action.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__runUntil

__runUntil(debuggerId="")

Private method to handle the Run Until action.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__showBreakpointsMenu

__showBreakpointsMenu()

Private method to handle the show breakpoints menu signal.

#### DebugUI.__showDebugMenu

__showDebugMenu()

Private method to set up the debug menu.

#### DebugUI.__showNotConnectedWarning

__showNotConnectedWarning(title, name="")

Private method to show a warning about a not connected eric-ide server.

title (str)
  title for the dialog
name (str (optional))
  name of the file (defaults to "")

#### DebugUI.__specialContinue

__specialContinue(debuggerId="")

Private method to handle the Special Continue action.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__step

__step(debuggerId="")

Private method to handle the Step action.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__stepOut

__stepOut(debuggerId="")

Private method to handle the Step Out action.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__stepOver

__stepOver(debuggerId="")

Private method to handle the Step Over action.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__stepQuit

__stepQuit(debuggerId="")

Private method to handle the Step Quit action.

debuggerId (str)
  ID of the debugger backend

#### DebugUI.__stopScript

__stopScript()

Private slot to stop the running script.

#### DebugUI.__toggleBreakpoint

__toggleBreakpoint()

Private slot to handle the 'Set/Reset breakpoint' action.

#### DebugUI.clearHistories

clearHistories()

Public method to clear the various debug histories.

#### DebugUI.debugInternalScript

debugInternalScript(venvName, scriptName, argv, workDir, environment, clientType, forProject)

Public method to run an internal script with debugger support.

venvName (str)
  name of the environment for the debug tests run
scriptName (str)
  name of the internal script to be run
argv (str or list of str)
  string or list containing the parameters for the script
workDir (str)
  working directory for the script
environment (str or dict)
  environment parameter override for the debug run
clientType (str)
  type (language) of the debug client to be used
forProject (bool)
  flag indicating a project related debug session

#### DebugUI.doCoverage

doCoverage(runProject, script="")

Public method to handle the coverage actions.

runProject (bool)
  flag indicating coverage of the current project (True) or script (false)
script (str)
  name of a script (optional)

#### DebugUI.doDebug

doDebug(debugProject, script="")

Public method to handle the debug actions.

debugProject (bool)
  flag indicating debugging the current project (True) or script (False)
script (str (optional))
  name of a script (defaults to "")

#### DebugUI.doProfile

doProfile(runProject, script="")

Public method to handle the profile actions.

runProject (bool)
  flag indicating profiling of the current project (True) or script (False)
script (str)
  name of a script (optional)

#### DebugUI.doRun

doRun(runProject, script="")

Public method to handle the run actions.

runProject (bool)
  flag indicating running the current project (True) or script (False)
script (str)
  name of a script (optional)

#### DebugUI.getActions

getActions()

Public method to get a list of all actions.

Return:
  list of all actions

Return Type:
  list of EricAction

#### DebugUI.getProjectEnvironmentString

getProjectEnvironmentString()

Public method to get the string for the project environment.

Return:
  string for the project environment

Return Type:
  str

#### DebugUI.getSelectedDebuggerId

getSelectedDebuggerId()

Public method to get the currently selected debugger ID.

Return:
  selected debugger ID

Return Type:
  str

#### DebugUI.initActions

initActions()

Public method defining the user interface actions.

#### DebugUI.initMenus

initMenus()

Public slot to initialize the project menu.

Return:
  the generated menu

Return Type:
  QMenu

#### DebugUI.initToolbars

initToolbars(toolbarManager)

Public slot to initialize the debug toolbars.

toolbarManager (EricToolBarManager)
  reference to a toolbar manager object

Return:
  the generated toolbars

Return Type:
  list of QToolBar

#### DebugUI.setArgvHistory

setArgvHistory(argsStr, clearHistories=False, history=None)

Public slot to initialize the argv history.

argsStr (str)
  command line arguments
clearHistories (bool)
  flag indicating, that the list should be cleared
history (list of str)
  list of history entries to be set

#### DebugUI.setAutoClearShell

setAutoClearShell(autoClearShell)

Public slot to initialize the autoClearShell flag.

autoClearShell (bool)
  flag indicating, that the interpreter window should be cleared

#### DebugUI.setAutoContinue

setAutoContinue(autoContinue)

Public slot to initialize the autoContinue flag.

autoContinue (bool)
  flag indicating, that the debugger should not stop at the first executable line

#### DebugUI.setDebugActionsEnabled

setDebugActionsEnabled(enable)

Public method to set the enabled state of the debug actions.

enable (bool)
  enable state to be set

#### DebugUI.setEnableGlobalConfigOverride

setEnableGlobalConfigOverride(overrideData)

Public method to initialize the global config override data.

overrideData (dict)
  dictionary containing a flag indicating to enable global config override and a flag indicating to redirect stdin/stdout/stderr

#### DebugUI.setEnableMultiprocess

setEnableMultiprocess(enableMultiprocess)

Public slot to initialize the enableMultiprocess flag.

enableMultiprocess (bool)
  flag indicating, that the debugger should be run in multi process mode

#### DebugUI.setEnvHistory

setEnvHistory(envStr, clearHistories=False, history=None)

Public slot to initialize the env history.

envStr (str)
  the environment settings
clearHistories (bool)
  flag indicating, that the list should be cleared
history (list of str)
  list of history entries to be set

#### DebugUI.setExcIgnoreList

setExcIgnoreList(excIgnoreList)

Public slot to initialize the ignored exceptions type list.

excIgnoreList (list of str)
  list of ignored exception types

#### DebugUI.setExcList

setExcList(excList)

Public slot to initialize the exceptions type list.

excList (list of str)
  list of exception types

#### DebugUI.setExceptionReporting

setExceptionReporting(reportAllExceptions)

Public slot to initialize the exception reporting flag.

reportAllExceptions (bool)
  flag indicating to report all exceptions

#### DebugUI.setMultiprocessNoDebugHistory

setMultiprocessNoDebugHistory(noDebugList, clearHistories=False, history=None)

Public slot to initialize the no debug list history.

noDebugList (str)
  whitespace separated list of programs not to be debugged
clearHistories (bool)
  flag indicating, that the list should be cleared
history (list of str)
  list of history entries to be set

#### DebugUI.setScriptsHistory

setScriptsHistory(scriptName, clearHistories=False, history=None)

Public slot to initialize the scripts history.

scriptName (str)
  script name
clearHistories (bool (optional))
  flag indicating, that the list should be cleared (defaults to False)
history (list of str (optional))
  list of history entries to be set (defaults to None)

#### DebugUI.setTracePython

setTracePython(tracePython)

Public slot to initialize the trace Python flag.

tracePython (bool)
  flag indicating if the Python library should be traced as well

#### DebugUI.setWdHistory

setWdHistory(wdStr, clearHistories=False, history=None)

Public slot to initialize the wd history.

wdStr (str)
  working directory
clearHistories (bool)
  flag indicating, that the list should be cleared
history (list of str)
  list of history entries to be set

#### DebugUI.showNotification

showNotification(notification, kind=NotificationTypes.INFORMATION, timeout=None)

Public method to show some notification message.

notification (str)
  message to be shown
kind (NotificationTypes)
  kind of notification to be shown
timeout (int)
  timeout for the notification (None = use configured default, 0 = indefinitely)

#### DebugUI.shutdown

shutdown()

Public method to perform shutdown actions.

#### DebugUI.shutdownServer

shutdownServer()

Public method to shut down the debug server.

This is needed to cleanly close the sockets on Win OS.

Return:
  always true

Return Type:
  bool

#### DebugUI.variablesFilter

variablesFilter(scope)

Public method to get the variables filter for a scope.

scope (bool)
  flag indicating global (True) or local (False) scope

Return:
  filters list

Return Type:
  list of str

Up