struct siginfo vs. siginfo_t (was: GNU C Library master sources branch, master, updated. glibc-2.15-229-g4efeffc)

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

struct siginfo vs. siginfo_t (was: GNU C Library master sources branch, master, updated. glibc-2.15-229-g4efeffc)

Thomas Schwinge-8
Hi!

On 26 Feb 2012 18:17:52 -0000, [hidden email] wrote:
> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efeffc1d583597e4f52985b9747269e47b754e2
>
> commit 4efeffc1d583597e4f52985b9747269e47b754e2
> Author: Ulrich Drepper <[hidden email]>
> Date:   Sun Feb 26 13:17:27 2012 -0500
>
>     Fix up POSIX testing in conformtest

> [...]
> + * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t
> + struct.  [...]
> [...]

> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
> index ecef39d..0635e2f 100644
> --- a/sysdeps/unix/sysv/linux/bits/siginfo.h
> +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h
> [...]
> @@ -47,7 +47,7 @@ typedef union sigval
>  #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
>  # endif
>  
> -typedef struct siginfo
> +typedef struct
>    {
>      int si_signo; /* Signal number.  */
>      int si_errno; /* If non-zero, an errno value associated with
> [...]
This change breaks GCC:

    In file included from /scratch/tschwing/FM_sh-linux-gnu-mk2/src/gcc-mainline/libgcc/unwind-dw2.c:377:0:
    ./md-unwind-support.h: In function 'sh_fallback_frame_state':
    ./md-unwind-support.h:182:17: error: field 'info' has incomplete type

In my case, this is really libgcc/config/sh/linux-unwind.h:

    [...]
       181      struct rt_sigframe {
       182 struct siginfo info;
       183 struct ucontext uc;
       184      } *rt_ = context->cfa;
    [...]

There are more such cases:

    boehm-gc/os_dep.c:#   define SIGINFO_T struct siginfo
    libgcc/config/alpha/linux-unwind.h:   struct siginfo info;
    libgcc/config/bfin/linux-unwind.h:    struct siginfo *pinfo;
    libgcc/config/bfin/linux-unwind.h:    struct siginfo info;
    libgcc/config/i386/linux-unwind.h:    struct siginfo *pinfo;
    libgcc/config/i386/linux-unwind.h:    struct siginfo info;
    libgcc/config/ia64/linux-unwind.h:    struct siginfo *info;
    libgcc/config/ia64/linux-unwind.h:    struct siginfo *info;
    libgcc/config/mips/linux-unwind.h:    struct siginfo info;
    libgcc/config/pa/linux-unwind.h:    struct siginfo info;
    libgcc/config/sh/linux-unwind.h:      struct siginfo *pinfo;
    libgcc/config/sh/linux-unwind.h:      struct siginfo info;
    libgcc/config/sh/linux-unwind.h:      struct siginfo info;
    libgcc/config/tilepro/linux-unwind.h:    struct siginfo info;
    libgcc/config/xtensa/linux-unwind.h:    struct siginfo info;

(Is there really nobody doing nightly testing of GCC against glibc master
branch on x86, which would have shown this earlier?)

Replacing struct siginfo with siginfo_t in sh/linux-unwind.h makes the
build pass.  Is this the desired approach; shall we apply this for all
cases listed above (and submit to Boehm GC upstream)?  I wonder -- if GCC
breaks, how much software out in the wild is going to break once this
glibc change ripples through?


Grüße,
 Thomas

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t (was: GNU C Library master sources branch, master, updated. glibc-2.15-229-g4efeffc)

Carlos O'Donell-2
On Thu, Mar 15, 2012 at 11:05 AM, Thomas Schwinge
<[hidden email]> wrote:

> Hi!
>
> On 26 Feb 2012 18:17:52 -0000, [hidden email] wrote:
>> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efeffc1d583597e4f52985b9747269e47b754e2
>>
>> commit 4efeffc1d583597e4f52985b9747269e47b754e2
>> Author: Ulrich Drepper <[hidden email]>
>> Date:   Sun Feb 26 13:17:27 2012 -0500
>>
>>     Fix up POSIX testing in conformtest
>
>> [...]
>> +     * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t
>> +     struct.  [...]
>> [...]
>
>> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
>> index ecef39d..0635e2f 100644
>> --- a/sysdeps/unix/sysv/linux/bits/siginfo.h
>> +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h
>> [...]
>> @@ -47,7 +47,7 @@ typedef union sigval
>>  #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
>>  # endif
>>
>> -typedef struct siginfo
>> +typedef struct
>>    {
>>      int si_signo;            /* Signal number.  */
>>      int si_errno;            /* If non-zero, an errno value associated with
>> [...]
>
> This change breaks GCC:
>
>    In file included from /scratch/tschwing/FM_sh-linux-gnu-mk2/src/gcc-mainline/libgcc/unwind-dw2.c:377:0:
>    ./md-unwind-support.h: In function 'sh_fallback_frame_state':
>    ./md-unwind-support.h:182:17: error: field 'info' has incomplete type
>
> In my case, this is really libgcc/config/sh/linux-unwind.h:
>
>    [...]
>       181            struct rt_sigframe {
>       182              struct siginfo info;
>       183              struct ucontext uc;
>       184            } *rt_ = context->cfa;
>    [...]

POSIX says you get "siginto_t" *not* "struct siginfo," please fix the code.

> (Is there really nobody doing nightly testing of GCC against glibc master
> branch on x86, which would have shown this earlier?)

I don't test building GCC against glibc master unless I'm making a
potentially ABI breaking change.

We should be rebuilding *all* of userspace when glibc changes. It
would be nice if we setup an OpenEmbedded system to rebuild as much of
x86-64 userspace as possible against a new glibc and check for
regressions.

> Replacing struct siginfo with siginfo_t in sh/linux-unwind.h makes the
> build pass.  Is this the desired approach; shall we apply this for all
> cases listed above (and submit to Boehm GC upstream)?  I wonder -- if GCC
> breaks, how much software out in the wild is going to break once this
> glibc change ripples through?

You can't know until you try building a full distribution.

Cheers,
Carlos.
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t (was: GNU C Library master sources branch, master, updated. glibc-2.15-229-g4efeffc)

H.J. Lu-30
On Thu, Mar 15, 2012 at 8:57 AM, Carlos O'Donell
<[hidden email]> wrote:

> On Thu, Mar 15, 2012 at 11:05 AM, Thomas Schwinge
> <[hidden email]> wrote:
>> Hi!
>>
>> On 26 Feb 2012 18:17:52 -0000, [hidden email] wrote:
>>> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efeffc1d583597e4f52985b9747269e47b754e2
>>>
>>> commit 4efeffc1d583597e4f52985b9747269e47b754e2
>>> Author: Ulrich Drepper <[hidden email]>
>>> Date:   Sun Feb 26 13:17:27 2012 -0500
>>>
>>>     Fix up POSIX testing in conformtest
>>
>>> [...]
>>> +     * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t
>>> +     struct.  [...]
>>> [...]
>>
>>> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
>>> index ecef39d..0635e2f 100644
>>> --- a/sysdeps/unix/sysv/linux/bits/siginfo.h
>>> +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h
>>> [...]
>>> @@ -47,7 +47,7 @@ typedef union sigval
>>>  #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
>>>  # endif
>>>
>>> -typedef struct siginfo
>>> +typedef struct
>>>    {
>>>      int si_signo;            /* Signal number.  */
>>>      int si_errno;            /* If non-zero, an errno value associated with
>>> [...]
>>
>> This change breaks GCC:
>>
>>    In file included from /scratch/tschwing/FM_sh-linux-gnu-mk2/src/gcc-mainline/libgcc/unwind-dw2.c:377:0:
>>    ./md-unwind-support.h: In function 'sh_fallback_frame_state':
>>    ./md-unwind-support.h:182:17: error: field 'info' has incomplete type
>>
>> In my case, this is really libgcc/config/sh/linux-unwind.h:
>>
>>    [...]
>>       181            struct rt_sigframe {
>>       182              struct siginfo info;
>>       183              struct ucontext uc;
>>       184            } *rt_ = context->cfa;
>>    [...]
>
> POSIX says you get "siginto_t" *not* "struct siginfo," please fix the code.
>

"struct siginfo" may not work correctly for Linux/x32
and siginfo_t does since siginfo_t has an alignment
attribute, which isn't applied to "struct siginfo".


--
H.J.
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Nick Alcock-2
In reply to this post by Thomas Schwinge-8
On 15 Mar 2012, Thomas Schwinge said:

>                                                        I wonder -- if GCC
> breaks, how much software out in the wild is going to break once this
> glibc change ripples through?

A bit of quick grepping through a biggish heap of source trees
(including KDE 3 and 4 and GNOME 2, but not GNOME 3) suggests only GDB
and strace (on Tile only, so perhaps irrelevant) are likely to be broken
by this.

--
NULL && (void)
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Chris Metcalf-3
On 3/15/2012 12:50 PM, Nix wrote:
> On 15 Mar 2012, Thomas Schwinge said:
>
>>                                                        I wonder -- if GCC
>> breaks, how much software out in the wild is going to break once this
>> glibc change ripples through?
> A bit of quick grepping through a biggish heap of source trees
> (including KDE 3 and 4 and GNOME 2, but not GNOME 3) suggests only GDB
> and strace (on Tile only, so perhaps irrelevant) are likely to be broken
> by this.

We owe the strace folks an update anyway, so I'll fix the 'struct siginfo'
there as part of it.

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com

Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Carlos O'Donell-2
In reply to this post by Nick Alcock-2
On Thu, Mar 15, 2012 at 12:50 PM, Nix <[hidden email]> wrote:

> On 15 Mar 2012, Thomas Schwinge said:
>
>>                                                        I wonder -- if GCC
>> breaks, how much software out in the wild is going to break once this
>> glibc change ripples through?
>
> A bit of quick grepping through a biggish heap of source trees
> (including KDE 3 and 4 and GNOME 2, but not GNOME 3) suggests only GDB
> and strace (on Tile only, so perhaps irrelevant) are likely to be broken
> by this.

Nix,

Thanks for checking!

Would you like to be our ambassador and give the gdb lists a heads up
about this issue?

I see that Chris is already going to bring this up with strace.

Cheers,
Carlos.
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Thomas Schwinge-8
Hi!

On Thu, 15 Mar 2012 13:30:22 -0400, Carlos O'Donell <[hidden email]> wrote:

> On Thu, Mar 15, 2012 at 12:50 PM, Nix <[hidden email]> wrote:
> > On 15 Mar 2012, Thomas Schwinge said:
> >
> >>                                                        I wonder -- if GCC
> >> breaks, how much software out in the wild is going to break once this
> >> glibc change ripples through?
> >
> > A bit of quick grepping through a biggish heap of source trees
> > (including KDE 3 and 4 and GNOME 2, but not GNOME 3) suggests only GDB
> > and strace (on Tile only, so perhaps irrelevant) are likely to be broken
> > by this.
Yeah, I had already noticed GDB as the toolchain build progressed.


> Would you like to be our ambassador and give the gdb lists a heads up
> about this issue?

No worries, I'm already testing patches, and will handle it.  Evidently,
there is no need for any rush.


Grüße,
 Thomas

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t (was: GNU C Library master sources branch, master, updated. glibc-2.15-229-g4efeffc)

Mike Frysinger
In reply to this post by Carlos O'Donell-2
On Thursday 15 March 2012 11:57:00 Carlos O'Donell wrote:
> We should be rebuilding *all* of userspace when glibc changes. It
> would be nice if we setup an OpenEmbedded system to rebuild as much of
> x86-64 userspace as possible against a new glibc and check for
> regressions.

emerge -e world
-mike

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Thomas Schwinge-8
In reply to this post by Carlos O'Donell-2
Hi!

On Thu, 15 Mar 2012 11:57:00 -0400, Carlos O'Donell <[hidden email]> wrote:

> On Thu, Mar 15, 2012 at 11:05 AM, Thomas Schwinge
> <[hidden email]> wrote:
> > On 26 Feb 2012 18:17:52 -0000, [hidden email] wrote:
> >> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efeffc1d583597e4f52985b9747269e47b754e2
> >>
> >> commit 4efeffc1d583597e4f52985b9747269e47b754e2
> >> Author: Ulrich Drepper <[hidden email]>
> >> Date:   Sun Feb 26 13:17:27 2012 -0500
> >>
> >>     Fix up POSIX testing in conformtest
> >
> >> [...]
> >> +     * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t
> >> +     struct.  [...]
> >> [...]
> >
> >> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
> >> index ecef39d..0635e2f 100644
> >> --- a/sysdeps/unix/sysv/linux/bits/siginfo.h
> >> +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h
> >> [...]
> >> @@ -47,7 +47,7 @@ typedef union sigval
> >>  #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
> >>  # endif
> >>
> >> -typedef struct siginfo
> >> +typedef struct
> >>    {
> >>      int si_signo;            /* Signal number.  */
> >>      int si_errno;            /* If non-zero, an errno value associated with
> >> [...]
> >
> > This change breaks GCC:
> >
> >    In file included from /scratch/tschwing/FM_sh-linux-gnu-mk2/src/gcc-mainline/libgcc/unwind-dw2.c:377:0:
> >    ./md-unwind-support.h: In function 'sh_fallback_frame_state':
> >    ./md-unwind-support.h:182:17: error: field 'info' has incomplete type
> >
> > In my case, this is really libgcc/config/sh/linux-unwind.h:
> >
> >    [...]
> >       181            struct rt_sigframe {
> >       182              struct siginfo info;
> >       183              struct ucontext uc;
> >       184            } *rt_ = context->cfa;
> >    [...]
>
> POSIX says you get "siginto_t" *not* "struct siginfo," please fix the code.
The same problem exists in GDB.

I tested the following patch for x86_64-linux-gnu natively, and
sh-linux-gnu cross-testing with gdbserver.  This doesn't cover all
affected configurations, but at least some of them, and the change is
pretty mechanic anyway (apart from the one occucrrence in gdbserver,
every place that used to refert to struct siginfo already must have had
<signal.h> in its include patch, which is the same file that declares
siginfo_t).

OK to commit?

gdb/
        * amd64-linux-nat.c (amd64_linux_siginfo_fixup): Use siginfo_t instead
        of struct siginfo.gdb_siginfo_t.
        * arm-linux-nat.c (arm_linux_stopped_data_address): Likewise.
        * ia64-linux-nat.c (ia64_linux_stopped_data_address): Likewise.
        * linux-nat.c (linux_nat_siginfo_fixup, siginfo_fixup)
        (linux_xfer_siginfo, linux_nat_set_siginfo_fixup)
        (linux_nat_get_siginfo): Likewise.
        * linux-nat.h (lwp_info, linux_nat_set_siginfo_fixup)
        (linux_nat_get_siginfo): Likewise.
        * linux-tdep.c (linux_get_siginfo_type): Likewise.
        * ppc-linux-nat.c (ppc_linux_stopped_data_address): Likewise.
        * procfs.c (gdb_siginfo_t): Likewise.

gdb/gdbserver/
        * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
        struct siginfo.gdb_siginfo_t.
        * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
        * linux-x86-low.c (x86_siginfo_fixup): Likewise.
        * linux-low.h (linux_target_ops): Likewise.  Include <signal.h> instead
        of declaring struct siginfo as incomplete type.

diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index f954483..5ebba3a 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -731,13 +731,13 @@ siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
    INF.  */
 
 static int
-amd64_linux_siginfo_fixup (struct siginfo *native, gdb_byte *inf, int direction)
+amd64_linux_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction)
 {
   /* Is the inferior 32-bit?  If so, then do fixup the siginfo
      object.  */
   if (gdbarch_addr_bit (get_frame_arch (get_current_frame ())) == 32)
     {
-      gdb_assert (sizeof (struct siginfo) == sizeof (compat_siginfo_t));
+      gdb_assert (sizeof (siginfo_t) == sizeof (compat_siginfo_t));
 
       if (direction == 0)
  compat_siginfo_from_siginfo ((struct compat_siginfo *) inf, native);
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index c5ce21c..f9f6ba5 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -1137,7 +1137,7 @@ arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
 static int
 arm_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
 {
-  struct siginfo *siginfo_p = linux_nat_get_siginfo (inferior_ptid);
+  siginfo_t *siginfo_p = linux_nat_get_siginfo (inferior_ptid);
   int slot = siginfo_p->si_errno;
 
   /* This must be a hardware breakpoint.  */
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index 8773195..19b827f 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -637,7 +637,7 @@ static int
 ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
 {
   CORE_ADDR psr;
-  struct siginfo *siginfo_p;
+  siginfo_t *siginfo_p;
   struct regcache *regcache = get_current_regcache ();
 
   siginfo_p = linux_nat_get_siginfo (inferior_ptid);
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index f80c0c1..d81d55e 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -188,7 +188,7 @@ static void (*linux_nat_prepare_to_resume) (struct lwp_info *);
 /* The method to call, if any, when the siginfo object needs to be
    converted between the layout returned by ptrace, and the layout in
    the architecture of the inferior.  */
-static int (*linux_nat_siginfo_fixup) (struct siginfo *,
+static int (*linux_nat_siginfo_fixup) (siginfo_t *,
        gdb_byte *,
        int);
 
@@ -4232,7 +4232,7 @@ linux_nat_mourn_inferior (struct target_ops *ops)
    layout of the inferiors' architecture.  */
 
 static void
-siginfo_fixup (struct siginfo *siginfo, gdb_byte *inf_siginfo, int direction)
+siginfo_fixup (siginfo_t *siginfo, gdb_byte *inf_siginfo, int direction)
 {
   int done = 0;
 
@@ -4244,9 +4244,9 @@ siginfo_fixup (struct siginfo *siginfo, gdb_byte *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));
     }
 }
 
@@ -4256,8 +4256,8 @@ linux_xfer_siginfo (struct target_ops *ops, enum target_object object,
     const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
 {
   int pid;
-  struct siginfo siginfo;
-  gdb_byte inf_siginfo[sizeof (struct siginfo)];
+  siginfo_t siginfo;
+  gdb_byte inf_siginfo[sizeof (siginfo_t)];
 
   gdb_assert (object == TARGET_OBJECT_SIGNAL_INFO);
   gdb_assert (readbuf || writebuf);
@@ -5266,7 +5266,7 @@ linux_nat_set_new_thread (struct target_ops *t,
    inferior.  */
 void
 linux_nat_set_siginfo_fixup (struct target_ops *t,
-     int (*siginfo_fixup) (struct siginfo *,
+     int (*siginfo_fixup) (siginfo_t *,
    gdb_byte *,
    int))
 {
@@ -5285,7 +5285,7 @@ linux_nat_set_prepare_to_resume (struct target_ops *t,
 }
 
 /* Return the saved siginfo associated with PTID.  */
-struct siginfo *
+siginfo_t *
 linux_nat_get_siginfo (ptid_t ptid)
 {
   struct lwp_info *lp = find_lwp_pid (ptid);
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index c9878d9..d87f0cf 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -78,7 +78,7 @@ struct lwp_info
 
   /* Non-zero si_signo if this LWP stopped with a trap.  si_addr may
      be the address of a hardware watchpoint.  */
-  struct siginfo siginfo;
+  siginfo_t siginfo;
 
   /* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data
      watchpoint trap.  */
@@ -184,7 +184,7 @@ void linux_nat_set_new_thread (struct target_ops *, void (*) (struct lwp_info *)
    that ptrace returns, and the layout in the architecture of the
    inferior.  */
 void linux_nat_set_siginfo_fixup (struct target_ops *,
-  int (*) (struct siginfo *,
+  int (*) (siginfo_t *,
    gdb_byte *,
    int));
 
@@ -198,7 +198,7 @@ void linux_nat_set_prepare_to_resume (struct target_ops *,
 void linux_nat_switch_fork (ptid_t new_ptid);
 
 /* Return the saved siginfo associated with PTID.  */
-struct siginfo *linux_nat_get_siginfo (ptid_t ptid);
+siginfo_t *linux_nat_get_siginfo (ptid_t ptid);
 
 /* Set alternative SIGTRAP-like events recognizer.  */
 void linux_nat_set_status_is_event (struct target_ops *t,
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 1bd157b..9bd11fd 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -2218,7 +2218,7 @@ ppc_linux_thread_exit (struct thread_info *tp, int silent)
 static int
 ppc_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
 {
-  struct siginfo *siginfo_p;
+  siginfo_t *siginfo_p;
 
   siginfo_p = linux_nat_get_siginfo (inferior_ptid);
 
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 903621d..cb4bc7c 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -266,7 +266,7 @@ typedef struct sigaction gdb_sigaction_t;
 #ifdef HAVE_PR_SIGINFO64_T
 typedef pr_siginfo64_t gdb_siginfo_t;
 #else
-typedef struct siginfo gdb_siginfo_t;
+typedef siginfo_t gdb_siginfo_t;
 #endif
 
 /* On mips-irix, praddset and prdelset are defined in such a way that
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index ff2437d..01208ef 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -631,7 +631,7 @@ static int
 arm_stopped_by_watchpoint (void)
 {
   struct lwp_info *lwp = get_thread_lwp (current_inferior);
-  struct siginfo siginfo;
+  siginfo_t siginfo;
 
   /* We must be able to set hardware watchpoints.  */
   if (arm_linux_get_hw_watchpoint_count () == 0)
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index d2d4c1d..4734f15 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -4779,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;
 
@@ -4791,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));
     }
 }
 
@@ -4802,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;
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index 677d261..3aeae70 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -20,6 +20,7 @@
 #ifdef HAVE_THREAD_DB_H
 #include <thread_db.h>
 #endif
+#include <signal.h>
 
 #include "gdb_proc_service.h"
 
@@ -46,8 +47,6 @@ struct regset_info
 extern struct regset_info target_regsets[];
 #endif
 
-struct siginfo;
-
 struct process_info_private
 {
   /* Arch-specific additions.  */
@@ -109,7 +108,7 @@ struct linux_target_ops
      Returns true if any conversion was done; false otherwise.
      If DIRECTION is 1, then copy from INF to NATIVE.
      If DIRECTION is 0, copy from NATIVE to INF.  */
-  int (*siginfo_fixup) (struct siginfo *native, void *inf, int direction);
+  int (*siginfo_fixup) (siginfo_t *native, void *inf, int direction);
 
   /* Hook to call when a new process is created or attached to.
      If extra per-process architecture-specific data is needed,
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index ed1f8a8..b466b5d 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -918,13 +918,13 @@ siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
    INF.  */
 
 static int
-x86_siginfo_fixup (struct siginfo *native, void *inf, int direction)
+x86_siginfo_fixup (siginfo_t *native, void *inf, int direction)
 {
 #ifdef __x86_64__
   /* Is the inferior 32-bit?  If so, then fixup the siginfo object.  */
   if (register_size (0) == 4)
     {
-      if (sizeof (struct siginfo) != sizeof (compat_siginfo_t))
+      if (sizeof (siginfo_t) != sizeof (compat_siginfo_t))
  fatal ("unexpected difference in siginfo");
 
       if (direction == 0)

I did not change refernces in comments that refer to signal frames and
the like.


Grüße,
 Thomas

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Pedro Alves-7
Okay, but,

On 03/21/2012 11:51 AM, Thomas Schwinge wrote:>

> gdb/
> * amd64-linux-nat.c (amd64_linux_siginfo_fixup): Use siginfo_t instead
> of struct siginfo.gdb_siginfo_t.


'gdb_siginfo_t.' here looks like a pasto.

> * arm-linux-nat.c (arm_linux_stopped_data_address): Likewise.
> * ia64-linux-nat.c (ia64_linux_stopped_data_address): Likewise.
> * linux-nat.c (linux_nat_siginfo_fixup, siginfo_fixup)
> (linux_xfer_siginfo, linux_nat_set_siginfo_fixup)
> (linux_nat_get_siginfo): Likewise.
> * linux-nat.h (lwp_info, linux_nat_set_siginfo_fixup)


s/lwp_info/struct lwp_info/

> (linux_nat_get_siginfo): Likewise.
> * linux-tdep.c (linux_get_siginfo_type): Likewise.
> * ppc-linux-nat.c (ppc_linux_stopped_data_address): Likewise.
> * procfs.c (gdb_siginfo_t): Likewise.
>
> gdb/gdbserver/
> * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
> struct siginfo.gdb_siginfo_t.


'gdb_siginfo_t.' here looks like a pasto.

> * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
> * linux-x86-low.c (x86_siginfo_fixup): Likewise.

> * linux-low.h (linux_target_ops): Likewise.  Include <signal.h> instead

> of declaring struct siginfo as incomplete type.


        * linux-low.h: Include <signal.h>.
  (struct siginfo): Delete forward declaration.
        (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
  struct siginfo.

Thanks.

--
Pedro Alves
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Thomas Schwinge-8
Hi!

Pedro Alves, true master of GNU ChangeLog syntax as well as quick patch
review.  Thanks!

Thusly changed and committed.  (And I have no idea how that pasto
happened.)


Grüße,
 Thomas

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Thomas Schwinge-8
In reply to this post by Carlos O'Donell-2
Hi!

On Thu, 15 Mar 2012 11:57:00 -0400, Carlos O'Donell <[hidden email]> wrote:

> On Thu, Mar 15, 2012 at 11:05 AM, Thomas Schwinge
> <[hidden email]> wrote:
> > On 26 Feb 2012 18:17:52 -0000, [hidden email] wrote:
> >> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efeffc1d583597e4f52985b9747269e47b754e2
> >>
> >> commit 4efeffc1d583597e4f52985b9747269e47b754e2
> >> Author: Ulrich Drepper <[hidden email]>
> >> Date:   Sun Feb 26 13:17:27 2012 -0500
> >>
> >>     Fix up POSIX testing in conformtest
> >
> >> [...]
> >> +     * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t
> >> +     struct.  [...]
> >> [...]
> >
> >> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
> >> index ecef39d..0635e2f 100644
> >> --- a/sysdeps/unix/sysv/linux/bits/siginfo.h
> >> +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h
> >> [...]
> >> @@ -47,7 +47,7 @@ typedef union sigval
> >>  #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
> >>  # endif
> >>
> >> -typedef struct siginfo
> >> +typedef struct
> >>    {
> >>      int si_signo;            /* Signal number.  */
> >>      int si_errno;            /* If non-zero, an errno value associated with
> >> [...]
> >
> > This change breaks GCC:
> >
> >    In file included from /scratch/tschwing/FM_sh-linux-gnu-mk2/src/gcc-mainline/libgcc/unwind-dw2.c:377:0:
> >    ./md-unwind-support.h: In function 'sh_fallback_frame_state':
> >    ./md-unwind-support.h:182:17: error: field 'info' has incomplete type
> >
> > In my case, this is really libgcc/config/sh/linux-unwind.h:
> >
> >    [...]
> >       181            struct rt_sigframe {
> >       182              struct siginfo info;
> >       183              struct ucontext uc;
> >       184            } *rt_ = context->cfa;
> >    [...]
>
> POSIX says you get "siginto_t" *not* "struct siginfo," please fix the code.
There is one usage in boehm-gc/os_dep.c, but it is only used if
SUNOS5SIGS is defined, which it is only if one of SUNOS5, DRSNX, HPUX, or
FREEBSD is defined, which are all not using Linux-based glibc ports.

Likewise, gcc/ada/init.c has a struct __siginfo occurence, but only for
__FreeBSD__.

config/rs6000/linux-unwind.h uses ``char siginfo[128]'', and
config/s390/linux-unwind.h also uses a constant.

I tested the following patch for sh-linux-gnu.  This only covers one
configuration, but the change is pretty mechanic anyway and every place
that used to refer to struct siginfo already must have had <signal.h> in
its include path, which is the same file that declares siginfo_t.

OK to commit?  This should probably also go into any active release
branches, to keep them buildable once this glibc change ripples through?

libgcc/
        * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
        siginfo_t instead of struct siginfo.
        * config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
        * config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
        * config/ia64/linux-unwind.h (ia64_fallback_frame_state)
        (ia64_handle_unwabi): Likewise.
        * config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
        * config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
        * config/sh/linux-unwind.h (shmedia_fallback_frame_state)
        (sh_fallback_frame_state): Likewise.
        * config/tilepro/linux-unwind.h (tile_fallback_frame_state): Likewise.
        * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.

diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
index 4c811dc..f747053 100644
--- a/libgcc/config/alpha/linux-unwind.h
+++ b/libgcc/config/alpha/linux-unwind.h
@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
   else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */
     {
       struct rt_sigframe {
- struct siginfo info;
+ siginfo_t info;
  struct ucontext uc;
       } *rt_ = context->cfa;
       sc = &rt_->uc.uc_mcontext;
diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
index 88c8285..6e8f1ad 100644
--- a/libgcc/config/bfin/linux-unwind.h
+++ b/libgcc/config/bfin/linux-unwind.h
@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
     {
       struct rt_sigframe {
  int sig;
- struct siginfo *pinfo;
+ siginfo_t *pinfo;
  void *puc;
  char retcode[8];
- struct siginfo info;
+ siginfo_t info;
  struct ucontext uc;
       } *rt_ = context->cfa;
 
diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
index f17a46c..33810c5 100644
--- a/libgcc/config/i386/linux-unwind.h
+++ b/libgcc/config/i386/linux-unwind.h
@@ -139,9 +139,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
     {
       struct rt_sigframe {
  int sig;
- struct siginfo *pinfo;
+ siginfo_t *pinfo;
  void *puc;
- struct siginfo info;
+ siginfo_t info;
  struct ucontext uc;
       } *rt_ = context->cfa;
       /* The void * cast is necessary to avoid an aliasing warning.
diff --git a/libgcc/config/ia64/linux-unwind.h b/libgcc/config/ia64/linux-unwind.h
index 93f762d..baf80ee 100644
--- a/libgcc/config/ia64/linux-unwind.h
+++ b/libgcc/config/ia64/linux-unwind.h
@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
       struct sigframe {
  char scratch[16];
  unsigned long sig_number;
- struct siginfo *info;
+ siginfo_t *info;
  struct sigcontext *sc;
       } *frame_ = (struct sigframe *)context->psp;
       struct sigcontext *sc = frame_->sc;
@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
       struct sigframe {
  char scratch[16];
  unsigned long sig_number;
- struct siginfo *info;
+ siginfo_t *info;
  struct sigcontext *sc;
       } *frame = (struct sigframe *)context->psp;
       struct sigcontext *sc = frame->sc;
diff --git a/libgcc/config/mips/linux-unwind.h b/libgcc/config/mips/linux-unwind.h
index 02f7cd5..69d96f1 100644
--- a/libgcc/config/mips/linux-unwind.h
+++ b/libgcc/config/mips/linux-unwind.h
@@ -75,7 +75,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
       struct rt_sigframe {
  u_int32_t ass[4];  /* Argument save space for o32.  */
  u_int32_t trampoline[2];
- struct siginfo info;
+ siginfo_t info;
  _sig_ucontext_t uc;
       } *rt_ = context->cfa;
       sc = &rt_->uc.uc_mcontext;
diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
index a0560e9..dd8f590 100644
--- a/libgcc/config/pa/linux-unwind.h
+++ b/libgcc/config/pa/linux-unwind.h
@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
   int i;
   struct sigcontext *sc;
   struct rt_sigframe {
-    struct siginfo info;
+    siginfo_t info;
     struct ucontext uc;
   } *frame;
 
diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
index 94ed95d..c1e1adb 100644
--- a/libgcc/config/sh/linux-unwind.h
+++ b/libgcc/config/sh/linux-unwind.h
@@ -80,9 +80,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
    && (*(unsigned long *) (pc+11)  == 0x6ff0fff0))
     {
       struct rt_sigframe {
- struct siginfo *pinfo;
+ siginfo_t *pinfo;
  void *puc;
- struct siginfo info;
+ siginfo_t info;
  struct ucontext uc;
       } *rt_ = context->cfa;
       /* The void * cast is necessary to avoid an aliasing warning.
@@ -179,7 +179,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
  && (*(unsigned short *) (pc+14)  == 0x00ad))))
     {
       struct rt_sigframe {
- struct siginfo info;
+ siginfo_t info;
  struct ucontext uc;
       } *rt_ = context->cfa;
       /* The void * cast is necessary to avoid an aliasing warning.
diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
index 0ed662c..27a6c43 100644
--- a/libgcc/config/tilepro/linux-unwind.h
+++ b/libgcc/config/tilepro/linux-unwind.h
@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
 
   struct rt_sigframe {
     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
-    struct siginfo info;
+    siginfo_t info;
     struct ucontext uc;
   } *rt_;
 
diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
index 32e9349..dda1f29 100644
--- a/libgcc/config/xtensa/linux-unwind.h
+++ b/libgcc/config/xtensa/linux-unwind.h
@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
   struct sigcontext *sc;
 
   struct rt_sigframe {
-    struct siginfo info;
+    siginfo_t info;
     struct ucontext uc;
   } *rt_;
 


Grüße,
 Thomas

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Thomas Schwinge-8
Hi!

Ping.

On Wed, 21 Mar 2012 15:56:04 +0100, I wrote:

> On Thu, 15 Mar 2012 11:57:00 -0400, Carlos O'Donell <[hidden email]> wrote:
> > On Thu, Mar 15, 2012 at 11:05 AM, Thomas Schwinge
> > <[hidden email]> wrote:
> > > On 26 Feb 2012 18:17:52 -0000, [hidden email] wrote:
> > >> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efeffc1d583597e4f52985b9747269e47b754e2
> > >>
> > >> commit 4efeffc1d583597e4f52985b9747269e47b754e2
> > >> Author: Ulrich Drepper <[hidden email]>
> > >> Date:   Sun Feb 26 13:17:27 2012 -0500
> > >>
> > >>     Fix up POSIX testing in conformtest
> > >
> > >> [...]
> > >> +     * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t
> > >> +     struct.  [...]
> > >> [...]
> > >
> > >> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
> > >> index ecef39d..0635e2f 100644
> > >> --- a/sysdeps/unix/sysv/linux/bits/siginfo.h
> > >> +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h
> > >> [...]
> > >> @@ -47,7 +47,7 @@ typedef union sigval
> > >>  #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
> > >>  # endif
> > >>
> > >> -typedef struct siginfo
> > >> +typedef struct
> > >>    {
> > >>      int si_signo;            /* Signal number.  */
> > >>      int si_errno;            /* If non-zero, an errno value associated with
> > >> [...]
> > >
> > > This change breaks GCC:
> > >
> > >    In file included from /scratch/tschwing/FM_sh-linux-gnu-mk2/src/gcc-mainline/libgcc/unwind-dw2.c:377:0:
> > >    ./md-unwind-support.h: In function 'sh_fallback_frame_state':
> > >    ./md-unwind-support.h:182:17: error: field 'info' has incomplete type
> > >
> > > In my case, this is really libgcc/config/sh/linux-unwind.h:
> > >
> > >    [...]
> > >       181            struct rt_sigframe {
> > >       182              struct siginfo info;
> > >       183              struct ucontext uc;
> > >       184            } *rt_ = context->cfa;
> > >    [...]
> >
> > POSIX says you get "siginto_t" *not* "struct siginfo," please fix the code.
>
> There is one usage in boehm-gc/os_dep.c, but it is only used if
> SUNOS5SIGS is defined, which it is only if one of SUNOS5, DRSNX, HPUX, or
> FREEBSD is defined, which are all not using Linux-based glibc ports.
>
> Likewise, gcc/ada/init.c has a struct __siginfo occurence, but only for
> __FreeBSD__.
>
> config/rs6000/linux-unwind.h uses ``char siginfo[128]'', and
> config/s390/linux-unwind.h also uses a constant.
>
> I tested the following patch for sh-linux-gnu.  This only covers one
> configuration, but the change is pretty mechanic anyway and every place
> that used to refer to struct siginfo already must have had <signal.h> in
> its include path, which is the same file that declares siginfo_t.
>
> OK to commit?  This should probably also go into any active release
> branches, to keep them buildable once this glibc change ripples through?
>
> libgcc/
> * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
> siginfo_t instead of struct siginfo.
> * config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
> * config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
> * config/ia64/linux-unwind.h (ia64_fallback_frame_state)
> (ia64_handle_unwabi): Likewise.
> * config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
> * config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
> * config/sh/linux-unwind.h (shmedia_fallback_frame_state)
> (sh_fallback_frame_state): Likewise.
> * config/tilepro/linux-unwind.h (tile_fallback_frame_state): Likewise.
> * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
>
> diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
> index 4c811dc..f747053 100644
> --- a/libgcc/config/alpha/linux-unwind.h
> +++ b/libgcc/config/alpha/linux-unwind.h
> @@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
>    else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */
>      {
>        struct rt_sigframe {
> - struct siginfo info;
> + siginfo_t info;
>   struct ucontext uc;
>        } *rt_ = context->cfa;
>        sc = &rt_->uc.uc_mcontext;
> diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
> index 88c8285..6e8f1ad 100644
> --- a/libgcc/config/bfin/linux-unwind.h
> +++ b/libgcc/config/bfin/linux-unwind.h
> @@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
>      {
>        struct rt_sigframe {
>   int sig;
> - struct siginfo *pinfo;
> + siginfo_t *pinfo;
>   void *puc;
>   char retcode[8];
> - struct siginfo info;
> + siginfo_t info;
>   struct ucontext uc;
>        } *rt_ = context->cfa;
>  
> diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
> index f17a46c..33810c5 100644
> --- a/libgcc/config/i386/linux-unwind.h
> +++ b/libgcc/config/i386/linux-unwind.h
> @@ -139,9 +139,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
>      {
>        struct rt_sigframe {
>   int sig;
> - struct siginfo *pinfo;
> + siginfo_t *pinfo;
>   void *puc;
> - struct siginfo info;
> + siginfo_t info;
>   struct ucontext uc;
>        } *rt_ = context->cfa;
>        /* The void * cast is necessary to avoid an aliasing warning.
> diff --git a/libgcc/config/ia64/linux-unwind.h b/libgcc/config/ia64/linux-unwind.h
> index 93f762d..baf80ee 100644
> --- a/libgcc/config/ia64/linux-unwind.h
> +++ b/libgcc/config/ia64/linux-unwind.h
> @@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
>        struct sigframe {
>   char scratch[16];
>   unsigned long sig_number;
> - struct siginfo *info;
> + siginfo_t *info;
>   struct sigcontext *sc;
>        } *frame_ = (struct sigframe *)context->psp;
>        struct sigcontext *sc = frame_->sc;
> @@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
>        struct sigframe {
>   char scratch[16];
>   unsigned long sig_number;
> - struct siginfo *info;
> + siginfo_t *info;
>   struct sigcontext *sc;
>        } *frame = (struct sigframe *)context->psp;
>        struct sigcontext *sc = frame->sc;
> diff --git a/libgcc/config/mips/linux-unwind.h b/libgcc/config/mips/linux-unwind.h
> index 02f7cd5..69d96f1 100644
> --- a/libgcc/config/mips/linux-unwind.h
> +++ b/libgcc/config/mips/linux-unwind.h
> @@ -75,7 +75,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
>        struct rt_sigframe {
>   u_int32_t ass[4];  /* Argument save space for o32.  */
>   u_int32_t trampoline[2];
> - struct siginfo info;
> + siginfo_t info;
>   _sig_ucontext_t uc;
>        } *rt_ = context->cfa;
>        sc = &rt_->uc.uc_mcontext;
> diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
> index a0560e9..dd8f590 100644
> --- a/libgcc/config/pa/linux-unwind.h
> +++ b/libgcc/config/pa/linux-unwind.h
> @@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
>    int i;
>    struct sigcontext *sc;
>    struct rt_sigframe {
> -    struct siginfo info;
> +    siginfo_t info;
>      struct ucontext uc;
>    } *frame;
>  
> diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
> index 94ed95d..c1e1adb 100644
> --- a/libgcc/config/sh/linux-unwind.h
> +++ b/libgcc/config/sh/linux-unwind.h
> @@ -80,9 +80,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
>     && (*(unsigned long *) (pc+11)  == 0x6ff0fff0))
>      {
>        struct rt_sigframe {
> - struct siginfo *pinfo;
> + siginfo_t *pinfo;
>   void *puc;
> - struct siginfo info;
> + siginfo_t info;
>   struct ucontext uc;
>        } *rt_ = context->cfa;
>        /* The void * cast is necessary to avoid an aliasing warning.
> @@ -179,7 +179,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
>   && (*(unsigned short *) (pc+14)  == 0x00ad))))
>      {
>        struct rt_sigframe {
> - struct siginfo info;
> + siginfo_t info;
>   struct ucontext uc;
>        } *rt_ = context->cfa;
>        /* The void * cast is necessary to avoid an aliasing warning.
> diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
> index 0ed662c..27a6c43 100644
> --- a/libgcc/config/tilepro/linux-unwind.h
> +++ b/libgcc/config/tilepro/linux-unwind.h
> @@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
>  
>    struct rt_sigframe {
>      unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
> -    struct siginfo info;
> +    siginfo_t info;
>      struct ucontext uc;
>    } *rt_;
>  
> diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
> index 32e9349..dda1f29 100644
> --- a/libgcc/config/xtensa/linux-unwind.h
> +++ b/libgcc/config/xtensa/linux-unwind.h
> @@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
>    struct sigcontext *sc;
>  
>    struct rt_sigframe {
> -    struct siginfo info;
> +    siginfo_t info;
>      struct ucontext uc;
>    } *rt_;
>  

Grüße,
 Thomas

attachment0 (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Ian Lance Taylor
In reply to this post by Thomas Schwinge-8
Thomas Schwinge <[hidden email]> writes:

> libgcc/
> * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
> siginfo_t instead of struct siginfo.
> * config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
> * config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
> * config/ia64/linux-unwind.h (ia64_fallback_frame_state)
> (ia64_handle_unwabi): Likewise.
> * config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
> * config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
> * config/sh/linux-unwind.h (shmedia_fallback_frame_state)
> (sh_fallback_frame_state): Likewise.
> * config/tilepro/linux-unwind.h (tile_fallback_frame_state): Likewise.
> * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.

This is OK for mainline and release branches.

Thanks.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: struct siginfo vs. siginfo_t

Thomas Schwinge-8
Hi!

Sorry for the delay.

On Tue, 27 Mar 2012 05:34:30 -0700, Ian Lance Taylor <[hidden email]> wrote:

> Thomas Schwinge <[hidden email]> writes:
>
> > libgcc/
> > * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
> > siginfo_t instead of struct siginfo.
> > * config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
> > * config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
> > * config/ia64/linux-unwind.h (ia64_fallback_frame_state)
> > (ia64_handle_unwabi): Likewise.
> > * config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
> > * config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
> > * config/sh/linux-unwind.h (shmedia_fallback_frame_state)
> > (sh_fallback_frame_state): Likewise.
> > * config/tilepro/linux-unwind.h (tile_fallback_frame_state): Likewise.
> > * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
>
> This is OK for mainline and release branches.
Now committed to GCC trunk (r186610), gcc-4_7-branch (r186611), and
trivially ported (libgcc/ -> gcc/) to gcc-4_6-branch (r186612), and
gcc-4_5-branch (r186613).


Grüße,
 Thomas

attachment0 (499 bytes) Download Attachment