Exemplo n.º 1
0
        private async Task RunDebugDiagAnalysis(DumpMetainfo dumpInfo, DirectoryInfo workingDir, string dumpFilePath)
        {
            //--dump = "C:\superdump\data\dumps\hno3391\iwb0664\iwb0664.dmp"--out= "C:\superdump\data\dumps\hno3391\iwb0664\debugdiagout.mht"--symbolPath = "cache*c:\localsymbols;http://msdl.microsoft.com/download/symbols"--overwrite
            string reportFilePath = Path.Combine(pathHelper.GetDumpDirectory(dumpInfo.BundleId, dumpInfo.DumpId), "DebugDiagAnalysis.mht");
            string debugDiagExe   = "SuperDump.DebugDiag.exe";

            try {
                using (var process = await ProcessRunner.Run(debugDiagExe, workingDir,
                                                             $"--dump=\"{dumpFilePath}\"",
                                                             $"--out=\"{reportFilePath}\"",
                                                             "--overwrite")) {
                    string log = $"debugDiagExe exited with error code {process.ExitCode}" +
                                 $"{Environment.NewLine}{Environment.NewLine}stdout:{Environment.NewLine}{process.StdOut}" +
                                 $"{Environment.NewLine}{Environment.NewLine}stderr:{Environment.NewLine}{process.StdErr}";
                    Console.WriteLine(log);
                    File.WriteAllText(Path.Combine(pathHelper.GetDumpDirectory(dumpInfo.BundleId, dumpInfo.DumpId), "superdump.debugdiag.log"), log);
                    dumpRepo.AddFile(dumpInfo.BundleId, dumpInfo.DumpId, "DebugDiagAnalysis.mht", SDFileType.DebugDiagResult);
                }
            } catch (ProcessRunnerException e) {
                if (e.InnerException is FileNotFoundException)
                {
                    Console.Error.WriteLine($"{debugDiagExe} not found. Check BinPath setting in appsettings.json.");
                }
                else
                {
                    Console.Error.WriteLine($"Error during DebugDiag analyis: {e}");
                }
                // do not abort analysis.
            }
        }