caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Getting exception backtraces without exiting ocaml
@ 2007-03-31 15:46 Denis Bueno
  2007-03-31 18:31 ` [Caml-list] " David Baelde
  2007-03-31 20:39 ` Florian Weimer
  0 siblings, 2 replies; 3+ messages in thread
From: Denis Bueno @ 2007-03-31 15:46 UTC (permalink / raw)
  To: OCaml Mailing List

All-

Is there a way to get an exception backtrace *without* having to exit
the ocaml runtime?

Some background:

I use the OUnit unit testing framework
(http://www.xs4all.nl/~mmzeeman/ocaml/) to unit test my compiler. I
like the fact that I can see *all* the test failures every time I run
the tests. That is, if one file fails to compile for some reason, I
can still see failures of other tests for independent parts of the
compiler.

This feature is only possible because OUnit catches exceptions that I
don't catch, runs Printexc.to_string on them, and continues with the
rest of the tests. However, this interferes with ocamlrun's printing
of the exception backtrace, which I really want in case of an
unexpected exception.

Can I get what I want?

-Denis


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

* Re: [Caml-list] Getting exception backtraces without exiting ocaml
  2007-03-31 15:46 Getting exception backtraces without exiting ocaml Denis Bueno
@ 2007-03-31 18:31 ` David Baelde
  2007-03-31 20:39 ` Florian Weimer
  1 sibling, 0 replies; 3+ messages in thread
From: David Baelde @ 2007-03-31 18:31 UTC (permalink / raw)
  To: Denis Bueno; +Cc: OCaml Mailing List

Hi,

When a thread throws an exception it simply exits without killing the
whole process,
and a stacktrace is issued.

Dunno if that could help...
-- 
David


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

* Re: [Caml-list] Getting exception backtraces without exiting ocaml
  2007-03-31 15:46 Getting exception backtraces without exiting ocaml Denis Bueno
  2007-03-31 18:31 ` [Caml-list] " David Baelde
@ 2007-03-31 20:39 ` Florian Weimer
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2007-03-31 20:39 UTC (permalink / raw)
  To: Denis Bueno; +Cc: OCaml Mailing List

* Denis Bueno:

> Is there a way to get an exception backtrace *without* having to exit
> the ocaml runtime?

It seems that the backtrace is unconditionally written to standard
error, so it will be difficult to obtain it even if you can keep the
process around.


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

end of thread, other threads:[~2007-03-31 20:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-31 15:46 Getting exception backtraces without exiting ocaml Denis Bueno
2007-03-31 18:31 ` [Caml-list] " David Baelde
2007-03-31 20:39 ` Florian Weimer

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