Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Stack traces
@ 1997-07-23 21:33 Adam P. Jenkins
  1997-07-24  7:35 ` Pierre Weis
  0 siblings, 1 reply; 2+ messages in thread
From: Adam P. Jenkins @ 1997-07-23 21:33 UTC (permalink / raw)
  To: caml-list

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-----





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-07-24  7:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-23 21:33 Stack traces Adam P. Jenkins
1997-07-24  7:35 ` Pierre Weis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox