Search in sources :

Example 1 with IFDStackFrame

use of com.intergral.fusiondebug.server.IFDStackFrame in project Lucee by lucee.

the class FDThreadImpl method getStack.

@Override
public List<IFDStackFrame> getStack() {
    List<PageSource> stack = pc.getPageSourceList();
    StackTraceElement[] traces = pc.getThread().getStackTrace();
    String template = "";
    StackTraceElement trace = null;
    ArrayList<IFDStackFrame> list = new ArrayList<IFDStackFrame>();
    PageSource ps;
    int index = stack.size();
    for (int i = traces.length - 1; i >= 0; i--) {
        trace = traces[i];
        ps = null;
        if (trace.getLineNumber() <= 0)
            continue;
        template = trace.getFileName();
        if (template == null || ResourceUtil.getExtension(template, "").equals("java"))
            continue;
        if (index > 0)
            ps = stack.get(--index);
        if (ps == null || !isEqual(ps, trace)) {
            ps = toPageSource(pc, template);
        }
        FDStackFrameImpl frame = new FDStackFrameImpl(this, pc, trace, ps);
        if (ASMUtil.isOverfowMethod(trace.getMethodName()))
            list.set(0, frame);
        else
            list.add(0, frame);
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) IFDStackFrame(com.intergral.fusiondebug.server.IFDStackFrame) PageSource(lucee.runtime.PageSource)

Aggregations

IFDStackFrame (com.intergral.fusiondebug.server.IFDStackFrame)1 ArrayList (java.util.ArrayList)1 PageSource (lucee.runtime.PageSource)1