6 * Repository of all commands sent from jde to jdebug, and all lisp functions
7 * sent from jdebug to jde
10 * <b>Nomenclature:</b>
13 * <dd> The java side of the debugger </dd>
16 * <dd> The emacs side of the debugger. Also used in general terms to
17 * mean JDE itself. </dd>
20 * <dd> The java development environment </dd>
22 * <dt> debugger: </dt>
23 * <dd> Usually the java side, also used in general
24 * terms to mean the full debugging framework </dd>
27 * <dd> The application being debugged. Usually means
28 * the VM of the application, as against the VM
29 * of the debugger. </dd>
31 * <dt> application: </dt>
32 * <dd> Same as 'debugee' </dd>
35 * <dd> The java virtual machine. During debugging,
36 * the debugger VM connects to the debuggee VM
37 * through a socket/shared memory (the latter is
38 * possible in case of Win9x/NT)
44 * The commands will be ASCII strings delimited by spaces, and
45 * will end with a BR .
47 * debugee_vm_id command_id command [optional_args]
50 * <dt> debugee_vm_id </dt>
51 * <dd> a number that is assigned during handshake
52 * between the emacs and the jde sides,
53 * representing a specific debugee vm.
55 * if (id == -1), the command is not specific to
58 * 'app_id', 'vm_id' 'id' & 'debugee_vm_id' are
61 * <dt> command_id </dt>
62 * <dd> an id that helps match a command and its response.
64 * 'cmd_id' 'cid' & 'command_id' are synonymous. </dd>
67 * <dd> plain text command </dd>
69 * <dt> optional_args </dt>
70 * <dd> arguments for the command. can use "" for
71 * arguments with white spaces. </dd>
77 * The replies to these commands will be ASCII too, in lisp
78 * forms, and will also end with a BR . They will either by
79 * "result" or "error":
81 * (jde-dbo-command-result command_id [optional_args])
82 * (jde-dbo-command-error command_id reason)
85 * <dt> debugee_vm_id, command_id </dt>
88 * <dt> optional_args </dt>
89 * <dd> if required </dd>
92 * <dd> a string, containing the error message </dd>
97 * See {@link EventHandler here}
101 * Created: Thu Jul 8 13:44:10 1999
105 * @version $Revision: 1.3 $
108 public interface Protocol {
112 * Some useful constants
116 /** line break, platform dependent */
117 public static String BR = System.getProperty("line.separator");
122 * Supported Commands from jde to jdebug
128 * Specifying the debuggee application
131 /** @see jde.debugger.command.LaunchApplication */
132 public final static String LAUNCH = "launch";
134 /** @see jde.debugger.command.AttachSocket */
135 public final static String ATTACH_SOCKET = "attach_socket";
137 /** @see jde.debugger.command.AttachShmem */
138 public final static String ATTACH_SHMEM = "attach_shmem";
140 /** @see jde.debugger.command.ListenSocket */
141 public final static String LISTEN_SOCKET = "listen_socket";
143 /** @see jde.debugger.command.ListenShmem */
144 public final static String LISTEN_SHMEM = "listen_shmem";
150 /** @see jde.debugger.command.Quit */
151 public final static String QUIT = "quit";
152 /** @see jde.debugger.command.Quit */
153 public final static String EXIT = "exit";
156 * Following commands are application specific: ie are directed
157 * towards an application once it has been launched/attached to/ etc.
160 /** @see jde.debugger.command.Run */
161 public final static String RUN = "run";
163 /** @see jde.debugger.command.Finish */
164 public final static String FINISH = "finish";
166 /** @see jde.debugger.command.TraceClasses */
167 public final static String TRACE_CLASSES = "trace_classes";
168 /** @see jde.debugger.command.CancelTraceClasses */
169 public final static String CANCEL_TRACE_CLASSES = "cancel_trace_classes";
172 /** @see jde.debugger.command.TraceExceptions */
173 public final static String TRACE_EXCEPTIONS = "trace_exceptions";
174 /** @see jde.debugger.command.Watch */
175 public final static String WATCH = "watch";
176 /** @see jde.debugger.command.Break */
177 public final static String BREAK = "break";
178 /** @see jde.debugger.command.Clear */
179 public final static String CLEAR = "clear";
181 /** @see jde.debugger.command.Step */
182 public final static String STEP = "step";
184 /** @see jde.debugger.command.Suspend */
185 public final static String SUSPEND = "suspend";
186 /** @see jde.debugger.command.Resume */
187 public final static String RESUME = "resume";
188 /** @see jde.debugger.command.Interrupt */
189 public final static String INTERRUPT = "interrupt";
190 /** @see jde.debugger.command.KillThread */
191 public final static String KILL_THREAD = "kill_thread";
193 /** @see jde.debugger.command.GetThreads */
194 public final static String GET_THREADS = "get_threads";
195 /** @see jde.debugger.command.GetThread */
196 public final static String GET_THREAD = "get_thread";
197 /** @see jde.debugger.command.GetObjectMonitors */
198 public final static String GET_OBJECT_MONITORS = "get_object_monitors";
199 /** @see jde.debugger.command.TraceThreads */
200 public final static String TRACE_THREADS = "trace_threads";
201 /** @see jde.debugger.command.CancelTraceThreads */
202 public final static String CANCEL_TRACE_THREADS = "cancel_trace_threads";
204 /** @see jde.debugger.command.TraceMethods */
205 public final static String TRACE_METHODS = "trace_methods";
206 /** @see jde.debugger.command.CancelTraceMethods */
207 public final static String CANCEL_TRACE_METHODS = "cancel_trace_methods";
209 /** @see jde.debugger.command.GetObject */
210 public final static String GET_OBJECT = "get_object";
212 /** @see jde.debugger.command.GetArray */
213 public final static String GET_ARRAY = "get_array";
215 /** @see jde.debugger.command.GetString */
216 public final static String GET_STRING = "get_string";
218 /** @see jde.debugger.command.GetLocals */
219 public final static String GET_LOCALS = "get_locals";
221 /** @see jde.debugger.command.GetLoadedClasses */
222 public final static String GET_LOADED_CLASSES = "get_loaded_classes";
223 /** @see jde.debugger.command.GetPathInfo */
224 public final static String GET_PATH_INFORMATION = "get_path_information";
226 /** @see jde.debugger.command.EvaluateExpression */
227 public final static String EVALUATE = "evaluate";
241 // lisp functions sent from jdebug to jde
243 /** arbitrary lisp functions passed to jde start with this*/
244 public final static String JDE_BUG =
247 /** the very first function, indicating that jdebug is up and running */
248 public final static String JDE_INIT_DEBUG_SESSION =
249 JDE_BUG+"init-debug-session";
251 /** The command executed properly, returns the result */
252 public final static String COMMAND_RESULT =
254 /** There was an error executing the command, returns the error */
255 public final static String COMMAND_ERROR =
258 /** A message to be displayed on the JDE UI */
259 public final static String MESSAGE =
262 public final static String WARNING =
265 public final static String ERROR =
268 /** a debug message */
269 public final static String DEBUG =
272 /** Event sets caused by the jpda. */
273 public final static String EVENTSET =
276 /** used to construct messages about invalid breakpoints etc. */
277 public final static String INVALID =
281 * tell jdebug to inform jdebug about references to objects being
282 * currently used. might dissapear soon...
284 public final static String REPORT_IDS_IN_USE =
288 * Notifies that a connection to a vm was successfully made
290 public final static String CONNECTED_TO_VM =
294 * Notifies that a spec was resolved properly
296 public final static String SPEC_RESOLVED =
302 * Events that are raised by the JDI implementation
307 /** @see EventHandler#breakpointEvent(BreakpointEvent) */
308 public final static String EVENT_BREAKPOINT_HIT =
309 JDE_BUG+"breakpoint-hit-event";
310 /** @see EventHandler#stepEvent(StepEvent) */
311 public final static String EVENT_STEP_COMPLETED =
312 JDE_BUG+"step-event";
314 /** @see EventHandler#watchpointEvent(WatchpointEvent) */
315 public final static String EVENT_WATCHPOINT_HIT =
316 JDE_BUG+"watchpoint-hit-event";
318 /** @see EventHandler#classPrepareEvent(ClassPrepareEvent) */
319 public final static String EVENT_CLASS_PREPARE =
320 JDE_BUG+"class-prepare-event";
321 /** @see EventHandler#classUnloadEvent(ClassUnloadEvent) */
322 public final static String EVENT_CLASS_UNLOAD =
323 JDE_BUG+"class-unload-event";
325 /** @see EventHandler#exceptionEvent(ExceptionEvent) */
326 public final static String EVENT_EXCEPTION =
327 JDE_BUG+"exception-event";
329 /** @see EventHandler#threadStartEvent(ThreadStartEvent) */
330 public final static String EVENT_THREAD_START =
331 JDE_BUG+"thread-start-event";
332 /** @see EventHandler#threadDeathEvent(ThreadDeathEvent) */
333 public final static String EVENT_THREAD_DEATH =
334 JDE_BUG+"thread-death-event";
336 /** @see EventHandler#methodEntryEvent(MethodEntryEvent) */
337 public final static String EVENT_METHOD_ENTRY =
338 JDE_BUG+"method-entry-event";
339 /** @see EventHandler#methodExitEvent(MethodExitEvent) */
340 public final static String EVENT_METHOD_EXIT =
341 JDE_BUG+"method-exit-event";
343 /** @see EventHandler#vmStartEvent(Event) */
344 public final static String EVENT_VM_START =
345 JDE_BUG+"vm-start-event";
346 /** @see EventHandler#vmDeathEvent(Event) */
347 public final static String EVENT_VM_DEATH =
348 JDE_BUG+"vm-death-event";
349 /** @see EventHandler#vmDisconnectEvent(Event) */
350 public final static String EVENT_VM_DISCONNECT =
351 JDE_BUG+"vm-disconnected-event";
353 /** @see EventHandler#otherEvent(Event) */
354 public final static String EVENT_OTHER =
355 JDE_BUG+"event-other";
363 // Constants for signalling through the JDE class
364 public final static boolean QUOTE = true;
365 public final static boolean NOQUOTE = false;
366 public final static boolean CMD_OK = true;
367 public final static boolean CMD_NOK = false;
373 public final static int NONE = 0;
375 * Trace application I/O - CURRENTLY NOT USED
377 public final static int APP_IO = 1;
379 * Trace pipe between Emacs and Java - CURRENTLY NOT USED
381 public final static int JDE_PIPE = 2;
383 * Trace anything related to events.
385 public final static int EVENTS = 4;
389 public final static int EXCEPTION = 8;
391 * Trace the functioning of the framework: debugging process
392 * administration, etc.
394 public final static int FRAMEWORK = 16;
396 * Trace command execution
398 public final static int COMMANDS = 32;
402 public final static int GUI = 64;
407 * $Log: Protocol.java,v $
408 * Revision 1.3 2003/01/08 06:53:37 paulk
409 * Integrate Petter Mahlen's updates.