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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With