use of com.intellij.debugger.engine.requests.MethodReturnValueWatcher in project intellij-community by JetBrains.
the class DebugProcessImpl method getLastExecutedMethod.
@Nullable
public Pair<Method, Value> getLastExecutedMethod() {
final MethodReturnValueWatcher watcher = myReturnValueWatcher;
if (watcher == null) {
return null;
}
final Method method = watcher.getLastExecutedMethod();
if (method == null) {
return null;
}
return Pair.create(method, watcher.getLastMethodReturnValue());
}
use of com.intellij.debugger.engine.requests.MethodReturnValueWatcher in project intellij-community by JetBrains.
the class DebugProcessEvents method vmAttached.
private void vmAttached() {
DebuggerManagerThreadImpl.assertIsManagerThread();
LOG.assertTrue(!isAttached());
if (myState.compareAndSet(State.INITIAL, State.ATTACHED)) {
final VirtualMachineProxyImpl machineProxy = getVirtualMachineProxy();
final EventRequestManager requestManager = machineProxy.eventRequestManager();
if (machineProxy.canGetMethodReturnValues()) {
myReturnValueWatcher = new MethodReturnValueWatcher(requestManager);
}
final ThreadStartRequest threadStartRequest = requestManager.createThreadStartRequest();
threadStartRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
threadStartRequest.enable();
final ThreadDeathRequest threadDeathRequest = requestManager.createThreadDeathRequest();
threadDeathRequest.setSuspendPolicy(EventRequest.SUSPEND_NONE);
threadDeathRequest.enable();
// fill position managers
((DebuggerManagerImpl) DebuggerManager.getInstance(getProject())).getCustomPositionManagerFactories().map(factory -> factory.fun(this)).filter(Objects::nonNull).forEach(this::appendPositionManager);
Stream.of(Extensions.getExtensions(PositionManagerFactory.EP_NAME, getProject())).map(factory -> factory.createPositionManager(this)).filter(Objects::nonNull).forEach(this::appendPositionManager);
myDebugProcessDispatcher.getMulticaster().processAttached(this);
createStackCapturingBreakpoints();
// breakpoints should be initialized after all processAttached listeners work
ApplicationManager.getApplication().runReadAction(() -> {
XDebugSession session = getSession().getXDebugSession();
if (session != null) {
session.initBreakpoints();
}
});
final String addressDisplayName = DebuggerBundle.getAddressDisplayName(getConnection());
final String transportName = DebuggerBundle.getTransportName(getConnection());
showStatusText(DebuggerBundle.message("status.connected", addressDisplayName, transportName));
LOG.debug("leave: processVMStartEvent()");
}
}
Aggregations