Initial Commit
[packages] / xemacs-packages / jde / java / src / jde / debugger / command / AttachShmem.java
1 package jde.debugger.command;
2 import jde.debugger.JDEException;
3 import jde.debugger.Debugger;
4 import jde.debugger.SessionManager;
5
6
7 /**
8  * Attaches to an already running application through shared memory.
9  * <p>
10  *
11  * <b>Syntax:</b>
12  * <pre>
13  * attach_shmem  app_id name
14  * </pre>
15  *
16  * <b>Comments:</b>
17  * <ul>
18  * <li> The debugee vm has to have been launched with the right parameters.
19  * See the <italic>Connection and Invocation</italic> section of the
20  * JPDA documentation.
21  * </ul>
22  *
23  * Copyright (c) 2000, 2001, 2003    Paul Kinnucan
24  *
25  * @author Paul Kinnucan
26  * @version $Revision: 1.4 $
27  */
28 public class AttachShmem extends DebugSessionCommand {
29   
30   protected void doCommand() throws JDEException {
31     // XXX - fix the 'true' here, and define a better way to determine
32     // whether to use a GUI or not.
33     Debugger debugger = new Debugger(m_targetProcessID, true);
34         
35     SessionManager.registerDebugger(debugger);
36         
37     try {
38       debugger.attachVMShmem(m_args);
39       debugger.start();
40     }
41     catch (JDEException e) {
42       SessionManager.deregisterDebugger(debugger);
43       throw e;
44     }
45         
46     debugger.signalCommandResult(m_cmdID, null, CMD_OK);
47   }
48     
49   public Object clone() {return new AttachShmem();}
50     
51     
52 } // AttachShmem
53
54
55 /*
56  * $Log: AttachShmem.java,v $
57  * Revision 1.4  2003/01/15 05:56:26  paulk
58  * Add Petter Mahlen's changes.
59  *
60  * Revision 1.3  2001/03/24 05:42:36  paulk
61  * Updated to reflect reorganization of debugger code.
62  *
63  * Revision 1.2  2000/02/02 05:58:12  paulk
64  * Added command succeeded messages.
65  *
66  * Revision 1.1  2000/01/31 12:44:15  paulk
67  * Attach existing application through shared memory.
68  *
69  */
70
71 // End of AttachShmem.java