aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-04-04 17:03:27 -0600
committerTom Tromey <tromey@adacore.com>2019-04-09 11:59:25 -0600
commit9ab8741a48294e19d514721c710c81bba46db7f2 (patch)
tree4d5ae9a1a3992e59d5d23ad1c256278f422d4d08 /gdb/remote.c
parent9ca1957fcb3c6904d9e5fb0a0e78d4b98f76b1b6 (diff)
downloadgdb-9ab8741a48294e19d514721c710c81bba46db7f2.zip
gdb-9ab8741a48294e19d514721c710c81bba46db7f2.tar.gz
gdb-9ab8741a48294e19d514721c710c81bba46db7f2.tar.bz2
Consistently use bool for fake_pid_p
I noticed a few spots where fake_pid_p is handled as an int, whereas the field in struct inferior has type bool. This patch changes the remaining places to use bool as well. Tested by the buildbot. gdb/ChangeLog 2019-04-09 Tom Tromey <tromey@adacore.com> * remote.c (remote_target::remote_add_inferior): Change fake_pid_p to bool. (extended_remote_target::attach): Update. (remote_target::remote_notice_new_inferior): Update. (remote_target::add_current_inferior_and_thread): Update. * inferior.c (exit_inferior_1): Use "false". * corelow.c (add_to_thread_list): Make fake_pid_p bool.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 9bbf458..69b479b 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -767,7 +767,7 @@ public: /* Remote specific methods. */
char *remote_get_noisy_reply ();
int remote_query_attached (int pid);
- inferior *remote_add_inferior (int fake_pid_p, int pid, int attached,
+ inferior *remote_add_inferior (bool fake_pid_p, int pid, int attached,
int try_open_exec);
ptid_t remote_current_thread (ptid_t oldpid);
@@ -2354,7 +2354,7 @@ remote_target::remote_query_attached (int pid)
if no main executable is open already. */
inferior *
-remote_target::remote_add_inferior (int fake_pid_p, int pid, int attached,
+remote_target::remote_add_inferior (bool fake_pid_p, int pid, int attached,
int try_open_exec)
{
struct inferior *inf;
@@ -2495,7 +2495,7 @@ remote_target::remote_notice_new_inferior (ptid_t currthread, int executing)
if (find_inferior_pid (currthread.pid ()) == NULL)
{
struct remote_state *rs = get_remote_state ();
- int fake_pid_p = !remote_multi_process_p (rs);
+ bool fake_pid_p = !remote_multi_process_p (rs);
inf = remote_add_inferior (fake_pid_p,
currthread.pid (), -1, 1);
@@ -4311,7 +4311,7 @@ void
remote_target::add_current_inferior_and_thread (char *wait_status)
{
struct remote_state *rs = get_remote_state ();
- int fake_pid_p = 0;
+ bool fake_pid_p = false;
inferior_ptid = null_ptid;
@@ -4321,7 +4321,7 @@ remote_target::add_current_inferior_and_thread (char *wait_status)
if (curr_ptid != null_ptid)
{
if (!remote_multi_process_p (rs))
- fake_pid_p = 1;
+ fake_pid_p = true;
}
else
{
@@ -4330,7 +4330,7 @@ remote_target::add_current_inferior_and_thread (char *wait_status)
double duty as both the pid of the target process (if it has
such), and as a flag indicating that a target is active. */
curr_ptid = magic_null_ptid;
- fake_pid_p = 1;
+ fake_pid_p = true;
}
remote_add_inferior (fake_pid_p, curr_ptid.pid (), -1, 1);
@@ -5847,7 +5847,7 @@ extended_remote_target::attach (const char *args, int from_tty)
target_pid_to_str (ptid_t (pid)).c_str ());
}
- set_current_inferior (remote_add_inferior (0, pid, 1, 0));
+ set_current_inferior (remote_add_inferior (false, pid, 1, 0));
inferior_ptid = ptid_t (pid);