Initial Commit
[packages] / xemacs-packages / jde / java / src / jde / debugger / command / Quit.java
1 package jde.debugger.command;
2 import jde.debugger.JDEException;
3 import jde.debugger.JDEbug;
4 import jde.debugger.SessionManager;
5 import jde.debugger.JDE;
6
7
8 /**
9  * Kills the debugger.
10  * <p>
11  *
12  * <b>Syntax:</b>
13  * <pre>
14  * quit
15  * </pre>
16  *
17  * @author Paul Kinnucan
18  * @version $Revision: 1.3 $
19  * @copyright Copyright (c) 2000, 2001, 2003    Paul Kinnucan
20  */
21 public class Quit extends DebugSessionCommand {
22     
23   protected void doCommand() throws JDEException {
24     JDE.debug(EVENTS, "shutting down debugger");
25     SessionManager.shutdown();
26         
27     JDE.commandResult(m_cmdID, null, CMD_OK);
28     JDEbug.theDebugger.shutdown();
29
30     // XXX Petter:
31     // I would very much prefer not doing a System.exit() here, since
32     // that has a tendency to hide threading problems, locked threads, etc.
33     // But the main thread is normally blocked in CommandStream.nextToken(),
34     // and I know that there is/was a bug in the AWT thread management as
35     // well, meaning that they can only be terminated by exiting the whole
36     // process.
37     System.exit(0);
38   }
39     
40   public Object clone() {return new Quit();}
41     
42 } // Quit
43
44
45 /*
46  * $Log: Quit.java,v $
47  * Revision 1.3  2003/01/15 05:56:26  paulk
48  * Add Petter Mahlen's changes.
49  *
50  * Revision 1.2  2001/03/24 05:42:37  paulk
51  * Updated to reflect reorganization of debugger code.
52  *
53  * Revision 1.1  2000/01/31 12:47:01  paulk
54  * Quit debugger.
55  *
56  */
57
58 // End of Quit.java