diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 8df7d58cb70..e2f60ae69a6 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,11 @@ +2004-09-09 Alain Magloire + Introduction of new classes in the CDI interface + * ICDIExecuteStep.java + * ICDIExecuteStepReturn.java + * ICDIExecuteResume.java + * ICDISuspend.java + * ICDIThreadGroup.java + 2004-09-07 Mikhail Khodjaiants Fix for bug 73498: Condition is cleared when disabled conditional breakpoint is set. * CBreakpointManager.java diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java index 40e950454c8..847be54fb2d 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java @@ -33,6 +33,7 @@ public interface ICDISession { * Returns the current debug target associatd with this sesion, * or null if no debug targets are associated with this session. * + * @deprecated * @return ICDITarget the current debug target */ ICDITarget getCurrentTarget(); @@ -40,6 +41,7 @@ public interface ICDISession { /** * Set the current debug target associatd with this sesion. * + * @deprecated * @return ICDITarget the current debug target */ void setCurrentTarget(ICDITarget target) throws CDIException; diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteResume.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteResume.java new file mode 100644 index 00000000000..d20e9dc6f17 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteResume.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi.model; + +import org.eclipse.cdt.debug.core.cdi.CDIException; +import org.eclipse.cdt.debug.core.cdi.ICDILocation; + +/** + * Provides the ability to resume a thread or debug target. + */ +interface ICDIExecuteResume { + + /** + * Causes this target to resume its execution. + * if passSignal is fase and the target was + * suspended by a signal when resuming the signal will be discarded + * Has no effect on a target that is not suspended. + * + * @param passSignal whether to discar the signal + * @throws CDIException if this method fails. Reasons include: + */ + void resume(boolean passSignal) throws CDIException; + + /** + * Resume execution at location. Note the method does not change stackframe. + * The result is undefined if it jumps outside of the stacframe. + * Can only be called when the associated target is suspended. + * + * @param location + * @throws CDIException if this method fails. Reasons include: + */ + void resume(ICDILocation location) throws CDIException; + + /** + * Resume execution where the program stopped but immediately give the + * signal. + * + * @param signal + * @throws CDIException + */ + void resume(ICDISignal signal) throws CDIException; + +} diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteStep.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteStep.java new file mode 100644 index 00000000000..e3e7b5350bf --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteStep.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi.model; + +import org.eclipse.cdt.debug.core.cdi.CDIException; +import org.eclipse.cdt.debug.core.cdi.ICDILocation; + +/** + * Provides the ability to step into, over, and until + * from the current execution location. Implementations + * must be non-blocking. + */ +public interface ICDIExecuteStep { + + /** + * Steps over the current source line. + * if count <= 0 it is a noop. + * Can only be called when the associated target/thread is suspended. + * + * @param count as in `step', but do so count times. + * @throws CDIException if this method fails. Reasons include: + */ + void stepOver(int count) throws CDIException; + + /** + * Steps over the current machine instruction. Can only be called + * when the associated target/thread is suspended. + * if count <= 0 it is a noop. + * + * @param count as in `stepOverInstruction', but do so count times. + * @throws CDIException if this method fails. Reasons include: + */ + void stepOverInstruction(int count) throws CDIException; + + /** + * Steps into the current source line. Can only be called + * when the associated target/thread is suspended. + * if count <= 0 it is a noop. + * + * @param count as in `step', but do so count times. + * @throws CDIException if this method fails. Reasons include: + */ + void stepInto(int count) throws CDIException; + + /** + * Steps into the current machine instruction. Can only be called + * when the associated target/thread is suspended. + * if count <= 0 it is a noop. + * + * @throws CDIException if this method fails. Reasons include: + */ + void stepIntoInstruction(int count) throws CDIException; + + /** + * Continues running until location is reached. + * If the program will be suspended if attempt to exit the current frame. + * Can only be called when the associated target is suspended. + * + * @throws CDIException if this method fails. Reasons include: + */ + void stepUntil(ICDILocation location) throws CDIException; + +} diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteStepReturn.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteStepReturn.java new file mode 100644 index 00000000000..3d0a9f52c4f --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIExecuteStepReturn.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi.model; + +import org.eclipse.cdt.debug.core.cdi.CDIException; + +/** + * Provides the ability to step return from the frame. + * Implementations must be non-blocking. + */ +public interface ICDIExecuteStepReturn { + + /** + * Continue execution until the frame return. + * + * @throws CDIException if this method fails. Reasons include: + */ + void stepReturn() throws CDIException; + + /** + * Cancel execution of the frame and return with value. + * value can be null, if no return value is needed. + * Can only be called when the associated target/thread is suspended. + * + * @param value use as the returning value. + * @throws CDIException if this method fails. Reasons include: + */ + void stepReturn(ICDIValue value) throws CDIException; + +} diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java index 88a9f6b1d6b..9c0031e3743 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIStackFrame.java @@ -22,7 +22,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation; * * @since Jul 8, 2002 */ -public interface ICDIStackFrame extends ICDIObject { +public interface ICDIStackFrame extends ICDIExecuteStepReturn, ICDIObject { /** * Returns the location of the instruction pointer in this * stack frame. diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISuspend.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISuspend.java new file mode 100644 index 00000000000..645b4d515ff --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDISuspend.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi.model; + +import org.eclipse.cdt.debug.core.cdi.CDIException; + +/** + * Provides the ability to suspend a thread or debug target. +*/ +public interface ICDISuspend { + + /** + * Causes this target/thread to suspend its execution. + * Has no effect on an already suspended thread. + * + * @throws CDIException if this method fails. Reasons include: + */ + void suspend() throws CDIException; + + /** + * Returns whether this target/thread is currently suspended. + * + * @return whether this target/thread is currently suspended + */ + boolean isSuspended(); +} diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java index 6be28d88cf5..edbf1f1b42d 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java @@ -14,7 +14,7 @@ package org.eclipse.cdt.debug.core.cdi.model; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDICondition; import org.eclipse.cdt.debug.core.cdi.ICDILocation; -import org.eclipse.cdt.debug.core.cdi.ICDISession; +import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; /** * @@ -23,13 +23,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDISession; * * @since Jul 8, 2002 */ -public interface ICDITarget extends ICDIBreakpointManagement, ICDIObject { - /** - * Returns the debug session this target is contained in. - * - * @return the debug session this target is contained in - */ - ICDISession getSession(); +public interface ICDITarget extends ICDIThreadGroup, ICDISessionObject { /** * Gets the target process. @@ -39,18 +33,10 @@ public interface ICDITarget extends ICDIBreakpointManagement, ICDIObject { */ Process getProcess(); - /** - * Returns the threads contained in this target. - * An empty collection is returned if this target contains no - * threads. - * - * @return a collection of threads - * @throws CDIException if this method fails. Reasons include: - */ - ICDIThread[] getThreads() throws CDIException; - /** * Set the current thread on the target. + * + * @deprecated * @param - ICDThread */ void setCurrentThread(ICDIThread current) throws CDIException; @@ -104,116 +90,85 @@ public interface ICDITarget extends ICDIBreakpointManagement, ICDIObject { void restart() throws CDIException; /** - * Returns whether this target is currently suspended. - * - * @return whether this target is currently suspended - */ - boolean isSuspended(); - - /** - * Causes this target to resume its execution. - * Has no effect on a target that is not suspended. + * Equivalent to resume(false) * + * @deprecated * @throws CDIException if this method fails. Reasons include: */ void resume() throws CDIException; /** - * Causes this target to suspend its execution. - * Has no effect on an already suspended target. - * - * @throws CDIException if this method fails. Reasons include: - */ - void suspend() throws CDIException; - - /** - * Equivalent to stepReturn(true) - * @throws CDIException if this method fails. Reasons include: - */ - void stepReturn() throws CDIException; - - /** - * If execute is true, continue running until just after function. if - * If execute is false, cancel execution of the function and stop the - * program after the function. - * Can only be called when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepReturn(boolean execute) throws CDIException; - - /** - * Steps over the current source line. Can only be called - * when the associated target is suspended. + * Equivalent to stepOver(1) * + * @deprecated + * @see #stepOver(int) * @throws CDIException if this method fails. Reasons include: */ void stepOver() throws CDIException; /** - * Steps into the current source line. Can only be called - * when the associated target is suspended. + * Equivalent to stepInto(1) * + * @deprecated + * @see #stepInto(int) * @throws CDIException if this method fails. Reasons include: */ void stepInto() throws CDIException; /** - * Steps over the current machine instruction. Can only be called - * when the associated target is suspended. + * Equivalent to stepOverInstruction(1) * + * @deprecated + * @see stepOverInstruction(int) * @throws CDIException if this method fails. Reasons include: */ void stepOverInstruction() throws CDIException; /** - * Steps into the current machine instruction. Can only be called - * when the associated target is suspended. + * Equivalent to stepIntoInstruction(1) * + * @deprecated + * @see #stepIntoInstruction(int) * @throws CDIException if this method fails. Reasons include: */ void stepIntoInstruction() throws CDIException; /** - * Continues running until location is reached. Can only be called when the associated - * target is suspended. + * Equivaltent to stepUntil(location) * + * @deprecated + * @see #stepUntil(ICDILocation) * @throws CDIException if this method fails. Reasons include: */ void runUntil(ICDILocation location) throws CDIException; /** - * Resume execution at location. Note the jump() does not change stackframe. - * The result is undefined if jump outside of the stacframe i.e function. - * Can only be called when the associated target is suspended. + * Equivalent to resume(location * + * @deprecated + * @see #resume(ICDLocation) * @throws CDIException if this method fails. Reasons include: */ void jump(ICDILocation location) throws CDIException; /** - * Method signal, resume execution without giving a signal. + * Equivalent to resume(false) + * + * @deprecated * @throws CDIException */ void signal() throws CDIException; /** - * Resume execution where the program stopped but immediately give the - * signal. + * Equivalent to resume(signal) * + * @deprecated + * @see #resume(ICDISignal) * @param signal * @throws CDIException */ void signal(ICDISignal signal) throws CDIException; - /** - * Returns the currently selected thread. - * - * @return the currently selected thread - * @throws CDIException if this method fails. Reasons include: - */ - ICDIThread getCurrentThread() throws CDIException; - /** * Return a ICDICondition */ diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java index 44906b4d132..69a359017dd 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIThread.java @@ -22,7 +22,8 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation; * * @since Jul 8, 2002 */ -public interface ICDIThread extends ICDIObject { +public interface ICDIThread extends ICDIExecuteStep, ICDIExecuteResume, ICDISuspend, ICDIObject { + /** * Returns the stack frames contained in this thread. An * empty collection is returned if this thread contains @@ -55,6 +56,8 @@ public interface ICDIThread extends ICDIObject { /** * Set the current Stack for the thread. + * + * @deprecated * @param - ICDIStackFrame */ void setCurrentStackFrame(ICDIStackFrame current) throws CDIException; @@ -62,6 +65,8 @@ public interface ICDIThread extends ICDIObject { /** * Set the current frame whithout generation any events, for example * registers changed events. + * + * @deprecated * @param frame * @param b */ @@ -69,107 +74,94 @@ public interface ICDIThread extends ICDIObject { /** * Set the current stackframe. + * + * @deprecated * @return ICDIStackFrame */ ICDIStackFrame getCurrentStackFrame() throws CDIException; - /** - * Returns whether this thread is currently suspended. - * - * @return whether this thread is currently suspended - */ - boolean isSuspended(); /** - * Causes this thread to resume its execution. - * Has no effect on a thread that is not suspended. + * Equivalent to resume(false) * + * @deprecated * @throws CDIException if this method fails. Reasons include: */ void resume() throws CDIException; /** - * Causes this thread to suspend its execution. - * Has no effect on an already suspended thread. - * - * @throws CDIException if this method fails. Reasons include: - */ - void suspend() throws CDIException; - - /** - * Equivalent to stepReturn(true) - * @throws CDIException if this method fails. Reasons include: - */ - void stepReturn() throws CDIException; - - /** - * If execute is true, continue running until just after function. if - * If execute is false, cancel execution of the function and stop the - * program after the function. - * Can only be called when the associated target is suspended. - * - * @throws CDIException if this method fails. Reasons include: - */ - void stepReturn(boolean execute) throws CDIException; - - /** - * Steps over the current source line. Can only be called - * when the associated thread is suspended. + * Equivalent to stepOver(1) * + * @deprecated * @throws CDIException if this method fails. Reasons include: */ void stepOver() throws CDIException; /** - * Steps into the current source line. Can only be called - * when the associated thread is suspended. + * Equivalent to stepInto(1) * + * @deprecated * @throws CDIException if this method fails. Reasons include: */ void stepInto() throws CDIException; /** - * Steps over the current machine instruction. Can only be called - * when the associated thread is suspended. + * Equivalent to stepOverInstruction(1) * + * @deprecated * @throws CDIException if this method fails. Reasons include: */ void stepOverInstruction() throws CDIException; /** - * Steps into the current machine instruction. Can only be called - * when the associated thread is suspended. + * Equivalent to stepIntoInstruction(1) * + * @deprecated * @throws CDIException if this method fails. Reasons include: */ void stepIntoInstruction() throws CDIException; /** - * Continues running until location is reached. - * Can only be called when the associated thread is suspended. + * This method is deprecated and will only be available + * on the stackframe * + * @deprecated + * @see ICDIStackFrame.stepReturn() + * @throws CDIException + */ + void stepReturn() throws CDIException; + + /** + * Equivalent to stepUntil(location) + * + * @deprecated + * @see #stepUntil(ICDILocation) * @throws CDIException if this method fails. Reasons include: */ void runUntil(ICDILocation location) throws CDIException; /** - * Resume execution at location. Note the jump() does not change stackframe. - * The result is undefined if jump outside of the stacframe i.e function. - * Can only be called when the associated target is suspended. + * Equivalent to resume(location) * + * @deprecated + * @see #resume(ICDILocation) * @throws CDIException if this method fails. Reasons include: */ void jump(ICDILocation location) throws CDIException; /** - * Method signal, resume execution without giving a signal. + * Equivalent to resume(false) + * + * @deprecated + * @see #resume(boolean) * @throws CDIException */ void signal() throws CDIException; /** - * Resume execution where the program stopped but immediately give the - * signal. + * Equivalent to resume(signal) * + * @deprecated + * @see #resume(ICDISignal) * @param signal * @throws CDIException */ diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIThreadGroup.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIThreadGroup.java new file mode 100644 index 00000000000..d4be0b9b1c4 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIThreadGroup.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi.model; + +import org.eclipse.cdt.debug.core.cdi.CDIException; + +/** + * @author User + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public interface ICDIThreadGroup extends ICDIBreakpointManagement, ICDIExecuteStep, ICDIExecuteResume, + ICDISuspend, ICDIObject { + + /** + * Returns the threads contained in this target. + * An empty collection is returned if this target contains no + * threads. + * + * @return a collection of threads + * @throws CDIException if this method fails. Reasons include: + */ + ICDIThread[] getThreads() throws CDIException; + + /** + * Returns the currently selected thread. + * + * @return the currently selected thread + * @throws CDIException if this method fails. Reasons include: + */ + ICDIThread getCurrentThread() throws CDIException; + +}