OSDN Git Service

2006-10-25 Andreas Tobler <a.tobler@schweiz.org>
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.jvmti / natevents.cc
1 #include <gcj/cni.h>
2
3 #include <jvm.h>
4 #include <jvmti.h>
5 #include <stdio.h>
6
7 #include "jvmti-int.h"
8 #include "events.h"
9
10 void
11 print_events ()
12 {
13 #define DO(X)                                   \
14   do                                            \
15     {                                           \
16       if (JVMTI_REQUESTED_EVENT (X))            \
17         printf (#X ",");                        \
18     }                                           \
19   while (0)
20
21   printf ("RequestedEvents: ");
22   DO (VMInit);
23   DO (VMDeath);
24   DO (ThreadStart);
25   DO (ThreadEnd);
26   DO (ClassFileLoadHook);
27   DO (ClassLoad);
28   DO (ClassPrepare);
29   DO (VMStart);
30   DO (Exception);
31   DO (ExceptionCatch);
32   DO (SingleStep);
33   DO (FramePop);
34   DO (Breakpoint);
35   DO (FieldAccess);
36   DO (FieldModification);
37   DO (MethodEntry);
38   DO (MethodExit);
39   DO (NativeMethodBind);
40   DO (CompiledMethodLoad);
41   DO (CompiledMethodUnload);
42   DO (DynamicCodeGenerated);
43   DO (DataDumpRequest);
44   DO (MonitorWait);
45   DO (MonitorWaited);
46   DO (MonitorContendedEnter);
47   DO (MonitorContendedEntered);
48   DO (GarbageCollectionStart);
49   DO (GarbageCollectionFinish);
50   DO (ObjectFree);
51   DO (VMObjectAlloc);
52   printf ("\n");
53 #undef DO
54 }
55
56 static void
57 VMInitCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread)
58 {
59   printf ("VMInitCB jni_env=%#llx thread=%#llx\n",
60           (unsigned long long) jni_env, (unsigned long long) thread);
61 }
62
63 static void
64 VMDeathCB (jvmtiEnv *env, JNIEnv *jni_env)
65 {
66   printf ("VMDeathCB jni_env=%#llx\n", (unsigned long long) jni_env);
67 }
68
69 static void
70 ThreadStartCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread)
71 {
72   printf ("ThreadStartCB jni_env=%#llx thread=%#llx\n",
73           (unsigned long long) jni_env, (unsigned long long) thread);
74 }
75
76 static void
77 ThreadEndCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread)
78 {
79   printf ("ThreadEndCB jni_env=%#llx thread=%#llx\n",
80           (unsigned long long) jni_env, (unsigned long long) thread);
81 }
82
83 static void
84 ClassFileLoadHookCB (jvmtiEnv *env, JNIEnv *jni_env,
85                      jclass class_being_redefined, jobject loader,
86                      const char *name, jobject protection_domain,
87                      jint class_data_len, const unsigned char *class_data,
88                      jint *new_class_data_len, unsigned char **new_class_data)
89 {
90   printf ("ClassFileLoadHookCB jni_env=%#llx class_being_redefined=%#llx"
91           " loader=%#llx", (unsigned long long) jni_env, (unsigned long long)
92           class_being_redefined, (unsigned long long) loader);
93   printf (" name=%s protection_domain=%#llx class_data_len=%d class_data=%#llx",
94           name, (unsigned long long) protection_domain, (int) class_data_len,
95           (unsigned long long) class_data);
96   printf (" new_class_data_len=%#llx new_class_data=%#llx\n",
97           (unsigned long long) new_class_data_len, (unsigned long long)
98           new_class_data);
99 }
100
101 static void
102 ClassLoadCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jclass klass)
103 {
104   printf ("ClassLoadCB jni_env=%#llx thread=%#llx klass=%#llx\n",
105           (unsigned long long) jni_env, (unsigned long long) thread,
106           (unsigned long long) klass);
107 }
108
109 static void
110 ClassPrepareCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jclass klass)
111 {
112   printf ("ClassPrepareCB jni_env=%#llx thread=%#llx klass=%#llx\n",
113           (unsigned long long)jni_env, (unsigned long long) thread,
114           (unsigned long long) klass);
115 }
116
117 static void
118 VMStartCB (jvmtiEnv *env, JNIEnv *jni_env)
119 {
120   printf ("VMStartCB jni_env=%#llx\n", (unsigned long long) jni_env);
121 }
122
123 static void
124 ExceptionCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
125              jlocation location, jobject exception, jmethodID catch_method,
126              jlocation catch_location)
127 {
128   printf ("ExceptionCB jni_env=%#llx thread=%#llx method=%#llx location=%#llx",
129           (unsigned long long) jni_env, (unsigned long long) thread,
130           (unsigned long long) method, (unsigned long long) location);
131   printf (" exception=%#llx catch_method=%#llx catch_location=%#llx\n",
132           (unsigned long long) exception, (unsigned long long) catch_method,
133           (unsigned long long) catch_location);
134 }
135
136 static void
137 ExceptionCatchCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
138                   jmethodID method, jlocation location, jobject exception)
139 {
140   printf ("ExceptionCatchCB jni_env=%#llx thread=%#llx method=%#llx"
141           " location=%#llx",
142           (unsigned long long) jni_env, (unsigned long long) thread,
143           (unsigned long long) method, (unsigned long long) location);
144   printf (" exception=%#llx\n", (unsigned long long) exception);
145 }
146
147 static void
148 SingleStepCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
149               jlocation location)
150 {
151   printf ("SingleStepCB jni_env=%#llx thread=%#llx method=%#llx"
152           " location=%#llx\n",
153           (unsigned long long) jni_env, (unsigned long long) thread,
154           (unsigned long long) method, (unsigned long long) location);
155 }
156
157 static void
158 FramePopCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
159             jboolean was_popped_by_exception)
160 {
161   printf ("FramePopCB jni_env=%#llx thread=%#llx method=%#llx",
162           (unsigned long long) jni_env, (unsigned long long) thread,
163           (unsigned long long) method);
164   printf (" was_pooped_by_exception=%d\n", (was_popped_by_exception ?
165                                             1 : 0));
166 }
167
168 static void
169 BreakpointCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jmethodID method,
170               jlocation location)
171 {
172   printf ("BreakpointCB  jni_env=%#llx thread=%#llx method=%#llx"
173           " location=%#llx\n", (unsigned long long) jni_env,
174           (unsigned long long) thread, (unsigned long long) method,
175           (unsigned long long) location);
176 }
177
178 static void
179 FieldAccessCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
180                jmethodID method, jlocation location, jclass field_klass,
181                jobject object, jfieldID field)
182 {
183   printf ("FieldAccessCB jni_env=%#llx thread=%#llx method=%#llx"
184           " location=%#llx", (unsigned long long) jni_env, (unsigned long long)
185           thread, (unsigned long long) method, (unsigned long long) location);
186   printf (" field_klass=%#llx object=%#llx field=%#llx\n", (unsigned long long)
187           field_klass, (unsigned long long) object, (unsigned long long) field);
188 }
189
190 static void
191 FieldModificationCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
192                      jmethodID method, jlocation location, jclass field_klass,
193                      jobject object, jfieldID field, char signature_type,
194                      jvalue new_value)
195
196 {
197   printf ("FieldModificationCB  jni_env=%#llx thread=%#llx method=%#llx"
198           " location=%#llx", (unsigned long long) jni_env, (unsigned long long)
199           thread, (unsigned long long) method, (unsigned long long) location);
200   printf (" field_klass=%#llx object=%#llx field=%#llx signature_type=%c",
201           (unsigned long long) field_klass, (unsigned long long) object,
202           (unsigned long long) field, signature_type);
203   printf (" new_value=%d\n", (int) new_value.i);
204 }
205
206 static void
207 MethodEntryCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
208                jmethodID method)
209 {
210   printf ("MethodEntryCB jni_env=%#llx thread=%#llx method=%#llx\n",
211           (unsigned long long) jni_env, (unsigned long long) thread,
212           (unsigned long long) method);
213 }
214
215 static void
216 MethodExitCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
217               jmethodID method, jboolean was_popped_by_exception,
218               jvalue return_value)
219 {
220   printf ("MethodExitCB jni_env=%#llx thread=%#llx method=%#llx",
221           (unsigned long long) jni_env, (unsigned long long) thread,
222           (unsigned long long) method);
223   printf (" was_popped_by_exception=%d return_value=%d\n",
224           (was_popped_by_exception) ? 1 : 0, (int) return_value.i);
225 }
226
227 static void
228 NativeMethodBindCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
229                     jmethodID method, void *address, void **new_address_ptr)
230 {
231   printf ("NativeMethodBindCB jni_env=%#llx thread=%#llx method=%#llx",
232           (unsigned long long) jni_env, (unsigned long long) thread,
233           (unsigned long long) method);
234   printf (" address=%#llx new_address_ptr=%#llx\n", (unsigned long long)
235           address, (unsigned long long) new_address_ptr);
236 }
237
238 static void
239 CompiledMethodLoadCB (jvmtiEnv *env, jmethodID method, jint code_size,
240                       const void *code_addr, jint map_length,
241                       const jvmtiAddrLocationMap *map,
242                       const void *compile_info)
243 {
244   printf ("CompiledMethodLoadCB method=%#llx code_size=%#llx code_addr=%#llx",
245           (unsigned long long) method, (unsigned long long) code_size,
246           (unsigned long long) code_addr);
247   printf (" map_length=%d map=%#llx compile_info=%#llx\n", (int) map_length,
248           (unsigned long long) map, (unsigned long long) compile_info);
249 }
250
251 static void
252 CompiledMethodUnloadCB (jvmtiEnv *env, jmethodID method, const void *code_addr)
253 {
254   printf ("CompiledMethodUnloadCB method=%#llx code_addr=%#llx\n",
255           (unsigned long long) method, (unsigned long long) code_addr);
256 }
257
258 static void
259 DynamicCodeGeneratedCB (jvmtiEnv *env, const char *name, const void *address,
260                         jint length)
261 {
262   printf ("DynamicCodeGeneratedCB name=%s address=%#llx length=%d\n", name,
263           (unsigned long long) address, (int) length);
264 }
265
266 static void
267 DataDumpRequestCB (jvmtiEnv *env)
268 {
269   printf ("DataDumpRequestCB\n");
270 }
271
272 static void
273 MonitorWaitCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread, jobject object,
274                jlong timeout)
275 {
276   printf ("MonitorWaitCB jni_env=%#llx thread=%#llx object=%#llx timeout=%ld\n",
277           (unsigned long long) jni_env, (unsigned long long) thread,
278           (unsigned long long) object, (long) timeout);
279 }
280
281 static void
282 MonitorWaitedCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
283                  jobject object, jboolean timed_out)
284 {
285   printf ("MonitorWaitedCB jni_env=%#llx thread=%#llx object=%#llx"
286           " timed_out=%d\n", (unsigned long long) jni_env, (unsigned long long)
287           thread, (unsigned long long) object, (timed_out) ? 1 : 0);
288 }
289
290 static void
291 MonitorContendedEnterCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
292                          jobject object)
293 {
294   printf ("MonitorContendedEnterCB jni_env=%#llx thread=%#llx object=%#llx\n",
295           (unsigned long long) jni_env, (unsigned long long) thread,
296           (unsigned long long) object);
297 }
298
299 static void
300 MonitorContendedEnteredCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
301                            jobject object)
302 {
303   printf ("MonitorContendedEnteredCB jni_env=%#llx thread=%#llx object=%#llx\n",
304           (unsigned long long) jni_env, (unsigned long long) thread,
305           (unsigned long long) object);
306 }
307
308 static void
309 GarbageCollectionStartCB (jvmtiEnv *env)
310 {
311   printf ("GarbageCollectionStartCB\n");
312 }
313
314 static void
315 GarbageCollectionFinishCB (jvmtiEnv *env)
316 {
317   printf ("GarbageCollectionFinishCB\n");
318 }
319
320 static void
321 ObjectFreeCB (jvmtiEnv *env, jlong tag)
322 {
323   printf ("ObjectFreeCB tag=%ld\n", (long) tag);
324 }
325
326 static void
327 VMObjectAllocCB (jvmtiEnv *env, JNIEnv *jni_env, jthread thread,
328                  jobject object, jclass object_klass, jlong size)
329 {
330   printf ("VMObjectAllocCB jni_env=%#llx thread=%#llx object=%#llx",
331           (unsigned long long) jni_env, (unsigned long long) thread,
332           (unsigned long long) object);
333   printf (" object_klass=%#llx size=%ld\n", (unsigned long long) object_klass,
334           (long) size);
335 }
336
337 static void
338 do_enable_tests ()
339 {
340   printf ("- enable tests -\n");
341   JavaVM *vm = _Jv_GetJavaVM ();
342   jvmtiEnv *env[3];
343   int i;
344   for (i = 0; i < 3; ++i)
345     {
346       vm->GetEnv (reinterpret_cast<void **> (&env[i]), JVMTI_VERSION_1_0);
347       printf ("created JVMTI environment #%d\n", i);
348     }
349
350   jvmtiEventCallbacks callbacks;
351   memset (&callbacks, 0, sizeof (jvmtiEventCallbacks));
352
353   printf ("setting callbacks for envs\n");
354   callbacks.VMInit = VMInitCB;
355   env[0]->SetEventCallbacks (&callbacks, sizeof (callbacks));
356   callbacks.VMDeath = VMDeathCB;
357   env[1]->SetEventCallbacks (&callbacks, sizeof (callbacks));
358   callbacks.ThreadEnd = ThreadEndCB;
359   env[2]->SetEventCallbacks (&callbacks, sizeof (callbacks));
360   print_events ();
361
362   printf ("enable VM_INIT for env0, env1, env2\n");
363   env[0]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
364   env[1]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
365   env[2]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
366   print_events ();
367
368   printf ("enable VM_DEATH for env1,env2\n");
369   env[1]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL);
370   env[2]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL);
371   print_events ();
372
373   /* Used to use a non-NULL event thread, but that causes problems
374      when SetEventNotificationMode tries to validate the thread. */
375   printf ("enable THREAD_END for env2\n");
376   env[2]->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_THREAD_END,
377                                     NULL);
378   print_events ();
379
380   printf ("disposing of env1\n");
381   env[1]->DisposeEnvironment ();
382   print_events ();
383
384   printf ("disposing of env0\n");
385   env[0]->DisposeEnvironment ();
386   print_events ();
387
388   printf ("disable VMInit in env2\n");
389   env[2]->SetEventNotificationMode (JVMTI_DISABLE, JVMTI_EVENT_VM_INIT, NULL);
390   print_events ();
391
392   printf ("clear VMDeath callback in env2\n");
393   callbacks.VMDeath = NULL;
394   env[2]->SetEventCallbacks (&callbacks, sizeof (callbacks));
395   print_events ();
396
397   printf ("sending VMInit\n");
398   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_INIT, (jthread) 0x1234,
399                        (JNIEnv *) 0x5678);
400
401   printf ("sending ThreadEnd\n");
402   _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, (jthread) 0x1234,
403                        (JNIEnv *) 0x5678);
404
405   /* See comment above re: SetEventNotificationMode and validity
406      checking
407   printf ("sending ThreadEnd (no match)\n");
408   _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, (jthread) 0x4321,
409                        (JNIEnv *) 0x5678);
410   */
411
412   printf ("sending VMDeath\n");
413   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_DEATH, (jthread) NULL,
414                        (JNIEnv *) 0x5678);
415
416   printf ("disposing of env2\n");
417   env[2]->DisposeEnvironment ();
418   print_events ();
419 }
420
421 static void
422 do_callback_arg_tests ()
423 {
424   printf ("- callback arg tests -\n");
425   JavaVM *vm = _Jv_GetJavaVM ();
426   jvmtiEnv *env;
427   vm->GetEnv (reinterpret_cast<void **> (&env), JVMTI_VERSION_1_0);
428
429   // Define all the callbacks
430 #define DEFINE(Event) callbacks.Event = Event ## CB;
431   jvmtiEventCallbacks callbacks;
432   DEFINE(VMInit);
433   DEFINE(VMDeath);
434   DEFINE(ThreadStart);
435   DEFINE(ThreadEnd);
436   DEFINE(ClassFileLoadHook);
437   DEFINE(ClassLoad);
438   DEFINE(ClassPrepare);
439   DEFINE(VMStart);
440   DEFINE(Exception);
441   DEFINE(ExceptionCatch);
442   DEFINE(SingleStep);
443   DEFINE(FramePop);
444   DEFINE(Breakpoint);
445   DEFINE(FieldAccess);
446   DEFINE(FieldModification);
447   DEFINE(MethodEntry);
448   DEFINE(MethodExit);
449   DEFINE(NativeMethodBind);
450   DEFINE(CompiledMethodLoad);
451   DEFINE(CompiledMethodUnload);
452   DEFINE(DynamicCodeGenerated);
453   DEFINE(DataDumpRequest);
454   DEFINE(MonitorWait);
455   DEFINE(MonitorWaited);
456   DEFINE(MonitorContendedEnter);
457   DEFINE(MonitorContendedEntered);
458   DEFINE(GarbageCollectionStart);
459   DEFINE(GarbageCollectionFinish);
460   DEFINE(ObjectFree);
461   DEFINE(VMObjectAlloc);
462 #undef DEFINE
463   env->SetEventCallbacks (&callbacks, sizeof (callbacks));
464
465   // Enable all the callbacks
466 #define ENABLE(Event)                                                   \
467   env->SetEventNotificationMode (JVMTI_ENABLE, JVMTI_EVENT_ ## Event, NULL)
468   ENABLE (VM_INIT);
469   ENABLE (VM_DEATH);
470   ENABLE (THREAD_START);
471   ENABLE (THREAD_END);
472   ENABLE (CLASS_FILE_LOAD_HOOK);
473   ENABLE (CLASS_LOAD);
474   ENABLE (CLASS_PREPARE);
475   ENABLE (VM_START);
476   ENABLE (EXCEPTION);
477   ENABLE (EXCEPTION_CATCH);
478   ENABLE (SINGLE_STEP);
479   ENABLE (FRAME_POP);
480   ENABLE (BREAKPOINT);
481   ENABLE (FIELD_ACCESS);
482   ENABLE (FIELD_MODIFICATION);
483   ENABLE (METHOD_ENTRY);
484   ENABLE (METHOD_EXIT);
485   ENABLE (NATIVE_METHOD_BIND);
486   ENABLE (COMPILED_METHOD_LOAD);
487   ENABLE (COMPILED_METHOD_UNLOAD);
488   ENABLE (DYNAMIC_CODE_GENERATED);
489   ENABLE (DATA_DUMP_REQUEST);
490   ENABLE (MONITOR_WAIT);
491   ENABLE (MONITOR_WAITED);
492   ENABLE (MONITOR_CONTENDED_ENTER);
493   ENABLE (MONITOR_CONTENDED_ENTERED);
494   ENABLE (GARBAGE_COLLECTION_START);
495   ENABLE (GARBAGE_COLLECTION_FINISH);
496   ENABLE (OBJECT_FREE);
497   ENABLE (VM_OBJECT_ALLOC);
498
499   // All events should now be enabled.
500   print_events ();
501
502   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_INIT, (jthread) 0x2, (JNIEnv *) 0x1);
503   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_DEATH, (jthread) 0x2, (JNIEnv *) 0x1);
504   _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_START, (jthread) 0x2,
505                        (JNIEnv *) 0x1);
506   _Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, (jthread) 0x2,
507                        (JNIEnv *) 0x1);
508   _Jv_JVMTI_PostEvent (JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, (jthread) 0xb00,
509                        (JNIEnv *) 0x1, (jclass) 0x2, (jobject) 0x3,
510                        "4", (jobject) 0x5, (jint) 6,
511                        (const unsigned char *) 0x7, (jint *) 0x8,
512                        (unsigned char **) 0x9);
513   _Jv_JVMTI_PostEvent (JVMTI_EVENT_CLASS_LOAD, (jthread) 0x2, (JNIEnv *) 0x1,
514                        (jclass) 0x3);
515   _Jv_JVMTI_PostEvent (JVMTI_EVENT_CLASS_PREPARE, (jthread) 0x2,
516                        (JNIEnv *) 0x1, (jclass) 0x3);
517   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_START, (jthread) 0xb00, (JNIEnv *) 0x1);
518   _Jv_JVMTI_PostEvent (JVMTI_EVENT_EXCEPTION, (jthread) 0x2, (JNIEnv *) 0x1,
519                        (jmethodID) 0x3, (jlocation) 0x4, (jobject) 0x5,
520                        (jmethodID) 0x6, (jlocation) 0x7);
521   _Jv_JVMTI_PostEvent (JVMTI_EVENT_EXCEPTION_CATCH, (jthread) 0x2,
522                        (JNIEnv *) 0x1, (jmethodID) 0x3, (jlocation) 0x4,
523                        (jobject) 0x5);
524   _Jv_JVMTI_PostEvent (JVMTI_EVENT_SINGLE_STEP, (jthread) 0x2, (JNIEnv *) 0x1,
525                        (jmethodID) 0x3, (jlocation) 0x4);
526   _Jv_JVMTI_PostEvent (JVMTI_EVENT_FRAME_POP, (jthread) 0x2, (JNIEnv *) 0x1,
527                        (jmethodID) 0x3, 4);
528   _Jv_JVMTI_PostEvent (JVMTI_EVENT_BREAKPOINT, (jthread) 0x2, (JNIEnv *) 0x1,
529                        (jmethodID) 0x3, (jlocation) 0x4);
530   _Jv_JVMTI_PostEvent (JVMTI_EVENT_FIELD_ACCESS, (jthread) 0x2,
531                        (JNIEnv *) 0x1, (jmethodID) 0x3, (jlocation) 0x4,
532                        (jclass) 0x5, (jobject) 0x6, (jfieldID) 0x7);
533   jvalue value;
534   value.l = (jobject) 0x9;
535   _Jv_JVMTI_PostEvent (JVMTI_EVENT_FIELD_MODIFICATION, (jthread) 0x2,
536                        (JNIEnv *) 0x1, (jmethodID) 0x3, (jlocation) 0x4,
537                        (jclass) 0x5, (jobject) 0x6, (jfieldID) 0x7,
538                        (int) '8', value);
539   _Jv_JVMTI_PostEvent (JVMTI_EVENT_METHOD_ENTRY, (jthread) 0x2,
540                        (JNIEnv *) 0x1, (jmethodID) 0x3);
541   jvalue value2;
542   value2.i = 5;
543   _Jv_JVMTI_PostEvent (JVMTI_EVENT_METHOD_EXIT, (jthread) 0x2,
544                        (JNIEnv *) 0x1, (jmethodID) 0x3, 4, value2);
545   _Jv_JVMTI_PostEvent (JVMTI_EVENT_NATIVE_METHOD_BIND, (jthread) 0x2,
546                        (JNIEnv *) 0x1, (jmethodID) 0x3, (void *) 0x4,
547                        (void **) 0x5);
548   _Jv_JVMTI_PostEvent (JVMTI_EVENT_COMPILED_METHOD_LOAD, (jthread) 0xb00,
549                        (jmethodID) 0x1, (jint) 2, (const void *) 0x3,
550                        (jint) 4, (const jvmtiAddrLocationMap *) 0x5,
551                        (const void *) 0x6);
552   _Jv_JVMTI_PostEvent (JVMTI_EVENT_COMPILED_METHOD_UNLOAD, (jthread) 0xb00,
553                        (jmethodID) 0x1, (const void *) 0x2);
554   _Jv_JVMTI_PostEvent (JVMTI_EVENT_DYNAMIC_CODE_GENERATED, (jthread) 0xb00,
555                        "1", (const void *) 0x2, (jint) 3);
556   _Jv_JVMTI_PostEvent (JVMTI_EVENT_DATA_DUMP_REQUEST, (jthread) 0xb00);
557   _Jv_JVMTI_PostEvent (JVMTI_EVENT_MONITOR_WAIT, (jthread) 0x2,
558                        (JNIEnv *) 0x1, (jobject) 0x3, (jlong) 4);
559   _Jv_JVMTI_PostEvent (JVMTI_EVENT_MONITOR_WAITED, (jthread) 0x2,
560                        (JNIEnv *) 0x1, (jobject) 0x3, (int) 4);
561   _Jv_JVMTI_PostEvent (JVMTI_EVENT_MONITOR_CONTENDED_ENTER, (jthread) 0x2,
562                        (JNIEnv *) 0x1, (jobject) 0x3);
563   _Jv_JVMTI_PostEvent (JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, (jthread) 0x2,
564                        (JNIEnv *) 0x1, (jobject) 0x3);
565   _Jv_JVMTI_PostEvent (JVMTI_EVENT_GARBAGE_COLLECTION_START, (jthread) 0xb00);
566   _Jv_JVMTI_PostEvent (JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, (jthread) 0xb00);
567   _Jv_JVMTI_PostEvent (JVMTI_EVENT_OBJECT_FREE, (jthread) 0xb00, (jlong) 1);
568   _Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_OBJECT_ALLOC, (jthread) 0x2,
569                        (JNIEnv *) 0x1, (jobject) 0x3, (jclass) 0x4,
570                        (jlong) 5);
571 }
572
573 void
574 events::do_events_tests ()
575 {
576   do_enable_tests ();
577   do_callback_arg_tests ();
578 }