From: mistachkin Date: Thu, 25 Aug 2011 02:02:25 +0000 (+0000) Subject: In the MSVC makefile, support several levels of debugging, each one building on the... X-Git-Tag: version-3.7.8~42^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=753c544495067bf983350a3ae240d3addb2f97e4;p=thirdparty%2Fsqlite.git In the MSVC makefile, support several levels of debugging, each one building on the previous. Also, add comment about the SQLITE_WIN32_MALLOC_VALIDATE macro. FossilOrigin-Name: 4257e9b7ca78feb03df08fde56da947ae64c5c6f --- diff --git a/Makefile.msc b/Makefile.msc index 6664b68b1f..6c3e2139d0 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -10,6 +10,7 @@ TOP = . # Set this non-0 to create and use the SQLite amalgamation file. # USE_AMALGAMATION = 1 +DEBUG=0 # Version numbers and release number for the SQLite being compiled. # @@ -41,7 +42,21 @@ TCC = $(TCC) -I$(TOP)\ext\rtree # Omitting the define will cause extra debugging code to be inserted and # includes extra comments when "EXPLAIN stmt" is used. # +!IF $(DEBUG)==0 TCC = $(TCC) -DNDEBUG +!ENDIF + +!IF $(DEBUG)>1 +TCC = $(TCC) -DSQLITE_DEBUG +!ENDIF + +!IF $(DEBUG)>3 +TCC = $(TCC) -DSQLITE_DEBUG_OS_TRACE=1 +!ENDIF + +!IF $(DEBUG)>4 +TCC = $(TCC) -DSQLITE_ENABLE_IOTRACE +!ENDIF # # Prevent warnings about "insecure" runtime library functions being used. @@ -49,10 +64,16 @@ TCC = $(TCC) -DNDEBUG TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS # -# Use native Win32 heap. +# Use native Win32 heap instead of malloc/free? # TCC = $(TCC) -DSQLITE_WIN32_MALLOC=1 -# TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 + +# +# Validate the heap on every call into the native Win32 heap subsystem? +# +!IF $(DEBUG)>2 +TCC = $(TCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 +!ENDIF # The locations of the Tcl header and library files. Also, the library that # non-stubs enabled programs using Tcl must link against. These variables @@ -130,6 +151,11 @@ TCC = $(TCC) $(OPT_FEATURE_FLAGS) # ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1". TCC = $(TCC) $(OPTS) +# Add debug information if enabled. +!IF $(DEBUG)!=0 +TCC = $(TCC) -Zi -D_DEBUG +!ENDIF + # libtool compile/link LTCOMPILE = $(TCC) -Fo$@ LTLIB = lib.exe @@ -144,6 +170,10 @@ LTLINKOPTS = /MACHINE:$(PLATFORM) LTLIBOPTS = /MACHINE:$(PLATFORM) !ENDIF +!IF $(DEBUG)!=0 +LTLINKOPTS = $(LTLINKOPTS) /DEBUG +!ENDIF + # nawk compatible awk. NAWK = gawk.exe diff --git a/manifest b/manifest index abb3c6ba24..668a0483a9 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Make\ssure\sthat\sSQLITE_FCNTL_SIZE_HINT\son\sWindows\sdoes\snot\sshrink\sthe\sfile. -D 2011-08-25T01:16:42.999 +C In\sthe\sMSVC\smakefile,\ssupport\sseveral\slevels\sof\sdebugging,\seach\sone\sbuilding\son\sthe\sprevious.\s\sAlso,\sadd\scomment\sabout\sthe\sSQLITE_WIN32_MALLOC_VALIDATE\smacro. +D 2011-08-25T02:02:25.221 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 8c930e7b493d59099ea1304bd0f2aed152eb3315 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc baf6b7037a8e0838387f8bfc9baacfcc57dc5902 +F Makefile.msc 2bd2c2956d9b5662f2f239f3f4785ab940c9d095 F Makefile.vxworks c85ec1d8597fe2f7bc225af12ac1666e21379151 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6 F VERSION f724de7326e87b7f3b0a55f16ef4b4d993680d54 @@ -183,7 +183,7 @@ F src/select.c d219c4b68d603cc734b6f9b1e2780fee12a1fa0d F src/shell.c bbe7818ff5bc8614105ceb81ad67b8bdc0b671dd F src/sqlite.h.in 0a6c9c23337fd1352c5c75a613ff9533aa7d91cb F src/sqlite3ext.h 1a1a4f784aa9c3b00edd287940197de52487cd93 -F src/sqliteInt.h 137c2af01e5913f9673e226b0822392cc4655b98 +F src/sqliteInt.h 5004ed078f0a4fd9a725b2eb75d7cf758cf86e91 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e @@ -961,7 +961,7 @@ F tool/symbols.sh caaf6ccc7300fd43353318b44524853e222557d5 F tool/tostr.awk 11760e1b94a5d3dcd42378f3cc18544c06cfa576 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings.sh b7fdb2cc525f5ef4fa43c80e771636dd3690f9d2 -P 7fca5a284cded6d7531060da6e99a57aed50cf8f -R 8bf9aeffcdc394f7e2d1b2b0d493cfd6 +P d4f6437f8de82482dfaa4c084f4221e89e21eb00 +R da2e33245e2364528467756cf50f41d5 U mistachkin -Z 53621de951679e35f623a12339a41936 +Z b479c51d4c7cb9ebde1314847b959959 diff --git a/manifest.uuid b/manifest.uuid index 9782684c64..96d5bdbabc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d4f6437f8de82482dfaa4c084f4221e89e21eb00 \ No newline at end of file +4257e9b7ca78feb03df08fde56da947ae64c5c6f \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 8c9b179d44..e98dc2c296 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -150,6 +150,11 @@ ** SQLITE_WIN32_MALLOC // Use Win32 native heap API ** SQLITE_MEMDEBUG // Debugging version of system malloc() ** +** On Windows, if the SQLITE_WIN32_MALLOC_VALIDATE macro is defined and the +** assert() macro is enabled, each call into the Win32 native heap subsystem +** will cause HeapValidate to be called. If heap validation should fail, an +** assertion will be triggered. +** ** (Historical note: There used to be several other options, but we've ** pared it down to just these two.) **