if (ch instanceof CallStackFrame) { frame = (CallStackFrame) ch; frameStr.append(frame.getClassName()); frameStr.append("."); frameStr.append(frame.getMethodName()); } else if (ch instanceof JSStackFrame) { JSStackFrame jsframe = (JSStackFrame) ch; frame = jsframe.getJavaFrame(); String cName = frame.getClassName(); if (cName.startsWith(JSUtils.NASHORN_SCRIPT)) { cName = cName.substring(JSUtils.NASHORN_SCRIPT.length()); frameStr.append(frame.getMethodName()); } else { frame = null; String sourceName = frame.getSourceName(null); frameStr.append("("); frameStr.append(sourceName); int line = frame.getLineNumber(null); if (line > 0) { frameStr.append(":");
private void currentStackFrameChanged(CallStackFrame csf) { if (csf != null && csf.getClassName().startsWith(JSUtils.NASHORN_SCRIPT)) { JPDAThread thread = csf.getThread(); suspendedNashornThread = new WeakReference<>(thread); try { Object node = dvSupport.getClass().getMethod("get", JPDAThread.class).invoke(dvSupport, thread); boolean explicitCollaps; synchronized (this) { explicitCollaps = collapsedExplicitly.contains(node); } if (!explicitCollaps) { fireNodeExpanded(node); } } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException ex) { Exceptions.printStackTrace(ex); } } else { suspendedNashornThread = NO_THREAD; } }
public static String getRelativePath ( CallStackFrame csf, String stratumn ) { try { return convertSlash (csf.getSourcePath (stratumn)); } catch (AbsentInformationException e) { return getRelativePath (csf.getClassName ()); } }
public boolean showSource (CallStackFrame csf, String stratumn) { try { String url = getURL ( convertSlash (csf.getSourcePath (stratumn)), true ); if (url == null) { stratumn = csf.getDefaultStratum (); url = getURL ( convertSlash (csf.getSourcePath (stratumn)), true ); "Show Source: No URL for source path "+csf.getSourcePath (stratumn)+ "\nThe reason is likely no opened project for this source file."); return false; int lineNumber = csf.getLineNumber (stratumn); if (lineNumber < 1) lineNumber = 1; return EditorContextBridge.getContext().showSource ( } catch (AbsentInformationException e) { String url = getURL ( convertClassNameToRelativePath (csf.getClassName ()), true ); if (url == null) { ErrorManager.getDefault().log(ErrorManager.WARNING, "Show Source: No source URL for class "+csf.getClassName()+ "\nThe reason is likely no opened project for the source file."); return false;
String stratumn ) { int lineNumber = csf.getLineNumber (stratumn); if (lineNumber < 1) return null; Operation operation = csf.getCurrentOperation(stratumn); try { if (operation != null) { getURL (convertSlash (csf.getSourcePath (stratumn)), true), startOffset, endOffset, } else { return EditorContextBridge.getContext().annotate ( getURL (convertSlash (csf.getSourcePath (stratumn)), true), lineNumber, EditorContext.CALL_STACK_FRAME_ANNOTATION_TYPE, return EditorContextBridge.getContext().annotate ( getURL ( convertClassNameToRelativePath (csf.getClassName ()), true ), lineNumber,
static Object[] filterChildren(Object[] children) { List<Object> newChildren = new ArrayList<>(children.length); newChildren.addAll(Arrays.asList(children)); for (int i = 0; i < newChildren.size(); i++) { Object ch = newChildren.get(i); if (ch instanceof CallStackFrame) { String className = ((CallStackFrame) ch).getClassName(); if (className.startsWith(FILTER1) || className.startsWith(FILTER2)) { newChildren.remove(i); i--; } } } return newChildren.toArray(); }
This thisVar = currentFrame.getThisVariable(); if (thisVar != null) { String fqn = thisVar.getType(); addClassNames(currentFrame.getClassName(), superTypeNames);
public static void setupContext(JEditorPane editorPane) { EditorKit kit = CloneableEditorSupport.getEditorKit("text/x-scala"); editorPane.setEditorKit(kit); DebuggerEngine en = DebuggerManager.getDebuggerManager ().getCurrentEngine(); JPDADebugger d = en.lookupFirst(null, JPDADebugger.class); CallStackFrame csf = d.getCurrentCallStackFrame(); if (csf != null) { String language = DebuggerManager.getDebuggerManager ().getCurrentSession().getCurrentLanguage(); SourcePath sp = en.lookupFirst(null, SourcePath.class); String url = sp.getURL(csf, language); int line = csf.getLineNumber(language); setupContext(editorPane, url, line); } }
void run(Object[] nodes) { List<JPDAThread> threads = new ArrayList<>(nodes.length); for (Object node : nodes) { if (node instanceof JPDAThread) { threads.add((JPDAThread) node); } if (node instanceof CallStackFrame) { JPDAThread t = ((CallStackFrame) node).getThread(); if (!threads.contains(t)) { threads.add(t); } } } if (threads.isEmpty()) { threads.add(debugger.getCurrentThread()); } stackToCLBD (threads); } }
This thisVariable = csf.getThisVariable(); if (thisVariable == null) { return null;
public String getURL ( CallStackFrame csf, String stratumn ) { try { return getURL (convertSlash (csf.getSourcePath (stratumn)), true); } catch (AbsentInformationException e) { return getURL ( convertClassNameToRelativePath (csf.getClassName ()), true ); } }
static Object[] filterChildren(Object[] children) { List<Object> newChildren = new ArrayList<>(children.length); newChildren.addAll(Arrays.asList(children)); for (int i = 0; i < newChildren.size(); i++) { Object ch = newChildren.get(i); if (ch instanceof CallStackFrame) { String className = ((CallStackFrame) ch).getClassName(); if (className.startsWith(FILTER1) || className.startsWith(FILTER2)) { newChildren.remove(i); i--; } } } return newChildren.toArray(); }
This thisVar = currentFrame.getThisVariable(); if (thisVar != null) { String fqn = thisVar.getType(); addClassNames(currentFrame.getClassName(), superTypeNames);
void run(Object[] nodes) { List<JPDAThread> threads = new ArrayList<>(nodes.length); for (Object node : nodes) { if (node instanceof JPDAThread) { threads.add((JPDAThread) node); } if (node instanceof CallStackFrame) { JPDAThread t = ((CallStackFrame) node).getThread(); if (!threads.contains(t)) { threads.add(t); } } } if (threads.isEmpty()) { threads.add(debugger.getCurrentThread()); } stackToCLBD (threads); } }
This thisVariable = csf.getThisVariable(); if (thisVariable == null) { return null;
frame = (CallStackFrame) ch; frameStr.append("\tat "); frameStr.append(frame.getClassName()); frameStr.append("."); frameStr.append(frame.getMethodName()); } else if (ch instanceof JSStackFrame) { JSStackFrame jsframe = (JSStackFrame) ch; frame = jsframe.getJavaFrame(); String cName = frame.getClassName(); if (cName.startsWith(JSUtils.NASHORN_SCRIPT)) { cName = cName.substring(JSUtils.NASHORN_SCRIPT.length()); frameStr.append(cName); frameStr.append("."); frameStr.append(frame.getMethodName()); } else { frame = null; String sourceName = frame.getSourceName(null); frameStr.append("("); frameStr.append(sourceName); int line = frame.getLineNumber(null); if (line > 0) { frameStr.append(":");
public boolean sourceAvailable ( CallStackFrame csf, String stratumn ) { try { return sourceAvailable ( convertSlash (csf.getSourcePath (stratumn)), true ); } catch (AbsentInformationException e) { return sourceAvailable ( convertClassNameToRelativePath (csf.getClassName ()), true ); } }
static Object[] createChildrenWithJSStack(Object[] children) { boolean isJSStack = false; for (int i = 0; i < children.length; i++) { Object ch = children[i]; if (ch instanceof CallStackFrame) { CallStackFrame csf = (CallStackFrame) ch; if (csf.getClassName().startsWith(JSUtils.NASHORN_SCRIPT)) { if (!isJSStack) { Object[] children2 = new Object[children.length]; System.arraycopy(children, 0, children2, 0, children.length); children = children2; } children[i] = JSStackFrame.get(csf); isJSStack = true; } } } if (isJSStack) { return children; } else { return null; } }
static Object[] createChildrenWithJSStack(Object[] children) { boolean isJSStack = false; for (int i = 0; i < children.length; i++) { Object ch = children[i]; if (ch instanceof CallStackFrame) { CallStackFrame csf = (CallStackFrame) ch; if (csf.getClassName().startsWith(JSUtils.NASHORN_SCRIPT)) { if (!isJSStack) { Object[] children2 = new Object[children.length]; System.arraycopy(children, 0, children2, 0, children.length); children = children2; } children[i] = JSStackFrame.get(csf); isJSStack = true; } } } if (isJSStack) { return children; } else { return null; } }