From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113577 invoked by alias); 14 Jul 2017 17:25:03 -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 113055 invoked by uid 89); 14 Jul 2017 17:25:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Jul 2017 17:25:01 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9556C08D43E; Fri, 14 Jul 2017 17:25:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B9556C08D43E Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B9556C08D43E Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19DFD6EE23; Fri, 14 Jul 2017 17:24:59 +0000 (UTC) Subject: Re: [RFA 1/2] Fix two regressions in scalar printing To: Tom Tromey References: <20170713123400.28917-1-tom@tromey.com> <20170713123400.28917-2-tom@tromey.com> <22c48f9e-ec2c-850d-91d3-c6a3ea8cdb11@redhat.com> <871spjufnv.fsf@pokyo> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Fri, 14 Jul 2017 17:25:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <871spjufnv.fsf@pokyo> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-07/txt/msg00195.txt.bz2 On 07/14/2017 05:49 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> I think this would all be fixed by simply having separate > Pedro> 'u'/'d' cases with fixed signness: > > Pedro> case 'u': > Pedro> print_decimal_chars (stream, valaddr, len, false, byte_order); > Pedro> break; > Pedro> case 'd': > Pedro> print_decimal_chars (stream, valaddr, len, true, byte_order); > Pedro> break; > > I'm testing this. Thanks for the feedback. > > One early note is that this changes the expected output for this test: > > FAIL: gdb.dwarf2/var-access.exp: verify re-initialized s2 > > Now it says: > > print/d s2 > $9 = {a = -65, b = 73, c = -25, d = 123} > > but the test wants: > > gdb_test "print/d s2" " = \\{a = 191, b = 73, c = 231, d = 123\\}" \ > "verify re-initialized s2" > Yeah, that seems OK to me GDB-output-wise. "You get what you ask for". Now, the test is for "# Byte-aligned register- and memory pieces.", and is treating the bytes as raw bytes, even though the fields are defined as "char". We see just above that a test setting the fields using values over 0x7f: gdb_test_no_output "set var s2 = {191, 73, 231, 123}" \ "re-initialize s2" gdb_test "print/d s2" " = \\{a = 191, b = 73, c = 231, d = 123\\}" \ "verify re-initialized s2" The /d was surely as a convenience to avoid printing the bytes in character format. I'd just change it to /u. Same for the related tests just above. Thanks, Pedro Alves