diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-04-20 14:46:58 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-05-30 15:07:26 -0400 |
commit | bf64d1d5bf718859b2687a0a011246b9cbbca9e1 (patch) | |
tree | 9f77aeb905a2235897e26355aa1cce894a7c0d6c /gdb/mi | |
parent | d6bd2ef5f4c2027a68810f4a9dbe871b61e819ab (diff) | |
download | gdb-bf64d1d5bf718859b2687a0a011246b9cbbca9e1.zip gdb-bf64d1d5bf718859b2687a0a011246b9cbbca9e1.tar.gz gdb-bf64d1d5bf718859b2687a0a011246b9cbbca9e1.tar.bz2 |
gdb: add interp::on_exited method
Same as previous patch, but for exited. Remove the exited observable,
since nothing uses it anymore, and we don't have anything coming that
will use it.
Change-Id: I358cbea0159af56752dfee7510d6a86191e722bb
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-interp.c | 20 | ||||
-rw-r--r-- | gdb/mi/mi-interp.h | 1 |
2 files changed, 5 insertions, 16 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index ba9297e..cfe1516 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_on_exited (int exitstatus); static void mi_on_no_history (void); static void mi_new_thread (struct thread_info *t); @@ -536,21 +535,11 @@ mi_interp::on_signal_exited (gdb_signal sig) print_signal_exited_reason (this->cli_uiout, sig); } -/* Observer for the exited notification. */ - -static void -mi_on_exited (int exitstatus) +void +mi_interp::on_exited (int status) { - SWITCH_THRU_ALL_UIS () - { - struct mi_interp *mi = find_mi_interp (); - - if (mi == NULL) - continue; - - print_exited_reason (mi->mi_uiout, exitstatus); - print_exited_reason (mi->cli_uiout, exitstatus); - } + print_exited_reason (this->mi_uiout, status); + print_exited_reason (this->cli_uiout, status); } /* Observer for the no_history notification. */ @@ -1264,7 +1253,6 @@ _initialize_mi_interp () interp_factory_register (INTERP_MI4, mi_interp_factory); interp_factory_register (INTERP_MI, mi_interp_factory); - gdb::observers::exited.attach (mi_on_exited, "mi-interp"); gdb::observers::no_history.attach (mi_on_no_history, "mi-interp"); gdb::observers::new_thread.attach (mi_new_thread, "mi-interp"); gdb::observers::thread_exit.attach (mi_thread_exit, "mi-interp"); diff --git a/gdb/mi/mi-interp.h b/gdb/mi/mi-interp.h index 2b825e7..9b29bb5 100644 --- a/gdb/mi/mi-interp.h +++ b/gdb/mi/mi-interp.h @@ -45,6 +45,7 @@ public: void on_signal_received (gdb_signal sig) override; void on_signal_exited (gdb_signal sig) override; void on_normal_stop (struct bpstat *bs, int print_frame) override; + void on_exited (int status) override; /* MI's output channels */ mi_console_file *out; |