[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Adam P. Jenkins <ajenkins@c...> |
| Subject: | Stack traces |
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-----