From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA16327; Thu, 20 Nov 2003 17:38:04 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA16235 for ; Thu, 20 Nov 2003 17:38:03 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAKGc2125968; Thu, 20 Nov 2003 17:38:02 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA15739; Thu, 20 Nov 2003 17:38:02 +0100 (MET) Date: Thu, 20 Nov 2003 17:38:02 +0100 From: Xavier Leroy To: Christian Schaller Cc: caml-list@inria.fr Subject: Re: [Caml-list] exceptions Message-ID: <20031120173802.C14255@pauillac.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from Christian.Schaller@siemens.com on Thu, Nov 20, 2003 at 05:20:54PM +0100 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 faq:01 debugging:01 ocamlc:01 backtrace:01 backtrace:01 bytecode:01 raises:01 compile:02 exception:02 stack:02 variable:03 execute:04 exceptions:04 exceptions:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Is there any way to get more details regarding exceptions? Whenever my > program raises an exception, it doesn't display the line that raised it. > > E.g. List.nth. Say, I have several of these function calls. How can I > tell which one got the wrong list or index? This should be in the FAQ somewhere: - Compile and link to bytecode with debugging info enabled ("ocamlc -g"). - Set the environment variable OCAMLRUNPARAMS to the value "b" (as in "backtrace"). - Execute your program. Voila, nice stack backtrace with line numbers. Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners