Mark lambda main methods as synthetic.
The "main" lambda method is still a synthetic forward to the lambda
implementation method and should be marked as such. Not doing so
appears to be an error and the subsequent manual debug filter a hack
to avoid the debugger issue arising from this.
Change-Id: Ie180de1e879d071fb6f4cdc94ecc75554d341938
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/LambdaClass.java b/src/main/java/com/android/tools/r8/ir/desugar/LambdaClass.java
index c9e47c2..9b8f930 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/LambdaClass.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/LambdaClass.java
@@ -233,7 +233,7 @@
new DexEncodedMethod(
mainMethod,
MethodAccessFlags.fromSharedAccessFlags(
- Constants.ACC_PUBLIC | Constants.ACC_FINAL, false),
+ Constants.ACC_PUBLIC | Constants.ACC_FINAL | Constants.ACC_SYNTHETIC, false),
MethodTypeSignature.noSignature(),
DexAnnotationSet.empty(),
ParameterAnnotationsList.empty(),
diff --git a/src/test/java/com/android/tools/r8/debug/DebugTestBase.java b/src/test/java/com/android/tools/r8/debug/DebugTestBase.java
index 13d59dc..44bcc80 100644
--- a/src/test/java/com/android/tools/r8/debug/DebugTestBase.java
+++ b/src/test/java/com/android/tools/r8/debug/DebugTestBase.java
@@ -2108,14 +2108,6 @@
}
return false;
}
- if (isInLambdaClass(mirror, location)) {
- // Lambda classes must be skipped since they are only wrappers around lambda code.
- if (DEBUG_TESTS) {
- System.out.println("Skipping lambda class wrapper method");
- }
- wrapper.enqueueCommandFirst(stepCommand);
- return true;
- }
if (isSyntheticMethod(mirror, location)) {
if (DEBUG_TESTS) {
System.out.println("Skipping synthetic method");
@@ -2160,11 +2152,6 @@
return false;
}
- private static boolean isInLambdaClass(VmMirror mirror, Location location) {
- String classSig = mirror.getClassSignature(location.classID);
- return classSig.contains("$$Lambda$");
- }
-
private static boolean isLambdaMethod(VmMirror mirror, Location location) {
String methodName = mirror.getMethodName(location.classID, location.methodID);
return methodName.startsWith("lambda$");