/ Check-in [8e2363ad]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8e2363ad76446e863d03ead91fd621e59d5cb495
User & Date: drh 2012-04-17 09:09:33
Context
2012-04-17
16:38
Improved handling of aggregate subqueries within an aggregate query. check-in: 430bb59d user: drh tags: trunk
09:09
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. check-in: 8e2363ad user: drh tags: trunk
2012-04-16
17:22
Fix a bug in the command-line shell logic that attempts to continue with a ".dump" even after encountering database corruption. check-in: 020b5e90 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  1557   1557   /*
  1558   1558   ** A routine for handling output from sqlite3_trace().
  1559   1559   */
  1560   1560   static void sql_trace_callback(void *pArg, const char *z){
  1561   1561     FILE *f = (FILE*)pArg;
  1562   1562     if( f ) fprintf(f, "%s\n", z);
  1563   1563   }
         1564  +
         1565  +/*
         1566  +** A no-op routine that runs with the ".breakpoint" doc-command.  This is
         1567  +** a useful spot to set a debugger breakpoint.
         1568  +*/
         1569  +static void test_breakpoint(void){
         1570  +  static int nCall = 0;
         1571  +  nCall++;
         1572  +}
  1564   1573   
  1565   1574   /*
  1566   1575   ** If an input line begins with "." then invoke this routine to
  1567   1576   ** process that line.
  1568   1577   **
  1569   1578   ** Return 1 on error, 2 to exit, and 0 otherwise.
  1570   1579   */
................................................................................
  1636   1645       }
  1637   1646       sqlite3_close(pDest);
  1638   1647     }else
  1639   1648   
  1640   1649     if( c=='b' && n>=3 && strncmp(azArg[0], "bail", n)==0 && nArg>1 && nArg<3 ){
  1641   1650       bail_on_error = booleanValue(azArg[1]);
  1642   1651     }else
         1652  +
         1653  +  /* The undocumented ".breakpoint" command causes a call to the no-op
         1654  +  ** routine named test_breakpoint().
         1655  +  */
         1656  +  if( c=='b' && n>=3 && strncmp(azArg[0], "breakpoint", n)==0 ){
         1657  +    test_breakpoint();
         1658  +  }else
  1643   1659   
  1644   1660     if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 && nArg==1 ){
  1645   1661       struct callback_data data;
  1646   1662       char *zErrMsg = 0;
  1647   1663       open_db(p);
  1648   1664       memcpy(&data, p, sizeof(data));
  1649   1665       data.showHeader = 1;