def break_here(self, frame): """ Breakpoints don't work for files with non-ascii chars in Python 2 Fixes Issue 1484 """ from bdb import effective filename = self.canonic(frame.f_code.co_filename) try: filename = unicode(filename, "utf-8") except TypeError: pass if filename not in self.breaks: return False lineno = frame.f_lineno if lineno not in self.breaks[filename]: # The line itself has no breakpoint, but maybe the line is the # first line of a function with breakpoint set by function name lineno = frame.f_code.co_firstlineno if lineno not in self.breaks[filename]: return False # flag says ok to delete temp. bp (bp, flag) = effective(filename, lineno, frame) if bp: self.currentbp = bp.number if (flag and bp.temporary): self.do_clear(str(bp.number)) return True else: return False
def break_here(self, frame): """This routine is almost copy of bdb.py's routine. Alas what pdb calls clear gdb calls delete and gdb's clear command is different. I tried saving/restoring method names, but that didn't catch all of the places break_here was called. """ filename = self.canonic(frame.f_code.co_filename) if not filename in self.breaks: return False lineno = frame.f_lineno if not lineno in self.breaks[filename]: # The line itself has no breakpoint, but maybe the line is the # first line of a function with breakpoint set by function name. lineno = frame.f_code.co_firstlineno if not lineno in self.breaks[filename]: return False # flag says ok to delete temp. bp (bp, flag) = bdb.effective(filename, lineno, frame) if bp: ## This is new when we have thread debugging. self.currentbp = bp.number if hasattr(bp, 'thread_name') and hasattr(self, 'thread_name') \ and bp.thread_name != self.thread_name: return False if (flag and bp.temporary): #### ARG. All for the below name change. self.do_delete(str(bp.number)) pass self.stop_reason = 'brkpt' return True return False
def break_here(self, frame): """ Public method reimplemented from bdb.py to fix the filename from the frame. See fix_frame_filename for more info. @param frame the frame object @return flag indicating the break status (boolean) """ filename = self.canonic(self.fix_frame_filename(frame)) if filename not in self.breaks and "Watch" not in self.breaks: return 0 if filename in self.breaks: lineno = frame.f_lineno if lineno in self.breaks[filename]: # flag says ok to delete temp. bp (bp, flag) = bdb.effective(filename, lineno, frame) if bp: self.currentbp = bp.number if (flag and bp.temporary): self.__do_clear(filename, lineno) return 1 if "Watch" in self.breaks: # flag says ok to delete temp. bp (bp, flag) = self.__effective(frame) if bp: self.currentbp = bp.number if (flag and bp.temporary): self.__do_clearWatch(bp.cond) return 1 return 0
def break_here(self, frame): from bdb import effective filename = self.canonic(frame.f_code.co_filename) try: filename = unicode(filename, "utf-8") except TypeError: pass if not filename in self.breaks: return False lineno = frame.f_lineno if not lineno in self.breaks[filename]: # The line itself has no breakpoint, but maybe the line is the # first line of a function with breakpoint set by function name. lineno = frame.f_code.co_firstlineno if not lineno in self.breaks[filename]: return False # flag says ok to delete temp. bp (bp, flag) = effective(filename, lineno, frame) if bp: self.currentbp = bp.number if (flag and bp.temporary): self.do_clear(str(bp.number)) return True else: return False
def break_here(self, frame): """This routine is almost copy of bdb.py's routine. Alas what pdb calls clear gdb calls delete and gdb's clear command is different. I tried saving/restoring method names, but that didn't catch all of the places break_here was called. """ filename = self.canonic(frame.f_code.co_filename) if not filename in self.breaks: return False lineno = frame.f_lineno if not lineno in self.breaks[filename]: # The line itself has no breakpoint, but maybe the line is the # first line of a function with breakpoint set by function name. lineno = frame.f_code.co_firstlineno if not lineno in self.breaks[filename]: return False # flag says ok to delete temp. bp (bp, flag) = bdb.effective(filename, lineno, frame) if bp: ## This is new when we have thread debugging. self.currentbp = bp.number if hasattr(bp, 'thread_name') and hasattr(self, 'thread_name') \ and bp.thread_name != self.thread_name: return False if (flag and bp.temporary): #### ARG. All for the below name change. self.do_delete(str(bp.number)) return True else: return False
def break_here(self, frame): filename, lineno = self.getFilenameAndLine(frame) if not self.breaks.has_key(filename): return 0 if not lineno in self.breaks[filename]: return 0 # flag says ok to delete temp. bp (bp, flag) = bdb.effective(filename, lineno, frame) if bp: self.currentbp = bp.number if (flag and bp.temporary): self.do_clear(str(bp.number)) self.afterBreakpoint(frame) return 1 else: return 0
def break_here(self, frame): """ Public method reimplemented from bdb.py to fix the filename from the frame. See fix_frame_filename for more info. @param frame the frame object @return flag indicating the break status (boolean) """ filename = self.canonic(self.fix_frame_filename(frame)) if filename not in self.breaks and "Watch" not in self.breaks: return False if filename in self.breaks: lineno = frame.f_lineno if lineno not in self.breaks[filename]: # The line itself has no breakpoint, but maybe the line is the # first line of a function with breakpoint set by function # name. lineno = frame.f_code.co_firstlineno if lineno in self.breaks[filename]: # flag says ok to delete temp. bp (bp, flag) = bdb.effective(filename, lineno, frame) if bp: self.currentbp = bp.number if (flag and bp.temporary): self.__do_clear(filename, lineno) return True if "Watch" in self.breaks: # flag says ok to delete temp. bp (bp, flag) = self.__effective(frame) if bp: self.currentbp = bp.number if (flag and bp.temporary): self.__do_clearWatch(bp.cond) return True return False
def break_here(self, frame): from bdb import effective filename = self.canonic(frame.f_code.co_filename) filename = unicode(filename, "utf-8") if not filename in self.breaks: return False lineno = frame.f_lineno if not lineno in self.breaks[filename]: # The line itself has no breakpoint, but maybe the line is the # first line of a function with breakpoint set by function name. lineno = frame.f_code.co_firstlineno if not lineno in self.breaks[filename]: return False # flag says ok to delete temp. bp (bp, flag) = effective(filename, lineno, frame) if bp: self.currentbp = bp.number if (flag and bp.temporary): self.do_clear(str(bp.number)) return True else: return False
def update_event(self, inp=-1): self.set_output_val(0, bdb.effective(self.input(0), self.input(1), self.input(2)))