caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Backtracting exceptions in toplevel
@ 2010-03-29 19:15 ` C. Fr
  2010-03-29 20:58   ` [Caml-list] " Yoann Padioleau
  2010-03-29 22:45   ` Jake Donham
  0 siblings, 2 replies; 3+ messages in thread
From: C. Fr @ 2010-03-29 19:15 UTC (permalink / raw)
  To: caml-list

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!


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Backtracting exceptions in toplevel
  2010-03-29 19:15 ` Backtracting exceptions in toplevel C. Fr
@ 2010-03-29 20:58   ` Yoann Padioleau
  2010-03-29 22:45   ` Jake Donham
  1 sibling, 0 replies; 3+ messages in thread
From: Yoann Padioleau @ 2010-03-29 20:58 UTC (permalink / raw)
  To: C.Fr; +Cc: caml-list

There is Printexc.get_backtrace 
since ocaml 3.11 I think.

On Mar 29, 2010, at 12:15 PM, C. Fr wrote:

> 
> 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
> 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Backtracting exceptions in toplevel
  2010-03-29 19:15 ` Backtracting exceptions in toplevel C. Fr
  2010-03-29 20:58   ` [Caml-list] " Yoann Padioleau
@ 2010-03-29 22:45   ` Jake Donham
  1 sibling, 0 replies; 3+ messages in thread
From: Jake Donham @ 2010-03-29 22:45 UTC (permalink / raw)
  To: C. Fr; +Cc: caml-list

On Mon, Mar 29, 2010 at 12:15 PM, C. Fr <newsgroups.fr@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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-29 22:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AcrPdCfVEZxg80SNSyKrkuUzJ6BqJg==>
2010-03-29 19:15 ` Backtracting exceptions in toplevel C. Fr
2010-03-29 20:58   ` [Caml-list] " Yoann Padioleau
2010-03-29 22:45   ` Jake Donham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).