diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-04-21 09:45:30 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-05-30 15:07:26 -0400 |
commit | 023c6d45d793b729b58968a50dee607e8b30a4d0 (patch) | |
tree | 32e73616760f9ca6fff45a8fa1ccc8d55eb4bf92 /gdb/inferior.c | |
parent | 8e7af8434581e325366c8ec4a30f33e8e1794310 (diff) | |
download | gdb-023c6d45d793b729b58968a50dee607e8b30a4d0.zip gdb-023c6d45d793b729b58968a50dee607e8b30a4d0.tar.gz gdb-023c6d45d793b729b58968a50dee607e8b30a4d0.tar.bz2 |
gdb: add interp::on_inferior_added method
Same idea as previous patches, but for inferior_added.
mi_interp::init avoided using mi_inferior_added, since, as the comment
used to say, it would notify all MI interpreters. Now, it's easy to
only notify the new interpreter, so it's possible to just call the
on_inferior_added method in mi_interp::init.
Change-Id: I0eddbd5367217d1c982516982089913019ef309f
Diffstat (limited to 'gdb/inferior.c')
-rw-r--r-- | gdb/inferior.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/inferior.c b/gdb/inferior.c index 8962b64..a70bbe4 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -38,6 +38,7 @@ #include "progspace-and-thread.h" #include "gdbsupport/buildargv.h" #include "cli/cli-style.h" +#include "interps.h" intrusive_list<inferior> inferior_list; static int highest_inferior_num; @@ -189,6 +190,15 @@ inferior::do_all_continuations () } } +/* Notify interpreters and observers that inferior INF was added. */ + +static void +notify_inferior_added (inferior *inf) +{ + interps_notify_inferior_added (inf); + gdb::observers::inferior_added.notify (inf); +} + struct inferior * add_inferior_silent (int pid) { @@ -196,7 +206,7 @@ add_inferior_silent (int pid) inferior_list.push_back (*inf); - gdb::observers::inferior_added.notify (inf); + notify_inferior_added (inf); if (pid != 0) inferior_appeared (inf, pid); |