From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id O9p/IQ5ti2J+2gcAWB0awg (envelope-from ) for ; Mon, 23 May 2022 07:16:30 -0400 Received: by simark.ca (Postfix, from userid 112) id 7F2631E220; Mon, 23 May 2022 07:16:30 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QkdyJ/JT; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 188991E01D for ; Mon, 23 May 2022 07:16:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1BB1383A332 for ; Mon, 23 May 2022 11:16:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1BB1383A332 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653304589; bh=++6QeH0o6S6xVzRDzLCw7k+cQg6SNjv3/6Ju+jyd+So=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=QkdyJ/JTcOsCGJ5RB7Y15g6ivt7Y8ve51qFfK2eG6HXXdkhuBM20OA+5D6l8x/W5l Vz/DcPVL25wwyaD0wFFPaAQvCwyElBCbRohjNV2jFf4EYPv2ON91QKzpFt2r13Kt1W xxc5r8duYPhNyGkBsWvdt7GHlZMPUYLD3iuzGCjc= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 1801A3858CDA for ; Mon, 23 May 2022 11:16:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1801A3858CDA Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4AD3B21A1E; Mon, 23 May 2022 11:16:09 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 31324139F5; Mon, 23 May 2022 11:16:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5i+9Cvlsi2JuGgAAMHmgww (envelope-from ); Mon, 23 May 2022 11:16:09 +0000 Message-ID: <9c428856-086f-4dc5-2c2d-663357588342@suse.de> Date: Mon, 23 May 2022 13:16:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH][gdb/c] Fix printing -2147483648 Content-Language: en-US To: Pedro Alves , gdb-patches@sourceware.org References: <20220518173840.GA8909@delia> <99bf2d3c-21ec-ab66-897f-b690194797de@palves.net> In-Reply-To: <99bf2d3c-21ec-ab66-897f-b690194797de@palves.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/18/22 21:15, Pedro Alves wrote: > On 2022-05-18 18:38, Tom de Vries wrote: > >> + if { [c_like $lang] } { >> + set val -2147483648 >> + if { $sizeof_long_long == 4 } { >> + set re $re_overflow >> + } else { >> + set re $val >> + } >> + gdb_test "p $val" $re >> + } > > Could you add ptype tests too? As is, is plausible for GDB to manage to print > the expected value, but incorrectly pick long long instead of long, for example. Indeed, good point. I've ended up extending the test-case in a more structural way, submitted here ( https://sourceware.org/pipermail/gdb-patches/2022-May/189309.html ), and that should address your comment. Thanks, - Tom