summaryrefslogtreecommitdiff
path: root/debugger/show_information.ml
diff options
context:
space:
mode:
authorSébastien Hinderer <Sebastien.Hinderer@inria.fr>2018-03-17 12:16:37 +0100
committerSébastien Hinderer <Sebastien.Hinderer@inria.fr>2018-03-20 16:00:41 +0100
commit23a6845929511592f1fdba9906ef7867510aecaa (patch)
tree3c130a9cc176fde633c97123b3b41e979364f71c /debugger/show_information.ml
parent7d5e40c102792001cd240e38c70c241fafff2d99 (diff)
downloadocaml-23a6845929511592f1fdba9906ef7867510aecaa.tar.gz
ocamldebug: add a few commandline options
This commit adds the following options to ocamldebug: * -no-prompt: suppress all prompts * -no-version: do not print version at startup * -no-time: do not print times * -no-breakpoint: do not print message at breakpoint setup and removal * -topdirs-path: set path to the directory containing topdirs.cmi
Diffstat (limited to 'debugger/show_information.ml')
-rw-r--r--debugger/show_information.ml24
1 files changed, 15 insertions, 9 deletions
diff --git a/debugger/show_information.ml b/debugger/show_information.ml
index 30d7774e2f..29fe1fb69c 100644
--- a/debugger/show_information.ml
+++ b/debugger/show_information.ml
@@ -28,20 +28,23 @@ open Parameters
(* Display information about the current event. *)
let show_current_event ppf =
- fprintf ppf "Time: %Li" (current_time ());
- (match current_pc () with
- | Some pc ->
- fprintf ppf " - pc: %i" pc
- | _ -> ());
+ if !Parameters.time then begin
+ fprintf ppf "Time: %Li" (current_time ());
+ (match current_pc () with
+ | Some pc ->
+ fprintf ppf " - pc: %i" pc
+ | _ -> ());
+ end;
update_current_event ();
reset_frame ();
match current_report () with
| None ->
- fprintf ppf "@.Beginning of program.@.";
+ if !Parameters.time then fprintf ppf "@.";
+ fprintf ppf "Beginning of program.@.";
show_no_point ()
| Some {rep_type = (Event | Breakpoint); rep_program_pointer = pc} ->
let ev = get_current_event () in
- fprintf ppf " - module %s@." ev.ev_module;
+ if !Parameters.time then fprintf ppf " - module %s@." ev.ev_module;
(match breakpoints_at_pc pc with
| [] ->
()
@@ -55,17 +58,20 @@ let show_current_event ppf =
(List.sort compare breakpoints));
show_point ev true
| Some {rep_type = Exited} ->
- fprintf ppf "@.Program exit.@.";
+ if !Parameters.time then fprintf ppf "@.";
+ fprintf ppf "Program exit.@.";
show_no_point ()
| Some {rep_type = Uncaught_exc} ->
+ if !Parameters.time then fprintf ppf "@.";
fprintf ppf
- "@.Program end.@.\
+ "Program end.@.\
@[Uncaught exception:@ %a@]@."
Printval.print_exception (Debugcom.Remote_value.accu ());
show_no_point ()
| Some {rep_type = Trap_barrier} ->
(* Trap_barrier not visible outside *)
(* of module `time_travel'. *)
+ if !Parameters.time then fprintf ppf "@.";
Misc.fatal_error "Show_information.show_current_event"
(* Display short information about one frame. *)