summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-02-12 15:31:30 +0000
committerAndrew Cagney <cagney@redhat.com>2003-02-12 15:31:30 +0000
commit7937e00b8921eba8d287d0fe3d96e9b2ac869549 (patch)
treef692ce0c85b1825a0719eb09e805ac19d60a9274
parent2072469751bb13fc964852caaf0e61a4393abe52 (diff)
downloadgdb-7937e00b8921eba8d287d0fe3d96e9b2ac869549.tar.gz
2003-02-12 Andrew Cagney <ac131313@redhat.com>
* event-top.c (cli_command_loop): Delete declaration. (_initialize_event_loop): Delete function setting event_loop_hook. * event-top.h (cli_command_loop): Declare. Update copyright. (EVENT_TOP_H): Define. Wrap header in #ifdef EVENT_TOP_H. * interps.c (current_interp_command_loop): When event_loop_p, call cli_command_loop.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/event-top.c12
-rw-r--r--gdb/event-top.h13
-rw-r--r--gdb/interps.c2
4 files changed, 22 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a7ca6ae7e16..681a3b4f139 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
2003-02-12 Andrew Cagney <ac131313@redhat.com>
+ * event-top.c (cli_command_loop): Delete declaration.
+ (_initialize_event_loop): Delete function setting event_loop_hook.
+ * event-top.h (cli_command_loop): Declare. Update copyright.
+ (EVENT_TOP_H): Define. Wrap header in #ifdef EVENT_TOP_H.
+ * interps.c (current_interp_command_loop): When event_loop_p, call
+ cli_command_loop.
+
+2003-02-12 Andrew Cagney <ac131313@redhat.com>
+
* interps.h (interp_command_loop_ftype): Change return type to
void.
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 2b2c4ff2785..ceef7b9c9eb 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -39,15 +39,12 @@
/* readline defines this. */
#undef savestring
-extern void _initialize_event_loop (void);
-
static void rl_callback_read_char_wrapper (gdb_client_data client_data);
static void command_line_handler (char *rl);
static void command_line_handler_continuation (struct continuation_arg *arg);
static void change_line_handler (void);
static void change_annotation_level (void);
static void command_handler (char *command);
-void cli_command_loop (void);
static void async_do_nothing (gdb_client_data arg);
static void async_disconnect (gdb_client_data arg);
static void async_stop_sig (gdb_client_data arg);
@@ -1199,12 +1196,3 @@ gdb_disable_readline (void)
delete_file_handler (input_fd);
}
}
-
-void
-_initialize_event_loop (void)
-{
- /* Tell gdb to use the cli_command_loop as the main loop. */
- if (event_loop_p && command_loop_hook == NULL)
- command_loop_hook = cli_command_loop;
-}
-
diff --git a/gdb/event-top.h b/gdb/event-top.h
index d8c0a963989..4c06083db24 100644
--- a/gdb/event-top.h
+++ b/gdb/event-top.h
@@ -1,5 +1,7 @@
-/* Definitions used by GDB event-top.c.
- Copyright 1999, 2001 Free Software Foundation, Inc.
+/* Definitions used by event-top.c, for GDB, the GNU debugger.
+
+ Copyright 1999, 2001, 2003 Free Software Foundation, Inc.
+
Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
This file is part of GDB.
@@ -19,6 +21,9 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef EVENT_TOP_H
+#define EVENT_TOP_H
+
/* Stack for prompts. Each prompt is composed as a prefix, a prompt
and a suffix. The prompt to be displayed at any given time is the
one on top of the stack. A stack is necessary because of cases in
@@ -111,3 +116,7 @@ extern void (*call_readline) (void *);
extern void (*input_handler) (char *);
extern int input_fd;
extern void (*after_char_processing_hook) (void);
+
+extern void cli_command_loop (void);
+
+#endif
diff --git a/gdb/interps.c b/gdb/interps.c
index 8e33ffc7055..748b5b64901 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -275,6 +275,8 @@ current_interp_command_loop (void)
else if (current_interpreter != NULL
&& current_interpreter->procs->command_loop_proc != NULL)
current_interpreter->procs->command_loop_proc (current_interpreter->data);
+ else if (event_loop_p)
+ cli_command_loop ();
else
command_loop ();
}