From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id A95D03857C42; Fri, 22 Apr 2022 15:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A95D03857C42 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove a const-removing cast from coff-pe-read.c X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 5a0d4dfbf8aa8238c3eaccfdaf59ec9c4ae0331e X-Git-Newrev: fa265c9bef46fc2211f8dccbc9d9b432778087be Message-Id: <20220422152226.A95D03857C42@sourceware.org> Date: Fri, 22 Apr 2022 15:22:26 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2022 15:22:26 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dfa265c9bef46= fc2211f8dccbc9d9b432778087be commit fa265c9bef46fc2211f8dccbc9d9b432778087be Author: Tom Tromey Date: Tue Apr 19 07:30:08 2022 -0600 Remove a const-removing cast from coff-pe-read.c =20 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 =3D (char *) bfd_get_filename (dll); int otherix =3D PE_SECTION_TABLE_SIZE; int is_pe64 =3D 0; int is_pe32 =3D 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 !=3D 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 =3D fptr + (export_opthdrrva - vaddr); break; } @@ -484,7 +483,7 @@ read_pe_exported_syms (minimal_symbol_reader &reader, exp_funcbase =3D pe_as32 (expdata + 28); =20 /* Use internal dll name instead of full pathname. */ - dll_name =3D (char *) (pe_as32 (expdata + 12) + erva); + char *dll_name =3D (char *) (pe_as32 (expdata + 12) + erva); =20 for (asection *sectp : gdb_bfd_sections (dll)) {