]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: change gdbarch_stap_is_single_operand to return bool
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 27 Feb 2026 20:05:20 +0000 (15:05 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 9 Mar 2026 17:15:47 +0000 (13:15 -0400)
Change-Id: I46976d84d1971df2cec75b70a1cf75168d740a10
Approved-By: Tom Tromey <tom@tromey.com>
gdb/aarch64-linux-tdep.c
gdb/arm-linux-tdep.c
gdb/gdbarch-gen.c
gdb/gdbarch-gen.h
gdb/gdbarch_components.py
gdb/i386-tdep.c
gdb/i386-tdep.h
gdb/ia64-linux-tdep.c
gdb/ppc-linux-tdep.c
gdb/riscv-tdep.c
gdb/s390-tdep.c

index b85c25ecae1d71ade70d4228453ba8c0b1ff009e..b037dbdb886e90c5395f3bc1fd0b06f94bb2e5b0 100644 (file)
@@ -1797,7 +1797,7 @@ aarch64_linux_core_read_description (struct gdbarch *gdbarch,
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
 
-static int
+static bool
 aarch64_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
 {
   return (*s == '#' || c_isdigit (*s) /* Literal number.  */
index cf425992ce438041ac29cb8d0332079917e29107..591e60d50840778340352888d7ec2a499dc98ac9 100644 (file)
@@ -1163,7 +1163,7 @@ arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
 
-static int
+static bool
 arm_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
 {
   return (*s == '#' || *s == '$' || c_isdigit (*s) /* Literal number.  */
index 9fad9ff28236a82a8476e9e432da8c19b008c898..7cc13a2d625f3cf0608696735033ebccdd71e111 100644 (file)
@@ -4537,7 +4537,7 @@ gdbarch_stap_is_single_operand_p (struct gdbarch *gdbarch)
   return gdbarch->stap_is_single_operand != NULL;
 }
 
-int
+bool
 gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
 {
   gdb_assert (gdbarch != NULL);
index f556751f26b3dcf0c67c0dd1aade8b4c290bd401..d401c6fcbd62656ebdd392ffb27d3fab78145a7e 100644 (file)
@@ -1387,14 +1387,14 @@ extern void set_gdbarch_stap_gdb_register_suffix (struct gdbarch *gdbarch, const
    - Register displacement, e.g. `4(%eax)' on x86
 
    This function should check for these patterns on the string
-   and return 1 if some were found, or zero otherwise.  Please try to match
+   and return true if some were found, or false otherwise.  Please try to match
    as much info as you can from the string, i.e., if you have to match
    something like `(%', do not match just the `('. */
 
 extern bool gdbarch_stap_is_single_operand_p (struct gdbarch *gdbarch);
 
-typedef int (gdbarch_stap_is_single_operand_ftype) (struct gdbarch *gdbarch, const char *s);
-extern int gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s);
+typedef bool (gdbarch_stap_is_single_operand_ftype) (struct gdbarch *gdbarch, const char *s);
+extern bool gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, const char *s);
 extern void set_gdbarch_stap_is_single_operand (struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype *stap_is_single_operand);
 
 /* Function used to handle a "special case" in the parser.
index 2d0fc40e0ce721dfbbd4448fa24b717e04f05e12..b0fe68d6bb7e1599bc385696cc7071d4fadbd5ab 100644 (file)
@@ -2244,11 +2244,11 @@ Single operands can be:
 - Register displacement, e.g. `4(%eax)' on x86
 
 This function should check for these patterns on the string
-and return 1 if some were found, or zero otherwise.  Please try to match
+and return true if some were found, or false otherwise.  Please try to match
 as much info as you can from the string, i.e., if you have to match
 something like `(%', do not match just the `('.
 """,
-    type="int",
+    type="bool",
     name="stap_is_single_operand",
     params=[("const char *", "s")],
     predicate=True,
index 09fd94f3d09a7d795e6de3a3c81509619a6d8abb..6863c1579e6950a9e84eb0fec9f2ef544ee020dc 100644 (file)
@@ -3835,7 +3835,7 @@ i386_svr4_sigcontext_addr (const frame_info_ptr &this_frame)
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
 
-int
+bool
 i386_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
 {
   return (*s == '$' /* Literal number.  */
index 21f9ed42a178b8f2e3e3bda7aa07ea00daacaad7..d64d5241754713429d6c2d0717772b7ba636c305 100644 (file)
@@ -481,8 +481,8 @@ extern int i386bsd_sc_reg_offset[];
 
 /* SystemTap related functions.  */
 
-extern int i386_stap_is_single_operand (struct gdbarch *gdbarch,
-                                       const char *s);
+extern bool i386_stap_is_single_operand (struct gdbarch *gdbarch,
+                                        const char *s);
 
 extern expr::operation_up i386_stap_parse_special_token
      (struct gdbarch *gdbarch, struct stap_parse_info *p);
index aa7ed1906bfe487cc22bd502552b986424039dba..28779d8b5aaa54970bc90f593513a2ebd1490e7c 100644 (file)
@@ -124,7 +124,7 @@ ia64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
 
-static int
+static bool
 ia64_linux_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
 {
   return ((c_isdigit (*s) && s[1] == '[' && s[2] == 'r') /* Displacement.  */
index 40f0a82435213735d0df2afb8fb2fea7404cd0a2..2dd36786bd3bed6449c9ee598eb4ed8f2b56e8eb 100644 (file)
@@ -1707,7 +1707,7 @@ ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc)
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
 
-static int
+static bool
 ppc_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
 {
   return (*s == 'i' /* Literal number.  */
index ee5db15947b0a4e59105d8389953945be9bfa575..252c2e5042e7b7f2536853a3e211fe4de2f1d916 100644 (file)
@@ -4178,7 +4178,7 @@ riscv_print_insn (bfd_vma addr, struct disassemble_info *info)
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
 
-static int
+static bool
 riscv_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
 {
   return (c_isdigit (*s) /* Literal number.  */
index 07793c4809ec9c49a2f448346edcf6cc74c967f3..aed7ae6b9b4c79e69f75c67052d743a9f2834f71 100644 (file)
@@ -7049,7 +7049,7 @@ s390_gnu_triplet_regexp (struct gdbarch *gdbarch)
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
    gdbarch.h.  */
 
-static int
+static bool
 s390_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
 {
   return ((c_isdigit (*s) && s[1] == '(' && s[2] == '%') /* Displacement