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 XAA28362 for caml-red; Wed, 5 Jul 2000 23:23:12 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA04475 for ; Tue, 4 Jul 2000 16:41:04 +0200 (MET DST) Received: from localhost.localdomain (starvin-marvin98.zip.com.au [210.23.142.98]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e64EevH01871; Tue, 4 Jul 2000 16:40:58 +0200 (MET DST) Received: from maxtal.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id AAA20486; Wed, 5 Jul 2000 00:43:07 +1000 Message-ID: <3961F7FA.643D7863@maxtal.com.au> Date: Wed, 05 Jul 2000 00:43:06 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Patrick M Doane CC: Gerd Stolpmann , Xavier Leroy , Scott McPeak , caml-list@inria.fr Subject: Re: how to set breakpoint at exception throw? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis@pauillac.inria.fr Patrick M Doane wrote: > > On Sat, 1 Jul 2000, Gerd Stolpmann wrote: > > > Nevertheless, I have a wish: At least for programs compiled with the bytecode > > compiler, an automatic backtrace of uncaught exceptions would be often helpful > > (i.e I get a list where the last uncaught exception was raised, and all > > locations where it is re-raised in the "with" clause of the "try" statement). > > First, this type of error is very frequent, and it would save much time if the > > location where the problem occurs were output from the failing program itself. > > Second, under some environments it is difficult to run the debugger; not every > > program is run from the command-line (CGI programs, for example). Furthermore, > > such a feature would help bug searching in production environments: on such > > machines, there is usually no debugger installed, and it is sometimes difficult > > to reconstruct the failing data case. > > I agree strongly that such a feature is needed for Ocaml development. I > have lost a lot of time to tracking down these problems in the past and > this is one of the few weak points in using the language right now. > > Patrick Hmmmm. I don't know how to do this in ocaml, but in C++ and Python it is easy: you create an exception one of whose components is the caught exception, and throw it, thus preserving the whole exception chain. That is, you can do this in user space without special system support. -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net