[1/4] gdb/remote: Use true/false instead of 1/0

Message ID 5da89b0d4cd1ca887b9ce944088df11ec8e7a001.1623268999.git.andrew.burgess@embecosm.com
State New
Headers show
Series
  • gdb/remote: spot stop packets sent for the wrong thread
Related show

Commit Message

Andrew Burgess June 9, 2021, 8:06 p.m.
The remote_state::starting_up member variable is already of type bool,
but in some places we still write to it using 1 and 0.  This commit
just updates things to use true and false.

There should be no user visible change after this commit.

gdb/ChangeLog:

	* remote.c (remote_target::start_remote): Set 'starting_up' using
	boolean values instead of integers.
---
 gdb/ChangeLog | 5 +++++
 gdb/remote.c  | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

-- 
2.25.4

Comments

Andrew Burgess June 28, 2021, 3:32 p.m. | #1
* Andrew Burgess <andrew.burgess@embecosm.com> [2021-06-09 21:06:14 +0100]:

> The remote_state::starting_up member variable is already of type bool,

> but in some places we still write to it using 1 and 0.  This commit

> just updates things to use true and false.

> 

> There should be no user visible change after this commit.

> 

> gdb/ChangeLog:

> 

> 	* remote.c (remote_target::start_remote): Set 'starting_up' using

> 	boolean values instead of integers.


I have pushed just this patch from this series.  The rest of this
series will need a review before it can be merged.

Thanks,
Andrew


> ---

>  gdb/ChangeLog | 5 +++++

>  gdb/remote.c  | 8 ++++----

>  2 files changed, 9 insertions(+), 4 deletions(-)

> 

> diff --git a/gdb/remote.c b/gdb/remote.c

> index de04aab43dc..531d43a692b 100644

> --- a/gdb/remote.c

> +++ b/gdb/remote.c

> @@ -4667,7 +4667,7 @@ remote_target::start_remote (int from_tty, int extended_p)

>       Ctrl-C before we're connected and synced up can't interrupt the

>       target.  Instead, it offers to drop the (potentially wedged)

>       connection.  */

> -  rs->starting_up = 1;

> +  rs->starting_up = true;

>  

>    QUIT;

>  

> @@ -4808,7 +4808,7 @@ remote_target::start_remote (int from_tty, int extended_p)

>  

>  	  /* We're connected, but not running.  Drop out before we

>  	     call start_remote.  */

> -	  rs->starting_up = 0;

> +	  rs->starting_up = false;

>  	  return;

>  	}

>        else

> @@ -4923,7 +4923,7 @@ remote_target::start_remote (int from_tty, int extended_p)

>  

>  	  /* We're connected, but not running.  Drop out before we

>  	     call start_remote.  */

> -	  rs->starting_up = 0;

> +	  rs->starting_up = false;

>  	  return;

>  	}

>  

> @@ -4968,7 +4968,7 @@ remote_target::start_remote (int from_tty, int extended_p)

>       target, our symbols have been relocated, and we're merged the

>       target's tracepoints with ours.  We're done with basic start

>       up.  */

> -  rs->starting_up = 0;

> +  rs->starting_up = false;

>  

>    /* Maybe breakpoints are global and need to be inserted now.  */

>    if (breakpoints_should_be_inserted_now ())

> -- 

> 2.25.4

>

Patch

diff --git a/gdb/remote.c b/gdb/remote.c
index de04aab43dc..531d43a692b 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -4667,7 +4667,7 @@  remote_target::start_remote (int from_tty, int extended_p)
      Ctrl-C before we're connected and synced up can't interrupt the
      target.  Instead, it offers to drop the (potentially wedged)
      connection.  */
-  rs->starting_up = 1;
+  rs->starting_up = true;
 
   QUIT;
 
@@ -4808,7 +4808,7 @@  remote_target::start_remote (int from_tty, int extended_p)
 
 	  /* We're connected, but not running.  Drop out before we
 	     call start_remote.  */
-	  rs->starting_up = 0;
+	  rs->starting_up = false;
 	  return;
 	}
       else
@@ -4923,7 +4923,7 @@  remote_target::start_remote (int from_tty, int extended_p)
 
 	  /* We're connected, but not running.  Drop out before we
 	     call start_remote.  */
-	  rs->starting_up = 0;
+	  rs->starting_up = false;
 	  return;
 	}
 
@@ -4968,7 +4968,7 @@  remote_target::start_remote (int from_tty, int extended_p)
      target, our symbols have been relocated, and we're merged the
      target's tracepoints with ours.  We're done with basic start
      up.  */
-  rs->starting_up = 0;
+  rs->starting_up = false;
 
   /* Maybe breakpoints are global and need to be inserted now.  */
   if (breakpoints_should_be_inserted_now ())