1

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!

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
Serj.by
  • 534
  • 5
  • 17

2 Answers2

3

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.

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
1

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.

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190