+ if BuildTimeConf.debug then begin
+ gui#main#debugMenu#misc#show ();
+ let addDebugItem ~label callback =
+ let item =
+ GMenu.menu_item ~packing:gui#main#debugMenu_menu#append ~label ()
+ in
+ ignore (item#connect#activate callback)
+ in
+ addDebugItem "dump environment to \"env.dump\"" (fun _ ->
+ let oc = open_out "env.dump" in
+ CicEnvironment.dump_to_channel oc;
+ close_out oc);
+ addDebugItem "load environment from \"env.dump\"" (fun _ ->
+ let ic = open_in "env.dump" in
+ CicEnvironment.restore_from_channel ic;
+ close_in ic);
+ addDebugItem "dump universes" (fun _ ->
+ List.iter (fun (u,_,g) ->
+ prerr_endline (UriManager.string_of_uri u);
+ CicUniv.print_ugraph g) (CicEnvironment.list_obj ())
+ );
+ addDebugItem "print selected terms" (fun () ->
+ let i = ref 0 in
+ List.iter
+ (fun t ->
+ incr i;
+ MatitaLog.debug (sprintf "%d: %s" !i (CicPp.ppterm t)))
+ (MatitaMathView.sequentViewer_instance ())#get_selected_terms);
+ addDebugItem "dump getter settings" (fun _ ->
+ prerr_endline (Http_getter_env.env_to_string ()));
+ addDebugItem "getter: update"
+ (fun _ ->
+ ignore (Thread.create (fun () ->
+ MatitaLog.message "Rebuilding getter maps in background ...";
+ Http_getter.update ();
+ MatitaLog.message "Getter maps successfully rebuilt.") ()));
+ addDebugItem "getter: getalluris" (fun _ ->
+ List.iter prerr_endline (Http_getter.getalluris ()));
+ addDebugItem "dump script status" script#dump;
+ addDebugItem "dump metasenv"
+ (fun _ ->
+ if script#onGoingProof () then
+ MatitaLog.debug (CicMetaSubst.ppmetasenv script#proofMetasenv []));
+ addDebugItem "dump coercions Db" (fun _ ->
+ List.iter (
+ fun (s,t,u) ->
+ MatitaLog.debug (
+ UriManager.name_of_uri u ^ ":" ^
+ UriManager.name_of_uri s ^ " -> " ^ UriManager.name_of_uri t))
+ (CoercDb.to_list ())
+ );
+ addDebugItem "rotate light bulbs"
+ (fun _ ->
+ let nb = gui#main#hintNotebook in
+ nb#goto_page ((nb#current_page + 1) mod 3));
+ (*
+ addDebugItem "print (on stdout) \"statement\" grammar entry"
+ (fun _ ->
+ Grammar.print_entry Format.std_formatter
+ (Grammar.Entry.obj CicTextualParser2.statement);
+ Format.pp_print_flush Format.std_formatter ());*)
+ end
+
+ (** </DEBUGGING> *)