From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 5DE43BBAF for ; Sat, 27 Mar 2010 13:58:12 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvMDAHqdrUuBWB4RnGdsb2JhbACDGYwFL4t7AQEBAQEICwgJEyKtapBHgSuCbGoE X-IronPort-AV: E=Sophos;i="4.51,319,1267398000"; d="scan'208";a="47582463" Received: from mx2.imag.fr (HELO rominette.imag.fr) ([129.88.30.17]) by mail3-smtp-sop.national.inria.fr with ESMTP; 27 Mar 2010 13:58:11 +0100 Received: from trottinette.imag.fr (trottinette.imag.fr [129.88.34.202]) by rominette.imag.fr (8.13.8/8.13.8) with ESMTP id o2RCs8wi025648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 27 Mar 2010 13:54:09 +0100 Received: from trottinette.imag.fr (localhost.imag.fr [127.0.0.1]) by trottinette.imag.fr (8.13.8/8.13.8/ImagV2.1.feuille) with ESMTP id o2RCwEAP005627 for ; Sat, 27 Mar 2010 13:58:14 +0100 Received: (from apache@localhost) by trottinette.imag.fr (8.13.8/8.13.8/Submit) id o2RCwEXG005626 for caml-list@yquem.inria.fr; Sat, 27 Mar 2010 13:58:14 +0100 X-Authentication-Warning: trottinette.imag.fr: apache set sender to ouchet@imag.fr using -f Received: from AGrenoble-552-1-185-47.w109-208.abo.wanadoo.fr (AGrenoble-552-1-185-47.w109-208.abo.wanadoo.fr [109.208.240.47]) by webmail.imag.fr (Horde Framework) with HTTP; Sat, 27 Mar 2010 13:58:14 +0100 Message-ID: <20100327135814.25675icryz1zvx7q@webmail.imag.fr> Date: Sat, 27 Mar 2010 13:58:14 +0100 From: Florent.Ouchet@imag.fr To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ocamldebug: User-defined printers for abstract data types? References: <1269690338.3027.41.camel@ratschan-laptop> In-Reply-To: <1269690338.3027.41.camel@ratschan-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.3.6) X-MI2S-Agent: webmail 3.3.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (rominette.imag.fr [129.88.30.17]); Sat, 27 Mar 2010 13:54:09 +0100 (CET) X-IMAG-MailScanner-Information: Please contact MI2S MIM for more information X-MailScanner-ID: o2RCs8wi025648 X-IMAG-MailScanner: Found to be clean X-IMAG-MailScanner-SpamCheck: X-IMAG-MailScanner-From: ouchet@imag.fr MailScanner-NULL-Check: 1270299249.30505@7yPXvDSkOQkryvJg3IxcLQ X-Spam: no; 0.00; ocamldebug:01 afaik:01 ocaml:01 printf:01 debugger:01 cmo:01 ocaml:01 ocamldebug:01 beginner's:01 bug:01 beginners:01 abstract:01 abstract:01 symbolic:01 caml-list:01 Hello, The printing of Big_int is possible and AFAIK Big_int is an abstract =20 data type. The following code is part of DebugPrinter.ml in VSYML [1]: (** custom debug printer for big_int values (why is it missing in =20 vanilla ocaml?) @param value_big_int the value to be printed @return unit *) let print_big_int (value_big_int:Big_int.big_int) =3D Format.printf "%s" (Big_int.string_of_big_int value_big_int);; And it is loaded by the following commands in the debugger: load_printer build/debug/DebugPrinter.cmo install_printer DebugPrinter.print_big_int [1] VSYML VHDL Symbolic Simulator in OCaml =20 http://users-tima.imag.fr/vds/ouchet/vsyml.ml - Florent Stefan Ratschan a =C3=A9crit=C2=A0: > The ocamldebug manual entry for load_printer says: "The loaded file does > not have direct access to the modules of the program being debugged." > > So I have to put the whole printer definition into the loaded file. But > then, how can one write a printer for abstract data types? External > files do not have access to those. > > Stefan Ratschan > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >