From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34116 invoked by alias); 14 Jul 2017 15:20:20 -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 34098 invoked by uid 89); 14 Jul 2017 15:20:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Jul 2017 15:20:18 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dW2O5-0005oT-8z for gdb-patches@sourceware.org; Fri, 14 Jul 2017 11:20:16 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dW2O5-0005oK-55; Fri, 14 Jul 2017 11:20:13 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4703 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dW2O4-0002Fr-3d; Fri, 14 Jul 2017 11:20:12 -0400 Date: Fri, 14 Jul 2017 15:20:00 -0000 Message-Id: <83k23bf3kj.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves CC: tom@tromey.com, gdb-patches@sourceware.org In-reply-to: <22c48f9e-ec2c-850d-91d3-c6a3ea8cdb11@redhat.com> (message from Pedro Alves on Fri, 14 Jul 2017 15:56:27 +0100) Subject: Re: [RFA 1/2] Fix two regressions in scalar printing Reply-to: Eli Zaretskii References: <20170713123400.28917-1-tom@tromey.com> <20170713123400.28917-2-tom@tromey.com> <22c48f9e-ec2c-850d-91d3-c6a3ea8cdb11@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00188.txt.bz2 > From: Pedro Alves > Date: Fri, 14 Jul 2017 15:56:27 +0100 > > The manual says: > > @item d > Print as integer in signed decimal. > > @item u > Print as integer in unsigned decimal. > > And I see this with a gdb from before the recent print_scalar_formatted > changes: > > (gdb) p /d (unsigned long long) -1 > $1 = -1 > > while we see this with either current master, or your patch: > > (gdb) p /d (unsigned long long) -1 > $1 = 18446744073709551615 > > which also doesn't look right to me. > > And here: > > (gdb) p /d (unsigned) -1 > $2 = 4294967295 > > I'd expect "-1", but we don't get it with any gdb version (before > original print_scalar_formatted changes, or current master, or > your current patch), which also looks like a bug to me. I think I agree: we should produce what the format says, not what the cast says.