简体   繁体   中英

How to get stack trace in Processing debugger

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!

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM