# eric4.DebugClients.Python.DebugThread

Module implementing the debug thread.

### Global Attributes

None

### Classes

DebugThread | Class implementing a debug thread.

### Functions

None

## DebugThread

Class implementing a debug thread.

It represents a thread in the python interpreter that we are tracing.

Provides simple wrapper methods around bdb for the 'owning' client to call to step etc.

### Derived from

DebugBase

### Class Attributes

None

### Class Methods

None

### Methods

DebugThread | Constructor
bootstrap | Private method to bootstrap the thread.
get_ident | Public method to return the id of this thread.
get_name | Public method to return the name of this thread.
set_ident | Public method to set the id for this thread.
traceThread | Private method to setup tracing for this thread.
trace_dispatch | Private method wrapping the trace_dispatch of bdb.py.

### Static Methods

None

#### DebugThread (Constructor)

DebugThread(dbgClient, targ = None, args = None, kwargs = None, mainThread = 0)

Constructor

dbgClient
  the owning client
targ
  the target method in the run thread
args
  arguments to be passed to the thread
kwargs
  arguments to be passed to the thread
mainThread
  0 if this thread is not the mainscripts thread

#### DebugThread.bootstrap

bootstrap()

Private method to bootstrap the thread.

It wraps the call to the user function to enable tracing before hand.

#### DebugThread.get_ident

get_ident()

Public method to return the id of this thread.

Returns:
  the id of this thread (int)

#### DebugThread.get_name

get_name()

Public method to return the name of this thread.

Returns:
  name of this thread (string)

#### DebugThread.set_ident

set_ident(id)

Public method to set the id for this thread.

id
  id for this thread (int)

#### DebugThread.traceThread

traceThread()

Private method to setup tracing for this thread.

#### DebugThread.trace_dispatch

trace_dispatch(frame, event, arg)

Private method wrapping the trace_dispatch of bdb.py.

It wraps the call to dispatch tracing into bdb to make sure we have locked the client to prevent multiple threads from entering the client event loop.

frame
  The current stack frame.
event
  The trace event (string)
arg
  The arguments

Returns:
  local trace function

Up