]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: change gdbarch_stack_frame_destroyed_p to return bool
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 27 Feb 2026 20:05:09 +0000 (15:05 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 9 Mar 2026 17:15:46 +0000 (13:15 -0400)
Change-Id: Iea7ff0028983fc54428d9627dd1d1106b02e9f07
Approved-By: Tom Tromey <tom@tromey.com>
21 files changed:
gdb/aarch64-tdep.c
gdb/amd64-tdep.c
gdb/arch-utils.c
gdb/arch-utils.h
gdb/arm-tdep.c
gdb/csky-tdep.c
gdb/gdbarch-gen.c
gdb/gdbarch-gen.h
gdb/gdbarch_components.py
gdb/hppa-tdep.c
gdb/i386-tdep.c
gdb/mips-tdep.c
gdb/nds32-tdep.c
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/sh-tdep.c
gdb/sparc-tdep.c
gdb/sparc-tdep.h
gdb/tic6x-tdep.c
gdb/tilegx-tdep.c
gdb/xstormy16-tdep.c

index 0ecc3e0c0f233da6a6af9e624b8c597d498b2b46..5904e65f3bc06e2e9c9ac8ed42a4bf83d46e1efe 100644 (file)
@@ -171,7 +171,7 @@ static const char *const aarch64_gcs_linux_register_names[] = {
   "gcs_features_locked",
 };
 
-static int aarch64_stack_frame_destroyed_p (struct gdbarch *, CORE_ADDR);
+static bool aarch64_stack_frame_destroyed_p (struct gdbarch *, CORE_ADDR);
 
 /* AArch64 prologue cache structure.  */
 struct aarch64_prologue_cache
@@ -4157,25 +4157,25 @@ aarch64_cannot_store_register (struct gdbarch *gdbarch, int regnum)
 
 /* Implement the stack_frame_destroyed_p gdbarch method.  */
 
-static int
+static bool
 aarch64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   CORE_ADDR func_start, func_end;
   if (!find_pc_partial_function (pc, NULL, &func_start, &func_end))
-    return 0;
+    return false;
 
   enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch);
 
   ULONGEST insn_from_memory;
   if (!safe_read_memory_unsigned_integer (pc, 4, byte_order_for_code,
                                          &insn_from_memory))
-    return 0;
+    return false;
 
   uint32_t insn = insn_from_memory;
 
   aarch64_inst inst;
   if (aarch64_decode_insn (insn, &inst, 1, nullptr) != 0)
-    return 0;
+    return false;
 
   return streq (inst.opcode->name, "ret");
 }
index 66411b4877720fd7627b7206e74874b917ef2fb5..2588960362018073b56432d3d131a6bea9d49545 100755 (executable)
@@ -3197,7 +3197,7 @@ static const struct frame_base amd64_frame_base =
 
 /* Implement core of the stack_frame_destroyed_p gdbarch method.  */
 
-static int
+static bool
 amd64_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   gdb_byte insn;
@@ -3211,12 +3211,12 @@ amd64_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
     return pc > epilogue;
 
   if (target_read_memory (pc, &insn, 1))
-    return 0;   /* Can't read memory at pc.  */
+    return false;   /* Can't read memory at pc.  */
 
   if (insn != 0xc3)     /* 'ret' instruction.  */
-    return 0;
+    return false;
 
-  return 1;
+  return true;
 }
 
 /* Normal frames, but in a function epilogue.  */
@@ -3227,7 +3227,7 @@ amd64_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
    follow any instruction such as 'leave' or 'pop %ebp' that destroys
    the function's stack frame.  */
 
-static int
+static bool
 amd64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   struct compunit_symtab *cust = find_compunit_symtab_for_pc (pc);
@@ -3236,7 +3236,7 @@ amd64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
       && producer_is_llvm (cust->producer ()))
     return amd64_stack_frame_destroyed_p_1 (gdbarch, pc);
 
-  return 0;
+  return false;
 }
 
 static int
index 66a52bb8e51451e1d20d82738499175dcb8c0870..af0ef8c7f1a1759e72bd8924f0a1e409d6b5e9f0 100644 (file)
@@ -159,10 +159,10 @@ generic_in_solib_return_trampoline (struct gdbarch *gdbarch,
   return false;
 }
 
-int
+bool
 generic_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
-  return 0;
+  return false;
 }
 
 bool
index 56d9b172f20933f31790543f6010a328bb9a6257..1849fe3b1c860270b1d5338e886f417dd6d2e955 100644 (file)
@@ -252,8 +252,8 @@ extern bool generic_in_solib_return_trampoline (struct gdbarch *gdbarch,
                                                CORE_ADDR pc,
                                                const char *name);
 
-extern int generic_stack_frame_destroyed_p (struct gdbarch *gdbarch,
-                                           CORE_ADDR pc);
+extern bool generic_stack_frame_destroyed_p (struct gdbarch *gdbarch,
+                                            CORE_ADDR pc);
 
 extern bool default_code_of_frame_writable (struct gdbarch *gdbarch,
                                            const frame_info_ptr &frame);
index 3a80b64804ba81cb06be4ca80555f34aa84bf005..2435a5398b81d88f63ddd179cb2bae30ca57241f 100644 (file)
@@ -3262,10 +3262,10 @@ arm_epilogue_frame_prev_register (const frame_info_ptr &this_frame,
   return arm_prologue_prev_register (this_frame, this_cache, regnum);
 }
 
-static int arm_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch,
-                                         CORE_ADDR pc);
-static int thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch,
-                                         CORE_ADDR pc);
+static bool arm_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch,
+                                          CORE_ADDR pc);
+static bool thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch,
+                                          CORE_ADDR pc);
 
 /* Implementation of function hook 'sniffer' in
    'struct frame_uwnind' for epilogue unwinder.  */
@@ -4126,18 +4126,19 @@ arm_dwarf2_prev_register (const frame_info_ptr &this_frame, void **this_cache,
 
 /* Implement the stack_frame_destroyed_p gdbarch method.  */
 
-static int
+static bool
 thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch);
   unsigned int insn, insn2;
-  int found_return = 0, found_stack_adjust = 0;
+  int found_return = 0;
+  bool found_stack_adjust = false;
   CORE_ADDR func_start, func_end;
   CORE_ADDR scan_pc;
   gdb_byte buf[4];
 
   if (!find_pc_partial_function (pc, NULL, &func_start, &func_end))
-    return 0;
+    return false;
 
   /* The epilogue is a sequence of instructions along the following lines:
 
@@ -4204,7 +4205,7 @@ thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
     }
 
   if (!found_return)
-    return 0;
+    return false;
 
   /* Since any instruction in the epilogue sequence, with the possible
      exception of return itself, updates the stack pointer, we need to
@@ -4213,28 +4214,28 @@ thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
      too much about false positives.  */
 
   if (pc - 4 < func_start)
-    return 0;
+    return false;
   if (target_read_memory (pc - 4, buf, 4))
-    return 0;
+    return false;
 
   insn = extract_unsigned_integer (buf, 2, byte_order_for_code);
   insn2 = extract_unsigned_integer (buf + 2, 2, byte_order_for_code);
 
   if (thumb_instruction_restores_sp (insn2))
-    found_stack_adjust = 1;
+    found_stack_adjust = true;
   else if (insn == 0xe8bd)  /* ldm.w sp!, <registers> */
-    found_stack_adjust = 1;
+    found_stack_adjust = true;
   else if (insn == 0xf85d  /* ldr.w <Rt>, [sp], #4 */
           && (insn2 & 0x0fff) == 0x0b04)
-    found_stack_adjust = 1;
+    found_stack_adjust = true;
   else if ((insn & 0xffbf) == 0xecbd  /* vldm sp!, <list> */
           && (insn2 & 0x0e00) == 0x0a00)
-    found_stack_adjust = 1;
+    found_stack_adjust = true;
 
   return found_stack_adjust;
 }
 
-static int
+static bool
 arm_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch);
@@ -4285,7 +4286,7 @@ arm_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
 
 /* Implement the stack_frame_destroyed_p gdbarch method.  */
 
-static int
+static bool
 arm_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   if (arm_pc_is_thumb (gdbarch, pc))
index da9cdc6e535e1db248042235aab6be816de6b141..a6f03add2481f25150d83a7550fa1d1a02ee8c93 100644 (file)
@@ -1939,7 +1939,7 @@ csky_analyze_prologue (struct gdbarch *gdbarch,
 /* Detect whether PC is at a point where the stack frame has been
    destroyed.  */
 
-static int
+static bool
 csky_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   unsigned int insn;
@@ -1947,7 +1947,7 @@ csky_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   CORE_ADDR func_start, func_end;
 
   if (!find_pc_partial_function (pc, NULL, &func_start, &func_end))
-    return 0;
+    return false;
 
   bool fp_saved = false;
   int insn_len;
@@ -1967,7 +1967,7 @@ csky_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
            return pc >= addr;
        }
     }
-  return 0;
+  return false;
 }
 
 /* Implement the skip_prologue gdbarch hook.  */
index ab786ba6eb4dc9fcad7a8efa659515b11c42d06d..1239e8e6daaf1d0b1cc8357abf39d50ad9c394b3 100644 (file)
@@ -3352,7 +3352,7 @@ set_gdbarch_in_indirect_branch_thunk (struct gdbarch *gdbarch,
   gdbarch->in_indirect_branch_thunk = in_indirect_branch_thunk;
 }
 
-int
+bool
 gdbarch_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
   gdb_assert (gdbarch != NULL);
index 601d327396addd1a249277a2f4a771b7da792c04..89f15a7a31ac65d80eb26f4b047c3e7551cdaec8 100644 (file)
@@ -819,15 +819,15 @@ extern void set_gdbarch_in_indirect_branch_thunk (struct gdbarch *gdbarch, gdbar
 /* A target might have problems with watchpoints as soon as the stack
    frame of the current function has been destroyed.  This mostly happens
    as the first action in a function's epilogue.  stack_frame_destroyed_p()
-   is defined to return a non-zero value if either the given addr is one
+   is defined to return true if either the given addr is one
    instruction after the stack destroying instruction up to the trailing
    return instruction or if we can figure out that the stack frame has
    already been invalidated regardless of the value of addr.  Targets
    which don't suffer from that problem could just let this functionality
    untouched. */
 
-typedef int (gdbarch_stack_frame_destroyed_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
-extern int gdbarch_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr);
+typedef bool (gdbarch_stack_frame_destroyed_p_ftype) (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern bool gdbarch_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr);
 extern void set_gdbarch_stack_frame_destroyed_p (struct gdbarch *gdbarch, gdbarch_stack_frame_destroyed_p_ftype *stack_frame_destroyed_p);
 
 /* Process an ELF symbol in the minimal symbol table in a backend-specific
index b1b0f79adc866bf1f5ab1e3197e68f51e6072d97..ef3603504f8b0e911b3712d3d69f0bbcd43948fb 100644 (file)
@@ -1433,14 +1433,14 @@ Method(
 A target might have problems with watchpoints as soon as the stack
 frame of the current function has been destroyed.  This mostly happens
 as the first action in a function's epilogue.  stack_frame_destroyed_p()
-is defined to return a non-zero value if either the given addr is one
+is defined to return true if either the given addr is one
 instruction after the stack destroying instruction up to the trailing
 return instruction or if we can figure out that the stack frame has
 already been invalidated regardless of the value of addr.  Targets
 which don't suffer from that problem could just let this functionality
 untouched.
 """,
-    type="int",
+    type="bool",
     name="stack_frame_destroyed_p",
     params=[("CORE_ADDR", "addr")],
     predefault="generic_stack_frame_destroyed_p",
index 7cd6f2c11b693429671c46371293fdfda33d9f08..302511b604f85d2d46a9230fa4af6cbba08dc918 100644 (file)
@@ -558,7 +558,7 @@ find_unwind_entry (CORE_ADDR pc)
    We do not assume that the epilogue is at the end of a function as we can
    also have return sequences in the middle of a function.  */
 
-static int
+static bool
 hppa_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -568,7 +568,7 @@ hppa_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 
   status = target_read_memory (pc, buf, 4);
   if (status != 0)
-    return 0;
+    return false;
 
   inst = extract_unsigned_integer (buf, 4, byte_order);
 
@@ -576,19 +576,19 @@ hppa_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
      We are destroying a stack frame if the offset is negative.  */
   if ((inst & 0xffffc000) == 0x37de0000
       && hppa_extract_14 (inst) < 0)
-    return 1;
+    return true;
 
   /* ldw,mb D(sp),X or ldd,mb D(sp),X */
   if (((inst & 0x0fc010e0) == 0x0fc010e0
        || (inst & 0x0fc010e0) == 0x0fc010e0)
       && hppa_extract_14 (inst) < 0)
-    return 1;
+    return true;
 
   /* bv %r0(%rp) or bv,n %r0(%rp) */
   if (inst == 0xe840c000 || inst == 0xe840c002)
-    return 1;
+    return true;
 
-  return 0;
+  return false;
 }
 
 constexpr gdb_byte hppa_break_insn[] = {0x00, 0x01, 0x00, 0x04};
index 8200683a6b74cdb1c92aec4e5a031bb64a6ca697..4ef9837570b67edf5567ba53689b0ff0d3d41bdd 100644 (file)
@@ -2132,17 +2132,17 @@ static const struct frame_unwind_legacy i386_frame_unwind (
    follow any instruction such as 'leave' or 'pop %ebp' that destroys
    the function's stack frame.  */
 
-static int
+static bool
 i386_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   gdb_byte insn;
   if (target_read_memory (pc, &insn, 1))
-    return 0;  /* Can't read memory at pc.  */
+    return false;      /* Can't read memory at pc.  */
 
   if (insn != 0xc3)    /* 'ret' instruction.  */
-    return 0;
+    return false;
 
-  return 1;
+  return true;
 }
 
 static int
index 3678e4dfbb103a3288628daf7deb810bd9a84f05..27ac746bcf964262c268ddd5defbe80a3e743c53 100644 (file)
@@ -6730,7 +6730,7 @@ mips_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 /* Implement the stack_frame_destroyed_p gdbarch method (32-bit version).
    This is a helper function for mips_stack_frame_destroyed_p.  */
 
-static int
+static bool
 mips32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   CORE_ADDR func_addr = 0, func_end = 0;
@@ -6743,7 +6743,7 @@ mips32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
       if (addr < func_addr + 4)
        addr = func_addr + 4;
       if (pc < addr)
-       return 0;
+       return false;
 
       for (; pc < func_end; pc += MIPS_INSN32_SIZE)
        {
@@ -6757,19 +6757,19 @@ mips32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
              && high_word != 0x67bd    /* daddiu $sp,$sp,offset */
              && inst != 0x03e00008     /* jr $ra */
              && inst != 0x00000000)    /* nop */
-           return 0;
+           return false;
        }
 
-      return 1;
+      return true;
     }
 
-  return 0;
+  return false;
 }
 
 /* Implement the stack_frame_destroyed_p gdbarch method (microMIPS version).
    This is a helper function for mips_stack_frame_destroyed_p.  */
 
-static int
+static bool
 micromips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   CORE_ADDR func_addr = 0;
@@ -6782,7 +6782,7 @@ micromips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   int loc;
 
   if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end))
-    return 0;
+    return false;
 
   /* The microMIPS epilogue is max. 12 bytes long.  */
   addr = func_end - 12;
@@ -6790,7 +6790,7 @@ micromips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   if (addr < func_addr + 2)
     addr = func_addr + 2;
   if (pc < addr)
-    return 0;
+    return false;
 
   for (; pc < func_end; pc += loc)
     {
@@ -6816,10 +6816,10 @@ micromips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
                            /* (D)ADDIU $sp, imm */
                  && offset >= 0)
                break;
-             return 0;
+             return false;
 
            default:
-             return 0;
+             return false;
            }
          break;
 
@@ -6833,7 +6833,7 @@ micromips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
              if (sreg == 0 && dreg == 0)
                                /* MOVE $zero, $zero aka NOP */
                break;
-             return 0;
+             return false;
 
            case 0x11: /* POOL16C: bits 010001 */
              if (b5s5_op (insn) == 0x18
@@ -6843,7 +6843,7 @@ micromips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
                      && b0s5_reg (insn) == MIPS_RA_REGNUM))
                                /* JRC $ra */
                break;
-             return 0;
+             return false;
 
            case 0x13: /* POOL16D: bits 010011 */
              offset = micromips_decode_imm9 (b1s9_imm (insn));
@@ -6851,21 +6851,21 @@ micromips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
                                /* ADDIUSP: bits 010011 1 */
                  && offset > 0)
                break;
-             return 0;
+             return false;
 
            default:
-             return 0;
+             return false;
            }
        }
     }
 
-  return 1;
+  return true;
 }
 
 /* Implement the stack_frame_destroyed_p gdbarch method (16-bit version).
    This is a helper function for mips_stack_frame_destroyed_p.  */
 
-static int
+static bool
 mips16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   CORE_ADDR func_addr = 0, func_end = 0;
@@ -6878,7 +6878,7 @@ mips16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
       if (addr < func_addr + 4)
        addr = func_addr + 4;
       if (pc < addr)
-       return 0;
+       return false;
 
       for (; pc < func_end; pc += MIPS_INSN16_SIZE)
        {
@@ -6894,13 +6894,13 @@ mips16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
              && inst != 0xe820         /* jr $ra */
              && inst != 0xe8a0         /* jrc $ra */
              && inst != 0x6500)        /* nop */
-           return 0;
+           return false;
        }
 
-      return 1;
+      return true;
     }
 
-  return 0;
+  return false;
 }
 
 /* Implement the stack_frame_destroyed_p gdbarch method.
@@ -6908,7 +6908,7 @@ mips16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
    The epilogue is defined here as the area at the end of a function,
    after an instruction which destroys the function's stack frame.  */
 
-static int
+static bool
 mips_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   if (mips_pc_is_mips16 (gdbarch, pc))
index 4278c92d5f37e83ca91f10688108bd80ada2ceb2..e2efe4fcdda46c897a278dae9bd06da4e2665cea 100644 (file)
@@ -1217,7 +1217,7 @@ nds32_analyze_epilogue (struct gdbarch *gdbarch, CORE_ADDR pc,
 
 /* Implement the "stack_frame_destroyed_p" gdbarch method.  */
 
-static int
+static bool
 nds32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
   nds32_gdbarch_tdep *tdep = gdbarch_tdep<nds32_gdbarch_tdep> (gdbarch);
@@ -1243,13 +1243,13 @@ nds32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr)
     }
 
   if (insn_type == INSN_NORMAL || insn_type == INSN_RESET_SP)
-    return 0;
+    return false;
 
   /* Search the required 'return' instruction within the following reasonable
      instructions.  */
   ret_found = nds32_analyze_epilogue (gdbarch, addr, NULL);
   if (ret_found == 0)
-    return 0;
+    return false;
 
   /* Scan backwards to make sure that the last instruction has adjusted
      stack.  Both a 16-bit and a 32-bit instruction will be tried.  This is
@@ -1263,7 +1263,7 @@ nds32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr)
 
       insn_type = nds32_analyze_epilogue_insn16 (insn >> 16, NULL);
       if (insn_type == INSN_RECOVER)
-       return 1;
+       return true;
     }
 
   insn = read_memory_unsigned_integer (addr - 4, 4, BFD_ENDIAN_BIG);
@@ -1277,10 +1277,10 @@ nds32_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR addr)
 
       insn_type = nds32_analyze_epilogue_insn32 (abi_use_fpr, insn, NULL);
       if (insn_type == INSN_RECOVER || insn_type == INSN_RESET_SP)
-       return 1;
+       return true;
     }
 
-  return 0;
+  return false;
 }
 
 /* Implement the "sniffer" frame_unwind method.  */
index 1d9ff3d84c6d26b13c973c2c8c08aa0362689492..f6b8963b9cc2130a996e1db2b0630bb7deac3c93 100644 (file)
@@ -802,7 +802,7 @@ rs6000_in_function_epilogue_frame_p (const frame_info_ptr &curfrm,
 
 /* Implement the stack_frame_destroyed_p gdbarch method.  */
 
-static int
+static bool
 rs6000_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   return rs6000_in_function_epilogue_frame_p (get_current_frame (),
index 3c36ab12acb871887c24bd4b5b0f3b53569b05ec..5b17d5da89bb19fbd8a48fa8b38aacab5dd43dff 100644 (file)
@@ -2206,7 +2206,7 @@ s390_get_return_buf_addr (struct type *val_type,
 
 /* Implement the stack_frame_destroyed_p gdbarch method.  */
 
-static int
+static bool
 s390_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   int word_size = gdbarch_ptr_bit (gdbarch) / 8;
@@ -2238,21 +2238,21 @@ s390_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
       && !target_read_memory (pc - 4, insn, 4)
       && is_rs (insn, op_lm, &r1, &r3, &d2, &b2)
       && r3 == S390_SP_REGNUM - S390_R0_REGNUM)
-    return 1;
+    return true;
 
   if (word_size == 4
       && !target_read_memory (pc - 6, insn, 6)
       && is_rsy (insn, op1_lmy, op2_lmy, &r1, &r3, &d2, &b2)
       && r3 == S390_SP_REGNUM - S390_R0_REGNUM)
-    return 1;
+    return true;
 
   if (word_size == 8
       && !target_read_memory (pc - 6, insn, 6)
       && is_rsy (insn, op1_lmg, op2_lmg, &r1, &r3, &d2, &b2)
       && r3 == S390_SP_REGNUM - S390_R0_REGNUM)
-    return 1;
+    return true;
 
-  return 0;
+  return false;
 }
 
 /* Implement unwind_pc gdbarch method.  */
index 251d58ff76eb81bfa616735417516aa03fda4108..c74114b2687abf4c3f7ec77dee51e0d2b9c0bcf6 100644 (file)
@@ -2033,7 +2033,7 @@ static const struct frame_unwind_legacy sh_stub_unwind (
    either on the `ret' instruction itself or after an instruction which
    destroys the function's stack frame.  */
 
-static int
+static bool
 sh_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -2050,14 +2050,14 @@ sh_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
       if (addr < func_addr + 4)
        addr = func_addr + 4;
       if (pc < addr)
-       return 0;
+       return false;
 
       /* First search forward until hitting an rts.  */
       while (addr < func_end
             && !IS_RTS (read_memory_unsigned_integer (addr, 2, byte_order)))
        addr += 2;
       if (addr >= func_end)
-       return 0;
+       return false;
 
       /* At this point we should find a mov.l @r15+,r14 instruction,
         either before or after the rts.  If not, then the function has
@@ -2068,7 +2068,7 @@ sh_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
        addr -= 2;
       else if (!IS_RESTORE_FP (read_memory_unsigned_integer (addr + 2, 2,
                                                             byte_order)))
-       return 0;
+       return false;
 
       inst = read_memory_unsigned_integer (addr - 2, 2, byte_order);
 
@@ -2112,9 +2112,9 @@ sh_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
        addr -= 4;
 
       if (pc >= addr)
-       return 1;
+       return true;
     }
-  return 0;
+  return false;
 }
 
 
index e495d13a90453a3b7878938592fbbae07de1b2d1..b16af5953f79efd693d633a3891334941d99e54f 100644 (file)
@@ -550,7 +550,7 @@ sparc32_pseudo_register_write (struct gdbarch *gdbarch,
 \f
 /* Implement the stack_frame_destroyed_p gdbarch method.  */
 
-int
+bool
 sparc_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   /* This function must return true if we are one instruction after an
index cb766c8eaf7505d95bf97be1bf770c8447539b4e..4f5710ecfa845de7e849324625d9b8aa59ed1f40 100644 (file)
@@ -212,10 +212,8 @@ extern struct sparc_frame_cache *
 extern struct sparc_frame_cache *
   sparc32_frame_cache (const frame_info_ptr &this_frame, void **this_cache);
 
-extern int
-  sparc_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc);
-
-\f
+extern bool sparc_stack_frame_destroyed_p (struct gdbarch *gdbarch,
+                                          CORE_ADDR pc);
 
 extern void sparc_supply_rwindow (struct regcache *regcache,
                                  CORE_ADDR sp, int regnum);
index 0fa66f4955371bb951bf50820a07bfb30f82d3bf..1730a75cd47d0a9c429e26ab5089a455346e1e33 100644 (file)
@@ -1080,7 +1080,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 
 /* This is the implementation of gdbarch method stack_frame_destroyed_p.  */
 
-static int
+static bool
 tic6x_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   unsigned long inst = tic6x_fetch_instruction (gdbarch, pc);
@@ -1091,10 +1091,10 @@ tic6x_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
                                                 INST_S_BIT (inst),
                                                 INST_X_BIT (inst));
       if (src2 == TIC6X_RA_REGNUM)
-       return 1;
+       return true;
     }
 
-  return 0;
+  return false;
 }
 
 /* This is the implementation of gdbarch method get_longjmp_target.  */
index d2114c585c37343133fa5988176960ac0c245c0f..40a30ccc6bfb929eb1e18fb3d655e97f1d77c683 100644 (file)
@@ -754,7 +754,7 @@ tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
 
 /* This is the implementation of gdbarch method stack_frame_destroyed_p.  */
 
-static int
+static bool
 tilegx_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   CORE_ADDR func_addr = 0, func_end = 0;
@@ -766,9 +766,9 @@ tilegx_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
       /* FIXME: Find the actual epilogue.  */
       /* HACK: Just assume the final bundle is the "ret" instruction".  */
       if (pc > addr)
-       return 1;
+       return true;
     }
-  return 0;
+  return false;
 }
 
 /* This is the implementation of gdbarch method get_longjmp_target.  */
index c8a613ff6d5e50bc7bdf4dc93105f79fe53ede8a..1916b8cfdfe42611063e3a0abdc8c906dd563085 100644 (file)
@@ -450,7 +450,7 @@ xstormy16_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
    either on the `ret' instruction itself or after an instruction which
    destroys the function's stack frame.  */
 
-static int
+static bool
 xstormy16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -463,14 +463,14 @@ xstormy16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 
       /* The Xstormy16 epilogue is max. 14 bytes long.  */
       if (pc < func_end - 7 * xstormy16_inst_size)
-       return 0;
+       return false;
 
       /* Check if we're on a `ret' instruction.  Otherwise it's
         too dangerous to proceed.  */
       inst = read_memory_unsigned_integer (addr,
                                           xstormy16_inst_size, byte_order);
       if (inst != 0x0003)
-       return 0;
+       return false;
 
       while ((addr -= xstormy16_inst_size) >= func_addr)
        {
@@ -489,12 +489,12 @@ xstormy16_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
              addr -= xstormy16_inst_size;
              break;
            }
-         return 0;
+         return false;
        }
       if (pc > addr)
-       return 1;
+       return true;
     }
-  return 0;
+  return false;
 }
 
 constexpr gdb_byte xstormy16_break_insn[] = { 0x06, 0x0 };