summaryrefslogtreecommitdiff
path: root/debugger/main.ml
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>2000-03-07 18:22:19 +0000
committerPierre Weis <Pierre.Weis@inria.fr>2000-03-07 18:22:19 +0000
commit242af96dba1bb152c842b92669b9991fbf28a8a5 (patch)
treea6fdc32c36d4c33d4b4b0351f4237e800e1005cb /debugger/main.ml
parentcb7ba09182b80f1806b08c8a2553087812fa3be1 (diff)
downloadocaml-242af96dba1bb152c842b92669b9991fbf28a8a5.tar.gz
Revision des messages première étape.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2919 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'debugger/main.ml')
-rw-r--r--debugger/main.ml37
1 files changed, 18 insertions, 19 deletions
diff --git a/debugger/main.ml b/debugger/main.ml
index 299c28ad9f..3bb4fe4c4a 100644
--- a/debugger/main.ml
+++ b/debugger/main.ml
@@ -25,56 +25,55 @@ open Program_management
open Frames
open Show_information
-
let line_buffer = Lexing.from_function read_user_input
-let rec loop () =
- line_loop line_buffer;
- if !loaded & (not (yes_or_no "The program is running. Quit anyway")) then
- loop ()
+let rec loop ppf =
+ line_loop ppf line_buffer;
+ if !loaded && (not (yes_or_no "The program is running. Quit anyway")) then
+ loop ppf
-let rec protect cont =
+let rec protect ppf cont =
try
- cont ()
+ cont ppf
with
- End_of_file ->
- protect (function () ->
+ | End_of_file ->
+ protect ppf (function ppf ->
forget_process
!current_checkpoint.c_fd
!current_checkpoint.c_pid;
flush stdout;
stop_user_input ();
- loop ())
+ loop ppf)
| Toplevel ->
- protect (function () ->
+ protect ppf (function ppf ->
flush stdout;
stop_user_input ();
- loop ())
+ loop ppf)
| Sys.Break ->
- protect (function () ->
+ protect ppf (function ppf ->
print_endline "Interrupted.";
Exec.protect (function () ->
flush stdout;
stop_user_input ();
if !loaded then begin
try_select_frame 0;
- show_current_event ()
+ show_current_event ppf;
end);
- loop ())
+ loop ppf)
| Current_checkpoint_lost ->
- protect (function () ->
+ protect ppf (function ppf ->
print_endline "Trying to recover...";
flush stdout;
stop_user_input ();
recover ();
try_select_frame 0;
- show_current_event ();
- loop ())
+ show_current_event ppf;
+ loop ppf)
| x ->
kill_program ();
raise x
-let toplevel_loop () = protect loop
+let toplevel_loop () = protect Format.std_formatter loop
(* Parsing of command-line arguments *)