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
how to set breakpoint at exception throw?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-07-05 (21:23)
From: John Max Skaller <skaller@m...>
Subject: Re: how to set breakpoint at exception throw?
Patrick M Doane wrote:
> On Sat, 1 Jul 2000, Gerd Stolpmann wrote:
> > Nevertheless, I have a wish: At least for programs compiled with the bytecode
> > compiler, an automatic backtrace of uncaught exceptions would be often helpful
> > (i.e I get a list where the last uncaught exception was raised, and all
> > locations where it is re-raised in the "with" clause of the "try" statement).
> > First, this type of error is very frequent, and it would save much time if the
> > location where the problem occurs were output from the failing program itself.
> > Second, under some environments it is difficult to run the debugger; not every
> > program is run from the command-line (CGI programs, for example). Furthermore,
> > such a feature would help bug searching in production environments: on such
> > machines, there is usually no debugger installed, and it is sometimes difficult
> > to reconstruct the failing data case.
> I agree strongly that such a feature is needed for Ocaml development. I
> have lost a lot of time to tracking down these problems in the past and
> this is one of the few weak points in using the language right now.
> Patrick

Hmmmm. I don't know how to do this in ocaml, but in C++ and Python it is
you create an exception one of whose components is the caught exception,
and throw it, thus preserving the whole exception chain. That is, you
can do
this in user space without special system support.

John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net