# eric6.Debugger.DebugViewer

Module implementing a widget containing various debug related views.

The views avaliable are:

- variables viewer for global variables
- variables viewer for local variables
- call trace viewer
- viewer for breakpoints
- viewer for watch expressions
- viewer for exceptions
- viewer for threads
- a file browser (optional)
- an interpreter shell (optional)

### Global Attributes

None

### Classes

DebugViewer | Class implementing a widget containing various debug related views.

### Functions

None

## DebugViewer

Class implementing a widget containing various debug related views.

The individual tabs contain the interpreter shell (optional), the filesystem browser (optional), the two variables viewers (global and local), a breakpoint viewer, a watch expression viewer and the exception logger. Additionally a list of all threads is shown.

### Signals

sourceFile(string, int)
  emitted to open a source file at a line

### Derived from

QWidget

### Class Attributes

None

### Class Methods

None

### Methods

DebugViewer | Constructor
__callStackFrameSelected | Private slot to handle the selection of a call stack entry of the call stack viewer.
__frameSelected | Private slot to handle the selection of a new stack frame number.
__showSource | Private slot to handle the source button press to show the selected file.
__threadSelected | Private slot to handle the selection of a thread in the thread list.
clearCallTrace | Public method to clear the recorded call trace.
currentWidget | Public method to get a reference to the current widget.
handleClientStack | Public slot to show the call stack of the program being debugged.
handleDebuggingStarted | Public slot to handle the start of a debugging session.
handleRawInput | Public slot to handle the switch to the shell in raw input mode.
handleResetUI | Public method to reset the SBVviewer.
initCallStackViewer | Public method to initialize the call stack viewer.
isCallTraceEnabled | Public method to get the state of the call trace function.
preferencesChanged | Public slot to handle the preferencesChanged signal.
restoreCurrentPage | Public slot to restore the previously saved page.
saveCurrentPage | Public slot to save the current page.
setCallTraceToProjectMode | Public slot to set the call trace viewer to project mode.
setCurrentWidget | Public slot to set the current page based on the given widget.
setDebugger | Public method to set a reference to the Debug UI.
setGlobalsFilter | Public slot to set the global variable filter.
setLocalsFilter | Public slot to set the local variable filter.
setVariablesFilter | Public slot to set the local variables filter.
showThreadList | Public method to show the thread list.
showVariable | Public method to show the variables in the respective window.
showVariables | Public method to show the variables in the respective window.
showVariablesTab | Public method to make a variables tab visible.

### Static Methods

None

#### DebugViewer (Constructor)

DebugViewer(debugServer, docked, vm, parent=None, embeddedShell=True, embeddedBrowser=True)

Constructor

debugServer
  reference to the debug server object (DebugServer)
docked
  flag indicating a dock window
vm
  reference to the viewmanager object
parent
  parent widget (QWidget)
embeddedShell
  flag indicating whether the shell should be included. This flag is set to False by those layouts, that have the interpreter shell in a separate window.
embeddedBrowser
  flag indicating whether the file browser should be included. This flag is set to False by those layouts, that have the file browser in a separate window or embedded in the project browser instead.

#### DebugViewer.__callStackFrameSelected

__callStackFrameSelected(frameNo)

Private slot to handle the selection of a call stack entry of the call stack viewer.

frameNo
  frame number (index) of the selected entry (integer)

#### DebugViewer.__frameSelected

__frameSelected(frmnr)

Private slot to handle the selection of a new stack frame number.

frmnr
  frame number (0 is the current frame) (int)

#### DebugViewer.__showSource

__showSource()

Private slot to handle the source button press to show the selected file.

#### DebugViewer.__threadSelected

__threadSelected(current, previous)

Private slot to handle the selection of a thread in the thread list.

current
  reference to the new current item (QTreeWidgetItem)
previous
  reference to the previous current item (QTreeWidgetItem)

#### DebugViewer.clearCallTrace

clearCallTrace()

Public method to clear the recorded call trace.

#### DebugViewer.currentWidget

currentWidget()

Public method to get a reference to the current widget.

Returns:
  reference to the current widget (QWidget)

#### DebugViewer.handleClientStack

handleClientStack(stack)

Public slot to show the call stack of the program being debugged.

stack
  list of tuples with call stack data (file name, line number, function name, formatted argument/values list)

#### DebugViewer.handleDebuggingStarted

handleDebuggingStarted()

Public slot to handle the start of a debugging session.

This slot sets the variables filter expressions.

#### DebugViewer.handleRawInput

handleRawInput()

Public slot to handle the switch to the shell in raw input mode.

#### DebugViewer.handleResetUI

handleResetUI()

Public method to reset the SBVviewer.

#### DebugViewer.initCallStackViewer

initCallStackViewer(projectMode)

Public method to initialize the call stack viewer.

projectMode
  flag indicating to enable the project mode (boolean)

#### DebugViewer.isCallTraceEnabled

isCallTraceEnabled()

Public method to get the state of the call trace function.

Returns:
  flag indicating the state of the call trace function (boolean)

#### DebugViewer.preferencesChanged

preferencesChanged()

Public slot to handle the preferencesChanged signal.

#### DebugViewer.restoreCurrentPage

restoreCurrentPage()

Public slot to restore the previously saved page.

#### DebugViewer.saveCurrentPage

saveCurrentPage()

Public slot to save the current page.

#### DebugViewer.setCallTraceToProjectMode

setCallTraceToProjectMode(enabled)

Public slot to set the call trace viewer to project mode.

In project mode the call trace info is shown with project relative path names.

enabled
  flag indicating to enable the project mode (boolean)

#### DebugViewer.setCurrentWidget

setCurrentWidget(widget)

Public slot to set the current page based on the given widget.

widget
  reference to the widget (QWidget)

#### DebugViewer.setDebugger

setDebugger(debugUI)

Public method to set a reference to the Debug UI.

debugUI
  reference to the DebugUI object (DebugUI)

#### DebugViewer.setGlobalsFilter

setGlobalsFilter()

Public slot to set the global variable filter.

#### DebugViewer.setLocalsFilter

setLocalsFilter()

Public slot to set the local variable filter.

#### DebugViewer.setVariablesFilter

setVariablesFilter(globalsFilter, localsFilter)

Public slot to set the local variables filter.

globalsFilter
  filter list for global variable types (list of int)
localsFilter
  filter list for local variable types (list of int)

#### DebugViewer.showThreadList

showThreadList(currentID, threadList)

Public method to show the thread list.

currentID
  id of the current thread (integer)
threadList
  list of dictionaries containing the thread data

#### DebugViewer.showVariable

showVariable(vlist, showGlobals)

Public method to show the variables in the respective window.

vlist
  list of variables to display
showGlobals
  flag indicating global/local state

#### DebugViewer.showVariables

showVariables(vlist, showGlobals)

Public method to show the variables in the respective window.

vlist
  list of variables to display
showGlobals
  flag indicating global/local state

#### DebugViewer.showVariablesTab

showVariablesTab(showGlobals)

Public method to make a variables tab visible.

showGlobals
  flag indicating global/local state

Up