Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stacktrace inside of the eclipse debugger

Tags:

java

eclipse

I have an exception that's not getting handled very well. I'm at a line in the debugger where I have the exception in hand, but it's not in my code, so I can't just log it at that point. So I'm sitting in the debugger with the exception in my variables window and I'm trying to figure out how to get the stack trace from it so i can find where the exception originated and handle it better.

Ideas?

like image 510
Thom Avatar asked Oct 08 '12 13:10

Thom


People also ask

How do I get full Stacktrace in Eclipse?

To simplify the accepted answer let us consider a simple notation. Hence you have the entire stack. But MAKE SURE CHECK BOX FOR “limit console output” is NOT checked under run/debug drop down --> console in eclipse preferences. You can use the following code to get more clarity.

What is stack trace in debugging?

A stack trace is a report that provides information about program subroutines. It is commonly used for certain kinds of debugging, where a stack trace can help software engineers figure out where a problem lies or how various subroutines work together during execution.

How do I view debug logs in Eclipse?

In your Eclipse development interface, select Window > Preferences. This mode displays verbose debug logs so you can view them in the Eclipse console window while you are previewing the app.


1 Answers

In the Debug Perspective, show the Expressions View. Now you can add a expression of e.printStackTrace() where e is your variable.

Alternatively, you can change your expression to getStackTrace() and expand the StackTraceElement array in the Expressions output window.

like image 174
David Grant Avatar answered Nov 12 '22 10:11

David Grant