diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-10-02 14:52:09 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-10-19 10:57:51 -0400 |
commit | 6fe4d5bf18512798b3a685599bfcff5aab3f798e (patch) | |
tree | 5186a8c030f972783799e99886ad09b704a68942 | |
parent | d08515a68e5b44f5e0b045e371a996e4196226ed (diff) | |
download | fsf-binutils-gdb-6fe4d5bf18512798b3a685599bfcff5aab3f798e.zip fsf-binutils-gdb-6fe4d5bf18512798b3a685599bfcff5aab3f798e.tar.gz fsf-binutils-gdb-6fe4d5bf18512798b3a685599bfcff5aab3f798e.tar.bz2 |
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>
-rw-r--r-- | gdb/solib-aix.c | 10 | ||||
-rw-r--r-- | gdb/solib-target.c | 8 | ||||
-rw-r--r-- | gdb/solib.c | 6 |
3 files changed, 6 insertions, 18 deletions
diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index fd6b1e7..0b6ad83 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -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, diff --git a/gdb/solib-target.c b/gdb/solib-target.c index ca9478f..865235d 100644 --- a/gdb/solib-target.c +++ b/gdb/solib-target.c @@ -282,12 +282,6 @@ solib_target_solib_create_inferior_hook (int from_tty) } static void -solib_target_clear_solib (void) -{ - /* Nothing needed. */ -} - -static void solib_target_free_so (struct so_list *so) { lm_info_target *li = (lm_info_target *) so->lm_info; @@ -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, diff --git a/gdb/solib.c b/gdb/solib.c index a2a8a03..e821181 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -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 |