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 0A6A6BB9A for ; Sat, 8 Oct 2005 20:35:57 +0200 (CEST) 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 j98IZuIV021028 for ; Sat, 8 Oct 2005 20:35:56 +0200 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 UAA25274 for ; Sat, 8 Oct 2005 20:35:56 +0200 (MET DST) Received: from relay.felk.cvut.cz (relay.felk.cvut.cz [147.32.80.7]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j98IZtqi021025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 8 Oct 2005 20:35:55 +0200 Received: from k333.felk.cvut.cz (k333.felk.cvut.cz [147.32.87.5]) by relay.felk.cvut.cz (8.13.3/8.13.3) with ESMTP id j98IZODp057558 for ; Sat, 8 Oct 2005 20:35:26 +0200 (CEST) (envelope-from kybic@fel.cvut.cz) Received: from K333/SpoolDir by k333.felk.cvut.cz (Mercury 1.48); 8 Oct 05 20:35:26 +0100 Received: from SpoolDir by K333 (Mercury 1.48); 8 Oct 05 20:35:20 +0100 Received: from localhost (147.32.84.19) by k333.felk.cvut.cz (Mercury 1.48) with ESMTP; 8 Oct 05 20:35:15 +0100 To: caml-list@inria.fr Subject: Feature wish: Localization information for exceptions Reply-To: Jan Kybic From: Jan Kybic User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Date: 08 Oct 2005 20:35:24 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: milter-sender/0.62.837 (relay.felk.cvut.cz [147.32.80.7]); Sat, 08 Oct 2005 20:35:26 +0200 X-FELK-MailScanner: Found to be clean X-FELK-MailScanner-SpamCheck: not spam, SpamAssassin (score=-4.9, required 5, autolearn=not spam, BAYES_00 -4.90) X-FELK-MailScanner-From: kybic@fel.cvut.cz X-Miltered: at concorde with ID 4348118C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4348118B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 debugger:01 byte:01 byte-code:01 ocaml:01 compiler:01 stack:01 compiler:01 native-code:01 debugger:01 ifdef:01 instrument:98 exception:01 exceptions:01 exceptions: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.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hello, I have a wish: would it be possible to print some kind of localization information when a native code Ocaml program is aborted due to exceptions such as 'index out of bounds' or 'Stack overflow'? When a program is aborted due to failed 'assert', this information is printed, so I thought maybe it would not be so difficult to do it for other exceptions too. At least knowing which function threw the exception would be great. Otherwise, localizing the cause of the error is quite time consuming. I know there is a debugger for byte code programs which can be used but for my applications (numerical calculations) the byte-code programs are too slow. If I remember correctly there is a patch for the Ocaml compiler to print the stack trace when program is aborted on exceptions. Are there plans to include such a patch into the official compiler? While I am at it, is there any chance of using native-code debugger for Ocaml? That would be an equally acceptable solution. For the moment, I am forced to instrument my program with frequent debug prints so that I can localize the problem spot. And since I need that these debug prints be completely removed for the production version in order not to slow it down, I am surrounding each debug print command with IFDEF DEBUG .. ELSE () ENDIF which is quite cumbersome and obscures the code itself. Is there any other solution? Thank you, Jan -- ------------------------------------------------------------------------- Jan Kybic tel. +420 2 2435 5721 http://cmp.felk.cvut.cz/~kybic ICQ 200569450