aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-03-24 13:44:58 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-03-24 13:45:21 -0400
commit5ab2fbf185935f387fd5c1f8b14ba9fe04b41b39 (patch)
tree75106f1f578d4e7a4d21019d7ae517d1c5d6c5bb /gdb/infrun.c
parente11cd7c491e4ec0cdd080c6dd45e62789a893606 (diff)
downloadgdb-5ab2fbf185935f387fd5c1f8b14ba9fe04b41b39.zip
gdb-5ab2fbf185935f387fd5c1f8b14ba9fe04b41b39.tar.gz
gdb-5ab2fbf185935f387fd5c1f8b14ba9fe04b41b39.tar.bz2
gdb: bool-ify follow_fork
Change parameters and return value of the various follow_fork functions/methods from int to bool. gdb/ChangeLog: * 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.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d672d1a..1fb445a 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -73,10 +73,6 @@ static void sig_print_info (enum gdb_signal);
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);
@@ -411,8 +407,8 @@ show_follow_fork_mode_string (struct ui_file *file, int from_tty,
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;
@@ -669,11 +665,11 @@ holding the child stopped. Try \"set detach-on-fork\" or \
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
@@ -714,7 +710,7 @@ follow_fork (void)
happened. */
thread_info *wait_thread = find_thread_ptid (wait_target, wait_ptid);
switch_to_thread (wait_thread);
- should_resume = 0;
+ should_resume = false;
}
}
@@ -5428,8 +5424,7 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
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;
@@ -5437,7 +5432,7 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
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. */