Stack traces

From: Adam P. Jenkins (
Date: Wed Jul 23 1997 - 23:33:18 MET DST

Date: Wed, 23 Jul 1997 17:33:18 -0400
Message-Id: <>
From: "Adam P. Jenkins" <>
Subject: Stack traces

        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

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 P. Jenkins				Office Phone: (413) 545-3059

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


This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:11 MET