00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _JAVASOFT_JVMDI_H_
00017 #define _JAVASOFT_JVMDI_H_
00018
00019 #include "jni.h"
00020
00021 #define JVMDI_VERSION_1 0x20010000
00022 #define JVMDI_VERSION_1_1 0x20010001
00023 #define JVMDI_VERSION_1_2 0x20010002
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00029 typedef jobject jthread;
00030
00031 typedef jobject jthreadGroup;
00032
00033 struct _jframeID;
00034 typedef struct _jframeID *jframeID;
00035
00036
00037 typedef jlong jlocation;
00038
00039
00040
00041
00042 #define OBSOLETE_METHOD_ID ((jmethodID)(NULL))
00043
00044
00045
00046
00047
00048 typedef jint jvmdiError;
00049
00050
00051 #define JVMDI_ERROR_NONE ((jvmdiError)0)
00052
00053
00054
00055
00056
00057
00058 #define JVMDI_ERROR_INVALID_THREAD ((jvmdiError)10)
00059
00060 #define JVMDI_ERROR_INVALID_THREAD_GROUP ((jvmdiError)11)
00061
00062 #define JVMDI_ERROR_INVALID_PRIORITY ((jvmdiError)12)
00063
00064 #define JVMDI_ERROR_THREAD_NOT_SUSPENDED ((jvmdiError)13)
00065
00066 #define JVMDI_ERROR_THREAD_SUSPENDED ((jvmdiError)14)
00067
00068
00069
00070
00071
00072
00073 #define JVMDI_ERROR_INVALID_OBJECT ((jvmdiError)20)
00074
00075 #define JVMDI_ERROR_INVALID_CLASS ((jvmdiError)21)
00076
00077 #define JVMDI_ERROR_CLASS_NOT_PREPARED ((jvmdiError)22)
00078
00079 #define JVMDI_ERROR_INVALID_METHODID ((jvmdiError)23)
00080
00081 #define JVMDI_ERROR_INVALID_LOCATION ((jvmdiError)24)
00082
00083 #define JVMDI_ERROR_INVALID_FIELDID ((jvmdiError)25)
00084
00085
00086
00087
00088
00089
00090 #define JVMDI_ERROR_INVALID_FRAMEID ((jvmdiError)30)
00091
00092 #define JVMDI_ERROR_NO_MORE_FRAMES ((jvmdiError)31)
00093
00094 #define JVMDI_ERROR_OPAQUE_FRAME ((jvmdiError)32)
00095
00096 #define JVMDI_ERROR_NOT_CURRENT_FRAME ((jvmdiError)33)
00097
00098 #define JVMDI_ERROR_TYPE_MISMATCH ((jvmdiError)34)
00099
00100 #define JVMDI_ERROR_INVALID_SLOT ((jvmdiError)35)
00101
00102
00103
00104
00105
00106
00107 #define JVMDI_ERROR_DUPLICATE ((jvmdiError)40)
00108
00109 #define JVMDI_ERROR_NOT_FOUND ((jvmdiError)41)
00110
00111
00112
00113
00114
00115
00116 #define JVMDI_ERROR_INVALID_MONITOR ((jvmdiError)50)
00117
00118 #define JVMDI_ERROR_NOT_MONITOR_OWNER ((jvmdiError)51)
00119
00120 #define JVMDI_ERROR_INTERRUPT ((jvmdiError)52)
00121
00122
00123
00124
00125
00126
00127 #define JVMDI_ERROR_INVALID_CLASS_FORMAT ((jvmdiError)60)
00128
00129 #define JVMDI_ERROR_CIRCULAR_CLASS_DEFINITION ((jvmdiError)61)
00130
00131 #define JVMDI_ERROR_FAILS_VERIFICATION ((jvmdiError)62)
00132
00133
00134 #define JVMDI_ERROR_ADD_METHOD_NOT_IMPLEMENTED ((jvmdiError)63)
00135
00136
00137 #define JVMDI_ERROR_SCHEMA_CHANGE_NOT_IMPLEMENTED ((jvmdiError)64)
00138
00139
00140 #define JVMDI_ERROR_INVALID_TYPESTATE ((jvmdiError)65)
00141
00142
00143
00144
00145 #define JVMDI_ERROR_HIERARCHY_CHANGE_NOT_IMPLEMENTED ((jvmdiError)66)
00146
00147
00148
00149 #define JVMDI_ERROR_DELETE_METHOD_NOT_IMPLEMENTED ((jvmdiError)67)
00150
00151
00152 #define JVMDI_ERROR_UNSUPPORTED_VERSION ((jvmdiError)68)
00153
00154
00155 #define JVMDI_ERROR_NAMES_DONT_MATCH ((jvmdiError)69)
00156
00157
00158 #define JVMDI_ERROR_CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED ((jvmdiError)70)
00159
00160
00161
00162 #define JVMDI_ERROR_METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED ((jvmdiError)71)
00163
00164
00165
00166
00167
00168
00169 #define JVMDI_ERROR_NOT_IMPLEMENTED ((jvmdiError)99)
00170
00171 #define JVMDI_ERROR_NULL_POINTER ((jvmdiError)100)
00172
00173 #define JVMDI_ERROR_ABSENT_INFORMATION ((jvmdiError)101)
00174
00175 #define JVMDI_ERROR_INVALID_EVENT_TYPE ((jvmdiError)102)
00176
00177 #define JVMDI_ERROR_ILLEGAL_ARGUMENT ((jvmdiError)103)
00178
00179
00180
00181
00182
00183
00184
00185
00186 #define JVMDI_ERROR_OUT_OF_MEMORY ((jvmdiError)110)
00187
00188 #define JVMDI_ERROR_ACCESS_DENIED ((jvmdiError)111)
00189
00190 #define JVMDI_ERROR_VM_DEAD ((jvmdiError)112)
00191
00192 #define JVMDI_ERROR_INTERNAL ((jvmdiError)113)
00193
00194 #define JVMDI_ERROR_UNATTACHED_THREAD ((jvmdiError)115)
00195
00196
00197
00198
00199
00200
00201
00202 #define JVMDI_THREAD_STATUS_UNKNOWN ((jint)-1)
00203
00204 #define JVMDI_THREAD_STATUS_ZOMBIE ((jint)0)
00205
00206 #define JVMDI_THREAD_STATUS_RUNNING ((jint)1)
00207
00208 #define JVMDI_THREAD_STATUS_SLEEPING ((jint)2)
00209
00210 #define JVMDI_THREAD_STATUS_MONITOR ((jint)3)
00211
00212 #define JVMDI_THREAD_STATUS_WAIT ((jint)4)
00213
00214
00215
00216 #define JVMDI_SUSPEND_STATUS_SUSPENDED ((jint)0x1)
00217
00218 #define JVMDI_SUSPEND_STATUS_BREAK ((jint)0x2)
00219
00220
00221
00222 #define JVMDI_THREAD_MIN_PRIORITY ((jint)1)
00223 #define JVMDI_THREAD_NORM_PRIORITY ((jint)5)
00224 #define JVMDI_THREAD_MAX_PRIORITY ((jint)10)
00225
00226 typedef struct {
00227 char *name;
00228 jint priority;
00229 jboolean is_daemon;
00230 jthreadGroup thread_group;
00231 jobject context_class_loader;
00232 } JVMDI_thread_info;
00233
00234 typedef struct {
00235 jthreadGroup parent;
00236 char *name;
00237 jint max_priority;
00238 jboolean is_daemon;
00239 } JVMDI_thread_group_info;
00240
00241 #define JVMDI_DISABLE ((jint) 0)
00242 #define JVMDI_ENABLE ((jint) 1)
00243
00244
00245
00246
00247 typedef void (*JVMDI_StartFunction)(void *);
00248
00249
00250
00251
00252 typedef void *JVMDI_RawMonitor;
00253
00254 #define JVMDI_MONITOR_WAIT_FOREVER ((jlong)(-1))
00255
00256
00257
00258
00259 typedef struct {
00260 jthread owner;
00261 jint entry_count;
00262 jint waiter_count;
00263 jthread *waiters;
00264 } JVMDI_monitor_info;
00265
00266 typedef struct {
00267 jint owned_monitor_count;
00268 jobject *owned_monitors;
00269 } JVMDI_owned_monitor_info;
00270
00271
00272
00273
00274
00275
00276 typedef struct {
00277 jthread thread;
00278 jclass clazz;
00279 jmethodID method;
00280 jlocation location;
00281 } JVMDI_single_step_event_data;
00282
00283
00284 typedef struct {
00285 jthread thread;
00286 jclass clazz;
00287 jmethodID method;
00288 jlocation location;
00289 } JVMDI_breakpoint_event_data;
00290
00291
00292 typedef struct {
00293 jthread thread;
00294 jclass clazz;
00295 jmethodID method;
00296 jlocation location;
00297 jclass field_clazz;
00298 jobject object;
00299 jfieldID field;
00300 } JVMDI_field_access_event_data;
00301
00302
00303 typedef struct {
00304 jthread thread;
00305 jclass clazz;
00306 jmethodID method;
00307 jlocation location;
00308 jclass field_clazz;
00309 jobject object;
00310 jfieldID field;
00311 char signature_type;
00312 jvalue new_value;
00313 } JVMDI_field_modification_event_data;
00314
00315
00316
00317
00318 typedef struct {
00319 jthread thread;
00320 jclass clazz;
00321 jmethodID method;
00322 jframeID frame;
00323 } JVMDI_frame_event_data;
00324
00325
00326 typedef struct {
00327 jthread thread;
00328 jclass clazz;
00329 jmethodID method;
00330 jlocation location;
00331 jobject exception;
00332 jclass catch_clazz;
00333 jmethodID catch_method;
00334 jlocation catch_location;
00335 } JVMDI_exception_event_data;
00336
00337
00338 typedef struct {
00339 jthread thread;
00340 jclass clazz;
00341 jmethodID method;
00342 jlocation location;
00343 jobject exception;
00344 } JVMDI_exception_catch_event_data;
00345
00346
00347 typedef struct {
00348 jobject object;
00349 jint key;
00350 } JVMDI_user_event_data;
00351
00352
00353
00354 typedef struct {
00355 jthread thread;
00356 } JVMDI_thread_change_event_data;
00357
00358
00359
00360
00361 typedef struct {
00362 jthread thread;
00363 jclass clazz;
00364 } JVMDI_class_event_data;
00365
00366
00367
00368
00369 typedef struct {
00370 jint kind;
00371
00372 union {
00373
00374 JVMDI_single_step_event_data single_step;
00375
00376
00377 JVMDI_breakpoint_event_data breakpoint;
00378
00379
00380
00381
00382 JVMDI_frame_event_data frame;
00383
00384
00385 JVMDI_field_access_event_data field_access;
00386
00387
00388 JVMDI_field_modification_event_data field_modification;
00389
00390
00391 JVMDI_exception_event_data exception;
00392
00393
00394 JVMDI_exception_catch_event_data exception_catch;
00395
00396
00397 JVMDI_user_event_data user;
00398
00399
00400
00401 JVMDI_thread_change_event_data thread_change;
00402
00403
00404
00405
00406 JVMDI_class_event_data class_event;
00407
00408
00409
00410 } u;
00411 } JVMDI_Event;
00412
00413
00414 #define JVMDI_EVENT_SINGLE_STEP ((jint)1)
00415 #define JVMDI_EVENT_BREAKPOINT ((jint)2)
00416 #define JVMDI_EVENT_FRAME_POP ((jint)3)
00417 #define JVMDI_EVENT_EXCEPTION ((jint)4)
00418 #define JVMDI_EVENT_USER_DEFINED ((jint)5)
00419 #define JVMDI_EVENT_THREAD_START ((jint)6)
00420 #define JVMDI_EVENT_THREAD_END ((jint)7)
00421 #define JVMDI_EVENT_CLASS_PREPARE ((jint)8)
00422 #define JVMDI_EVENT_CLASS_UNLOAD ((jint)9)
00423 #define JVMDI_EVENT_CLASS_LOAD ((jint)10)
00424 #define JVMDI_EVENT_FIELD_ACCESS ((jint)20)
00425 #define JVMDI_EVENT_FIELD_MODIFICATION ((jint)21)
00426 #define JVMDI_EVENT_EXCEPTION_CATCH ((jint)30)
00427 #define JVMDI_EVENT_METHOD_ENTRY ((jint)40)
00428 #define JVMDI_EVENT_METHOD_EXIT ((jint)41)
00429 #define JVMDI_EVENT_VM_INIT ((jint)90)
00430 #define JVMDI_EVENT_VM_DEATH ((jint)99)
00431
00432 #define JVMDI_MAX_EVENT_TYPE_VAL ((jint)99)
00433
00434
00435
00436
00437 typedef void (*JVMDI_EventHook)(JNIEnv *env, JVMDI_Event *event);
00438
00439 typedef jvmdiError (*JVMDI_AllocHook) (jlong size, jbyte** memPtr);
00440 typedef jvmdiError (*JVMDI_DeallocHook) (jbyte* buffer);
00441
00442
00443
00444
00445 #define JVMDI_CLASS_STATUS_VERIFIED ((jint)0x01)
00446 #define JVMDI_CLASS_STATUS_PREPARED ((jint)0x02)
00447 #define JVMDI_CLASS_STATUS_INITIALIZED ((jint)0x04)
00448
00449 #define JVMDI_CLASS_STATUS_ERROR ((jint)0x08)
00450
00451
00452
00453 typedef struct {
00454 jlocation start_location;
00455 jint line_number;
00456 } JVMDI_line_number_entry;
00457
00458
00459
00460
00461 typedef struct {
00462 jlocation start_location;
00463 jint length;
00464 char *name;
00465 char *signature;
00466 jint slot;
00467 } JVMDI_local_variable_entry;
00468
00469
00470
00471 typedef struct {
00472 jlocation start_location;
00473 jlocation end_location;
00474 jlocation handler_location;
00475 jclass exception;
00476 } JVMDI_exception_handler_entry;
00477
00478 #define JVMDI_OPERAND_TYPE_REFERENCE ((jint)1)
00479 #define JVMDI_OPERAND_TYPE_INT ((jint)2)
00480 #define JVMDI_OPERAND_TYPE_FLOAT ((jint)3)
00481 #define JVMDI_OPERAND_TYPE_LONG0 ((jint)4)
00482 #define JVMDI_OPERAND_TYPE_LONG1 ((jint)5)
00483 #define JVMDI_OPERAND_TYPE_DOUBLE0 ((jint)6)
00484 #define JVMDI_OPERAND_TYPE_DOUBLE1 ((jint)7)
00485 #define JVMDI_OPERAND_TYPE_RETURN_ADDRESS ((jint)8)
00486
00487 typedef struct {
00488 jint word;
00489 jint type;
00490
00491 } JVMDI_operand_stack_element;
00492
00493 typedef struct {
00494 jint instance_field_count;
00495 struct JVMDI_instance_field {
00496 jobject instance;
00497 jfieldID field;
00498 } *instance_fields;
00499
00500 jint static_field_count;
00501 struct JVMDI_static_field {
00502 jclass clazz;
00503 jfieldID static_field;
00504 } *static_fields;
00505
00506 jint array_element_count;
00507 struct JVMDI_array_element {
00508 jobjectArray array;
00509 jint index;
00510 } *array_elements;
00511
00512 jint frame_slot_count;
00513 struct JVMDI_frame_slot {
00514 jthread thread;
00515 jframeID frame;
00516 jint slot;
00517 } *frame_slots;
00518 } JVMDI_object_reference_info;
00519
00520
00521
00522 typedef struct {
00523 jclass clazz;
00524 jint class_byte_count;
00525 jbyte *class_bytes;
00526
00527 } JVMDI_class_definition;
00528
00529
00530 #define can_change_schema can_unrestrictedly_redefine_classes
00531
00532 typedef struct {
00533 unsigned int can_watch_field_modification : 1;
00534 unsigned int can_watch_field_access : 1;
00535 unsigned int can_get_bytecodes : 1;
00536 unsigned int can_get_synthetic_attribute : 1;
00537 unsigned int can_get_owned_monitor_info : 1;
00538 unsigned int can_get_current_contended_monitor : 1;
00539 unsigned int can_get_monitor_info : 1;
00540 unsigned int can_get_heap_info : 1;
00541 unsigned int can_get_operand_stack : 1;
00542 unsigned int can_set_operand_stack : 1;
00543 unsigned int can_pop_frame : 1;
00544 unsigned int can_get_class_definition : 1;
00545 unsigned int can_redefine_classes : 1;
00546 unsigned int can_add_method : 1;
00547 unsigned int can_unrestrictedly_redefine_classes : 1;
00548 unsigned int reserved5 : 1;
00549 } JVMDI_capabilities;
00550
00551 typedef struct JVMDI_Interface_1_ {
00552 jvmdiError (JNICALL *SetEventHook)
00553 (JVMDI_EventHook hook);
00554 jvmdiError (JNICALL *SetEventNotificationMode)
00555 (jint mode, jint eventType, jthread thread, ...);
00556
00557 jvmdiError (JNICALL *GetThreadStatus)
00558 (jthread thread,
00559 jint *threadStatusPtr, jint *suspendStatusPtr);
00560 jvmdiError (JNICALL *GetAllThreads)
00561 (jint *threadsCountPtr, jthread **threadsPtr);
00562 jvmdiError (JNICALL *SuspendThread)
00563 (jthread thread);
00564 jvmdiError (JNICALL *ResumeThread)
00565 (jthread thread);
00566 jvmdiError (JNICALL *StopThread)
00567 (jthread thread, jobject exception);
00568 jvmdiError (JNICALL *InterruptThread)
00569 (jthread thread);
00570 jvmdiError (JNICALL *GetThreadInfo)
00571 (jthread thread, JVMDI_thread_info *infoPtr);
00572 jvmdiError (JNICALL *GetOwnedMonitorInfo)
00573 (jthread thread, JVMDI_owned_monitor_info *infoPtr);
00574 jvmdiError (JNICALL *GetCurrentContendedMonitor)
00575 (jthread thread, jobject *monitor);
00576 jvmdiError (JNICALL *RunDebugThread)
00577 (jthread thread, JVMDI_StartFunction proc, void *arg,
00578 int priority);
00579
00580 jvmdiError (JNICALL *GetTopThreadGroups)
00581 (jint *groupCountPtr, jthreadGroup **groupsPtr);
00582 jvmdiError (JNICALL *GetThreadGroupInfo)
00583 (jthreadGroup group, JVMDI_thread_group_info *infoPtr);
00584 jvmdiError (JNICALL *GetThreadGroupChildren)
00585 (jthreadGroup group,
00586 jint *threadCountPtr, jthread **threadsPtr,
00587 jint *groupCountPtr, jthreadGroup **groupsPtr);
00588
00589 jvmdiError (JNICALL *GetFrameCount)
00590 (jthread thread, jint *countPtr);
00591 jvmdiError (JNICALL *GetCurrentFrame)
00592 (jthread thread, jframeID *framePtr);
00593 jvmdiError (JNICALL *GetCallerFrame)
00594 (jframeID called, jframeID *framePtr);
00595 jvmdiError (JNICALL *GetFrameLocation)
00596 (jframeID frame, jclass *classPtr, jmethodID *methodPtr,
00597 jlocation *locationPtr);
00598 jvmdiError (JNICALL *NotifyFramePop)
00599 (jframeID frame);
00600 jvmdiError (JNICALL *GetLocalObject)
00601 (jframeID frame, jint slot, jobject *valuePtr);
00602 jvmdiError (JNICALL *GetLocalInt)
00603 (jframeID frame, jint slot, jint *valuePtr);
00604 jvmdiError (JNICALL *GetLocalLong)
00605 (jframeID frame, jint slot, jlong *valuePtr);
00606 jvmdiError (JNICALL *GetLocalFloat)
00607 (jframeID frame, jint slot, jfloat *valuePtr);
00608 jvmdiError (JNICALL *GetLocalDouble)
00609 (jframeID frame, jint slot, jdouble *valuePtr);
00610 jvmdiError (JNICALL *SetLocalObject)
00611 (jframeID frame, jint slot, jobject value);
00612 jvmdiError (JNICALL *SetLocalInt)
00613 (jframeID frame, jint slot, jint value);
00614 jvmdiError (JNICALL *SetLocalLong)
00615 (jframeID frame, jint slot, jlong value);
00616 jvmdiError (JNICALL *SetLocalFloat)
00617 (jframeID frame, jint slot, jfloat value);
00618 jvmdiError (JNICALL *SetLocalDouble)
00619 (jframeID frame, jint slot, jdouble value);
00620
00621 jvmdiError (JNICALL *CreateRawMonitor)
00622 (char *name, JVMDI_RawMonitor *monitorPtr);
00623 jvmdiError (JNICALL *DestroyRawMonitor)
00624 (JVMDI_RawMonitor monitor);
00625 jvmdiError (JNICALL *RawMonitorEnter)
00626 (JVMDI_RawMonitor monitor);
00627 jvmdiError (JNICALL *RawMonitorExit)
00628 (JVMDI_RawMonitor monitor);
00629 jvmdiError (JNICALL *RawMonitorWait)
00630 (JVMDI_RawMonitor monitor, jlong millis);
00631 jvmdiError (JNICALL *RawMonitorNotify)
00632 (JVMDI_RawMonitor monitor);
00633 jvmdiError (JNICALL *RawMonitorNotifyAll)
00634 (JVMDI_RawMonitor monitor);
00635
00636 jvmdiError (JNICALL *SetBreakpoint)
00637 (jclass clazz, jmethodID method, jlocation location);
00638 jvmdiError (JNICALL *ClearBreakpoint)
00639 (jclass clazz, jmethodID method, jlocation location);
00640 jvmdiError (JNICALL *ClearAllBreakpoints)
00641 ();
00642
00643 jvmdiError (JNICALL *SetFieldAccessWatch)
00644 (jclass clazz, jfieldID field);
00645 jvmdiError (JNICALL *ClearFieldAccessWatch)
00646 (jclass clazz, jfieldID field);
00647 jvmdiError (JNICALL *SetFieldModificationWatch)
00648 (jclass clazz, jfieldID field);
00649 jvmdiError (JNICALL *ClearFieldModificationWatch)
00650 (jclass clazz, jfieldID field);
00651
00652 jvmdiError (JNICALL *SetAllocationHooks)
00653 (JVMDI_AllocHook ahook, JVMDI_DeallocHook dhook);
00654 jvmdiError (JNICALL *Allocate)
00655 (jlong size, jbyte** memPtr);
00656 jvmdiError (JNICALL *Deallocate)
00657 (jbyte* mem);
00658
00659 jvmdiError (JNICALL *GetClassSignature)
00660 (jclass clazz, char **sigPtr);
00661 jvmdiError (JNICALL *GetClassStatus)
00662 (jclass clazz, jint *statusPtr);
00663 jvmdiError (JNICALL *GetSourceFileName)
00664 (jclass clazz, char **sourceNamePtr);
00665 jvmdiError (JNICALL *GetClassModifiers)
00666 (jclass clazz, jint *modifiersPtr);
00667 jvmdiError (JNICALL *GetClassMethods)
00668 (jclass clazz, jint *methodCountPtr, jmethodID **methodsPtr);
00669 jvmdiError (JNICALL *GetClassFields)
00670 (jclass clazz, jint *fieldCountPtr, jfieldID **fieldsPtr);
00671 jvmdiError (JNICALL *GetImplementedInterfaces)
00672 (jclass clazz, jint *interfaceCountPtr, jclass **interfacesPtr);
00673 jvmdiError (JNICALL *IsInterface)
00674 (jclass clazz, jboolean *isInterfacePtr);
00675 jvmdiError (JNICALL *IsArrayClass)
00676 (jclass clazz, jboolean *isArrayClassPtr);
00677 jvmdiError (JNICALL *GetClassLoader)
00678 (jclass clazz, jobject *classloaderPtr);
00679
00680 jvmdiError (JNICALL *GetObjectHashCode)
00681 (jobject object, jint *hashCodePtr);
00682 jvmdiError (JNICALL *GetMonitorInfo)
00683 (jobject object, JVMDI_monitor_info *infoPtr);
00684
00685 jvmdiError (JNICALL *GetFieldName)
00686 (jclass clazz, jfieldID field, char **namePtr, char **signaturePtr);
00687 jvmdiError (JNICALL *GetFieldDeclaringClass)
00688 (jclass clazz, jfieldID field, jclass *declaringClassPtr);
00689 jvmdiError (JNICALL *GetFieldModifiers)
00690 (jclass clazz, jfieldID field, jint *modifiersPtr);
00691 jvmdiError (JNICALL *IsFieldSynthetic)
00692 (jclass clazz, jfieldID field, jboolean *isSyntheticPtr);
00693
00694 jvmdiError (JNICALL *GetMethodName)
00695 (jclass clazz, jmethodID method,
00696 char **namePtr, char **signaturePtr);
00697 jvmdiError (JNICALL *GetMethodDeclaringClass)
00698 (jclass clazz, jmethodID method, jclass *declaringClassPtr);
00699 jvmdiError (JNICALL *GetMethodModifiers)
00700 (jclass clazz, jmethodID method, jint *modifiersPtr);
00701 jvmdiError (JNICALL *GetMaxStack)
00702 (jclass clazz, jmethodID method, jint *maxPtr);
00703 jvmdiError (JNICALL *GetMaxLocals)
00704 (jclass clazz, jmethodID method, jint *maxPtr);
00705 jvmdiError (JNICALL *GetArgumentsSize)
00706 (jclass clazz, jmethodID method, jint *sizePtr);
00707 jvmdiError (JNICALL *GetLineNumberTable)
00708 (jclass clazz, jmethodID method,
00709 jint *entryCountPtr, JVMDI_line_number_entry **tablePtr);
00710 jvmdiError (JNICALL *GetMethodLocation)
00711 (jclass clazz, jmethodID method,
00712 jlocation *startLocationPtr, jlocation *endLocationPtr);
00713 jvmdiError (JNICALL *GetLocalVariableTable)
00714 (jclass clazz, jmethodID method,
00715 jint *entryCountPtr, JVMDI_local_variable_entry **tablePtr);
00716 jvmdiError (JNICALL *GetExceptionHandlerTable)
00717 (jclass clazz, jmethodID method,
00718 jint *entryCountPtr, JVMDI_exception_handler_entry **tablePtr);
00719 jvmdiError (JNICALL *GetThrownExceptions)
00720 (jclass clazz, jmethodID method,
00721 jint *exceptionCountPtr, jclass **exceptionsPtr);
00722 jvmdiError (JNICALL *GetBytecodes)
00723 (jclass clazz, jmethodID method,
00724 jint *bytecodeCountPtr, jbyte **bytecodesPtr);
00725 jvmdiError (JNICALL *IsMethodNative)
00726 (jclass clazz, jmethodID method, jboolean *isNativePtr);
00727 jvmdiError (JNICALL *IsMethodSynthetic)
00728 (jclass clazz, jmethodID method, jboolean *isSyntheticPtr);
00729
00730 jvmdiError (JNICALL *GetLoadedClasses)
00731 (jint *classCountPtr, jclass **classesPtr);
00732 jvmdiError (JNICALL *GetClassLoaderClasses)
00733 (jobject initiatingLoader, jint *classesCountPtr,
00734 jclass **classesPtr);
00735
00736 jvmdiError (JNICALL *PopFrame)
00737 (jthread thread);
00738 jvmdiError (JNICALL *SetFrameLocation)
00739 (jframeID frame, jlocation location);
00740 jvmdiError (JNICALL *GetOperandStack)
00741 (jframeID frame, jint *operandStackSizePtr,
00742 JVMDI_operand_stack_element **operandStackPtr);
00743 jvmdiError (JNICALL *SetOperandStack)
00744 (jframeID frame, jint operandStackSize,
00745 JVMDI_operand_stack_element *operandStack);
00746 jvmdiError (JNICALL *AllInstances)
00747 (jclass clazz, jint *instanceCountPtr, jobject **instancesPtr);
00748 jvmdiError (JNICALL *References)
00749 (jobject obj, JVMDI_object_reference_info *refs);
00750 jvmdiError (JNICALL *GetClassDefinition)
00751 (jclass clazz, JVMDI_class_definition *classDefPtr);
00752 jvmdiError (JNICALL *RedefineClasses)
00753 (jint classCount, JVMDI_class_definition *classDefs);
00754
00755 jvmdiError (JNICALL *GetVersionNumber)
00756 (jint *versionPtr);
00757 jvmdiError (JNICALL *GetCapabilities)
00758 (JVMDI_capabilities *capabilitiesPtr);
00759
00760 jvmdiError (JNICALL *GetSourceDebugExtension)
00761 (jclass clazz, char **sourceDebugExtension);
00762 jvmdiError (JNICALL *IsMethodObsolete)
00763 (jclass clazz, jmethodID method, jboolean *isObsoletePtr);
00764 } JVMDI_Interface_1;
00765
00766 #ifndef NO_JVMDI_MACROS
00767
00768 #define JVMDI_ERROR_DUPLICATE_BREAKPOINT JVMDI_ERROR_DUPLICATE
00769 #define JVMDI_ERROR_NO_SUCH_BREAKPOINT JVMDI_ERROR_NOT_FOUND
00770 #define JVMDI_ERROR_DUPLICATE_FRAME_POP JVMDI_ERROR_DUPLICATE
00771
00772
00773 static JVMDI_Interface_1 *jvmdi_interface = NULL;
00774 static JavaVM *j_vm;
00775
00776 #ifdef __cplusplus
00777 #define SetJVMDIfromJNIEnv(a_env) ( (jvmdi_interface == NULL)? \
00778 ((a_env)->GetJavaVM(&j_vm), \
00779 (j_vm)->GetEnv((void **)&jvmdi_interface, \
00780 JVMDI_VERSION_1)):0)
00781 #else
00782 #define SetJVMDIfromJNIEnv(a_env) ( (jvmdi_interface == NULL)? \
00783 ((*a_env)->GetJavaVM(a_env, &j_vm), \
00784 (*j_vm)->GetEnv(j_vm, (void **)&jvmdi_interface, \
00785 JVMDI_VERSION_1)):0)
00786 #endif
00787
00788 #define JVMDI_SetEventHook(a_env, a1) ( \
00789 SetJVMDIfromJNIEnv(a_env), \
00790 jvmdi_interface->SetEventHook(a1) )
00791 #define JVMDI_GetThreadStatus(a_env, a1, a2, a3) ( \
00792 SetJVMDIfromJNIEnv(a_env), \
00793 jvmdi_interface->GetThreadStatus(a1, a2, a3) )
00794 #define JVMDI_GetAllThreads(a_env, a1, a2) ( \
00795 SetJVMDIfromJNIEnv(a_env), \
00796 jvmdi_interface->GetAllThreads(a1, a2) )
00797 #define JVMDI_SuspendThread(a_env, a1) ( \
00798 SetJVMDIfromJNIEnv(a_env), \
00799 jvmdi_interface->SuspendThread(a1) )
00800 #define JVMDI_ResumeThread(a_env, a1) ( \
00801 SetJVMDIfromJNIEnv(a_env), \
00802 jvmdi_interface->ResumeThread(a1) )
00803 #define JVMDI_StopThread(a_env, a1, a2) ( \
00804 SetJVMDIfromJNIEnv(a_env), \
00805 jvmdi_interface->StopThread(a1, a2) )
00806 #define JVMDI_InterruptThread(a_env, a1) ( \
00807 SetJVMDIfromJNIEnv(a_env), \
00808 jvmdi_interface->InterruptThread(a1) )
00809 #define JVMDI_SetSingleStep(a_env, a1, a2) ( \
00810 SetJVMDIfromJNIEnv(a_env), \
00811 jvmdi_interface->SetEventNotificationMode( \
00812 (a2) ? JVMDI_ENABLE : JVMDI_DISABLE, \
00813 JVMDI_EVENT_SINGLE_STEP, a1) )
00814 #define JVMDI_GetThreadInfo(a_env, a1, a2) ( \
00815 SetJVMDIfromJNIEnv(a_env), \
00816 jvmdi_interface->GetThreadInfo(a1, a2) )
00817 #define JVMDI_RunDebugThread(a_env, a1, a2, a3, a4) ( \
00818 SetJVMDIfromJNIEnv(a_env), \
00819 jvmdi_interface->RunDebugThread(a1, a2, a3, a4) )
00820 #define JVMDI_GetTopThreadGroups(a_env, a1, a2) ( \
00821 SetJVMDIfromJNIEnv(a_env), \
00822 jvmdi_interface->GetTopThreadGroups(a1, a2) )
00823 #define JVMDI_GetThreadGroupInfo(a_env, a1, a2) ( \
00824 SetJVMDIfromJNIEnv(a_env), \
00825 jvmdi_interface->GetThreadGroupInfo(a1, a2) )
00826 #define JVMDI_GetThreadGroupChildren(a_env, a1, a2, a3, a4, a5) ( \
00827 SetJVMDIfromJNIEnv(a_env), \
00828 jvmdi_interface->GetThreadGroupChildren(a1, a2, a3, a4, a5) )
00829 #define JVMDI_GetCurrentFrame(a_env, a1, a2) ( \
00830 SetJVMDIfromJNIEnv(a_env), \
00831 jvmdi_interface->GetCurrentFrame(a1, a2) )
00832 #define JVMDI_GetCallerFrame(a_env, a1, a2) ( \
00833 SetJVMDIfromJNIEnv(a_env), \
00834 jvmdi_interface->GetCallerFrame(a1, a2) )
00835 #define JVMDI_GetFrameLocation(a_env, a1, a2, a3, a4) ( \
00836 SetJVMDIfromJNIEnv(a_env), \
00837 jvmdi_interface->GetFrameLocation(a1, a2, a3, a4) )
00838 #define JVMDI_NotifyFramePop(a_env, a1) ( \
00839 SetJVMDIfromJNIEnv(a_env), \
00840 jvmdi_interface->NotifyFramePop(a1) )
00841 #define JVMDI_GetLocalObject(a_env, a1, a2, a3) ( \
00842 SetJVMDIfromJNIEnv(a_env), \
00843 jvmdi_interface->GetLocalObject(a1, a2, a3) )
00844 #define JVMDI_GetLocalInt(a_env, a1, a2, a3) ( \
00845 SetJVMDIfromJNIEnv(a_env), \
00846 jvmdi_interface->GetLocalInt(a1, a2, a3) )
00847 #define JVMDI_GetLocalLong(a_env, a1, a2, a3) ( \
00848 SetJVMDIfromJNIEnv(a_env), \
00849 jvmdi_interface->GetLocalLong(a1, a2, a3) )
00850 #define JVMDI_GetLocalFloat(a_env, a1, a2, a3) ( \
00851 SetJVMDIfromJNIEnv(a_env), \
00852 jvmdi_interface->GetLocalFloat(a1, a2, a3) )
00853 #define JVMDI_GetLocalDouble(a_env, a1, a2, a3) ( \
00854 SetJVMDIfromJNIEnv(a_env), \
00855 jvmdi_interface->GetLocalDouble(a1, a2, a3) )
00856 #define JVMDI_SetLocalObject(a_env, a1, a2, a3) ( \
00857 SetJVMDIfromJNIEnv(a_env), \
00858 jvmdi_interface->SetLocalObject(a1, a2, a3) )
00859 #define JVMDI_SetLocalInt(a_env, a1, a2, a3) ( \
00860 SetJVMDIfromJNIEnv(a_env), \
00861 jvmdi_interface->SetLocalInt(a1, a2, a3) )
00862 #define JVMDI_SetLocalLong(a_env, a1, a2, a3) ( \
00863 SetJVMDIfromJNIEnv(a_env), \
00864 jvmdi_interface->SetLocalLong(a1, a2, a3) )
00865 #define JVMDI_SetLocalFloat(a_env, a1, a2, a3) ( \
00866 SetJVMDIfromJNIEnv(a_env), \
00867 jvmdi_interface->SetLocalFloat(a1, a2, a3) )
00868 #define JVMDI_SetLocalDouble(a_env, a1, a2, a3) ( \
00869 SetJVMDIfromJNIEnv(a_env), \
00870 jvmdi_interface->SetLocalDouble(a1, a2, a3) )
00871 #define JVMDI_CreateRawMonitor(a_env, a1, a2) ( \
00872 SetJVMDIfromJNIEnv(a_env), \
00873 jvmdi_interface->CreateRawMonitor(a1, a2) )
00874 #define JVMDI_DestroyRawMonitor(a_env, a1) ( \
00875 SetJVMDIfromJNIEnv(a_env), \
00876 jvmdi_interface->DestroyRawMonitor(a1) )
00877 #define JVMDI_RawMonitorEnter(a_env, a1) ( \
00878 SetJVMDIfromJNIEnv(a_env), \
00879 jvmdi_interface->RawMonitorEnter(a1) )
00880 #define JVMDI_RawMonitorExit(a_env, a1) ( \
00881 SetJVMDIfromJNIEnv(a_env), \
00882 jvmdi_interface->RawMonitorExit(a1) )
00883 #define JVMDI_RawMonitorWait(a_env, a1, a2) ( \
00884 SetJVMDIfromJNIEnv(a_env), \
00885 jvmdi_interface->RawMonitorWait(a1, a2) )
00886 #define JVMDI_RawMonitorNotify(a_env, a1) ( \
00887 SetJVMDIfromJNIEnv(a_env), \
00888 jvmdi_interface->RawMonitorNotify(a1) )
00889 #define JVMDI_RawMonitorNotifyAll(a_env, a1) ( \
00890 SetJVMDIfromJNIEnv(a_env), \
00891 jvmdi_interface->RawMonitorNotifyAll(a1) )
00892 #define JVMDI_SetBreakpoint(a_env, a1, a2, a3) ( \
00893 SetJVMDIfromJNIEnv(a_env), \
00894 jvmdi_interface->SetBreakpoint(a1, a2, a3) )
00895 #define JVMDI_ClearBreakpoint(a_env, a1, a2, a3) ( \
00896 SetJVMDIfromJNIEnv(a_env), \
00897 jvmdi_interface->ClearBreakpoint(a1, a2, a3) )
00898 #define JVMDI_ClearAllBreakpoints(a_env) ( \
00899 SetJVMDIfromJNIEnv(a_env), \
00900 jvmdi_interface->ClearAllBreakpoints() )
00901 #define JVMDI_SetAllocationHooks(a_env, a1, a2) ( \
00902 SetJVMDIfromJNIEnv(a_env), \
00903 jvmdi_interface->SetAllocationHooks(a1, a2) )
00904 #define JVMDI_Allocate(a_env, a1, a2) ( \
00905 SetJVMDIfromJNIEnv(a_env), \
00906 jvmdi_interface->Allocate(a1, a2) )
00907 #define JVMDI_Deallocate(a_env, a1) ( \
00908 SetJVMDIfromJNIEnv(a_env), \
00909 jvmdi_interface->Deallocate(a1) )
00910 #define JVMDI_GetClassSignature(a_env, a1, a2) ( \
00911 SetJVMDIfromJNIEnv(a_env), \
00912 jvmdi_interface->GetClassSignature(a1, a2) )
00913 #define JVMDI_GetClassStatus(a_env, a1, a2) ( \
00914 SetJVMDIfromJNIEnv(a_env), \
00915 jvmdi_interface->GetClassStatus(a1, a2) )
00916 #define JVMDI_GetSourceFileName(a_env, a1, a2) ( \
00917 SetJVMDIfromJNIEnv(a_env), \
00918 jvmdi_interface->GetSourceFileName(a1, a2) )
00919 #define JVMDI_GetClassModifiers(a_env, a1, a2) ( \
00920 SetJVMDIfromJNIEnv(a_env), \
00921 jvmdi_interface->GetClassModifiers(a1, a2) )
00922 #define JVMDI_GetClassMethods(a_env, a1, a2, a3) ( \
00923 SetJVMDIfromJNIEnv(a_env), \
00924 jvmdi_interface->GetClassMethods(a1, a2, a3) )
00925 #define JVMDI_GetClassFields(a_env, a1, a2, a3) ( \
00926 SetJVMDIfromJNIEnv(a_env), \
00927 jvmdi_interface->GetClassFields(a1, a2, a3) )
00928 #define JVMDI_GetImplementedInterfaces(a_env, a1, a2, a3) ( \
00929 SetJVMDIfromJNIEnv(a_env), \
00930 jvmdi_interface->GetImplementedInterfaces(a1, a2, a3) )
00931 #define JVMDI_IsInterface(a_env, a1, a2) ( \
00932 SetJVMDIfromJNIEnv(a_env), \
00933 jvmdi_interface->IsInterface(a1, a2) )
00934 #define JVMDI_IsArrayClass(a_env, a1, a2) ( \
00935 SetJVMDIfromJNIEnv(a_env), \
00936 jvmdi_interface->IsArrayClass(a1, a2) )
00937 #define JVMDI_ClassLoader(a_env, a1, a2) ( \
00938 SetJVMDIfromJNIEnv(a_env), \
00939 jvmdi_interface->GetClassLoader(a1, a2) )
00940 #define JVMDI_GetFieldName(a_env, a1, a2, a3, a4) ( \
00941 SetJVMDIfromJNIEnv(a_env), \
00942 jvmdi_interface->GetFieldName(a1, a2, a3, a4) )
00943 #define JVMDI_GetFieldDeclaringClass(a_env, a1, a2, a3) ( \
00944 SetJVMDIfromJNIEnv(a_env), \
00945 jvmdi_interface->GetFieldDeclaringClass(a1, a2, a3) )
00946 #define JVMDI_GetFieldModifiers(a_env, a1, a2, a3) ( \
00947 SetJVMDIfromJNIEnv(a_env), \
00948 jvmdi_interface->GetFieldModifiers(a1, a2, a3) )
00949 #define JVMDI_GetMethodName(a_env, a1, a2, a3, a4) ( \
00950 SetJVMDIfromJNIEnv(a_env), \
00951 jvmdi_interface->GetMethodName(a1, a2, a3, a4) )
00952 #define JVMDI_GetMethodDeclaringClass(a_env, a1, a2, a3) ( \
00953 SetJVMDIfromJNIEnv(a_env), \
00954 jvmdi_interface->GetMethodDeclaringClass(a1, a2, a3) )
00955 #define JVMDI_GetMethodModifiers(a_env, a1, a2, a3) ( \
00956 SetJVMDIfromJNIEnv(a_env), \
00957 jvmdi_interface->GetMethodModifiers(a1, a2, a3) )
00958 #define JVMDI_GetMaxStack(a_env, a1, a2, a3) ( \
00959 SetJVMDIfromJNIEnv(a_env), \
00960 jvmdi_interface->GetMaxStack(a1, a2, a3) )
00961 #define JVMDI_GetMaxLocals(a_env, a1, a2, a3) ( \
00962 SetJVMDIfromJNIEnv(a_env), \
00963 jvmdi_interface->GetMaxLocals(a1, a2, a3) )
00964 #define JVMDI_GetArgumentsSize(a_env, a1, a2, a3) ( \
00965 SetJVMDIfromJNIEnv(a_env), \
00966 jvmdi_interface->GetArgumentsSize(a1, a2, a3) )
00967 #define JVMDI_GetLineNumberTable(a_env, a1, a2, a3, a4) ( \
00968 SetJVMDIfromJNIEnv(a_env), \
00969 jvmdi_interface->GetLineNumberTable(a1, a2, a3, a4) )
00970 #define JVMDI_GetMethodLocation(a_env, a1, a2, a3, a4) ( \
00971 SetJVMDIfromJNIEnv(a_env), \
00972 jvmdi_interface->GetMethodLocation(a1, a2, a3, a4) )
00973 #define JVMDI_GetLocalVariableTable(a_env, a1, a2, a3, a4) ( \
00974 SetJVMDIfromJNIEnv(a_env), \
00975 jvmdi_interface->GetLocalVariableTable(a1, a2, a3, a4) )
00976 #define JVMDI_GetExceptionHandlerTable(a_env, a1, a2, a3, a4) ( \
00977 SetJVMDIfromJNIEnv(a_env), \
00978 jvmdi_interface->GetExceptionHandlerTable(a1, a2, a3, a4) )
00979 #define JVMDI_GetThrownExceptions(a_env, a1, a2, a3, a4) ( \
00980 SetJVMDIfromJNIEnv(a_env), \
00981 jvmdi_interface->GetThrownExceptions(a1, a2, a3, a4) )
00982 #define JVMDI_GetBytecodes(a_env, a1, a2, a3, a4) ( \
00983 SetJVMDIfromJNIEnv(a_env), \
00984 jvmdi_interface->GetBytecodes(a1, a2, a3, a4) )
00985 #define JVMDI_IsMethodNative(a_env, a1, a2, a3) ( \
00986 SetJVMDIfromJNIEnv(a_env), \
00987 jvmdi_interface->IsMethodNative(a1, a2, a3) )
00988 #define JVMDI_GetLoadedClasses(a_env, a1, a2) ( \
00989 SetJVMDIfromJNIEnv(a_env), \
00990 jvmdi_interface->GetLoadedClasses(a1, a2) )
00991 #define JVMDI_GetClassLoaderClasses(a_env, a1, a2, a3) ( \
00992 SetJVMDIfromJNIEnv(a_env), \
00993 jvmdi_interface->GetClassLoaderClasses(a1, a2, a3) )
00994 #define JVMDI_GetVersionNumber(a_env, a1) ( \
00995 SetJVMDIfromJNIEnv(a_env), \
00996 jvmdi_interface->GetVersionNumber(a1) )
00997
00998 #endif
00999
01000 #ifdef __cplusplus
01001 }
01002 #endif
01003
01004 #endif
01005
01006