DebugClients/Python/DebugBase.py

changeset 4309
cc9c62f55413
parent 4293
125a75cfd249
child 4541
e8ddd9d76414
equal deleted inserted replaced
4307:6a8ec996a49c 4309:cc9c62f55413
88 88
89 @return the current frame 89 @return the current frame
90 """ 90 """
91 return self.currentFrame 91 return self.currentFrame
92 92
93 def getCurrentFrameLocals(self): 93 def getFrameLocals(self, frmnr=0):
94 """ 94 """
95 Public method to return the locals dictionary of the current frame. 95 Public method to return the locals dictionary of the current frame
96 96 or a frame below.
97 @return locals dictionary of the current frame 97
98 """ 98 @keyparam frmnr distance of frame to get locals dictionary of. 0 is
99 return self.currentFrameLocals 99 the current frame (int)
100 @return locals dictionary of the frame
101 """
102 if frmnr:
103 f = self.currentFrame
104 while f is not None and frmnr > 0:
105 f = f.f_back
106 frmnr -= 1
107 return f.f_locals
108 else:
109 return self.currentFrameLocals
100 110
101 def step(self, traceMode): 111 def step(self, traceMode):
102 """ 112 """
103 Public method to perform a step operation in this thread. 113 Public method to perform a step operation in this thread.
104 114
795 805
796 # Eliminate things like <string> and <stdin>. 806 # Eliminate things like <string> and <stdin>.
797 if fn[0] == '<': 807 if fn[0] == '<':
798 return 1 808 return 1
799 809
800 #XXX - think of a better way to do this. It's only a convience for 810 #XXX - think of a better way to do this. It's only a convenience for
801 #debugging the debugger - when the debugger code is in the current 811 #debugging the debugger - when the debugger code is in the current
802 #directory. 812 #directory.
803 if os.path.basename(fn) in [ 813 if os.path.basename(fn) in [
804 'AsyncFile.py', 'AsyncIO.py', 814 'AsyncFile.py', 'AsyncIO.py',
805 'DebugConfig.py', 'DCTestResult.py', 815 'DebugConfig.py', 'DCTestResult.py',

eric ide

mercurial