diff options
author | drh <drh@noemail.net> | 2012-04-17 09:09:33 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2012-04-17 09:09:33 +0000 |
commit | d8621b90c9caa7d7e1970e98b0c6992d414706a7 (patch) | |
tree | 6c363526de31a431a6785ad101fca2456be45463 /src | |
parent | 8c5058bbdb96a4e9a0392011ad0aa279d1a32e8b (diff) | |
download | sqlite-d8621b90c9caa7d7e1970e98b0c6992d414706a7.tar.gz sqlite-d8621b90c9caa7d7e1970e98b0c6992d414706a7.zip |
Add an undocumented and possibly ephemeral ".breakpoint" command to the
command-line shell, to call a no-op routine on which it is convenient to
set a symbolic debugger breakpoint.
FossilOrigin-Name: 8e2363ad76446e863d03ead91fd621e59d5cb495
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shell.c b/src/shell.c index b4c21ad38..2607e680d 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1563,6 +1563,15 @@ static void sql_trace_callback(void *pArg, const char *z){ } /* +** A no-op routine that runs with the ".breakpoint" doc-command. This is +** a useful spot to set a debugger breakpoint. +*/ +static void test_breakpoint(void){ + static int nCall = 0; + nCall++; +} + +/* ** If an input line begins with "." then invoke this routine to ** process that line. ** @@ -1641,6 +1650,13 @@ static int do_meta_command(char *zLine, struct callback_data *p){ bail_on_error = booleanValue(azArg[1]); }else + /* The undocumented ".breakpoint" command causes a call to the no-op + ** routine named test_breakpoint(). + */ + if( c=='b' && n>=3 && strncmp(azArg[0], "breakpoint", n)==0 ){ + test_breakpoint(); + }else + if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 && nArg==1 ){ struct callback_data data; char *zErrMsg = 0; |