]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove filename arg from gdb_bfd_open_from_target_memory
authorAndrew Burgess <aburgess@redhat.com>
Wed, 5 Oct 2022 14:25:59 +0000 (15:25 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 10 Oct 2022 12:05:27 +0000 (13:05 +0100)
The filename argument to gdb_bfd_open_from_target_memory was never
used; this argument had a default value of nullptr, and the only call
to this function, in jit.c, relied on the default value.

In the next commit I'm going to make some changes to the
gdb_bfd_open_from_target_memory function, and, though I could take
account of a filename parameter, it seems pointless to maintain an
unused argument.

This commit removes the filename argument.

There should be no user visible changes after this commit.

gdb/gdb_bfd.c
gdb/gdb_bfd.h

index 7e743891aedafd4ad1c7b69b6e809c08383e4d63..36ef5e1cc5ad6b2b559cc32db8b2e6995ecde323 100644 (file)
@@ -288,14 +288,13 @@ mem_bfd_iovec_stat (struct bfd *abfd, void *stream, struct stat *sb)
 
 gdb_bfd_ref_ptr
 gdb_bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size,
-                                const char *target,
-                                const char *filename)
+                                const char *target)
 {
   struct target_buffer *buffer = XNEW (struct target_buffer);
 
   buffer->base = addr;
   buffer->size = size;
-  return gdb_bfd_openr_iovec (filename ? filename : "<in-memory>", target,
+  return gdb_bfd_openr_iovec ("<in-memory>", target,
                              mem_bfd_iovec_open,
                              buffer,
                              mem_bfd_iovec_pread,
index 86f7be85f2090afc57e4c7a66c3ad039be33f4e6..6ea16ddc73509a5fb1db6d35c911b1be86e02863 100644 (file)
@@ -201,11 +201,12 @@ int gdb_bfd_requires_relocations (bfd *abfd);
 bool gdb_bfd_get_full_section_contents (bfd *abfd, asection *section,
                                        gdb::byte_vector *contents);
 
-/* Create and initialize a BFD handle from a target in-memory range.  */
+/* Create and initialize a BFD handle from a target in-memory range.  The
+   BFD starts at ADDR and is SIZE bytes long.  TARGET is the BFD target
+   name as used in bfd_find_target.  */
 
 gdb_bfd_ref_ptr gdb_bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size,
-                                                const char *target,
-                                                const char *filename = nullptr);
+                                                const char *target);
 
 /* Range adapter for a BFD's sections.