Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
Breakpoint Class Reference

Public Member Functions

def __init__
 
def deleteMe
 
def enable
 
def disable
 
def bpprint
 

Data Fields

 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 406 of file bdb.py.

Constructor & Destructor Documentation

def __init__ (   self,
  file,
  line,
  temporary = 0,
  cond = None 
)

Definition at line 430 of file bdb.py.

431  def __init__(self, file, line, temporary=0, cond = None):
432  self.file = file # This better be in canonical form!
433  self.line = line
434  self.temporary = temporary
435  self.cond = cond
436  self.enabled = 1
437  self.ignore = 0
438  self.hits = 0
439  self.number = Breakpoint.next
440  Breakpoint.next = Breakpoint.next + 1
441  # Build the two lists
442  self.bpbynumber.append(self)
443  if self.bplist.has_key((file, line)):
444  self.bplist[file, line].append(self)
445  else:
446  self.bplist[file, line] = [self]
447 

Member Function Documentation

def bpprint (   self)

Definition at line 462 of file bdb.py.

References Breakpoint.cond, Breakpoint.enabled, Breakpoint.file, Breakpoint.hits, Breakpoint.ignore, Breakpoint.line, Breakpoint.number, and Breakpoint.temporary.

463  def bpprint(self):
464  if self.temporary:
465  disp = 'del '
466  else:
467  disp = 'keep '
468  if self.enabled:
469  disp = disp + 'yes'
470  else:
471  disp = disp + 'no '
472  print '%-4dbreakpoint %s at %s:%d' % (self.number, disp,
473  self.file, self.line)
474  if self.cond:
475  print '\tstop only if %s' % (self.cond,)
476  if self.ignore:
477  print '\tignore next %d hits' % (self.ignore)
478  if (self.hits):
479  if (self.hits > 1): ss = 's'
480  else: ss = ''
481  print ('\tbreakpoint already hit %d time%s' %
482  (self.hits, ss))
483 
484 # -----------end of Breakpoint class----------
485 
486 # Determines if there is an effective (active) breakpoint at this
# line of code. Returns breakpoint number or 0 if none
def deleteMe (   self)

Definition at line 448 of file bdb.py.

References Breakpoint.bpbynumber, Breakpoint.bplist, Breakpoint.file, Breakpoint.line, and Breakpoint.number.

449  def deleteMe(self):
450  index = (self.file, self.line)
451  self.bpbynumber[self.number] = None # No longer in list
452  self.bplist[index].remove(self)
453  if not self.bplist[index]:
454  # No more bp for this f:l combo
455  del self.bplist[index]
def disable (   self)

Definition at line 459 of file bdb.py.

References Breakpoint.enabled.

460  def disable(self):
461  self.enabled = 0
def enable (   self)

Definition at line 456 of file bdb.py.

References Breakpoint.enabled.

457  def enable(self):
458  self.enabled = 1

Field Documentation

list bpbynumber = [None]
static

Definition at line 426 of file bdb.py.

dictionary bplist = {}
static

Definition at line 425 of file bdb.py.

cond

Definition at line 434 of file bdb.py.

enabled

Definition at line 435 of file bdb.py.

file

Definition at line 431 of file bdb.py.

hits

Definition at line 437 of file bdb.py.

ignore

Definition at line 436 of file bdb.py.

line

Definition at line 432 of file bdb.py.

int next = 1
static

Definition at line 424 of file bdb.py.

number

Definition at line 438 of file bdb.py.

temporary

Definition at line 433 of file bdb.py.


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