/// <summary> /// Event handler for when the process exits /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An EventArgs that contains no event data.</param> private void ExitProcessEventHandler(object sender, CorProcessEventArgs e) { Dispose(); }
void OnCreateProcess (object sender, CorProcessEventArgs e) { // Required to avoid the jit to get rid of variables too early e.Process.DesiredNGENCompilerFlags = CorDebugJITCompilerFlags.CORDEBUG_JIT_DISABLE_OPTIMIZATION; e.Process.EnableLogMessages (true); e.Continue = true; }
/// <summary> /// Event Handler for the creation of the Debugee's process /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An EventArgs that contains no event data.</param> private void CreateProcessEventHandler(object sender, CorProcessEventArgs e) { //Console.WriteLine("OnCreateProcess"); //e.Continue = true; e.Continue = true; }
void process_OnProcessExit(object sender, CorProcessEventArgs e) { _terminateEvent.Set(); }
void OnProcessExit (object sender, CorProcessEventArgs e) { TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetExited); // If the main thread stopped, terminate the debugger session if (e.Process.Id == process.Id) { lock (terminateLock) { process = null; ThreadPool.QueueUserWorkItem (delegate { // The Terminate call will fail if called in the event handler dbg.Terminate (); dbg = null; GC.Collect (); }); } } OnTargetEvent (args); }
private void OnExit(object sender, CorProcessEventArgs e) { state = ProcessState.Terminated; subscriber.Published(string.Format("Process [{0}] terminated, exiting...", e.Process.Id)); }
void OnProcessExit (object sender, CorProcessEventArgs e) { TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetExited); OnTargetEvent (args); }
private void ExitProcessEventHandler(Object sender, CorProcessEventArgs e) { Trace.WriteLine("ManagedCallback::ExitProcess"); BeginManagedDebugEvent(); try { CleanAfterProcessExit(); if (InternalHandleRawMode(ManagedCallbackType.OnProcessExit, e)) return; if (HandleCustomPostCallback(ManagedCallbackType.OnProcessExit, e)) return; e.Continue = false; InternalSignalRuntimeIsStopped(null, new ProcessExitedStopReason()); } finally { EndManagedDebugEvent(e); } }
private void CreateProcessEventHandler(Object sender, CorProcessEventArgs e) { Trace.WriteLine("ManagedCallback::CreateProcess"); BeginManagedDebugEvent(); try { if (InternalHandleRawMode(ManagedCallbackType.OnCreateProcess, e)) return; Debug.Assert(m_corProcess == e.Process); if (!m_processAttaching && (m_debugMode != DebugModeFlag.Default) && (m_debugMode != DebugModeFlag.Enc) // currently we cannot force ignoring native images // as would be desirable for ENC. ) { CorDebugJITCompilerFlags flags = MapDebugModeToJITCompilerFlags(m_debugMode); Trace.WriteLine("Setting Desired NGEN compiler flags:" + flags); m_corProcess.DesiredNGENCompilerFlags = flags; } if (HandleCustomPostCallback(ManagedCallbackType.OnCreateProcess, e)) { return; } } finally { EndManagedDebugEvent(e); } }
private void ControlCTrapEventHandler(Object sender, CorProcessEventArgs e) { Trace.WriteLine("ManagedCallback::ControlCTrap"); BeginManagedDebugEvent(); try { if (InternalHandleRawMode(ManagedCallbackType.OnControlCTrap, e)) return; e.Continue = false; InternalSignalRuntimeIsStopped(null, new ControlCTrappedStopReason()); } finally { EndManagedDebugEvent(e); } }