How to get stack trace in Processing debugger

985 Views Asked by At

Is there any way to show a stack trace in the Processing 3 debugger (Java mode)? Not by catching an exception. I know about e.printStackTrace(). I want to print a stack trace in the debugger at a custom breakpoint. Thanks!

2

There are 2 best solutions below

0
Kevin Workman On BEST ANSWER

I don't know of a way to view the stack in Processing's debugger. The Processing debugger is designed to be pretty barebones. If you really need this functionality, consider switching to a more advanced IDE like Eclipse or Intellij. Shameless self-promotion: here is a tutorial I wrote on using Processing in Java.

But one thing that you might try is manually printing out the stack trace by creating a new Exception:

new Exception().printStackTrace();

This will print out a stack trace to the console without actually throwing an exception. Put this line right before your break point to see the breakpoint's stack trace.

0
Jim Garrison On

If you set an exception breakpoint all IDEs will stop when the exception is thrown and show you the current stack. You cannot get a stack trace after the fact unless you print/log it somewhere at the time the exception happens.