138 def getFrameLocals(self, frmnr=0): |
138 def getFrameLocals(self, frmnr=0): |
139 """ |
139 """ |
140 Public method to return the locals dictionary of the current frame |
140 Public method to return the locals dictionary of the current frame |
141 or a frame below. |
141 or a frame below. |
142 |
142 |
143 @keyparam frmnr distance of frame to get locals dictionary of. 0 is |
143 @param frmnr distance of frame to get locals dictionary of. 0 is |
144 the current frame (int) |
144 the current frame (int) |
145 @return locals dictionary of the frame |
145 @return locals dictionary of the frame |
146 """ |
146 """ |
147 f = self.currentFrame |
147 f = self.currentFrame |
148 while f is not None and frmnr > 0: |
148 while f is not None and frmnr > 0: |
153 def storeFrameLocals(self, frmnr=0): |
153 def storeFrameLocals(self, frmnr=0): |
154 """ |
154 """ |
155 Public method to store the locals into the frame, so an access to |
155 Public method to store the locals into the frame, so an access to |
156 frame.f_locals returns the last data. |
156 frame.f_locals returns the last data. |
157 |
157 |
158 @keyparam frmnr distance of frame to store locals dictionary to. 0 is |
158 @param frmnr distance of frame to store locals dictionary to. 0 is |
159 the current frame (int) |
159 the current frame (int) |
160 """ |
160 """ |
161 cf = self.currentFrame |
161 cf = self.currentFrame |
162 while cf is not None and frmnr > 0: |
162 while cf is not None and frmnr > 0: |
163 cf = cf.f_back |
163 cf = cf.f_back |
399 |
399 |
400 If frame is not specified, debugging starts from caller's frame. |
400 If frame is not specified, debugging starts from caller's frame. |
401 Because of jump optimizations it's not possible to use sys.breakpoint() |
401 Because of jump optimizations it's not possible to use sys.breakpoint() |
402 as last instruction in a function or method. |
402 as last instruction in a function or method. |
403 |
403 |
404 @keyparam frame frame to start debugging from |
404 @param frame frame to start debugging from |
405 @type frame object |
405 @type frame object |
406 """ |
406 """ |
407 if frame is None: |
407 if frame is None: |
408 frame = sys._getframe().f_back # Skip set_trace method |
408 frame = sys._getframe().f_back # Skip set_trace method |
409 |
409 |
749 |
749 |
750 def getStack(self, frame=None, applyTrace=False): |
750 def getStack(self, frame=None, applyTrace=False): |
751 """ |
751 """ |
752 Public method to get the stack. |
752 Public method to get the stack. |
753 |
753 |
754 @keyparam frame frame object to inspect |
754 @param frame frame object to inspect |
755 @type frame object or list |
755 @type frame object or list |
756 @keyparam applyTrace flag to assign trace function to fr.f_trace |
756 @param applyTrace flag to assign trace function to fr.f_trace |
757 @type bool |
757 @type bool |
758 @return list of lists with file name (string), line number (integer) |
758 @return list of lists with file name (string), line number (integer) |
759 and function name (string) |
759 and function name (string) |
760 """ |
760 """ |
761 tb_lineno = None |
761 tb_lineno = None |
845 """ |
845 """ |
846 Public method reimplemented to report an exception to the debug server. |
846 Public method reimplemented to report an exception to the debug server. |
847 |
847 |
848 @param excinfo details about the exception |
848 @param excinfo details about the exception |
849 @type tuple(Exception, excval object, traceback frame object) |
849 @type tuple(Exception, excval object, traceback frame object) |
850 @keyparam unhandled flag indicating an uncaught exception |
850 @param unhandled flag indicating an uncaught exception |
851 @type bool |
851 @type bool |
852 """ |
852 """ |
853 exctype, excval, exctb = excinfo |
853 exctype, excval, exctb = excinfo |
854 |
854 |
855 if ((exctype in [GeneratorExit, StopIteration] and |
855 if ((exctype in [GeneratorExit, StopIteration] and |