From patchwork Thu Feb 21 04:25:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 222182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3A9BA2C008C for ; Thu, 21 Feb 2013 16:35:08 +1100 (EST) Received: from localhost ([::1]:47143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Njo-0000PW-IQ for incoming@patchwork.ozlabs.org; Wed, 20 Feb 2013 23:26:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Nj9-0007I2-Oi for qemu-devel@nongnu.org; Wed, 20 Feb 2013 23:25:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8Nj2-0002DZ-LW for qemu-devel@nongnu.org; Wed, 20 Feb 2013 23:25:47 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49382 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8Nj2-0002DJ-FM for qemu-devel@nongnu.org; Wed, 20 Feb 2013 23:25:40 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E8C40A5207 for ; Thu, 21 Feb 2013 05:25:39 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 21 Feb 2013 05:25:07 +0100 Message-Id: <1361420711-15698-12-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1361420711-15698-1-git-send-email-afaerber@suse.de> References: <1361420711-15698-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH v2 11/15] target-openrisc: Refactor debug output macros X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Debug output is already enabled and thus compile-testable, but align with other targets. Signed-off-by: Andreas Färber --- target-openrisc/translate.c | 14 ++++++++++++-- 1 Datei geändert, 12 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-) diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c index 1e1b30c..2b6f19c 100644 --- a/target-openrisc/translate.c +++ b/target-openrisc/translate.c @@ -34,11 +34,21 @@ #define OPENRISC_DISAS #ifdef OPENRISC_DISAS -# define LOG_DIS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__) +static const bool debug_disas = true; #else -# define LOG_DIS(...) do { } while (0) +static const bool debug_disas; #endif +static void GCC_FMT_ATTR(1, 2) LOG_DIS(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 { TranslationBlock *tb; target_ulong pc, ppc, npc;