NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Jumping to a particular for loop iteration when debugging

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
reverby356



Joined: 30 Jul 2010
Posts: 4

PostPosted: Thu Nov 18, 2010 5:27 am    Post subject: Jumping to a particular for loop iteration when debugging Reply with quote

When debugging in Java (and C/C++ for that matter), is there a way to tell Netbeans which # iteration of a for loop to jump to? For example, if you have

for( int i = 0; i < 50; i++ ) {
.....
}

and I know the iterations 0 - 29 are fine, but I need to get to the 30th iteration, is there a way to go straight there with the debugger? Any help would be appreciated- thanks!
Back to top
areeda



Joined: 28 Aug 2008
Posts: 469
Location: Los Angeles

PostPosted: Thu Nov 18, 2010 10:20 pm    Post subject: Reply with quote

If you right click on the red square breakpoint icon and choose breakpoint properties, you can either specify a hit count or a condition (i==30).

That works in Java, I'm not sure about C++.

Joe
Back to top
reverby356



Joined: 30 Jul 2010
Posts: 4

PostPosted: Sun Nov 21, 2010 7:01 am    Post subject: Thank you Reply with quote

That works great, should make life a lot easier in the future. Thanks!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo