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 QAA28730 for caml-red; Fri, 7 Jul 2000 16:33:51 +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 NAA29027 for ; Thu, 6 Jul 2000 13:23:15 +0200 (MET DST) Received: from jaune.inria.fr (jaune.inria.fr [128.93.11.80]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e66BN2923668; Thu, 6 Jul 2000 13:23:02 +0200 (MET DST) Received: (from ddr@localhost) by jaune.inria.fr (8.8.7/8.8.7) id NAA21079; Thu, 6 Jul 2000 13:23:00 +0200 Date: Thu, 6 Jul 2000 13:23:00 +0200 From: Daniel de Rauglaudre To: Gerd Stolpmann Cc: John Max Skaller , Patrick M Doane , Xavier Leroy , Scott McPeak , caml-list@inria.fr Subject: Re: how to set breakpoint at exception throw? Message-ID: <20000706132300.S17898@jaune.inria.fr> References: <3961F7FA.643D7863@maxtal.com.au> <0007042058420E.14914@ice> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <0007042058420E.14914@ice>; from gerd@gerd-stolpmann.de on Tue, Jul 04, 2000 at 08:19:20PM +0200 Sender: weis@pauillac.inria.fr Hello, On Tue, Jul 04, 2000 at 08:19:20PM +0200, Gerd Stolpmann wrote: > Uncaught exception: Not_found > Exception backtrace: > - File x, line 3: Not_found > - File x, line 7: Not_found > - File x, line 11: Not_found Can't camlp4 help you? ========================================= file toto.ml open Pcaml EXTEND expr: LEVEL "apply" [ [ "myraise"; e = expr LEVEL "simple" -> let bp = <:expr< $int:string_of_int (fst loc)$ >> in let ep = <:expr< $int:string_of_int (snd loc)$ >> in <:expr< raise (LocExc $e$ $str:!input_file$ ($bp$, $ep$)) >> ] ] ; END ========================================= $ ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I `camlp4 -where` -c toto.ml ========================================= file foo.ml exception LocExc of exn * string * (int * int) try try myraise Not_found with x -> (* XXX: Clean-up code here *) myraise x with x -> (* XXX: Clean-up code here *) myraise x ========================================= $ ocamlc -c -pp "camlp4o ./toto.cmo" foo.ml $ camlp4o ./toto.cmo pr_o.cmo foo.ml exception LocExc of exn * string * (int * int);; try try raise (LocExc (Not_found, "foo.ml", (63, 80))) with x -> raise (LocExc (x, "foo.ml", (139, 148))) with x -> raise (LocExc (x, "foo.ml", (199, 208)));; -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/