use of com.sun.jdi.ReferenceType in project gravel by gravel-st.
the class VMTargetStarter method installHaltPoint.
private void installHaltPoint(VirtualMachine vm) {
List<ReferenceType> targetClasses = vm.classesByName(VMLocalTarget.class.getName());
ReferenceType classRef = targetClasses.get(0);
Method meth = classRef.methodsByName("haltPoint").get(0);
BreakpointRequest req = vm.eventRequestManager().createBreakpointRequest(meth.location());
req.setSuspendPolicy(BreakpointRequest.SUSPEND_EVENT_THREAD);
req.enable();
}
use of com.sun.jdi.ReferenceType in project gravel by gravel-st.
the class VMRemoteInstance method getMethod.
protected Method getMethod(Class<?> class1, String methodName) {
List<ReferenceType> targetClasses = vm().classesByName(class1.getName());
ReferenceType classRef = targetClasses.get(0);
return classRef.methodsByName(methodName).get(0);
}
use of com.sun.jdi.ReferenceType in project processing by processing.
the class LineBreakpoint method classLoaded.
/**
* Event handler called when a class is loaded in the debugger. Causes the
* breakpoint to be attached, if its class was loaded.
*
* @param theClass the class that was just loaded.
*/
@Override
public void classLoaded(ReferenceType theClass) {
// check if our class is being loaded
Messages.log("Class Loaded: " + theClass.name());
if (theClass.name().equals(className())) {
this.theClass = theClass;
attach();
}
for (ReferenceType ct : theClass.nestedTypes()) {
Messages.log("Nested " + ct.name());
}
}
use of com.sun.jdi.ReferenceType in project intellij-community by JetBrains.
the class ClassesTable method updateCountsInternal.
private void updateCountsInternal(@NotNull Map<ReferenceType, Long> class2Count) {
final ReferenceType selectedClass = myModel.getSelectedClassBeforeHided();
int newSelectedIndex = -1;
final boolean isInitialized = !myItems.isEmpty();
myItems = Collections.unmodifiableList(new ArrayList<>(class2Count.keySet()));
int i = 0;
for (final ReferenceType ref : class2Count.keySet()) {
if (ref.equals(selectedClass)) {
newSelectedIndex = i;
}
final DiffValue oldValue = isInitialized && !myCounts.containsKey(ref) ? new DiffValue(0, 0) : myCounts.getOrDefault(ref, UNKNOWN_VALUE);
myCounts.put(ref, oldValue.update(class2Count.get(ref)));
i++;
}
showContent();
if (newSelectedIndex != -1 && !myModel.isHided()) {
final int ix = convertRowIndexToView(newSelectedIndex);
changeSelection(ix, DiffViewTableModel.CLASSNAME_COLUMN_INDEX, false, false);
}
getRowSorter().allRowsChanged();
}
use of com.sun.jdi.ReferenceType in project intellij-community by JetBrains.
the class PositionManagerImpl method getPsiFileByLocation.
@Nullable
protected PsiFile getPsiFileByLocation(final Project project, final Location location) {
if (location == null) {
return null;
}
final ReferenceType refType = location.declaringType();
if (refType == null) {
return null;
}
// We should find a class no matter what
// setAlternativeResolveEnabled is turned on here
//if (DumbService.getInstance(project).isDumb()) {
// return null;
//}
final String originalQName = refType.name();
Ref<PsiFile> altSource = new Ref<>();
PsiClass psiClass = findPsiClassByName(originalQName, c -> altSource.set(findAlternativeJreSourceFile(c)));
if (!altSource.isNull()) {
return altSource.get();
}
if (psiClass != null) {
PsiElement element = psiClass.getNavigationElement();
// see IDEA-137167, prefer not compiled elements
if (element instanceof PsiCompiledElement) {
PsiElement fileElement = psiClass.getContainingFile().getNavigationElement();
if (!(fileElement instanceof PsiCompiledElement)) {
element = fileElement;
}
}
return element.getContainingFile();
} else {
// try to search by filename
try {
PsiFile[] files = FilenameIndex.getFilesByName(project, refType.sourceName(), GlobalSearchScope.allScope(project));
for (PsiFile file : files) {
if (file instanceof PsiJavaFile) {
for (PsiClass cls : ((PsiJavaFile) file).getClasses()) {
if (StringUtil.equals(originalQName, cls.getQualifiedName())) {
return file;
}
}
}
}
} catch (AbsentInformationException ignore) {
}
}
return null;
}
Aggregations