summaryrefslogtreecommitdiff
path: root/python/src/com/jetbrains/python/debugger/PyDebugProcess.java
diff options
context:
space:
mode:
Diffstat (limited to 'python/src/com/jetbrains/python/debugger/PyDebugProcess.java')
-rw-r--r--python/src/com/jetbrains/python/debugger/PyDebugProcess.java28
1 files changed, 24 insertions, 4 deletions
diff --git a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java
index cdea41298a4e..ea492e43cf2d 100644
--- a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java
+++ b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java
@@ -17,7 +17,6 @@ package com.jetbrains.python.debugger;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import com.intellij.execution.console.DuplexConsoleView;
import com.intellij.execution.process.ProcessEvent;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.process.ProcessListener;
@@ -88,6 +87,7 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
private boolean myWaitingForConnection = false;
private PyStackFrame myStackFrameBeforeResume;
private PyStackFrame myConsoleContextFrame = null;
+ private PyReferrersLoader myReferrersProvider;
public PyDebugProcess(final @NotNull XDebugSession session,
@NotNull final ServerSocket serverSocket,
@@ -489,7 +489,7 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
return myDebugger.evaluate(frame.getThreadId(), frame.getFrameId(), expression, execute, trimResult);
}
- public void consoleExec(String command, ProcessDebugger.DebugCallback<String> callback) {
+ public void consoleExec(String command, PyDebugCallback<String> callback) {
dropFrameCaches();
try {
final PyStackFrame frame = currentFrame();
@@ -539,6 +539,17 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
}
@Override
+ public void loadReferrers(PyReferringObjectsValue var, PyDebugCallback<XValueChildrenList> callback) {
+ try {
+ final PyStackFrame frame = currentFrame();
+ myDebugger.loadReferrers(frame.getThreadId(), frame.getFrameId(), var, callback);
+ }
+ catch (PyDebuggerException e) {
+ callback.error(e);
+ }
+ }
+
+ @Override
public void changeVariable(final PyDebugValue var, final String value) throws PyDebuggerException {
final PyStackFrame frame = currentFrame();
PyDebugValue newValue = myDebugger.changeVariable(frame.getThreadId(), frame.getFrameId(), var, value);
@@ -546,14 +557,23 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
}
@Nullable
+ @Override
+ public PyReferrersLoader getReferrersLoader() {
+ if (myReferrersProvider == null) {
+ myReferrersProvider = new PyReferrersLoader(this);
+ }
+ return myReferrersProvider;
+ }
+
+ @Nullable
public String loadSource(String path) {
return myDebugger.loadSource(path);
}
@Override
- public boolean isVariable(String name) {
+ public boolean canSaveToTemp(String name) {
final Project project = getSession().getProject();
- return PyDebugSupportUtils.isVariable(project, name);
+ return PyDebugSupportUtils.canSaveToTemp(project, name);
}
private PyStackFrame currentFrame() throws PyDebuggerException {