use of com.intellij.debugger.engine.requests.RequestManagerImpl 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.intellij.debugger.engine.requests.RequestManagerImpl 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);
}
}
}
use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.
the class BreakpointWithHighlighter method createLocationBreakpointRequest.
static void createLocationBreakpointRequest(@NotNull FilteredRequestor requestor, @Nullable Location location, @NotNull DebugProcessImpl debugProcess) {
if (location != null) {
RequestManagerImpl requestsManager = debugProcess.getRequestsManager();
requestsManager.enableRequest(requestsManager.createBreakpointRequest(requestor, location));
}
}
use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.
the class FieldBreakpoint method createRequestForPreparedClass.
@Override
public void createRequestForPreparedClass(DebugProcessImpl debugProcess, ReferenceType refType) {
VirtualMachineProxy vm = debugProcess.getVirtualMachineProxy();
try {
RequestManagerImpl manager = debugProcess.getRequestsManager();
Field field = refType.fieldByName(getFieldName());
if (field == null) {
manager.setInvalid(this, DebuggerBundle.message("error.invalid.breakpoint.missing.field.in.class", getFieldName(), refType.name()));
return;
}
if (isWatchModification() && vm.canWatchFieldModification()) {
manager.enableRequest(manager.createModificationWatchpointRequest(this, field));
LOG.debug("Modification request added");
}
if (isWatchAccess() && vm.canWatchFieldAccess()) {
manager.enableRequest(manager.createAccessWatchpointRequest(this, field));
if (LOG.isDebugEnabled()) {
LOG.debug("Access request added field = " + field.name() + "; refType = " + refType.name());
}
}
} catch (Exception ex) {
LOG.debug(ex);
}
}
use of com.intellij.debugger.engine.requests.RequestManagerImpl in project intellij-community by JetBrains.
the class BreakpointWithHighlighter method calcIcon.
private Icon calcIcon(@Nullable DebugProcessImpl debugProcess) {
final boolean muted = debugProcess != null && isMuted(debugProcess);
if (!isEnabled()) {
return getDisabledIcon(muted);
}
myInvalidMessage = "";
if (!isValid()) {
return getInvalidIcon(muted);
}
if (debugProcess == null) {
return getSetIcon(muted);
}
final RequestManagerImpl requestsManager = debugProcess.getRequestsManager();
final boolean isVerified = myCachedVerifiedState || requestsManager.isVerified(this);
final String warning = requestsManager.getWarning(this);
if (warning != null) {
myInvalidMessage = warning;
if (!isVerified) {
return getInvalidIcon(muted);
}
return getVerifiedWarningsIcon(muted);
}
if (isVerified) {
return getVerifiedIcon(muted);
}
return getSetIcon(muted);
}
Aggregations