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 java.util.Vector;
040: import edu.rice.cs.drjava.model.OpenDefinitionsDocument;
041:
042: /**
043: * Placeholder class indicating that no debugger is available to DrJava.
044: * This class follows the Singleton pattern.
045: * @version $Id: NoDebuggerAvailable.java 4255 2007-08-28 19:17:37Z mgricken $
046: */
047: public class NoDebuggerAvailable implements Debugger {
048:
049: /** Singleton instance of this class. */
050: public static final NoDebuggerAvailable ONLY = new NoDebuggerAvailable();
051:
052: /** Private constructor: use the ONLY field. */
053: private NoDebuggerAvailable() {
054: }
055:
056: /** Returns whether the debugger is currently available in this JVM. This does not indicate whether it is ready to
057: * be used.
058: */
059: public boolean isAvailable() {
060: return false;
061: }
062:
063: public DebugModelCallback callback() {
064: return new DebugModelCallback() {
065: };
066: }
067:
068: /** Attaches the debugger to the Interactions JVM to prepare for debugging. */
069: public void startUp() throws DebugException {
070: }
071:
072: /** Disconnects the debugger from the Interactions JVM and cleans up any state. */
073: public void shutdown() {
074: }
075:
076: /** Returns the status of the debugger. */
077: public boolean isReady() {
078: return false;
079: }
080:
081: /** Suspends execution of the currently. */
082: public void suspend(DebugThreadData d) {
083: }
084:
085: /** Suspends all the threads. */
086: public void suspendAll() {
087: }
088:
089: /** Sets the current thread which is being debugged to the thread referenced by d. */
090: public void setCurrentThread(DebugThreadData d) {
091: }
092:
093: /** Resumes execution of the currently loaded document. */
094: public void resume() {
095: }
096:
097: /** Resumes execution of the given thread.
098: * @param data the DebugThreadData representing the thread to resume
099: */
100: public void resume(DebugThreadData data) {
101: }
102:
103: /** Steps the execution of the currently loaded document. */
104: public void step(StepType type) throws DebugException {
105: }
106:
107: /** Called from interactionsEnded in MainFrame in order to clear any current StepRequests that remain. */
108: public void clearCurrentStepRequest() {
109: }
110:
111: /** Adds a watch on the given field or variable.
112: * @param field the name of the field we will watch
113: */
114: public void addWatch(String field) {
115: }
116:
117: /** Removes any watches on the given field or variable.
118: * @param field the name of the field we will watch
119: */
120: public void removeWatch(String field) {
121: }
122:
123: /** Removes the watch at the given index.
124: * @param index Index of the watch to remove
125: */
126: public void removeWatch(int index) {
127: }
128:
129: /** Removes all watches on existing fields and variables. */
130: public void removeAllWatches() {
131: }
132:
133: /** Toggles whether a breakpoint is set at the given line in the given document. */
134: public void toggleBreakpoint(OpenDefinitionsDocument doc,
135: int offset, int lineNum, boolean isEnabled)
136: throws DebugException {
137: }
138:
139: /** Sets a breakpoint. */
140: public void setBreakpoint(Breakpoint breakpoint) {
141: }
142:
143: /** Removes a breakpoint. */
144: public void removeBreakpoint(Breakpoint breakpoint) {
145: }
146:
147: /** Returns all currently watched fields and variables. */
148: public Vector<DebugWatchData> getWatches() {
149: return new Vector<DebugWatchData>();
150: }
151:
152: /** Returns a Vector of ThreadData or null if the vm is null. */
153: public Vector<DebugThreadData> getCurrentThreadData() {
154: return new Vector<DebugThreadData>();
155: }
156:
157: /** Returns a Vector of StackData for the current thread or null if the current thread is null. */
158: public Vector<DebugStackData> getCurrentStackFrameData() {
159: return new Vector<DebugStackData>();
160: }
161:
162: /** Adds a listener to this Debugger. */
163: public void addListener(DebugListener listener) {
164: }
165:
166: /** Removes a listener to this JPDADebugger. */
167: public void removeListener(DebugListener listener) {
168: }
169:
170: /** @return true if there are any threads in the program currently being
171: * debugged which have been suspended (by the user or by hitting a breakpoint).
172: */
173: public boolean hasSuspendedThreads() {
174: return false;
175: }
176:
177: /** Returns whether the thread the debugger is tracking is now running. */
178: public boolean hasRunningThread() {
179: return false;
180: }
181:
182: /** Returns whether the debugger's current thread is suspended. */
183: public boolean isCurrentThreadSuspended() {
184: return false;
185: }
186:
187: /** scrolls to the source indicated by the given DebugStackData */
188: public void scrollToSource(DebugStackData data) {
189: }
190:
191: /** scrolls to the source indicated by the given Breakpoint */
192: public void scrollToSource(Breakpoint bp) {
193: }
194:
195: /** Gets the Breakpoint object at the specified line in the given class. */
196: public Breakpoint getBreakpoint(int line, String className) {
197: return null;
198: }
199: }
|