System.Data.SQLite

Check-in [3ad43e2de3]
Login

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

Overview
Comment:Prevent inlining of tracing methods that deal with stack frame introspection (i.e. fix method names reported in the log file).
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3ad43e2de3dd09a4ce6efde747f2ac148ff45758
User & Date: mistachkin 2011-08-10 02:49:24.692
Context
2011-08-10
03:28
Move configuration class code closer to the other helper classes. Mark delegates as internal. check-in: a748b76dc9 user: mistachkin tags: trunk
02:49
Prevent inlining of tracing methods that deal with stack frame introspection (i.e. fix method names reported in the log file). check-in: 3ad43e2de3 user: mistachkin tags: trunk
2011-08-09
22:24
Refactor installer registry key helper methods into their own class and keep track of basic usage stats for reporting at the end. check-in: 7ff0314780 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to tools/install/Installer.cs.
1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
/*
 * Installer.cs --
 *
 * Written by Joe Mistachkin.
 * Released to the public domain, use at your own risk!
 */

using System.Collections.Generic;
using System.Diagnostics;
using System.EnterpriseServices.Internal;
using System.IO;
using System.Reflection;

using System.Threading;
using System.Windows.Forms;
using System.Xml;
using Microsoft.Win32;

namespace System.Data.SQLite
{












>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Installer.cs --
 *
 * Written by Joe Mistachkin.
 * Released to the public domain, use at your own risk!
 */

using System.Collections.Generic;
using System.Diagnostics;
using System.EnterpriseServices.Internal;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows.Forms;
using System.Xml;
using Microsoft.Win32;

namespace System.Data.SQLite
{
242
243
244
245
246
247
248

249
250
251
252
253
254
255
            public static string TimeStamp(DateTime dateTime)
            {
                return dateTime.ToString(Iso8601DateTimeOutputFormat);
            }

            ///////////////////////////////////////////////////////////////////


            private static string GetMethodName(
                StackTrace stackTrace,
                int level
                )
            {
                try
                {







>







243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
            public static string TimeStamp(DateTime dateTime)
            {
                return dateTime.ToString(Iso8601DateTimeOutputFormat);
            }

            ///////////////////////////////////////////////////////////////////

            [MethodImpl(MethodImplOptions.NoInlining)]
            private static string GetMethodName(
                StackTrace stackTrace,
                int level
                )
            {
                try
                {
319
320
321
322
323
324
325

326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341

342
343
344
345
346
347
348
349
350
351
352

353
354
355
356
357
358
359
                    System.Diagnostics.Trace.WriteLine(message, category);
                    System.Diagnostics.Trace.Flush();
                }
            }

            ///////////////////////////////////////////////////////////////////


            public static string Trace(
                TraceCallback traceCallback,
                Exception exception,
                string category
                )
            {
                if (exception != null)
                    return Trace(traceCallback,
                        new StackTrace(exception, true), 0,
                        exception.ToString(), category);

                return null;
            }

            ///////////////////////////////////////////////////////////////////


            public static string Trace(
                TraceCallback traceCallback,
                string message,
                string category
                )
            {
                return Trace(traceCallback, null, 0, message, category);
            }

            ///////////////////////////////////////////////////////////////////


            private static string Trace(
                TraceCallback traceCallback,
                StackTrace stackTrace,
                int level,
                string message,
                string category
                )







>
















>






|




>







321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
                    System.Diagnostics.Trace.WriteLine(message, category);
                    System.Diagnostics.Trace.Flush();
                }
            }

            ///////////////////////////////////////////////////////////////////

            [MethodImpl(MethodImplOptions.NoInlining)]
            public static string Trace(
                TraceCallback traceCallback,
                Exception exception,
                string category
                )
            {
                if (exception != null)
                    return Trace(traceCallback,
                        new StackTrace(exception, true), 0,
                        exception.ToString(), category);

                return null;
            }

            ///////////////////////////////////////////////////////////////////

            [MethodImpl(MethodImplOptions.NoInlining)]
            public static string Trace(
                TraceCallback traceCallback,
                string message,
                string category
                )
            {
                return Trace(traceCallback, null, 1, message, category);
            }

            ///////////////////////////////////////////////////////////////////

            [MethodImpl(MethodImplOptions.NoInlining)]
            private static string Trace(
                TraceCallback traceCallback,
                StackTrace stackTrace,
                int level,
                string message,
                string category
                )
1644
1645
1646
1647
1648
1649
1650

1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
                        return false;
                    }
                    else
                    {
                        if (localSaved && !saved)
                            saved = true;


                        TraceOps.Trace(traceCallback, String.Format(
                            "localSaved = {0}, saved = {1}", localSaved,
                            saved), traceCategory);
                    }
                }
            }

            return true;
        }








>
|
|
|







1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
                        return false;
                    }
                    else
                    {
                        if (localSaved && !saved)
                            saved = true;

                        if (verbose)
                            TraceOps.Trace(traceCallback, String.Format(
                                "localSaved = {0}, saved = {1}", localSaved,
                                saved), traceCategory);
                    }
                }
            }

            return true;
        }

3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
            {
                if (all)
                    return ((installFlags & hasFlags) == hasFlags);
                else
                    return ((installFlags & hasFlags) != InstallFlags.None);
            }

            ///////////////////////////////////////////////////////////////////////

            public void Dump()
            {
                if (traceCallback != null)
                {
                    traceCallback(String.Format(NameAndValueFormat,
                        "Assembly", ForDisplay(assembly)),







|







3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
            {
                if (all)
                    return ((installFlags & hasFlags) == hasFlags);
                else
                    return ((installFlags & hasFlags) != InstallFlags.None);
            }

            ///////////////////////////////////////////////////////////////////

            public void Dump()
            {
                if (traceCallback != null)
                {
                    traceCallback(String.Format(NameAndValueFormat,
                        "Assembly", ForDisplay(assembly)),