use of com.sun.jdi.Method in project intellij-community by JetBrains.
the class NodeManagerImpl method getContextKeyForFrame.
@Nullable
public static String getContextKeyForFrame(final StackFrameProxyImpl frame) {
if (frame == null) {
return null;
}
try {
final Location location = frame.location();
final Method method = DebuggerUtilsEx.getMethod(location);
if (method == null) {
return null;
}
final ReferenceType referenceType = location.declaringType();
final StringBuilder builder = StringBuilderSpinAllocator.alloc();
try {
return builder.append(referenceType.signature()).append("#").append(method.name()).append(method.signature()).toString();
} finally {
StringBuilderSpinAllocator.dispose(builder);
}
} catch (EvaluateException ignored) {
} catch (InternalException ie) {
if (ie.errorCode() != 23) {
// INVALID_METHODID
throw ie;
}
}
return null;
}
use of com.sun.jdi.Method in project otertool by wuntee.
the class Testing method addIntentBreakpoints.
@SuppressWarnings("restriction")
public static void addIntentBreakpoints(VirtualMachine vm) {
EventRequestManager mgr = vm.eventRequestManager();
com.sun.jdi.ReferenceType intentClass = vm.classesByName("android.content.Intent").get(0);
for (Method m : intentClass.methodsByName("<init>")) {
System.out.println("Breakpoint: " + m.toString());
Location location = m.location();
BreakpointRequest bpr = mgr.createBreakpointRequest(location);
bpr.enable();
}
for (Method m : intentClass.methodsByName("putExtra")) {
System.out.println("Breakpoint: " + m.toString());
Location location = m.location();
BreakpointRequest bpr = mgr.createBreakpointRequest(location);
bpr.enable();
}
}
use of com.sun.jdi.Method in project jdk8u_jdk by JetBrains.
the class InvokableTypeImpl method allMethods.
/**
* Shared implementation of {@linkplain ClassType#allMethods()} and
* {@linkplain InterfaceType#allMethods()}
* @return A list of all methods (recursively)
*/
public final List<Method> allMethods() {
ArrayList<Method> list = new ArrayList<>(methods());
ClassType clazz = superclass();
while (clazz != null) {
list.addAll(clazz.methods());
clazz = clazz.superclass();
}
/*
* Avoid duplicate checking on each method by iterating through
* duplicate-free allInterfaces() rather than recursing
*/
for (InterfaceType interfaze : getAllInterfaces()) {
list.addAll(interfaze.methods());
}
return list;
}
use of com.sun.jdi.Method in project jdk8u_jdk by JetBrains.
the class OomDebugTest method invoke.
void invoke(String methodName, String methodSig, @SuppressWarnings("rawtypes") List args, Value value) throws Exception {
Method method = findMethod(targetClass, methodName, methodSig);
if (method == null) {
failure("FAILED: Can't find method: " + methodName + " for class = " + targetClass);
return;
}
invoke(method, args, value);
}
Aggregations