mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
Change gdbarch_inner_than to return bool
A recent patch from Andrew pointed out that gdbarch_inner_than returns 'int', while it should really return 'bool'. Approved-By: Pedro Alves <pedro@palves.net>
This commit is contained in:
parent
04e63f26ba
commit
e14f6ec969
@ -173,16 +173,16 @@ default_code_of_frame_writable (struct gdbarch *gdbarch,
|
||||
|
||||
/* Helper functions for gdbarch_inner_than */
|
||||
|
||||
int
|
||||
bool
|
||||
core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)
|
||||
{
|
||||
return (lhs < rhs);
|
||||
return lhs < rhs;
|
||||
}
|
||||
|
||||
int
|
||||
bool
|
||||
core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs)
|
||||
{
|
||||
return (lhs > rhs);
|
||||
return lhs > rhs;
|
||||
}
|
||||
|
||||
/* Misc helper functions for targets. */
|
||||
|
@ -83,8 +83,8 @@ extern bool default_displaced_step_hw_singlestep (struct gdbarch *);
|
||||
extern CORE_ADDR displaced_step_at_entry_point (struct gdbarch *gdbarch);
|
||||
|
||||
/* The only possible cases for inner_than. */
|
||||
extern int core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs);
|
||||
extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);
|
||||
extern bool core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs);
|
||||
extern bool core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);
|
||||
|
||||
/* Identity functions on a CORE_ADDR. Just return the "addr". */
|
||||
|
||||
|
@ -547,8 +547,8 @@ typedef CORE_ADDR (gdbarch_skip_entrypoint_ftype) (struct gdbarch *gdbarch, CORE
|
||||
extern CORE_ADDR gdbarch_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR ip);
|
||||
extern void set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch, gdbarch_skip_entrypoint_ftype *skip_entrypoint);
|
||||
|
||||
typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
|
||||
extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
|
||||
typedef bool (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs);
|
||||
extern bool gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs);
|
||||
extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than);
|
||||
|
||||
typedef const gdb_byte * (gdbarch_breakpoint_from_pc_ftype) (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr);
|
||||
|
@ -173,8 +173,8 @@ check_stack_growth (struct gdbarch *gdbarch)
|
||||
implementation by calling gdbarch_inner_than. GDB assumes that stacks
|
||||
either grow down or up (see uses of gdbarch_stack_grows_down), so exactly
|
||||
one of these needs to be true. */
|
||||
bool stack_grows_down = gdbarch_inner_than (gdbarch, 1, 2) != 0;
|
||||
bool stack_grows_up = gdbarch_inner_than (gdbarch, 2, 1) != 0;
|
||||
bool stack_grows_down = gdbarch_inner_than (gdbarch, 1, 2);
|
||||
bool stack_grows_up = gdbarch_inner_than (gdbarch, 2, 1);
|
||||
|
||||
SELF_CHECK (stack_grows_up != stack_grows_down);
|
||||
}
|
||||
|
@ -2788,7 +2788,7 @@ set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch,
|
||||
gdbarch->skip_entrypoint = skip_entrypoint;
|
||||
}
|
||||
|
||||
int
|
||||
bool
|
||||
gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
|
||||
{
|
||||
gdb_assert (gdbarch != NULL);
|
||||
|
@ -375,7 +375,7 @@ gdbarch_num_cooked_regs (gdbarch *arch)
|
||||
static inline bool
|
||||
gdbarch_stack_grows_down (gdbarch *arch)
|
||||
{
|
||||
return gdbarch_inner_than (arch, 1, 2) != 0;
|
||||
return gdbarch_inner_than (arch, 1, 2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1020,7 +1020,7 @@ is not used.
|
||||
)
|
||||
|
||||
Function(
|
||||
type="int",
|
||||
type="bool",
|
||||
name="inner_than",
|
||||
params=[("CORE_ADDR", "lhs"), ("CORE_ADDR", "rhs")],
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user