From patchwork Fri Oct 19 21:19:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 192822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D23F82C009F for ; Sat, 20 Oct 2012 08:20:58 +1100 (EST) Received: from localhost ([::1]:43579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPK00-0007r4-V8 for incoming@patchwork.ozlabs.org; Fri, 19 Oct 2012 17:20:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPJzS-0007l0-RP for qemu-devel@nongnu.org; Fri, 19 Oct 2012 17:20:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPJyy-0007JZ-2q for qemu-devel@nongnu.org; Fri, 19 Oct 2012 17:20:22 -0400 Received: from hall.aurel32.net ([88.191.126.93]:41748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPJyx-0007JI-T3 for qemu-devel@nongnu.org; Fri, 19 Oct 2012 17:19:52 -0400 Received: from watt.aurel32.net ([82.228.202.134] helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TPJyv-0003wl-Nf; Fri, 19 Oct 2012 23:19:49 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1TPJyv-0007VJ-0x; Fri, 19 Oct 2012 23:19:49 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Fri, 19 Oct 2012 23:19:19 +0200 Message-Id: <1350681559-28522-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.126.93 Cc: Blue Swirl , Markus Armbruster , Aurelien Jarno , Luiz Capitulino Subject: [Qemu-devel] [PATCH v2] hmp: fix info cpus for sparc targets 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 On sparc targets, info cpus returns this kind of output: | info cpus | * CPU #0: pc=0x0000000000424d18pc=0x0000000000424d18npc=0x0000000000424d1c thread_id=19460 pc is printed twice, there is no space between pc, pc and npc. With this patch, pc is not printed anymore when has_npc is set. In addition the space is printed before pc/nip/npc/PC instead of after the colon so that multiple prints are possible. This result on the following kind of input on sparc targets: | info cpus | * CPU #0: pc=0x0000000000424d18 npc=0x0000000000424d1c thread_id=19460 Cc: Luiz Capitulino Cc: Markus Armbruster Cc: Blue Swirl Signed-off-by: Aurelien Jarno Acked-by: Luiz Capitulino --- hmp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) Changes v1 -> v2: strategy change, has_npc doesn't imply has_pc anymore. diff --git a/hmp.c b/hmp.c index 70bdec2..296adc3 100644 --- a/hmp.c +++ b/hmp.c @@ -233,20 +233,19 @@ void hmp_info_cpus(Monitor *mon) active = '*'; } - monitor_printf(mon, "%c CPU #%" PRId64 ": ", active, cpu->value->CPU); + monitor_printf(mon, "%c CPU #%" PRId64 ":", active, cpu->value->CPU); if (cpu->value->has_pc) { - monitor_printf(mon, "pc=0x%016" PRIx64, cpu->value->pc); + monitor_printf(mon, " pc=0x%016" PRIx64, cpu->value->pc); } if (cpu->value->has_nip) { - monitor_printf(mon, "nip=0x%016" PRIx64, cpu->value->nip); + monitor_printf(mon, " nip=0x%016" PRIx64, cpu->value->nip); } if (cpu->value->has_npc) { - monitor_printf(mon, "pc=0x%016" PRIx64, cpu->value->pc); - monitor_printf(mon, "npc=0x%016" PRIx64, cpu->value->npc); + monitor_printf(mon, " npc=0x%016" PRIx64, cpu->value->npc); } if (cpu->value->has_PC) { - monitor_printf(mon, "PC=0x%016" PRIx64, cpu->value->PC); + monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->PC); } if (cpu->value->halted) {