2002-11-05 Elena Zannoni <ezannoni@redhat.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Tue, 5 Nov 2002 22:38:11 +0000 (22:38 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Tue, 5 Nov 2002 22:38:11 +0000 (22:38 +0000)
        From Jim Ingham  <jingham@apple.com>:
* event-top.c (gdb_disable_readline): New function.
(_initialize_event_loop): Move comment.

gdb/ChangeLog
gdb/event-top.c

index 87efdd46729959dcc34145fb4858bb3dafb3a0d2..dc7f7eb03a99f1e69117da089660d737345b1513 100644 (file)
        (frame_register_read): Use frame_register instead of
        get_saved_register.
 
+2002-11-05  Elena Zannoni  <ezannoni@redhat.com>
+       
+        From Jim Ingham  <jingham@apple.com>:
+       * event-top.c (gdb_disable_readline): New function.
+       (_initialize_event_loop): Move comment.
+
 2002-11-05  Elena Zannoni  <ezannoni@redhat.com>
 
        * event-loop.c (start_event_loop): Add comment.
index 9d871d6590625a79c37bd128d4c5f13357da1903..8f39998ed9b1a8009273f99e5fa1531f604cca73 100644 (file)
@@ -1168,14 +1168,39 @@ gdb_setup_readline (void)
     }
 }
 
+/* Disable command input through the standard CLI channels.  Used in
+   the suspend proc for interpreters that use the standard gdb readline
+   interface, like the cli & the mi.  */
+void
+gdb_disable_readline (void)
+{
+  if (event_loop_p)
+    {
+      /* FIXME - It is too heavyweight to delete and remake these
+         every time you run an interpreter that needs readline.
+         It is probably better to have the interpreters cache these,
+         which in turn means that this needs to be moved into interpreter
+         specific code. */
+
+#if 0
+      ui_file_delete (gdb_stdout);
+      ui_file_delete (gdb_stderr);
+      gdb_stdlog = NULL;
+      gdb_stdtarg = NULL;
+#endif
+
+      rl_callback_handler_remove ();
+      delete_file_handler (input_fd);
+    }
+}
+
 void
 _initialize_event_loop (void)
 {
   gdb_setup_readline ();
 
+  /* Tell gdb to use the cli_command_loop as the main loop. */
   if (event_loop_p && command_loop_hook == NULL)
-    {
-      /* Tell gdb to use the cli_command_loop as the main loop. */
-      command_loop_hook = cli_command_loop;
-    }
+    command_loop_hook = cli_command_loop;
 }
+