target_follow_fork (child_inf, child_ptid, fork_kind, follow_child,
detach_fork);
+ gdb::observers::inferior_forked.notify (parent_inf, child_inf, fork_kind);
+
/* target_follow_fork must leave the parent as the current inferior. If we
want to follow the child, we make it the current one below. */
gdb_assert (current_inferior () == parent_inf);
DEFINE_OBSERVABLE (executable_changed);
DEFINE_OBSERVABLE (inferior_created);
DEFINE_OBSERVABLE (inferior_execd);
+DEFINE_OBSERVABLE (inferior_forked);
DEFINE_OBSERVABLE (record_changed);
DEFINE_OBSERVABLE (solib_loaded);
DEFINE_OBSERVABLE (solib_unloaded);
#define OBSERVABLE_H
#include "gdbsupport/observable.h"
+#include "target/waitstatus.h"
struct bpstat;
struct so_list;
extern observable<inferior */* exec_inf */, inferior */* follow_inf */>
inferior_execd;
+/* The inferior PARENT_INF has forked. If we are setting up an inferior for
+ the child (because we follow only the child or we follow both), CHILD_INF
+ is the child inferior. Otherwise, CHILD_INF is nullptr.
+
+ FORK_KIND is TARGET_WAITKIND_FORKED or TARGET_WAITKIND_VFORKED. */
+extern observable<inferior */* parent_inf */, inferior */* child_inf */,
+ target_waitkind /* fork_kind */> inferior_forked;
+
/* The status of process record for inferior inferior in gdb has
changed. The process record is started if STARTED is true, and
the process record is stopped if STARTED is false.