001: /*BEGIN_COPYRIGHT_BLOCK
002: *
003: * Copyright (c) 2001-2007, JavaPLT group at Rice University (javaplt@rice.edu)
004: * All rights reserved.
005: *
006: * Redistribution and use in source and binary forms, with or without
007: * modification, are permitted provided that the following conditions are met:
008: * * Redistributions of source code must retain the above copyright
009: * notice, this list of conditions and the following disclaimer.
010: * * Redistributions in binary form must reproduce the above copyright
011: * notice, this list of conditions and the following disclaimer in the
012: * documentation and/or other materials provided with the distribution.
013: * * Neither the names of DrJava, the JavaPLT group, Rice University, nor the
014: * names of its contributors may be used to endorse or promote products
015: * derived from this software without specific prior written permission.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
018: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
019: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
020: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
021: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
022: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
023: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
024: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
025: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
026: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
027: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
028: *
029: * This software is Open Source Initiative approved Open Source Software.
030: * Open Source Initative Approved is a trademark of the Open Source Initiative.
031: *
032: * This file is part of DrJava. Download the current version of this project
033: * from http://www.drjava.org/ or http://sourceforge.net/projects/drjava/
034: *
035: * END_COPYRIGHT_BLOCK*/
036:
037: package edu.rice.cs.drjava.model.debug;
038:
039: import edu.rice.cs.drjava.model.DocumentRegion;
040: import edu.rice.cs.drjava.model.RegionManagerListener;
041: import edu.rice.cs.drjava.model.OpenDefinitionsDocument;
042:
043: /** Any class which wants to listen to events fired by the Debugger should implement this interface and use Debugger's
044: * addDebugListener() method.
045: * @version $Id: DebugListener.java 4255 2007-08-28 19:17:37Z mgricken $
046: */
047: public interface DebugListener extends
048: RegionManagerListener<Breakpoint> {
049:
050: /** Called when debugger mode has been enabled. Must be executed in event thread. */
051: public void debuggerStarted();
052:
053: /** Called when debugger mode has been disabled. Must be executed in event thread. */
054: public void debuggerShutdown();
055:
056: /** Called when the given line is reached by the current thread in the debugger, to request that the line be
057: * displayed. Must be executed only in the event thread.
058: * @param doc Document to display
059: * @param lineNumber Line to display or highlight
060: * @param shouldHighlight true iff the line should be highlighted.
061: */
062: public void threadLocationUpdated(OpenDefinitionsDocument doc,
063: int lineNumber, boolean shouldHighlight);
064:
065: /** Called when a breakpoint is reached during execution.
066: * @param bp the breakpoint
067: */
068: public void breakpointReached(Breakpoint bp);
069:
070: /** Called when a watch is set. Must be executed in event thread.
071: * @param w the watch
072: */
073: public void watchSet(DebugWatchData w);
074:
075: /** Called when a watch is removed. Must be executed in event thread.
076: * @param w the watch
077: */
078: public void watchRemoved(DebugWatchData w);
079:
080: /** Called when a step is requested on the current thread. Must be executed in event thread. */
081: public void stepRequested();
082:
083: /** Called when the current thread is suspended. */
084: public void currThreadSuspended();
085:
086: /** Called when the current thread is resumed. Must be executed in event thread. */
087: public void currThreadResumed();
088:
089: /** Called when a thread starts. Must be executed in event thread. */
090: public void threadStarted();
091:
092: /** Called when the current thread dies. Must be executed in event thread. */
093: public void currThreadDied();
094:
095: /** Called when any thread other than the current thread dies. Must be executed in event thread. */
096: public void nonCurrThreadDied();
097:
098: /** Called when the current (selected) thread is set in the debugger.
099: * @param thread the thread that was set as current
100: */
101: public void currThreadSet(DebugThreadData thread);
102:
103: // from RegionManagerListener<Breakpoint>:
104: // public void regionAdded(Breakpoint r, int index);
105: // public void regionChanged(Breakpoint r, int index);
106: // public void regionRemoved(Breakpoint r);
107: }
|