This situation made me think that there is a need for some kind of tour through Eclipse debugger's features to share our knowledge about this great tool. Every week I will try to write a little bit about one of the debuger's aspect. If you have any hints or hacks for the debugger let me know - we can learn from each other!
Types of breakpoints
I would like to start with different kinds of breakpoints that are available in the debugger. We can use:
- line breakpoint
- method breakpoint
- field breakpoint
- class breakpoint
- java exception breakpoint
I guess that most of us use usually the first type and we tend to forget about others, however, that often can come very handy.
Line breakpoints
The post popular ones, so I won't get into the details. They make the execution pause whenever the given (marked as breakpoint) line is hit. Breakpoints like this can be created by clicking the ruler on the line we want to put the breakpoint on.
This kind of breakpoints pauses the execution whenever the processing enters or/and exists the given method. Breakpoints like this can be created by clicking the ruler on the line where the name of the method in the declaration of the method is written.
Field breakpoints pause the execution whenever the given field is read or/and modified.
These breakpoints pause the processing when the given class (or interface) is loaded by the JVm for the first time.
Java exception breakpoints
Allow to pause the execution of the application when particular exception is thrown. They can be set in the Breakpoints view. Choose Add Java Exception Breakpoint option:
Did I miss any kind of breakpoints?
Next time I will try to write about the Hit count option and the breakpoints' conditions.
2 comments:
One point: they are Java Exception Breakpoints...not Java Execution and the toolbar action is "Add Java Exception Breakpoint".
Yes, you are right. I mus have had some problems with my eyes yesterday ;) Thanks!
Post a Comment