PyDocs

Nav

Debugging and profiling

Bdb

bdb

class (source)
  • Bdb(skip=None, backend='settrace')
Generic Python debugger base class.

This class takes care of details of the trace facility;
a derived class should implement user interaction.
The standard debugger class (pdb.Pdb) is an example.

The optional skip argument must be an iterable of glob-style
module name patterns.  The debugger will not step into frames
that originate in a module that matches one of these patterns.
Whether a frame is considered to originate in a certain module
is determined by the __name__ in the frame globals.
Changed in 3.1, 3.14
  • 3.1: Added the skip parameter.
  • 3.14: Added the backend parameter.
Members of Bdb

b

break_anywhere
Return True if there is any breakpoint in that frame
break_here
Return True if there is an effective breakpoint for this line.

c

canonic
Return canonical form of filename.
clear_all_breaks
Delete all existing breakpoints.
clear_all_file_breaks
Delete all breakpoints in filename.
clear_bpbynumber
Delete a breakpoint by its index in Breakpoint.bpbynumber.
clear_break
Delete breakpoints for filename:lineno.

d

disable_current_event
Disable the current event.
dispatch_call
Invoke user function and return trace function for call event.
dispatch_exception
Invoke user function and return trace function for exception event.
dispatch_line
Invoke user function and return trace function for line event.
dispatch_return
Invoke user function and return trace function for return event.
do_clear
Remove temporary breakpoint.

f

format_stack_entry
Return a string with information about a stack entry.

g

get_all_breaks
Return all breakpoints that are set.
get_bpbynumber
Return a breakpoint by its index in Breakpoint.bybpnumber.
get_break
Return True if there is a breakpoint for filename:lineno.
get_breaks
Return all breakpoints for filename:lineno.
get_file_breaks
Return all lines with breakpoints for filename.
get_stack
Return a list of (frame, lineno) in a stack trace and a size.

i

is_skipped_module
Return True if module_name matches any skip pattern.

r

reset
Set values of attributes as ready to start debugging.
restart_events
Restart all events.
run
Debug a statement executed via the exec() function.
runcall
Debug a single function call.
runctx
For backwards-compatibility.
runeval
Debug an expression executed via the eval() function.

s

set_break
Set a new breakpoint for filename:lineno.
set_continue
Stop only at breakpoints or when finished.
set_next
Stop on the next line in or below the given frame.
set_quit
Set quitting attribute to True.
set_return
Stop when returning from the given frame.
set_step
Stop after one line of code.
set_trace
Start debugging from frame.
set_until
Stop when the line with the lineno greater than the current one is reached or when returning from current frame.
start_trace
Start tracing.
stop_here
Return True if frame is below the starting frame in the stack.
stop_trace
Stop tracing.

t

trace_dispatch
Dispatch a trace function for debugged frames based on the event.

u

user_call
Called if we might stop in a function.
user_exception
Called when we stop on an exception.
user_line
Called when we stop or break at a line.
user_return
Called when a return trap is set here.
0 Examples
No examples for bdb/Bdb.
See Also
No see-alsos for bdb/Bdb
0 Notes
No notes for Bdb