Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001836OCamlOCaml generalpublic2003-09-16 18:032004-02-15 11:49
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001836: ocaml : Printer in ocamldebug
DescriptionTested versions : 3.06-21 (Debian) and 3.07beta2


There are problems with the printers in ocamldebug. Some printers are not
taken in account even if their code is correct. And sometimes, the message
<printer ***** raised an exception> is displayed although the corresponding
function is correct.

I didn't manage to get a minimal example with an exception, but in the
following example, the function print_term doesn't work as a printer, even if
it works inside the program.

Here is the file in question :
type term = { mutable args : term list; mutable parent : term };;
let rec term_null = { args = []; parent = term_null };;
let rec print_term t = print_string ("toto");
     if t.term_args <> [] then print_char '*';;
let a = { term_args = [] ;
           term_parent = term_null };;
print_term a;;

Then the steps I made to produce the error :

$ ocamlc -g
$ ocamldebug ./a.out
         Objective Caml Debugger version 3.06

(ocd) load_printer printer.cmo
totoFile ./printer.cmo loaded
(ocd) install_printer Printer.print_term
(ocd) goto 16
(ocd) p a
a : term =
   {args = [];
    parent =
     {args = [];
      parent = ...

But the result "a : term = toto" is expected.

Yours faithfully,

  Prakash Countcham

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
administrator (administrator)
2004-02-15 11:49

From within module Printer, "a" has type "term", not "Printer.term" as expected
by the user-installed printer. I agree this is confusing, but it looks hard to
fix. Classified as "feature wish". -XL, 2004-02-15

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker