By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,864 Members | 1,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,864 IT Pros & Developers. It's quick & easy.

How to set condition breakpoints?

P: n/a
I have a script with a class in it:
class Class:
def f(x, y):
# do something

I start up the debugger like this:
python /usr/lib/python2.3/pdb.py myscript.py

I want to set a conditional breakpoint:
b Class.f, x == 1 and y == 2

....but that doesn't work. How can I do what I want?

Thank you.

Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Christopher J. Bottaro wrote:
I have a script with a class in it:
class Class:
def f(x, y):
# do something

I start up the debugger like this:
python /usr/lib/python2.3/pdb.py myscript.py

I want to set a conditional breakpoint:
b Class.f, x == 1 and y == 2

....but that doesn't work. How can I do what I want?

Thank you.

You might consider boa-constructor, implemented for Windows and Linux.

I believe that it provides this functionality. Of course it provides a
lot more.

Colin W.
Jul 18 '05 #2

P: n/a
Colin J. Williams wrote:
Christopher J. Bottaro wrote:
I have a script with a class in it:
class Class:
def f(x, y):
# do something

I start up the debugger like this:
python /usr/lib/python2.3/pdb.py myscript.py

I want to set a conditional breakpoint:
b Class.f, x == 1 and y == 2

....but that doesn't work. How can I do what I want?

Thank you.

You might consider boa-constructor, implemented for Windows and Linux.

I believe that it provides this functionality. Of course it provides a
lot more.


Hmm, thanks for the suggestions. One more quick question. Is it even
possible to set a breakpoint in a class method in pdb.py? I can't even say
"break Class.f" without the condition. I don't think the documentation for
pdb is very good...=(

Thanks.

Jul 18 '05 #3

P: n/a
"Christopher J. Bottaro" <cj*******@alumni.cs.utexas.edu> writes on Fri, 10 Dec 2004 11:45:19 -0600:
...
Hmm, thanks for the suggestions. One more quick question. Is it even
possible to set a breakpoint in a class method in pdb.py? I can't even say
"break Class.f" without the condition. I don't think the documentation for
pdb is very good...=(


What happens? I can do it...

However, I had to fix "pdb" to prevent it to set the breakpoint
inside the docstring (where it is not effective).

I hope the fix found its way into the most recent Python versions
(2.3.4 and 2.4).

Dieter
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.