From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA17819 for caml-red; Mon, 30 Oct 2000 12:08:33 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA13493 for ; Mon, 30 Oct 2000 08:57:31 +0100 (MET) Received: from cs.huji.ac.il (cs.huji.ac.il [132.65.16.10]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id e9U7vUr06032; Mon, 30 Oct 2000 08:57:31 +0100 (MET) Received: from zigzag.cs.huji.ac.il ([132.65.208.204]) by cs.huji.ac.il with esmtp (Exim 3.16 #1) id 13q9ov-0000jj-00; Mon, 30 Oct 2000 09:57:29 +0200 Received: (from orodeh@localhost) by zigzag.cs.huji.ac.il (8.9.3/1.1c) id JAA31893; Mon, 30 Oct 2000 09:57:29 +0200 Date: Mon, 30 Oct 2000 09:57:29 +0200 (IST) From: Ohad Rodeh To: Pierre Weis cc: Mattias Waldau , caml-list@inria.fr Subject: Re: Where did the exception occur? In-Reply-To: <200010300736.IAA14139@pauillac.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis@pauillac.inria.fr List, 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 ?). Ohad. 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, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/ > > >