Commit 030bdeea authored by Lubomir Bulej's avatar Lubomir Bulej

Display more information about methods in trace mode

Besides showing the method access flags, log methods that have
been excluded because they are abstract or native.
parent d3431961
package ch.usi.dag.disl;
import static ch.usi.dag.util.asm.Access.ABSTRACT;
import static ch.usi.dag.util.asm.Access.NATIVE;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toSet;
......@@ -28,6 +30,7 @@ import org.objectweb.asm.tree.MethodNode;
import ch.usi.dag.disl.staticcontext.SCGenerator;
import ch.usi.dag.util.asm.Access;
import ch.usi.dag.util.asm.ClassNodeHelper;
import ch.usi.dag.util.logging.Logger;
......@@ -193,20 +196,22 @@ public final class DiSL {
private boolean instrumentMethod (
final ClassNode classNode, final MethodNode methodNode
) throws DiSLException {
final String className = classNode.name;
final String methodName = methodNode.name;
final String methodDesc = methodNode.desc;
// skip abstract methods
if ((methodNode.access & Opcodes.ACC_ABSTRACT) != 0) {
if (ABSTRACT.isSet (methodNode.access)) {
__log.debug ("excluded abstract method %s.%s%s", className, methodName, methodDesc);
return false;
}
// skip native methods
if ((methodNode.access & Opcodes.ACC_NATIVE) != 0) {
if (NATIVE.isSet (methodNode.access)) {
__log.debug ("excluded native method %s.%s%s", className, methodName, methodDesc);
return false;
}
final String className = classNode.name;
final String methodName = methodNode.name;
final String methodDesc = methodNode.desc;
// evaluate exclusions
// TODO LB: Add support for inclusion
final Optional <Scope> excludeMatch = __excludedScopes.stream ()
......@@ -385,7 +390,8 @@ public final class DiSL {
try {
__log.trace (
"processing method: %s.%s%s",
"processing [%s] method: %s.%s%s",
Access.formatMethodAccess (methodNode.access),
classNode.name, methodNode.name, methodNode.desc
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment