"Dr. David Alan Gilbert" <dgilb...@redhat.com> writes:

> * Markus Armbruster (arm...@redhat.com) wrote:
>> The various dump_mmu() take an fprintf()-like callback and a FILE * to
>> pass to it, and so do their helper functions.  Passing around callback
>> and argument is rather tiresome.
>> 
>> Most dump_mmu() are called only by the target's hmp_info_tlb().  These
>> all pass monitor_printf() cast to fprintf_function and the current
>> monitor cast to FILE *.
>> 
>> SPARC's dump_mmu() gets also called from target/sparc/ldst_helper.c a
>> few times #ifdef DEBUG_MMU.  These calls pass fprintf() and stdout.
>
> You might want to fixup the DPRINTF_MMU in ldst_helper.c to also
> use qemu_printf.

Hmm.  Makes DPRINTF_MMU() consistent with how dump_mmu() prints, but
inconsistent with how the other DPRINTF_*() print.  Dunno...

All that debug code should really be tracepoints of course.

I'll leave DPRINTF_MMU() alone unless a maintainer (cc'ed) wants me to
update it.

>> The type-punning is technically undefined behaviour, but works in
>> practice.  Clean up: drop the callback, and call qemu_printf()
>> instead.
>> 
>> Signed-off-by: Markus Armbruster <arm...@redhat.com>
>
> Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com>

Thanks!

Reply via email to