[binutils-gdb] Convert an int flag variable to bool

Luis Machado luisgpm@sourceware.org
Tue Jan 21 13:27:00 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f0c702d4b8415becb67610389cf266f73226080e

commit f0c702d4b8415becb67610389cf266f73226080e
Author: Luis Machado <luis.machado@linaro.org>
Date:   Thu Jan 9 16:24:15 2020 -0300

    Convert an int flag variable to bool
    
    As suggested, the cond variable is really supposed to be a bool. So,
    make it so.
    
    gdb/ChangeLog:
    
    2020-01-21  Luis Machado  <luis.machado@linaro.org>
    
    	* aarch64-tdep.c (struct aarch64_displaced_step_closure)
    	<cond>: Change type to bool.
    	(aarch64_displaced_step_b_cond): Update cond to use bool type.
    	(aarch64_displaced_step_cb): Likewise.
    	(aarch64_displaced_step_tb): Likewise.

Diff:
---
 gdb/ChangeLog      | 8 ++++++++
 gdb/aarch64-tdep.c | 8 ++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ec9bac0..0161fbf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
 2020-01-21  Luis Machado  <luis.machado@linaro.org>
 
+	* aarch64-tdep.c (struct aarch64_displaced_step_closure)
+	<cond>: Change type to bool.
+	(aarch64_displaced_step_b_cond): Update cond to use bool type.
+	(aarch64_displaced_step_cb): Likewise.
+	(aarch64_displaced_step_tb): Likewise.
+
+2020-01-21  Luis Machado  <luis.machado@linaro.org>
+
 	* aarch64-tdep.c (aarch64_displaced_step_fixup): Add more debugging
 	output.
 
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 03d650d..1631178 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -2735,7 +2735,7 @@ struct aarch64_displaced_step_closure : public displaced_step_closure
 {
   /* It is true when condition instruction, such as B.CON, TBZ, etc,
      is being displaced stepping.  */
-  int cond = 0;
+  bool cond = false;
 
   /* PC adjustment offset after displaced stepping.  If 0, then we don't
      write the PC back, assuming the PC is already the right address.  */
@@ -2816,7 +2816,7 @@ aarch64_displaced_step_b_cond (const unsigned cond, const int32_t offset,
   */
 
   emit_bcond (dsd->insn_buf, cond, 8);
-  dsd->dsc->cond = 1;
+  dsd->dsc->cond = true;
   dsd->dsc->pc_adjust = offset;
   dsd->insn_count = 1;
 }
@@ -2851,7 +2851,7 @@ aarch64_displaced_step_cb (const int32_t offset, const int is_cbnz,
   */
   emit_cb (dsd->insn_buf, is_cbnz, aarch64_register (rn, is64), 8);
   dsd->insn_count = 1;
-  dsd->dsc->cond = 1;
+  dsd->dsc->cond = true;
   dsd->dsc->pc_adjust = offset;
 }
 
@@ -2876,7 +2876,7 @@ aarch64_displaced_step_tb (const int32_t offset, int is_tbnz,
   */
   emit_tb (dsd->insn_buf, is_tbnz, bit, aarch64_register (rt, 1), 8);
   dsd->insn_count = 1;
-  dsd->dsc->cond = 1;
+  dsd->dsc->cond = true;
   dsd->dsc->pc_adjust = offset;
 }



More information about the Gdb-cvs mailing list