bdb — Debugger framework¶
Source code: Lib/bdb.py
The bdb module handles basic debugger functions, like setting breakpoints
or managing execution via the debugger.
The following exception is defined:
The bdb module also defines two classes:
- class bdb.Breakpoint(self, file, line, temporary=False, cond=None, funcname=None)¶
This class implements temporary breakpoints, ignore counts, disabling and (re-)enabling, and conditionals.
Breakpoints are indexed by number through a list called
bpbynumberand by(file, line)pairs throughbplist. The former points to a single instance of classBreakpoint. The latter points to a list of such instances since there may be more than one breakpoint per line.When creating a breakpoint, its associated
file nameshould be in canonical form. If afuncnameis defined, a breakpointhitwill be counted when the first line of that function is executed. Aconditionalbreakpoint always counts ahit.Breakpointinstances have the following methods:- deleteMe()¶
Delete the breakpoint from the list associated to a file/line. If it is the last breakpoint in that position, it also deletes the entry for the file/line.
- enable()¶
Mark the breakpoint as enabled.
- disable()¶
Mark the breakpoint as disabled.
- bpformat()¶
Return a string with all the information about the breakpoint, nicely formatted:
Breakpoint number.
Temporary status (del or keep).
File/line position.
Break condition.
Number of times to ignore.
Number of times hit.