public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* gdb: adjust x_file fields on COFF readers
@ 2021-11-10 12:42 CHIGOT, CLEMENT
  2021-11-10 12:55 ` Simon Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: CHIGOT, CLEMENT @ 2021-11-10 12:42 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

The patch made for PR 28447 changes the structure associated to the
internal representation of files in COFF formats.
However, gdb directory update has been forgotten.
This patch fixes it.

Changelog/gdb:
2021-11-10  Clément Chigot  <clement.chigot@atos.net>

	* gdb/coffread.c (coff_getfilename): Adjust names of x_file
	fields.
	* gdb/xcoffread.c (coff_getfilename): Likewise.



[-- Attachment #2: 0001-gdb-adjust-x_file-fields-on-COFF-readers.patch --]
[-- Type: application/octet-stream, Size: 2459 bytes --]

From 0dfe945cd80d9ffdbdf88fd7fa321998b0af59c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <clement.chigot@atos.net>
Date: Wed, 10 Nov 2021 13:35:07 +0100
Subject: [PATCH] gdb: adjust x_file fields on COFF readers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The patch made for PR 28447 changes the structure associated to the
internal representation of files in COFF formats.
However, gdb directory update has been forgotten.
This patch fixes it.

Changelog/gdb:
2021-11-10  Clément Chigot  <clement.chigot@atos.net>

	* gdb/coffread.c (coff_getfilename): Adjust names of x_file
	fields.
	* gdb/xcoffread.c (coff_getfilename): Likewise.
---
 gdb/coffread.c  | 8 ++++----
 gdb/xcoffread.c | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/coffread.c b/gdb/coffread.c
index 225e0e28e95..4723662f140 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 a854d4daf37..067f6fecdb8 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);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gdb: adjust x_file fields on COFF readers
  2021-11-10 12:42 gdb: adjust x_file fields on COFF readers CHIGOT, CLEMENT
@ 2021-11-10 12:55 ` Simon Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2021-11-10 12:55 UTC (permalink / raw)
  To: CHIGOT, CLEMENT, gdb-patches



On 2021-11-10 07:42, CHIGOT, CLEMENT via Gdb-patches wrote:
> The patch made for PR 28447 changes the structure associated to the
> internal representation of files in COFF formats.
> However, gdb directory update has been forgotten.
> This patch fixes it.
> 
> Changelog/gdb:
> 2021-11-10  Clément Chigot  <clement.chigot@atos.net>
> 
> 	* gdb/coffread.c (coff_getfilename): Adjust names of x_file
> 	fields.
> 	* gdb/xcoffread.c (coff_getfilename): Likewise.
> 
> 

Thanks, I adjusted the commit message and pushed.

Simon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-10 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 12:42 gdb: adjust x_file fields on COFF readers CHIGOT, CLEMENT
2021-11-10 12:55 ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).