bdb.Breakpoint

class bdb.Breakpoint(self, file, line, temporary=0, 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 bpbynumber and by (file, line) pairs through bplist. The former points to a single instance of class Breakpoint. 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 filename should be in canonical form. If a funcname is defined, a breakpoint hit will be counted when the first line of that function is executed. A conditional breakpoint always counts a hit.

Breakpoint instances 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:

  • The breakpoint number.
  • If it is temporary or not.
  • Its file,line position.
  • The condition that causes a break.
  • If it must be ignored the next N times.
  • The breakpoint hit count.

New in version 3.2.

bpprint(out=None)

Print the output of bpformat() to the file out, or if it is None, to standard output.

doc_python
2016-10-07 17:27:28
Comments
Leave a Comment

Please login to continue.