DebugClients/Python/DebugBase.py

changeset 2953
703452a2876f
parent 2927
f36b757378f1
child 2987
c99695c0f13a
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
145 def profile(self, frame, event, arg): 145 def profile(self, frame, event, arg):
146 """ 146 """
147 Public method used to trace some stuff independent of the debugger 147 Public method used to trace some stuff independent of the debugger
148 trace function. 148 trace function.
149 149
150 @param frame The current stack frame. 150 @param frame current stack frame.
151 @param event The trace event (string) 151 @param event trace event (string)
152 @param arg The arguments 152 @param arg arguments
153 @exception RuntimeError raised to indicate too many recursions
153 """ 154 """
154 if event == 'return': 155 if event == 'return':
155 self.cFrame = frame.f_back 156 self.cFrame = frame.f_back
156 self.__recursionDepth -= 1 157 self.__recursionDepth -= 1
157 self.__sendCallTrace(event, frame, self.cFrame) 158 self.__sendCallTrace(event, frame, self.cFrame)
234 for new events (i.e. new breakpoints) while we are going through 235 for new events (i.e. new breakpoints) while we are going through
235 the code. 236 the code.
236 237
237 @param frame The current stack frame. 238 @param frame The current stack frame.
238 @return local trace function 239 @return local trace function
240 @exception bdb.BdbQuit raised to indicate the end of the debug session
239 """ 241 """
240 if self.stop_here(frame) or self.break_here(frame): 242 if self.stop_here(frame) or self.break_here(frame):
241 self.user_line(frame) 243 self.user_line(frame)
242 if self.quitting: 244 if self.quitting:
243 raise bdb.BdbQuit 245 raise bdb.BdbQuit
248 Reimplemented from bdb.py to handle passive mode cleanly. 250 Reimplemented from bdb.py to handle passive mode cleanly.
249 251
250 @param frame The current stack frame. 252 @param frame The current stack frame.
251 @param arg The arguments 253 @param arg The arguments
252 @return local trace function 254 @return local trace function
255 @exception bdb.BdbQuit raised to indicate the end of the debug session
253 """ 256 """
254 if self.stop_here(frame) or frame == self.returnframe: 257 if self.stop_here(frame) or frame == self.returnframe:
255 self.user_return(frame, arg) 258 self.user_return(frame, arg)
256 if self.quitting and not self._dbgClient.passive: 259 if self.quitting and not self._dbgClient.passive:
257 raise bdb.BdbQuit 260 raise bdb.BdbQuit
262 Reimplemented from bdb.py to always call user_exception. 265 Reimplemented from bdb.py to always call user_exception.
263 266
264 @param frame The current stack frame. 267 @param frame The current stack frame.
265 @param arg The arguments 268 @param arg The arguments
266 @return local trace function 269 @return local trace function
270 @exception bdb.BdbQuit raised to indicate the end of the debug session
267 """ 271 """
268 if not self.__skip_it(frame): 272 if not self.__skip_it(frame):
269 self.user_exception(frame, arg) 273 self.user_exception(frame, arg)
270 if self.quitting: 274 if self.quitting:
271 raise bdb.BdbQuit 275 raise bdb.BdbQuit
317 this can break debugging as the .pyc will refer to the .py 321 this can break debugging as the .pyc will refer to the .py
318 on the original machine. Another case might be sharing 322 on the original machine. Another case might be sharing
319 code over a network... This logic deals with that. 323 code over a network... This logic deals with that.
320 324
321 @param frame the frame object 325 @param frame the frame object
326 @return fixed up file name (string)
322 """ 327 """
323 # get module name from __file__ 328 # get module name from __file__
324 if '__file__' in frame.f_globals and \ 329 if '__file__' in frame.f_globals and \
325 frame.f_globals['__file__'] and \ 330 frame.f_globals['__file__'] and \
326 frame.f_globals['__file__'] == frame.f_code.co_filename: 331 frame.f_globals['__file__'] == frame.f_code.co_filename:
373 def get_watch(self, cond): 378 def get_watch(self, cond):
374 """ 379 """
375 Public method to get a watch expression. 380 Public method to get a watch expression.
376 381
377 @param cond expression of the watch expression to be cleared (string) 382 @param cond expression of the watch expression to be cleared (string)
383 @return reference to the watch point
378 """ 384 """
379 possibles = bdb.Breakpoint.bplist["Watch", 0] 385 possibles = bdb.Breakpoint.bplist["Watch", 0]
380 for i in range(0, len(possibles)): 386 for i in range(0, len(possibles)):
381 b = possibles[i] 387 b = possibles[i]
382 if b.cond == cond: 388 if b.cond == cond:
498 Reimplemented from bdb.py to get the first breakpoint of a particular line. 504 Reimplemented from bdb.py to get the first breakpoint of a particular line.
499 505
500 Because eric5 supports only one breakpoint per line, this overwritten 506 Because eric5 supports only one breakpoint per line, this overwritten
501 method will return this one and only breakpoint. 507 method will return this one and only breakpoint.
502 508
503 @param filename the filename of the bp to retrieve (string) 509 @param filename filename of the bp to retrieve (string)
504 @param ineno the linenumber of the bp to retrieve (integer) 510 @param lineno linenumber of the bp to retrieve (integer)
505 @return breakpoint or None, if there is no bp 511 @return breakpoint or None, if there is no bp
506 """ 512 """
507 filename = self.canonic(filename) 513 filename = self.canonic(filename)
508 return filename in self.breaks and \ 514 return filename in self.breaks and \
509 lineno in self.breaks[filename] and \ 515 lineno in self.breaks[filename] and \

eric ide

mercurial