473,385 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to set condition breakpoints?

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
3 3102
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: fred | last post by:
What has happened to my breakpoints? Whenever I start my application from the IDE in Visual Studio then all of the breakpoints show a "?" and a comment says "The breakpoint will not currently be...
2
by: Jozef | last post by:
Hello, I'm coding a windows form, and up until now, the breakpoints have worked fine. For some reason, now when I run the program, the breakpoints fail and the code continues running. I have...
9
by: Rea | last post by:
Hi eb I set some 'Stop' statements and also visual breakpoints in asp code (vbscript). I am doing that in Microsoft Script debugger. Than I refresh the original page and expect execution to halt...
2
by: MSK | last post by:
Hi, Continued to my earlier post regaring "Breakpoints are not getting hit" , I have comeup with more input this time.. Kindly give me some idea. I am a newbie to .NET, recently I installed...
1
by: jeem | last post by:
I am using ActiveState Komodo 3.5 to work on a large python 2.4 application with an extensive UI... I am attempting to debug the application and am setting breakpoints in 4 different *.py files.....
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
1
by: Jeff | last post by:
Hey How can I get a list of breakpoints in Visual Studio 2005, while the loaded solution is in Edit mode (not running or not debugging)... I'm trying to learn thousands of uncommented C# code...
2
by: =?Utf-8?B?TG9zdCBJbiBUaGUgV29vZHM=?= | last post by:
I've seen a ton of posts about similar problems, but none of the solutions were effective. I've been maintaining this VB code for 3 years, and this is the first time this has happened. It seems...
1
by: GiJeet | last post by:
Hello, I'm trying to stop program execution by setting a break point and setting a condition on a variable. So I go into the breakpoints window and set a condition e.g. when 'x1' has changed. I...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.