Initial Commit
[packages] / xemacs-packages / jde / java / src / jde / debugger / command / LaunchApplication.java
1 package jde.debugger.command;
2
3 import jde.debugger.Debugger;
4 import jde.debugger.JDEException;
5 import jde.debugger.SessionManager;
6
7
8 /**
9  * Launches an application.
10  * <p>
11  *
12  * <b>Syntax:</b>
13  * <pre>
14  * launch app_id [-use_executable javax] classname [args]
15  * </pre>
16  *
17  * @author Paul Kinnucan
18  * @version $Revision: 1.8 $
19  * @copyright Copyright (c) 2000, 2001, 2003    Paul Kinnucan
20  */
21 public class LaunchApplication extends DebugSessionCommand {
22
23   /**
24    *
25    * @exception jde.debugger.JDEException <description>
26    */
27   public void doCommand() throws JDEException {
28     // XXX - fix the 'true' here, and define a better way to determine
29     // whether to use a GUI or not.
30     Debugger debugger = new Debugger(m_targetProcessID, true);
31         
32     SessionManager.registerDebugger(debugger);
33         
34     try {
35       debugger.launchVM(m_cmdID, m_args);
36       debugger.start();
37     }
38     catch (JDEException e) {
39       SessionManager.deregisterDebugger(debugger);
40       throw e;
41     }
42   }
43
44   public Object clone() {return new LaunchApplication();}
45   
46 } // LaunchApplication
47
48
49 /*
50  * $Log: LaunchApplication.java,v $
51  * Revision 1.8  2003/01/15 05:56:26  paulk
52  * Add Petter Mahlen's changes.
53  *
54  * Revision 1.7  2002/10/11 05:41:06  paulk
55  * Fixed bug where the debuggee application launcher was downcasing the first vm command line argument. Thanks toEric W Brown <ewb@us.ibm.com> for this fix.
56  *
57  * Revision 1.6  2001/05/24 02:50:06  paulk
58  * Moved  jde.signalCommandResult(....,
59  * port) from LaunchApplication.java  into the same thread that creates a
60  * server SIO socket to make sure that Emacs connects to this socket after its
61  * creation. Thanks to "Eugene Gavrilov" <eag99@mail.ru>.
62  *
63  * Revision 1.5  2001/03/24 05:42:37  paulk
64  * Updated to reflect reorganization of debugger code.
65  *
66  * Revision 1.4  2000/07/28 06:27:02  paulk
67  * Committing all modified files.
68  *
69  * Revision 1.3  2000/03/03 07:45:05  paulk
70  * Replaced backslashes with forward slashes in launch error messages.
71  *
72  * Revision 1.2  2000/01/31 12:41:45  paulk
73  * * Continue converting commands from functional to OO implementation.
74  *
75  * Revision 1.1  2000/01/30 12:39:50  paulk
76  * Defines command to launch debuggee application.
77  *
78  */
79
80 // End of LaunchApplication.java