From patchwork Thu Oct 10 23:55:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Wilson X-Patchwork-Id: 34913 Received: (qmail 45860 invoked by alias); 10 Oct 2019 23:55:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 45852 invoked by uid 89); 10 Oct 2019 23:55:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-pf1-f181.google.com Received: from mail-pf1-f181.google.com (HELO mail-pf1-f181.google.com) (209.85.210.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Oct 2019 23:55:29 +0000 Received: by mail-pf1-f181.google.com with SMTP id q12so4921504pff.9 for ; Thu, 10 Oct 2019 16:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cnscWyUlOYGIcGfUz4SePMy7wn4yCuPhQVlb0s0k56c=; b=aBfyWirbqkKL7QdxmYwMiaAfQ+7hLj39KBFa/kxQ9iaVYC5EwWzP1K6T8fBmKqW7mE musX8ABMDNoTy3JIxjEK0QK9T4DQCepYkSHaH6P+PYzhoRG+xa9j8nttkeJ7Xe/RN6F3 kfqox5HY+k/zMe9MXqqFKkZozevM0dSyVx/hBNumlcWnMqc3ZzeqiF+OYtYgP1NZIXCe qv9no9xBShBhDwk4b9eltSQSX4qmVkYBaxkKgD+v/xvAVW1WYJBjmkstHy/Z6/0jDZnU qDx2XDljUopIp4YA3Zj8EwtT74F9U2ZsaBOzHchL9xYDHprF6rnCj8HwoXfERiChlaIO 4TQA== Return-Path: Received: from rohan.sifive.com ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id i190sm9100544pgc.93.2019.10.10.16.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 16:55:27 -0700 (PDT) From: Jim Wilson To: gdb-patches@sourceware.org Cc: Jim Wilson Subject: [PATCH 2/2] Improve comments in print-utils.h. Date: Thu, 10 Oct 2019 16:55:23 -0700 Message-Id: <20191010235523.27098-1-jimw@sifive.com> In-Reply-To: References: X-IsSubscribed: yes Since I had to look at these function comments to fix the RISC-V ARI warnings, I noticed that they make no sense. The pulongest and plongest comments are swapped. phex is missing a comment. And phex_nz doesn't mention how it is different from phex. * gdbsupport/print-utils.h (pulongest): Fix comment. (plongest): Likewise. (phex): Add missing comment, mention leading zeros. (phex_nz): Add mention of no leading zeros to comment. --- gdb/gdbsupport/print-utils.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/gdbsupport/print-utils.h b/gdb/gdbsupport/print-utils.h index 815b14cbed..d52bcf8f61 100644 --- a/gdb/gdbsupport/print-utils.h +++ b/gdb/gdbsupport/print-utils.h @@ -24,20 +24,23 @@ cell. */ #define PRINT_CELL_SIZE 50 -/* %d for LONGEST. The result is stored in a circular static buffer, +/* %u for ULONGEST. The result is stored in a circular static buffer, NUMCELLS deep. */ extern char *pulongest (ULONGEST u); -/* %u for ULONGEST. The result is stored in a circular static buffer, +/* %d for LONGEST. The result is stored in a circular static buffer, NUMCELLS deep. */ extern char *plongest (LONGEST l); +/* Convert a ULONGEST into a HEX string, like %lx, with leading zeros. + The result is stored in a circular static buffer, NUMCELLS deep. */ + extern char *phex (ULONGEST l, int sizeof_l); -/* Convert a ULONGEST into a HEX string, like %lx. The result is - stored in a circular static buffer, NUMCELLS deep. */ +/* Convert a ULONGEST into a HEX string, like %lx, without leading zeros. + The result is stored in a circular static buffer, NUMCELLS deep. */ extern char *phex_nz (ULONGEST l, int sizeof_l);