Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: "Sébastien Hinderer" <Sebastien.Hinderer@inria.fr>,
	"caml users" <caml-list@inria.fr>
Subject: Re: [Caml-list] ANN: exn-source - exception backtraces with source code printing
Date: Thu, 23 Oct 2014 18:43:16 +0200	[thread overview]
Message-ID: <CAPFanBEW8R-HVpoPJPC_MBvZOCFMSySWnYXiD_fqhUN=4ayNpA@mail.gmail.com> (raw)
In-Reply-To: <20141023114858.GB8128@pl-59055.rocqadm.inria.fr>

[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]

exn-source produces an output using ANSI escape codes. Here is a text
version (ansifilter --text):
  http://gallium.inria.fr/~scherer/tmp/tmp/exnsource-example.text
and a HTML version
  http://gallium.inria.fr/~scherer/tmp/tmp/exnsource-example.html

To (re)produce this output I ran the command
  OCAMLRUNPARAM="b" ./cpdf -debug foo.pdf
from the the tag v1.7 of the repo
  https://github.com/johnwhitington/cpdf-source/
(after installing both camlpdf (from OPAM) and exnsource (from github))
with the following patch applied:

diff --git a/Makefile b/Makefile
index d706771..c4f9523 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ SOURCES = $(foreach x,$(MODS),$(x).ml $(x).mli)
cpdfcommandrun.ml

 RESULT = cpdf

-PACKS = camlpdf
+PACKS = camlpdf exnsource

 OCAMLNCFLAGS = -g
 OCAMLBCFLAGS = -g
diff --git a/cpdfcommandrun.ml b/cpdfcommandrun.ml
index 2a43a43..bb0af72 100644
--- a/cpdfcommandrun.ml
+++ b/cpdfcommandrun.ml
@@ -1,2 +1,4 @@
+let _ = Exnsource.add_dir ""
+
 let _ = Cpdfcommand.go ()



On Thu, Oct 23, 2014 at 1:48 PM, Sébastien Hinderer <
Sebastien.Hinderer@inria.fr> wrote:

> Hi,
>
> John Whitington (2014/10/23 09:32 +0100):
> > Hi,
> >
> > John Whitington wrote:
> > >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
>
> This seems very interesting, thanks!
>
> > >Here's the start of a backtrace:
> > >
> > >http://www.coherentpdf.com/exnsource.png
>
> Just wanted to mention that not everybody can look at pictures, so it
> would be great to show the text itself whenever it'spossible.
>
> Thanks,
> Sébastien.
>
> --
> 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
>

[-- Attachment #2: Type: text/html, Size: 3626 bytes --]

      reply	other threads:[~2014-10-23 16:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-19 18:03 John Whitington
2014-10-19 18:26 ` Gabriel Scherer
2014-10-19 18:55   ` John Whitington
2014-10-19 19:05     ` Gabriel Scherer
     [not found]       ` <54441347.904@coherentgraphics.co.uk>
2014-10-19 19:50         ` Gabriel Scherer
2014-10-20  9:15 ` Nicolas Boulay
2014-10-20  9:35 ` Peter Zotov
2014-10-20 11:52   ` John Whitington
2014-10-20 12:06     ` Peter Zotov
2014-10-20 12:15       ` Francois Berenger
2014-10-20 18:28         ` Török Edwin
2014-10-23  8:32 ` John Whitington
2014-10-23 11:48   ` Sébastien Hinderer
2014-10-23 16:43     ` Gabriel Scherer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPFanBEW8R-HVpoPJPC_MBvZOCFMSySWnYXiD_fqhUN=4ayNpA@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=Sebastien.Hinderer@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox