gdb: change gdbarch_stap_is_single_operand to return bool

Change-Id: I46976d84d1971df2cec75b70a1cf75168d740a10
Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
Simon Marchi 2026-02-27 15:05:20 -05:00
parent 17e0597f73
commit 86b23fc07e
11 changed files with 15 additions and 15 deletions

View 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. */

View 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. */

View 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);

View 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.

View 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,

View 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. */

View 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);

View 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. */

View 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. */

View 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. */

View 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