+2020-03-24 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * fbsd-nat.c (fbsd_nat_target::follow_fork): Change bool to int.
+ * fbsd-nat.h (class fbsd_nat_target) <follow_fork>: Likewise.
+ * inf-ptrace.c (inf_ptrace_target::follow_fork): Likewise.
+ * inf-ptrace.h (struct inf_ptrace_target) <follow_fork>: Likewise.
+ * infrun.c (follow_fork): Likewise.
+ (follow_fork_inferior): Likewise.
+ * linux-nat.c (linux_nat_target::follow_fork): Likewise.
+ * linux-nat.h (class linux_nat_target): Likewise.
+ * remote.c (class remote_target) <follow_fork>: Likewise.
+ (remote_target::follow_fork): Likewise.
+ * target-delegates.c: Re-generate.
+ * target.c (default_follow_fork): Likewise.
+ (target_follow_fork): Likewise.
+ * target.h (struct target_ops) <follow_fork>: Likewise.
+ (target_follow_fork): Likewise.
+
2020-03-24 Tom de Vries <tdevries@suse.de>
* psymtab.c (maintenance_info_psymtabs): Print user field.
/* Target hook for follow_fork. On entry and at return inferior_ptid is
the ptid of the followed inferior. */
-int
-fbsd_nat_target::follow_fork (int follow_child, int detach_fork)
+bool
+fbsd_nat_target::follow_fork (bool follow_child, bool detach_fork)
{
if (!follow_child && detach_fork)
{
#endif
}
- return 0;
+ return false;
}
int
#endif
#ifdef TDP_RFPPWAIT
- int follow_fork (int, int) override;
+ bool follow_fork (bool, bool) override;
int insert_fork_catchpoint (int) override;
int remove_fork_catchpoint (int) override;
/* Target hook for follow_fork. On entry and at return inferior_ptid is
the ptid of the followed inferior. */
-int
-inf_ptrace_target::follow_fork (int follow_child, int detach_fork)
+bool
+inf_ptrace_target::follow_fork (bool follow_child, bool detach_fork)
{
if (!follow_child)
{
perror_with_name (("ptrace"));
}
- return 0;
+ return false;
}
int
void create_inferior (const char *, const std::string &,
char **, int) override;
#ifdef PT_GET_PROCESS_STATE
- int follow_fork (int, int) override;
+ bool follow_fork (bool, bool) override;
int insert_fork_catchpoint (int) override;
static void sig_print_header (void);
-static int follow_fork (void);
-
-static int follow_fork_inferior (int follow_child, int detach_fork);
-
static void follow_inferior_reset_breakpoints (void);
static int currently_stepping (struct thread_info *tp);
the fork parent. At return inferior_ptid is the ptid of the
followed inferior. */
-static int
-follow_fork_inferior (int follow_child, int detach_fork)
+static bool
+follow_fork_inferior (bool follow_child, bool detach_fork)
{
int has_vforked;
ptid_t parent_ptid, child_ptid;
if the inferior should be resumed; false, if the target for some
reason decided it's best not to resume. */
-static int
-follow_fork (void)
+static bool
+follow_fork ()
{
- int follow_child = (follow_fork_mode_string == follow_fork_mode_child);
- int should_resume = 1;
+ bool follow_child = (follow_fork_mode_string == follow_fork_mode_child);
+ bool should_resume = true;
struct thread_info *tp;
/* Copy user stepping state to the new inferior thread. FIXME: the
happened. */
thread_info *wait_thread = find_thread_ptid (wait_target, wait_ptid);
switch_to_thread (wait_thread);
- should_resume = 0;
+ should_resume = false;
}
}
watchpoints, for example, always appear in the bpstat. */
if (!bpstat_causes_stop (ecs->event_thread->control.stop_bpstat))
{
- int should_resume;
- int follow_child
+ bool follow_child
= (follow_fork_mode_string == follow_fork_mode_child);
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
process_stratum_target *targ
= ecs->event_thread->inf->process_target ();
- should_resume = follow_fork ();
+ bool should_resume = follow_fork ();
/* Note that one of these may be an invalid pointer,
depending on detach_fork. */
ptid of the followed inferior. At return, inferior_ptid will be
unchanged. */
-int
-linux_nat_target::follow_fork (int follow_child, int detach_fork)
+bool
+linux_nat_target::follow_fork (bool follow_child, bool detach_fork)
{
if (!follow_child)
{
check_for_thread_db ();
}
- return 0;
+ return false;
}
\f
void post_attach (int) override;
- int follow_fork (int, int) override;
+ bool follow_fork (bool, bool) override;
std::vector<static_tracepoint_marker>
static_tracepoint_markers_by_strid (const char *id) override;
const struct btrace_config *btrace_conf (const struct btrace_target_info *) override;
bool augmented_libraries_svr4_read () override;
- int follow_fork (int, int) override;
+ bool 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. */
-int
-remote_target::follow_fork (int follow_child, int detach_fork)
+bool
+remote_target::follow_fork (bool follow_child, bool detach_fork)
{
struct remote_state *rs = get_remote_state ();
enum target_waitkind kind = inferior_thread ()->pending_follow.kind;
remote_detach_pid (child_pid);
}
}
- return 0;
+
+ 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;
- int follow_fork (int arg0, int arg1) override;
+ bool 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;
- int follow_fork (int arg0, int arg1) override;
+ bool 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;
}
-int
-target_ops::follow_fork (int arg0, int arg1)
+bool
+target_ops::follow_fork (bool arg0, bool arg1)
{
return this->beneath ()->follow_fork (arg0, arg1);
}
-int
-dummy_target::follow_fork (int arg0, int arg1)
+bool
+dummy_target::follow_fork (bool arg0, bool arg1)
{
return default_follow_fork (this, arg0, arg1);
}
-int
-debug_target::follow_fork (int arg0, int arg1)
+bool
+debug_target::follow_fork (bool arg0, bool arg1)
{
- int result;
+ bool result;
fprintf_unfiltered (gdb_stdlog, "-> %s->follow_fork (...)\n", this->beneath ()->shortname ());
result = this->beneath ()->follow_fork (arg0, arg1);
fprintf_unfiltered (gdb_stdlog, "<- %s->follow_fork (", this->beneath ()->shortname ());
- target_debug_print_int (arg0);
+ target_debug_print_bool (arg0);
fputs_unfiltered (", ", gdb_stdlog);
- target_debug_print_int (arg1);
+ target_debug_print_bool (arg1);
fputs_unfiltered (") = ", gdb_stdlog);
- target_debug_print_int (result);
+ target_debug_print_bool (result);
fputs_unfiltered ("\n", gdb_stdlog);
return result;
}
static ptid_t default_get_ada_task_ptid (struct target_ops *self,
long lwp, long tid);
-static int default_follow_fork (struct target_ops *self, int follow_child,
- int detach_fork);
-
static void default_mourn_inferior (struct target_ops *self);
static int default_search_memory (struct target_ops *ops,
current_top_target ()->program_signals (program_signals);
}
-static int
-default_follow_fork (struct target_ops *self, int follow_child,
- int detach_fork)
+static bool
+default_follow_fork (struct target_ops *self, bool follow_child,
+ bool detach_fork)
{
/* Some target returned a fork event, but did not know how to follow it. */
internal_error (__FILE__, __LINE__,
/* Look through the list of possible targets for a target that can
follow forks. */
-int
-target_follow_fork (int follow_child, int detach_fork)
+bool
+target_follow_fork (bool follow_child, bool detach_fork)
{
return current_top_target ()->follow_fork (follow_child, detach_fork);
}
TARGET_DEFAULT_RETURN (1);
virtual int remove_vfork_catchpoint (int)
TARGET_DEFAULT_RETURN (1);
- virtual int follow_fork (int, int)
+ virtual bool follow_fork (bool, bool)
TARGET_DEFAULT_FUNC (default_follow_fork);
virtual int insert_exec_catchpoint (int)
TARGET_DEFAULT_RETURN (1);
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 1 if the inferior should not be resumed
+ This function returns true if the inferior should not be resumed
(i.e. there is another event pending). */
-int target_follow_fork (int follow_child, int detach_fork);
+bool 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. */