System.Data.SQLite
Check-in [9221073c65]
Not logged in

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

Overview
Comment:Fixes and enhancements to the internal debugging interfaces.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9221073c65d002066ba3eeb14f74c351762b80e7
User & Date: mistachkin 2018-01-25 21:43:05
Context
2018-01-25
23:52
Further fixes to the internal debugging interfaces, primarily focused on thread-safety. check-in: 29690b4981 user: mistachkin tags: trunk
21:44
Merge updates from trunk. check-in: a363e907fe user: mistachkin tags: tkt-5cee5409f8
21:43
Fixes and enhancements to the internal debugging interfaces. check-in: 9221073c65 user: mistachkin tags: trunk
2018-01-24
19:53
Additions and corrections to the DbType mapping related lookup tables. Pursuant to ticket [a799e3978f]. check-in: 939cc5db59 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.

   135    135                 if (otherCounts == null)
   136    136                     otherCounts = new Dictionary<string, int>();
   137    137             }
   138    138         }
   139    139   
   140    140         /////////////////////////////////////////////////////////////////////////
   141    141   
          142  +      /// <summary>
          143  +      /// Queries the read counts for the runtime configuration settings.
          144  +      /// These numbers are used for debugging and testing purposes only.
          145  +      /// </summary>
          146  +      /// <param name="viaFile">
          147  +      /// Non-zero if the specified setting is being read from the XML
          148  +      /// configuration file.
          149  +      /// </param>
          150  +      /// <returns>
          151  +      /// A copy of the statistics for the specified runtime configuration
          152  +      /// settings -OR- null if they are not available.
          153  +      /// </returns>
          154  +      public static object GetSettingReadCounts(
          155  +          bool viaFile
          156  +          )
          157  +      {
          158  +          lock (staticSyncRoot)
          159  +          {
          160  +              if (viaFile)
          161  +              {
          162  +                  if (settingFileReadCounts == null)
          163  +                      return null;
          164  +
          165  +                  return new Dictionary<string, int>(settingFileReadCounts);
          166  +              }
          167  +              else
          168  +              {
          169  +                  if (settingReadCounts == null)
          170  +                      return null;
          171  +
          172  +                  return new Dictionary<string, int>(settingReadCounts);
          173  +              }
          174  +          }
          175  +      }
          176  +
          177  +      /////////////////////////////////////////////////////////////////////////
          178  +
   142    179         /// <summary>
   143    180         /// Increments the read count for the specified runtime configuration
   144    181         /// setting.  These numbers are used for debugging and testing purposes
   145    182         /// only.
   146    183         /// </summary>
   147    184         /// <param name="name">
   148    185         /// The name of the setting being read.
................................................................................
   329    366             return false;
   330    367         }
   331    368         #endregion
   332    369   
   333    370         /////////////////////////////////////////////////////////////////////////
   334    371   
   335    372         #region Internal Methods
          373  +      /// <summary>
          374  +      /// Resets the cached value for the "PreLoadSQLite_BreakIntoDebugger"
          375  +      /// configuration setting.
          376  +      /// </summary>
          377  +      internal static void ResetBreakIntoDebugger()
          378  +      {
          379  +          lock (staticSyncRoot)
          380  +          {
          381  +              debuggerBreak = null;
          382  +          }
          383  +      }
          384  +
          385  +      /////////////////////////////////////////////////////////////////////////
          386  +
   336    387         /// <summary>
   337    388         /// If the "PreLoadSQLite_BreakIntoDebugger" configuration setting is
   338    389         /// present (e.g. via the environment), give the interactive user an
   339    390         /// opportunity to attach a debugger to the current process; otherwise,
   340    391         /// do nothing.
   341    392         /// </summary>
   342    393         internal static void MaybeBreakIntoDebugger()
................................................................................
   408    459                     {
   409    460                         debuggerBreak = false;
   410    461                     }
   411    462   
   412    463                     throw;
   413    464                 }
   414    465             }
          466  +          else
          467  +          {
          468  +              //
          469  +              // BUGFIX: There is (almost) no point in checking for the
          470  +              //         associated configuration setting repeatedly.
          471  +              //         Prevent that here by setting the cached value
          472  +              //         to false.
          473  +              //
          474  +              lock (staticSyncRoot)
          475  +              {
          476  +                  debuggerBreak = false;
          477  +              }
          478  +          }
   415    479         }
   416    480   
   417    481         /////////////////////////////////////////////////////////////////////////
   418    482   
   419    483         /// <summary>
   420    484         /// Determines if preparing a query should be logged.
   421    485         /// </summary>