From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34174 invoked by alias); 11 Feb 2019 10:27:43 -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 34165 invoked by uid 89); 11 Feb 2019 10:27:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=John, jon, tuple X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Feb 2019 10:27:41 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1BAOLZJ086327 for ; Mon, 11 Feb 2019 05:27:40 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qk507xgtt-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Feb 2019 05:27:40 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Feb 2019 10:27:37 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 11 Feb 2019 10:27:35 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1BARY8E53739742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 11 Feb 2019 10:27:34 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E4ED42049; Mon, 11 Feb 2019 10:27:34 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3CDFF42045; Mon, 11 Feb 2019 10:27:34 +0000 (GMT) Received: from laptop-ibm (unknown [9.152.212.134]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 11 Feb 2019 10:27:34 +0000 (GMT) Date: Mon, 11 Feb 2019 10:27:00 -0000 From: Philipp Rudo To: John Baldwin Cc: Omair Javaid , gdb-patches@sourceware.org Subject: Re: [PATCH v2 06/11] Add a more general version of lookup_struct_elt_type. In-Reply-To: References: <9a5a86e3591c8fe6c0fc8efb6151547902a63d3c.1549672588.git.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit x-cbid: 19021110-0016-0000-0000-00000254F9D5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021110-0017-0000-0000-000032AF1491 Message-Id: <20190211112733.698a1b72@laptop-ibm> X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00117.txt.bz2 Hey Jon On Fri, 8 Feb 2019 17:07:22 -0800 John Baldwin wrote: > On 2/8/19 4:40 PM, John Baldwin wrote: > > lookup_struct_elt is a new function which returns a tuple of > > information about a component of a structure or union. The returned > > tuple contains a pointer to the struct field object for the component > > as well as a bit offset of that field within the structure. If the > > field names a field in an anonymous substructure, the offset is the > > "global" offset relative to the original structure type. If noerr is > > set, then the returned tuple will set the field pointer to NULL to > > indicate a missing component rather than throwing an error. > > > > lookup_struct_elt_type is now reimplemented in terms of this new > > function. It simply returns the type of the returned field. > > Hopefully this is close enough to lk_find_field that you can reuse it. > One difference is that it defines its own dedicated type and the second is > that it returns the raw bitpos so that it is hopefully easier to reuse in > other places. I think you can probably call it and just pass the members > the returned structure (with an added divide for the offset to convert to > bytes) to construct an lk_symbol. sorry, I totally missed your v1. The patch looks sane to me. It should be possible to use it in lk_find_field. I'm not fully sure what the 'check on baseclasses' does for C structs, but I guess it doesn't harm. Otherwise there would have already been an outcry :) Thanks Philipp