mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
Convert "remote:" sysroots to "target:" and remove "remote:"
The functionality of "target:" sysroots is a superset of the functionality of "remote:" sysroots. This commit causes the "set sysroot" command to rewrite "remote:" sysroots as "target:" sysroots and replaces "remote:" specific code with "target:" specific code where still necessary. gdb/ChangeLog: * remote.h (REMOTE_SYSROOT_PREFIX): Remove definition. (remote_filename_p): Remove declaration. (remote_bfd_open): Likewise. * remote.c (remote_bfd_iovec_open): Remove function. (remote_bfd_iovec_close): Likewise. (remote_bfd_iovec_pread): Likewise. (remote_bfd_iovec_stat): Likewise. (remote_filename_p): Likewise. (remote_bfd_open): Likewise. * symfile.h (gdb_bfd_open_maybe_remote): Remove declaration. * symfile.c (separate_debug_file_exists): Use gdb_bfd_open. (gdb_bfd_open_maybe_remote): Remove function. (symfile_bfd_open): Replace remote filename check with target filename check. (reread_symbols): Use gdb_bfd_open. * build-id.c (gdbcore.h): New include. (build_id_to_debug_bfd): Use gdb_bfd_open. * infcmd.c (attach_command_post_wait): Remove remote filename check. * solib.c (solib_find): Replace remote-specific handling with target-specific handling. Update comments where necessary. (solib_bfd_open): Replace remote-specific handling with target-specific handling. (gdb_sysroot_changed): New function. (_initialize_solib): Call the above when gdb_sysroot changes. * windows-tdep.c (gdbcore.h): New include. (windows_xfer_shared_library): Use gdb_bfd_open.
This commit is contained in:
@ -1368,7 +1368,7 @@ separate_debug_file_exists (const char *name, unsigned long crc,
|
||||
if (filename_cmp (name, objfile_name (parent_objfile)) == 0)
|
||||
return 0;
|
||||
|
||||
abfd = gdb_bfd_open_maybe_remote (name);
|
||||
abfd = gdb_bfd_open (name, gnutarget, -1);
|
||||
|
||||
if (!abfd)
|
||||
return 0;
|
||||
@ -1712,23 +1712,6 @@ set_initial_language (void)
|
||||
expected_language = current_language; /* Don't warn the user. */
|
||||
}
|
||||
|
||||
/* If NAME is a remote name open the file using remote protocol, otherwise
|
||||
open it normally. Returns a new reference to the BFD. On error,
|
||||
returns NULL with the BFD error set. */
|
||||
|
||||
bfd *
|
||||
gdb_bfd_open_maybe_remote (const char *name)
|
||||
{
|
||||
bfd *result;
|
||||
|
||||
if (remote_filename_p (name))
|
||||
result = remote_bfd_open (name, gnutarget);
|
||||
else
|
||||
result = gdb_bfd_open (name, gnutarget, -1);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Open the file specified by NAME and hand it off to BFD for
|
||||
preliminary analysis. Return a newly initialized bfd *, which
|
||||
includes a newly malloc'd` copy of NAME (tilde-expanded and made
|
||||
@ -1742,9 +1725,9 @@ symfile_bfd_open (const char *cname)
|
||||
char *name, *absolute_name;
|
||||
struct cleanup *back_to;
|
||||
|
||||
if (remote_filename_p (cname))
|
||||
if (is_target_filename (cname))
|
||||
{
|
||||
sym_bfd = remote_bfd_open (cname, gnutarget);
|
||||
sym_bfd = gdb_bfd_open (cname, gnutarget, -1);
|
||||
if (!sym_bfd)
|
||||
error (_("`%s': can't open to read symbols: %s."), cname,
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
@ -2596,7 +2579,7 @@ reread_symbols (void)
|
||||
obfd_filename = bfd_get_filename (objfile->obfd);
|
||||
/* Open the new BFD before freeing the old one, so that
|
||||
the filename remains live. */
|
||||
objfile->obfd = gdb_bfd_open_maybe_remote (obfd_filename);
|
||||
objfile->obfd = gdb_bfd_open (obfd_filename, gnutarget, -1);
|
||||
if (objfile->obfd == NULL)
|
||||
{
|
||||
/* We have to make a cleanup and error here, rather
|
||||
|
Reference in New Issue
Block a user