DebugClients/Python3/BreakpointWatch.py

branch
debugger speed
changeset 5045
50862a6a2c63
parent 5041
f00a4c8bcbbd
child 5061
753f720c2a48
equal deleted inserted replaced
5044:630b9f290a77 5045:50862a6a2c63
25 which is indexed only by filename and holds all line numbers where 25 which is indexed only by filename and holds all line numbers where
26 breakpoints are. 26 breakpoints are.
27 """ 27 """
28 breaks = {} # indexed by (filename, lineno) tuple: Breakpoint 28 breaks = {} # indexed by (filename, lineno) tuple: Breakpoint
29 breakInFile = {} # indexed by filename: [lineno] 29 breakInFile = {} # indexed by filename: [lineno]
30 breakInFrameCache = {}
30 31
31 def __init__(self, filename, lineno, temporary=0, cond=None): 32 def __init__(self, filename, lineno, temporary=0, cond=None):
32 """ 33 """
33 Constructor 34 Constructor
34 35
51 self.hits = 0 52 self.hits = 0
52 self.breaks[filename, lineno] = self 53 self.breaks[filename, lineno] = self
53 lines = self.breakInFile.setdefault(filename, []) 54 lines = self.breakInFile.setdefault(filename, [])
54 if lineno not in lines: 55 if lineno not in lines:
55 lines.append(lineno) 56 lines.append(lineno)
57 self.breakInFrameCache = {}
56 58
57 def deleteMe(self): 59 def deleteMe(self):
58 """ 60 """
59 Public method to clear this breakpoint. 61 Public method to clear this breakpoint.
60 """ 62 """
89 @type int 91 @type int
90 """ 92 """
91 bp = Breakpoint.breaks.get((filename, lineno)) 93 bp = Breakpoint.breaks.get((filename, lineno))
92 if bp: 94 if bp:
93 bp.deleteMe() 95 bp.deleteMe()
96 Breakpoint.breakInFrameCache = {}
94 97
95 @staticmethod 98 @staticmethod
96 def get_break(filename, lineno): 99 def get_break(filename, lineno):
97 """ 100 """
98 Public method to get the breakpoint of a particular line. 101 Public method to get the breakpoint of a particular line.

eric ide

mercurial