[Patches] [ python-Patches-1472184 ] [patch] pdb 'clear' command doesn't clear selected bp's

SourceForge.net noreply at sourceforge.net
Tue Apr 18 11:47:39 CEST 2006


Patches item #1472184, was opened at 2006-04-18 09:38
Message generated for change (Settings changed) made by jakamkon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1472184&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
>Group: Python 2.5
Status: Open
>Resolution: Accepted
Priority: 5
Submitted By: Kuba Kończyk (jakamkon)
Assigned to: Nobody/Anonymous (nobody)
>Summary: [patch] pdb 'clear' command doesn't clear selected bp's

Initial Comment:
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)):


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1472184&group_id=5470


More information about the Patches mailing list