Eclipse Tips: Debugging your multi-thread application

One of difficulty in debugging a multi-thread application is that there are several threads running at one time and if you are defining a standard breakpoint in your application, it will only break the related thread. The other threads will be still running.

Eclipse actually has provided a tool to break all threads in the same JVM which can be quite useful in such case. You must open the breakpoint properties window from your breakpoint definition and there you will get a dialog like following.

2009-08-20_1649

The bottom combo box can be changed to suspend VM.

2009-08-20_1649b

If you do something like this your entire VM will be suspended in case of a breakpoint is reached. That won’t make creating a multi-thread any easier, but at least the tool will help you locate the bug you create.

Leave a Reply

Your email address will not be published. Required fields are marked *