public void Dispose() { if (DebuggerClient != null) { DebuggerClient.Close(); } if (LocalDebugger != null) { // we may exit debugger by "gdb-exit" call in command script try { LocalDebugger.Close(); } // "No such process" exception at System.Diagnostics.Process.Kill() catch (System.ComponentModel.Win32Exception) {} } }
public static void Gui(string args) { //System.Diagnostics.Debug.Assert(false); if (nppDebugger == null) { nppDebugger = new DebuggerClient(Shell); } var ap = new ArgParser(args); if (ap.Exists(0)) { if (ap.AsString(0) == "close") { if (nppDebugger != null) { nppDebugger.Close(); Application.Exit(); // this line will cause the message pump on other thread to quit. return; } else { throw new MDbgShellException("NPP not started."); } } else { throw new MDbgShellException("invalid argument"); } } if (Shell.IO == nppDebugger) { WriteOutput("NPP already started. Cannot start second instance."); return; } WriteOutput("starting npp"); Shell.IO = nppDebugger; }