From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id E1D74BB9A for ; Tue, 8 Nov 2005 10:28:21 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jA89SLAD002364 for ; Tue, 8 Nov 2005 10:28:21 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA31745 for ; Tue, 8 Nov 2005 10:28:20 +0100 (MET) Received: from mail.barettadeit.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jA89SKwQ002359 for ; Tue, 8 Nov 2005 10:28:20 +0100 Received: from [10.0.0.10] (host73-158.pool8263.interbusiness.it [82.63.158.73]) by mail.barettadeit.com (Postfix) with ESMTP id 21B7D112E1C; Tue, 8 Nov 2005 10:33:06 +0100 (CET) Message-ID: <43707E30.2040405@barettadeit.com> Date: Tue, 08 Nov 2005 11:30:08 +0100 From: Alessandro Baretta User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nicolas Cannasse Cc: skaller , caml-list@inria.fr Subject: Re: [Caml-list] Seeking exception source References: <1131416033.23991.57.camel@rosella> <001e01c5e443$c7259d40$0c05a8c0@PWarp> In-Reply-To: <001e01c5e443$c7259d40$0c05a8c0@PWarp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43706FB5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43706FB4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 baretta:01 caml-list:01 cannasse:01 bytecode:01 ocamlrun:01 backtrace:01 bytecode:01 backtrace:01 terminate:01 uncaught:01 ocaml:01 wrote:01 exception:01 exception:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 Nicolas Cannasse wrote: >> I am occasionally annoyed by Not_found propagating to my >> top level function .. meaning the error could be anywhere >> at all in my program. > > > At that time the best is to run your program in bytecode with debug > infos using ocamlrun -b so you'll get full backtrace informations. It > would be better for such debug informations (not all the types but only > the bytecode -> source positions) to be included by default, and always > have backtrace turned on. In many cases this is completely inadequate. The AS/Xcaml application server, for example, cannot terminate on an uncaught exception in a program module. The main loop must catch the exception and do its best to report it, without aborting the execution of the server. This means that I need to get the backtrace within Ocaml code by applying some kind of function to the exception object. I tried to write a C function providing this kind of information, but I never managed to get it to work. Alex