qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 06/15] target-alpha: Refactor debug output ma


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 06/15] target-alpha: Refactor debug output macros
Date: Fri, 22 Feb 2013 16:32:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Andreas Färber <address@hidden> writes:

> Make LOG_DISAS() arguments compile-testable even if disabled.
>
> Signed-off-by: Andreas Färber <address@hidden>
> ---
>  target-alpha/translate.c |   14 ++++++++++++--
>  1 Datei geändert, 12 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
>
> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
> index f687b95..32fe056 100644
> --- a/target-alpha/translate.c
> +++ b/target-alpha/translate.c
> @@ -30,11 +30,21 @@
>  #define CONFIG_SOFTFLOAT_INLINE
>  
>  #ifdef ALPHA_DEBUG_DISAS
> -#  define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
> +static const bool debug_disas = true;
>  #else
> -#  define LOG_DISAS(...) do { } while (0)
> +static const bool debug_disas;
>  #endif
>  
> +static void GCC_FMT_ATTR(1, 2) LOG_DISAS(const char *fmt, ...)
> +{
> +    if (debug_disas) {
> +        va_list ap;
> +        va_start(ap, fmt);
> +        qemu_log_mask_vprintf(CPU_LOG_TB_IN_ASM, fmt, ap);
> +        va_end(ap);
> +    }
> +}
> +
>  typedef struct DisasContext DisasContext;
>  struct DisasContext {
>      struct TranslationBlock *tb;

All-caps function names aren't explicitly forbidden by CODING_STYLE,
probably just because "nobody would do that".

Keeping the name avoids touching call sites.  For alpha, there's just
one.

Sure you want to keep the ugly name?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]