private void WriteCrashDumps(GCMode gc) { if (_fullDumpPath[(int)gc] != null) { return; } string executable = Executable; DebuggerStartInfo info = new DebuggerStartInfo(); if (gc == GCMode.Server) { info.SetEnvironmentVariable("COMPlus_BuildFlavor", "svr"); } using (Debugger dbg = info.LaunchProcess(executable, Helpers.TestWorkingDirectory)) { dbg.SecondChanceExceptionEvent += delegate(Debugger d, EXCEPTION_RECORD64 ex) { if (ex.ExceptionCode == (uint)ExceptionTypes.Clr) { WriteDumps(dbg, executable, gc); } }; DEBUG_STATUS status; do { status = dbg.ProcessEvents(0xffffffff); } while (status != DEBUG_STATUS.NO_DEBUGGEE); Assert.IsNotNull(_miniDumpPath[(int)gc]); Assert.IsNotNull(_fullDumpPath[(int)gc]); } }
private void WriteCrashDumps(string executable) { DebuggerStartInfo info = new DebuggerStartInfo(); using (Debugger dbg = info.LaunchProcess(executable, Helpers.TestWorkingDirectory)) { dbg.SecondChanceExceptionEvent += delegate (Debugger d, EXCEPTION_RECORD64 ex) { if (ex.ExceptionCode == (uint)ExceptionTypes.Clr) WriteDumps(dbg, executable); }; DEBUG_STATUS status; do { status = dbg.ProcessEvents(0xffffffff); } while (status != DEBUG_STATUS.NO_DEBUGGEE); } }
private void WriteCrashDumps(GCMode gc) { if (_fullDumpPath[(int)gc] != null) return; string executable = Executable; DebuggerStartInfo info = new DebuggerStartInfo(); if (gc == GCMode.Server) info.SetEnvironmentVariable("COMPlus_BuildFlavor", "svr"); using (Debugger dbg = info.LaunchProcess(executable, Helpers.TestWorkingDirectory)) { dbg.SecondChanceExceptionEvent += delegate (Debugger d, EXCEPTION_RECORD64 ex) { if (ex.ExceptionCode == (uint)ExceptionTypes.Clr) WriteDumps(dbg, executable, gc); }; DEBUG_STATUS status; do { status = dbg.ProcessEvents(0xffffffff); } while (status != DEBUG_STATUS.NO_DEBUGGEE); Assert.IsNotNull(_miniDumpPath[(int)gc]); Assert.IsNotNull(_fullDumpPath[(int)gc]); } }