]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* mi-interp.c (mi_event_handlers): Add context_changed event
authorKeith Seitz <keiths@redhat.com>
Fri, 9 Aug 2002 19:53:56 +0000 (19:53 +0000)
committerKeith Seitz <keiths@redhat.com>
Fri, 9 Aug 2002 19:53:56 +0000 (19:53 +0000)
        handler.
        (mi_command_loop): Remove big block of code repeated in
        mi_interpreter_resume. I don't think this is needed.
        (mi_insert_notify_hooks): Remove context_hook.
        (mi_remove_notify_hooks): Likewise.
        * mi-events.c (mi_context_changed): New function.
        * mi.h (mi_context_changed): Add declaration.

gdb/mi/ChangeLog
gdb/mi/mi-events.c
gdb/mi/mi-interp.c
gdb/mi/mi.h

index 6562657da46242115277437a4a4fd565e3cf3b19..eac1700a5b226ea97e08eb70693fbadc2ec47428 100644 (file)
@@ -1,3 +1,14 @@
+2002-08-09  Keith Seitz  <keiths@redhat.com>
+
+        * mi-interp.c (mi_event_handlers): Add context_changed event
+        handler.
+       (mi_command_loop): Remove big block of code repeated in 
+       mi_interpreter_resume. I don't think this is needed.
+        (mi_insert_notify_hooks): Remove context_hook.
+        (mi_remove_notify_hooks): Likewise.
+        * mi-events.c (mi_context_changed): New function.
+        * mi.h (mi_context_changed): Add declaration.
+
 2002-07-25  Keith Seitz  <keiths@redhat.com>
 
        * mi-interp.c (mi_event_handlers): Add selected_frame_level_changed
        remove redundant breakpoint info on "-break-insert" and "-break-watch".
        The event now supplies everything that is needed.
 
+2002-05-28  Keith Seitz  <keiths@redhat.com>
+
+       * mi-interp.c:  New file. Almost entirely from Apple's
+       sources. Collected and moved here.
+       * mi-events.c: Ditto.
+       * mi.h: New file.
+       * mi-main.c (captured_execute_command): Use catch_exception
+       instead of catch_errors.
+       (mi_execute_command_wrapper): Remove. Using catch_errors now.
+       (mi_input): Make global.
+       (mi_load_progress): Ditto.
+       Use interpreter functions instead of interpreter_p.
+       (mi_command_loop): Moved to mi-interp.c
+       (mi0_command_loop): Ditto.
+       (mi1_command_loop): Ditto.
+       (mi_init_ui): Remove.
+       (_initialize_mi_main): Remove. No longer needed.
+
 2002-07-29  Andrew Cagney  <ac131313@redhat.com>
 
        * mi-cmd-var.c: Include "gdb_string.h".
index 873101b65b6c1e0deaa3a4085b31f3078cc373e6..546a70f4bb4e8b781d705f3e50d112f9bd29bbf7 100644 (file)
@@ -43,24 +43,6 @@ mi_interp_stack_changed_hook (void)
   uiout = saved_ui_out;
 }
 
-void
-mi_interp_context_hook (int thread_id)
-{
-  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);
-  else
-    uiout = gdb_interpreter_ui_out (mi_interp);
-
-  ui_out_list_begin (uiout, "MI_HOOK_RESULT");
-  ui_out_field_string (uiout, "HOOK_TYPE", "thread_changed");
-  ui_out_field_int (uiout, "thread", thread_id);
-  ui_out_list_end (uiout);
-  uiout = saved_ui_out;
-}
-
 static void
 event_notify (const char *string, ...)
 {
@@ -130,3 +112,9 @@ mi_selected_frame_level_changed (int level)
 {
   event_notify ("selected-frame-level-changed,level=\"%d\"", level);
 }
+
+void
+mi_context_changed (int thread_id)
+{
+  event_notify ("context-changed,thread=\"%d\"", thread_id);
+}
index 5f1f0843047dd8dc23494a8836cddb36937d47da..9aa5c612fa2e912d79675295b7376d93a3f30a34 100644 (file)
@@ -78,7 +78,8 @@ static struct gdb_events mi_event_handlers =
     mi_modify_tracepoint,
     mi_architecture_changed,
     mi_register_update,
-    mi_selected_frame_level_changed
+    mi_selected_frame_level_changed,
+    mi_context_changed
   };
 
 static int
@@ -341,14 +342,12 @@ mi_cmd_interpreter_set (char *command, char **argv, int argc)
 static void
 mi_insert_notify_hooks (void)
 {
-  context_hook = mi_interp_context_hook;
   query_hook = mi_interp_query_hook;
 }
 
 static void
 mi_remove_notify_hooks ()
 {
-  context_hook = NULL;
   query_hook = NULL;
 }
 
@@ -398,6 +397,7 @@ mi1_command_loop (void)
 static void
 mi_command_loop (int mi_version)
 {
+#if 0
   /* 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 */
@@ -435,6 +435,7 @@ mi_command_loop (int mi_version)
   error_hook = 0;
   error_begin_hook = 0;
   show_load_progress = mi_load_progress;
+#endif
   /* 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;
index cba6a9cdb13e3e4ecc8eb97cd7d3f52b6c1b4d8e..1db80a656fb63acdaa7d6a88d705856b8ddb4024 100644 (file)
@@ -55,4 +55,5 @@ extern void mi_delete_tracepoint (int bpnum);
 extern void mi_architecture_changed (void);
 extern void mi_register_update(int regno);
 extern void mi_selected_frame_level_changed (int level);
+extern void mi_context_changed (int thread_id);
 #endif /* MI_H */