Issue 1643369: pdb find_function does not find Class methods. (original) (raw)

Issue1643369

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:22 admin set github: 44499
2008-12-05 09:37:50 georg.brandl set status: open -> closedresolution: not a bug
2007-09-20 17:39:57 jafo set severity: normal -> minor
2007-09-20 17:38:34 jafo set priority: high -> lowtype: enhancementtitle: function breakpoints in pdb -> pdb find_function does not find Class methods.
2007-09-19 20🔞57 hoffman set nosy: + hoffmanmessages: +
2007-01-24 10:22:47 decitre create