qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] [v2] Add a --enable-debug-tcg option to configure
@ 2009-04-13 13:51 Stuart Brady
  2009-04-13 18:46 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Stuart Brady @ 2009-04-13 13:51 UTC (permalink / raw)
  To: qemu-devel

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.

Changes from v1:
  Suppressed definition of NDEBUG when debugging is enabled
  Renamed the option from 'debug-tcgv' to 'debug-tcg'

Signed-off-by: Stuart Brady <stuart.brady@gmail.com>

Index: tcg/tcg.c
===================================================================
--- tcg/tcg.c	(revision 7095)
+++ tcg/tcg.c	(working copy)
@@ -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 */
Index: tcg/tcg.h
===================================================================
--- tcg/tcg.h	(revision 7095)
+++ tcg/tcg.h	(working copy)
@@ -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
 
Index: configure
===================================================================
--- configure	(revision 7095)
+++ configure	(working copy)
@@ -153,6 +153,7 @@
   ;;
 esac
 gprof="no"
+debug_tcg="no"
 sparse="no"
 strip_opt="yes"
 bigendian="no"
@@ -394,6 +395,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"
@@ -562,6 +567,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"
@@ -1359,6 +1366,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
-- 
Stuart Brady

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] [v2] Add a --enable-debug-tcg option to configure
  2009-04-13 13:51 [Qemu-devel] [PATCH] [v2] Add a --enable-debug-tcg option to configure Stuart Brady
@ 2009-04-13 18:46 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2009-04-13 18:46 UTC (permalink / raw)
  To: Stuart Brady, qemu-devel

On Mon, Apr 13, 2009 at 02:51:25PM +0100, Stuart Brady wrote:
> 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.
> 
> Changes from v1:
>   Suppressed definition of NDEBUG when debugging is enabled
>   Renamed the option from 'debug-tcgv' to 'debug-tcg'
> 
> Signed-off-by: Stuart Brady <stuart.brady@gmail.com>

Thanks, applied.

> Index: tcg/tcg.c
> ===================================================================
> --- tcg/tcg.c	(revision 7095)
> +++ tcg/tcg.c	(working copy)
> @@ -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 */
> Index: tcg/tcg.h
> ===================================================================
> --- tcg/tcg.h	(revision 7095)
> +++ tcg/tcg.h	(working copy)
> @@ -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
>  
> Index: configure
> ===================================================================
> --- configure	(revision 7095)
> +++ configure	(working copy)
> @@ -153,6 +153,7 @@
>    ;;
>  esac
>  gprof="no"
> +debug_tcg="no"
>  sparse="no"
>  strip_opt="yes"
>  bigendian="no"
> @@ -394,6 +395,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"
> @@ -562,6 +567,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"
> @@ -1359,6 +1366,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
> -- 
> Stuart Brady
> 
> 
> 

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-13 18:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-13 13:51 [Qemu-devel] [PATCH] [v2] Add a --enable-debug-tcg option to configure Stuart Brady
2009-04-13 18:46 ` Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).