aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse - Breakpoint Hit Count Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse - Breakpoint Hit Count" Watch "Eclipse - Breakpoint Hit Count" New topic
Author

Eclipse - Breakpoint Hit Count

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

Could anybody please tell me what is Breakpoint Hit Count in Eclipse Debugger IDE .

When i gone through Eclipse Tutotrial from

http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/breakpoints/ref-hitcount_option.htm

I found this below , but i couldn't understand

"Select the Hit Count option to define a hit count for the selected breakpoint.
The Hit Count option is used to determine when your program should suspend on that breakpoint. "

Could anybody please tell me , what is this Hit Count in Eclipse IDE Debugger .

Thanks in advance . please suggest .



Save India From Corruption - Anna Hazare.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14272
    
  21

It means that the debugger will not stop at the breakpoint the first time, but only after that breakpoint has been passed N times (where N is the hit count).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

It means that the debugger will not stop at the breakpoint the first time, but only after that breakpoint has been passed N times (where N is the hit count).


Thanks Jesper for the reply , to be frank I did not get what do you mean by the above thing :

Assume that this is my sample program , how can the above theroy suit my sample program given below . Please suggest .

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

Ravi Kiran Va wrote:
It means that the debugger will not stop at the breakpoint the first time, but only after that breakpoint has been passed N times (where N is the hit count).


Thanks Jesper for the reply , to be frank I did not get what do you mean by the above thing :

Assume that this is my sample program , how can the above theroy suit my sample program given below . Please suggest .



Let's assume you put a breakpoint on the "First Line" println statement and set the hit count to 5.

The first 4 times that statement is executed, the debugger will keep going as though there was no breakpoint there. However, on the 5th time (in the current debug run), the breakpoint will be taken and the debugger will pause execution.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you very much , Tim Holloway , that was a nice explanation , but why this sort of behaviour would be useful anywhere ??

Thanks .
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14272
    
  21

Because sometimes you want the debugger to stop the 100th time it passes some breakpoint, and it quickly becomes tedious if you have to keep on clicking "Continue" the first 99 times.
 
 
subject: Eclipse - Breakpoint Hit Count