From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id A27377F02D for ; Sun, 19 Oct 2014 20:03:21 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=pra; client-ip=188.64.184.40; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=mailfrom; client-ip=188.64.184.40; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@bluechip4.ukhost4u.com) identity=helo; client-ip=188.64.184.40; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="postmaster@bluechip4.ukhost4u.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkBALf7Q1S8QLgoemdsb2JhbABbg15YzBeIXhYBEQEBCwcNCTcLhEFjGjQCTIhWAQibfKQBlSMFlkaIQ4Y4ijmHeWsBgkoBAQE X-IPAS-Result: AmkBALf7Q1S8QLgoemdsb2JhbABbg15YzBeIXhYBEQEBCwcNCTcLhEFjGjQCTIhWAQibfKQBlSMFlkaIQ4Y4ijmHeWsBgkoBAQE X-IronPort-AV: E=Sophos;i="5.04,749,1406584800"; d="scan'208";a="83838350" Received: from bluechip4.ukhost4u.com ([188.64.184.40]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Oct 2014 20:03:20 +0200 Received: from [86.26.5.13] (port=50164 helo=[192.168.0.3]) by bluechip4.ukhost4u.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.82) (envelope-from ) id 1Xfup6-002Oba-Br for caml-list@inria.fr; Sun, 19 Oct 2014 19:03:20 +0100 Message-ID: <5443FCE6.50206@coherentgraphics.co.uk> Date: Sun, 19 Oct 2014 19:03:18 +0100 From: John Whitington User-Agent: Postbox 3.0.11 (Macintosh/20140602) MIME-Version: 1.0 To: "caml-list@inria.fr" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bluechip4.ukhost4u.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coherentgraphics.co.uk X-Get-Message-Sender-Via: bluechip4.ukhost4u.com: authenticated_id: john@coherentgraphics.co.uk Subject: [Caml-list] ANN: exn-source - exception backtraces with source code printing 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/