public DebuggerContextImpl createDebuggerContext(
      final SuspendContextImpl suspendContext, StackFrameProxyImpl stackFrame) {
    final DebuggerSession[] session = new DebuggerSession[1];

    UIUtil.invokeAndWaitIfNeeded(
        new Runnable() {
          @Override
          public void run() {
            session[0] =
                DebuggerManagerEx.getInstanceEx(myProject)
                    .getSession(suspendContext.getDebugProcess());
          }
        });

    DebuggerContextImpl debuggerContext =
        DebuggerContextImpl.createDebuggerContext(
            session[0],
            suspendContext,
            stackFrame != null ? stackFrame.threadProxy() : null,
            stackFrame);
    debuggerContext.initCaches();
    return debuggerContext;
  }