aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-interp.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-04-21 09:45:30 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-05-30 15:07:26 -0400
commit30e7e0a917b44cbef439cb9c52fa41d21a5f8e44 (patch)
treebbb9cbadedbf0e748df1183ebd83be97cd32751b /gdb/mi/mi-interp.c
parent77cd03e27c547a5b5b7f086a0b537084eb399258 (diff)
downloadgdb-30e7e0a917b44cbef439cb9c52fa41d21a5f8e44.zip
gdb-30e7e0a917b44cbef439cb9c52fa41d21a5f8e44.tar.gz
gdb-30e7e0a917b44cbef439cb9c52fa41d21a5f8e44.tar.bz2
gdb: add interp::on_new_thread method
Same idea as previous patches, but for new_thread. Change-Id: Ib70ae3421b736fd69d86c4e7c708bec349aa256c
Diffstat (limited to 'gdb/mi/mi-interp.c')
-rw-r--r--gdb/mi/mi-interp.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 2984cb9..7090331 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -60,7 +60,6 @@ static int mi_interp_query_hook (const char *ctlstr, va_list ap)
static void mi_insert_notify_hooks (void);
static void mi_remove_notify_hooks (void);
-static void mi_new_thread (struct thread_info *t);
static void mi_thread_exit (struct thread_info *t, int silent);
static void mi_record_changed (struct inferior*, int, const char *,
const char *);
@@ -307,24 +306,15 @@ mi_interp::pre_command_loop ()
display_mi_prompt (mi);
}
-static void
-mi_new_thread (struct thread_info *t)
+void
+mi_interp::on_new_thread (thread_info *t)
{
- SWITCH_THRU_ALL_UIS ()
- {
- struct mi_interp *mi = as_mi_interp (top_level_interpreter ());
-
- if (mi == NULL)
- continue;
-
- target_terminal::scoped_restore_terminal_state term_state;
- target_terminal::ours_for_output ();
+ target_terminal::scoped_restore_terminal_state term_state;
+ target_terminal::ours_for_output ();
- gdb_printf (mi->event_channel,
- "thread-created,id=\"%d\",group-id=\"i%d\"",
- t->global_num, t->inf->num);
- gdb_flush (mi->event_channel);
- }
+ gdb_printf (this->event_channel, "thread-created,id=\"%d\",group-id=\"i%d\"",
+ t->global_num, t->inf->num);
+ gdb_flush (this->event_channel);
}
static void
@@ -1189,7 +1179,6 @@ _initialize_mi_interp ()
interp_factory_register (INTERP_MI4, mi_interp_factory);
interp_factory_register (INTERP_MI, mi_interp_factory);
- gdb::observers::new_thread.attach (mi_new_thread, "mi-interp");
gdb::observers::thread_exit.attach (mi_thread_exit, "mi-interp");
gdb::observers::inferior_added.attach (mi_inferior_added, "mi-interp");
gdb::observers::inferior_appeared.attach (mi_inferior_appeared, "mi-interp");