+2021-04-07 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * target.h (struct target_ops) <follow_fork>: Return void.
+ (target_follow_fork): Likewise.
+ * target.c (default_follow_fork): Likewise.
+ (target_follow_fork): Likewise.
+ * infrun.c (follow_fork_inferior): Adjust.
+ * fbsd-nat.h (class fbsd_nat_target) <follow_fork>: Return void.
+ * fbsd-nat.c (fbsd_nat_target:::follow_fork): Likewise.
+ * linux-nat.h (class linux_nat_target) <follow_fork>: Likewise.
+ * linux-nat.c (linux_nat_target::follow_fork): Return void.
+ * obsd-nat.h (class obsd_nat_target) <follow_fork>: Return void.
+ * obsd-nat.c (obsd_nat_target::follow_fork): Likewise.
+ * remote.c (class remote_target) <follow_fork>: Likewise.
+ (remote_target::follow_fork): Likewise.
+ * target-delegates.c: Re-generate.
+
2021-04-07 Weimin Pan <weimin.pan@oracle.com>
* ctfread.c (fetch_tid_type): New function, use throughout file.
/* Target hook for follow_fork. On entry and at return inferior_ptid is
the ptid of the followed inferior. */
-bool
+void
fbsd_nat_target::follow_fork (bool follow_child, bool detach_fork)
{
if (!follow_child && detach_fork)
}
#endif
}
-
- return false;
}
int
#endif
#ifdef TDP_RFPPWAIT
- bool follow_fork (bool, bool) override;
+ void follow_fork (bool, bool) override;
int insert_fork_catchpoint (int) override;
int remove_fork_catchpoint (int) override;
Can not resume the parent process over vfork in the foreground while\n\
holding the child stopped. Try \"set detach-on-fork\" or \
\"set schedule-multiple\".\n"));
- return 1;
+ return true;
}
if (!follow_child)
switch_to_thread (child_thr);
}
- return target_follow_fork (follow_child, detach_fork);
+ target_follow_fork (follow_child, detach_fork);
+
+ return false;
}
/* Tell the target to follow the fork we're stopped at. Returns true
ptid of the followed inferior. At return, inferior_ptid will be
unchanged. */
-bool
+void
linux_nat_target::follow_fork (bool follow_child, bool detach_fork)
{
if (!follow_child)
/* Let the thread_db layer learn about this new process. */
check_for_thread_db ();
}
-
- return false;
}
\f
void post_attach (int) override;
- bool follow_fork (bool, bool) override;
+ void follow_fork (bool, bool) override;
std::vector<static_tracepoint_marker>
static_tracepoint_markers_by_strid (const char *id) override;
/* Target hook for follow_fork. On entry and at return inferior_ptid is
the ptid of the followed inferior. */
-bool
+void
obsd_nat_target::follow_fork (bool follow_child, bool detach_fork)
{
if (!follow_child)
if (ptrace (PT_DETACH, child_pid, (PTRACE_TYPE_ARG3)1, 0) == -1)
perror_with_name (("ptrace"));
}
-
- return false;
}
int
ptid_t wait (ptid_t, struct target_waitstatus *, target_wait_flags) override;
#ifdef PT_GET_PROCESS_STATE
- bool follow_fork (bool, bool) override;
+ void follow_fork (bool, bool) override;
int insert_fork_catchpoint (int) override;
const struct btrace_config *btrace_conf (const struct btrace_target_info *) override;
bool augmented_libraries_svr4_read () override;
- bool follow_fork (bool, bool) override;
+ void follow_fork (bool, bool) override;
void follow_exec (struct inferior *, const char *) override;
int insert_fork_catchpoint (int) override;
int remove_fork_catchpoint (int) override;
it is named remote_follow_fork in anticipation of using it for the
remote target as well. */
-bool
+void
remote_target::follow_fork (bool follow_child, bool detach_fork)
{
struct remote_state *rs = get_remote_state ();
remote_detach_pid (child_pid);
}
}
-
- return false;
}
/* Target follow-exec function for remote targets. Save EXECD_PATHNAME
int remove_fork_catchpoint (int arg0) override;
int insert_vfork_catchpoint (int arg0) override;
int remove_vfork_catchpoint (int arg0) override;
- bool follow_fork (bool arg0, bool arg1) override;
+ void follow_fork (bool arg0, bool arg1) override;
int insert_exec_catchpoint (int arg0) override;
int remove_exec_catchpoint (int arg0) override;
void follow_exec (struct inferior *arg0, const char *arg1) override;
int remove_fork_catchpoint (int arg0) override;
int insert_vfork_catchpoint (int arg0) override;
int remove_vfork_catchpoint (int arg0) override;
- bool follow_fork (bool arg0, bool arg1) override;
+ void follow_fork (bool arg0, bool arg1) override;
int insert_exec_catchpoint (int arg0) override;
int remove_exec_catchpoint (int arg0) override;
void follow_exec (struct inferior *arg0, const char *arg1) override;
return result;
}
-bool
+void
target_ops::follow_fork (bool arg0, bool arg1)
{
- return this->beneath ()->follow_fork (arg0, arg1);
+ this->beneath ()->follow_fork (arg0, arg1);
}
-bool
+void
dummy_target::follow_fork (bool arg0, bool arg1)
{
- return default_follow_fork (this, arg0, arg1);
+ default_follow_fork (this, arg0, arg1);
}
-bool
+void
debug_target::follow_fork (bool arg0, bool arg1)
{
- bool result;
fprintf_unfiltered (gdb_stdlog, "-> %s->follow_fork (...)\n", this->beneath ()->shortname ());
- result = this->beneath ()->follow_fork (arg0, arg1);
+ this->beneath ()->follow_fork (arg0, arg1);
fprintf_unfiltered (gdb_stdlog, "<- %s->follow_fork (", this->beneath ()->shortname ());
target_debug_print_bool (arg0);
fputs_unfiltered (", ", gdb_stdlog);
target_debug_print_bool (arg1);
- fputs_unfiltered (") = ", gdb_stdlog);
- target_debug_print_bool (result);
- fputs_unfiltered ("\n", gdb_stdlog);
- return result;
+ fputs_unfiltered (")\n", gdb_stdlog);
}
int
current_inferior ()->top_target ()->program_signals (program_signals);
}
-static bool
+static void
default_follow_fork (struct target_ops *self, bool follow_child,
bool detach_fork)
{
_("could not find a target to follow fork"));
}
-/* Look through the list of possible targets for a target that can
- follow forks. */
+/* See target.h. */
-bool
+void
target_follow_fork (bool follow_child, bool detach_fork)
{
target_ops *target = current_inferior ()->top_target ();
TARGET_DEFAULT_RETURN (1);
virtual int remove_vfork_catchpoint (int)
TARGET_DEFAULT_RETURN (1);
- virtual bool follow_fork (bool, bool)
+ virtual void follow_fork (bool, bool)
TARGET_DEFAULT_FUNC (default_follow_fork);
virtual int insert_exec_catchpoint (int)
TARGET_DEFAULT_RETURN (1);
the next resume in order to perform any bookkeeping and fiddling
necessary to continue debugging either the parent or child, as
requested, and releasing the other. Information about the fork
- or vfork event is available via get_last_target_status ().
- This function returns true if the inferior should not be resumed
- (i.e. there is another event pending). */
+ or vfork event is available via get_last_target_status (). */
-bool target_follow_fork (bool follow_child, bool detach_fork);
+void target_follow_fork (bool follow_child, bool detach_fork);
/* Handle the target-specific bookkeeping required when the inferior
makes an exec call. INF is the exec'd inferior. */