From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10120 invoked by alias); 11 Mar 2013 13:39:20 -0000 Received: (qmail 10015 invoked by uid 22791); 11 Mar 2013 13:39:18 -0000 X-SWARE-Spam-Status: No, hits=-4.6 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; Mon, 11 Mar 2013 13:39:01 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UF2wO-0002P2-1U from Yao_Qi@mentor.com ; Mon, 11 Mar 2013 06:39:00 -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); Mon, 11 Mar 2013 06:38:59 -0700 Received: from qiyao.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; Mon, 11 Mar 2013 06:38:59 -0700 Message-ID: <513DDE2C.9080109@codesourcery.com> Date: Mon, 11 Mar 2013 13:39:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Hui Zhu CC: gdb-patches ml , Joel Brobecker Subject: Re: [PATCH] Fix agent code generate bug of ref References: In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed 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: 2013-03/txt/msg00460.txt.bz2 On 03/10/2013 01:00 PM, Hui Zhu wrote: > @@ -2929,7 +2929,7 @@ dwarf2_compile_expr_to_ax (struct agent_ > if (op == DW_OP_deref_size) > size = *op_ptr++; > else > - size = addr_size; > + size = addr_size_bits; The problem here is SIZE is "size in bytes", but > > switch (size) > { SIZE is checked as "size in bits". Your fix is right, but not complete. We also have to fix it when op is DW_OP_deref_size, something like the patch below. I am not familiar with this area, so I might be wrong. -- Yao (齐尧) @@ -2931,7 +2931,7 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc, else size = addr_size; - switch (size) + switch (size * TARGET_CHAR_BIT) { case 8: ax_simple (expr, aop_ref8);