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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id ADDFFBC57 for ; Mon, 21 Jun 2010 22:48:12 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUIABptH0xQW+UMYGdsb2JhbACSYowlCyEjIsNahRsEhmg X-IronPort-AV: E=Sophos;i="4.53,455,1272837600"; d="scan'208";a="53620954" Received: from lo.gmane.org ([80.91.229.12]) by mail2-smtp-roc.national.inria.fr with ESMTP; 21 Jun 2010 22:48:12 +0200 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OQnud-0007jY-OS for caml-list@inria.fr; Mon, 21 Jun 2010 22:48:11 +0200 Received: from ks368928.kimsufi.com ([94.23.39.26]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Jun 2010 22:48:11 +0200 Received: from sylvain by ks368928.kimsufi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 21 Jun 2010 22:48:11 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: exception error trace back in ocaml Date: Mon, 21 Jun 2010 20:47:53 +0000 (UTC) Message-ID: References: <55271.216.73.250.152.1277144142.squirrel@webmail.amnh.org> X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ks368928.kimsufi.com User-Agent: slrn/pre1.0.0-11 (Linux) X-Spam: no; 0.00; le-gall:01 ocaml:01 amnh:01 traceback:01 traceback:01 ocaml:01 ocamlc:01 foo:01 re-raise:01 wrote:01 compile:01 exception:01 exception:01 argument:02 bounds:02 On 21-06-2010, lin hong wrote: > > I have problem getting a full traceback of some exception error. The > traceback looks like this: > > Fatal error: exception Invalid_argument("index out of bounds") > Raised at file "camlinternalLazy.ml", line 33, characters 10-11 > Called from file "list.ml", line 74, characters 24-34 > > But that's all I got, both camlinternalLazy.ml and list.ml are ocaml > source code, I still don't know which part of my code trigger it. Also, in > camlinternalLazy.ml line 33, there is a "try .... with e -> raise e", is > this the reason I don't have a full traceback -- Maybe something else > catch the "raise e" ? Any idea? > To get the full trace, you need to compile your code with "-g", i.e. ocamlc -g foo.ml If you don't have this debug flag, you won't see calls from the code you compiled. The "try ... with e -> raise e" just re-raise the exception and you will be able to see it in the full trace. Regards, Sylvain Le Gall