From 83b7c726d05a748437bf43c35d7e8d9b03530559 Mon Sep 17 00:00:00 2001 From: Richard Eisenberg Date: Wed, 21 Dec 2022 17:40:34 -0500 Subject: [PATCH] Document the debug_printers script Thanks to Chris for explaining this to me! --- HACKING.jst.adoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/HACKING.jst.adoc b/HACKING.jst.adoc index 76b8830efef9..1c9511198822 100644 --- a/HACKING.jst.adoc +++ b/HACKING.jst.adoc @@ -54,3 +54,19 @@ where the test file or test dir are specified with respect to the $ make -f Makefile.jst test-one TEST=typing-local/local.ml $ make -f Makefile.jst test-one DIR=typing-local +## Debugging + +OCaml 4.14 makes `type_expr` abstract, and thus normal debug printing +of types no longer works. However, there is now an installable printer +for types, which we can use to see the types. Here are the instructions: + +1. Use the old `Makefile`, not the new `Makefile.jst`. This is an infelicity +we hope to fix. + +2. In the `tools` directory, run `make debug_printers.cmo`. + +3. In the debugger, execute some instructions, with e.g. `run` or `step`. This forces +the debugger to load the compiler code, required for the next +step. + +4. Execute `source tools/debug_printers` to install the printers.