diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-11-29 11:54:17 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-11-29 11:54:17 (GMT) |
commit | 6f1070485f54469d7bf48df8306e398609340a07 (patch) | |
tree | 08eda3c912bb78c17b0655e140161da0213126d7 /Lib/bdb.py | |
parent | ead22227cce112457b6beba8b008699ea4a3a084 (diff) | |
download | cpython-6f1070485f54469d7bf48df8306e398609340a07.zip cpython-6f1070485f54469d7bf48df8306e398609340a07.tar.gz cpython-6f1070485f54469d7bf48df8306e398609340a07.tar.bz2 |
Fix #10561 - Fix pdb behavior. Delete the breakpoints by breakpoint number.
Handle multiple breakpoints at same line. Update docs/test.
Patch by Xavier de Gaye.
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r-- | Lib/bdb.py | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -252,6 +252,12 @@ class Bdb: list.append(lineno) bp = Breakpoint(filename, lineno, temporary, cond, funcname) + def _prune_breaks(self, filename, lineno): + if (filename, lineno) not in Breakpoint.bplist: + self.breaks[filename].remove(lineno) + if not self.breaks[filename]: + del self.breaks[filename] + def clear_break(self, filename, lineno): filename = self.canonic(filename) if not filename in self.breaks: @@ -263,17 +269,15 @@ class Bdb: # pair, then remove the breaks entry for bp in Breakpoint.bplist[filename, lineno][:]: bp.deleteMe() - if (filename, lineno) not in Breakpoint.bplist: - self.breaks[filename].remove(lineno) - if not self.breaks[filename]: - del self.breaks[filename] + self._prune_breaks(filename, lineno) def clear_bpbynumber(self, arg): try: bp = self.get_bpbynumber(arg) except ValueError as err: return str(err) - self.clear_break(bp.file, bp.line) + bp.deleteMe() + self._prune_breaks(bp.file, bp.line) def clear_all_file_breaks(self, filename): filename = self.canonic(filename) |