use of com.sun.jdi.request.MethodExitRequest in project intellij-community by JetBrains.
the class MethodBreakpoint method createRequestForPreparedClassOriginal.
private void createRequestForPreparedClassOriginal(@NotNull DebugProcessImpl debugProcess, @NotNull ReferenceType classType) {
try {
boolean hasMethod = false;
for (Method method : classType.allMethods()) {
String signature = method.signature();
String name = method.name();
if (getMethodName().equals(name) && mySignature.getName(debugProcess).equals(signature)) {
hasMethod = true;
break;
}
}
if (!hasMethod) {
debugProcess.getRequestsManager().setInvalid(this, DebuggerBundle.message("error.invalid.breakpoint.method.not.found", classType.name()));
return;
}
RequestManagerImpl requestManager = debugProcess.getRequestsManager();
if (isWatchEntry()) {
MethodEntryRequest entryRequest = findRequest(debugProcess, MethodEntryRequest.class, this);
if (entryRequest == null) {
entryRequest = requestManager.createMethodEntryRequest(this);
} else {
entryRequest.disable();
}
//entryRequest.addClassFilter(myClassQualifiedName);
// use addClassFilter(ReferenceType) in order to stop on subclasses also!
entryRequest.addClassFilter(classType);
debugProcess.getRequestsManager().enableRequest(entryRequest);
}
if (isWatchExit()) {
MethodExitRequest exitRequest = findRequest(debugProcess, MethodExitRequest.class, this);
if (exitRequest == null) {
exitRequest = requestManager.createMethodExitRequest(this);
} else {
exitRequest.disable();
}
//exitRequest.addClassFilter(myClassQualifiedName);
exitRequest.addClassFilter(classType);
debugProcess.getRequestsManager().enableRequest(exitRequest);
}
} catch (Exception e) {
LOG.debug(e);
}
}
use of com.sun.jdi.request.MethodExitRequest in project intellij-community by JetBrains.
the class WildcardMethodBreakpoint method createRequest.
public void createRequest(DebugProcessImpl debugProcess) {
DebuggerManagerThreadImpl.assertIsManagerThread();
if (!shouldCreateRequest(debugProcess)) {
return;
}
if (isEmulated()) {
createOrWaitPrepare(debugProcess, getClassPattern());
} else {
try {
RequestManagerImpl requestManager = debugProcess.getRequestsManager();
if (isWatchEntry()) {
MethodEntryRequest entryRequest = MethodBreakpoint.findRequest(debugProcess, MethodEntryRequest.class, this);
if (entryRequest == null) {
entryRequest = requestManager.createMethodEntryRequest(this);
} else {
entryRequest.disable();
}
entryRequest.addClassFilter(getClassPattern());
debugProcess.getRequestsManager().enableRequest(entryRequest);
}
if (isWatchExit()) {
MethodExitRequest exitRequest = MethodBreakpoint.findRequest(debugProcess, MethodExitRequest.class, this);
if (exitRequest == null) {
exitRequest = requestManager.createMethodExitRequest(this);
} else {
exitRequest.disable();
}
exitRequest.addClassFilter(getClassPattern());
debugProcess.getRequestsManager().enableRequest(exitRequest);
}
} catch (Exception e) {
LOG.debug(e);
}
}
}
Aggregations