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 find_function does not find Class methods.
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: decitre, hoffman, isandler
Priority: low Keywords:

Created on 2007-01-24 10:22 by decitre, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
try.py decitre, 2007-01-24 10:22 function breakpoint testcase
Messages (3)
msg31078 - (view) Author: decitre (decitre) Date: 2007-01-24 10:22
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
msg31079 - (view) Author: Ilya Sandler (isandler) Date: 2007-03-08 06:25
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



msg56046 - (view) Author: Michael Hoffman (hoffman) Date: 2007-09-19 20:18
Agree with isandler. This is not a bug.
History
Date User Action Args
2022-04-11 14:56:22adminsetgithub: 44499
2008-12-05 09:37:50georg.brandlsetstatus: open -> closed
resolution: not a bug
2007-09-20 17:39:57jafosetseverity: normal -> minor
2007-09-20 17:38:34jafosetpriority: high -> low
type: enhancement
title: function breakpoints in pdb -> pdb find_function does not find Class methods.
2007-09-19 20:18:57hoffmansetnosy: + hoffman
messages: + msg56046
2007-01-24 10:22:47decitrecreate