From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LtRA6-0000lN-4D for qemu-devel@nongnu.org; Mon, 13 Apr 2009 14:45:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LtRA4-0000lB-Mq for qemu-devel@nongnu.org; Mon, 13 Apr 2009 14:45:40 -0400 Received: from [199.232.76.173] (port=34891 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtRA4-0000l8-HE for qemu-devel@nongnu.org; Mon, 13 Apr 2009 14:45:40 -0400 Received: from savannah.gnu.org ([199.232.41.3]:37390 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LtRA4-0000lq-7k for qemu-devel@nongnu.org; Mon, 13 Apr 2009 14:45:40 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LtRA3-0007NG-HD for qemu-devel@nongnu.org; Mon, 13 Apr 2009 18:45:39 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LtRA3-0007NC-4Y for qemu-devel@nongnu.org; Mon, 13 Apr 2009 18:45:39 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Mon, 13 Apr 2009 18:45:39 +0000 Subject: [Qemu-devel] [7105] Add a --enable-debug-tcg option to configure Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 7105 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7105 Author: aurel32 Date: 2009-04-13 18:45:38 +0000 (Mon, 13 Apr 2009) Log Message: ----------- Add a --enable-debug-tcg option to configure This patch allows DEBUG_TCGV to be defined (and also prevents NDEBUG from being defined) when passing an option to the configure script. This should help to prevent any accidental changes that enable DEBUG_TCGV in tcg/tcg.h from being committed in future, and may help to encourage testing with DEBUG_TCGV enabled. Signed-off-by: Stuart Brady Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/configure trunk/tcg/tcg.c trunk/tcg/tcg.h Modified: trunk/configure =================================================================== --- trunk/configure 2009-04-13 17:19:26 UTC (rev 7104) +++ trunk/configure 2009-04-13 18:45:38 UTC (rev 7105) @@ -153,6 +153,7 @@ ;; esac gprof="no" +debug_tcg="no" sparse="no" strip_opt="yes" bigendian="no" @@ -400,6 +401,10 @@ ;; --audio-drv-list=*) audio_drv_list="$optarg" ;; + --enable-debug-tcg) debug_tcg="yes" + ;; + --disable-debug-tcg) debug_tcg="no" + ;; --enable-sparse) sparse="yes" ;; --disable-sparse) sparse="no" @@ -568,6 +573,8 @@ echo " --make=MAKE use specified make [$make]" echo " --install=INSTALL use specified install [$install]" echo " --static enable static build [$static]" +echo " --enable-debug-tcg enable TCG debugging" +echo " --disable-debug-tcg disable TCG debugging (default)" echo " --enable-sparse enable sparse checker" echo " --disable-sparse disable sparse checker (default)" echo " --disable-strip disable stripping binaries" @@ -1368,6 +1375,9 @@ exit 1 ;; esac +if test "$debug_tcg" = "yes" ; then + echo "#define DEBUG_TCG 1" >> $config_h +fi if test "$sparse" = "yes" ; then echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak Modified: trunk/tcg/tcg.c =================================================================== --- trunk/tcg/tcg.c 2009-04-13 17:19:26 UTC (rev 7104) +++ trunk/tcg/tcg.c 2009-04-13 18:45:38 UTC (rev 7105) @@ -22,9 +22,6 @@ * THE SOFTWARE. */ -/* define it to suppress various consistency checks (faster) */ -#define NDEBUG - /* define it to use liveness analysis (better code) */ #define USE_LIVENESS_ANALYSIS @@ -45,6 +42,11 @@ #include "qemu-common.h" #include "cache-utils.h" +#ifndef DEBUG_TCG +/* define it to suppress various consistency checks (faster) */ +#define NDEBUG +#endif + /* Note: the long term plan is to reduce the dependancies on the QEMU CPU definitions. Currently they are used for qemu_ld/st instructions */ Modified: trunk/tcg/tcg.h =================================================================== --- trunk/tcg/tcg.h 2009-04-13 17:19:26 UTC (rev 7104) +++ trunk/tcg/tcg.h 2009-04-13 18:45:38 UTC (rev 7105) @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#include "qemu-common.h" #include "tcg-target.h" #if TCG_TARGET_REG_BITS == 32 @@ -120,7 +121,9 @@ are aliases for target_ulong and host pointer sized values respectively. */ -//#define DEBUG_TCGV 1 +#ifdef DEBUG_TCG +#define DEBUG_TCGV 1 +#endif #ifdef DEBUG_TCGV