English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Getting exception backtraces without exiting ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-31 (15:47)
From: Denis Bueno <dbueno@g...>
Subject: Getting exception backtraces without exiting ocaml

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

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?