From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98170 invoked by alias); 27 Jan 2019 04:22:35 -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 72401 invoked by uid 89); 27 Jan 2019 03:47:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=connect, silly X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 27 Jan 2019 03:47:19 +0000 Received: from [10.0.0.178] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id DD4F11E077; Sat, 26 Jan 2019 22:47:17 -0500 (EST) Subject: Re: [PATCH 1/9] Support the fs_base and gs_base registers on i386. To: John Baldwin , gdb-patches@sourceware.org References: From: Simon Marchi Message-ID: <5c89f494-c6a9-37fc-bfdf-954d27f0f026@simark.ca> Date: Sun, 27 Jan 2019 04:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-01/txt/msg00572.txt.bz2 On 2019-01-22 1:42 p.m., John Baldwin wrote: > As on amd64, these registers hold the base address of the fs and gs > segments, respectively. For i386 these two registers are 32 bits. I just started to look at this, still trying to get my head around it and connect all the dots. Just a silly question for now: > diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c > index d4143ae155..1eb0bcdf17 100644 > --- a/gdb/amd64-tdep.c > +++ b/gdb/amd64-tdep.c > @@ -3107,15 +3107,7 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch, > > if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.segments") != NULL) > { > - const struct tdesc_feature *feature = > - tdesc_find_feature (tdesc, "org.gnu.gdb.i386.segments"); > - struct tdesc_arch_data *tdesc_data_segments = > - (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"); > + tdep->fsbase_regnum = AMD64_FSBASE_REGNUM; > } Can you explain what this change does and why it is needed? I am a bit lost. I see you add something equivalent in i386-tdep.c, but as far as I know, they are completely separate. Simon