From patchwork Thu Sep 12 18:09:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 274579 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AA1052C00FF for ; Fri, 13 Sep 2013 04:09:36 +1000 (EST) Received: from localhost ([::1]:43202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKBKf-0002Qe-W7 for incoming@patchwork.ozlabs.org; Thu, 12 Sep 2013 14:09:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKBKN-0002Pb-1g for qemu-devel@nongnu.org; Thu, 12 Sep 2013 14:09:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKBKI-0001DX-0u for qemu-devel@nongnu.org; Thu, 12 Sep 2013 14:09:14 -0400 Received: from qemu.weilnetz.de ([37.221.198.45]:38521 helo=v2201305906712890.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKBKH-0001DK-RF; Thu, 12 Sep 2013 14:09:09 -0400 Received: by v2201305906712890.yourvserver.net (Postfix, from userid 1000) id E24DF180651; Thu, 12 Sep 2013 20:09:06 +0200 (CEST) From: Stefan Weil To: qemu-devel Date: Thu, 12 Sep 2013 20:09:06 +0200 Message-Id: <1379009346-18130-1-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 37.221.198.45 Cc: qemu-trivial@nongnu.org, Stefan Weil Subject: [Qemu-devel] [PATCH] translate-all: Fix formatting of dump output X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The page dump writes a table with 3 abi_ulong values in each row. These values take 8 or 16 characters (depending on sizeof abi_ulong). Fix the table headings to be aligned with the table columns. old: start end size prot 0000000120000000-000000012021e000 000000000021e000 rwx 0000004000000000-0000004000002000 0000000000002000 --- 0000004000002000-0000004000802000 0000000000800000 rw- new: start end size prot 0000000120000000-000000012021e000 000000000021e000 rwx 0000004000000000-0000004000002000 0000000000002000 --- 0000004000002000-0000004000802000 0000000000800000 rw- Signed-off-by: Stefan Weil --- translate-all.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/translate-all.c b/translate-all.c index 2c923c6..3b97c66 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1679,8 +1679,9 @@ static int dump_region(void *priv, abi_ulong start, /* dump memory mappings */ void page_dump(FILE *f) { - (void) fprintf(f, "%-8s %-8s %-8s %s\n", - "start", "end", "size", "prot"); + const size_t length = sizeof(abi_ulong) * 2; + (void) fprintf(f, "%-*s %-*s %-*s %s\n", + length, "start", length, "end", length, "size", "prot"); walk_memory_regions(f, dump_region); }