This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [PATCH] New BFD function necessary for a new GDB feature


Sorry... forgot to attach the patch.

Here it goes.


-- Carlos Eduardo Seo Software Engineer IBM Linux Technology Center
2008-02-03  Carlos Eduardo Seo  <cseo@linux.vnet.ibm.com>

	* elf.c (elfcore_write_register_note): New function.
	* elf-bfd.h (elfcore_write_register_note): New prototype.

Index: src/bfd/elf.c
===================================================================
--- src.orig/bfd/elf.c
+++ src/bfd/elf.c
@@ -8453,6 +8453,23 @@ elfcore_write_ppc_vmx (bfd *abfd,
 			     note_name, NT_PPC_VMX, ppc_vmx, size);
 }
 
+char *
+elfcore_write_register_note (bfd *abfd,
+			     char *buf,
+			     int *bufsiz,
+			     const char *section,
+			     const void *data,
+			     int size)
+{
+  if (strcmp (section, ".reg2") == 0)
+    return elfcore_write_prfpreg (abfd, buf, bufsiz, data, size);
+  if (strcmp (section, ".reg-xfp") == 0)
+    return elfcore_write_prxfpreg (abfd, buf, bufsiz, data, size);
+  if (strcmp (section, ".reg-ppc-vmx") == 0)
+    return elfcore_write_ppc_vmx (abfd, buf, bufsiz, data, size);
+  return NULL;
+}
+
 static bfd_boolean
 elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset)
 {
Index: src/bfd/elf-bfd.h
===================================================================
--- src.orig/bfd/elf-bfd.h
+++ src/bfd/elf-bfd.h
@@ -2143,6 +2143,8 @@ extern char *elfcore_write_ppc_vmx
   (bfd *, char *, int *, const void *, int);
 extern char *elfcore_write_lwpstatus
   (bfd *, char *, int *, long, int, const void *);
+extern char *elfcore_write_register_note
+  (bfd *, char *, int *, const char *, const void *, int);
 
 extern bfd *_bfd_elf32_bfd_from_remote_memory
   (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,

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