[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/2] Improve Monitor disas with s
From: |
Andreas Färber |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/2] Improve Monitor disas with symbol lookup |
Date: |
Mon, 19 Aug 2013 16:14:10 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
Am 02.08.2013 14:48, schrieb Fabien Chouteau:
> Part of M731-018.
>
> Signed-off-by: Fabien Chouteau <address@hidden>
> ---
> disas.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> 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 *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, ": ");
> + }
Independent of PMM's comment, I think you meant
+ monitor_printf(mon, "0x" TARGET_FMT_lx, pc);
+ if (sym[0] != '\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 = print_insn(pc, &s.info);
> - monitor_printf(mon, "\n");
> - if (count < 0)
> - break;
> + monitor_printf(mon, "\n");
> + if (count < 0) {
> + break;
> + }
> pc += count;
> }
> }
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg