* interps.h (GDB_INTERPRETER_MI2): Define.
(GDB_INTERPRETER_MI0): Remove.
2002-11-04 Elena Zannoni <ezannoni@redhat.com>
* mi-interp.c: Increment mi version numbers: 0->1, 1->2,
and 2->3. Remove MI0 references.
* mi-events.c: Ditto.
* mi-main.c: Ditto. Remove erroneously merged code.
* mi.h: Ditto.
+2002-11-04 Elena Zannoni <ezannoni@redhat.com>
+
+ * interps.h (GDB_INTERPRETER_MI2): Define.
+ (GDB_INTERPRETER_MI0): Remove.
+
2002-10-01 Keith Seitz <keiths@redhat.com>
* interps.c (interpreter_exec_cmd): Remove mention of "mi" in
/* well-known interpreters */
#define GDB_INTERPRETER_CONSOLE "console"
-#define GDB_INTERPRETER_MI0 "mi0"
#define GDB_INTERPRETER_MI1 "mi1"
+#define GDB_INTERPRETER_MI2 "mi2"
#define GDB_INTERPRETER_MI "mi"
#endif /* GDB_INTERPRETER_H */
+2002-11-04 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi-interp.c: Increment mi version numbers: 0->1, 1->2,
+ and 2->3. Remove MI0 references.
+ * mi-events.c: Ditto.
+ * mi-main.c: Ditto. Remove erroneously merged code.
+ * mi.h: Ditto.
+
2002-08-28 Keith Seitz <keiths@redhat.com>
* mi-interp.c (_initialize_mi_interp): Add exec_proc.
struct ui_out *saved_ui_out = uiout;
struct mi_out *tmp_mi_out;
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- uiout = gdb_interpreter_ui_out (mi0_interp);
+ if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
+ uiout = gdb_interpreter_ui_out (mi1_interp);
else
uiout = gdb_interpreter_ui_out (mi_interp);
{
va_list args;
- if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0)
- && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
+ if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
+ && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
{
va_start (args, string);
vfprintf_unfiltered (mi_event_channel, string, args);
struct ui_file *mi_event_channel;
/* This is the interpreter for the mi... */
-struct gdb_interpreter *mi0_interp;
+struct gdb_interpreter *mi2_interp;
struct gdb_interpreter *mi1_interp;
struct gdb_interpreter *mi_interp;
static char *mi_interp_read_one_line_hook (char *prompt, int repeat,
char *anno);
-static void mi0_command_loop (void);
+static void mi2_command_loop (void);
static void mi1_command_loop (void);
static void mi_insert_notify_hooks (void);
show_load_progress = mi_load_progress;
/* If we're _the_ interpreter, take control. */
- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0))
- command_loop_hook = mi0_command_loop;
+ if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
+ command_loop_hook = mi2_command_loop;
else if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
command_loop_hook = mi1_command_loop;
else if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI))
- command_loop_hook = mi1_command_loop;
+ command_loop_hook = mi2_command_loop;
else
return 0;
}
static void
-mi0_command_loop (void)
+mi1_command_loop (void)
{
- mi_command_loop (0);
+ mi_command_loop (1);
}
static void
-mi1_command_loop (void)
+mi2_command_loop (void)
{
- mi_command_loop (1);
+ mi_command_loop (2);
}
static void
mi_interpreter_prompt /* prompt_proc */
};
- /* Create MI0 interpreter */
- if (mi0_interp == NULL)
- {
- mi0_interp =
- gdb_new_interpreter (GDB_INTERPRETER_MI0, NULL, mi_out_new (0),
- &procs);
- if (mi0_interp == NULL)
- error
- ("Couldn't allocate a new interpreter for the mi0 interpreter\n");
- if (gdb_add_interpreter (mi0_interp) != 1)
- error ("Couldn't add the mi0 interpreter to gdb.\n");
- }
-
/* Create MI1 interpreter */
if (mi1_interp == NULL)
{
}
/* Create MI2 interpreter */
+ if (mi2_interp == NULL)
+ {
+ mi2_interp =
+ gdb_new_interpreter (GDB_INTERPRETER_MI2, NULL, mi_out_new (2),
+ &procs);
+ if (mi2_interp == NULL)
+ error
+ ("Couldn't allocate a new interpreter for the mi2 interpreter\n");
+ if (gdb_add_interpreter (mi2_interp) != 1)
+ error ("Couldn't add the mi2 interpreter to gdb.\n");
+ }
+
+ /* Create MI3 interpreter */
if (mi_interp == NULL)
{
mi_interp =
- gdb_new_interpreter (GDB_INTERPRETER_MI, NULL, mi_out_new (2),
+ gdb_new_interpreter (GDB_INTERPRETER_MI, NULL, mi_out_new (3),
&procs);
if (mi_interp == NULL)
error
/* If we changed interpreters, DON'T print out anything. */
if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI)
- || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0)
- || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
+ || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
+ || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
{
/* print the result */
/* FIXME: Check for errors here. */
int new_section;
if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI)
- && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI0)
- && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
+ && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
+ && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
return;
update_threshold.tv_sec = 0;
}
}
-static void
-mi_command_loop (int mi_version)
-{
- /* HACK: Force stdout/stderr to point at the console. This avoids
- any potential side effects caused by legacy code that is still
- using the TUI / fputs_unfiltered_hook */
- raw_stdout = stdio_fileopen (stdout);
- /* Route normal output through the MIx */
- gdb_stdout = mi_console_file_new (raw_stdout, "~");
- /* Route error and log output through the MI */
- gdb_stderr = mi_console_file_new (raw_stdout, "&");
- gdb_stdlog = gdb_stderr;
- /* Route target output through the MI. */
- gdb_stdtarg = mi_console_file_new (raw_stdout, "@");
-
- /* HACK: Poke the ui_out table directly. Should we be creating a
- mi_out object wired up to the above gdb_stdout / gdb_stderr? */
- uiout = mi_out_new (mi_version);
-
- /* HACK: Override any other interpreter hooks. We need to create a
- real event table and pass in that. */
- init_ui_hook = 0;
- /* command_loop_hook = 0; */
- print_frame_info_listing_hook = 0;
- query_hook = 0;
- warning_hook = 0;
- create_breakpoint_hook = 0;
- delete_breakpoint_hook = 0;
- modify_breakpoint_hook = 0;
- interactive_hook = 0;
- registers_changed_hook = 0;
- readline_begin_hook = 0;
- readline_hook = 0;
- readline_end_hook = 0;
- register_changed_hook = 0;
- memory_changed_hook = 0;
- context_hook = 0;
- target_wait_hook = 0;
- call_command_hook = 0;
- error_hook = 0;
- error_begin_hook = 0;
- show_load_progress = mi_load_progress;
-
- /* Turn off 8 bit strings in quoted output. Any character with the
- high bit set is printed using C's octal format. */
- sevenbit_strings = 1;
-
- /* Tell the world that we're alive */
- fputs_unfiltered ("(gdb) \n", raw_stdout);
- gdb_flush (raw_stdout);
-
- if (!event_loop_p)
- simplified_command_loop (mi_input, mi_execute_command);
- else
- start_event_loop ();
-}
-
-static void
-mi1_command_loop (void)
-{
- mi_command_loop (1);
-}
-
-static void
-mi2_command_loop (void)
-{
- mi_command_loop (2);
-}
-
-static void
-setup_architecture_data (void)
+void
+mi_setup_architecture_data (void)
{
/* don't trust REGISTER_BYTES to be zero. */
old_regs = xmalloc (REGISTER_BYTES + 1);
void
mi_register_gdbarch_swap (void)
{
- if (interpreter_p == NULL)
- return;
-
- /* If we're _the_ interpreter, take control. */
- if (strcmp (interpreter_p, "mi") == 0)
- command_loop_hook = mi2_command_loop;
- else if (strcmp (interpreter_p, "mi1") == 0)
- command_loop_hook = mi1_command_loop;
- else if (strcmp (interpreter_p, "mi2") == 0)
- command_loop_hook = mi2_command_loop;
- else
- return;
-
- init_ui_hook = mi_init_ui;
- setup_architecture_data ();
register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL);
register_gdbarch_swap (NULL, 0, mi_setup_architecture_data);
}
struct breakpoint;
struct gdb_interpreter;
extern struct gdb_interpreter *mi_interp;
-extern struct gdb_interpreter *mi0_interp;
+extern struct gdb_interpreter *mi1_interp;
extern void mi_setup_architecture_data (void);
extern void mi_register_gdbarch_swap (void);