From ced6c94c59ba147abbee642dcd3e816ee2e1c1eb Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Thu, 30 Jun 2005 09:32:28 +0000 Subject: [PATCH] added a debugging helper --- helm/matita/matitaMisc.ml | 7 ++++++- helm/matita/matitaMisc.mli | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/helm/matita/matitaMisc.ml b/helm/matita/matitaMisc.ml index ab077d923..acaf2123c 100644 --- a/helm/matita/matitaMisc.ml +++ b/helm/matita/matitaMisc.ml @@ -207,4 +207,9 @@ let rec list_uniq = function | h1::h2::tl when h1 = h2 -> list_uniq (h2 :: tl) | h1::tl (* when h1 <> h2 *) -> h1 :: list_uniq tl -let end_ma_RE = Pcre.regexp "\\.ma$" +let debug_wrap name f = + prerr_endline (sprintf "debug_wrap: ==>> %s" name); + let res = f () in + prerr_endline (sprintf "debug_wrap: <<== %s" name); + res + diff --git a/helm/matita/matitaMisc.mli b/helm/matita/matitaMisc.mli index 31efae031..c2cba5903 100644 --- a/helm/matita/matitaMisc.mli +++ b/helm/matita/matitaMisc.mli @@ -94,3 +94,8 @@ val get_proof_aliases: MatitaTypes.status -> DisambiguateTypes.environment val image_path: string -> string val obj_file_of_script: string -> string + (** invoke a given function and return its value; in addition il will print + * the given string before invoking it and "/" ^ the given string afterwards. + * This permit tracing of functions which does not return a value *) +val debug_wrap: string -> (unit -> 'a) -> 'a + -- 2.39.2