Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Where did the exception occur?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ohad Rodeh <orodeh@c...>
Subject: Re: Where did the exception occur?
  I'd like to point out, that my application (LARGE OCaml project) is
embedded in C code, so one cannot use the OCaml debugger to replay and
find the exception.  I'd be happy if a feature would be added to the
language to point out which line in the code the exception came from (I
understand this was added to SML ?).


On Mon, 30 Oct 2000, Pierre Weis wrote:

> > I am running my program from the top-level, and the programs aborts to the
> > toplevel ans says:
> >
> > Uncaught exception: Not_found.
> >
> > Is there a way to tell where the exception occured, for example program
> > languages like SICStus Prolog, Lisp, Visual C++, Visual Basic normally stops
> > in a top-loop at the stack frame of the error. Is there a similar feature in
> > OCaml?
> >
> > ----
> > Mattias Waldau
> Some programming languages use ``pushing'' exceptions (exceptions
> that push a stack frameon the control stack then try to find a
> handler), other languages use ``poping'' exceptions (exceptions pops
> stack frames directly to the next handler). Caml uses the second kind,
> which is considered more efficient. So there is no way in Caml to
> start a new top-loop where the exception occurred.
> However, you've got a nice replay debugger that allows you to step
> back anywhere in the past of the computation of your (bte-code)
> compiled program. So, you just have to go back to the point where the
> exception is raised and then use the usual top-level of the debugger.
> Hope this helps,
> Pierre Weis
> INRIA, Projet Cristal,,