You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;;
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
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
The text was updated successfully, but these errors were encountered: