John Whitington
2014-10-19 18:03:18 UTC
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:
Loading Image...
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/
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:
Loading Image...
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
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