*/
protected static PyStackFrame getCurrentSuspendedPyStackFrame(IConsole console) {
IAdaptable context = DebugUITools.getDebugContext();
if (context instanceof PyStackFrame) {
PyStackFrame stackFrame = (PyStackFrame) context;
if (!stackFrame.isTerminated() && stackFrame.isSuspended()) {
if (console != null) {
//If a console is passed, we must check if it matches the console from the selected frame.
AbstractDebugTarget target = (AbstractDebugTarget) stackFrame.getAdapter(IDebugTarget.class);
if (DebugUITools.getConsole(target.getProcess()) != console) {
return null;
}
}