New debugging pragmas: PRAGMA vdbe_debug=ON is short-hand for the sql_trace,

vdbe_listing, and vdbe_trace pragmas.  PRAGMA vdbe_debug enables tracing of
sqlite3VdbeAddOp() calls.  None of this is active unless compiled with
SQLITE_DEBUG.

FossilOrigin-Name: ae565ff3e0836b0cb45cc0ba7f27fa8cb2d21d77
This commit is contained in:
drh 2013-01-29 19:14:31 +00:00
parent 47f2239fc1
commit e096205a7f
6 changed files with 18 additions and 27 deletions

View File

@ -1,5 +1,5 @@
C Fix\san\sissue\swith\sthe\sSQLITE_TESTCTRL_EXPLAIN_STMT\sand\scompound\squeries\swith\nmultiple\sterms.
D 2013-01-28T22:52:34.785
C New\sdebugging\spragmas:\s\sPRAGMA\svdbe_debug=ON\sis\sshort-hand\sfor\sthe\ssql_trace,\nvdbe_listing,\sand\svdbe_trace\spragmas.\s\sPRAGMA\svdbe_debug\senables\stracing\sof\nsqlite3VdbeAddOp()\scalls.\s\sNone\sof\sthis\sis\sactive\sunless\scompiled\swith\nSQLITE_DEBUG.
D 2013-01-29T19:14:31.718
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in a48faa9e7dd7d556d84f5456eabe5825dd8a6282
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -168,7 +168,7 @@ F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
F src/pcache.h 1b5dcc3dc8103d03e625b177023ee67764fa6b7c
F src/pcache1.c 9fd22671c270b35131ef480bbc00392b8b5f8ab9
F src/pragma.c b7ef175454106000fae966b3948b19e807bffc89
F src/pragma.c eb9d39e30f00e3ba51892749ddf9d7b86541c43e
F src/prepare.c 931ad0d852a0df48f79adcba6ce79ca5f475625c
F src/printf.c 4a9f882f1c1787a8b494a2987765acf9d97ac21f
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
@ -179,12 +179,12 @@ F src/shell.c 266791241d7add796ccce2317977ae6c3c67d77f
F src/sqlite.h.in 39cc33bb08897c748fe3383c29ccf56585704177
F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477
F src/sqliteInt.h fb4109b7a77d985a39bbd04f1fbc49c940d4e410
F src/sqliteInt.h 6267485592261a1420ae9195e388242d9e451bdb
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
F src/tclsqlite.c 3213f3101e3b85f047d6e389da5a53d76d3d7540
F src/test1.c f62769c989146149590662ab02de4a813813a9c5
F src/test1.c 266c7ff1ca7a4be000f5ee19ef624f8e9c21693d
F src/test2.c 4178056dd1e7d70f954ad8a1e3edb71a2a784daf
F src/test3.c 3c3c2407fa6ec7a19e24ae23f7cb439d0275a60d
F src/test4.c bf9fa9bece01de08e6f5e02314e4af5c13590dfa
@ -243,7 +243,7 @@ F src/vdbe.c f51eb3207594703d24e91335cb16906e894b48aa
F src/vdbe.h b52887278cb173e66188da84dfab216bea61119d
F src/vdbeInt.h c5b337e571752a52aa7157d2ad991b33603b91b9
F src/vdbeapi.c 4c2418161cf45392ba76a7ca92f9a5f06b96f89c
F src/vdbeaux.c ec83f5db5b99db762eefefed1f5e19b513cca38a
F src/vdbeaux.c 8b5d13a2e0a2430f35881eceec762fab8d24e64d
F src/vdbeblob.c 32f2a4899d67f69634ea4dd93e3f651936d732cb
F src/vdbemem.c cb55e84b8e2c15704968ee05f0fae25883299b74
F src/vdbesort.c c61ca318681c0e7267da8be3abfca8469652a7e9
@ -1034,7 +1034,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
P c2462a95ed8e1e69886681400d673207d906bf1b
R 2764eebe1b9b63463757357d22ceb722
P a6499c2521637931661ed4d3afc4f96f91c69785
R 1966f971ee35330a9cfdb2fe42a708ea
U drh
Z 9ef42cd81768a3cc2df7a3bc9ba7e903
Z 4b24169152f5fb24a8eeab17cd2e55a2

View File

@ -1 +1 @@
a6499c2521637931661ed4d3afc4f96f91c69785
ae565ff3e0836b0cb45cc0ba7f27fa8cb2d21d77

View File

@ -184,6 +184,9 @@ static int flagPragma(Parse *pParse, const char *zLeft, const char *zRight){
{ "sql_trace", SQLITE_SqlTrace },
{ "vdbe_listing", SQLITE_VdbeListing },
{ "vdbe_trace", SQLITE_VdbeTrace },
{ "vdbe_addoptrace", SQLITE_VdbeAddopTrace},
{ "vdbe_debug", SQLITE_SqlTrace | SQLITE_VdbeListing
| SQLITE_VdbeTrace },
#endif
#ifndef SQLITE_OMIT_CHECK
{ "ignore_check_constraints", SQLITE_IgnoreChecks },

View File

@ -949,7 +949,7 @@ struct sqlite3 {
#define SQLITE_SqlTrace 0x00000040 /* Debug print SQL as it executes */
#define SQLITE_VdbeListing 0x00000080 /* Debug listings of VDBE programs */
#define SQLITE_WriteSchema 0x00000100 /* OK to update SQLITE_MASTER */
/* 0x00000200 Unused */
#define SQLITE_VdbeAddopTrace 0x00000200 /* Trace sqlite3VdbeAddOp() calls */
#define SQLITE_IgnoreChecks 0x00000400 /* Do not enforce check constraints */
#define SQLITE_ReadUncommitted 0x0000800 /* For shared-cache mode */
#define SQLITE_LegacyFileFmt 0x00001000 /* Create new databases in format 1 */

View File

@ -6299,8 +6299,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
(char*)&query_plan, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
#endif
#ifdef SQLITE_DEBUG
Tcl_LinkVar(interp, "sqlite_addop_trace",
(char*)&sqlite3VdbeAddopTrace, TCL_LINK_INT);
Tcl_LinkVar(interp, "sqlite_where_trace",
(char*)&sqlite3WhereTrace, TCL_LINK_INT);
Tcl_LinkVar(interp, "sqlite_os_trace",

View File

@ -17,18 +17,6 @@
#include "sqliteInt.h"
#include "vdbeInt.h"
/*
** When debugging the code generator in a symbolic debugger, one can
** set the sqlite3VdbeAddopTrace to 1 and all opcodes will be printed
** as they are added to the instruction stream.
*/
#ifdef SQLITE_DEBUG
int sqlite3VdbeAddopTrace = 0;
#endif
/*
** Create a new virtual database engine.
*/
@ -158,7 +146,9 @@ int sqlite3VdbeAddOp3(Vdbe *p, int op, int p1, int p2, int p3){
pOp->p4type = P4_NOTUSED;
#ifdef SQLITE_DEBUG
pOp->zComment = 0;
if( sqlite3VdbeAddopTrace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]);
if( p->db->flags & SQLITE_VdbeAddopTrace ){
sqlite3VdbePrintOp(0, i, &p->aOp[i]);
}
#endif
#ifdef VDBE_PROFILE
pOp->cycles = 0;
@ -512,7 +502,7 @@ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
pOut->p5 = 0;
#ifdef SQLITE_DEBUG
pOut->zComment = 0;
if( sqlite3VdbeAddopTrace ){
if( p->db->flags & SQLITE_VdbeAddopTrace ){
sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]);
}
#endif