From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS8gl-0004UD-VE for qemu-devel@nongnu.org; Fri, 04 Oct 2013 12:57:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VS8gf-0001qC-Oq for qemu-devel@nongnu.org; Fri, 04 Oct 2013 12:57:15 -0400 Received: from mel.act-europe.fr ([194.98.77.210]:57562 helo=smtp.eu.adacore.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS8gf-0001pn-Hs for qemu-devel@nongnu.org; Fri, 04 Oct 2013 12:57:09 -0400 From: Fabien Chouteau Date: Fri, 4 Oct 2013 18:57:01 +0200 Message-Id: <1380905823-3981-3-git-send-email-chouteau@adacore.com> In-Reply-To: <1380905823-3981-1-git-send-email-chouteau@adacore.com> References: <1380905823-3981-1-git-send-email-chouteau@adacore.com> Subject: [Qemu-devel] [PATCH 2/4] Improve Monitor disas with symbol lookup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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