| Author |
debug - breakpoint -- only stop when a variable is a certain value?
|
Ben David
Ranch Hand
Joined: Oct 01, 2010
Posts: 67
|
|
I want to debug a program that runs through a lot of loops within loops. I want to set a break point, but the iteration I want to look at is hundreds of iterations in.
Is there a way to set a conditional breakpoint? So that it will only stop at the breakpoint when a variable I specify has a value that I specify?
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
|
|
|
What about a conditional print?
|
 |
Ernesto Chicas
Greenhorn
Joined: Jan 13, 2010
Posts: 18
|
|
maybe this helps
FAQ How do I set a conditional breakpoint?
netbeans has something like this
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24054
|
|
Hi Ben,
As you can see, the answer to 'can I' is "yes" -- but the answer to 'how can I' depends entirely on what debugger (i.e., what development tools) you're using, which you neglected to mention. Let us know and somebody can probably tell you exactly what to do.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Ben David
Ranch Hand
Joined: Oct 01, 2010
Posts: 67
|
|
Ernest Friedman-Hill wrote:Hi Ben,
As you can see, the answer to 'can I' is "yes" -- but the answer to 'how can I' depends entirely on what debugger (i.e., what development tools) you're using, which you neglected to mention. Let us know and somebody can probably tell you exactly what to do.
oops!! -- my bad!! I was totally meant to say I was using netbeans, but failed to get that into the post!
Anyway Ernesto Chicas comment helped me out. Dont know why i didnt try right clicking the breakpoint after setting it. I can then click "properties" and have a box where I can set the condition.
Thanks all!
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
|
|
|
This sounds like a NetBeans-related question which would sit better on our IDEs forum. Moving.
|
 |
 |
|
|
subject: debug - breakpoint -- only stop when a variable is a certain value?
|
|
|