public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb: remove filename arg from gdb_bfd_open_from_target_memory
Date: Mon, 10 Oct 2022 12:10:18 +0000 (GMT)	[thread overview]
Message-ID: <20221010121018.963053858D37@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=322dd71cbffdd681f3c94ad28b625f71ea9369f8

commit 322dd71cbffdd681f3c94ad28b625f71ea9369f8
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Wed Oct 5 15:25:59 2022 +0100

    gdb: remove filename arg from gdb_bfd_open_from_target_memory
    
    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.

Diff:
---
 gdb/gdb_bfd.c | 5 ++---
 gdb/gdb_bfd.h | 7 ++++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 7e743891aed..36ef5e1cc5a 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -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,
diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h
index 86f7be85f20..6ea16ddc735 100644
--- a/gdb/gdb_bfd.h
+++ b/gdb/gdb_bfd.h
@@ -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.

                 reply	other threads:[~2022-10-10 12:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221010121018.963053858D37@sourceware.org \
    --to=aburgess@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).