Received: from eggs.gnu.org ([208.118.235.92]:41176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR15l-0005NR-Hl for qemu-devel@nongnu.org; Wed, 24 Oct 2012 09:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TR15h-0004TT-Ah for qemu-devel@nongnu.org; Wed, 24 Oct 2012 09:33:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR15h-0004S6-19 for qemu-devel@nongnu.org; Wed, 24 Oct 2012 09:33:49 -0400 From: Luiz Capitulino Date: Wed, 24 Oct 2012 11:34:38 -0200 Message-Id: <1351085680-16901-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1351085680-16901-1-git-send-email-lcapitulino@redhat.com> References: <1351085680-16901-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PULL 1/3] hmp: fix info cpus for sparc targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com From: Aurelien Jarno 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 Signed-off-by: Luiz Capitulino --- hmp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hmp.c b/hmp.c index 2b97982..9df84e3 100644 --- a/hmp.c +++ b/hmp.c @@ -245,20 +245,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) { -- 1.7.12.315.g682ce8b