This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pdb: fix for #1472191('clear' command bug)
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jakamkon
Priority: high Keywords: patch

Created on 2006-04-18 09:38 by jakamkon, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pdb-clear.patch jakamkon, 2006-04-18 09:50 patch for pdb 'command'
Messages (2)
msg50056 - (view) Author: Kuba Kończyk (jakamkon) Date: 2006-04-18 09:38
Pdb 'clear x' command doesn't clear selected breakpoints
that are already set:

$ ./python -m pdb ../test.py
> /home/xyz/python/test.py(3)<module>()
-> def t(x):
(Pdb) break 5
Breakpoint 1 at /home/xyz/python/test.py:5
(Pdb) break
Num Type         Disp Enb   Where
1   breakpoint   keep yes   at /home/xyz/python/test.py:5
(Pdb) clear 1
No breakpoint numbered 1
(Pdb)                    
...
  for i in numberlist:
*  if not (0 <= i < len(bdb.Breakpoint.bpbynumber)): 
    print 'No breakpoint numbered', i
...

Each i is a string and it's compared to 0 and len(...),
so condition * is always True. 
The fix is trivial:
*  if not (0 <= int(i) < len(bdb.Breakpoint.bpbynumber)):
msg50057 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-05-03 18:13
Logged In: YES 
user_id=849994

Problem was fixed in rev. 45891, 45892(2.4), including
better error handling.
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43237
2006-04-18 09:38:12jakamkoncreate