From: Tom Tromey Date: Sun, 3 Nov 2024 16:49:50 +0000 (-0700) Subject: Remove solib_symbols_extension gdbarch hook X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef1941993b8222d8a9626ff72a2f64d564fe1f55;p=thirdparty%2Fbinutils-gdb.git Remove solib_symbols_extension gdbarch hook The solib_symbols_extension gdbarch hook has been obsolete since: commit 18b8df43bd11ed314153dff2ef04a4b991f00a7c Author: Alan Modra Date: Wed Feb 10 12:38:47 2021 +1030 gdb: Remove arm-symbianelf support This patch removes it. --- diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c index 63ab7caba31..969ace4de6a 100644 --- a/gdb/gdbarch-gen.c +++ b/gdb/gdbarch-gen.c @@ -231,7 +231,6 @@ struct gdbarch gdbarch_guess_tracepoint_registers_ftype *guess_tracepoint_registers = default_guess_tracepoint_registers; gdbarch_auto_charset_ftype *auto_charset = default_auto_charset; gdbarch_auto_wide_charset_ftype *auto_wide_charset = default_auto_wide_charset; - const char * solib_symbols_extension = 0; int has_dos_based_file_system = 0; gdbarch_gen_return_address_ftype *gen_return_address = default_gen_return_address; gdbarch_info_proc_ftype *info_proc = nullptr; @@ -501,7 +500,6 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of guess_tracepoint_registers, invalid_p == 0. */ /* Skip verify of auto_charset, invalid_p == 0. */ /* Skip verify of auto_wide_charset, invalid_p == 0. */ - /* Skip verify of solib_symbols_extension, invalid_p == 0. */ /* Skip verify of has_dos_based_file_system, invalid_p == 0. */ /* Skip verify of gen_return_address, invalid_p == 0. */ /* Skip verify of info_proc, has predicate. */ @@ -1280,9 +1278,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) gdb_printf (file, "gdbarch_dump: auto_wide_charset = <%s>\n", host_address_to_string (gdbarch->auto_wide_charset)); - gdb_printf (file, - "gdbarch_dump: solib_symbols_extension = %s\n", - pstring (gdbarch->solib_symbols_extension)); gdb_printf (file, "gdbarch_dump: has_dos_based_file_system = %s\n", plongest (gdbarch->has_dos_based_file_system)); @@ -4931,23 +4926,6 @@ set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch, gdbarch->auto_wide_charset = auto_wide_charset; } -const char * -gdbarch_solib_symbols_extension (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - /* Skip verify of solib_symbols_extension, invalid_p == 0. */ - if (gdbarch_debug >= 2) - gdb_printf (gdb_stdlog, "gdbarch_solib_symbols_extension called\n"); - return gdbarch->solib_symbols_extension; -} - -void -set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch, - const char * solib_symbols_extension) -{ - gdbarch->solib_symbols_extension = solib_symbols_extension; -} - int gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch) { diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index a98b5b94121..04d5d187edd 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -1555,16 +1555,6 @@ typedef const char * (gdbarch_auto_wide_charset_ftype) (); extern const char * gdbarch_auto_wide_charset (struct gdbarch *gdbarch); extern void set_gdbarch_auto_wide_charset (struct gdbarch *gdbarch, gdbarch_auto_wide_charset_ftype *auto_wide_charset); -/* If non-empty, this is a file extension that will be opened in place - of the file extension reported by the shared library list. - - This is most useful for toolchains that use a post-linker tool, - where the names of the files run on the target differ in extension - compared to the names of the files GDB should load for debug info. */ - -extern const char * gdbarch_solib_symbols_extension (struct gdbarch *gdbarch); -extern void set_gdbarch_solib_symbols_extension (struct gdbarch *gdbarch, const char * solib_symbols_extension); - /* If true, the target OS has DOS-based file system semantics. That is, absolute paths include a drive name, and the backslash is considered a directory separator. */ diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py index 72e75ccc82e..a57ec01e244 100644 --- a/gdb/gdbarch_components.py +++ b/gdb/gdbarch_components.py @@ -2467,21 +2467,6 @@ Return the "auto" target wide charset. invalid=False, ) -Value( - comment=""" -If non-empty, this is a file extension that will be opened in place -of the file extension reported by the shared library list. - -This is most useful for toolchains that use a post-linker tool, -where the names of the files run on the target differ in extension -compared to the names of the files GDB should load for debug info. -""", - type="const char *", - name="solib_symbols_extension", - invalid=False, - printer="pstring (gdbarch->solib_symbols_extension)", -) - Value( comment=""" If true, the target OS has DOS-based file system semantics. That diff --git a/gdb/solib.c b/gdb/solib.c index 06330de7e91..4433019c144 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -375,33 +375,6 @@ exec_file_find (const char *in_pathname, int *fd) gdb::unique_xmalloc_ptr solib_find (const char *in_pathname, int *fd) { - const char *solib_symbols_extension - = gdbarch_solib_symbols_extension (current_inferior ()->arch ()); - - /* If solib_symbols_extension is set, replace the file's - extension. */ - if (solib_symbols_extension != NULL) - { - const char *p = in_pathname + strlen (in_pathname); - - while (p > in_pathname && *p != '.') - p--; - - if (*p == '.') - { - char *new_pathname; - - new_pathname - = (char *) alloca (p - in_pathname + 1 - + strlen (solib_symbols_extension) + 1); - memcpy (new_pathname, in_pathname, p - in_pathname + 1); - strcpy (new_pathname + (p - in_pathname) + 1, - solib_symbols_extension); - - in_pathname = new_pathname; - } - } - return solib_find_1 (in_pathname, fd, true); }