struct siginfo vs. siginfo_t
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-low.c
index 06ec5763c624d66f1be540f7268688da6b459215..4734f159067b56b3fd613b64770df573db02cb01 100644 (file)
@@ -652,6 +652,8 @@ linux_attach_lwp_1 (unsigned long lwpid, int initial)
 
   if (ptrace (PTRACE_ATTACH, lwpid, 0, 0) != 0)
     {
+      struct buffer buffer;
+
       if (!initial)
        {
          /* If we fail to attach to an LWP, just warn.  */
@@ -662,8 +664,11 @@ linux_attach_lwp_1 (unsigned long lwpid, int initial)
        }
 
       /* If we fail to attach to a process, report an error.  */
-      error ("Cannot attach to lwp %ld: %s (%d)\n", lwpid,
-            strerror (errno), errno);
+      buffer_init (&buffer);
+      linux_ptrace_attach_warnings (lwpid, &buffer);
+      buffer_grow_str0 (&buffer, "");
+      error ("%sCannot attach to lwp %ld: %s (%d)", buffer_finish (&buffer),
+            lwpid, strerror (errno), errno);
     }
 
   if (initial)
@@ -4774,7 +4779,7 @@ linux_qxfer_osdata (const char *annex,
    layout of the inferiors' architecture.  */
 
 static void
-siginfo_fixup (struct siginfo *siginfo, void *inf_siginfo, int direction)
+siginfo_fixup (siginfo_t *siginfo, void *inf_siginfo, int direction)
 {
   int done = 0;
 
@@ -4786,9 +4791,9 @@ siginfo_fixup (struct siginfo *siginfo, void *inf_siginfo, int direction)
   if (!done)
     {
       if (direction == 1)
-       memcpy (siginfo, inf_siginfo, sizeof (struct siginfo));
+       memcpy (siginfo, inf_siginfo, sizeof (siginfo_t));
       else
-       memcpy (inf_siginfo, siginfo, sizeof (struct siginfo));
+       memcpy (inf_siginfo, siginfo, sizeof (siginfo_t));
     }
 }
 
@@ -4797,8 +4802,8 @@ linux_xfer_siginfo (const char *annex, unsigned char *readbuf,
                    unsigned const char *writebuf, CORE_ADDR offset, int len)
 {
   int pid;
-  struct siginfo siginfo;
-  char inf_siginfo[sizeof (struct siginfo)];
+  siginfo_t siginfo;
+  char inf_siginfo[sizeof (siginfo_t)];
 
   if (current_inferior == NULL)
     return -1;
This page took 0.024949 seconds and 4 git commands to generate.