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

Closed
vicuna opened this issue Sep 16, 2003 · 2 comments
Closed

ocaml : Printer in ocamldebug #8286

vicuna opened this issue Sep 16, 2003 · 2 comments

Comments

@vicuna
Copy link

vicuna 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

Hello,

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 :

printer.ml

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 printer.ml
$ 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

@vicuna
Copy link
Author

vicuna 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

@mshinwell
Copy link
Contributor

This is so old that I think the value in retaining it open is insufficiently high.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants