From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101619 invoked by alias); 20 Jan 2016 18:56:21 -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 101599 invoked by uid 89); 20 Jan 2016 18:56:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=customization X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 20 Jan 2016 18:56:20 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 025ABC0A15FF; Wed, 20 Jan 2016 18:56:19 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0KIuHMT022611; Wed, 20 Jan 2016 13:56:17 -0500 Message-ID: <569FD851.2010108@redhat.com> Date: Wed, 20 Jan 2016 18:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Walfred Tedeschi , eliz@gnu.org, brobecker@adacore.com CC: gdb-patches@sourceware.org Subject: Re: [PATCH V3 2/6] Prepararion for new siginfo on Linux. References: <1453105544-30866-1-git-send-email-walfred.tedeschi@intel.com> <1453105544-30866-3-git-send-email-walfred.tedeschi@intel.com> In-Reply-To: <1453105544-30866-3-git-send-email-walfred.tedeschi@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-01/txt/msg00490.txt.bz2 On 01/18/2016 08:25 AM, Walfred Tedeschi wrote: > First add new structure and function to allow architecture customization > for the siginfo structure. > > 2016-01-15 Walfred Tedeschi > > gdb/ChangeLog: > > * linux-tdep.h (linux_siginfo_extra_field_values): New enum values. > (linux_siginfo_extra_fields): New enum type. > * linux-tdep.c (linux_get_siginfo_type_with_fields): New function. > (linux_get_siginfo_type): Use new function. > > --- > gdb/linux-tdep.c | 16 +++++++++++++--- > gdb/linux-tdep.h | 10 ++++++++++ > 2 files changed, 23 insertions(+), 3 deletions(-) > > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index 29f5f3c..48bed11 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -243,11 +243,12 @@ get_linux_inferior_data (void) > return info; > } > > -/* This function is suitable for architectures that don't > - extend/override the standard siginfo structure. */ > +/* This function is suitable for architectures that > + extend/override the standard siginfo in an specific way. */ "a specific" > > static struct type * > -linux_get_siginfo_type (struct gdbarch *gdbarch) > +linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, > + linux_siginfo_extra_fields extra_fields) > { > struct linux_gdbarch_data *linux_gdbarch_data; > struct type *int_type, *uint_type, *long_type, *void_ptr_type; > @@ -364,6 +365,15 @@ linux_get_siginfo_type (struct gdbarch *gdbarch) > return siginfo_type; > } > > +/* This function is suitable for architectures that don't > + extend/override the standard siginfo structure. */ > + > +static struct type * > +linux_get_siginfo_type (struct gdbarch *gdbarch) > +{ > + return linux_get_siginfo_type_with_fields (gdbarch, 0); > +} > + > /* Return true if the target is running on uClinux instead of normal > Linux kernel. */ > > diff --git a/gdb/linux-tdep.h b/gdb/linux-tdep.h > index 328c7f0..98a17fa 100644 > --- a/gdb/linux-tdep.h > +++ b/gdb/linux-tdep.h > @@ -24,6 +24,16 @@ > > struct regcache; > > +/* Enum used to define which kind of siginfo is used by the architecture. */ /* Enum used to define the extra fields of the siginfo type used by an architecture. */ > +enum linux_siginfo_extra_field_values > +{ > + /* Add bound fields into the segmentation fault fields. */ "segmentation fault field." > + LINUX_SIGINFO_FIELD_ADDR_BND = 1 > +}; > + > +/* Defines a type for the values defined in linux_siginfo_extra_field_values. */ > +DEF_ENUM_FLAGS_TYPE (enum linux_siginfo_extra_field_values, linux_siginfo_extra_fields); > + Line too long. > typedef char *(*linux_collect_thread_registers_ftype) (const struct regcache *, > ptid_t, > bfd *, char *, int *, > Otherwise OK. Thanks, Pedro Alves