< prev index next >

test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr07/libgetstacktr07.cpp

Print this page

 28 #include "../get_stack_trace.h"
 29 
 30 extern "C" {
 31 
 32 #define PASSED 0
 33 #define STATUS_FAILED 2
 34 
 35 static jvmtiEnv *jvmti = NULL;
 36 static jvmtiCapabilities caps;
 37 static jvmtiEventCallbacks callbacks;
 38 static jint result = PASSED;
 39 static jmethodID mid;
 40 static jbyteArray classBytes;
 41 static frame_info expected_platform_frames[] = {
 42     {"Lgetstacktr07$TestThread;", "checkPoint", "()V"},
 43     {"Lgetstacktr07$TestThread;", "chain4", "()V"},
 44     {"Lgetstacktr07$TestThread;", "chain3", "()V"},
 45     {"Lgetstacktr07$TestThread;", "chain2", "()V"},
 46     {"Lgetstacktr07$TestThread;", "chain1", "()V"},
 47     {"Lgetstacktr07$TestThread;", "run", "()V"},

 48     {"Ljava/lang/Thread;", "run", "()V"},
 49 };
 50 
 51 static frame_info expected_virtual_frames[] = {
 52     {"Lgetstacktr07$TestThread;", "checkPoint", "()V"},
 53     {"Lgetstacktr07$TestThread;", "chain4", "()V"},
 54     {"Lgetstacktr07$TestThread;", "chain3", "()V"},
 55     {"Lgetstacktr07$TestThread;", "chain2", "()V"},
 56     {"Lgetstacktr07$TestThread;", "chain1", "()V"},
 57     {"Lgetstacktr07$TestThread;", "run", "()V"},

 58     {"Ljava/lang/VirtualThread;", "run", "(Ljava/lang/Runnable;)V"},
 59     {"Ljava/lang/VirtualThread$VThreadContinuation;", "lambda$new$0", "(Ljava/lang/VirtualThread;Ljava/lang/Runnable;)V"},
 60     {"Ljava/lang/VirtualThread$VThreadContinuation$$Lambda;", "run", "()V"},
 61     {"Ljdk/internal/vm/Continuation;", "enter0", "()V"},
 62     {"Ljdk/internal/vm/Continuation;", "enter", "(Ljdk/internal/vm/Continuation;Z)V"},
 63 };
 64 
 65 
 66 void JNICALL Breakpoint(jvmtiEnv *jvmti_env, JNIEnv *jni, jthread thread, jmethodID method, jlocation location) {
 67   jclass klass;
 68   jvmtiClassDefinition class_def;
 69 
 70   if (mid != method) {
 71     jni->FatalError("ERROR: don't know where we get called from");
 72   }
 73 
 74   if (classBytes == NULL) {
 75     jni->FatalError("ERROR: don't have any bytes");
 76   }
 77 

 28 #include "../get_stack_trace.h"
 29 
 30 extern "C" {
 31 
 32 #define PASSED 0
 33 #define STATUS_FAILED 2
 34 
 35 static jvmtiEnv *jvmti = NULL;
 36 static jvmtiCapabilities caps;
 37 static jvmtiEventCallbacks callbacks;
 38 static jint result = PASSED;
 39 static jmethodID mid;
 40 static jbyteArray classBytes;
 41 static frame_info expected_platform_frames[] = {
 42     {"Lgetstacktr07$TestThread;", "checkPoint", "()V"},
 43     {"Lgetstacktr07$TestThread;", "chain4", "()V"},
 44     {"Lgetstacktr07$TestThread;", "chain3", "()V"},
 45     {"Lgetstacktr07$TestThread;", "chain2", "()V"},
 46     {"Lgetstacktr07$TestThread;", "chain1", "()V"},
 47     {"Lgetstacktr07$TestThread;", "run", "()V"},
 48     {"Ljava/lang/Thread;", "runWith", "(Ljava/lang/Object;Ljava/lang/Runnable;)V"},
 49     {"Ljava/lang/Thread;", "run", "()V"},
 50 };
 51 
 52 static frame_info expected_virtual_frames[] = {
 53     {"Lgetstacktr07$TestThread;", "checkPoint", "()V"},
 54     {"Lgetstacktr07$TestThread;", "chain4", "()V"},
 55     {"Lgetstacktr07$TestThread;", "chain3", "()V"},
 56     {"Lgetstacktr07$TestThread;", "chain2", "()V"},
 57     {"Lgetstacktr07$TestThread;", "chain1", "()V"},
 58     {"Lgetstacktr07$TestThread;", "run", "()V"},
 59     {"Ljava/lang/VirtualThread;", "runWith", "(Ljava/lang/Object;Ljava/lang/Runnable;)V"},
 60     {"Ljava/lang/VirtualThread;", "run", "(Ljava/lang/Runnable;)V"},
 61     {"Ljava/lang/VirtualThread$VThreadContinuation;", "lambda$new$0", "(Ljava/lang/VirtualThread;Ljava/lang/Runnable;)V"},
 62     {"Ljava/lang/VirtualThread$VThreadContinuation$$Lambda;", "run", "()V"},
 63     {"Ljdk/internal/vm/Continuation;", "enter0", "()V"},
 64     {"Ljdk/internal/vm/Continuation;", "enter", "(Ljdk/internal/vm/Continuation;Z)V"},
 65 };
 66 
 67 
 68 void JNICALL Breakpoint(jvmtiEnv *jvmti_env, JNIEnv *jni, jthread thread, jmethodID method, jlocation location) {
 69   jclass klass;
 70   jvmtiClassDefinition class_def;
 71 
 72   if (mid != method) {
 73     jni->FatalError("ERROR: don't know where we get called from");
 74   }
 75 
 76   if (classBytes == NULL) {
 77     jni->FatalError("ERROR: don't have any bytes");
 78   }
 79 
< prev index next >