Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006777OCamltools (ocaml{lex,yacc,dep,debug,...})public2015-02-11 14:002017-03-15 15:14
Reportergasche 
Assigned To 
PrioritylowSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.02.1 
Target VersionFixed in Version 
Summary0006777: ocamldebug fails to use installed printer on types defined in the module being stepped
Descriptionocamldebug 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 Reproducetest1.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
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0013268)
gasche (developer)
2015-02-11 14:02

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.
(0013331)
doligez (administrator)
2015-02-23 23:02

I think this is a "would be nice to fix", so let's keep it open.

If you want to write some documentation to describe this as a limitation of the current system, go ahead.

- Issue History
Date Modified Username Field Change
2015-02-11 14:00 gasche New Issue
2015-02-11 14:02 gasche Note Added: 0013268
2015-02-23 23:02 doligez Note Added: 0013331
2015-02-23 23:02 doligez Target Version => 4.02.3+dev
2015-02-23 23:02 doligez Status new => acknowledged
2015-07-10 17:34 doligez Target Version 4.02.3+dev => 4.03.0+dev / +beta1
2016-04-18 14:06 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2016-12-07 16:37 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser,debug}) => OCaml tools (ocaml{lex,yacc,dep,debug})
2017-02-16 14:01 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:45 doligez Category OCaml tools (ocaml{lex,yacc,dep,debug}) => tools (ocaml{lex,yacc,dep,debug,...})
2017-03-15 15:14 doligez Target Version undecided =>


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker