1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
|
// jvmti.cc - JVMTI implementation
/* Copyright (C) 2006 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
#include <platform.h>
#include <jvm.h>
#include <java-threads.h>
#include <java-gc.h>
#include <jvmti.h>
#include <gnu/classpath/SystemProperties.h>
#include <gnu/gcj/runtime/BootClassLoader.h>
#include <java/lang/Class.h>
#include <java/lang/ClassLoader.h>
#include <java/lang/Thread.h>
#include <java/lang/Throwable.h>
#include <java/lang/VMClassLoader.h>
#include <java/lang/reflect/Field.h>
#include <java/lang/reflect/Modifier.h>
#include <java/util/Collection.h>
#include <java/util/HashMap.h>
#include <java/net/URL.h>
extern struct JNINativeInterface _Jv_JNIFunctions;
struct _Jv_rawMonitorID
{
_Jv_Mutex_t mutex;
_Jv_ConditionVariable_t condition;
};
// Some commonly-used checks
#define THREAD_DEFAULT_TO_CURRENT(jthread) \
if (jthread == NULL) jthread = java::lang::Thread::currentThread ();
#define THREAD_CHECK_VALID(jthread) \
if (!java::lang::Thread::class$.isAssignableFrom (&(jthread->class$))) \
return JVMTI_ERROR_INVALID_THREAD;
#define THREAD_CHECK_IS_ALIVE(thread) \
if (!thread->isAlive ()) return JVMTI_ERROR_THREAD_NOT_ALIVE;
// FIXME: if current phase is not set in Phases,
// return JVMTI_ERROR_WRONG_PHASE
#define REQUIRE_PHASE(Env, Phases)
#define NULL_CHECK(Ptr) \
if (Ptr == NULL) return JVMTI_ERROR_NULL_POINTER;
static jvmtiError JNICALL
_Jv_JVMTI_SuspendThread (MAYBE_UNUSED jvmtiEnv *env, jthread thread)
{
using namespace java::lang;
THREAD_DEFAULT_TO_CURRENT (thread);
THREAD_CHECK_VALID (thread);
Thread *t = reinterpret_cast<Thread *> (thread);
THREAD_CHECK_IS_ALIVE (t);
_Jv_Thread_t *data = _Jv_ThreadGetData (t);
_Jv_SuspendThread (data);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_ResumeThread (MAYBE_UNUSED jvmtiEnv *env, jthread thread)
{
using namespace java::lang;
THREAD_DEFAULT_TO_CURRENT (thread);
THREAD_CHECK_VALID (thread);
Thread *t = reinterpret_cast<Thread *> (thread);
THREAD_CHECK_IS_ALIVE (t);
_Jv_Thread_t *data = _Jv_ThreadGetData (t);
_Jv_ResumeThread (data);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_InterruptThread (MAYBE_UNUSED jvmtiEnv *env, jthread thread)
{
using namespace java::lang;
REQUIRE_PHASE (env, JVMTI_PHASE_LIVE);
// FIXME: capability handling? 'can_signal_thread'
if (thread == NULL)
return JVMTI_ERROR_INVALID_THREAD;
THREAD_CHECK_VALID (thread);
Thread *real_thread = reinterpret_cast<Thread *> (thread);
THREAD_CHECK_IS_ALIVE (real_thread);
real_thread->interrupt();
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_CreateRawMonitor (MAYBE_UNUSED jvmtiEnv *env, const char *name,
jrawMonitorID *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_ONLOAD | JVMTI_PHASE_LIVE);
NULL_CHECK (name);
NULL_CHECK (result);
*result = (jrawMonitorID) _Jv_Malloc (sizeof (_Jv_rawMonitorID));
_Jv_MutexInit (&(*result)->mutex);
_Jv_CondInit (&(*result)->condition);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_DestroyRawMonitor (MAYBE_UNUSED jvmtiEnv *env, jrawMonitorID monitor)
{
REQUIRE_PHASE (env, JVMTI_PHASE_ONLOAD | JVMTI_PHASE_LIVE);
// Note we have no better way of knowing whether this object is
// really a raw monitor.
if (monitor == NULL)
return JVMTI_ERROR_INVALID_MONITOR;
// FIXME: perform checks on monitor, release it if this thread owns
// it.
#ifdef _Jv_HaveMutexDestroy
_Jv_MutexDestroy (&monitor->mutex);
#endif
_Jv_Free (monitor);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_RawMonitorEnter (MAYBE_UNUSED jvmtiEnv *env, jrawMonitorID monitor)
{
if (monitor == NULL)
return JVMTI_ERROR_INVALID_MONITOR;
_Jv_MutexLock (&monitor->mutex);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_RawMonitorExit (MAYBE_UNUSED jvmtiEnv *env, jrawMonitorID monitor)
{
if (monitor == NULL)
return JVMTI_ERROR_INVALID_MONITOR;
if (_Jv_MutexUnlock (&monitor->mutex))
return JVMTI_ERROR_NOT_MONITOR_OWNER;
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_RawMonitorWait (MAYBE_UNUSED jvmtiEnv *env, jrawMonitorID monitor)
{
if (monitor == NULL)
return JVMTI_ERROR_INVALID_MONITOR;
int r = _Jv_CondWait (&monitor->condition, &monitor->mutex, 0, 0);
if (r == _JV_NOT_OWNER)
return JVMTI_ERROR_NOT_MONITOR_OWNER;
if (r == _JV_INTERRUPTED)
return JVMTI_ERROR_INTERRUPT;
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_RawMonitorNotify (MAYBE_UNUSED jvmtiEnv *env, jrawMonitorID monitor)
{
if (monitor == NULL)
return JVMTI_ERROR_INVALID_MONITOR;
if (_Jv_CondNotify (&monitor->condition, &monitor->mutex) == _JV_NOT_OWNER)
return JVMTI_ERROR_NOT_MONITOR_OWNER;
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_RawMonitorNotifyAll (MAYBE_UNUSED jvmtiEnv *env,
jrawMonitorID monitor)
{
if (monitor == NULL)
return JVMTI_ERROR_INVALID_MONITOR;
if (_Jv_CondNotifyAll (&monitor->condition, &monitor->mutex)
== _JV_NOT_OWNER)
return JVMTI_ERROR_NOT_MONITOR_OWNER;
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_Allocate (MAYBE_UNUSED jvmtiEnv *env, jlong size,
unsigned char **result)
{
if (size < 0)
return JVMTI_ERROR_ILLEGAL_ARGUMENT;
NULL_CHECK (result);
if (size == 0)
*result = NULL;
else
{
*result = (unsigned char *) _Jv_MallocUnchecked (size);
if (*result == NULL)
return JVMTI_ERROR_OUT_OF_MEMORY;
}
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_Deallocate (MAYBE_UNUSED jvmtiEnv *env, unsigned char *mem)
{
if (mem != NULL)
_Jv_Free (mem);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetClassModifiers (jvmtiEnv *env, jclass klass, jint *mods)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
// Don't bother checking KLASS' type.
if (klass == NULL)
return JVMTI_ERROR_INVALID_CLASS;
NULL_CHECK (mods);
*mods = klass->getModifiers();
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetClassMethods (jvmtiEnv *env, jclass klass, jint *count_ptr,
jmethodID **methods_ptr)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
// FIXME: capability can_maintain_original_method_order
// Don't bother checking KLASS' type.
if (klass == NULL)
return JVMTI_ERROR_INVALID_CLASS;
NULL_CHECK (count_ptr);
NULL_CHECK (methods_ptr);
*count_ptr = JvNumMethods(klass);
*methods_ptr = (jmethodID *) _Jv_Malloc (*count_ptr * sizeof (jmethodID));
jmethodID start = JvGetFirstMethod (klass);
for (jint i = 0; i < *count_ptr; ++i)
// FIXME: correct?
(*methods_ptr)[i] = start + i;
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_IsInterface (jvmtiEnv *env, jclass klass, jboolean *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (klass == NULL)
return JVMTI_ERROR_INVALID_CLASS;
NULL_CHECK (result);
*result = klass->isInterface();
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_IsArrayClass (jvmtiEnv *env, jclass klass, jboolean *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (klass == NULL)
return JVMTI_ERROR_INVALID_CLASS;
NULL_CHECK (result);
*result = klass->isArray();
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetClassLoader (jvmtiEnv *env, jclass klass, jobject *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (klass == NULL)
return JVMTI_ERROR_INVALID_CLASS;
NULL_CHECK (result);
*result = klass->getClassLoaderInternal();
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetObjectHashCode (jvmtiEnv *env, jobject obj, jint *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (obj == NULL)
return JVMTI_ERROR_INVALID_OBJECT;
NULL_CHECK (result);
*result = _Jv_HashCode (obj);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetFieldModifiers (jvmtiEnv *env, jclass klass, jfieldID field,
jint *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (klass == NULL)
return JVMTI_ERROR_INVALID_CLASS;
if (field == NULL)
return JVMTI_ERROR_INVALID_FIELDID;
NULL_CHECK (result);
*result = field->getModifiers();
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_IsFieldSynthetic (jvmtiEnv *env, jclass klass, jfieldID field,
jboolean *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (klass == NULL)
return JVMTI_ERROR_INVALID_CLASS;
if (field == NULL)
return JVMTI_ERROR_INVALID_FIELDID;
NULL_CHECK (result);
// FIXME: capability can_get_synthetic_attribute
*result = ((field->getModifiers() & java::lang::reflect::Modifier::SYNTHETIC)
!= 0);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetMethodModifiers (jvmtiEnv *env, jmethodID method, jint *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (method == NULL)
return JVMTI_ERROR_INVALID_METHODID;
NULL_CHECK (result);
// FIXME: mask off some internal bits...
*result = method->accflags;
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_IsMethodNative (jvmtiEnv *env, jmethodID method, jboolean *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (method == NULL)
return JVMTI_ERROR_INVALID_METHODID;
NULL_CHECK (result);
*result = ((method->accflags & java::lang::reflect::Modifier::NATIVE) != 0);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_IsMethodSynthetic (jvmtiEnv *env, jmethodID method, jboolean *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (method == NULL)
return JVMTI_ERROR_INVALID_METHODID;
NULL_CHECK (result);
// FIXME capability can_get_synthetic_attribute
*result = ((method->accflags & java::lang::reflect::Modifier::SYNTHETIC)
!= 0);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetClassLoaderClasses (jvmtiEnv *env,
jobject init_loader,
jint *count_ptr,
jclass **result_ptr)
{
using namespace java::lang;
using namespace java::util;
REQUIRE_PHASE (env, JVMTI_PHASE_LIVE);
NULL_CHECK (count_ptr);
NULL_CHECK (result_ptr);
ClassLoader *loader = (ClassLoader *) init_loader;
if (loader == NULL)
loader = VMClassLoader::bootLoader;
Collection *values = loader->loadedClasses->values();
jobjectArray array = values->toArray();
*count_ptr = array->length;
jobject *elts = elements (array);
jclass *result = (jclass *) _Jv_Malloc (*count_ptr * sizeof (jclass));
// FIXME: JNI references...
memcpy (result, elts, *count_ptr * sizeof (jclass));
*result_ptr = result;
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_ForceGarbageCollection (jvmtiEnv *env)
{
REQUIRE_PHASE (env, JVMTI_PHASE_LIVE);
_Jv_RunGC();
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_SetJNIFunctionTable (jvmtiEnv *env,
const jniNativeInterface *function_table)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
NULL_CHECK (function_table);
memcpy (&_Jv_JNIFunctions, function_table, sizeof (jniNativeInterface));
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetJNIFunctionTable (jvmtiEnv *env,
jniNativeInterface **function_table)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
NULL_CHECK (function_table);
*function_table
= (jniNativeInterface *) _Jv_Malloc (sizeof (jniNativeInterface));
memcpy (*function_table, &_Jv_JNIFunctions, sizeof (jniNativeInterface));
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_DisposeEnvironment (jvmtiEnv *env)
{
// All we need to do is free memory allocated by _Jv_GetJVMTIEnv
_Jv_Free (env);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetSystemProperty (jvmtiEnv *env, const char *property,
char **result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_ONLOAD | JVMTI_PHASE_LIVE);
NULL_CHECK (property);
NULL_CHECK (result);
jstring name = JvNewStringUTF(property);
jstring result_str = gnu::classpath::SystemProperties::getProperty(name);
if (result_str == NULL)
return JVMTI_ERROR_NOT_AVAILABLE;
int len = JvGetStringUTFLength (result_str);
*result = (char *) _Jv_Malloc (len + 1);
JvGetStringUTFRegion (result_str, 0, result_str->length(), *result);
(*result)[len] = '\0';
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_SetSystemProperty (jvmtiEnv *env, const char *property,
const char *value)
{
REQUIRE_PHASE (env, JVMTI_PHASE_ONLOAD);
NULL_CHECK (property);
if (value == NULL)
{
// FIXME: When would a property not be writeable?
return JVMTI_ERROR_NONE;
}
jstring prop_str = JvNewStringUTF(property);
jstring value_str = JvNewStringUTF(value);
gnu::classpath::SystemProperties::setProperty(prop_str, value_str);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetTime (MAYBE_UNUSED jvmtiEnv *env, jlong *nanos_ptr)
{
NULL_CHECK (nanos_ptr);
*nanos_ptr = _Jv_platform_nanotime();
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetAvailableProcessors (MAYBE_UNUSED jvmtiEnv *env,
jint *nprocessors_ptr)
{
NULL_CHECK (nprocessors_ptr);
#ifdef _SC_NPROCESSORS_ONLN
*nprocessors_ptr = sysconf(_SC_NPROCESSORS_ONLN);
#else
*nprocessors_ptr = 1;
#endif
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_AddToBootstrapClassLoaderSearch (jvmtiEnv *env, const char *segment)
{
using namespace java::lang;
using namespace java::net;
using namespace gnu::gcj::runtime;
REQUIRE_PHASE (env, JVMTI_PHASE_ONLOAD);
NULL_CHECK (segment);
jstring str_segment = JvNewStringUTF(segment);
URL *url;
try
{
url = new URL(JvNewStringUTF("file"), NULL, str_segment);
}
catch (jthrowable ignore)
{
return JVMTI_ERROR_ILLEGAL_ARGUMENT;
}
BootClassLoader *loader = VMClassLoader::bootLoader;
// Don't call this too early.
// assert (loader != NULL);
loader->addURL(url);
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_SetVerboseFlag (MAYBE_UNUSED jvmtiEnv *env, jvmtiVerboseFlag flag,
jboolean value)
{
switch (flag)
{
case JVMTI_VERBOSE_OTHER:
case JVMTI_VERBOSE_GC:
case JVMTI_VERBOSE_JNI:
// Ignore.
break;
case JVMTI_VERBOSE_CLASS:
gcj::verbose_class_flag = value;
break;
default:
return JVMTI_ERROR_ILLEGAL_ARGUMENT;
}
return JVMTI_ERROR_NONE;
}
static jvmtiError JNICALL
_Jv_JVMTI_GetObjectSize (jvmtiEnv *env, jobject object, jlong *result)
{
REQUIRE_PHASE (env, JVMTI_PHASE_START | JVMTI_PHASE_LIVE);
if (object == NULL)
return JVMTI_ERROR_INVALID_OBJECT;
NULL_CHECK (result);
jclass klass = object->getClass();
if (klass->isArray())
{
jclass comp = klass->getComponentType();
jint base
= (jint) _Jv_GetArrayElementFromElementType(NULL,
klass->getComponentType());
// FIXME: correct for primitive types?
jint compSize = comp->size();
__JArray *array = (__JArray *) object;
*result = base + array->length * compSize;
}
else
{
// Note that if OBJECT is a String then it may (if
// str->data==str) take more space. Do we care?
*result = klass->size();
}
return JVMTI_ERROR_NONE;
}
#define RESERVED NULL
#define UNIMPLEMENTED NULL
struct _Jv_jvmtiEnv _Jv_JVMTI_Interface =
{
RESERVED, // reserved1
UNIMPLEMENTED, // SetEventNotification
RESERVED, // reserved3
UNIMPLEMENTED, // GetAllThreads
_Jv_JVMTI_SuspendThread, // SuspendThread
_Jv_JVMTI_ResumeThread, // ResumeThread
UNIMPLEMENTED, // StopThread
_Jv_JVMTI_InterruptThread, // InterruptThread
UNIMPLEMENTED, // GetThreadInfo
UNIMPLEMENTED, // GetOwnedMonitorInfo
UNIMPLEMENTED, // GetCurrentContendedMonitor
UNIMPLEMENTED, // RunAgentThread
UNIMPLEMENTED, // GetTopThreadGroups
UNIMPLEMENTED, // GetThreadGroupInfo
UNIMPLEMENTED, // GetThreadGroupChildren
UNIMPLEMENTED, // GetFrameCount
UNIMPLEMENTED, // GetThreadState
RESERVED, // reserved18
UNIMPLEMENTED, // GetFrameLocation
UNIMPLEMENTED, // NotifyPopFrame
UNIMPLEMENTED, // GetLocalObject
UNIMPLEMENTED, // GetLocalInt
UNIMPLEMENTED, // GetLocalLong
UNIMPLEMENTED, // GetLocalFloat
UNIMPLEMENTED, // GetLocalDouble
UNIMPLEMENTED, // SetLocalObject
UNIMPLEMENTED, // SetLocalInt
UNIMPLEMENTED, // SetLocalLong
UNIMPLEMENTED, // SetLocalFloat
UNIMPLEMENTED, // SetLocalDouble
_Jv_JVMTI_CreateRawMonitor, // CreateRawMonitor
_Jv_JVMTI_DestroyRawMonitor, // DestroyRawMonitor
_Jv_JVMTI_RawMonitorEnter, // RawMonitorEnter
_Jv_JVMTI_RawMonitorExit, // RawMonitorExit
_Jv_JVMTI_RawMonitorWait, // RawMonitorWait
_Jv_JVMTI_RawMonitorNotify, // RawMonitorNotify
_Jv_JVMTI_RawMonitorNotifyAll, // RawMonitorNotifyAll
UNIMPLEMENTED, // SetBreakpoint
UNIMPLEMENTED, // ClearBreakpoint
RESERVED, // reserved40
UNIMPLEMENTED, // SetFieldAccessWatch
UNIMPLEMENTED, // ClearFieldAccessWatch
UNIMPLEMENTED, // SetFieldModificationWatch
UNIMPLEMENTED, // ClearFieldModificationWatch
RESERVED, // reserved45
_Jv_JVMTI_Allocate, // Allocate
_Jv_JVMTI_Deallocate, // Deallocate
UNIMPLEMENTED, // GetClassSignature
UNIMPLEMENTED, // GetClassStatus
UNIMPLEMENTED, // GetSourceFileName
_Jv_JVMTI_GetClassModifiers, // GetClassModifiers
_Jv_JVMTI_GetClassMethods, // GetClassMethods
UNIMPLEMENTED, // GetClassFields
UNIMPLEMENTED, // GetImplementedInterfaces
_Jv_JVMTI_IsInterface, // IsInterface
_Jv_JVMTI_IsArrayClass, // IsArrayClass
_Jv_JVMTI_GetClassLoader, // GetClassLoader
_Jv_JVMTI_GetObjectHashCode, // GetObjectHashCode
UNIMPLEMENTED, // GetObjectMonitorUsage
UNIMPLEMENTED, // GetFieldName
UNIMPLEMENTED, // GetFieldDeclaringClass
_Jv_JVMTI_GetFieldModifiers, // GetFieldModifiers
_Jv_JVMTI_IsFieldSynthetic, // IsFieldSynthetic
UNIMPLEMENTED, // GetMethodName
UNIMPLEMENTED, // GetMethodDeclaringClass
_Jv_JVMTI_GetMethodModifiers, // GetMethodModifers
RESERVED, // reserved67
UNIMPLEMENTED, // GetMaxLocals
UNIMPLEMENTED, // GetArgumentsSize
UNIMPLEMENTED, // GetLineNumberTable
UNIMPLEMENTED, // GetMethodLocation
UNIMPLEMENTED, // GetLocalVariableTable
RESERVED, // reserved73
RESERVED, // reserved74
UNIMPLEMENTED, // GetBytecodes
_Jv_JVMTI_IsMethodNative, // IsMethodNative
_Jv_JVMTI_IsMethodSynthetic, // IsMethodSynthetic
UNIMPLEMENTED, // GetLoadedClasses
_Jv_JVMTI_GetClassLoaderClasses, // GetClassLoaderClasses
UNIMPLEMENTED, // PopFrame
RESERVED, // reserved81
RESERVED, // reserved82
RESERVED, // reserved83
RESERVED, // reserved84
RESERVED, // reserved85
RESERVED, // reserved86
UNIMPLEMENTED, // RedefineClasses
UNIMPLEMENTED, // GetVersionNumber
UNIMPLEMENTED, // GetCapabilities
UNIMPLEMENTED, // GetSourceDebugExtension
UNIMPLEMENTED, // IsMethodObsolete
UNIMPLEMENTED, // SuspendThreadList
UNIMPLEMENTED, // ResumeThreadList
RESERVED, // reserved94
RESERVED, // reserved95
RESERVED, // reserved96
RESERVED, // reserved97
RESERVED, // reserved98
RESERVED, // reserved99
UNIMPLEMENTED, // GetAllStackTraces
UNIMPLEMENTED, // GetThreadListStackTraces
UNIMPLEMENTED, // GetThreadLocalStorage
UNIMPLEMENTED, // SetThreadLocalStorage
UNIMPLEMENTED, // GetStackTrace
RESERVED, // reserved105
UNIMPLEMENTED, // GetTag
UNIMPLEMENTED, // SetTag
_Jv_JVMTI_ForceGarbageCollection, // ForceGarbageCollection
UNIMPLEMENTED, // IterateOverObjectsReachable
UNIMPLEMENTED, // IterateOverReachableObjects
UNIMPLEMENTED, // IterateOverHeap
UNIMPLEMENTED, // IterateOverInstanceOfClass
RESERVED, // reserved113
UNIMPLEMENTED, // GetObjectsWithTags
RESERVED, // reserved115
RESERVED, // reserved116
RESERVED, // reserved117
RESERVED, // reserved118
RESERVED, // reserved119
_Jv_JVMTI_SetJNIFunctionTable, // SetJNIFunctionTable
_Jv_JVMTI_GetJNIFunctionTable, // GetJNIFunctionTable
UNIMPLEMENTED, // SetEventCallbacks
UNIMPLEMENTED, // GenerateEvents
UNIMPLEMENTED, // GetExtensionFunctions
UNIMPLEMENTED, // GetExtensionEvents
UNIMPLEMENTED, // SetExtensionEventCallback
_Jv_JVMTI_DisposeEnvironment, // DisposeEnvironment
UNIMPLEMENTED, // GetErrorName
UNIMPLEMENTED, // GetJLocationFormat
UNIMPLEMENTED, // GetSystemProperties
_Jv_JVMTI_GetSystemProperty, // GetSystemProperty
_Jv_JVMTI_SetSystemProperty, // SetSystemProperty
UNIMPLEMENTED, // GetPhase
UNIMPLEMENTED, // GetCurrentThreadCpuTimerInfo
UNIMPLEMENTED, // GetCurrentThreadCpuTime
UNIMPLEMENTED, // GetThreadCpuTimerInfo
UNIMPLEMENTED, // GetThreadCpuTime
UNIMPLEMENTED, // GetTimerInfo
_Jv_JVMTI_GetTime, // GetTime
UNIMPLEMENTED, // GetPotentialCapabilities
RESERVED, // reserved141
UNIMPLEMENTED, // AddCapabilities
UNIMPLEMENTED, // RelinquishCapabilities
_Jv_JVMTI_GetAvailableProcessors, // GetAvailableProcessors
RESERVED, // reserved145
RESERVED, // reserved146
UNIMPLEMENTED, // GetEnvironmentLocalStorage
UNIMPLEMENTED, // SetEnvironmentLocalStorage
_Jv_JVMTI_AddToBootstrapClassLoaderSearch, // AddToBootstrapClassLoaderSearch
_Jv_JVMTI_SetVerboseFlag, // SetVerboseFlag
RESERVED, // reserved151
RESERVED, // reserved152
RESERVED, // reserved153
_Jv_JVMTI_GetObjectSize // GetObjectSize
};
_Jv_JVMTIEnv *
_Jv_GetJVMTIEnv (void)
{
_Jv_JVMTIEnv *env
= (_Jv_JVMTIEnv *) _Jv_MallocUnchecked (sizeof (_Jv_JVMTIEnv));
env->p = &_Jv_JVMTI_Interface;
return env;
}
|