| 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <pthread.h> |
| 18 | |
| 19 | #include <cstdio> |
| 20 | #include <iostream> |
| 21 | #include <vector> |
| 22 | |
| 23 | #include "android-base/logging.h" |
| 24 | #include "jni.h" |
| 25 | #include "jvmti.h" |
| 26 | |
| 27 | #include "scoped_local_ref.h" |
| 28 | #include "scoped_primitive_array.h" |
| 29 | |
| 30 | // Test infrastructure |
| 31 | #include "jvmti_helper.h" |
| 32 | #include "test_env.h" |
| 33 | |
| 34 | namespace art { |
| 35 | namespace Test1926FramePopMissed { |
| 36 | |
| 37 | extern "C" JNIEXPORT void JNICALL Java_art_Test1926_disableFramePop( |
| 38 | JNIEnv* env, jclass, jthread thr) { |
| 39 | JvmtiErrorToException(env, |
| 40 | jvmti_env, |
| 41 | jvmti_env->SetEventNotificationMode( |
| 42 | JVMTI_DISABLE, JVMTI_EVENT_FRAME_POP, thr)); |
| 43 | } |
| 44 | |
| 45 | extern "C" JNIEXPORT void JNICALL Java_art_Test1926_reenableFramePop( |
| 46 | JNIEnv* env, jclass, jthread thr) { |
| 47 | JvmtiErrorToException(env, |
| 48 | jvmti_env, |
| 49 | jvmti_env->SetEventNotificationMode( |
| 50 | JVMTI_ENABLE, JVMTI_EVENT_FRAME_POP, thr)); |
| 51 | } |
| 52 | |
| 53 | } // namespace Test1926FramePopMissed |
| 54 | } // namespace art |
| 55 |