From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id C9D477F02D for ; Mon, 20 Oct 2014 11:15:29 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of nicolas.boulay@gmail.com) identity=pra; client-ip=209.85.223.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.boulay@gmail.com"; x-sender="nicolas.boulay@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of nicolas.boulay@gmail.com designates 209.85.223.175 as permitted sender) identity=mailfrom; client-ip=209.85.223.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.boulay@gmail.com"; x-sender="nicolas.boulay@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f175.google.com) identity=helo; client-ip=209.85.223.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="nicolas.boulay@gmail.com"; x-sender="postmaster@mail-ie0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlMBAOrRRFTRVd+vlWdsb2JhbABcg2FcgwK5E44egXCHTYELBxYBEQEBAQEHDQkJEjCEAwEBAwESER0BLQsBAwELAQUFBAMEGh0CAiISAQUBChIGExIQiAkDCQgNoTNuizCFAogtJwMKhjEBAQgCARkBBQ6QP4MCgVQFhRUFikqGYocTgTA8kDWCDBgpgW+BIleBRTsvAYJKAQEB X-IPAS-Result: AlMBAOrRRFTRVd+vlWdsb2JhbABcg2FcgwK5E44egXCHTYELBxYBEQEBAQEHDQkJEjCEAwEBAwESER0BLQsBAwELAQUFBAMEGh0CAiISAQUBChIGExIQiAkDCQgNoTNuizCFAogtJwMKhjEBAQgCARkBBQ6QP4MCgVQFhRUFikqGYocTgTA8kDWCDBgpgW+BIleBRTsvAYJKAQEB X-IronPort-AV: E=Sophos;i="5.04,754,1406584800"; d="scan'208";a="101993344" Received: from mail-ie0-f175.google.com ([209.85.223.175]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Oct 2014 11:15:28 +0200 Received: by mail-ie0-f175.google.com with SMTP id x19so4331874ier.34 for ; Mon, 20 Oct 2014 02:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=waBlM+bR7Y6r4bT09VMDZedxlwmGk55WKoGElbEtvYY=; b=BwenCKWwh/JRO8NYTE2FRFGbQU80HhnofOPxPwAj665G44zVHkdOqqsgaKokzHkhUL OtGlqzTug3+RT83SIGhFgNJGdM2EEAExMehI7B2kac8OnllQ9Df1N7icLmMZ1eaV214i RnqSMbmsTHXsvZODPevc6RIj4TshdSYC3+RK1BEl7FTSYgP7i3RHAV+RciiDxSBB3Wq0 ts3+7l6TIgGHdRoLDn/f0rJZ0p0EToTxs8I/VZ2txuIFpcqC3yqrJ0CHyAR3YGihYJZd toD2GESbo8j4L4Tr15RkM1NCyTEIHZIvjHIzFXybL+PBIYjApj2/T8JenVW2KlD9PPnr gCfg== MIME-Version: 1.0 X-Received: by 10.50.78.166 with SMTP id c6mr16847755igx.16.1413796527970; Mon, 20 Oct 2014 02:15:27 -0700 (PDT) Sender: nicolas.boulay@gmail.com Received: by 10.50.28.44 with HTTP; Mon, 20 Oct 2014 02:15:27 -0700 (PDT) In-Reply-To: <5443FCE6.50206@coherentgraphics.co.uk> References: <5443FCE6.50206@coherentgraphics.co.uk> Date: Mon, 20 Oct 2014 11:15:27 +0200 X-Google-Sender-Auth: Gvr36Uz2ntliPpS0uDUmeJ-kIkg Message-ID: From: Nicolas Boulay To: John Whitington Cc: "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=089e01633df2d59d0b0505d7272f X-Validation-by: nicolas@boulay.name Subject: Re: [Caml-list] ANN: exn-source - exception backtraces with source code printing --089e01633df2d59d0b0505d7272f Content-Type: text/plain; charset=UTF-8 Very nive project ! May a suggest a different result presentation ? Most of the time, only name of the function called are usefull, its more compact than 5 lines arround the call site. One other very important feature will be the parameter value of the function call. It's value could be serialised on fixe size (<20 characters by default). On a tricky bug, the next step is to print such value, so you save time to print it with the function call. 2014-10-19 20:03 GMT+02:00 John Whitington : > Hi, > > OCaml 4.02 has new facilities for installing a new backtrace handler, and > processing the back trace symbolically. As a little proof of concept, I've > built a package which you can add to any project to get backtrace with > source code printed and highlighted: > > https://github.com/johnwhitington/exn-source > > Here's the start of a backtrace: > > http://www.coherentpdf.com/exnsource.png > > By default, it prints five lines either side, and looks the current > directory for source code. But as one can see from the screenshot, one can > add /usr/local/lib/ocaml to get stdlib source and so on... > > It's somewhat difficult to test this kind of thing (we can't use > exceptions at all inside a backtrace handler, for example), so I'm > appealing for help. Attach exn-source to your code and let me know how you > get on... > > Thanks, > > -- > John Whitington > Director, Coherent Graphics Ltd > http://www.coherentpdf.com/ > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --089e01633df2d59d0b0505d7272f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Very nive project !

May a suggest a= different result presentation ? Most of the time, only name of the functio= n called are usefull, its more compact than 5 lines arround the call site.<= br>
One other very important feature will be the parameter value o= f the function call. It's value could be serialised on fixe size (<2= 0 characters by default). On a tricky bug, the next step is to print such v= alue, so you save time to print it with the function call.

2014-10-19 20:0= 3 GMT+02:00 John Whitington <john@coherentgraphics.co.uk>= :
Hi,

OCaml 4.02 has new facilities for installing a new backtrace handler, and p= rocessing the back trace symbolically. As a little proof of concept, I'= ve built a package which you can add to any project to get backtrace with s= ource code printed and highlighted:

= https://github.com/johnwhitington/exn-source

Here's the start of a backtrace:

http= ://www.coherentpdf.com/exnsource.png

By default, it prints five lines either side, and looks the current directo= ry for source code. But as one can see from the screenshot, one can add /us= r/local/lib/ocaml to get stdlib source and so on...

It's somewhat difficult to test this kind of thing (we can't use ex= ceptions at all inside a backtrace handler, for example), so I'm appeal= ing for help. Attach exn-source to your code and let me know how you get on= ...

Thanks,

--
John Whitington
Director, Coherent Graphics Ltd
http://www.cohere= ntpdf.com/


--
Caml-list mailing list.=C2=A0 Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs

--089e01633df2d59d0b0505d7272f--