From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28975 invoked by alias); 1 Dec 2015 10:08:37 -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 28958 invoked by uid 89); 1 Dec 2015 10:08:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_40,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga14.intel.com Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Dec 2015 10:08:33 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 01 Dec 2015 02:08:32 -0800 X-ExtLoop1: 1 Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga001.jf.intel.com with ESMTP; 01 Dec 2015 02:08:31 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.138]) by IRSMSX154.ger.corp.intel.com ([169.254.12.98]) with mapi id 14.03.0248.002; Tue, 1 Dec 2015 10:08:28 +0000 From: "Tedeschi, Walfred" To: Pedro Alves , "Yao Qi (qiyaoltc@gmail.com)" CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH v1] Synchronize siginfo type described in GDB with the kernel and glibc ones. Date: Tue, 01 Dec 2015 10:08:00 -0000 Message-ID: References: <1445864086-4831-1-git-send-email-walfred.tedeschi@intel.com> <1445864086-4831-3-git-send-email-walfred.tedeschi@intel.com> <20151118230151.GA7958@adacore.com> <564DCE42.5060000@redhat.com> <564E01BC.4030402@redhat.com> In-Reply-To: <564E01BC.4030402@redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00001.txt.bz2 Hello Pedro, Thanks a lot for your feedback! Moving forward on this patch I observed that there is fixup for 32 and x32 = on gdbserver and gdb side. I suppose we should join both implementation so we patch only once every t= ime! :) To do that I was wondering where should be the appropriated place, the "nat= " or the "common" folder. Thanks and regards, -Fred -----Original Message----- From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware= .org] On Behalf Of Pedro Alves Sent: Thursday, November 19, 2015 6:07 PM To: Tedeschi, Walfred; Joel Brobecker; Yao Qi (yao@c= odesourcery.com) Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v1] Synchronize siginfo type described in GDB with the = kernel and glibc ones. On 11/19/2015 04:40 PM, Tedeschi, Walfred wrote: > Pedro, >=20 > If I understood you right you are in favour of keeping the siginfo as glo= bal one? > In case this is correct, I will start working on the code you pointed out. I favor not querying whether the running x86 kernel supports the extra fiel= d. But I wouldn't say I'm in favor of exposing the field in all targets -- mor= e like, if it's hard and we really want to be lazy, I see no real big harm = in making the change affect all archs, though I'd mildly prefer making the = change be x86-specific, like glibc did. I actually think it'd be simple. = IIRC, Yao already suggested how to do it without much changes. Simply rena= me the existing linux_get_siginfo_type function, and add a new parameter th= at allows saying "I want field X". Then the x86 version can install a sigi= nfo type with the field, while other ports not. e.g., enum linux_siginfo_extra_field_values { LINUX_SIGINFO_FIELD_ADDR_BND =3D 1, ... }; DEF_ENUM_FLAGS_TYPE (enum linux_siginfo_extra_field_values, linux_siginfo_e= xtra_fields); static struct type * linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, linux_siginfo_extra_fields extra_fields= ) { ... if ((extra_fields & LINUX_SIGINFO_FIELD_ADDR_BND) !=3D 0) { ... } } static struct type * linux_get_siginfo_type (struct gdbarch *gdbarch) { return linux_get_siginfo_type_with_fields (gdbarch, 0); } x86: x86_linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch, linux_siginfo_extra_fields extra_fi= elds) { return linux_get_siginfo_type_with_fields (gdbarch, LINUX_SIGINFO_FIELD_ADDR_BND)= ; } ... set_gdbarch_get_siginfo_type (gdbarch, x86_linux_get_siginfo_type_with_fiel= ds); ... >=20 > What I could see from the glibc code the structure is reset via memset. Actually, gdb reads the siginfo object out of the kernel directly, so whate= ver glibc does has no bearing here. The question is whether the kernel rea= lly shows garbage in those fields when si_code is not 3, or whether it alwa= ys pre-fills the siginfo objects (including the padding) with zeroes. >=20 > Thanks a lot for your feedback!=20 > Muito obrigado! You're welcome. De nada. ;-) Thanks, Pedro Alves Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928