From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18092 invoked by alias); 12 Mar 2013 02:22:41 -0000 Received: (qmail 18079 invoked by uid 22791); 12 Mar 2013 02:22:40 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com) (209.85.214.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Mar 2013 02:22:27 +0000 Received: by mail-ob0-f171.google.com with SMTP id x4so4029460obh.30 for ; Mon, 11 Mar 2013 19:22:26 -0700 (PDT) X-Received: by 10.60.29.194 with SMTP id m2mr10405860oeh.36.1363054946567; Mon, 11 Mar 2013 19:22:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.60.7 with HTTP; Mon, 11 Mar 2013 19:21:46 -0700 (PDT) In-Reply-To: <87r4jmngr5.fsf@fleche.redhat.com> References: <513DDE2C.9080109@codesourcery.com> <87r4jmngr5.fsf@fleche.redhat.com> From: Hui Zhu Date: Tue, 12 Mar 2013 02:22:00 -0000 Message-ID: Subject: Re: [PATCH] Fix agent code generate bug of ref To: Tom Tromey Cc: Yao Qi , gdb-patches ml , Joel Brobecker Content-Type: text/plain; charset=ISO-8859-1 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/msg00498.txt.bz2 On Mon, Mar 11, 2013 at 10:38 PM, Tom Tromey wrote: >>>>>> "Yao" == Yao Qi writes: > > Yao> SIZE is checked as "size in bits". Your fix is right, but not > Yao> complete. We also have to fix it when op is DW_OP_deref_size, > Yao> something like the patch below. > > Yao> I am not familiar with this area, so I might be wrong. > > You are correct, but IMO it is simpler to divide each of the case > constants by 8. > > Tom Hi Tom, Post a new version change 8 to TARGET_CHAR_BIT. Thanks, Hui 2013-03-12 Yao Qi Hui Zhu * dwarf2loc.c (dwarf2_compile_expr_to_ax): Change use bits number in DW_OP_deref and DW_OP_deref_size. --- a/dwarf2loc.c +++ b/dwarf2loc.c @@ -2933,7 +2933,7 @@ dwarf2_compile_expr_to_ax (struct agent_ else size = addr_size; - switch (size) + switch (size * TARGET_CHAR_BIT) { case 8: ax_simple (expr, aop_ref8);