Search in sources :

Example 1 with XSLStackFrame

use of org.eclipse.wst.xsl.launching.model.XSLStackFrame in project webtools.sourceediting by eclipse.

the class JAXPDebugTarget method getStackFrames.

/**
 * Returns the current stack frames in the target.
 */
public IStackFrame[] getStackFrames() throws DebugException {
    synchronized (STACK_FRAMES_LOCK) {
        if (stale) {
            stale = false;
            String framesData = sendRequest(DebugConstants.REQUEST_STACK);
            // $NON-NLS-1$
            String[] frames = framesData.split("\\$\\$\\$");
            IStackFrame[] sf = new IStackFrame[frames.length];
            List<IStackFrame> currentFrames = Arrays.asList(stackFramesCache);
            for (int i = 0; i < frames.length; i++) {
                String data = frames[i];
                XSLStackFrame frame = new XSLStackFrame(thread, data, i);
                int index;
                if ((index = currentFrames.indexOf(frame)) != -1) {
                    XSLStackFrame curr = (XSLStackFrame) currentFrames.get(index);
                    curr.setLineNumber(frame.getLineNumber());
                    curr.setVariables(frame.getVariables());
                    frame = curr;
                }
                sf[frames.length - i - 1] = frame;
            }
            stackFramesCache = sf;
        }
        return stackFramesCache;
    }
}
Also used : IStackFrame(org.eclipse.debug.core.model.IStackFrame) XSLStackFrame(org.eclipse.wst.xsl.launching.model.XSLStackFrame) ILineBreakpoint(org.eclipse.debug.core.model.ILineBreakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint)

Aggregations

IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)1 ILineBreakpoint (org.eclipse.debug.core.model.ILineBreakpoint)1 IStackFrame (org.eclipse.debug.core.model.IStackFrame)1 XSLStackFrame (org.eclipse.wst.xsl.launching.model.XSLStackFrame)1