void setSuspendedEvent(SuspendedEvent suspendedEvent) { assert session == null || session == suspendedEvent.getSession(); frame = new DebugStackFrame(suspendedEvent, depth == 0 ? null : frameInstance, depth); }
void setSuspendedEvent(SuspendedEvent suspendedEvent) { assert session == suspendedEvent.getSession(); if (catchLocation != null) { catchLocation.setSuspendedEvent(suspendedEvent); } this.suspendedEvent = suspendedEvent; }
private CatchLocation cloneFor(DebuggerSession ds) { assert this.session == null; CatchLocation clon = new CatchLocation(ds, section, frameInstance, depth); if (frame != null) { assert ds == frame.event.getSession(); clon.frame = frame; } return clon; } }
DebugValue wrapHeapValue(Object result) { LanguageInfo language; RootNode root = findCurrentRoot(); if (root != null) { language = root.getLanguageInfo(); } else { language = null; } return new HeapValue(event.getSession(), language, null, result); }
DebugValue wrapHeapValue(Object result) { LanguageInfo language; RootNode root = findCurrentRoot(); if (root != null) { language = root.getLanguageInfo(); } else { language = null; } return new HeapValue(event.getSession().getDebugger(), language, null, result); }
/** * Returns the source section of the location where the debugging session was suspended. The * source section is <code>null</code> if the source location is not available. * * <p> * This method is thread-safe. * * @since 0.17 */ public SourceSection getSourceSection() { verifyValidState(true); if (currentFrame == null) { SuspendedContext context = getContext(); return event.getSession().resolveSection(context.getInstrumentedSourceSection()); } else { Node callNode = currentFrame.getCallNode(); if (callNode != null) { return event.getSession().resolveSection(callNode.getEncapsulatingSourceSection()); } return null; } }
/** * A description of the AST (expected to be a method or procedure name in most languages) that * identifies the AST for the benefit of guest language programmers using tools; it might * appear, for example in the context of a stack dump or trace and is not expected to be called * often. If the language does not provide such a description then <code>null</code> is * returned. * * <p> * This method is thread-safe. * * @since 0.17 */ public String getName() throws DebugException { verifyValidState(true); RootNode root = findCurrentRoot(); if (root == null) { return null; } try { return root.getName(); } catch (ThreadDeath td) { throw td; } catch (Throwable ex) { throw new DebugException(event.getSession(), ex, root.getLanguageInfo(), null, true, null); } }
private static Object evalInContext(SuspendedEvent ev, Node node, MaterializedFrame frame, String code) { RootNode rootNode = node.getRootNode(); if (rootNode == null) { throw new IllegalArgumentException("Cannot evaluate in context using a node that is not yet adopated using a RootNode."); } LanguageInfo info = rootNode.getLanguageInfo(); if (info == null) { throw new IllegalArgumentException("Cannot evaluate in context using a without an associated TruffleLanguage."); } if (!info.isInteractive()) { throw new IllegalStateException("Can not evaluate in a non-interactive language."); } final Source source = Source.newBuilder(info.getId(), code, "eval in context").build(); ExecutableNode fragment = ev.getSession().getDebugger().getEnv().parseInline(source, node, frame); if (fragment != null) { ev.getInsertableNode().setParentOf(fragment); return fragment.execute(frame); } else { return Debugger.ACCESSOR.evalInContext(source, node, frame); } }
return evalInContext(ev, node, frame, code); } catch (KillException kex) { throw new DebugException(ev.getSession(), "Evaluation was killed.", null, true, null); } catch (Throwable ex) { LanguageInfo language = null; language = root.getLanguageInfo(); throw new DebugException(ev.getSession(), ex, language, null, true, null);
Debugger debugger = event.getSession().getDebugger(); MaterializedFrame frame = findTruffleFrame(); Iterable<Scope> scopes = debugger.getEnv().findLocalScopes(node, frame);
DebuggerSession session = event.getSession(); MaterializedFrame frame = findTruffleFrame(); try {