Reputation: 321
I'm working interactively from the Scala shell, and am wondering how I can get the call stack-trace of a command (which doesn't throw an exception)
Thanks!
Upvotes: 0
Views: 897
Reputation: 14217
You can use Ctrl-\
to run to dump, like:
println("Hello") //Use Ctrl - / to run
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.71-b15 mixed mode):
"process reaper" #28 daemon prio=10 os_prio=31 tid=0x00007ff35f8ad000 nid=0x130f waiting on condition [0x00007000000be000]
java.lang.Thread.State: TIMED_WAITING (parking)
...
Upvotes: 1
Reputation: 1706
just use (new RuntimeException).getStackTrace
(no need to throw Exception).
Upvotes: 1