use of com.sun.jdi.InvalidStackFrameException in project che by eclipse.
the class JdiStackFrameImpl method getFields.
@Override
public JdiField[] getFields() throws DebuggerException {
if (fields == null) {
try {
ObjectReference object = stackFrame.thisObject();
if (object == null) {
ReferenceType type = stackFrame.location().declaringType();
List<Field> fs = stackFrame.location().declaringType().allFields();
fields = new JdiField[fs.size()];
int i = 0;
for (Field f : fs) {
fields[i++] = new JdiFieldImpl(f, type);
}
} else {
List<Field> fs = object.referenceType().allFields();
fields = new JdiField[fs.size()];
int i = 0;
for (Field f : fs) {
fields[i++] = new JdiFieldImpl(f, object);
}
}
Arrays.sort(fields);
} catch (InvalidStackFrameException e) {
throw new DebuggerException(e.getMessage(), e);
}
}
return fields;
}
use of com.sun.jdi.InvalidStackFrameException in project intellij-community by JetBrains.
the class PopFrameAction method actionPerformed.
public void actionPerformed(@NotNull AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
final JavaStackFrame stackFrame = getStackFrame(e);
if (stackFrame == null || stackFrame.getStackFrameProxy().isBottom()) {
return;
}
try {
final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
if (debugProcess == null) {
return;
}
debugProcess.getSession().setSteppingThrough(stackFrame.getStackFrameProxy().threadProxy());
if (evaluateFinallyBlocks(project, UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)), stackFrame, new XDebuggerEvaluator.XEvaluationCallback() {
@Override
public void evaluated(@NotNull XValue result) {
popFrame(debugProcess, debuggerContext, stackFrame);
}
@Override
public void errorOccurred(@NotNull final String errorMessage) {
ApplicationManager.getApplication().invokeLater(() -> Messages.showMessageDialog(project, DebuggerBundle.message("error.executing.finally", errorMessage), UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)), Messages.getErrorIcon()));
}
}))
return;
popFrame(debugProcess, debuggerContext, stackFrame);
} catch (NativeMethodException e2) {
Messages.showMessageDialog(project, DebuggerBundle.message("error.native.method.exception"), UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)), Messages.getErrorIcon());
} catch (InvalidStackFrameException | VMDisconnectedException ignored) {
}
}
use of com.sun.jdi.InvalidStackFrameException in project che by eclipse.
the class JdiStackFrameImpl method getLocalVariables.
@Override
public JdiLocalVariable[] getLocalVariables() throws DebuggerException {
if (localVariables == null) {
try {
List<LocalVariable> targetVariables = stackFrame.visibleVariables();
localVariables = new JdiLocalVariable[targetVariables.size()];
int i = 0;
for (LocalVariable var : targetVariables) {
localVariables[i++] = new JdiLocalVariableImpl(stackFrame, var);
}
} catch (AbsentInformationException e) {
throw new DebuggerAbsentInformationException(e.getMessage(), e);
} catch (InvalidStackFrameException | NativeMethodException e) {
throw new DebuggerException(e.getMessage(), e);
}
}
return localVariables;
}
use of com.sun.jdi.InvalidStackFrameException in project che by eclipse.
the class Evaluator method getLocalVariable.
public ExpressionValue getLocalVariable(String text) {
ExpressionValue value = null;
try {
StackFrame frame = thread.frame(0);
LocalVariable var = frame.visibleVariableByName(text);
if (var != null) {
value = new LocalValue(thread, var);
}
} catch (IncompatibleThreadStateException | AbsentInformationException | InvalidStackFrameException | NativeMethodException e) {
throw new ExpressionException(e.getMessage(), e);
}
LOG.debug("GET local variable {} {} ", text, value);
return value;
}
use of com.sun.jdi.InvalidStackFrameException in project intellij-community by JetBrains.
the class NodeDescriptorImpl method updateRepresentationNoNotify.
protected void updateRepresentationNoNotify(EvaluationContextImpl context, DescriptorLabelListener labelListener) {
try {
try {
myEvaluateException = null;
myLabel = calcRepresentation(context, labelListener);
} catch (InconsistentDebugInfoException e) {
throw new EvaluateException(DebuggerBundle.message("error.inconsistent.debug.info"));
} catch (InvalidStackFrameException e) {
throw new EvaluateException(DebuggerBundle.message("error.invalid.stackframe"));
} catch (VMDisconnectedException e) {
throw e;
} catch (RuntimeException e) {
if (e.getCause() instanceof InterruptedException) {
throw e;
}
LOG.error(e);
throw new EvaluateException("Internal error, see logs for more details");
}
} catch (EvaluateException e) {
setFailed(e);
}
}
Aggregations