return 1;
}
-/* Return non-zero iff PC belongs to the dynamic linker resolution
+/* Return true iff PC belongs to the dynamic linker resolution
code, a PLT entry, or a lazy binding stub. */
-static int
+static bool
mips_linux_in_dynsym_resolve_code (CORE_ADDR pc)
{
/* Check whether PC is in the dynamic linker. This also checks
whether it is in the .plt section, used by non-PIC executables. */
if (svr4_in_dynsym_resolve_code (pc))
- return 1;
+ return true;
/* Likewise for the stubs. They live in the .MIPS.stubs section these
days, so we check if the PC is within, than fall back to a pattern
match. */
if (mips_linux_in_dynsym_stub (pc))
- return 1;
+ return true;
- return 0;
+ return false;
}
/* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c,
/* Return true if PC is in a section called NAME. */
extern bool pc_in_section (CORE_ADDR, const char *);
-/* Return non-zero if PC is in a SVR4-style procedure linkage table
+/* Return true if PC is in a SVR4-style procedure linkage table
section. */
-static inline int
+static inline bool
in_plt_section (CORE_ADDR pc)
{
return (pc_in_section (pc, ".plt")
section. For secure PLT, stub is in .text and we need to check
instruction patterns. */
-static int
+static bool
powerpc_linux_in_dynsym_resolve_code (CORE_ADDR pc)
{
/* Check whether PC is in the dynamic linker. This also checks
whether it is in the .plt section, used by non-PIC executables. */
if (svr4_in_dynsym_resolve_code (pc))
- return 1;
+ return true;
/* Check if we are in the resolver. */
bound_minimal_symbol sym = lookup_minimal_symbol_by_pc (pc);
- if (sym.minsym != NULL
- && (strcmp (sym.minsym->linkage_name (), "__glink") == 0
- || strcmp (sym.minsym->linkage_name (), "__glink_PLTresolve") == 0))
- return 1;
- return 0;
+ if (sym.minsym == nullptr)
+ return false;
+
+ return (strcmp (sym.minsym->linkage_name (), "__glink") == 0
+ || strcmp (sym.minsym->linkage_name (), "__glink_PLTresolve") == 0);
}
/* Follow PLT stub to actual routine.
/* Implement the "in_dynsym_resolve_code" solib_ops method. */
-static int
+static bool
solib_aix_in_dynsym_resolve_code (CORE_ADDR pc)
{
- return 0;
+ return false;
}
/* Implement the "bfd_open" solib_ops method. */
return darwin_validate_exec_header (load_addr);
}
-/* Return 1 if PC lies in the dynamic symbol resolution code of the
+/* Return true if PC lies in the dynamic symbol resolution code of the
run time loader. */
-static int
+static bool
darwin_in_dynsym_resolve_code (CORE_ADDR pc)
{
- return 0;
+ return false;
}
/* A wrapper for bfd_mach_o_fat_extract that handles reference
return sos;
}
-/* Return 1 if PC lies in the dynamic symbol resolution code of the
+/* Return true if PC lies in the dynamic symbol resolution code of the
run time loader. */
-static int
+static bool
dsbt_in_dynsym_resolve_code (CORE_ADDR pc)
{
dsbt_info *info = get_dsbt_info (current_program_space);
static CORE_ADDR interp_plt_sect_low;
static CORE_ADDR interp_plt_sect_high;
-static int
+static bool
frv_in_dynsym_resolve_code (CORE_ADDR pc)
{
return ((pc >= interp_text_sect_low && pc < interp_text_sect_high)
return (0);
}
-/* Return 1 if PC lies in the dynamic symbol resolution code of the
+/* Return true if PC lies in the dynamic symbol resolution code of the
SVR4 run time loader. */
-int
+bool
svr4_in_dynsym_resolve_code (CORE_ADDR pc)
{
struct svr4_info *info = get_svr4_info (current_program_space);
extern struct link_map_offsets *svr4_ilp32_fetch_link_map_offsets (void);
extern struct link_map_offsets *svr4_lp64_fetch_link_map_offsets (void);
-/* Return 1 if PC lies in the dynamic symbol resolution code of the
+/* Return true if PC lies in the dynamic symbol resolution code of the
SVR4 run time loader. */
-int svr4_in_dynsym_resolve_code (CORE_ADDR pc);
+bool svr4_in_dynsym_resolve_code (CORE_ADDR pc);
/* For the MUSL C library, given link map address LM_ADDR, return the
corresponding TLS module id, or 0 if not found. */
return 0;
}
-static int
+static bool
solib_target_in_dynsym_resolve_code (CORE_ADDR pc)
{
/* We don't have a range of addresses for the dynamic linker; there
bool
in_solib_dynsym_resolve_code (CORE_ADDR pc)
{
- const solib_ops *ops = gdbarch_so_ops (current_inferior ()->arch ());
-
- return ops->in_dynsym_resolve_code (pc) != 0;
+ return (gdbarch_so_ops (current_inferior ()->arch ())
+ ->in_dynsym_resolve_code (pc));
}
/* Implements the "sharedlibrary" command. */
/* Determine if PC lies in the dynamic symbol resolution code of
the run time loader. */
- int (*in_dynsym_resolve_code) (CORE_ADDR pc);
+ bool (*in_dynsym_resolve_code) (CORE_ADDR pc);
/* Find and open shared library binary file. */
gdb_bfd_ref_ptr (*bfd_open) (const char *pathname);