summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2002-08-09 19:53:56 +0000
committerKeith Seitz <keiths@redhat.com>2002-08-09 19:53:56 +0000
commit9f22e73b462f3b194a8d5f69df23e55d8f216c0b (patch)
treed24746470dde00b6a9b5b35ca9ecb290ab21a7be
parentb931009abd595ef564b2afca6c961a149e9bc500 (diff)
downloadgdb-9f22e73b462f3b194a8d5f69df23e55d8f216c0b.tar.gz
* 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.
-rw-r--r--gdb/mi/ChangeLog29
-rw-r--r--gdb/mi/mi-events.c24
-rw-r--r--gdb/mi/mi-interp.c7
-rw-r--r--gdb/mi/mi.h1
4 files changed, 40 insertions, 21 deletions
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 6562657da46..eac1700a5b2 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -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
@@ -83,6 +94,24 @@
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".
diff --git a/gdb/mi/mi-events.c b/gdb/mi/mi-events.c
index 873101b65b6..546a70f4bb4 100644
--- a/gdb/mi/mi-events.c
+++ b/gdb/mi/mi-events.c
@@ -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);
+}
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 5f1f0843047..9aa5c612fa2 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -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;
diff --git a/gdb/mi/mi.h b/gdb/mi/mi.h
index cba6a9cdb13..1db80a656fb 100644
--- a/gdb/mi/mi.h
+++ b/gdb/mi/mi.h
@@ -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 */