From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBQDu-0001YU-37 for qemu-devel@nongnu.org; Mon, 19 Aug 2013 10:14:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBQDm-0007yN-D2 for qemu-devel@nongnu.org; Mon, 19 Aug 2013 10:14:22 -0400 Message-ID: <52122832.9000501@suse.de> Date: Mon, 19 Aug 2013 16:14:10 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1375447708-14545-1-git-send-email-chouteau@adacore.com> In-Reply-To: <1375447708-14545-1-git-send-email-chouteau@adacore.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] Improve Monitor disas with symbol lookup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: qemu-trivial@nongnu.org, Peter Maydell , qemu-devel@nongnu.org, lcapitulino@redhat.com Am 02.08.2013 14:48, schrieb Fabien Chouteau: > Part of M731-018. >=20 > Signed-off-by: Fabien Chouteau > --- > disas.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) >=20 > diff --git a/disas.c b/disas.c > index 71007fb..3ffb3ae 100644 > --- a/disas.c > +++ b/disas.c > @@ -480,11 +480,19 @@ void monitor_disas(Monitor *mon, CPUArchState *en= v, > #endif > =20 > for(i =3D 0; i < nb_insn; i++) { > - monitor_printf(mon, "0x" TARGET_FMT_lx ": ", pc); > + const char *sym =3D lookup_symbol(pc); > + > + monitor_printf(mon, "0x" TARGET_FMT_lx " ", pc); > + if (sym[0] !=3D '\0') { > + monitor_printf(mon, "<%s>: ", sym); > + } else { > + monitor_printf(mon, ": "); > + } Independent of PMM's comment, I think you meant + monitor_printf(mon, "0x" TARGET_FMT_lx, pc); + if (sym[0] !=3D '\0') { + monitor_printf(mon, " <%s>: ", sym); + } else { + monitor_printf(mon, ": "); + } to keep the output unchanged. Could you please put the tab fixing into a preceding patch for readability and prepend a cover letter? Regards, Andreas > count =3D print_insn(pc, &s.info); > - monitor_printf(mon, "\n"); > - if (count < 0) > - break; > + monitor_printf(mon, "\n"); > + if (count < 0) { > + break; > + } > pc +=3D count; > } > } >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg