From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15660 invoked by alias); 29 Nov 2012 07:46:33 -0000 Received: (qmail 15635 invoked by uid 22791); 29 Nov 2012 07:46:31 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 07:46:26 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TdypF-0005fX-Kq from Yao_Qi@mentor.com ; Wed, 28 Nov 2012 23:46:25 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 28 Nov 2012 23:46:25 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Wed, 28 Nov 2012 23:46:23 -0800 Message-ID: <50B712B2.9020900@codesourcery.com> Date: Thu, 29 Nov 2012 07:46:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Tom Tromey CC: Subject: Re: [committed]: [PATCH 0/4] Fix member pointer bugs References: <1353569539-744-1-git-send-email-yao@codesourcery.com> <50B473AC.5070604@codesourcery.com> <8738ztbx9b.fsf@fleche.redhat.com> <50B62A3C.2060202@codesourcery.com> <87y5hladko.fsf@fleche.redhat.com> In-Reply-To: <87y5hladko.fsf@fleche.redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 X-SW-Source: 2012-11/txt/msg00843.txt.bz2 On 11/29/2012 12:37 AM, Tom Tromey wrote: > index 55582e0..faad9e3 100644 > --- a/gdb/eval.c > +++ b/gdb/eval.c > @@ -1410,7 +1410,7 @@ evaluate_subexp_standard (struct type *expect_type, > > mem_offset = value_as_long (arg1); > > - arg1 = value_from_pointer (type_ptr, > + arg1 = value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)), > value_as_long (arg2) + mem_offset); > arg1 = value_ind (arg1); > tem = 1; TYPE_TARGET_TYPE (type) was used in my first post, but it was replaced by TYPE_DOMAIN_TYPE (type) by mistake in my follow-up patch, which is to shorten the line. I didn't run regression test again after the change. Thanks for pointing this out. The patch below is the same to yours, but shorten the line by defining a new local variable. Regression tested on x86_64-linux. Committed. -- Yao (齐尧) gdb: 2012-11-29 Yao Qi Tom Tromey * eval.c (evaluate_subexp_standard): Get the correct pointer type for TYPE_CODE_MEMBERPTR. --- gdb/eval.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/gdb/eval.c b/gdb/eval.c index 55582e0..7d48d7e 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1404,13 +1404,15 @@ evaluate_subexp_standard (struct type *expect_type, { struct type *type_ptr = lookup_pointer_type (TYPE_DOMAIN_TYPE (type)); + struct type *target_type_ptr + = lookup_pointer_type (TYPE_TARGET_TYPE (type)); /* Now, convert these values to an address. */ arg2 = value_cast (type_ptr, arg2); mem_offset = value_as_long (arg1); - arg1 = value_from_pointer (type_ptr, + arg1 = value_from_pointer (target_type_ptr, value_as_long (arg2) + mem_offset); arg1 = value_ind (arg1); tem = 1; -- 1.7.7.6