Commits

camlspotter committed ea59fbe Merge

merge

Comments (0)

Files changed (5)

      install::
         cp \*.mli \*.cmi \*.cma \*.cmt \*.cmti \*.cmxa $(INSTALLDIR)
 
+If you want to browse values of OCaml's standard library (stdlib and otherlibs), you must also recompile those modules with -bin-annot option to create cmt/cmti files.
 
 Some automation
 --------------------------
     | (_, ".cmx") -> true 
     | _ -> false) (Array.to_list cmt.cmt_args)
 
-let recover_env env =
+module Envaux = struct (* copied from debugger/envaux.ml *)
+  open Misc
+  open Types
+  open Env
 
-  let module Envaux = struct (* copied from debugger/envaux.ml *)
-    open Misc
-    open Types
-    open Env
+  type error =
+      Module_not_found of Path.t
   
-    type error =
-        Module_not_found of Path.t
-    
-    exception Error of error
-    
-    let env_cache =
-      (Hashtbl.create 59 : ((Env.summary * Subst.t), Env.t) Hashtbl.t)
-    
-    let reset_cache () =
-      Hashtbl.clear env_cache;
-      Env.reset_cache()
-    
-    let extract_sig env mty =
-      match Mtype.scrape env mty with
-        Mty_signature sg -> sg
-      | _ -> fatal_error "Envaux.extract_sig"
-    
-    let rec env_from_summary sum subst =
+  exception Error of error
+  
+  let env_cache =
+    (Hashtbl.create 59 : ((Env.summary * Subst.t), Env.t) Hashtbl.t)
+  
+  let cntr = ref 0
+
+  let reset_cache () =
+    Hashtbl.clear env_cache;
+    cntr := 0;
+    Env.reset_cache()
+  
+  let extract_sig env mty =
+    match Mtype.scrape env mty with
+      Mty_signature sg -> sg
+    | _ -> fatal_error "Envaux.extract_sig"
+  
+  let rec env_from_summary sum subst =
     try
       Hashtbl.find env_cache (sum, subst)
     with Not_found ->
             in
             Env.open_signature path' (extract_sig env mty) env
       in
-        Hashtbl.add env_cache (sum, subst) env;
-        env
-  end in
-  Envaux.reset_cache ();
-  Envaux.env_from_summary (Env.summary env) Subst.identity
-  
+      Hashtbl.add env_cache (sum, subst) env;
+      env
+end 
+
+let reset_env_cache () = Envaux.reset_cache ()
+
+let recover_env env = Envaux.env_from_summary (Env.summary env) Subst.identity
 val recover_env : Env.t -> Env.t
   (** Type environments in cmt are simplified and just have env summaries.
       If we want the real environment, we need to recover it from the summary. *)
+val reset_env_cache : unit -> unit
         end;
         super#pattern p
 
-    (* CR jfuruse: pat_extra *)
-
-      method! pattern_desc pd =
-        begin match pd with
+      (* CR jfuruse: pat_extra *)
+          
+      method! pattern_desc pd = 
+        begin match pd with 
         | Tpat_var (id, {loc})
         | Tpat_alias (_, id, {loc}) -> record_def loc (AStr_value id)
         | Tpat_construct _ -> () (* done in #pattern *)

tests/Makefile.targets

 packed_alias.cmo \
 pathname.cmo \
 perv.cmo \
-predef.cmo \
 primitive.cmo \
 recmodule.cmo \
 record.cmo \