gdb/solib: make solib_ops::in_dynsym_resolve_code optional

Two solib ops implementations have dummy implementations for the
in_dynsym_resolve_code callback.  Make it optional, to avoid this.

Change-Id: I786776fb82ce1b96335a97713fbfe8074c84c00c
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
This commit is contained in:
Simon Marchi
2025-05-26 16:26:16 -04:00
committed by Simon Marchi
parent 134767de03
commit d5ef1fc282
3 changed files with 6 additions and 21 deletions

View File

@@ -489,14 +489,6 @@ solib_aix_current_sos ()
return sos;
}
/* Implement the "in_dynsym_resolve_code" solib_ops method. */
static bool
solib_aix_in_dynsym_resolve_code (CORE_ADDR pc)
{
return false;
}
/* Implement the "bfd_open" solib_ops method. */
static gdb_bfd_ref_ptr
@@ -676,7 +668,7 @@ const solib_ops solib_aix_so_ops =
solib_aix_solib_create_inferior_hook,
solib_aix_current_sos,
nullptr,
solib_aix_in_dynsym_resolve_code,
nullptr,
solib_aix_bfd_open,
nullptr,
nullptr,

View File

@@ -353,15 +353,6 @@ darwin_read_exec_load_addr_at_init (struct darwin_info *info)
return darwin_validate_exec_header (load_addr);
}
/* Return true if PC lies in the dynamic symbol resolution code of the
run time loader. */
static bool
darwin_in_dynsym_resolve_code (CORE_ADDR pc)
{
return false;
}
/* A wrapper for bfd_mach_o_fat_extract that handles reference
counting properly. This will either return NULL, or return a new
reference to a BFD. */
@@ -640,7 +631,7 @@ const solib_ops darwin_so_ops =
darwin_solib_create_inferior_hook,
darwin_current_sos,
nullptr,
darwin_in_dynsym_resolve_code,
nullptr,
darwin_bfd_open,
nullptr,
nullptr,

View File

@@ -1325,8 +1325,10 @@ solib_create_inferior_hook (int from_tty)
bool
in_solib_dynsym_resolve_code (CORE_ADDR pc)
{
return (gdbarch_so_ops (current_inferior ()->arch ())
->in_dynsym_resolve_code (pc));
const auto in_dynsym_resolve_code
= gdbarch_so_ops (current_inferior ()->arch ())->in_dynsym_resolve_code;
return in_dynsym_resolve_code && in_dynsym_resolve_code (pc);
}
/* Implements the "sharedlibrary" command. */