Add method tracing JVMTI callbacks
Add MethodEntryHook and MethodExitHook callbacks and associated
capabilities.
Split --jvmti-stress option in run-test into --jvmti-trace-stress and
--jvmti-redefine-stress to test each different component.
NB 3 differences from RI found:
1) RI will call methodExitHook again if the method exit hook throws
an exception. This can easily cause an infinite loop and the test
is specifically tweaked to prevent this from happening on the RI.
2) RI always includes the method being exited in the stack trace of
errors thrown in the hooks. In ART we will not include the method
if it is native. This is due to the way we call native methods
and would be extremely difficult to change.
3) The RI will allow exceptions thrown in the MethodEnterHook to be
caught by the entered method in some situations. This occurs with
the tryCatchExit test in 989. In ART this does not happen.
Bug: 34414073
Test: ./test.py --host -j40
Test: ART_TEST_FULL=true DEXTER_BINARY="/path/to/dexter" \
./test/testrunner/testrunner.py --host -j40 -t 988
Test: ART_TEST_FULL=true DEXTER_BINARY="/path/to/dexter" \
./test/testrunner/testrunner.py --host -j40 -t 989
Test: lunch aosp_angler-userdebug; \
m -j40 droid build-art && \
fastboot -w flashall && \
./test.py --target -j4
Change-Id: Iab229353fae23c2ea27c2b698c831627a9f861b1
diff --git a/test/989-method-trace-throw/src/Main.java b/test/989-method-trace-throw/src/Main.java
new file mode 100644
index 0000000..29b9de1
--- /dev/null
+++ b/test/989-method-trace-throw/src/Main.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+public class Main {
+ public static void main(String[] args) throws Exception {
+ art.Test989.run();
+ }
+}