use of com.intellij.debugger.memory.utils.StackFrameItem in project intellij-community by JetBrains.
the class StackCapturingLineBreakpoint method processLocatableEvent.
@Override
public boolean processLocatableEvent(SuspendContextCommandImpl action, LocatableEvent event) throws EventProcessingException {
SuspendContextImpl suspendContext = action.getSuspendContext();
if (suspendContext != null) {
ThreadReferenceProxyImpl thread = suspendContext.getThread();
if (thread != null) {
DebugProcessImpl process = suspendContext.getDebugProcess();
try {
StackFrameProxyImpl frameProxy = ContainerUtil.getFirstItem(thread.forceFrames());
if (frameProxy != null) {
Map<Object, List<StackFrameItem>> stacks = process.getUserData(CAPTURED_STACKS);
if (stacks == null) {
stacks = new CapturedStacksMap();
process.putUserData(CAPTURED_STACKS, Collections.synchronizedMap(stacks));
}
Value key = myCaptureEvaluator.evaluate(new EvaluationContextImpl(suspendContext, frameProxy));
if (key instanceof ObjectReference) {
List<StackFrameItem> frames = StackFrameItem.createFrames(suspendContext, true);
if (frames.size() > MAX_STACK_LENGTH) {
frames = frames.subList(0, MAX_STACK_LENGTH);
}
stacks.put(getKey((ObjectReference) key), frames);
}
}
} catch (EvaluateException e) {
LOG.debug(e);
process.printToConsole(DebuggerBundle.message("error.unable.to.evaluate.capture.expression", e.getMessage()) + "\n");
}
}
}
return false;
}
use of com.intellij.debugger.memory.utils.StackFrameItem in project intellij-community by JetBrains.
the class JumpToAllocationSourceAction method perform.
@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
final Project project = e.getProject();
final List<StackFrameItem> stack = getStack(e);
if (project != null && stack != null) {
final XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
if (session != null) {
DebugProcessImpl process = (DebugProcessImpl) DebuggerManager.getInstance(project).getDebugProcess(session.getDebugProcess().getProcessHandler());
StackFramePopup.show(stack, process);
}
}
}
use of com.intellij.debugger.memory.utils.StackFrameItem in project intellij-community by JetBrains.
the class ShowRelatedStackAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
Project project = e.getProject();
List<StackFrameItem> stack = getRelatedStack(e);
if (project != null && stack != null) {
DebugProcessImpl debugProcess = DebuggerAction.getDebuggerContext(e.getDataContext()).getDebugProcess();
if (debugProcess == null) {
return;
}
StackFramePopup.show(stack, debugProcess);
}
}
Aggregations