From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123696 invoked by alias); 8 Mar 2019 18:39:44 -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 123215 invoked by uid 89); 8 Mar 2019 18:39:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx2.freebsd.org Received: from mx2.freebsd.org (HELO mx2.freebsd.org) (8.8.178.116) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Mar 2019 18:39:43 +0000 Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 7BF518A661; Fri, 8 Mar 2019 18:39:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97DDD85F0A; Fri, 8 Mar 2019 18:39:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 322541906B; Fri, 8 Mar 2019 18:39:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH v2 06/11] Add a more general version of lookup_struct_elt_type. To: Pedro Alves , Simon Marchi , gdb-patches@sourceware.org References: <9a5a86e3591c8fe6c0fc8efb6151547902a63d3c.1549672588.git.jhb@FreeBSD.org> <1e84fa17-adf6-186f-843c-e4f7a6dd7e7b@FreeBSD.org> <3de20033-411d-643b-d120-19a49f8815dc@redhat.com> From: John Baldwin Openpgp: preference=signencrypt Message-ID: Date: Fri, 08 Mar 2019 18:39:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <3de20033-411d-643b-d120-19a49f8815dc@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 97DDD85F0A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00190.txt.bz2 On 3/7/19 4:32 PM, Pedro Alves wrote: > On 03/08/2019 12:04 AM, John Baldwin wrote: >> On 3/7/19 7:53 AM, Simon Marchi wrote: >>> Not really a big deal, but I find it a bit overkill to define a type >>> just for this, I would have probably just returned the the offset as an >>> output parameter. But maybe this way is better, in that if we want to >>> add something to the return type, we don't have to update the callers. >> >> Honestly, I just modeled this after the similar code in the Linux >> kernel thread patches. Using a reference parameter for the offset >> would be fine and I don't mind making that change. I don't think that >> we are going to add more things to that structure in the future. The >> field generally has everything else you want to know other than the >> offset. >> > > Note that you can keep the struct with just the data fields > and no ctor boilerplate if you use brace initialization. Thanks, I've made this change and also fixed the missing space. -- John Baldwin