From 34a8065f495147ace8564548a97c91579d0b7028 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 27 Mar 2015 00:19:31 +0000 Subject: [PATCH 1/4] In the MSVC Makefile, make the DYNAMIC_SHELL option work without USE_STDCALL. FossilOrigin-Name: 25b46a9c7e03a84bee2ffddc6d7fd6ae280e9d7b --- Makefile.msc | 6 +++--- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 837fc003c0..7e6a077ffb 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -331,7 +331,7 @@ SHELL_CCONV_OPTS = # These are additional compiler options used for the core library. # !IFNDEF CORE_COMPILE_OPTS -!IF $(USE_STDCALL)!=0 +!IF $(DYNAMIC_SHELL)!=0 CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) -DSQLITE_API=__declspec(dllexport) !ELSE CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) @@ -342,7 +342,7 @@ CORE_COMPILE_OPTS = $(CORE_CCONV_OPTS) # when linking. # !IFNDEF CORE_LINK_DEP -!IF $(USE_STDCALL)!=0 +!IF $(DYNAMIC_SHELL)!=0 CORE_LINK_DEP = !ELSE CORE_LINK_DEP = sqlite3.def @@ -352,7 +352,7 @@ CORE_LINK_DEP = sqlite3.def # These are additional linker options used for the core library. # !IFNDEF CORE_LINK_OPTS -!IF $(USE_STDCALL)!=0 +!IF $(DYNAMIC_SHELL)!=0 CORE_LINK_OPTS = !ELSE CORE_LINK_OPTS = /DEF:sqlite3.def diff --git a/manifest b/manifest index 8c7cd354d7..f180feac72 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Revise\sWin32\slocking\stest\sto\saccount\sfor\srecent\slog\smessage\schanges. -D 2015-03-26T18:24:26.716 +C In\sthe\sMSVC\sMakefile,\smake\sthe\sDYNAMIC_SHELL\soption\swork\swithout\sUSE_STDCALL. +D 2015-03-27T00:19:31.300 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 -F Makefile.msc 3481e2dd260968742c715542db178c2bdd5db99f +F Makefile.msc 23e6eaa84569829c3e7f409513caa136e5bcaf2a F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866 F VERSION 319eb1ced4b4d17a67730f2b7b85f15c1346cb60 @@ -1247,7 +1247,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 3e872011ff5e27738c282f46d2b5803d94fe4b76 -R 72196f1f01590aeab1e66e07214515fd +P 1bc76339e8542770bff7829a3dd346680950c0a5 +R 0d57eafd4468edd6e6285fb5978d1b4c U mistachkin -Z 13c90271975eca10437167897808ec14 +Z 9f68da42d0682346a204d1bd4bb0b359 diff --git a/manifest.uuid b/manifest.uuid index 1084c3d448..44cdf4be9e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1bc76339e8542770bff7829a3dd346680950c0a5 \ No newline at end of file +25b46a9c7e03a84bee2ffddc6d7fd6ae280e9d7b \ No newline at end of file From 9871a933c143dfe61281aaa6d8107dee7aab4650 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 27 Mar 2015 00:21:52 +0000 Subject: [PATCH 2/4] Using MSVC, get the sqlite3IoTrace variable working with the USE_STDCALL and/or DYNAMIC_SHELL options. FossilOrigin-Name: fe976c9130f6eecfa0a10347ee3f800f32051b89 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/main.c | 2 +- src/shell.c | 4 ++-- src/sqliteInt.h | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index f180feac72..3a717ccebb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sthe\sMSVC\sMakefile,\smake\sthe\sDYNAMIC_SHELL\soption\swork\swithout\sUSE_STDCALL. -D 2015-03-27T00:19:31.300 +C Using\sMSVC,\sget\sthe\ssqlite3IoTrace\svariable\sworking\swith\sthe\sUSE_STDCALL\sand/or\sDYNAMIC_SHELL\soptions. +D 2015-03-27T00:21:52.785 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770 F src/loadext.c 86bd4e2fccd520b748cba52492ab60c4a770f660 -F src/main.c 569d45ba9eb4fbdd631d53f440bcdb4a35ab1505 +F src/main.c 40e333960d53f7d50ee8ce09d40431c87ea653f2 F src/malloc.c 6a370b83d54e4bbf6f94021221c2a311cff26a18 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 F src/mem1.c abe6ee469b6c5a35c7f22bfeb9c9bac664a1c987 @@ -231,11 +231,11 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f4d79e31ffa5820c2e3d1740baa5e9b190425f2b F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c 72ffb62e2879956302140e9f6e6ae88aee36b0e5 -F src/shell.c 3ae1e53878d2804fe77b8c8f1f6ca287a0e5d80e +F src/shell.c f21e91ab78e7b681e5c3c8d7f7a5b92f5583ed7a F src/sqlite.h.in 278602140d49575e8708e643161f4263e428a02a F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d -F src/sqliteInt.h bedf15914c09bfb5fe3ec4e3f211a4a6fc42cd33 +F src/sqliteInt.h d02d2b85cb02a38bc442cf9302ec8209baf6771d F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46 F src/status.c f266ad8a2892d659b74f0f50cb6a88b6e7c12179 F src/table.c e7a09215315a978057fb42c640f890160dbcc45e @@ -1247,7 +1247,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1bc76339e8542770bff7829a3dd346680950c0a5 -R 0d57eafd4468edd6e6285fb5978d1b4c +P 25b46a9c7e03a84bee2ffddc6d7fd6ae280e9d7b +R a3ab1f66556079c5bd7cf506cd3f9f92 U mistachkin -Z 9f68da42d0682346a204d1bd4bb0b359 +Z 0ec554b2258cca84ae33b3fc6f4637d7 diff --git a/manifest.uuid b/manifest.uuid index 44cdf4be9e..88bef69794 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -25b46a9c7e03a84bee2ffddc6d7fd6ae280e9d7b \ No newline at end of file +fe976c9130f6eecfa0a10347ee3f800f32051b89 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 6967131143..d9ee77fab2 100644 --- a/src/main.c +++ b/src/main.c @@ -62,7 +62,7 @@ int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } ** I/O active are written using this function. These messages ** are intended for debugging activity only. */ -/* not-private */ void (*sqlite3IoTrace)(const char*, ...) = 0; +SQLITE_API void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...) = 0; #endif /* diff --git a/src/shell.c b/src/shell.c index b31ea16333..14ac9bc72d 100644 --- a/src/shell.c +++ b/src/shell.c @@ -370,7 +370,7 @@ static FILE *iotrace = 0; ** is written to iotrace. */ #ifdef SQLITE_ENABLE_IOTRACE -static void iotracePrintf(const char *zFormat, ...){ +static void SQLITE_CDECL iotracePrintf(const char *zFormat, ...){ va_list ap; char *z; if( iotrace==0 ) return; @@ -3144,7 +3144,7 @@ static int do_meta_command(char *zLine, ShellState *p){ #ifdef SQLITE_ENABLE_IOTRACE if( c=='i' && strncmp(azArg[0], "iotrace", n)==0 ){ - extern void (*sqlite3IoTrace)(const char*, ...); + SQLITE_API extern void (SQLITE_CDECL *sqlite3IoTrace)(const char*, ...); if( iotrace && iotrace!=stdout ) fclose(iotrace); iotrace = 0; if( nArg<2 ){ diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 9df6d1bc4e..3841c91f14 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -3803,7 +3803,7 @@ void sqlite3Put4byte(u8*, u32); #ifdef SQLITE_ENABLE_IOTRACE # define IOTRACE(A) if( sqlite3IoTrace ){ sqlite3IoTrace A; } void sqlite3VdbeIOTraceSql(Vdbe*); -SQLITE_EXTERN void (*sqlite3IoTrace)(const char*,...); +SQLITE_API SQLITE_EXTERN void (SQLITE_CDECL *sqlite3IoTrace)(const char*,...); #else # define IOTRACE(A) # define sqlite3VdbeIOTraceSql(X) From 6f5a37a4649b800203006f23dbc63b0514d49517 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 27 Mar 2015 02:27:20 +0000 Subject: [PATCH 3/4] Fix the ".testctrl imposter" command in the command-line shell to be consistent in error reporting and results with the other .testctrl commands. FossilOrigin-Name: 0ec08ba8a0fa188146b071a489908332693ba59a --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 3a717ccebb..ddfb25e98b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Using\sMSVC,\sget\sthe\ssqlite3IoTrace\svariable\sworking\swith\sthe\sUSE_STDCALL\sand/or\sDYNAMIC_SHELL\soptions. -D 2015-03-27T00:21:52.785 +C Fix\sthe\s".testctrl\simposter"\scommand\sin\sthe\scommand-line\sshell\sto\sbe\nconsistent\sin\serror\sreporting\sand\sresults\swith\sthe\sother\s.testctrl\ncommands. +D 2015-03-27T02:27:20.756 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -231,7 +231,7 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696 F src/resolve.c f4d79e31ffa5820c2e3d1740baa5e9b190425f2b F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e F src/select.c 72ffb62e2879956302140e9f6e6ae88aee36b0e5 -F src/shell.c f21e91ab78e7b681e5c3c8d7f7a5b92f5583ed7a +F src/shell.c 84a1593bd86aaa14f4da8a8f9b16fbc239d262aa F src/sqlite.h.in 278602140d49575e8708e643161f4263e428a02a F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d @@ -1247,7 +1247,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 25b46a9c7e03a84bee2ffddc6d7fd6ae280e9d7b -R a3ab1f66556079c5bd7cf506cd3f9f92 -U mistachkin -Z 0ec554b2258cca84ae33b3fc6f4637d7 +P fe976c9130f6eecfa0a10347ee3f800f32051b89 +R 13326ac5b127e703532d322e93f2a662 +U drh +Z b2f8062e547cfe60af29856c986c54f4 diff --git a/manifest.uuid b/manifest.uuid index 88bef69794..980d7d833a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -fe976c9130f6eecfa0a10347ee3f800f32051b89 \ No newline at end of file +0ec08ba8a0fa188146b071a489908332693ba59a \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 14ac9bc72d..7ff3eb6cb0 100644 --- a/src/shell.c +++ b/src/shell.c @@ -3803,9 +3803,9 @@ static int do_meta_command(char *zLine, ShellState *p){ azArg[2], integerValue(azArg[3]), integerValue(azArg[4])); + fprintf(p->out, "%d (0x%08x)\n", rc, rc); }else{ - fprintf(stderr,"Usage: .testctrl initmode dbName onoff tnum\n"); - rc = 1; + fprintf(stderr,"Usage: .testctrl imposter dbName onoff tnum\n"); } break; From ad1e55e55a869106c181ab278f89cc1bd6705b19 Mon Sep 17 00:00:00 2001 From: mistachkin Date: Fri, 27 Mar 2015 18:20:25 +0000 Subject: [PATCH 4/4] Enhancements to OSTRACE usage in the Win32 VFS. FossilOrigin-Name: ab5800291e1908b5b51d912feeacf748dc9be14b --- manifest | 14 ++++++------ manifest.uuid | 2 +- src/os_win.c | 60 +++++++++++++++++++++++++++++++++------------------ 3 files changed, 47 insertions(+), 29 deletions(-) diff --git a/manifest b/manifest index ddfb25e98b..98c814021d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\s".testctrl\simposter"\scommand\sin\sthe\scommand-line\sshell\sto\sbe\nconsistent\sin\serror\sreporting\sand\sresults\swith\sthe\sother\s.testctrl\ncommands. -D 2015-03-27T02:27:20.756 +C Enhancements\sto\sOSTRACE\susage\sin\sthe\sWin32\sVFS. +D 2015-03-27T18:20:25.776 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -215,7 +215,7 @@ F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa F src/os_unix.c a4dadbc2da41599e99093e91e276c38c17a73b89 -F src/os_win.c f65255fdc30c90bab195989776797e98dc89d709 +F src/os_win.c 865ba15878eded98bb29a97ac898f2a799dc481a F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca F src/pager.c 4120a49ecd37697e28f5ed807f470b9c0b88410c F src/pager.h c3476e7c89cdf1c6914e50a11f3714e30b4e0a77 @@ -1247,7 +1247,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P fe976c9130f6eecfa0a10347ee3f800f32051b89 -R 13326ac5b127e703532d322e93f2a662 -U drh -Z b2f8062e547cfe60af29856c986c54f4 +P 0ec08ba8a0fa188146b071a489908332693ba59a +R 5fa56a67857aa9aa0bfe9c8eabbd7f2b +U mistachkin +Z 22e64f81a05ea0084d0b656c0478e6e9 diff --git a/manifest.uuid b/manifest.uuid index 980d7d833a..50a77b66aa 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0ec08ba8a0fa188146b071a489908332693ba59a \ No newline at end of file +ab5800291e1908b5b51d912feeacf748dc9be14b \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index 7a95b77a58..e40114000d 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -2450,7 +2450,8 @@ static int winClose(sqlite3_file *id){ assert( pFile->pShm==0 ); #endif assert( pFile->h!=NULL && pFile->h!=INVALID_HANDLE_VALUE ); - OSTRACE(("CLOSE file=%p\n", pFile->h)); + OSTRACE(("CLOSE pid=%lu, pFile=%p, file=%p\n", + osGetCurrentProcessId(), pFile, pFile->h)); #if SQLITE_MAX_MMAP_SIZE>0 winUnmapfile(pFile); @@ -2479,7 +2480,8 @@ static int winClose(sqlite3_file *id){ pFile->h = NULL; } OpenCounter(-1); - OSTRACE(("CLOSE file=%p, rc=%s\n", pFile->h, rc ? "ok" : "failed")); + OSTRACE(("CLOSE pid=%lu, pFile=%p, file=%p, rc=%s\n", + osGetCurrentProcessId(), pFile, pFile->h, rc ? "ok" : "failed")); return rc ? SQLITE_OK : winLogError(SQLITE_IOERR_CLOSE, osGetLastError(), "winClose", pFile->zPath); @@ -2507,7 +2509,8 @@ static int winRead( assert( amt>0 ); assert( offset>=0 ); SimulateIOError(return SQLITE_IOERR_READ); - OSTRACE(("READ file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n", + OSTRACE(("READ pid=%lu, pFile=%p, file=%p, buffer=%p, amount=%d, " + "offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile, pFile->h, pBuf, amt, offset, pFile->locktype)); #if SQLITE_MAX_MMAP_SIZE>0 @@ -2516,7 +2519,8 @@ static int winRead( if( offsetmmapSize ){ if( offset+amt <= pFile->mmapSize ){ memcpy(pBuf, &((u8 *)(pFile->pMapRegion))[offset], amt); - OSTRACE(("READ-MMAP file=%p, rc=SQLITE_OK\n", pFile->h)); + OSTRACE(("READ-MMAP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n", + osGetCurrentProcessId(), pFile, pFile->h)); return SQLITE_OK; }else{ int nCopy = (int)(pFile->mmapSize - offset); @@ -2530,7 +2534,8 @@ static int winRead( #if SQLITE_OS_WINCE || defined(SQLITE_WIN32_NO_OVERLAPPED) if( winSeekFile(pFile, offset) ){ - OSTRACE(("READ file=%p, rc=SQLITE_FULL\n", pFile->h)); + OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_FULL\n", + osGetCurrentProcessId(), pFile, pFile->h)); return SQLITE_FULL; } while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){ @@ -2544,7 +2549,8 @@ static int winRead( DWORD lastErrno; if( winRetryIoerr(&nRetry, &lastErrno) ) continue; pFile->lastErrno = lastErrno; - OSTRACE(("READ file=%p, rc=SQLITE_IOERR_READ\n", pFile->h)); + OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_READ\n", + osGetCurrentProcessId(), pFile, pFile->h)); return winLogError(SQLITE_IOERR_READ, pFile->lastErrno, "winRead", pFile->zPath); } @@ -2552,11 +2558,13 @@ static int winRead( if( nRead<(DWORD)amt ){ /* Unread parts of the buffer must be zero-filled */ memset(&((char*)pBuf)[nRead], 0, amt-nRead); - OSTRACE(("READ file=%p, rc=SQLITE_IOERR_SHORT_READ\n", pFile->h)); + OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_SHORT_READ\n", + osGetCurrentProcessId(), pFile, pFile->h)); return SQLITE_IOERR_SHORT_READ; } - OSTRACE(("READ file=%p, rc=SQLITE_OK\n", pFile->h)); + OSTRACE(("READ pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n", + osGetCurrentProcessId(), pFile, pFile->h)); return SQLITE_OK; } @@ -2579,7 +2587,8 @@ static int winWrite( SimulateIOError(return SQLITE_IOERR_WRITE); SimulateDiskfullError(return SQLITE_FULL); - OSTRACE(("WRITE file=%p, buffer=%p, amount=%d, offset=%lld, lock=%d\n", + OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, buffer=%p, amount=%d, " + "offset=%lld, lock=%d\n", osGetCurrentProcessId(), pFile, pFile->h, pBuf, amt, offset, pFile->locktype)); #if SQLITE_MAX_MMAP_SIZE>0 @@ -2588,7 +2597,8 @@ static int winWrite( if( offsetmmapSize ){ if( offset+amt <= pFile->mmapSize ){ memcpy(&((u8 *)(pFile->pMapRegion))[offset], pBuf, amt); - OSTRACE(("WRITE-MMAP file=%p, rc=SQLITE_OK\n", pFile->h)); + OSTRACE(("WRITE-MMAP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n", + osGetCurrentProcessId(), pFile, pFile->h)); return SQLITE_OK; }else{ int nCopy = (int)(pFile->mmapSize - offset); @@ -2651,17 +2661,20 @@ static int winWrite( if( rc ){ if( ( pFile->lastErrno==ERROR_HANDLE_DISK_FULL ) || ( pFile->lastErrno==ERROR_DISK_FULL )){ - OSTRACE(("WRITE file=%p, rc=SQLITE_FULL\n", pFile->h)); + OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_FULL\n", + osGetCurrentProcessId(), pFile, pFile->h)); return winLogError(SQLITE_FULL, pFile->lastErrno, "winWrite1", pFile->zPath); } - OSTRACE(("WRITE file=%p, rc=SQLITE_IOERR_WRITE\n", pFile->h)); + OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_WRITE\n", + osGetCurrentProcessId(), pFile, pFile->h)); return winLogError(SQLITE_IOERR_WRITE, pFile->lastErrno, "winWrite2", pFile->zPath); }else{ winLogIoerr(nRetry, __LINE__); } - OSTRACE(("WRITE file=%p, rc=SQLITE_OK\n", pFile->h)); + OSTRACE(("WRITE pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n", + osGetCurrentProcessId(), pFile, pFile->h)); return SQLITE_OK; } @@ -2675,8 +2688,8 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){ assert( pFile ); SimulateIOError(return SQLITE_IOERR_TRUNCATE); - OSTRACE(("TRUNCATE file=%p, size=%lld, lock=%d\n", - pFile->h, nByte, pFile->locktype)); + OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, size=%lld, lock=%d\n", + osGetCurrentProcessId(), pFile, pFile->h, nByte, pFile->locktype)); /* If the user has configured a chunk-size for this file, truncate the ** file so that it consists of an integer number of chunks (i.e. the @@ -2708,7 +2721,8 @@ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){ } #endif - OSTRACE(("TRUNCATE file=%p, rc=%s\n", pFile->h, sqlite3ErrName(rc))); + OSTRACE(("TRUNCATE pid=%lu, pFile=%p, file=%p, rc=%s\n", + osGetCurrentProcessId(), pFile, pFile->h, sqlite3ErrName(rc))); return rc; } @@ -2753,8 +2767,9 @@ static int winSync(sqlite3_file *id, int flags){ */ SimulateDiskfullError( return SQLITE_FULL ); - OSTRACE(("SYNC file=%p, flags=%x, lock=%d\n", - pFile->h, flags, pFile->locktype)); + OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, flags=%x, lock=%d\n", + osGetCurrentProcessId(), pFile, pFile->h, flags, + pFile->locktype)); #ifndef SQLITE_TEST UNUSED_PARAMETER(flags); @@ -2769,17 +2784,20 @@ static int winSync(sqlite3_file *id, int flags){ ** no-op */ #ifdef SQLITE_NO_SYNC - OSTRACE(("SYNC-NOP file=%p, rc=SQLITE_OK\n", pFile->h)); + OSTRACE(("SYNC-NOP pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n", + osGetCurrentProcessId(), pFile, pFile->h)); return SQLITE_OK; #else rc = osFlushFileBuffers(pFile->h); SimulateIOError( rc=FALSE ); if( rc ){ - OSTRACE(("SYNC file=%p, rc=SQLITE_OK\n", pFile->h)); + OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, rc=SQLITE_OK\n", + osGetCurrentProcessId(), pFile, pFile->h)); return SQLITE_OK; }else{ pFile->lastErrno = osGetLastError(); - OSTRACE(("SYNC file=%p, rc=SQLITE_IOERR_FSYNC\n", pFile->h)); + OSTRACE(("SYNC pid=%lu, pFile=%p, file=%p, rc=SQLITE_IOERR_FSYNC\n", + osGetCurrentProcessId(), pFile, pFile->h)); return winLogError(SQLITE_IOERR_FSYNC, pFile->lastErrno, "winSync", pFile->zPath); }