コード例 #1
0
ファイル: SOS.cs プロジェクト: mikkelbu/diagnostics
    private async Task RunTest(TestConfiguration config, string testName, string debuggeeName, string scriptName, string debuggeeArguments = null, bool useCreateDump = true)
    {
        SkipIfArm(config);

        // Live
        using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName, debuggeeName, debuggeeArguments))
        {
            await runner.RunScript(scriptName);
        }

        // Generate a crash dump.
        if (IsCreateDumpConfig(config))
        {
            await SOSRunner.CreateDump(config, Output, testName, debuggeeName, debuggeeArguments, useCreateDump);
        }

        // Test against a crash dump.
        if (IsOpenDumpConfig(config))
        {
            // With cdb (Windows) or lldb (Linux or OSX)
            using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName, debuggeeName, debuggeeArguments, SOSRunner.Options.LoadDump))
            {
                await runner.RunScript(scriptName);
            }

            // With the dotnet-dump analyze tool
            if (OS.Kind == OSKind.Linux)
            {
                using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName, debuggeeName, debuggeeArguments, SOSRunner.Options.LoadDumpWithDotNetDump))
                {
                    await runner.RunScript(scriptName);
                }
            }
        }
    }
コード例 #2
0
ファイル: SOS.cs プロジェクト: cshung/diagnostics
    private async Task RunTest(string scriptName, bool testLive = true, bool testDump = true, SOSRunner.TestInformation information = null)
    {
        information.OutputHelper = Output;

        if (testLive)
        {
            // Live
            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.Live))
            {
                await runner.RunScript(scriptName);
            }
        }

        if (testDump)
        {
            string dumpName = null;

            // Create and test dumps on OSX or Alpine only if the runtime is 6.0 or greater
            if (!(OS.Kind == OSKind.OSX || OS.IsAlpine) || information.TestConfiguration.RuntimeFrameworkVersionMajor > 5)
            {
                // Generate a crash dump.
                if (information.DebuggeeDumpOutputRootDir != null)
                {
                    dumpName = await SOSRunner.CreateDump(information);
                }

                // Test against a crash dump.
                if (information.DebuggeeDumpInputRootDir != null)
                {
                    // With cdb (Windows) or lldb (Linux)
                    using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDump))
                    {
                        await runner.RunScript(scriptName);
                    }

                    // Using the dotnet-dump analyze tool if the path exists in the config file.
                    // TODO: dotnet-dump currently doesn't support macho core dumps that the MacOS createdump generates
                    if (information.TestConfiguration.DotNetDumpPath() != null && OS.Kind != OSKind.OSX)
                    {
                        // Don't test dotnet-dump on triage dumps when running on desktop CLR.
                        if (information.TestConfiguration.IsNETCore || information.DumpType != SOSRunner.DumpType.Triage)
                        {
                            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDumpWithDotNetDump))
                            {
                                await runner.RunScript(scriptName);
                            }
                        }
                    }
                }

                // Test the crash report json file
                if (dumpName != null && information.TestCrashReport)
                {
                    TestCrashReport(dumpName, information);
                }
            }
        }
    }
コード例 #3
0
ファイル: SOS.cs プロジェクト: vitek-karas/diagnostics
    private async Task RunTest(string scriptName, bool testLive = true, bool testDump = true, SOSRunner.TestInformation information = null)
    {
        information.OutputHelper = Output;

        if (testLive && !SOSRunner.IsAlpine())
        {
            // Live
            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.Live))
            {
                await runner.RunScript(scriptName);
            }
        }

        if (testDump)
        {
            // Create and test dumps on OSX only if the runtime is 6.0 or greater
            // TODO: reenable for 5.0 when the MacOS createdump fixes make it into a service release (https://github.com/dotnet/diagnostics/issues/1749)
            if (OS.Kind != OSKind.OSX || information.TestConfiguration.RuntimeFrameworkVersionMajor > 5)
            {
                // Generate a crash dump.
                if (information.TestConfiguration.DebuggeeDumpOutputRootDir() != null)
                {
                    if (information.DumpGenerator == SOSRunner.DumpGenerator.NativeDebugger && SOSRunner.IsAlpine())
                    {
                        throw new SkipTestException("lldb tests not supported on Alpine");
                    }
                    await SOSRunner.CreateDump(information);
                }

                // Test against a crash dump.
                if (information.TestConfiguration.DebuggeeDumpInputRootDir() != null)
                {
                    if (!SOSRunner.IsAlpine())
                    {
                        // With cdb (Windows) or lldb (Linux)
                        using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDump))
                        {
                            await runner.RunScript(scriptName);
                        }
                    }

                    // Using the dotnet-dump analyze tool if the path exists in the config file.
                    // TODO: dotnet-dump currently doesn't support macho core dumps that the MacOS createdump generates
                    if (information.TestConfiguration.DotNetDumpPath() != null && OS.Kind != OSKind.OSX)
                    {
                        // Don't test dotnet-dump on triage dumps when running on desktop CLR.
                        if (information.TestConfiguration.IsNETCore || information.DumpType != SOSRunner.DumpType.Triage)
                        {
                            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDumpWithDotNetDump))
                            {
                                await runner.RunScript(scriptName);
                            }
                        }
                    }
                }
            }
        }
    }
コード例 #4
0
ファイル: SOS.cs プロジェクト: brianrob/diagnostics
 public async Task GCTests(TestConfiguration config)
 {
     // Live only
     SkipIfArm(config);
     using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName: "SOS.GCTests", debuggeeName: "GCWhere"))
     {
         await runner.RunScript("GCTests.script");
     }
 }
コード例 #5
0
    private async Task RunTest(string scriptName, bool testLive = true, bool testDump = true, SOSRunner.TestInformation information = null)
    {
        information.OutputHelper = Output;

        if (testLive && !SOSRunner.IsAlpine())
        {
            // Live
            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.Live))
            {
                await runner.RunScript(scriptName);
            }
        }

        if (testDump)
        {
            // Create and test dumps on OSX only if the runtime is 5.0 or greater
            if (OS.Kind != OSKind.OSX || information.TestConfiguration.RuntimeFrameworkVersionMajor >= 5)
            {
                // Generate a crash dump.
                if (information.TestConfiguration.DebuggeeDumpOutputRootDir() != null)
                {
                    if (information.DumpGenerator == SOSRunner.DumpGenerator.NativeDebugger && SOSRunner.IsAlpine())
                    {
                        throw new SkipTestException("lldb tests not supported on Alpine");
                    }
                    await SOSRunner.CreateDump(information);
                }

                // Test against a crash dump.
                if (information.TestConfiguration.DebuggeeDumpInputRootDir() != null)
                {
                    if (!SOSRunner.IsAlpine() && OS.Kind != OSKind.OSX)
                    {
                        // With cdb (Windows) or lldb (Linux)
                        using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDump))
                        {
                            await runner.RunScript(scriptName);
                        }
                    }

                    // Using the dotnet-dump analyze tool if the path exists in the config file.
                    if (information.TestConfiguration.DotNetDumpPath() != null)
                    {
                        // Don't test dotnet-dump on triage dumps when running on desktop CLR.
                        if (information.TestConfiguration.IsNETCore || information.DumpType != SOSRunner.DumpType.Triage)
                        {
                            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDumpWithDotNetDump))
                            {
                                await runner.RunScript(scriptName);
                            }
                        }
                    }
                }
            }
        }
    }
コード例 #6
0
ファイル: SOS.cs プロジェクト: Maoni0/diagnostics
    private async Task RunTest(string scriptName, SOSRunner.TestInformation information)
    {
        information.OutputHelper = Output;

        if (information.TestLive)
        {
            // Live
            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.Live))
            {
                await runner.RunScript(scriptName);
            }
        }

        if (information.TestDump)
        {
            string dumpName = null;

            // Generate a crash dump.
            if (information.DebuggeeDumpOutputRootDir != null)
            {
                dumpName = await SOSRunner.CreateDump(information);
            }

            // Test against a crash dump.
            if (information.DebuggeeDumpInputRootDir != null)
            {
                // With cdb (Windows) or lldb (Linux)
                using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDump))
                {
                    await runner.RunScript(scriptName);
                }

                // Using the dotnet-dump analyze tool if the path exists in the config file.
                if (information.TestConfiguration.DotNetDumpPath() != null)
                {
                    // Don't test dotnet-dump on triage dumps when running on desktop CLR.
                    if (information.TestConfiguration.IsNETCore || information.DumpType != SOSRunner.DumpType.Triage)
                    {
                        using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDumpWithDotNetDump))
                        {
                            await runner.RunScript(scriptName);
                        }
                    }
                }
            }

            // Test the crash report json file
            if (dumpName != null && information.TestCrashReport)
            {
                TestCrashReport(dumpName, information);
            }
        }
    }
コード例 #7
0
ファイル: SOS.cs プロジェクト: tmds/diagnostics
 public async Task GCTests(TestConfiguration config)
 {
     // Live only
     SkipIfArm(config);
     if (SOSRunner.IsAlpine())
     {
         throw new SkipTestException("lldb tests not supported on Alpine");
     }
     using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName: "SOS.GCTests", debuggeeName: "GCWhere"))
     {
         await runner.RunScript("GCTests.script");
     }
 }
コード例 #8
0
ファイル: SOS.cs プロジェクト: ziyasal/diagnostics
    private async Task RunTest(string scriptName, bool testLive = true, bool testDump = true, SOSRunner.TestInformation information = null)
    {
        information.OutputHelper = Output;

        if (testLive && !SOSRunner.IsAlpine())
        {
            // Live
            using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.Live))
            {
                await runner.RunScript(scriptName);
            }
        }

        if (testDump)
        {
            // Generate a crash dump.
            if (information.TestConfiguration.DebuggeeDumpOutputRootDir() != null)
            {
                if (information.DumpGenerator == SOSRunner.DumpGenerator.NativeDebugger && SOSRunner.IsAlpine())
                {
                    throw new SkipTestException("lldb tests not supported on Alpine");
                }
                await SOSRunner.CreateDump(information);
            }

            // Test against a crash dump.
            if (information.TestConfiguration.DebuggeeDumpInputRootDir() != null)
            {
                if (!SOSRunner.IsAlpine())
                {
                    // With cdb (Windows) or lldb (Linux or OSX)
                    using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDump))
                    {
                        await runner.RunScript(scriptName);
                    }
                }

                // With the dotnet-dump analyze tool
                if (information.TestConfiguration.DotNetDumpPath() != null)
                {
                    using (SOSRunner runner = await SOSRunner.StartDebugger(information, SOSRunner.DebuggerAction.LoadDumpWithDotNetDump))
                    {
                        await runner.RunScript(scriptName);
                    }
                }
            }
        }
    }
コード例 #9
0
ファイル: SOS.cs プロジェクト: tmds/diagnostics
    private async Task RunTest(TestConfiguration config, string testName, string debuggeeName, string scriptName, string debuggeeArguments = null, bool useCreateDump = true)
    {
        SkipIfArm(config);

        if (!SOSRunner.IsAlpine())
        {
            // Live
            using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName, debuggeeName, debuggeeArguments))
            {
                await runner.RunScript(scriptName);
            }
        }

        // Generate a crash dump.
        if (IsCreateDumpConfig(config))
        {
            if (!useCreateDump && SOSRunner.IsAlpine())
            {
                throw new SkipTestException("lldb tests not supported on Alpine");
            }
            await SOSRunner.CreateDump(config, Output, testName, debuggeeName, debuggeeArguments, useCreateDump);
        }

        // Test against a crash dump.
        if (IsOpenDumpConfig(config))
        {
            if (!SOSRunner.IsAlpine())
            {
                // With cdb (Windows) or lldb (Linux or OSX)
                using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName, debuggeeName, debuggeeArguments, SOSRunner.Options.LoadDump))
                {
                    await runner.RunScript(scriptName);
                }
            }

            // With the dotnet-dump analyze tool
            if (config.DotNetDumpPath() != null)
            {
                using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName, debuggeeName, debuggeeArguments, SOSRunner.Options.LoadDumpWithDotNetDump))
                {
                    await runner.RunScript(scriptName);
                }
            }
        }
    }
コード例 #10
0
ファイル: SOS.cs プロジェクト: brianrob/diagnostics
    private async Task RunTest(TestConfiguration config, string testName, string debuggeeName, string scriptName, string debuggeeArguments = null, bool useCreateDump = true)
    {
        SkipIfArm(config);

        // Live
        using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName, debuggeeName, debuggeeArguments))
        {
            await runner.RunScript(scriptName);
        }

        // Against a crash dump.
        if (IsCreateDumpConfig(config))
        {
            await SOSRunner.CreateDump(config, Output, testName, debuggeeName, debuggeeArguments, useCreateDump);
        }

        if (IsOpenDumpConfig(config))
        {
            using (SOSRunner runner = await SOSRunner.StartDebugger(config, Output, testName, debuggeeName, debuggeeArguments, loadDump: true))
            {
                await runner.RunScript(scriptName);
            }
        }
    }