From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA20331 for caml-redistribution; Thu, 24 Jul 1997 09:35:19 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA12798 for ; Wed, 23 Jul 1997 23:33:27 +0200 (MET DST) Received: from kalgoorlie.cs.umass.edu (ajenkins@kalgoorlie.cs.umass.edu [128.119.41.180]) by nez-perce.inria.fr (8.8.5/8.8.5) with ESMTP id XAA21940 for ; Wed, 23 Jul 1997 23:33:20 +0200 (MET DST) Received: (from ajenkins@localhost) by kalgoorlie.cs.umass.edu (8.8.5/8.8.6) id RAA16346; Wed, 23 Jul 1997 17:33:18 -0400 Date: Wed, 23 Jul 1997 17:33:18 -0400 Message-Id: <199707232133.RAA16346@kalgoorlie.cs.umass.edu> From: "Adam P. Jenkins" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: caml-list@inria.fr Subject: Stack traces X-Mailer: VM 6.31 under 20.2 XEmacs Lucid Sender: weis 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-----