From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53754 invoked by alias); 9 Jul 2019 15:21:23 -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 53649 invoked by uid 89); 9 Jul 2019 15:21:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=spots, super X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.119) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Jul 2019 15:21:22 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id BE48C48D72 for ; Tue, 9 Jul 2019 10:21:20 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id krvkhwTud4FKpkrvkhA5wO; Tue, 09 Jul 2019 10:21:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=l/uUicehsv0XzYyqKRYSFH4UIYlOm5jxrIpMoveOKps=; b=cAbKTlZVbGAaAfNB3j7ZgmT+Z9 K7+z7FQUNwBLFuFX8n210C/iXvq1TAY/GObtQ8YhMoWJj322aNulzWEvpSytrr4rYLeK/XWZKOu57 oEyWAUcHSd3MSpzYIn1smuJPO; Received: from 174-29-36-25.hlrn.qwest.net ([174.29.36.25]:43534 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hkrvk-001V8D-E4; Tue, 09 Jul 2019 10:21:20 -0500 From: Tom Tromey To: Andrew Burgess Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH v2 2/4] Use field_string in more places References: <20190702153602.27637-1-tromey@adacore.com> <20190702153602.27637-3-tromey@adacore.com> <20190702155304.GY23204@embecosm.com> Date: Tue, 09 Jul 2019 15:21:00 -0000 In-Reply-To: <20190702155304.GY23204@embecosm.com> (Andrew Burgess's message of "Tue, 2 Jul 2019 16:53:05 +0100") Message-ID: <87imsbgro0.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-07/txt/msg00213.txt.bz2 >>>>> "Andrew" == Andrew Burgess writes: >> + current_uiout->field_string ("event_status", >> + hex_string_custom (event_status, 4)); Andrew> I don't know if it matters, but this will reduce the number of 0s that Andrew> are printed, if 'event_status = 1' then phex (event_status, 4) will Andrew> return '00000001' while hex_string_custom will return '0001'. Andrew> I'm not an SPU user so have no opinion either way... I don't know either. I looked into this a bit and it seems like a messy area of gdb: * hex_string and hex_string_custom take a signed argument, which IMO doesn't make sense. * hex_string is basically phex_nz with the 0x prefix; but hex_string_custom differs in its truncation behavior from phex. * core_addr_to_string and core_addr_to_string_nz exist; though some spots choose to print a CORE_ADDR using one of the hex_string functions; and of course there is paddress and (I just learned this one) print_core_address. * paddress probably should be renamed paddress_nz and print_core_address to paddress, but of course this would be super confusing; and anyway it seems like it would make more sense to standardize on a single way to print addresses, or maybe at least a user- (rather than patch-writer-) configurable one. Faced with this I chose to flee, and I'm dropping the SPU bits from my patch. Also I felt this made sense because the SPU code is slated to be removed. Tom