2002-02-11 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Wed, 13 Feb 2002 21:53:31 +0000 (21:53 +0000)
committerMichael Snyder <msnyder@vmware.com>
Wed, 13 Feb 2002 21:53:31 +0000 (21:53 +0000)
* elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
* elf.c (elfcore_grok_pstatus): Add prototype.
(elfcore_grok_lwpstatus): Add prototype.
(elfcore_write_lwpstatus): New function.
(elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.

bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf.c

index 4b7640e060afa24586aff78a27f2d6b8272ee974..7d55773a22aa7b1efb6509e2b7601d3653dd42cf 100644 (file)
        DT_PPC64_OPD and DT_PPC64_OPDSZ tags.
        (ppc64_elf_finish_dynamic_sections): Set values for them.
 
+2002-02-11  Michael Snyder  <msnyder@redhat.com>
+
+       * elf-bfd.h (elfcore_write_lwpstatus): Add prototype.
+       * elf.c (elfcore_grok_pstatus): Add prototype.
+       (elfcore_grok_lwpstatus): Add prototype.
+       (elfcore_write_lwpstatus): New function.
+       (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy.
+
 2002-02-11  Alexandre Oliva  <aoliva@redhat.com>
 
        * elf32-sh.c: Added missing prototypes.
index 0bd559f50227ed35bc756a259c3ad4296c45bb73..4439daaff980e3043e33e94218850607e4d399ed 100644 (file)
@@ -1531,6 +1531,8 @@ extern char *elfcore_write_prfpreg
   PARAMS ((bfd *, char *, int *, void *, int));
 extern char *elfcore_write_prxfpreg 
   PARAMS ((bfd *, char *, int *, void *, int));
+extern char *elfcore_write_lwpstatus 
+  PARAMS ((bfd*, char*, int*, long, int, void*));
 
 /* MIPS ELF specific routines.  */
 
index 519e71d5999a4c8441774d35174a5c4cf88c1684..f75eb8587d0db5ab673642a184fac81bc0635b1d 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6153,6 +6153,8 @@ elfcore_grok_psinfo (abfd, note)
 #endif /* defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) */
 
 #if defined (HAVE_PSTATUS_T)
+static boolean elfcore_grok_pstatus PARAMS ((bfd *, Elf_Internal_Note *));
+
 static boolean
 elfcore_grok_pstatus (abfd, note)
      bfd *abfd;
@@ -6190,6 +6192,8 @@ elfcore_grok_pstatus (abfd, note)
 #endif /* defined (HAVE_PSTATUS_T) */
 
 #if defined (HAVE_LWPSTATUS_T)
+static boolean elfcore_grok_lwpstatus PARAMS ((bfd *, Elf_Internal_Note *));
+
 static boolean
 elfcore_grok_lwpstatus (abfd, note)
      bfd *abfd;
@@ -6603,6 +6607,38 @@ elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs)
 }
 #endif /* HAVE_PRSTATUS_T */
 
+#if defined (HAVE_LWPSTATUS_T)
+char *
+elfcore_write_lwpstatus (abfd, buf, bufsiz, pid, cursig, gregs)
+     bfd *abfd;
+     char *buf;
+     int *bufsiz;
+     long pid;
+     int cursig;
+     void *gregs;
+{
+  lwpstatus_t lwpstat;
+  char *note_name = "CORE";
+
+  memset (&lwpstat, 0, sizeof (lwpstat));
+  lwpstat.pr_lwpid  = pid >> 16;
+  lwpstat.pr_cursig = cursig;
+#if defined (HAVE_LWPSTATUS_T_PR_REG)
+  memcpy (lwpstat.pr_reg, gregs, sizeof (lwpstat.pr_reg));
+#elif defined (HAVE_LWPSTATUS_T_PR_CONTEXT)
+#if !defined(gregs)
+  memcpy (lwpstat.pr_context.uc_mcontext.gregs,
+         gregs, sizeof (lwpstat.pr_context.uc_mcontext.gregs));
+#else
+  memcpy (lwpstat.pr_context.uc_mcontext.__gregs,
+         gregs, sizeof (lwpstat.pr_context.uc_mcontext.__gregs));
+#endif
+#endif
+  return elfcore_write_note (abfd, buf, bufsiz, note_name, 
+                            NT_LWPSTATUS, &lwpstat, sizeof (lwpstat));
+}
+#endif /* HAVE_LWPSTATUS_T */
+
 #if defined (HAVE_PSTATUS_T)
 char *
 elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs)
@@ -6616,11 +6652,11 @@ elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs)
   pstatus_t pstat;
   char *note_name = "CORE";
 
-  memset (&pstat, 0, sizeof (prstat));
-  pstat.pr_pid = pid;
-  memcpy (pstat.pr_reg, gregs, sizeof (pstat.pr_reg));
-  return elfcore_write_note (abfd, buf, bufsiz, 
-                            note_name, NT_PSTATUS, &pstat, sizeof (pstat));
+  memset (&pstat, 0, sizeof (pstat));
+  pstat.pr_pid = pid & 0xffff;
+  buf = elfcore_write_note (abfd, buf, bufsiz, note_name, 
+                           NT_PSTATUS, &pstat, sizeof (pstat));
+  return buf;
 }
 #endif /* HAVE_PSTATUS_T */
 
This page took 0.033742 seconds and 4 git commands to generate.