Convert an int flag variable to bool
authorLuis Machado <luis.machado@linaro.org>
Thu, 9 Jan 2020 19:24:15 +0000 (16:24 -0300)
committerLuis Machado <luis.machado@linaro.org>
Tue, 21 Jan 2020 13:26:27 +0000 (10:26 -0300)
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.

gdb/ChangeLog
gdb/aarch64-tdep.c

index ec9bac0dad30355664452bfbd6d5bbcfbd192f43..0161fbf6849c6c52bdd91b3c279ec2327508535d 100644 (file)
@@ -1,3 +1,11 @@
+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
index 03d650d9dc5c6ec375984e003bd8196f41b547c6..1631178f8c2620b3470f83ceb656b11c4571ac57 100644 (file)
@@ -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;
 }
 
This page took 0.028934 seconds and 4 git commands to generate.