--- debuggercore/api/apichanges.xml:1.6 +++ debuggercore/api/apichanges.xml:1.6 @@ -181,6 +181,25 @@
++ Compatile change. +
+
+ Added fields:
+ ActionsManager.ACTION_STEP_OPERATION
,
+ This constant is used in action performer which implements an operation step.
+
+ In order to be able to provide stepping over operations, + we need a representation of an operation and some way how to + retrieve the operation(s) from a Thread and a CallStackFrame. +
+
+ Added fields:
+ JPDAStep.STEP_OPERATION
,
+ EditorContext.CURRENT_LAST_OPERATION_ANNOTATION_TYPE
,
+ EditorContext.CURRENT_EXPRESSION_SECONDARY_LINE_ANNOTATION_TYPE
,
+ EditorContext.CURRENT_EXPRESSION_CURRENT_LINE_ANNOTATION_TYPE
+
+ Added methods:
+ CallStackFrame.getCurrentOperation()
,
+ JPDAThread.getCurrentOperation()
,
+ JPDAThread.getLastOperations()
,
+ EditorContext.createMethodOperation()
,
+ EditorContext.addNextOperationTo()
,
+ EditorContext.createPosition()
,
+ EditorContext.getOperations()
+
+ Added classes:
+ EditorContext.BytecodeProvider
,
+ EditorContext.Operation
,
+ EditorContext.Position
+
null
otherwise
+ */
+ public abstract Operation getCurrentOperation(String struts);
/**
* Returns method name associated with this stack frame.
--- debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDAStep.java:1.3 Fri Jun 30 12:04:47 2006
+++ debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDAStep.java:1.3 Fri Jul 21 10:59:11 2006
@@ -44,6 +44,8 @@
public static final int STEP_OUT = StepRequest.STEP_OUT;
/** Step to the next location on a different line */
public static final int STEP_LINE = StepRequest.STEP_LINE;
+ /** Step to the next available operation */
+ public static final int STEP_OPERATION = 10;
/** Step to the next available location */
public static final int STEP_MIN = StepRequest.STEP_MIN;
/** Property fired when the step is executed */
--- debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDAThread.java:1.10 Fri Jun 30 12:04:47 2006
+++ debuggerjpda/api/src/org/netbeans/api/debugger/jpda/JPDAThread.java:1.10 Thu Jan 18 08:34:30 2007
@@ -22,6 +22,9 @@
import com.sun.jdi.AbsentInformationException;
import com.sun.jdi.ThreadReference;
import java.beans.PropertyChangeListener;
+import java.util.List;
+import org.netbeans.spi.debugger.jpda.EditorContext;
+import org.netbeans.spi.debugger.jpda.EditorContext.Operation;
/**
@@ -82,6 +85,25 @@
* @see CallStackFrame
*/
public abstract int getLineNumber (String stratum);
+
+ /**
+ * Returns the operation that is being currently executed on this thread.
+ * @return The current operation, or null
.
+ * @see {@link CallStackFrame#getCurrentOperation}
+ */
+ public abstract Operation getCurrentOperation();
+
+ /**
+ * Returns the list of the last operations, that were performed on this thread.
+ * Typically just operations from the current expression are stored.
+ * The thread should be suspended at the moment this method is called.
+ *
+ * @return The list of last operations if available, the thread is suspended,
+ * contains at least one frame and the topmost frame does not
+ * represent a native method invocation; null
otherwise
+ * @see CallStackFrame
+ */
+ public abstract Listnull
, when the annotation can not be
+ * created at the given URL or line number.
+ */
+ public Object annotate (
+ String url,
+ int startPosition,
+ int endPosition,
+ String annotationType,
+ Object timeStamp
+ ) {
+ return null;
+ }
+
+ /**
* Returns line number given annotation is associated with.
*
* @param annotation a annotation
@@ -207,6 +240,70 @@
public abstract String[] getImports (String url);
/**
+ * Creates an operation which is determined by starting and ending position.
+ *
+ protected final Operation createOperation(Position startPosition,
+ Position endPosition,
+ int bytecodeIndex) {
+ return new Operation(startPosition, endPosition, bytecodeIndex);
+ }
+ */
+
+ /**
+ * Creates a method operation.
+ * @param startPosition The starting position of the operation
+ * @param endPosition The ending position of the operation
+ * @param methodStartPosition The starting position of the method name
+ * @param methodEndPosition The ending position of the method name
+ * @param methodName The string representation of the method name
+ * @param methodClassType The class type, which defines this method
+ * @param bytecodeIndex The bytecode index of this method call
+ */
+ protected final Operation createMethodOperation(Position startPosition,
+ Position endPosition,
+ Position methodStartPosition,
+ Position methodEndPosition,
+ String methodName,
+ String methodClassType,
+ int bytecodeIndex) {
+ return new Operation(startPosition, endPosition,
+ methodStartPosition, methodEndPosition,
+ methodName, methodClassType, bytecodeIndex);
+ }
+
+ /**
+ * Assign a next operation, concatenates operations.
+ * @param operation The first operation
+ * @param next The next operation
+ */
+ protected final void addNextOperationTo(Operation operation, Operation next) {
+ operation.addNextOperation(next);
+ }
+
+ /**
+ * Creates a new {@link Position} object.
+ * @param offset The offset
+ * @param line The line number
+ * @param column The column number
+ */
+ protected final Position createPosition(
+ int offset, int line, int column) {
+
+ return new Position(offset, line, column);
+ }
+
+ /**
+ * Get the list of operations that are in expression(s) located at the given line.
+ * @param url The file's URL
+ * @param lineNumber The line number
+ * @param bytecodeProvider The provider of method bytecodes.
+ */
+ public Operation[] getOperations(String url, int lineNumber,
+ BytecodeProvider bytecodeProvider) {
+ throw new UnsupportedOperationException("This method is not implemented.");
+ }
+
+ /**
* Adds a property change listener.
*
* @param l the listener to add
@@ -241,5 +338,226 @@
String propertyName,
PropertyChangeListener l
);
+
+ /**
+ * A provider of method bytecode information.
+ */
+ public interface BytecodeProvider {
+
+ /**
+ * Retrieve the class' constant pool.
+ */
+ byte[] constantPool();
+
+ /**
+ * Retrieve the bytecodes of the method.
+ */
+ byte[] byteCodes();
+
+ /**
+ * Get an array of bytecode indexes of operations between the starting
+ * and ending line.
+ * @param startLine The starting line
+ * @param endLine The ending line
+ */
+ int[] indexAtLines(int startLine, int endLine);
+
+ }
+
+ /**
+ * The operation definition.
+ */
+ public static final class Operation {
+
+ private final Position startPosition;
+ private final Position endPosition;
+ private final int bytecodeIndex;
+
+ private Position methodStartPosition;
+ private Position methodEndPosition;
+ private String methodName;
+ private String methodClassType;
+ private Variable returnValue;
+
+ private List