org.eclipse.ease.lang.python.debugger

## Class PythonDebugger

- java.lang.Object
- - org.eclipse.ease.debugging.AbstractEaseDebugger
  - - org.eclipse.ease.lang.python.debugger.PythonDebugger

All Implemented Interfaces:
  IEventProcessor, IExecutionListener

Direct Known Subclasses:
  JythonDebugger, Py4jDebugger

    public class PythonDebugger
    extends AbstractEaseDebugger
    implements IEventProcessor, IExecutionListener

Debugger class handling communication between Python and Eclipse.

### Nested Class Summary

Nested Classes
`class` `PythonDebugger.PythonDebugFrame` Custom `EaseDebugFrame` parsing the data from `IPyFrame` to more usable format.

### Nested classes/interfaces inherited from class org.eclipse.ease.debugging.AbstractEaseDebugger

`AbstractEaseDebugger.ThreadState`

### Field Summary

Fields
`static java.lang.String` `PYTHON_DEBUGGER_VARIABLE` Variable name for `PythonDebugger` in Python engine.

### Fields inherited from interface org.eclipse.ease.IExecutionListener

`ENGINE_END, ENGINE_START, SCRIPT_END, SCRIPT_INJECTION_END, SCRIPT_INJECTION_START, SCRIPT_START`

### Constructor Summary

Constructors
Constructor and Description
`PythonDebugger(IDebugEngine engine, boolean showDynamicCode)`

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.Object` `execute(Script script)` Runs the given `Script` using the `ICodeTracer`.
`IPythonScriptRegistry` `getScriptRegistry()` Returns the `IPythonScriptRegistry` used by the debugger.
`void` `setCodeTracer(ICodeTracer tracer)` Sets the `ICodeTracer` from the Python implementation.
`void` `traceDispatch(IPyFrame frame, java.lang.String type)` Function called from `ICodeTracer` whenever a new frame in Python is hit.

### Methods inherited from class org.eclipse.ease.debugging.AbstractEaseDebugger

`fireDispatchEvent, getExceptionStacktrace, getExceptionStacktrace, getStacktrace, handleEvent, isTrackedScript, notify, setDispatcher, setScriptRegistry`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.ease.debugging.dispatcher.IEventProcessor

`handleEvent, setDispatcher`

### Methods inherited from interface org.eclipse.ease.IExecutionListener

`notify`

### Field Detail

#### PYTHON_DEBUGGER_VARIABLE

    public static final java.lang.String PYTHON_DEBUGGER_VARIABLE

Variable name for `PythonDebugger` in Python engine. During setup phase set this variable BEFORE calling edb.py.

See Also:
  Constant Field Values

### Constructor Detail

#### PythonDebugger

    public PythonDebugger(IDebugEngine engine,
                          boolean showDynamicCode)

See Also:
  `AbstractEaseDebugger#AbstractScriptDebugger(IScriptEngine, boolean)`

### Method Detail

#### setCodeTracer

    public void setCodeTracer(ICodeTracer tracer)

Sets the `ICodeTracer` from the Python implementation.

This method will be called by edb.py on "_pyease_debugger".

Parameters:
  `tracer` - `ICodeTracer` for the connection between Eclipse and Python.

#### traceDispatch

    public void traceDispatch(IPyFrame frame,
                              java.lang.String type)

Function called from `ICodeTracer` whenever a new frame in Python is hit. Effectively checks if debugger should suspend or continue.

Parameters:
  `frame` - `IPyFrame` for current execution point.
  `type` - Type of trace step that occurred (ignored).

#### execute

    public java.lang.Object execute(Script script)

Runs the given `Script` using the `ICodeTracer`.

Return values are ignored in debug mode.

Parameters:
  `script` - Script to be executed.
Returns:
  Always `null`

#### getScriptRegistry

    public IPythonScriptRegistry getScriptRegistry()

Returns the `IPythonScriptRegistry` used by the debugger. If debugger has been set up incorrectly (e.g. script registry not tailored for python) this will return `null`.

Returns:
  `IPythonScriptRegistry` or `null`.