1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Add the test_trace_breakpoint() subroutine that is invoked after each

instruction is printed while running PRAGMA vdbe_trace=on.  Only works for
SQLITE_DEBUG builds.  Also add parameters "pc" and "pOp" to 
test_addop_breakpoint() to make it easier to set conditionals.

FossilOrigin-Name: 49a6368c384178653cb3ccb58cc8eff93327c16929bf79eeefeb13a4ce897153
This commit is contained in:
drh
2020-01-02 13:26:49 +00:00
parent 629b88c683
commit 52f11b885a
5 changed files with 42 additions and 14 deletions

View File

@@ -117,6 +117,26 @@ int sqlite3_found_count = 0;
# define UPDATE_MAX_BLOBSIZE(P)
#endif
#ifdef SQLITE_DEBUG
/* This routine provides a convenient place to set a breakpoint during
** tracing with PRAGMA vdbe_trace=on. The breakpoint fires right after
** each opcode is printed. Variables "pc" (program counter) and pOp are
** available to add conditionals to the breakpoint. GDB example:
**
** break test_trace_breakpoint if pc=22
**
** Other useful labels for breakpoints include:
** test_addop_breakpoint(pc,pOp)
** sqlite3CorruptError(lineno)
** sqlite3MisuseError(lineno)
** sqlite3CantopenError(lineno)
*/
static void test_trace_breakpoint(int pc, Op *pOp){
static int n = 0;
n++;
}
#endif
/*
** Invoke the VDBE coverage callback, if that callback is defined. This
** feature is used for test suite validation only and does not appear an
@@ -738,6 +758,7 @@ int sqlite3VdbeExec(
#ifdef SQLITE_DEBUG
if( db->flags & SQLITE_VdbeTrace ){
sqlite3VdbePrintOp(stdout, (int)(pOp - aOp), pOp);
test_trace_breakpoint((int)(pOp - aOp),pOp);
}
#endif