Friday, July 29, 2011

Filtering Debug Steps in Eclipse

Have you grown tired of ending up in a Spring proxy while you're debugging? You know, not being able to just press F5 or step into a method and actually go into your own written code. Instead you see some class file without source of the generated proxy. It really hampers the debugging experience. Sounds familiar? To work around this you have to open the implementation class and put a breakpoint in the method you want to debug and press F8 (or Resume). This takes a lot of time, but I see a lot of developers do this ALL THE FREAKING TIME. There is a simple solution though, that nobody seems knows about. It is called 'step filters' in eclipse.

Eclipse has support to skip specified packages while debugging and it is easy to use:

1. Go to your eclipse preferences, and search on step.
2. Enable Use Step Filters
3. Add step filters. Try org.springframework.*

And your done!

You can enable and disable the Step filters in the preferences, simply click the button indicated below in the screenshot or by right clicking the background in the Debug view and select Use Step Filters.


Easy to use, saves a lot of time, nuf' said, start using it.

0 comments: