Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocaml : Printer in ocamldebug #8286

vicuna opened this Issue Sep 16, 2003 · 1 comment


None yet
2 participants
Copy link

commented Sep 16, 2003

Original bug ID: 1836
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: tools (ocaml{lex,yacc,dep,debug,...})

Bug description

Tested 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


This comment has been minimized.

Copy link

commented Feb 15, 2004

Comment author: administrator

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

@vicuna vicuna added the tools label Mar 14, 2019

@nojb nojb added the ocamldebug label Mar 15, 2019

@vicuna vicuna added the feature-wish label Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.