Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse - Breakpoint Hit Count

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .


 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18014
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic