aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2021-11-10 13:35:07 +0100
committerSimon Marchi <simon.marchi@polymtl.ca>2021-11-10 07:55:17 -0500
commitb08625af20ade108868edd6f31d1cee68889a0df (patch)
tree2a74a23fbe6f8f6015cdbe16c8cc8a6d677feab3
parent7cfa8d93cbbe16424fe2190cb3d27fc94c59f39b (diff)
downloadgdb-b08625af20ade108868edd6f31d1cee68889a0df.zip
gdb-b08625af20ade108868edd6f31d1cee68889a0df.tar.gz
gdb-b08625af20ade108868edd6f31d1cee68889a0df.tar.bz2
gdb: adjust x_file fields on COFF readers
Commit e86fc4a5bc37 ("PR 28447: implement multiple parameters for .file on XCOFF") changes the structure associated to the internal representation of files in COFF formats. However, gdb directory update has been forgotten, leading to compilation errors of this kind: CXX coffread.o /home/simark/src/binutils-gdb/gdb/coffread.c: In function 'const char* coff_getfilename(internal_auxent*)': /home/simark/src/binutils-gdb/gdb/coffread.c:1343:29: error: 'union internal_auxent::<unnamed struct>::<unnamed>' has no member named 'x_zeroes' 1343 | if (aux_entry->x_file.x_n.x_zeroes == 0) | ^~~~~~~~ Fix it by adjusting the COFF code in GDB. Change-Id: I703fa134bc722d47515efbd72b88fa5650af6c3c
-rw-r--r--gdb/coffread.c8
-rw-r--r--gdb/xcoffread.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 225e0e2..4723662 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1340,15 +1340,15 @@ coff_getfilename (union internal_auxent *aux_entry)
static char buffer[BUFSIZ];
const char *result;
- if (aux_entry->x_file.x_n.x_zeroes == 0)
+ if (aux_entry->x_file.x_n.x_n.x_zeroes == 0)
{
- if (strlen (stringtab + aux_entry->x_file.x_n.x_offset) >= BUFSIZ)
+ if (strlen (stringtab + aux_entry->x_file.x_n.x_n.x_offset) >= BUFSIZ)
internal_error (__FILE__, __LINE__, _("coff file name too long"));
- strcpy (buffer, stringtab + aux_entry->x_file.x_n.x_offset);
+ strcpy (buffer, stringtab + aux_entry->x_file.x_n.x_n.x_offset);
}
else
{
- strncpy (buffer, aux_entry->x_file.x_fname, FILNMLEN);
+ strncpy (buffer, aux_entry->x_file.x_n.x_fname, FILNMLEN);
buffer[FILNMLEN] = '\0';
}
result = buffer;
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index a854d4d..067f6fe 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1678,12 +1678,12 @@ coff_getfilename (union internal_auxent *aux_entry, struct objfile *objfile)
{
static char buffer[BUFSIZ];
- if (aux_entry->x_file.x_n.x_zeroes == 0)
+ if (aux_entry->x_file.x_n.x_n.x_zeroes == 0)
strcpy (buffer, (XCOFF_DATA (objfile)->strtbl
- + aux_entry->x_file.x_n.x_offset));
+ + aux_entry->x_file.x_n.x_n.x_offset));
else
{
- strncpy (buffer, aux_entry->x_file.x_fname, FILNMLEN);
+ strncpy (buffer, aux_entry->x_file.x_n.x_fname, FILNMLEN);
buffer[FILNMLEN] = '\0';
}
return (buffer);