From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1875 invoked by alias); 1 Nov 2012 07:47:26 -0000 Received: (qmail 1826 invoked by uid 22791); 1 Nov 2012 07:47:25 -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, 01 Nov 2012 07:47:19 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TTpUl-0003hg-13 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 01 Nov 2012 00:47:19 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 1 Nov 2012 00:47:18 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Thu, 1 Nov 2012 00:47:17 -0700 From: Yao Qi To: Subject: [PATCH 4/6] Remove 'substruct_type' and 'subfieldno'. Date: Thu, 01 Nov 2012 07:47:00 -0000 Message-ID: <1351756007-18242-5-git-send-email-yao@codesourcery.com> In-Reply-To: <1351756007-18242-1-git-send-email-yao@codesourcery.com> References: <1351756007-18242-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain 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/msg00008.txt.bz2 gdb: 2012-11-01 Yao Qi * eval.c (evaluate_struct_tuple): Replace 'substruct_type' with 'struct_type'. Replace 'subfieldno' with 'fieldno'. --- gdb/eval.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/gdb/eval.c b/gdb/eval.c index 3eb4896..62b26a9 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -287,10 +287,8 @@ evaluate_struct_tuple (struct value *struct_val, int *pos, enum noside noside, int nargs) { struct type *struct_type = check_typedef (value_type (struct_val)); - struct type *substruct_type = struct_type; struct type *field_type; int fieldno = -1; - int subfieldno = -1; while (--nargs >= 0) { @@ -306,7 +304,6 @@ evaluate_struct_tuple (struct value *struct_val, && field_is_static (&TYPE_FIELD (struct_type, fieldno))) fieldno++; - subfieldno = fieldno; if (fieldno >= TYPE_NFIELDS (struct_type)) error (_("too many initializers")); field_type = TYPE_FIELD_TYPE (struct_type, fieldno); @@ -325,7 +322,7 @@ evaluate_struct_tuple (struct value *struct_val, subfieldno is the index of the actual real (named inner) field in substruct_type. */ - field_type = TYPE_FIELD_TYPE (substruct_type, subfieldno); + field_type = TYPE_FIELD_TYPE (struct_type, fieldno); if (val == 0) val = evaluate_subexp (field_type, exp, pos, noside); @@ -335,7 +332,7 @@ evaluate_struct_tuple (struct value *struct_val, if (value_type (val) != field_type) val = value_cast (field_type, val); - bitsize = TYPE_FIELD_BITSIZE (substruct_type, subfieldno); + bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno); bitpos = TYPE_FIELD_BITPOS (struct_type, fieldno); addr = value_contents_writeable (struct_val) + bitpos / 8; if (bitsize) -- 1.7.7.6