public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Remove a const-removing cast from coff-pe-read.c
Date: Fri, 22 Apr 2022 15:22:26 +0000 (GMT)	[thread overview]
Message-ID: <20220422152226.A95D03857C42@sourceware.org> (raw)

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

commit fa265c9bef46fc2211f8dccbc9d9b432778087be
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Apr 19 07:30:08 2022 -0600

    Remove a const-removing cast from coff-pe-read.c
    
    coff-pe-read.c casts away const at one spot, but this is easily
    replaced by calling bfd_get_filename directly in a couple of debugging
    prints.

Diff:
---
 gdb/coff-pe-read.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index 32d0a9ef649..ae4ca5435b6 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -311,7 +311,6 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
   unsigned long exp_funcbase;
   unsigned char *expdata, *erva;
   unsigned long name_rvas, ordinals, nexp, ordbase;
-  char *dll_name = (char *) bfd_get_filename (dll);
   int otherix = PE_SECTION_TABLE_SIZE;
   int is_pe64 = 0;
   int is_pe32 = 0;
@@ -394,12 +393,12 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
 	      if (debug_coff_pe_read)
 		gdb_printf (gdb_stdlog, _("Export RVA for dll "
 					  "\"%s\" is in section \"%s\"\n"),
-			    dll_name, sname);
+			    bfd_get_filename (dll), sname);
 	    }
 	  else if (export_opthdrrva != vaddr && debug_coff_pe_read)
 	    gdb_printf (gdb_stdlog, _("Wrong value of export RVA"
 				      " for dll \"%s\": 0x%lx instead of 0x%lx\n"),
-			dll_name, export_opthdrrva, vaddr);
+			bfd_get_filename (dll), export_opthdrrva, vaddr);
 	  expptr = fptr + (export_opthdrrva - vaddr);
 	  break;
 	}
@@ -484,7 +483,7 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
   exp_funcbase = pe_as32 (expdata + 28);
 
   /* Use internal dll name instead of full pathname.  */
-  dll_name = (char *) (pe_as32 (expdata + 12) + erva);
+  char *dll_name = (char *) (pe_as32 (expdata + 12) + erva);
 
   for (asection *sectp : gdb_bfd_sections (dll))
     {


                 reply	other threads:[~2022-04-22 15:22 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=20220422152226.A95D03857C42@sourceware.org \
    --to=tromey@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).