Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Showing exception details while debugging(Cannot find how to view uncaught exception object when a thread is suspended.)
Showing exception details while debugging [message #874947] Mon, 21 May 2012 16:57 Go to next message
Alex O is currently offline Alex O
Messages: 2
Registered: May 2012
Junior Member
Hey, I have a problem which has vexed me for many days. It goes something like this:

I tell Eclipse to break on all uncaught exceptions, which it does do.

I run my code in debug mode.

Eclipse breaks on a RuntimeException, but the code it breaks on is not my code, and I do not have the source. I cannot step through, view, or watch any expressions in the code surrounding the place the exception is thrown at.

The debug window shows "Thread X is suspended (RuntimeException)", but I cannot view the exception (I can't see the message, the callstack trace, any inner exceptions, etc.) I would like to see these things, but I can't find any way of doing it. Right-clicking into the debug window doesn't give me anything useful, and hovering over any of the text in the window doesn't do anything either.

Anyone know how to place a watch on the exception object or at least view its message?

I'm attaching a screenshot of what I'm talking about.

PS.

I know about the special breakpoint for exceptions. Using it doesn't seem to change much. Breaking on the exception isn't the problem; trying to do anything useful with it afterwards is.

index.php/fa/9828/0/
  • Attachment: problem.png
    (Size: 128.46KB, Downloaded 443 times)
Re: Showing exception details while debugging [message #874967 is a reply to message #874947] Mon, 21 May 2012 17:51 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 977
Registered: July 2009
Senior Member
The following preference should help you:

Java > Debug > Open popup when suspend on exception

When you hit an exception breakpoint a popup with the exception object comes up.
You may want to push it to the Expression view (Ctrl-Shift-I), so you can better drill into the exception object.

I typically enable this option only temporarily, because I don't like to always get the popup thrown in my face Smile
but it seems to be the best available solution for your problem.

best,
Stephan
Re: Showing exception details while debugging [message #875374 is a reply to message #874967] Tue, 22 May 2012 12:11 Go to previous messageGo to next message
Alex O is currently offline Alex O
Messages: 2
Registered: May 2012
Junior Member
That's exactly what I needed, thanks man.

For future people searching, this is the solution in picture form:

index.php/fa/9837/0/

Once the option "Open popup when suspended on exception" in Window->Preferences->Java->Debug is turned on, you can left-click on the exception in the Debug window and a popup will display (much like mousing over on a variable name during debug stepping) with Exception details:

index.php/fa/9838/0/

  • Attachment: scr1.png
    (Size: 37.90KB, Downloaded 424 times)
  • Attachment: scr2.png
    (Size: 24.88KB, Downloaded 420 times)
Re: Showing exception details while debugging [message #1043056 is a reply to message #874947] Wed, 17 April 2013 04:03 Go to previous message
Pierpaolo Paris is currently offline Pierpaolo Paris
Messages: 1
Registered: April 2013
Junior Member
I have the same problem as Alex O. I checked "open popup when suspend on exception", as Stephan Herrmann said, but popup doesn't open. How can I find out if there is another problem with Eclipse? In the error log there isn't nothing strange.
My Eclipse version is 4.2.1
Previous Topic:Refactoring Participants for Java Refactoring and Model Refactoring
Next Topic:How do I read from the console of the target platform?
Goto Forum:
  


Current Time: Thu Jul 24 04:26:48 EDT 2014

Powered by FUDForum. Page generated in 0.02550 seconds