public class Test901 {
public static void run() {
- Main.bindAgentJNIForClass(Test901.class);
-
System.out.println("Hello, world!");
if (checkLivePhase()) {
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
public class Test903 {
public static void run() {
- Main.bindAgentJNIForClass(Test903.class);
-
doTest();
testGetTaggedObjects();
testTags();
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test904 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test904.class);
-
// Use a list to ensure objects must be allocated.
ArrayList<Object> l = new ArrayList<>(100);
public class Test905 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test905.class);
doTest();
}
public class Test906 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test906.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test907 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test907.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test908 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test908.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test910 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test910.class);
doTest();
}
bar (IIILart/ControlData;)J 0 26
foo (IIILart/ControlData;)I 0 21
doTest ()V 38 25
- run ()V 0 30
+ run ()V 0 25
---------
print (Ljava/lang/Thread;II)V 0 38
printOrWait (IILart/ControlData;)V 6 41
bar (IIILart/ControlData;)J 0 26
foo (IIILart/ControlData;)I 0 21
doTest ()V 42 26
- run ()V 0 30
+ run ()V 0 25
---------
getStackTrace (Ljava/lang/Thread;II)[[Ljava/lang/String; -1 -2
print (Ljava/lang/Thread;II)V 0 38
baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
From bottom
---------
- run ()V 0 30
+ run ()V 0 25
---------
baz (IIILart/ControlData;)Ljava/lang/Object; 9 34
bar (IIILart/ControlData;)J 0 26
foo (IIILart/ControlData;)I 0 21
doTest ()V 65 32
- run ()V 0 30
+ run ()V 0 25
---------
bar (IIILart/ControlData;)J 0 26
foo (IIILart/ControlData;)I 0 21
getAllStackTraces (I)[[Ljava/lang/Object; -1 -2
printAll (I)V 0 75
doTest ()V 128 59
- run ()V 24 42
+ run ()V 24 37
---------
main
getAllStackTraces (I)[[Ljava/lang/Object; -1 -2
printAll (I)V 0 75
doTest ()V 133 61
- run ()V 24 42
+ run ()V 24 37
---------
main
getThreadListStackTraces ([Ljava/lang/Thread;I)[[Ljava/lang/Object; -1 -2
printList ([Ljava/lang/Thread;I)V 0 68
doTest ()V 116 54
- run ()V 32 46
+ run ()V 32 41
---------
ThreadListTraces Thread 0
getThreadListStackTraces ([Ljava/lang/Thread;I)[[Ljava/lang/Object; -1 -2
printList ([Ljava/lang/Thread;I)V 0 68
doTest ()V 121 56
- run ()V 32 46
+ run ()V 32 41
---------
ThreadListTraces Thread 0
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test911 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(AllTraces.class);
- Main.bindAgentJNIForClass(Frames.class);
- Main.bindAgentJNIForClass(PrintThread.class);
- Main.bindAgentJNIForClass(ThreadListTraces.class);
-
Thread t = new Thread("Test911") {
@Override
public void run() {
public class Test912 {
public static void run() throws Exception {
- art.Main.bindAgentJNIForClass(Test912.class);
doTest();
}
public class Test912Art {
public static void run() throws Exception {
- art.Main.bindAgentJNIForClass(Test912Art.class);
doTest();
}
public class Test913 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test913.class);
-
doTest();
// Use a countdown latch for synchronization, as join() will introduce more roots.
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
}
public static void main(String[] args) {
- art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform(), new TestWatcher());
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test918 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test918.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test920 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test920.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test922 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test922.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test923 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test923.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test924 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test924.class);
-
// Run the test on its own thread, so we have a known state for the "current" thread.
Thread t = new Thread("TestThread") {
@Override
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test925 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test925.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test927 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test927.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test928 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test928.class);
doJNITableTest();
System.out.println("Done");
public class Main {
public static void main(String[] args) throws Exception {
- art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test931 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test931.class);
testAgentThread();
System.out.println("Done");
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
public class Test933 {
public static void run() throws Exception {
- Main.bindAgentJNIForClass(Test933.class);
testSigQuit();
System.out.println("Done");
}
public static void main(String[] args) {
- art.Main.bindAgentJNIForClass(Main.class);
// Don't pop transformations. Make sure that even if 2 threads race to define the class both
// will get the same result.
setPopRetransformations(false);
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
public class Main {
public static void main(String[] args) throws Exception {
- art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
}
public static void main(String[] args) {
- art.Main.bindAgentJNIForClass(Main.class);
setPopRetransformations(false);
addCommonTransformationResult("java/util/OptionalLong", CLASS_BYTES, DEX_BYTES);
enableCommonRetransformation(true);
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
}
public static void main(String[] args) {
- art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
}
public static void main(String[] args) {
- art.Main.bindAgentJNIForClass(Main.class);
doTest(new Transform());
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
public class Test945 {
static class Transform {
- static {
- art.Main.bindAgentJNIForClass(Transform.class);
- }
+ // static block to ensure that there is a <clinit> method. This used to be needed due to a bug.
+ // Since it's annoying to recompute the transformed bytes we will just leave this here.
+ static { }
public void sayHi(Runnable r) {
System.out.println("hello");
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
"AAQgAAACAAAAmwIAAAAgAAABAAAApwIAAAAQAAABAAAAuAIAAA==");
public static void main(String[] args) {
- art.Main.bindAgentJNIForClass(Main.class);
doTest(new RemoveAnnotationsTest());
doTest(new AddAnnotationsTest());
doTest(new ChangeAnnotationValues());
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
}
public static void main(String[] args) {
- art.Main.bindAgentJNIForClass(Main.class);
doTest(10000);
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
}
public static void main(String[] args) {
- art.Main.bindAgentJNIForClass(Main.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
"AA==");
public static void run() {
- art.Main.bindAgentJNIForClass(Test984.class);
doTest();
}
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.ArrayList;
// Common Redefinition functions. Placed here for use by CTS
public class Redefinition {
- // Bind native functions.
- static {
- Main.bindAgentJNIForClass(Redefinition.class);
- }
-
public static final class CommonClassDefinition {
public final Class<?> target;
public final byte[] class_file_bytes;
Hello - 2
private static native void art.Test986$Transform.sayHi() = Java_art_Test986_00024Transform_sayHi__ -> NoReallySayGoodbye
Bye
+private static native void art.Test986.rebindTransformClass(java.lang.Class) = Java_art_Test986_rebindTransformClass -> Java_art_Test986_rebindTransformClass
private static native void art.Test986$Transform.sayHi() = Java_art_Test986_00024Transform_sayHi__ -> Java_art_Test986_00024Transform_sayHi2
private static native void art.Test986$Transform.sayHi2() = Java_art_Test986_00024Transform_sayHi2 -> Java_art_Test986_00024Transform_sayHi2
Hello - 2
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
import java.util.HashMap;
public class Test986 {
- static {
- // NB This is called before any setup is done so we don't need to worry about getting bind
- // events.
- Main.bindAgentJNIForClass(Test986.class);
- }
-
-
private static final HashMap<Method, String> SymbolMap = new HashMap<>();
// A class with a native method we can play with.
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package art;
-
-// Binder class so the agent's C code has something that can be bound and exposed to tests.
-// In a package to separate cleanly and work around CTS reference issues (though this class
-// should be replaced in the CTS version).
-public class Main {
- // Load the given class with the given classloader, and bind all native methods to corresponding
- // C methods in the agent. Will abort if any of the steps fail.
- public static native void bindAgentJNI(String className, ClassLoader classLoader);
- // Same as above, giving the class directly.
- public static native void bindAgentJNIForClass(Class<?> klass);
-}
* limitations under the License.
*/
-#include "agent_startup.h"
-
#include "android-base/logging.h"
#include "android-base/macros.h"
namespace art {
-static constexpr const char* kMainClass = "art/Main";
-
-static StartCallback gCallback = nullptr;
-
-// TODO: Check this. This may not work on device. The classloader containing the app's classes
-// may not have been created at this point (i.e., if it's not the system classloader).
-static void JNICALL VMInitCallback(jvmtiEnv* callback_jvmti_env,
- JNIEnv* jni_env,
- jthread thread ATTRIBUTE_UNUSED) {
- // Bind kMainClass native methods.
- BindFunctions(callback_jvmti_env, jni_env, kMainClass);
-
- if (gCallback != nullptr) {
- gCallback(callback_jvmti_env, jni_env);
- gCallback = nullptr;
- }
-
- // And delete the jvmtiEnv.
- callback_jvmti_env->DisposeEnvironment();
-}
-
-// Install a phase callback that will bind JNI functions on VMInit.
-void BindOnLoad(JavaVM* vm, StartCallback callback) {
- // Use a new jvmtiEnv. Otherwise we might collide with table changes.
- jvmtiEnv* install_env;
- if (vm->GetEnv(reinterpret_cast<void**>(&install_env), JVMTI_VERSION_1_0) != 0) {
- LOG(FATAL) << "Could not get jvmtiEnv";
- }
- SetAllCapabilities(install_env);
-
- {
- jvmtiEventCallbacks callbacks;
- memset(&callbacks, 0, sizeof(jvmtiEventCallbacks));
- callbacks.VMInit = VMInitCallback;
-
- CheckJvmtiError(install_env, install_env->SetEventCallbacks(&callbacks, sizeof(callbacks)));
- }
-
- CheckJvmtiError(install_env, install_env->SetEventNotificationMode(JVMTI_ENABLE,
- JVMTI_EVENT_VM_INIT,
- nullptr));
-
- gCallback = callback;
-}
-
-// Ensure binding of the Main class when the agent is started through OnAttach.
-void BindOnAttach(JavaVM* vm, StartCallback callback) {
- // Get a JNIEnv. As the thread is attached, we must not destroy it.
- JNIEnv* env;
- CHECK_EQ(0, vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6))
- << "Could not get JNIEnv";
-
- jvmtiEnv* bind_jvmti_env;
- CHECK_EQ(0, vm->GetEnv(reinterpret_cast<void**>(&bind_jvmti_env), JVMTI_VERSION_1_0))
- << "Could not get jvmtiEnv";
- SetAllCapabilities(bind_jvmti_env);
-
- BindFunctions(bind_jvmti_env, env, kMainClass);
-
- if (callback != nullptr) {
- callback(bind_jvmti_env, env);
- }
-
- if (bind_jvmti_env->DisposeEnvironment() != JVMTI_ERROR_NONE) {
- LOG(FATAL) << "Could not dispose temporary jvmtiEnv";
- }
-}
-
-// Utility functions for art.Main shim.
+// Utility functions for binding jni methods.
extern "C" JNIEXPORT void JNICALL Java_art_Main_bindAgentJNI(
JNIEnv* env, jclass klass ATTRIBUTE_UNUSED, jstring className, jobject classLoader) {
ScopedUtfChars name(env, className);
+++ /dev/null
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_TEST_TI_AGENT_AGENT_STARTUP_H_
-#define ART_TEST_TI_AGENT_AGENT_STARTUP_H_
-
-#include <functional>
-
-#include "jni.h"
-#include "jvmti.h"
-
-namespace art {
-
-using StartCallback = void(*)(jvmtiEnv*, JNIEnv*);
-
-// Ensure binding of the Main class when the agent is started through OnLoad.
-void BindOnLoad(JavaVM* vm, StartCallback callback);
-
-// Ensure binding of the Main class when the agent is started through OnAttach.
-void BindOnAttach(JavaVM* vm, StartCallback callback);
-
-} // namespace art
-
-#endif // ART_TEST_TI_AGENT_AGENT_STARTUP_H_
#include "base/logging.h"
#include "base/macros.h"
-#include "agent_startup.h"
#include "common_helper.h"
#include "jni_binder.h"
#include "jvmti_helper.h"
SetIsJVM(remaining_options);
- BindOnLoad(vm, nullptr);
-
AgentLib* lib = FindAgent(name_option);
OnLoad fn = nullptr;
if (lib == nullptr) {
return -1;
}
- BindOnAttach(vm, nullptr);
-
AgentLib* lib = FindAgent(name_option);
if (lib == nullptr) {
printf("Unable to find agent named: %s, add it to the list in test/ti-agent/common_load.cc\n",