debug.mli 2.24 KB
Newer Older
1 2
(**************************************************************************)
(*                                                                        *)
3
(*  Copyright (C) 2010-2011                                               *)
4 5 6
(*    François Bobot                                                      *)
(*    Jean-Christophe Filliâtre                                           *)
(*    Claude Marché                                                       *)
7 8 9 10 11 12 13 14 15 16 17 18 19 20
(*    Andrei Paskevich                                                    *)
(*                                                                        *)
(*  This software is free software; you can redistribute it and/or        *)
(*  modify it under the terms of the GNU Library General Public           *)
(*  License version 2.1, with the special exception on linking            *)
(*  described in file LICENSE.                                            *)
(*                                                                        *)
(*  This software is distributed in the hope that it will be useful,      *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  *)
(*                                                                        *)
(**************************************************************************)

type flag
21
(* Flag used for debugging only part of Why *)
22 23

val register_flag : string -> flag
24 25 26
(** Register a new flag. If someone try to register two times the same
    flag the same one is used *)

27 28
val lookup_flag : string -> flag
val list_flags : unit -> (string * flag * bool) list
29
(** List the known flags *)
30

31
(** Modify the state of a flag *)
32 33 34 35 36
val set_flag : flag -> unit
val unset_flag : flag -> unit
val toggle_flag : flag -> unit

val test_flag : flag -> bool
37 38 39 40 41 42
(** Return the state of the flag *)
val nottest_flag : flag -> bool

val set_debug_formatter : Format.formatter -> unit
(** Set the formatter used when printing debug material *)

43 44 45 46
val get_debug_formatter : unit -> Format.formatter
(** Get the formatter used when printing debug material *)


47 48
val dprintf : flag -> ('a, Format.formatter, unit) format -> 'a
(** Print only if the flag is set *)
49

50
val stack_trace : flag
51
(** stack_trace flag *)