gdb: remove empty clear_solib functions

Make the target_so_ops::clear_solib method optional, remove two empty
implementations.

Change-Id: Ifda297d50c74327d337091c58cdb5b3b60382591
Approved-By: Pedro Alves <pedro@palves.net>
Reviewed-By: Reviewed-By: Lancelot Six <lancelot.six@amd.com>
This commit is contained in:
Simon Marchi 2023-10-02 14:52:09 -04:00
parent d08515a68e
commit 6fe4d5bf18
3 changed files with 6 additions and 18 deletions

View File

@ -373,14 +373,6 @@ solib_aix_free_so (struct so_list *so)
delete li;
}
/* Implement the "clear_solib" target_so_ops method. */
static void
solib_aix_clear_solib (void)
{
/* Nothing needed. */
}
/* Compute and return the OBJFILE's section_offset array, using
the associated loader info (INFO). */
@ -715,7 +707,7 @@ const struct target_so_ops solib_aix_so_ops =
solib_aix_relocate_section_addresses,
solib_aix_free_so,
nullptr,
solib_aix_clear_solib,
nullptr,
solib_aix_solib_create_inferior_hook,
solib_aix_current_sos,
solib_aix_open_symbol_file_object,

View File

@ -281,12 +281,6 @@ solib_target_solib_create_inferior_hook (int from_tty)
/* Nothing needed. */
}
static void
solib_target_clear_solib (void)
{
/* Nothing needed. */
}
static void
solib_target_free_so (struct so_list *so)
{
@ -440,7 +434,7 @@ const struct target_so_ops solib_target_so_ops =
solib_target_relocate_section_addresses,
solib_target_free_so,
nullptr,
solib_target_clear_solib,
nullptr,
solib_target_solib_create_inferior_hook,
solib_target_current_sos,
solib_target_open_symbol_file_object,

View File

@ -1240,7 +1240,8 @@ clear_solib (void)
free_so (so);
}
ops->clear_solib ();
if (ops->clear_solib != nullptr)
ops->clear_solib ();
}
/* Shared library startup support. When GDB starts up the inferior,
@ -1409,7 +1410,8 @@ reload_shared_libraries (const char *ignored, int from_tty,
{
/* Reset or free private data structures not associated with
so_list entries. */
ops->clear_solib ();
if (ops->clear_solib != nullptr)
ops->clear_solib ();
/* Remove any previous solib event breakpoint. This is usually
done in common code, at breakpoint_init_inferior time, but