use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.
the class DebuggerTestCase method createEvaluationContext.
protected EvaluationContextImpl createEvaluationContext(final SuspendContextImpl suspendContext) {
try {
StackFrameProxyImpl proxy = suspendContext.getFrameProxy();
assertNotNull(proxy);
return new EvaluationContextImpl(suspendContext, proxy, proxy.thisObject());
} catch (EvaluateException e) {
error(e);
return null;
}
}
use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.
the class ClassInstanceMethodFilter method onReached.
@Override
public int onReached(SuspendContextImpl context, RequestHint hint) {
StackFrameProxyImpl proxy = context.getFrameProxy();
if (proxy != null) {
try {
ObjectReference reference = proxy.thisObject();
if (reference != null) {
StepIntoBreakpoint breakpoint = DebuggerManagerEx.getInstanceEx(context.getDebugProcess().getProject()).getBreakpointManager().addStepIntoBreakpoint(myMethodFilter);
if (breakpoint != null) {
breakpoint.addInstanceFilter(reference.uniqueID());
breakpoint.setInstanceFiltersEnabled(true);
setUpStepIntoBreakpoint(context, breakpoint, hint);
return RequestHint.RESUME;
}
}
} catch (EvaluateException ignored) {
}
}
return RequestHint.STOP;
}
use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.
the class AddSteppingFilterAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
DebugProcessImpl process = debuggerContext.getDebugProcess();
if (process == null) {
return;
}
final StackFrameProxyImpl proxy = PopFrameAction.getStackFrameProxy(e);
process.getManagerThread().schedule(new DebuggerCommandImpl() {
protected void action() throws Exception {
final String name = getClassName(proxy != null ? proxy : debuggerContext.getFrameProxy());
if (name == null) {
return;
}
final Project project = e.getData(CommonDataKeys.PROJECT);
ApplicationManager.getApplication().invokeLater(() -> {
String filter = Messages.showInputDialog(project, "", "Add Stepping Filter", null, name, null);
if (filter != null) {
ClassFilter[] newFilters = ArrayUtil.append(DebuggerSettings.getInstance().getSteppingFilters(), new ClassFilter(filter));
DebuggerSettings.getInstance().setSteppingFilters(newFilters);
}
});
}
});
}
use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.
the class PopFrameAction method update.
public void update(@NotNull AnActionEvent e) {
boolean enable = false;
StackFrameProxyImpl proxy = getStackFrameProxy(e);
if (proxy != null && !proxy.isBottom()) /*&& isAtBreakpoint(e)*/
{
enable = proxy.getVirtualMachine().canPopFrames();
}
if (ActionPlaces.isMainMenuOrActionSearch(e.getPlace()) || ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) {
e.getPresentation().setEnabled(enable);
} else {
e.getPresentation().setVisible(enable);
}
}
use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.
the class LineBreakpoint method calculateEventClass.
@Override
protected String calculateEventClass(EvaluationContextImpl context, LocatableEvent event) throws EvaluateException {
String className = null;
final ObjectReference thisObject = (ObjectReference) context.getThisObject();
if (thisObject != null) {
className = thisObject.referenceType().name();
} else {
final StackFrameProxyImpl frame = context.getFrameProxy();
if (frame != null) {
className = frame.location().declaringType().name();
}
}
return className;
}
Aggregations