DebugClients/Python3/DebugBase.py

changeset 2953
703452a2876f
parent 2927
f36b757378f1
child 2987
c99695c0f13a
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
144 def profile(self, frame, event, arg): 144 def profile(self, frame, event, arg):
145 """ 145 """
146 Public method used to trace some stuff independent of the debugger 146 Public method used to trace some stuff independent of the debugger
147 trace function. 147 trace function.
148 148
149 @param frame The current stack frame. 149 @param frame current stack frame.
150 @param event The trace event (string) 150 @param event trace event (string)
151 @param arg The arguments 151 @param arg arguments
152 @exception RuntimeError raised to indicate too many recursions
152 """ 153 """
153 if event == 'return': 154 if event == 'return':
154 self.cFrame = frame.f_back 155 self.cFrame = frame.f_back
155 self.__recursionDepth -= 1 156 self.__recursionDepth -= 1
156 self.__sendCallTrace(event, frame, self.cFrame) 157 self.__sendCallTrace(event, frame, self.cFrame)
233 for new events (i.e. new breakpoints) while we are going through 234 for new events (i.e. new breakpoints) while we are going through
234 the code. 235 the code.
235 236
236 @param frame The current stack frame. 237 @param frame The current stack frame.
237 @return local trace function 238 @return local trace function
239 @exception bdb.BdbQuit raised to indicate the end of the debug session
238 """ 240 """
239 if self.stop_here(frame) or self.break_here(frame): 241 if self.stop_here(frame) or self.break_here(frame):
240 self.user_line(frame) 242 self.user_line(frame)
241 if self.quitting: 243 if self.quitting:
242 raise bdb.BdbQuit 244 raise bdb.BdbQuit
247 Reimplemented from bdb.py to handle passive mode cleanly. 249 Reimplemented from bdb.py to handle passive mode cleanly.
248 250
249 @param frame The current stack frame. 251 @param frame The current stack frame.
250 @param arg The arguments 252 @param arg The arguments
251 @return local trace function 253 @return local trace function
254 @exception bdb.BdbQuit raised to indicate the end of the debug session
252 """ 255 """
253 if self.stop_here(frame) or frame == self.returnframe: 256 if self.stop_here(frame) or frame == self.returnframe:
254 self.user_return(frame, arg) 257 self.user_return(frame, arg)
255 if self.quitting and not self._dbgClient.passive: 258 if self.quitting and not self._dbgClient.passive:
256 raise bdb.BdbQuit 259 raise bdb.BdbQuit
261 Reimplemented from bdb.py to always call user_exception. 264 Reimplemented from bdb.py to always call user_exception.
262 265
263 @param frame The current stack frame. 266 @param frame The current stack frame.
264 @param arg The arguments 267 @param arg The arguments
265 @return local trace function 268 @return local trace function
269 @exception bdb.BdbQuit raised to indicate the end of the debug session
266 """ 270 """
267 if not self.__skip_it(frame): 271 if not self.__skip_it(frame):
268 self.user_exception(frame, arg) 272 self.user_exception(frame, arg)
269 if self.quitting: 273 if self.quitting:
270 raise bdb.BdbQuit 274 raise bdb.BdbQuit
316 this can break debugging as the .pyc will refer to the .py 320 this can break debugging as the .pyc will refer to the .py
317 on the original machine. Another case might be sharing 321 on the original machine. Another case might be sharing
318 code over a network... This logic deals with that. 322 code over a network... This logic deals with that.
319 323
320 @param frame the frame object 324 @param frame the frame object
325 @return fixed up file name (string)
321 """ 326 """
322 # get module name from __file__ 327 # get module name from __file__
323 if '__file__' in frame.f_globals and \ 328 if '__file__' in frame.f_globals and \
324 frame.f_globals['__file__'] and \ 329 frame.f_globals['__file__'] and \
325 frame.f_globals['__file__'] == frame.f_code.co_filename: 330 frame.f_globals['__file__'] == frame.f_code.co_filename:
376 def get_watch(self, cond): 381 def get_watch(self, cond):
377 """ 382 """
378 Public method to get a watch expression. 383 Public method to get a watch expression.
379 384
380 @param cond expression of the watch expression to be cleared (string) 385 @param cond expression of the watch expression to be cleared (string)
386 @return reference to the watch point
381 """ 387 """
382 possibles = bdb.Breakpoint.bplist["Watch", 0] 388 possibles = bdb.Breakpoint.bplist["Watch", 0]
383 for i in range(0, len(possibles)): 389 for i in range(0, len(possibles)):
384 b = possibles[i] 390 b = possibles[i]
385 if b.cond == cond: 391 if b.cond == cond:
717 """ 723 """
718 Private method to extract the exception name given the exception 724 Private method to extract the exception name given the exception
719 type object. 725 type object.
720 726
721 @param exctype type of the exception 727 @param exctype type of the exception
728 @return exception name (string)
722 """ 729 """
723 return str(exctype).replace("<class '", "").replace("'>", "") 730 return str(exctype).replace("<class '", "").replace("'>", "")
724 731
725 def __extract_stack(self, exctb): 732 def __extract_stack(self, exctb):
726 """ 733 """

eric ide

mercurial