Received: from eggs.gnu.org ([2001:4830:134:3::10]:39403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOVkb-0003HW-Qz for qemu-devel@nongnu.org; Tue, 24 Sep 2013 12:46:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOVkX-0005kd-AU for qemu-devel@nongnu.org; Tue, 24 Sep 2013 12:46:13 -0400 From: Fabien Chouteau Date: Tue, 24 Sep 2013 18:46:00 +0200 Message-Id: <1380041161-13266-3-git-send-email-chouteau@adacore.com> In-Reply-To: <1380041161-13266-1-git-send-email-chouteau@adacore.com> References: <1380041161-13266-1-git-send-email-chouteau@adacore.com> Subject: [Qemu-devel] [PATCH 2/3] Improve Monitor disas with symbol lookup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-trivial@nongnu.org Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, afaerber@suse.de, lcapitulino@redhat.com Signed-off-by: Fabien Chouteau --- disas.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/disas.c b/disas.c index 32407de..c83bf5b 100644 --- a/disas.c +++ b/disas.c @@ -507,7 +507,15 @@ void monitor_disas(Monitor *mon, CPUArchState *env, #endif for (i = 0; i < nb_insn; i++) { - monitor_printf(mon, "0x" TARGET_FMT_lx ": ", pc); + const char *sym = lookup_symbol(pc); + + monitor_printf(mon, "0x" TARGET_FMT_lx, pc); + if (sym[0] != '\0') { + monitor_printf(mon, " <%s>: ", sym); + } else { + monitor_printf(mon, ": "); + } + count = print_insn(pc, &s.info); monitor_printf(mon, "\n"); if (count < 0) { -- 1.7.9.5