From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31866 invoked by alias); 11 Jul 2013 15:20:56 -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 31854 invoked by uid 89); 11 Jul 2013 15:20:56 -0000 X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_MED,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mms1.broadcom.com (HELO mms1.broadcom.com) (216.31.210.17) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 11 Jul 2013 15:20:55 +0000 Received: from [10.9.208.57] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 11 Jul 2013 08:16:55 -0700 X-Server-Uuid: 06151B78-6688-425E-9DE2-57CB27892261 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Thu, 11 Jul 2013 08:20:41 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.1.438.0; Thu, 11 Jul 2013 08:20:41 -0700 Received: from [10.177.73.66] (unknown [10.177.73.66]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 7F611F2D72; Thu, 11 Jul 2013 08:20:40 -0700 (PDT) Message-ID: <51DECD47.60207@broadcom.com> Date: Thu, 11 Jul 2013 15:20:00 -0000 From: "Andrew Burgess" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" cc: "Tom Tromey" Subject: Re: [PATCH] [1/2] Add new 'z' format for print command References: <51DAF728.4040309@broadcom.com> <878v1egw5r.fsf@fleche.redhat.com> In-Reply-To: <878v1egw5r.fsf@fleche.redhat.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00319.txt.bz2 On 10/07/2013 6:30 PM, Tom Tromey wrote: >>>>>> "Andrew" == Andrew Burgess writes: > > Andrew> Pedro pointed out that I could do better, so, this patch > Andrew> introduces a new 'z' format within the core value printing > Andrew> code that displays scalars using zero padded hexadecimal. > Andrew> I've mentioned this in the docs and added a test for the > Andrew> new format. > > Andrew> In patch [2/2] I'll change the MI code to make use of this > Andrew> new 'z' formatter. > > Andrew> OK to apply? > > It looks good to me. However, it needs a doc review, and also, I think, > a NEWS entry. Thanks for looking through this patch. I've included a proposed NEWS entry below. It also occurred to me that the 'z' formatter should be mentioned in the help text for the 'x' command, I've included a small patch below that makes this change. > Plus, I think we should wait a little bit in case anyone has an issue > with the choice of 'z'. I'll wait a while to see if there's any feedback on the choice of letter, and for a docs review. Thanks, Andrew gdb/NEWS * New 'z' formatter for print and examine memory commands, displays the value as hexadecimal zero padded to the size of the type. gdb/ChangeLog 2013-07-08 Andrew Burgess * printcmd.c (_initialize_printcmd): Mention 'z' formatter in help text of the 'x' command. diff --git a/gdb/printcmd.c b/gdb/printcmd.c index f34d18b..0862f86 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -2500,7 +2500,8 @@ Examine memory: x/FMT ADDRESS.\n\ ADDRESS is an expression for the memory address to examine.\n\ FMT is a repeat count followed by a format letter and a size letter.\n\ Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),\n\ - t(binary), f(float), a(address), i(instruction), c(char) and s(string).\n\ + t(binary), f(float), a(address), i(instruction), c(char), s(string)\n\ + and z(zero padded hex).\n\ Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).\n\ The specified number of objects of the specified size are printed\n\ according to the format.\n\n\