When the program has stopped at a breakpoint, I want to copy the current stack trace (the call stack) and paste it into a text file.
Unfortunately, the current version of IntelliJ Idea does not provide such functionality in the debugger frames window.
You can use:
The solution is to add a special watch (the green + in the Variables window of the debugger), either
new Exception("debug").getStackTrace()
or
org.apache.commons.lang.StringUtils.join(new Exception("debug").getStackTrace(),"\n")
It is possible to copy (and paste as text) the value of such watch, and this value is the stack trace.
(You should be able to use String.join() in Java 8 or TextUtils.join(delimiter, array) in Android)
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.