From: mistachkin Date: Thu, 15 Aug 2013 08:06:15 +0000 (+0000) Subject: Make it easy to attach a debugger the test fixture process prior to any tests being... X-Git-Tag: version-3.8.0~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2FdbgTestFixture;p=thirdparty%2Fsqlite.git Make it easy to attach a debugger the test fixture process prior to any tests being run. FossilOrigin-Name: c23acba11bfefc019b5945cfb345f9afcf4b6242 --- diff --git a/manifest b/manifest index 5e2d3872f1..c257781adc 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sfew\smore\sminor\scomment\stypos.\s\sNo\schanges\sto\scode. -D 2013-08-14T00:20:23.461 +C Make\sit\seasy\sto\sattach\sa\sdebugger\sthe\stest\sfixture\sprocess\sprior\sto\sany\stests\sbeing\srun. +D 2013-08-15T08:06:15.562 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -225,7 +225,7 @@ F src/sqliteInt.h def0e436c0d4ca5084305ca6ae898020fbafaae4 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 7ac05a5c7017d0b9f0b4bcd701228b784f987158 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e -F src/tclsqlite.c b8835978e853a89bf58de88acc943a5ca94d752e +F src/tclsqlite.c 659dad8ef30b54831306a244b43e37af4725a444 F src/test1.c 870fc648a48cb6d6808393174f7ebe82b8c840fa F src/test2.c 7355101c085304b90024f2261e056cdff13c6c35 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c @@ -1105,7 +1105,10 @@ F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P ac336959490083ffeaaf25aaec97ecb59a2f4536 -R b65660836257e0b7350de3a479496a6b +P 9e999081a59b161a0a1f968fbc01a1db9ea43b93 +R c32412a10fe0450296a67115895879b1 +T *branch * dbgTestFixture +T *sym-dbgTestFixture * +T -sym-trunk * U mistachkin -Z 2adbd114c976ac90cd58966c1c244f68 +Z 7b47b87c7211179488e7ecca78b01825 diff --git a/manifest.uuid b/manifest.uuid index c5b110f948..32c235aa4c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9e999081a59b161a0a1f968fbc01a1db9ea43b93 \ No newline at end of file +c23acba11bfefc019b5945cfb345f9afcf4b6242 \ No newline at end of file diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 6d2a51e5ab..42f7bcdc3a 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -41,6 +41,18 @@ #endif #include +/* Used to get the current process ID */ +#if !defined(_WIN32) +# include +# define GETPID getpid +#elif !defined(_WIN32_WCE) +# ifndef SQLITE_AMALGAMATION +# define WIN32_LEAN_AND_MEAN +# include +# endif +# define GETPID (int)GetCurrentProcessId +#endif + /* * Windows needs to know which symbols to export. Unix does not. * BUILD_sqlite should be undefined for Unix. @@ -3746,7 +3758,16 @@ static void init_all(Tcl_Interp *interp){ #define TCLSH_MAIN main /* Needed to fake out mktclapp */ int TCLSH_MAIN(int argc, char **argv){ Tcl_Interp *interp; - + +#if !defined(_WIN32_WCE) + if( getenv("BREAK") ){ + fprintf(stderr, + "attach debugger to process %d and press any key to continue.\n", + GETPID()); + fgetc(stdin); + } +#endif + /* Call sqlite3_shutdown() once before doing anything else. This is to ** test that sqlite3_shutdown() can be safely called by a process before ** sqlite3_initialize() is. */