@Nullable public StackFrame getStackFrame() { try { return myThreadReference.frame(myIndex); } catch (Throwable t) { LOG.error(t); return null; } }
/** if this line can not be current => stepOver & return true. return false on the other hand. */ boolean resolveCanBeCurrent(ThreadReference tr) { try { Location l = tr.frame(0).location(); if (l == null) return false; return resolveCanBeCurrent( tr, Utils.getLineForSource(l.declaringType().name(), l.sourceName(), l.lineNumber())); } catch (Exception e) { } return false; }
public Value getLocalVariableValue(ThreadReference tr, int frameIdx, String localName) throws AbsentInformationException, IncompatibleThreadStateException { StackFrame fr = tr.frame(frameIdx); Value ret = null; LocalVariable var = fr.visibleVariableByName(localName); if (var != null) { ret = fr.getValue(var); } return ret; }
/** * Get the current stackframe. * * @return the current stackframe. */ public StackFrame getCurrentFrame() throws IncompatibleThreadStateException { if (thread.frameCount() == 0) { return null; } return thread.frame(currentFrameIndex); }