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: 6777 Reporter:@gasche Status: acknowledged (set by @damiendoligez on 2015-02-23T22:02:26Z) Resolution: open Priority: low Severity: minor Version: 4.02.1 Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
ocamldebug installed printers behave differently depending on whether the type of the variable being printed is defined inside the module being stepped through, or in another compilation unit. If the type is defined in the current module, installed custom printers are not used.
Steps to reproduce
test1.ml:
type t = T_with_default_printer
let f (x : t) = x
let () = ignore (f T_with_default_printer)
test2a.ml:
type u = U_with_default_printer
test2b.ml:
open Test2a
let f (x : u) = x
let () = ignore (f U_with_default_printer)
If this was considered normal or at least "will not attempt to fix" by the people that know how the debugger should behave, then we could at least clearly document the behavior. It took me some time to understand why my install_printer didn't work.
I can write the corresponding documentation if someone confirms that is the proper course of actions.
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
This printer currently not work because odb doesn't call printer if the type is defined in the same module of the breakpoint.
Details: ocaml/ocaml#6777
Original bug ID: 6777
Reporter: @gasche
Status: acknowledged (set by @damiendoligez on 2015-02-23T22:02:26Z)
Resolution: open
Priority: low
Severity: minor
Version: 4.02.1
Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
ocamldebug installed printers behave differently depending on whether the type of the variable being printed is defined inside the module being stepped through, or in another compilation unit. If the type is defined in the current module, installed custom printers are not used.
Steps to reproduce
test1.ml:
type t = T_with_default_printer
let f (x : t) = x
let () = ignore (f T_with_default_printer)
test2a.ml:
type u = U_with_default_printer
test2b.ml:
open Test2a
let f (x : u) = x
let () = ignore (f U_with_default_printer)
test3.ml:
let print_t buf (_ : Test1.t) = Format.fprintf buf "T-custom@."
let print_u buf (_ : Test2a.u) = Format.fprintf buf "U-custom@."
comp.sh:
ocamlc -g test1.ml -o test1.byte
ocamlc -g test2a.ml test2b.ml -o test2.byte
ocamlc -g test3.ml
test1.debug:
load_printer "test3.cmo"
install_printer Test3.print_t
run
break Test1.f
goto 0
run
print x
test2.debug:
load_printer "test3.cmo"
install_printer Test3.print_u
run
break Test2b.f
goto 0
run
print x
$ ocamldebug test1.byte
OCaml Debugger version 4.02.1
(ocd) source test1.debug
[...]
x: t = T_with_default_printer
$ ocamldebug test2.byte
OCaml Debugger version 4.02.1
(ocd) source test2.debug
[...]
x: Test2a.u = U-custom
The text was updated successfully, but these errors were encountered: