From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83820 invoked by alias); 18 Sep 2018 23:26:10 -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 83810 invoked by uid 89); 18 Sep 2018 23:26:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*u:6.1, H*UA:6.1 X-HELO: userp2130.oracle.com Received: from userp2130.oracle.com (HELO userp2130.oracle.com) (156.151.31.86) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Sep 2018 23:26:08 +0000 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8INOUxt059446; Tue, 18 Sep 2018 23:26:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=W6LWyYEb4e8tvGxnsmaiRdWYF+ZXtqOghxPd9rE4WH8=; b=446vglvOJ53dSQ0vw3NNeW6AP1kZVz1R4uGo5nnLTxx2yauxSNfcMVX1TLOJVbcOgsHM MON+qkHPSsSBYaU7A7uj/0P32e9NvGAD8WACTTBXV1+PHJNs6aWs8wIaiqionguvICCQ ed4sXSFgISJ9I+4MrGaQgz3zqRmHj6cib9RsmKvI/tx/PDNDfV/1oTgzo5BddyfvI6pn DKMm74dQmpstrCaSs5wPb4gYuJlJwDHY0N/MXkXWvU09r0tGfyxdfQafLPlPQfJ3sMY8 0zjULH3hOQnb6Qm6PchfqDJted3Rs5li14OqboFvehjBlcnP+WfbyKtAkIZJwLeCDlp9 Ig== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2mgsgtqk75-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Sep 2018 23:26:06 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w8INQ0OT009898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Sep 2018 23:26:00 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8INPxmX030783; Tue, 18 Sep 2018 23:26:00 GMT Received: from [10.132.96.98] (/10.132.96.98) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Sep 2018 16:25:59 -0700 Subject: Re: [PATCH v3 PR gdb/16841] virtual inheritance via typedef cannot find base To: Tom Tromey Cc: gdb-patches@sourceware.org References: <1536800471-78975-1-git-send-email-weimin.pan@oracle.com> <87r2hrt3s6.fsf@tromey.com> From: Weimin Pan Message-ID: <8c8e0eb6-245c-40c0-456e-9f49ccb92b74@oracle.com> Date: Tue, 18 Sep 2018 23:26:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <87r2hrt3s6.fsf@tromey.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2018-09/txt/msg00666.txt.bz2 On 9/18/2018 4:59 AM, Tom Tromey wrote: >>>>>> ">" == Weimin Pan writes: >>> +2018-09-12 Weimin Pan >>> + >>> + PR gdb/16841 > This should read "PR c++/16841". The robot doesn't care but I suppose > it's a bit clearer for humans. Done. >>> + PR gdb/16841 > Here too. Done. >>> + gdb_test "print ${scope}d" " = 6.5999999999999996" > It's best with floats to use a number that is exact. > So, instead of 6.6, 6.25 or something like that. Using 6.6 will result in an inexact number as well. Will change it to "6.25". > The code has a loop to deal with multiple inheritance but the test > doesn't exercise this case. I think an additional for that would be > good. Sorry, which case is not exercised? Could it be printing superbase class member in base? >>> + if (get_baseclass_offset (domain, curtype, v, &boff, >>> + &isvirt)) >>> + mem_offset += boff; >>> + else >>> + { >>> + struct type *t = check_typedef (value_type (this_v)); >>> + t = check_typedef (TYPE_TARGET_TYPE (t)); >>> + if (get_baseclass_offset (t, curtype, this_v, >>> + &boff, &isvirt)) >>> + mem_offset += boff; > Could you explain this "else" block? I did not understand the reason > for it. I suppose it could use a comment. There is a brief comment:                     /* Find class offset of type CURTYPE from either its                          parent type DOMAIN or the type of implied this.  */ i.e. trying to find the class offset for CURTYPE first from its parent type DOMAIN. If failed,  try to find it from the type of the implied this. Thanks for your comments. Weimin > > thanks, > Tom