From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 614CE385BF81 for ; Thu, 16 Apr 2020 18:47:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 614CE385BF81 X-ASG-Debug-ID: 1587062865-0c856e314b456620001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id EMdPi4S2hervAXuz (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Apr 2020 14:47:45 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from localhost.localdomain (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id B05CA441D66; Thu, 16 Apr 2020 14:47:45 -0400 (EDT) From: Simon Marchi X-Barracuda-Effective-Source-IP: 192-222-164-54.qc.cable.ebox.net[192.222.164.54] X-Barracuda-Apparent-Source-IP: 192.222.164.54 X-Barracuda-RBL-IP: 192.222.164.54 To: gdb-patches@sourceware.org Subject: [PATCH v2 2/2] gdb: is_linked_with_cygwin_dll: mention filename in warning messages Date: Thu, 16 Apr 2020 14:47:39 -0400 X-ASG-Orig-Subj: [PATCH v2 2/2] gdb: is_linked_with_cygwin_dll: mention filename in warning messages Message-Id: <20200416184739.205859-2-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200416184739.205859-1-simon.marchi@polymtl.ca> References: <20200416154508.168585-1-simon.marchi@polymtl.ca> <20200416184739.205859-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1587062865 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 2194 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.81219 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-39.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2020 18:47:47 -0000 When a warning is displayed, it isn't clear to the user which file is the cause of the warning. Add the filename in there. Remove the "Failed to parse .idata section" part, since the .idata section is always mentioned one way or another anyway, so it just contributes to make the message longer than it needs to be. gdb/ChangeLog: * windows-tdep.c (is_linked_with_cygwin_dll): Add filename to warning messages. --- gdb/windows-tdep.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index 50bb9591f931..13eaf8f1cabd 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -1030,7 +1030,8 @@ section's range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), gdb::byte_vector idata_contents; if (!gdb_bfd_get_full_section_contents (abfd, idata_section, &idata_contents)) { - warning (_("Failed to get content of .idata section.")); + warning (_("%s: failed to get contents of .idata section."), + bfd_get_filename (abfd)); return false; } @@ -1046,8 +1047,8 @@ section's range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), /* Is there enough space left in the section for another entry? */ if (iter + sizeof (pe_import_directory_entry) > end) { - warning (_("Failed to parse .idata section: unexpected end of " - ".idata section.")); + warning (_("%s: unexpected end of .idata section."), + bfd_get_filename (abfd)); break; } @@ -1065,9 +1066,10 @@ section's range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), if (name_va < idata_section_va || name_va >= idata_section_end_va) { warning (_("\ -Failed to parse .idata section: name's virtual address (0x%" BFD_VMA_FMT "x) \ -is outside .idata section's range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), - name_va, idata_section_va, idata_section_end_va); +%s: name's virtual address (0x%" BFD_VMA_FMT "x) is outside .idata section's \ +range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), + bfd_get_filename (abfd), name_va, idata_section_va, + idata_section_end_va); break; } -- 2.26.0