From: Simon Marchi <simon.marchi@polymtl.ca>
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 [thread overview]
Message-ID: <20200416184739.205859-2-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20200416184739.205859-1-simon.marchi@polymtl.ca>
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
next prev parent reply other threads:[~2020-04-16 18:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-16 15:45 [PATCH] gdb: make is_linked_with_cygwin_dll handle import table not at beginning of .idata section Simon Marchi
2020-04-16 16:27 ` Pedro Alves
2020-04-16 16:52 ` Simon Marchi
2020-04-16 18:47 ` [PATCH v2 1/2] " Simon Marchi
2020-04-16 18:47 ` Simon Marchi [this message]
2020-04-16 19:21 ` Pedro Alves
2020-04-16 19:47 ` Simon Marchi
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=20200416184739.205859-2-simon.marchi@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@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