Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
bdb.Breakpoint Class Reference

List of all members.

Public Member Functions

def __init__
def deleteMe
def enable
def disable
def bpprint
def bpformat
def __str__

Public Attributes

 funcname
 func_first_executable_line
 file
 line
 temporary
 cond
 enabled
 ignore
 hits
 number

Static Public Attributes

int next = 1
dictionary bplist = {}
list bpbynumber = [None]

Detailed Description

Breakpoint class.

Implements temporary breakpoints, ignore counts, disabling and
(re)-enabling, and conditionals.

Breakpoints are indexed by number through bpbynumber and by
the file,line tuple using 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.

Definition at line 439 of file bdb.py.


Constructor & Destructor Documentation

def bdb.Breakpoint.__init__ (   self,
  file,
  line,
  temporary = False,
  cond = None,
  funcname = None 
)

Definition at line 462 of file bdb.py.

00462 
00463     def __init__(self, file, line, temporary=False, cond=None, funcname=None):
00464         self.funcname = funcname
00465         # Needed if funcname is not None.
00466         self.func_first_executable_line = None
00467         self.file = file    # This better be in canonical form!
00468         self.line = line
00469         self.temporary = temporary
00470         self.cond = cond
00471         self.enabled = True
00472         self.ignore = 0
00473         self.hits = 0
00474         self.number = Breakpoint.next
00475         Breakpoint.next += 1
00476         # Build the two lists
00477         self.bpbynumber.append(self)
00478         if (file, line) in self.bplist:
00479             self.bplist[file, line].append(self)
00480         else:
00481             self.bplist[file, line] = [self]

Here is the caller graph for this function:


Member Function Documentation

def bdb.Breakpoint.__str__ (   self)

Definition at line 524 of file bdb.py.

00524 
00525     def __str__(self):
00526         return 'breakpoint %s at %s:%s' % (self.number, self.file, self.line)
00527 
00528 # -----------end of Breakpoint class----------

Here is the caller graph for this function:

def bdb.Breakpoint.bpformat (   self)

Definition at line 501 of file bdb.py.

00501 
00502     def bpformat(self):
00503         if self.temporary:
00504             disp = 'del  '
00505         else:
00506             disp = 'keep '
00507         if self.enabled:
00508             disp = disp + 'yes  '
00509         else:
00510             disp = disp + 'no   '
00511         ret = '%-4dbreakpoint   %s at %s:%d' % (self.number, disp,
00512                                                 self.file, self.line)
00513         if self.cond:
00514             ret += '\n\tstop only if %s' % (self.cond,)
00515         if self.ignore:
00516             ret += '\n\tignore next %d hits' % (self.ignore,)
00517         if self.hits:
00518             if self.hits > 1:
00519                 ss = 's'
00520             else:
00521                 ss = ''
00522             ret += '\n\tbreakpoint already hit %d time%s' % (self.hits, ss)
00523         return ret

Here is the caller graph for this function:

def bdb.Breakpoint.bpprint (   self,
  out = None 
)

Definition at line 496 of file bdb.py.

00496 
00497     def bpprint(self, out=None):
00498         if out is None:
00499             out = sys.stdout
00500         print(self.bpformat(), file=out)

Here is the call graph for this function:

def bdb.Breakpoint.deleteMe (   self)

Definition at line 482 of file bdb.py.

00482 
00483     def deleteMe(self):
00484         index = (self.file, self.line)
00485         self.bpbynumber[self.number] = None   # No longer in list
00486         self.bplist[index].remove(self)
00487         if not self.bplist[index]:
00488             # No more bp for this f:l combo
00489             del self.bplist[index]

Here is the call graph for this function:

def bdb.Breakpoint.disable (   self)

Definition at line 493 of file bdb.py.

00493 
00494     def disable(self):
00495         self.enabled = False

Here is the caller graph for this function:

def bdb.Breakpoint.enable (   self)

Definition at line 490 of file bdb.py.

00490 
00491     def enable(self):
00492         self.enabled = True

Here is the caller graph for this function:


Member Data Documentation

list bdb.Breakpoint.bpbynumber = [None] [static]

Definition at line 458 of file bdb.py.

Definition at line 457 of file bdb.py.

Definition at line 469 of file bdb.py.

Definition at line 470 of file bdb.py.

Definition at line 466 of file bdb.py.

Definition at line 465 of file bdb.py.

Definition at line 463 of file bdb.py.

Definition at line 472 of file bdb.py.

Definition at line 471 of file bdb.py.

Definition at line 467 of file bdb.py.

int bdb.Breakpoint.next = 1 [static]

Definition at line 456 of file bdb.py.

Definition at line 473 of file bdb.py.

Definition at line 468 of file bdb.py.


The documentation for this class was generated from the following file: