summaryrefslogtreecommitdiff
path: root/debugger
diff options
context:
space:
mode:
authorDavid Allsopp <david.allsopp@metastack.com>2019-10-19 11:47:07 +0100
committerDavid Allsopp <david.allsopp@metastack.com>2019-10-19 11:47:07 +0100
commitd0bab08f15c768c07bc88547043e26237b69085e (patch)
tree7b170486e8f5446c073339b65a5a1d797ff4eae1 /debugger
parent37acb3bf24626e5989cb8a21c90ed9177d768cc9 (diff)
downloadocaml-d0bab08f15c768c07bc88547043e26237b69085e.tar.gz
Don't ever call stop_user_input in line_loop
The caller is now always responsible for calling stop_user_input, rather than only responsible for calling it on error.
Diffstat (limited to 'debugger')
-rw-r--r--debugger/command_line.ml3
-rw-r--r--debugger/main.ml5
2 files changed, 5 insertions, 3 deletions
diff --git a/debugger/command_line.ml b/debugger/command_line.ml
index 381700d382..0a1fb7ceb3 100644
--- a/debugger/command_line.ml
+++ b/debugger/command_line.ml
@@ -210,7 +210,7 @@ let line_loop ppf line_buffer =
done
with
| Exit ->
- stop_user_input ()
+ ()
(* | Sys_error s ->
error ("System error: " ^ s) *)
@@ -571,6 +571,7 @@ let instr_source ppf lexbuf =
interactif := false;
user_channel := io_chan;
line_loop ppf (Lexing.from_function read_user_input);
+ stop_user_input ();
close_io io_chan;
interactif := old_state;
user_channel := old_channel
diff --git a/debugger/main.ml b/debugger/main.ml
index 53959a7693..ec99786e57 100644
--- a/debugger/main.ml
+++ b/debugger/main.ml
@@ -29,7 +29,7 @@ open Primitives
let line_buffer = Lexing.from_function read_user_input
-let loop ppf = line_loop ppf line_buffer
+let loop ppf = line_loop ppf line_buffer; stop_user_input ()
let current_duration = ref (-1L)
@@ -130,7 +130,8 @@ let execute_file_if_any () =
let len = Buffer.length buffer in
if len > 0 then
let commands = Buffer.sub buffer 0 (pred len) in
- line_loop Format.std_formatter (Lexing.from_string commands)
+ line_loop Format.std_formatter (Lexing.from_string commands);
+ stop_user_input ()
let toplevel_loop () =
interactif := false;