Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Adam P. Jenkins" <ajenkins@cs.umass.edu>
To: caml-list@inria.fr
Subject: Stack traces
Date: Wed, 23 Jul 1997 17:33:18 -0400	[thread overview]
Message-ID: <199707232133.RAA16346@kalgoorlie.cs.umass.edu> (raw)

Hi, 
	Is there any way to get a stack trace, or even core dump, when
an uncaught exception occurs in O'Caml?  Getting
 
	Fatal error: out-of-bound access in array or string

isn't much more useful than the traditional segfault, and is less
useful than a core dump; it tells me why the program crashed but not
where.  Mine is a large program so it would be hard, and messy
looking, to put "try ... with" blocks around every single array
access.

Is this a planned addition to Caml, or would it slow it down too much
to save the stack when an exception is raised?  I'm guessing the
latter, since C++ also doesn't save stack info, whereas Lisp,
Python, and Tcl all have exceptions and do save a stack trace when an
exception is raised.  I realize this might be hard for the native-code 
OCaml compiler, but what about in the bytecode interpreter?

My suggestion is, a compiler switch could be added so that when
debugging a program, the stack would be saved whenever an exception is
thrown, but then the feature could be disabled in finished code, kind
of like the way array bounds-checking can be disabled now.

Take care,
Adam

-- 
Adam P. Jenkins				Office Phone: (413) 545-3059
mailto:ajenkins@cs.umass.edu

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQBNAzBt18UAAAECALmLVRW6EP59OrypUB4uT6ADRYGB3FfyW1wACf40cvdTfOUy
QHhM8Oy4aMWZ5RNYeY5qTkCRnvtsfGSsLRxEmN0ABRG0KUFkYW0gUC4gSmVua2lu
cyA8YXBqQHR3YWluLm9pdC51bWFzcy5lZHU+
=yzSE
-----END PGP PUBLIC KEY BLOCK-----





             reply	other threads:[~1997-07-24  7:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-23 21:33 Adam P. Jenkins [this message]
1997-07-24  7:35 ` Pierre Weis

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=199707232133.RAA16346@kalgoorlie.cs.umass.edu \
    --to=ajenkins@cs.umass.edu \
    --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