diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-11-04 16:18:02 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-11-04 16:18:02 +0000 |
commit | ca904da3c4ca23893579f73f0a7149e2b850bf0f (patch) | |
tree | 41fd7a74ff1bdaac5bf1ea6c27f09f70a74a7070 | |
parent | 8e5d13c34ab3a45f0f78cf1aaae0ddab4a284e66 (diff) | |
download | gdb-ca904da3c4ca23893579f73f0a7149e2b850bf0f.tar.gz |
2002-11-04 Elena Zannoni <ezannoni@redhat.com>
* 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.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/interps.h | 2 | ||||
-rw-r--r-- | gdb/mi/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/mi/mi-events.c | 8 | ||||
-rw-r--r-- | gdb/mi/mi-interp.c | 46 | ||||
-rw-r--r-- | gdb/mi/mi-main.c | 96 | ||||
-rw-r--r-- | gdb/mi/mi.h | 2 |
7 files changed, 48 insertions, 119 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0dd7b517777..de369a9ad8f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gdb/interps.h b/gdb/interps.h index b4577158edf..297bed1c5c7 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -70,7 +70,7 @@ void clear_interpreter_hooks (); /* 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 */ diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 3a59321263d..9d3dd9f0876 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,11 @@ +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. diff --git a/gdb/mi/mi-events.c b/gdb/mi/mi-events.c index d63e578d7d3..5dc4b26dada 100644 --- a/gdb/mi/mi-events.c +++ b/gdb/mi/mi-events.c @@ -32,8 +32,8 @@ mi_interp_stack_changed_hook (void) 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); @@ -48,8 +48,8 @@ event_notify (const char *string, ...) { 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); diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 52597f29071..044bc2ed6f1 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -39,7 +39,7 @@ struct ui_file *mi_stdtarg; 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; @@ -63,7 +63,7 @@ static int mi_interp_query_hook (const char *ctlstr, va_list ap); 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); @@ -149,12 +149,12 @@ mi_interpreter_resume (void *data) 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; @@ -352,15 +352,15 @@ mi_execute_command_wrapper (char *cmd) } 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 @@ -437,19 +437,6 @@ _initialize_mi_interp (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) { @@ -464,10 +451,23 @@ _initialize_mi_interp (void) } /* 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 diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 5e2f4cc08c9..f317910f02f 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1161,8 +1161,8 @@ captured_mi_execute_command (struct ui_out *uiout, void *data) /* 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. */ @@ -1411,8 +1411,8 @@ mi_load_progress (const char *section_name, 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; @@ -1471,77 +1471,8 @@ mi_load_progress (const char *section_name, } } -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); @@ -1551,21 +1482,6 @@ setup_architecture_data (void) 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); } diff --git a/gdb/mi/mi.h b/gdb/mi/mi.h index 0fbf2cdd5bf..be4e63344d8 100644 --- a/gdb/mi/mi.h +++ b/gdb/mi/mi.h @@ -25,7 +25,7 @@ struct ui_file; 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); |