[ python-Bugs-1643369 ] function breakpoints in pdb

SourceForge.net noreply at sourceforge.net
Thu Mar 8 07:25:20 CET 2007


Bugs item #1643369, was opened at 2007-01-24 02:22
Message generated for change (Comment added) made by isandler
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1643369&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: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 6
Private: No
Submitted By: decitre (decitre)
Assigned to: Nobody/Anonymous (nobody)
Summary: function breakpoints in pdb

Initial Comment:
pdb.Pdb.find_function method is not able to recognize class methods, since the regular expression it uses only looks for "def" at beginning of lines.

Please replace
r'def\s+%s\s*[(]' % funcname
with
r'\s*def\s+%s\s*[(]' % funcname

test file in attachment. this file shows that pdb can set a breakpoint on foo but not on readline function.

Regards, Emmanuel
www.e-rsatz.info

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

Comment By: Ilya Sandler (isandler)
Date: 2007-03-07 22:25

Message:
Logged In: YES 
user_id=971153
Originator: NO

I think it's a bit more complicated than it seems: it's more than common
for different classes to have methods with the same name.

So looking for "\s*def func" will just grab the first matching
method...Which is probably not what one would want...And dealing with
multiple matches might be more hassle than it's worth..

So maybe the current behaviour should be kept as is

NOTE: you CAN currently set breakpoints in methods by doing

b Class.method





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

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


More information about the Python-bugs-list mailing list