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

Data Structures

class  Bdb
 
class  Breakpoint
 
class  Tdb
 

Functions

def set_trace
 
def effective
 
def foo
 
def bar
 
def test
 

Variables

list __all__ = ["BdbQuit","Bdb","Breakpoint"]
 
string BdbQuit = 'bdb.BdbQuit'
 

Detailed Description

Debugger basics

Function Documentation

def bdb.bar (   a)

Definition at line 561 of file bdb.py.

562 def bar(a):
563  print 'bar(', a, ')'
564  return a/2
def bdb.effective (   file,
  line,
  frame 
)
Determine which breakpoint for this file:line is to be acted upon.

Called only if we know there is a bpt at this
location.  Returns breakpoint that was triggered and a flag
that indicates if it is ok to delete a temporary bp.

Definition at line 487 of file bdb.py.

488 def effective(file, line, frame):
489  """Determine which breakpoint for this file:line is to be acted upon.
490 
491  Called only if we know there is a bpt at this
492  location. Returns breakpoint that was triggered and a flag
493  that indicates if it is ok to delete a temporary bp.
494 
495  """
496  possibles = Breakpoint.bplist[file,line]
497  for i in range(0, len(possibles)):
498  b = possibles[i]
499  if b.enabled == 0:
500  continue
501  # Count every hit when bp is enabled
502  b.hits = b.hits + 1
503  if not b.cond:
504  # If unconditional, and ignoring,
505  # go on to next, else break
506  if b.ignore > 0:
507  b.ignore = b.ignore -1
508  continue
509  else:
510  # breakpoint and marker that's ok
511  # to delete if temporary
512  return (b,1)
513  else:
514  # Conditional bp.
515  # Ignore count applies only to those bpt hits where the
516  # condition evaluates to true.
517  try:
518  val = eval(b.cond, frame.f_globals,
519  frame.f_locals)
520  if val:
521  if b.ignore > 0:
522  b.ignore = b.ignore -1
523  # continue
524  else:
525  return (b,1)
526  # else:
527  # continue
528  except:
529  # if eval fails, most conservative
530  # thing is to stop on breakpoint
531  # regardless of ignore count.
532  # Don't delete temporary,
533  # as another hint to user.
534  return (b,0)
535  return (None, None)
536 
537 # -------------------- testing --------------------
def bdb.foo (   n)

Definition at line 556 of file bdb.py.

References bar().

557 def foo(n):
558  print 'foo(', n, ')'
559  x = bar(n*10)
560  print 'bar returned', x
def bdb.set_trace ( )

Definition at line 402 of file bdb.py.

403 def set_trace():
404  Bdb().set_trace()
405 
def bdb.test ( )

Definition at line 565 of file bdb.py.

566 def test():
567  t = Tdb()
568  t.run('import bdb; bdb.foo(10)')
569 
570 # end

Variable Documentation

list __all__ = ["BdbQuit","Bdb","Breakpoint"]

Definition at line 7 of file bdb.py.

string BdbQuit = 'bdb.BdbQuit'

Definition at line 9 of file bdb.py.