The Objective Caml language will only produce stack traces if you ask for them just right - what are the requirements for both bytecode and native code?
You can obtain a stack trace from a thread – by calling the getStackTrace method on that Thread instance. This invocation returns an array of StackTraceElement, from which details about stack frames of the thread can be extracted.
Just use new Throwable(). printStackTrace() method and it will print complete stack trace from where a method is called, into the console.
You can easily see the stack trace in JavaScript by adding the following into your code: console. trace(); And you'll get an outputted stack trace.
Compile with -g and set environment variable OCAMLRUNPARAM=b
Some Printexc functions let you do this programmatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With