eric3.Debugger.DebugBase

Module implementing the debug base class.

Classes

DebugBase Class implementing base class of the debugger.

Functions

printerr Module function used for debugging the debug client.

DebugBase

Class implementing base class of the debugger.

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

Derived from

bdb.Bdb

Methods

DebugBase Constructor
break_anywhere Reimplemented from bdb.py to fix the filename from the frame.
break_here Reimplemented from bdb.py to fix the filename from the frame.
dispatch_exception Reimplemented from bdb.py to always call user_exception.
dispatch_return Reimplemented from bdb.py to handle passive mode cleanly.
do_clear Private method called to clear a temporary breakpoint.
extract_stack Protected member to return a list of stack frames.
fix_frame_filename Protected method used to fixup the filename for a given frame.
getCurrentFrame Public method to return the current frame.
get_break Reimplemented from bdb.py to get the first breakpoint of a particular line.
go Public method to resume the thread.
set_continue Reimplemented from bdb.py to always get informed of exceptions.
set_quit Public method to quit.
step Public method to perform a step operation in this thread.
stepOut Public method to perform a step out of the current call.
stop_here Reimplemented to filter out debugger files.
user_exception Reimplemented to report an exception to the debug server.
user_line Reimplemented to handle the program about to execute a particular line.
user_return Reimplemented to report program termination to the debug server.

DebugBase (Constructor)

DebugBase(dbgClient)

Constructor

dbgClient
the owning client

DebugBase.break_anywhere

break_anywhere(frame)

Reimplemented from bdb.py to fix the filename from the frame.

See fix_frame_filename for more info.

frame
the frame object
Returns:
flag indicating the break status (boolean)

DebugBase.break_here

break_here(frame)

Reimplemented from bdb.py to fix the filename from the frame.

See fix_frame_filename for more info.

frame
the frame object
Returns:
flag indicating the break status (boolean)

DebugBase.dispatch_exception

dispatch_exception(frame, arg)

Reimplemented from bdb.py to always call user_exception.

arg
The arguments
frame
The current stack frame.

DebugBase.dispatch_return

dispatch_return(frame, arg)

Reimplemented from bdb.py to handle passive mode cleanly.

arg
The arguments
frame
The current stack frame.

DebugBase.do_clear

do_clear(filename, lineno)

Private method called to clear a temporary breakpoint.

filename
name of the file the bp belongs to
lineno
linenumber of the bp

DebugBase.extract_stack

extract_stack(exctb)

Protected member to return a list of stack frames.

exctb
exception traceback
Returns:
list of stack frames

DebugBase.fix_frame_filename

fix_frame_filename(frame)

Protected method used to fixup the filename for a given frame.

The logic employed here is that if a module was loaded from a .pyc file, then the correct .py to operate with should be in the same path as the .pyc. The reason this logic is needed is that when a .pyc file is generated, the filename embedded and thus what is readable in the code object of the frame object is the fully qualified filepath when the pyc is generated. If files are moved from machine to machine this can break debugging as the .pyc will refer to the .py on the original machine. Another case might be sharing code over a network... This logic deals with that.

frame
-- the frame object

DebugBase.getCurrentFrame

getCurrentFrame()

Public method to return the current frame.

Returns:
the current frame

DebugBase.get_break

get_break(filename, lineno)

Reimplemented from bdb.py to get the first breakpoint of a particular line.

Because eric3 supports only one breakpoint per line, this overwritten method will return this one and only breakpoint.

filename
the filename of the bp to retrieve (string)
ineno
the linenumber of the bp to retrieve (integer)
Returns:
breakpoint or None, if there is no bp

DebugBase.go

go()

Public method to resume the thread.

It resumes the thread stopping only at breakpoints or exceptions.

DebugBase.set_continue

set_continue()

Reimplemented from bdb.py to always get informed of exceptions.

DebugBase.set_quit

set_quit()

Public method to quit.

It wraps call to bdb to clear the current frame properly.

DebugBase.step

step(traceMode)

Public method to perform a step operation in this thread.

tracemode
If it is non-zero, then the step is a step into, otherwise it is a step over.

DebugBase.stepOut

stepOut()

Public method to perform a step out of the current call.

DebugBase.stop_here

stop_here(frame)

Reimplemented to filter out debugger files.

Tracing is turned off for files that are part of the debugger that are called from the application being debugged.

frame
the frame object
Returns:
flag indicating whether the debugger should stop here

DebugBase.user_exception

user_exception(frame, (exctype, excval, exctb), unhandled=0)

Reimplemented to report an exception to the debug server.

exctb
traceback for the exception
exctype
the type of the exception
excval
data about the exception
frame
the frame object
unhandled
flag indicating an uncaught exception

DebugBase.user_line

user_line(frame)

Reimplemented to handle the program about to execute a particular line.

frame
the frame object

DebugBase.user_return

user_return(frame, retval)

Reimplemented to report program termination to the debug server.

frame
the frame object
retval
the return value of the program

Up

printerr

printerr(s)

Module function used for debugging the debug client.

Arguments

s
the data to be printed
Up