Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] ocamldebug: User-defined printers for abstract data types?

83 views
Skip to first unread message

Stefan Ratschan

unread,
Mar 27, 2010, 7:45:50 AM3/27/10
to caml...@yquem.inria.fr
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

Florent...@imag.fr

unread,
Mar 27, 2010, 8:58:27 AM3/27/10
to caml...@yquem.inria.fr
Hello,

The printing of Big_int is possible and AFAIK Big_int is an abstract
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
vanilla ocaml?)
@param value_big_int the value to be printed
@return unit *)
let print_big_int (value_big_int:Big_int.big_int) =
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
http://users-tima.imag.fr/vds/ouchet/vsyml.ml

- Florent

Stefan Ratschan <stefan....@cs.cas.cz> a écrit :

0 new messages