diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-03-14 07:58:06 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-03-14 07:58:06 +0000 |
commit | e837f12a8d57a112a5ec40a3b3387aac3768c016 (patch) | |
tree | f8e1355cbfc9d7e18f3e2e7213ddeb681b290373 /gdb/mi | |
parent | ec8460b5bac24867500e840a88a6ee36fbc2dff2 (diff) | |
download | gdb-e837f12a8d57a112a5ec40a3b3387aac3768c016.zip gdb-e837f12a8d57a112a5ec40a3b3387aac3768c016.tar.gz gdb-e837f12a8d57a112a5ec40a3b3387aac3768c016.tar.bz2 |
gdb/
Fix double prompt of 'interpreter-exec mi'.
* mi/mi-interp.c (mi_execute_command_input_handler): New prototype.
(mi_interpreter_resume): use it.
(mi_execute_command_input_handler): New function.
* mi/mi-main.c (mi_execute_command): Move prompt printing to
mi_execute_command_input_handler.
gdb/testsuite/
* gdb.mi/mi2-prompt.exp: New file.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-interp.c | 14 | ||||
-rw-r--r-- | gdb/mi/mi-main.c | 3 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index cb12549..daae480 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -40,6 +40,7 @@ interpreter. */ static void mi_execute_command_wrapper (char *cmd); +static void mi_execute_command_input_handler (char *cmd); static void mi_command_loop (int mi_version); /* These are hooks that we put in place while doing interpreter_exec @@ -151,7 +152,7 @@ mi_interpreter_resume (void *data) /* These overwrite some of the initialization done in _intialize_event_loop. */ call_readline = gdb_readline2; - input_handler = mi_execute_command_wrapper; + input_handler = mi_execute_command_input_handler; add_file_handler (input_fd, stdin_event_handler, 0); async_command_editing_p = 0; /* FIXME: This is a total hack for now. PB's use of the MI @@ -297,6 +298,17 @@ mi_execute_command_wrapper (char *cmd) mi_execute_command (cmd, stdin == instream); } +/* mi_execute_command_wrapper wrapper suitable for INPUT_HANDLER. */ + +static void +mi_execute_command_input_handler (char *cmd) +{ + mi_execute_command_wrapper (cmd); + + fputs_unfiltered ("(gdb) \n", raw_stdout); + gdb_flush (raw_stdout); +} + static void mi1_command_loop (void) { diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 787d247..9f14f01 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -2029,9 +2029,6 @@ mi_execute_command (char *cmd, int from_tty) mi_parse_free (command); } - - fputs_unfiltered ("(gdb) \n", raw_stdout); - gdb_flush (raw_stdout); } static void |