Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Backtracting exceptions in toplevel

0 views
Skip to first unread message

C. Fr

unread,
Mar 29, 2010, 3:15:29 PM3/29/10
to caml...@yquem.inria.fr
Hello everyone,

It there a way to get a backtrace for exceptions occurring in the toplevel
(for example, getting more information when the stack blows)? I’ve read that
there was an equivalent of the -b option that ocamlrun uses, but I couldn’t
find any subsequent information on it.

Thanks!

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Yoann Padioleau

unread,
Mar 29, 2010, 4:58:42 PM3/29/10
to C.Fr, caml...@yquem.inria.fr
There is Printexc.get_backtrace
since ocaml 3.11 I think.

Jake Donham

unread,
Mar 29, 2010, 6:46:30 PM3/29/10
to C. Fr, caml...@yquem.inria.fr
On Mon, Mar 29, 2010 at 12:15 PM, C. Fr <newsgr...@gmail.com> wrote:
> It there a way to get a backtrace for exceptions occurring in the toplevel
> (for example, getting more information when the stack blows)? I�ve read that
> there was an equivalent of the -b option that ocamlrun uses, but I couldn�t

> find any subsequent information on it.

In 3.11.x there is Printexc.record_backtrace which controls the -b
flag, and Printexc.get_backtrace to get the trace of the last
exception.

If you want to see backtraces printed automatically in the toplevel,
try my patch:

http://ambassadortothecomputers.blogspot.com/2010/03/updated-backtrace-patch.html

Jake

0 new messages