From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22389 invoked by alias); 3 Dec 2013 17:06:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 22375 invoked by uid 89); 3 Dec 2013 17:06:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Dec 2013 17:06:11 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB3H61GI014498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Dec 2013 12:06:01 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rB3H5x8W013042; Tue, 3 Dec 2013 12:06:00 -0500 Message-ID: <529E0F77.6030608@redhat.com> Date: Tue, 03 Dec 2013 17:06:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: "Jose E. Marchesi" CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Support for the $_siginfo convenience var in sparc64 References: <8761sptppx.fsf@oracle.com> <52667BC5.2050300@redhat.com> <87zjq1s9ww.fsf@oracle.com> <87d2lew3fb.fsf@oracle.com> In-Reply-To: <87d2lew3fb.fsf@oracle.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00087.txt.bz2 On 12/03/2013 11:59 AM, Jose E. Marchesi wrote: > > ping > > > The following patch adds support for the $_siginfo convenience variable > > to sparc64-*-linux-gnu targets. > > I take it from the patch that linux-tdep.c:linux_get_siginfo_type wouldn't > work for sparc64? Why is that? What's different? > > These are the differences of glibc's bits/siginfo.h in sparc with > respect to bits/siginfo.h in x86: > > - The _sigfault struct has an additional field `int si_trapno'. > - The `si_band' field in the `_sigpoll' struct is of type `int' instead > of `long int'. > > It would be nice to avoid all that code repetition, but since glibc > maintains per-target bits/signinfo.h files more differences could be > introduced in the future... It just looks like the glibc code is waiting to be cleaned up: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $ diff -up ./sysdeps/unix/sysv/linux/bits/siginfo.h ./sysdeps/unix/sysv/linux/sparc/bits/siginfo.h -/* siginfo_t, sigevent and constants. Linux version. +/* siginfo_t, sigevent and constants. Linux/SPARC version. Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -95,13 +95,14 @@ typedef struct struct { void *si_addr; /* Faulting insn/memory ref. */ + int si_trapno; short int si_addr_lsb; /* Valid LSB of the reported address. */ } _sigfault; /* SIGPOLL. */ struct { - long int si_band; /* Band event for SIGPOLL. */ + int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On the kernel side, archs just define a couple macros for those minor differences, sharing most of the definitions: http://lxr.free-electrons.com/source/include/uapi/asm-generic/siginfo.h 28 29 /* 30 * The default "si_band" type is "long", as specified by POSIX. 31 * However, some architectures want to override this to "int" 32 * for historical compatibility reasons, so we allow that. 33 */ 34 #ifndef __ARCH_SI_BAND_T 35 #define __ARCH_SI_BAND_T long 36 #endif ... 87 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 88 struct { 89 void __user *_addr; /* faulting insn/memory ref. */ 90 #ifdef __ARCH_SI_TRAPNO 91 int _trapno; /* TRAP # which caused the signal */ 92 #endif Seems like we should be able to share similarly (though with runtime switches, of course). -- Pedro Alves