caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "HENRIKSON, JEFFREY" <JEFHEN@SAFECO.com>
To: <caml-list@inria.fr>
Subject: RE: [Caml-list] How do I get a stack trace in a running program?
Date: Mon, 10 Jan 2005 11:04:29 -0800	[thread overview]
Message-ID: <9410EC84C0872141B27A2726613EF45D02A52E24@psmrdcex01.psm.pin.safeco.com> (raw)

> Therefore it seems there is no way to trigger the printing of 
> backtraces except by modifying the sources to the OCaml 
> compuiler. Except that possibly you could write a C extension 
> which calls caml_print_exception_backtrace, if that symbol is 
> visible, and it might do the right thing, with luck!
> 
> It would be really nice if OCaml (a) recorded the function 
> parameters in backtraces, and (b) made available the 
> backtraces programmatically. Both Java and Perl do this, so 
> there is no excuse for our favorite language not to do it too!

I brought this up on the list a year or two back.  I still see this as a
stumbling block on the path toward production code in ocaml.  One use
case was wanting to be able to email bug reports from crashes on user
machines back to myself.  Only having the ability to print on stdout
without compiler modification makes this a headache.

I do see parameter recording and printing as necessary for a robust
implementation.  In the toplevel, it seems that printing a stack frame
parameter means the same thing as printing a value.  It should be
configurable as a default behavior to print uncaught exceptions with a
stack backtrace, perhaps with some kind of #turn_on_backtrace_printing
toplevel command.  However, in binary executables, I would be happy to
have binary runtime parameter printing, ala the OReily book's C
interface chapter.  Even a supported way to configure binary parameter
printing in the toplevel via a user handler would be very helpful for
me.  I had a C hack to get a backtrace out sans parameters in the
toplevel in version 3.04, but it broke when I went to 3.06.

Regards,


Jeff Henrikson



             reply	other threads:[~2005-01-10 19:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 19:04 HENRIKSON, JEFFREY [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-10 17:20 Alex Baretta
2005-01-10 17:58 ` [Caml-list] " Richard Jones
2005-01-10 18:09   ` Alex Baretta
2005-01-11 10:30     ` Alex Baretta
     [not found]       ` <20050111103546.GA16257@furbychan.cocan.org>
2005-01-11 10:59         ` Alex Baretta

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=9410EC84C0872141B27A2726613EF45D02A52E24@psmrdcex01.psm.pin.safeco.com \
    --to=jefhen@safeco.com \
    --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;
as well as URLs for NNTP newsgroup(s).