From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p0HHD3lM032083 for ; Mon, 17 Jan 2011 18:13:03 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4BAP0GNE3RVda2kGdsb2JhbACCPaE4VggVAQEBAQkJDAcRBCCpCYl6ghiERC6GegEBAwWFSwSEcIYvhhw X-IronPort-AV: E=Sophos;i="4.60,333,1291590000"; d="scan'208";a="87143720" Received: from mail-iw0-f182.google.com ([209.85.214.182]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 17 Jan 2011 18:12:57 +0100 Received: by iwn39 with SMTP id 39so5038257iwn.27 for ; Mon, 17 Jan 2011 09:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=5VADSbBRAakszXtOZ+b4tFbqfbmpsRSgbC6e6penOt0=; b=ov6TBGQrLxpOUgS+qmScoYdCWxUNRN0uPVtKpHK3cyiFr5TGr+zszyQooVcv1umpY3 1QkYBIZqvFv1xjEBNQWGD3KleqMmjoubB/OQ/+NRQp/9g+gGdevJ9M4d9wuJWOfY2BoM tfBu2MNOlwoXqBG6sN8fwi3qslrc+G2W2vUIU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=VfBSLfAAO5Vz+ChYTm0tDAMokitnGKYzn67CODXY0ZZ9MZ/Ck8dE8vGEEicx5caKjt zA+9+9cEtW4FkYny7p4gSg7g8tRYDNSFf073p6zRPJSQebGnjR+iaMoYCRtbWHAiEGXD RhPGtr44/MKqT4EFPJetMyX073pDyjl0s3I0U= Received: by 10.231.38.2 with SMTP id z2mr4469829ibd.142.1295284376625; Mon, 17 Jan 2011 09:12:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.14.10 with HTTP; Mon, 17 Jan 2011 09:12:36 -0800 (PST) In-Reply-To: <560327307.145239.1295283749745.JavaMail.root@zmbs4.inria.fr> References: <560327307.145239.1295283749745.JavaMail.root@zmbs4.inria.fr> From: Ashish Agarwal Date: Mon, 17 Jan 2011 12:12:36 -0500 Message-ID: To: Xavier Clerc Cc: Caml List Content-Type: multipart/alternative; boundary=00221504879b26eab9049a0de519 Subject: Re: [Caml-list] printing an exception changes printed backtrace --00221504879b26eab9049a0de519 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Oops. Forgot about OCAMLRUNPARAM. Both your and my example work now. Okay, this resolves the issue in some sense; you have to be careful about exceptions being raised that you don't see. Thanks for the explanations. On Mon, Jan 17, 2011 at 12:02 PM, Xavier Clerc wrote: > > > ------------------------------ > > *De: *"Ashish Agarwal" > *=C0: *"xclerc" > *Cc: *"Caml List" > *Envoy=E9: *Lundi 17 Janvier 2011 17:41:13 > *Objet: *Re: [Caml-list] printing an exception changes printed backtrace > > > On Mon, Jan 17, 2011 at 10:37 AM, xclerc wrote: > > >> The underlying problem is that "Printexc.print_backtrace" prints the >> backtrace >> for the last exception raised... which can be one raised by >> "Printf.eprintf" or >> "Printexc.to_string", but locally caught and not exposed to the outside >> world. >> > > Okay, that makes sense. > > > >> You will get different backtraces according to the value of >> "custom_printer". >> > > I'm actually getting the same output (just "Not_found" printed). Tried > native and byte code, on two different systems. > > Based on your explanation, I was expecting the following to give different > output if you change true to false. But actually nothing is printed out in > any case. So I'm really unclear now as to what print_backtrace does. > > Are you sure that you compiled the source with the "-g" option, > *and* set the OCAMLRUNPARAM environment variable to "b"? > > > Regards, > > Xavier Clerc > > --00221504879b26eab9049a0de519 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Oops. Forgot about OCAMLRUNPARAM. Both your and my example work now. Okay, = this resolves the issue in some sense; you have to be careful about excepti= ons being raised that you don't see. Thanks for the explanations.


On Mon, Jan 17, 2011 at 12:02 PM, Xavier= Clerc <xavie= r.clerc@inria.fr> wrote:
De: "Ashish Agarwal" <= agarwal1975@gmai= l.com>
=C0: "xclerc" <xavier.clerc@inria.fr>
Cc: "Caml L= ist" <caml-= list@inria.fr>
Envoy=E9: Lundi 17 Janvier 2011 17:41:13
Objet: Re: [Caml-= list] printing an exception changes printed backtrace

=
On Mon, Jan 17, 2011 at 10:37 AM, xclerc <xavier.clerc@inria.fr> wrote:
=A0
The underlying problem is that "Printexc.print_backtrace" prints = the backtrace
for the last exception raised... which can be one raised b= y "Printf.eprintf" or
"Printexc.to_string", but loca= lly caught and not exposed to the outside world.

Okay, that makes sense.=A0

<= /div>
=A0
You = will get different backtraces according to the value of "custom_printe= r".

I'm actually getting the same output (= just "Not_found" printed). Tried native and byte code, on two dif= ferent systems.

Based on your explanation, I was e= xpecting the following to give different output if you change true to false= . But actually nothing is printed out in any case. So I'm really unclea= r now as to what print_backtrace does.
Are you sure that you compiled the source with the= "-g" option,
*and* set the OCAMLRUNPARAM environment variable= to "b"?


Regards,

Xavier Clerc


--00221504879b26eab9049a0de519--