From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24486 invoked by alias); 5 Dec 2013 16:18:52 -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 24470 invoked by uid 89); 5 Dec 2013 16:18:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Dec 2013 16:18:51 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB5GIgX8025382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Dec 2013 11:18:43 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB5GIfoB022901; Thu, 5 Dec 2013 11:18:41 -0500 Message-ID: <52A0A760.8000509@redhat.com> Date: Thu, 05 Dec 2013 16:18:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andrew Burgess CC: gdb-patches@sourceware.org Subject: Re: [PATCH [2/2] Convert the unavailable vector to be bit, not byte, based. References: <529F489F.7070805@broadcom.com> <529F498F.7060909@broadcom.com> In-Reply-To: <529F498F.7060909@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00187.txt.bz2 On 12/04/2013 03:26 PM, Andrew Burgess wrote: > * gdb/dwarf2loc.c (read_pieced_value): Mark bits, not bytes > unavailable, use correct bit length. No "gdb/" prefix. > (unpack_value_bits_as_long_1): Check availability in bits, bot > bytes. Typo: "bot". > * gdb/value.h (int value_bits_available): Declare new function. Stale "int". > (mark_value_bits_unavailable): Declare new function. > *val1, int offset1, > return 0; > > /* Compare the _available_ contents. */ > - if (memcmp (val1->contents + offset1, > - val2->contents + offset2, > - l1) != 0) > + if (memcmp (val1->contents + (offset1 / TARGET_CHAR_BIT), > + val2->contents + (offset2 / TARGET_CHAR_BIT), > + (l1 / TARGET_CHAR_BIT)) != 0) > return 0; As memcmp compares bytes, isn't this potentially comparing bits at the beginning and end of the values' buffers, when it should not? That is, it looks like the 'offset1 % TARGET_CHAR_BIT != 0' and '(offset1 + l1) % TARGET_CHAR_BIT' cases should be considered here? > + gdb_test "tfind 0" "Found trace frame 0, tracepoint .*" > + gdb_test "p x" "\\\$${decimal} = {a = 0 '\\\\000', b = , c = 0 '\\\\000', d = 0 '\\\\000', e = 0 '\\\\000', f = 0 '\\\\000', g = 0 '\\\\000', h = 0 '\\\\000', i = 0 '\\\\000', j = 0 '\\\\000'}" > + gdb_test "p y" "\\\$${decimal} = {a = 0 '\\\\000', b = 0 '\\\\000', c = 0 '\\\\000', d = 0 '\\\\000', e = , f = 0 '\\\\000', g = 0 '\\\\000', h = 0 '\\\\000', i = 0 '\\\\000', j = 0 '\\\\000'}" > + gdb_test "p z" "\\\$${decimal} = {a = 0 '\\\\000', b = 0 '\\\\000', c = 0 '\\\\000', d = 0 '\\\\000', e = 0 '\\\\000', f = 0 '\\\\000', g = 0 '\\\\000', h = 0 '\\\\000', i = , j = 0 '\\\\000'}" (I think you could have used "p/d" or "p/x" to simplify the output.) > + > + gdb_test "tfind none" "No longer looking at any trace frame.*" > +void > +end () end (void) There are more instances. > + struct s v = { 0, 1, 2}; Missing space before }. > + struct t w = { 5, 0, 1, 0, 1, 0, 1, 0, 1, 7 }; Otherwise looks good to me. -- Pedro Alves