mirror of
				https://github.com/sqlite/sqlite.git
				synced 2025-11-03 16:53:36 +03:00 
			
		
		
		
	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
This commit is contained in:
		
							
								
								
									
										16
									
								
								src/shell.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/shell.c
									
									
									
									
									
								
							@@ -1562,6 +1562,15 @@ static void sql_trace_callback(void *pArg, const char *z){
 | 
			
		||||
  if( f ) fprintf(f, "%s\n", 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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user