This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfc][1/3] Remote core file generation: BFD support


On Wed, Nov 09, 2011 at 07:18:26PM +0100, Ulrich Weigand wrote:
> OK, good point.  I've just copied this from the PowerPC implementation,
> which needs to be fixed as well ...   I'll provide an updated patch.

Applied.

	* elf32-ppc.c (ppc_elf_write_core_note <NT_PRPSINFO>): Don't leave
	trailing garbage in the note.
	* elf64-ppc.c (ppc64_elf_write_core_note <NT_PRPSINFO>): Likewise.

Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.306
diff -u -p -r1.306 elf32-ppc.c
--- bfd/elf32-ppc.c	3 Dec 2011 00:55:49 -0000	1.306
+++ bfd/elf32-ppc.c	16 Jan 2012 22:25:06 -0000
@@ -1920,7 +1920,7 @@ ppc_elf_write_core_note (bfd *abfd, char
 	va_list ap;
 
 	va_start (ap, note_type);
-	memset (data, 0, 32);
+	memset (data, 0, sizeof (data));
 	strncpy (data + 32, va_arg (ap, const char *), 16);
 	strncpy (data + 48, va_arg (ap, const char *), 80);
 	va_end (ap);
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.373
diff -u -p -r1.373 elf64-ppc.c
--- bfd/elf64-ppc.c	11 Jan 2012 09:28:44 -0000	1.373
+++ bfd/elf64-ppc.c	16 Jan 2012 22:25:12 -0000
@@ -2721,7 +2721,7 @@ ppc64_elf_write_core_note (bfd *abfd, ch
 	va_list ap;
 
 	va_start (ap, note_type);
-	memset (data, 0, 40);
+	memset (data, 0, sizeof (data));
 	strncpy (data + 40, va_arg (ap, const char *), 16);
 	strncpy (data + 56, va_arg (ap, const char *), 80);
 	va_end (ap);

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]