From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95837 invoked by alias); 6 Aug 2018 18:27:30 -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 95828 invoked by uid 89); 6 Aug 2018 18:27:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.2 spammy=collects, carefully, bigger X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Aug 2018 18:27:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1533580046; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gF99EHuz5WUR8hDNgndCnXP3yPr6jK1qaKxCyctY2Co=; b=T/jBxn6G0GxQy7EA+ipQp3F6VkPYwig/awoctVff3wpu5NTuwnr/1wxNgzliXnF5 sVgI+8/4WpS2XwAGAWYNX0nmefYs2E7PEedRixjZGKf9hj+gjFWVqRfX0+EDWDiA NOD8mg2/nYr1pzMMrmjhiglRw09o4B+vZWfopqY+K3o=; Received: from ESESSMB504.ericsson.se (Unknown_Domain [153.88.183.122]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id CC.70.22015.E03986B5; Mon, 6 Aug 2018 20:27:26 +0200 (CEST) Received: from ESESBMR501.ericsson.se (153.88.183.129) by ESESSMB504.ericsson.se (153.88.183.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 6 Aug 2018 20:27:24 +0200 Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESBMR501.ericsson.se (153.88.183.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 6 Aug 2018 20:27:24 +0200 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB505.ericsson.se (153.88.183.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Mon, 6 Aug 2018 20:27:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VjrFHxA+fxqSs+cpCso78wWhYqv2HMBXh12mN7lVUKo=; b=mcvgdbQCy5PTbh7dsXXnN92s9xBAtsetZHPDAJzTM/bcoc6dz/Qn5JuVlWmbJxlc/HpqKjDeM9aJCwdL980uTFObeARyZBw0qNwI4D/uynvsaueUcLk/nuphH5rogjUmH/DLgW4p03I5t5PyED8dCVFr8gRElXuiVy9w5ysFcUI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [142.133.48.222] (192.75.88.130) by SN6PR15MB2399.namprd15.prod.outlook.com (2603:10b6:805:24::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Mon, 6 Aug 2018 18:27:21 +0000 Subject: Re: [PATCH v2 1/3] Add min size to regset section iterations To: Alan Hayward , CC: References: <20180730092528.98739-1-alan.hayward@arm.com> <20180730092528.98739-2-alan.hayward@arm.com> From: Simon Marchi Message-ID: <045ba9b9-6f37-0eeb-5609-f895e29f894f@ericsson.com> Date: Mon, 06 Aug 2018 18:27:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180730092528.98739-2-alan.hayward@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-Path: simon.marchi@ericsson.com Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00099.txt.bz2 On 2018-07-30 05:25 AM, Alan Hayward wrote: > When using the regset section iteration functions, the size parameter is used > in different ways. > > With collect, size is used to create the buffer in which to write the regset. > (see linux-tdep.c::linux_collect_regset_section_cb). > > With supply, size is used to confirm the existing regset is the correct size. > If REGSET_VARIABLE_SIZE is set then the regset can be bigger than size. > Effectively, size is the minimum possible size of the regset. > (see corelow.c::get_core_register_section). > > There are currently no targets with both REGSET_VARIABLE_SIZE and a collect > function. > > To allow support of collects for REGSET_VARIABLE_SIZE we need two sizes. > Min_size is the minimum allowed size for the regset, and size is used as the > size to use when creating new regsets. For all targets that are not > REGSET_VARIABLE_SIZE then these two sizes are equal. Hi Alan, I am still a bit confused by how these two sizes are used. Please document carefully what they each mean, for both the collect and supply case. Part of my confusion comes the fact that for Aarch64 SVE, we seem to know in advance the exact size the SVE register section should have, based on vq (which we read in aarch64_linux_core_read_vq). In this case, the single size parameter would be enough for collecting and supplying, since it's the exact size (not a minimum size). > diff --git a/gdb/corelow.c b/gdb/corelow.c > index 059ce2f6eb..32a054ee3e 100644 > --- a/gdb/corelow.c > +++ b/gdb/corelow.c > @@ -107,6 +107,7 @@ public: > const struct regset *regset, > const char *name, > int min_size, > + int size, > int which, > const char *human_name, > bool required); > @@ -570,12 +571,13 @@ core_target::get_core_register_section (struct regcache *regcache, > const struct regset *regset, > const char *name, > int min_size, > + int size, > int which, > const char *human_name, > bool required) > {> struct bfd_section *section; > - bfd_size_type size; > + bfd_size_type core_size; I would suggest naming this "section_size", or "reg_section_size". At first I thought it meant the size of the whole core file. You could push this rename as an obvious patch right now to reduce the noise in this patch, since it's a good change on its own. Simon