From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32830 invoked by alias); 7 Nov 2016 14:40:52 -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 32794 invoked by uid 89); 7 Nov 2016 14:40:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_50,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:corp, Fred, Amtsgericht, amtsgericht X-HELO: mga06.intel.com Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Nov 2016 14:40:38 +0000 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 07 Nov 2016 06:40:35 -0800 X-ExtLoop1: 1 Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga006.fm.intel.com with ESMTP; 07 Nov 2016 06:40:34 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.49]) by IRSMSX151.ger.corp.intel.com ([169.254.4.28]) with mapi id 14.03.0248.002; Mon, 7 Nov 2016 14:40:33 +0000 From: "Tedeschi, Walfred" To: John Baldwin , "gdb-patches@sourceware.org" CC: "palves@redhat.com" , "eliz@gnu.org" , "brobecker@adacore.com" Subject: RE: [PATCH 2/2] amd64-linux: expose system register FS_BASE and GS_BASE for Linux. Date: Mon, 07 Nov 2016 14:40:00 -0000 Message-ID: References: <1478166445-21370-1-git-send-email-walfred.tedeschi@intel.com> <1478166445-21370-3-git-send-email-walfred.tedeschi@intel.com> <10348831.DcNpOF0W33@ralph.baldwin.cx> In-Reply-To: <10348831.DcNpOF0W33@ralph.baldwin.cx> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-11/txt/msg00137.txt.bz2 > diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index=20 > 3f2a92b..a8a0b79 100644 > --- a/gdb/amd64-linux-tdep.c > +++ b/gdb/amd64-linux-tdep.c > @@ -1872,6 +1881,18 @@ amd64_linux_init_abi (struct gdbarch_info info, st= ruct gdbarch *gdbarch) > tdesc =3D tdesc_amd64_linux; > tdep->tdesc =3D tdesc; >=20=20 > + feature =3D tdesc_find_feature (tdesc, "org.gnu.gdb.i386.segments");= =20=20 > + if (feature !=3D NULL) > + { > + struct tdesc_arch_data *tdesc_data_segments > + =3D (struct tdesc_arch_data *) info.tdep_info; > + > + tdesc_numbered_register (feature, tdesc_data_segments, > + AMD64_FSBASE_REGNUM, "fs_base"); > + tdesc_numbered_register (feature, tdesc_data_segments, > + AMD64_GSBASE_REGNUM, "gs_base"); > + } > + > feature =3D tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux"); > if (feature =3D=3D NULL) > return; Should this be done in the OS-independent amd64_init_abi() instead? FreeBSD also has ptrace operations to get/set the FS and GS base registers = (which I will add as a followup once this series is committed). John, Thanks for the review! :) I can place the code there. I also have to change fix a regression on a tes= t on gcore. Next review I do in the way you proposed. I can also place the changes in a= dedicated branch if it helps. Thanks and regards, Fred 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