aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-04-16 15:46:16 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-04-16 15:46:44 -0400
commit161972082386042858ee68b5335ddd09648e5bea (patch)
tree8f296daafe2e93369e6dfb66608447b6be47eb39
parent00ac85d3751b763155adb4e9d15dd134399b4e77 (diff)
downloadbinutils-161972082386042858ee68b5335ddd09648e5bea.zip
binutils-161972082386042858ee68b5335ddd09648e5bea.tar.gz
binutils-161972082386042858ee68b5335ddd09648e5bea.tar.bz2
gdb: is_linked_with_cygwin_dll: mention filename in warning messages
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/windows-tdep.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ebba52f..c57ffe1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2020-04-16 Simon Marchi <simon.marchi@polymtl.ca>
+ * windows-tdep.c (is_linked_with_cygwin_dll): Add filename to
+ warning messages.
+
+2020-04-16 Simon Marchi <simon.marchi@polymtl.ca>
+
* windows-tdep.c (is_linked_with_cygwin_dll): Consider case where
import table is not at beginning of .idata section.
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 50bb959..13eaf8f 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;
}