aboutsummaryrefslogtreecommitdiff
path: root/sysinit
diff options
context:
space:
mode:
authorcoqbot-app[bot]2021-02-25 16:46:41 +0000
committerGitHub2021-02-25 16:46:41 +0000
commit24e94b3dac66510e6d57b9f55f9a4e3e84fd6e54 (patch)
tree5befd0a43d5973f3c0707c65a90265121db8047c /sysinit
parent6ef58b0e9348d49ccf456d9fd475368c3dc1aafa (diff)
parent0772562f1ef66ee69677456963187d6ff736b0bf (diff)
Merge PR #13202: Infrastructure for fine-grained debug flags
Reviewed-by: gares Ack-by: herbelin Ack-by: Zimmi48 Ack-by: jfehrle Ack-by: SkySkimmer Ack-by: ejgallego
Diffstat (limited to 'sysinit')
-rw-r--r--sysinit/coqargs.ml22
1 files changed, 11 insertions, 11 deletions
diff --git a/sysinit/coqargs.ml b/sysinit/coqargs.ml
index 56d88e6bd6..8be73ca028 100644
--- a/sysinit/coqargs.ml
+++ b/sysinit/coqargs.ml
@@ -22,14 +22,6 @@ let error_missing_arg s =
exit 1
(******************************************************************************)
-(* Imperative effects! This must be fixed at some point. *)
-(******************************************************************************)
-
-let set_debug () =
- let () = Exninfo.record_backtrace true in
- Flags.debug := true
-
-(******************************************************************************)
type native_compiler = Coq_config.native_compiler =
NativeOff | NativeOn of { ondemand : bool }
@@ -168,6 +160,9 @@ let add_load_vernacular opts verb s =
let add_set_option opts opt_name value =
{ opts with pre = { opts.pre with injections = OptionInjection (opt_name, value) :: opts.pre.injections }}
+let add_set_debug opts flags =
+ add_set_option opts ["Debug"] (OptionAppend flags)
+
(** Options for proof general *)
let set_emacs opts =
let opts = add_set_option opts Printer.print_goal_tag_opt_name (OptionSet None) in
@@ -382,10 +377,15 @@ let parse_args ~usage ~init arglist : t * string list =
(* Options with zero arg *)
|"-test-mode" -> Vernacinterp.test_mode := true; oval
|"-beautify" -> Flags.beautify := true; oval
- |"-bt" -> Exninfo.record_backtrace true; oval
+ |"-bt" -> add_set_debug oval "backtrace"
|"-config"|"--config" -> set_query oval PrintConfig
- |"-debug" -> set_debug (); oval
- |"-xml-debug" -> Flags.xml_debug := true; set_debug (); oval
+
+ |"-debug" -> add_set_debug oval "all"
+ |"-d" | "-D" -> add_set_debug oval (next())
+
+ (* -xml-debug implies -debug. TODO don't be imperative here. *)
+ |"-xml-debug" -> Flags.xml_debug := true; add_set_debug oval "all"
+
|"-diffs" ->
add_set_option oval Proof_diffs.opt_name @@ OptionSet (Some (next ()))
|"-emacs" -> set_emacs oval