jvmti.h 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820
  1. /* jvmti.h - Java Virtual Machine Tool Interface
  2. Copyright (C) 2006 Free Software Foundation
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. /* Note: this file must be compilable by the C compiler (for now,
  32. assuming GNU C is ok). This means you must never use `//'
  33. comments, and all C++-specific code must be conditional on
  34. __cplusplus. */
  35. #ifndef _CLASSPATH_JVMTI_H
  36. #define _CLASSPATH_JVMTI_H
  37. #include <jni.h>
  38. #include "jvmti_md.h"
  39. /* The VM might define JVMTI base types */
  40. #ifndef _CLASSPATH_VM_JVMTI_TYPES_DEFINED
  41. typedef jobject jthread;
  42. typedef jobject jthreadGroup;
  43. typedef jlong jlocation;
  44. typedef struct _Jv_rawMonitorID *jrawMonitorID;
  45. #endif /* !_CLASSPATH_VM_JVMTI_TYPES_DEFINED */
  46. /* JVMTI Version */
  47. #define JVMTI_VERSION_1_0 0x30010000
  48. #define JVMTI_VERSION (JVMTI_VERSION_1_0 + 38) /* Spec version is 1.0.38 */
  49. #ifdef __cplusplus
  50. extern "C"
  51. {
  52. #endif
  53. /* These functions might be defined in libraries which we load; the
  54. JVMTI implementation calls them at the appropriate times. */
  55. extern JNIEXPORT jint JNICALL Agent_OnLoad (JavaVM *vm, char *options,
  56. void *reserved);
  57. extern JNIEXPORT void JNICALL Agent_OnUnload (JavaVM *vm);
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. /* Forward declarations */
  62. typedef struct _jvmtiAddrLocationMap jvmtiAddrLocationMap;
  63. #ifdef __cplusplus
  64. typedef struct _Jv_JVMTIEnv jvmtiEnv;
  65. #else
  66. typedef const struct _Jv_jvmtiEnv *jvmtiEnv;
  67. #endif
  68. /*
  69. * Error constants
  70. */
  71. typedef enum
  72. {
  73. /* Universal Errors */
  74. JVMTI_ERROR_NONE = 0,
  75. JVMTI_ERROR_NULL_POINTER = 100,
  76. JVMTI_ERROR_OUT_OF_MEMORY = 110,
  77. JVMTI_ERROR_ACCESS_DENIED = 111,
  78. JVMTI_ERROR_WRONG_PHASE = 112,
  79. JVMTI_ERROR_INTERNAL = 113,
  80. JVMTI_ERROR_UNATTACHED_THREAD = 115,
  81. JVMTI_ERROR_INVALID_ENVIRONMENT = 116,
  82. /* Function-specific Required Errors */
  83. JVMTI_ERROR_INVALID_PRIORITY = 12,
  84. JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13,
  85. JVMTI_ERROR_THREAD_SUSPENDED = 14,
  86. JVMTI_ERROR_THREAD_NOT_ALIVE = 15,
  87. JVMTI_ERROR_CLASS_NOT_PREPARED = 22,
  88. JVMTI_ERROR_NO_MORE_FRAMES = 31,
  89. JVMTI_ERROR_OPAQUE_FRAME = 32,
  90. JVMTI_ERROR_DUPLICATE = 40,
  91. JVMTI_ERROR_NOT_FOUND = 41,
  92. JVMTI_ERROR_NOT_MONITOR_OWNER = 51,
  93. JVMTI_ERROR_INTERRUPT = 52,
  94. JVMTI_ERROR_UNMODIFIABLE_CLASS = 79,
  95. JVMTI_ERROR_NOT_AVAILABLE = 98,
  96. JVMTI_ERROR_ABSENT_INFORMATION = 101,
  97. JVMTI_ERROR_INVALID_EVENT_TYPE = 102,
  98. JVMTI_ERROR_NATIVE_METHOD = 104,
  99. /* Function-specific Agent Errors */
  100. JVMTI_ERROR_INVALID_THREAD = 10,
  101. JVMTI_ERROR_INVALID_THREAD_GROUP = 11,
  102. JVMTI_ERROR_INVALID_OBJECT = 20,
  103. JVMTI_ERROR_INVALID_CLASS = 21,
  104. JVMTI_ERROR_INVALID_METHODID = 23,
  105. JVMTI_ERROR_INVALID_LOCATION = 24,
  106. JVMTI_ERROR_INVALID_FIELDID = 25,
  107. JVMTI_ERROR_TYPE_MISMATCH = 34,
  108. JVMTI_ERROR_INVALID_SLOT = 35,
  109. JVMTI_ERROR_INVALID_MONITOR = 50,
  110. JVMTI_ERROR_INVALID_CLASS_FORMAT = 60,
  111. JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61,
  112. JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63,
  113. JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64,
  114. JVMTI_ERROR_INVALID_TYPESTATE = 65,
  115. JVMTI_ERROR_FAILS_VERIFICATION = 62,
  116. JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66,
  117. JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67,
  118. JVMTI_ERROR_UNSUPPORTED_VERSION = 68,
  119. JVMTI_ERROR_NAMES_DONT_MATCH = 69,
  120. JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70,
  121. JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71,
  122. JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99,
  123. JVMTI_ERROR_ILLEGAL_ARGUMENT = 103
  124. } jvmtiError;
  125. /*
  126. * Enumeration Definitions
  127. */
  128. typedef enum
  129. {
  130. JVMTI_DISABLE = 0,
  131. JVMTI_ENABLE = 1
  132. } jvmtiEventMode;
  133. typedef enum
  134. {
  135. JVMTI_HEAP_OBJECT_TAGGED = 1,
  136. JVMTI_HEAP_OBJECT_UNTAGGED = 2,
  137. JVMTI_HEAP_OBJECT_EITHER = 3
  138. } jvmtiHeapObjectFilter;
  139. typedef enum
  140. {
  141. JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
  142. JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
  143. JVMTI_HEAP_ROOT_MONITOR = 3,
  144. JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
  145. JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
  146. JVMTI_HEAP_ROOT_THREAD = 6,
  147. JVMTI_HEAP_ROOT_OTHER = 7
  148. } jvmtiHeapRootKind;
  149. typedef enum
  150. {
  151. JVMTI_ITERATION_ABORT = 0,
  152. JVMTI_ITERATION_CONTINUE = 1,
  153. JVMTI_ITERATION_IGNORE = 2
  154. } jvmtiIterationControl;
  155. typedef enum
  156. {
  157. JVMTI_JLOCATION_OTHER = 0,
  158. JVMTI_JLOCATION_JVMBCI = 1,
  159. JVMTI_JLOCATION_MACHINEPC = 2
  160. } jvmtiJlocationFormat;
  161. typedef enum
  162. {
  163. JVMTI_REFERENCE_CLASS = 1,
  164. JVMTI_REFERENCE_FIELD = 2,
  165. JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
  166. JVMTI_REFERENCE_CLASS_LOADER = 4,
  167. JVMTI_REFERENCE_SIGNERS = 5,
  168. JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
  169. JVMTI_REFERENCE_INTERFACE = 7,
  170. JVMTI_REFERENCE_STATIC_FIELD = 8,
  171. JVMTI_REFERENCE_CONSTANT_POOL = 9
  172. } jvmtiObjectReferenceKind;
  173. typedef enum
  174. {
  175. JVMTI_KIND_IN = 91,
  176. JVMTI_KIND_IN_PTR = 92,
  177. JVMTI_KIND_IN_BUF = 93,
  178. JVMTI_KIND_ALLOC_BUF = 94,
  179. JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
  180. JVMTI_KIND_OUT = 96,
  181. JVMTI_KIND_OUT_BUF = 97
  182. } jvmtiParamKind;
  183. typedef enum
  184. {
  185. JVMTI_TYPE_JBYTE = 101,
  186. JVMTI_TYPE_JCHAR = 102,
  187. JVMTI_TYPE_JSHORT = 103,
  188. JVMTI_TYPE_JINT = 104,
  189. JVMTI_TYPE_JLONG = 105,
  190. JVMTI_TYPE_JFLOAT = 106,
  191. JVMTI_TYPE_JDOUBLE = 107,
  192. JVMTI_TYPE_JBOOLEAN = 108,
  193. JVMTI_TYPE_JOBJECT = 109,
  194. JVMTI_TYPE_JTHREAD = 110,
  195. JVMTI_TYPE_JCLASS = 111,
  196. JVMTI_TYPE_JVALUE = 112,
  197. JVMTI_TYPE_JFIELDID = 113,
  198. JVMTI_TYPE_JMETHODID = 114,
  199. JVMTI_TYPE_CCHAR = 115,
  200. JVMTI_TYPE_CVOID = 116,
  201. JVMTI_TYPE_JNIENV = 117
  202. } jvmtiParamTypes;
  203. typedef enum
  204. {
  205. JVMTI_PHASE_ONLOAD = 1,
  206. JVMTI_PHASE_PRIMORDIAL = 2,
  207. JVMTI_PHASE_LIVE = 4,
  208. JVMTI_PHASE_START = 6,
  209. JVMTI_PHASE_DEAD = 8
  210. } jvmtiPhase;
  211. typedef enum
  212. {
  213. JVMTI_TIMER_USER_CPU = 30,
  214. JVMTI_TIMER_TOTAL_CPU = 31,
  215. JVMTI_TIMER_ELAPSED = 32
  216. } jvmtiTimerKind;
  217. typedef enum
  218. {
  219. JVMTI_VERBOSE_OTHER = 0,
  220. JVMTI_VERBOSE_GC = 1,
  221. JVMTI_VERBOSE_CLASS = 2,
  222. JVMTI_VERBOSE_JNI = 4
  223. } jvmtiVerboseFlag;
  224. /* Version information */
  225. #define JVMTI_VERSION_INTERFACE_JNI 0x00000000
  226. #define JVMTI_VERSION_INTERFACE_JVMTI 0x30000000
  227. #define JVMTI_VERSION_MASK_INTERFACE_TYPE 0x70000000
  228. #define JVMTI_VERSION_MASK_MAJOR 0x0FFF0000
  229. #define JVMTI_VERSION_MASK_MINOR 0x0000FF00
  230. #define JVMTI_VERSION_MASK_MICRO 0x000000FF
  231. #define JVMTI_VERSION_SHIFT_MAJOR 16
  232. #define JVMTI_VERSION_SHIFT_MINOR 8
  233. #define JVMTI_VERSION_SHIFT_MICRO 0
  234. /*
  235. * Events and event callbacks
  236. */
  237. typedef enum
  238. {
  239. JVMTI_EVENT_VM_INIT = 50,
  240. JVMTI_EVENT_VM_DEATH = 51,
  241. JVMTI_EVENT_THREAD_START = 52,
  242. JVMTI_EVENT_THREAD_END = 53,
  243. JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
  244. JVMTI_EVENT_CLASS_LOAD = 55,
  245. JVMTI_EVENT_CLASS_PREPARE = 56,
  246. JVMTI_EVENT_VM_START = 57,
  247. JVMTI_EVENT_EXCEPTION = 58,
  248. JVMTI_EVENT_EXCEPTION_CATCH = 59,
  249. JVMTI_EVENT_SINGLE_STEP = 60,
  250. JVMTI_EVENT_FRAME_POP = 61,
  251. JVMTI_EVENT_BREAKPOINT = 62,
  252. JVMTI_EVENT_FIELD_ACCESS = 63,
  253. JVMTI_EVENT_FIELD_MODIFICATION = 64,
  254. JVMTI_EVENT_METHOD_ENTRY = 65,
  255. JVMTI_EVENT_METHOD_EXIT = 66,
  256. JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
  257. JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
  258. JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
  259. JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
  260. JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
  261. JVMTI_EVENT_MONITOR_WAIT = 73,
  262. JVMTI_EVENT_MONITOR_WAITED = 74,
  263. JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
  264. JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
  265. JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
  266. JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
  267. JVMTI_EVENT_OBJECT_FREE = 83,
  268. JVMTI_EVENT_VM_OBJECT_ALLOC = 84
  269. } jvmtiEvent;
  270. typedef void *jvmtiEventReserved;
  271. typedef void (JNICALL *jvmtiEventSingleStep)
  272. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  273. jlocation location);
  274. typedef void (JNICALL *jvmtiEventBreakpoint)
  275. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  276. jlocation location);
  277. typedef void (JNICALL *jvmtiEventFieldAccess)
  278. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  279. jlocation location, jclass field_klass, jobject object, jfieldID field);
  280. typedef void (JNICALL *jvmtiEventFieldModification)
  281. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  282. jlocation location, jclass field_klass, jobject object, jfieldID field,
  283. char signature_type, jvalue new_value);
  284. typedef void (JNICALL *jvmtiEventFramePop)
  285. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  286. jboolean was_popped_by_exception);
  287. typedef void (JNICALL *jvmtiEventMethodEntry)
  288. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method);
  289. typedef void (JNICALL *jvmtiEventMethodExit)
  290. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  291. jboolean was_popped_by_exception, jvalue return_value);
  292. typedef void (JNICALL *jvmtiEventNativeMethodBind)
  293. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  294. void *address, void **new_address_ptr);
  295. typedef void (JNICALL *jvmtiEventException)
  296. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  297. jlocation location, jobject exception, jmethodID catch_method,
  298. jlocation catch_location);
  299. typedef void (JNICALL *jvmtiEventExceptionCatch)
  300. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jmethodID method,
  301. jlocation location, jobject exception);
  302. typedef void (JNICALL *jvmtiEventThreadStart)
  303. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread);
  304. typedef void (JNICALL *jvmtiEventThreadEnd)
  305. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread);
  306. typedef void (JNICALL *jvmtiEventClassLoad)
  307. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jclass klass);
  308. typedef void (JNICALL *jvmtiEventClassPrepare)
  309. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thraed, jclass klass);
  310. typedef void (JNICALL *jvmtiEventClassFileLoadHook)
  311. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jclass class_being_redefined,
  312. jobject loader, const char *name, jobject protection_domain,
  313. jint class_data_len, const unsigned char *class_data,
  314. jint *new_class_data_len, unsigned char **new_class_data);
  315. typedef void (JNICALL *jvmtiEventVMStart)
  316. (jvmtiEnv *jvmti_env, JNIEnv *jni_env);
  317. typedef void (JNICALL *jvmtiEventVMInit)
  318. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread);
  319. typedef void (JNICALL *jvmtiEventVMDeath)
  320. (jvmtiEnv *jvmti_env, JNIEnv *jni_env);
  321. typedef void (JNICALL *jvmtiEventCompiledMethodLoad)
  322. (jvmtiEnv *jvmti_env, jmethodID method, jint code_size,
  323. const void *code_addr, jint map_length, const jvmtiAddrLocationMap *map,
  324. const void *compile_info);
  325. typedef void (JNICALL *jvmtiEventCompiledMethodUnload)
  326. (jvmtiEnv *jvmti_env, jmethodID method, const void *code_addr);
  327. typedef void (JNICALL *jvmtiEventDynamicCodeGenerated)
  328. (jvmtiEnv *jvmti_env, const char *name, const void *address, jint length);
  329. typedef void (JNICALL *jvmtiEventDataDumpRequest)
  330. (jvmtiEnv *jvmti_env);
  331. typedef void (JNICALL *jvmtiEventMonitorContendedEnter)
  332. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object);
  333. typedef void (JNICALL *jvmtiEventMonitorContendedEntered)
  334. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object);
  335. typedef void (JNICALL *jvmtiEventMonitorWait)
  336. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object,
  337. jlong timeout);
  338. typedef void (JNICALL *jvmtiEventMonitorWaited)
  339. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object,
  340. jboolean timed_out);
  341. typedef void (JNICALL *jvmtiEventVMObjectAlloc)
  342. (jvmtiEnv *jvmti_env, JNIEnv *jni_env, jthread thread, jobject object,
  343. jclass object_klass, jlong size);
  344. typedef void (JNICALL *jvmtiEventObjectFree)
  345. (jvmtiEnv *jvmti_env, jlong tag);
  346. typedef void (JNICALL *jvmtiEventGarbageCollectionStart)
  347. (jvmtiEnv *jvmti_env);
  348. typedef void (JNICALL *jvmtiEventGarbageCollectionFinish)
  349. (jvmtiEnv *jvmti_env);
  350. typedef struct
  351. {
  352. jvmtiEventVMInit VMInit;
  353. jvmtiEventVMDeath VMDeath;
  354. jvmtiEventThreadStart ThreadStart;
  355. jvmtiEventThreadEnd ThreadEnd;
  356. jvmtiEventClassFileLoadHook ClassFileLoadHook;
  357. jvmtiEventClassLoad ClassLoad;
  358. jvmtiEventClassPrepare ClassPrepare;
  359. jvmtiEventVMStart VMStart;
  360. jvmtiEventException Exception;
  361. jvmtiEventExceptionCatch ExceptionCatch;
  362. jvmtiEventSingleStep SingleStep;
  363. jvmtiEventFramePop FramePop;
  364. jvmtiEventBreakpoint Breakpoint;
  365. jvmtiEventFieldAccess FieldAccess;
  366. jvmtiEventFieldModification FieldModification;
  367. jvmtiEventMethodEntry MethodEntry;
  368. jvmtiEventMethodExit MethodExit;
  369. jvmtiEventNativeMethodBind NativeMethodBind;
  370. jvmtiEventCompiledMethodLoad CompiledMethodLoad;
  371. jvmtiEventCompiledMethodUnload CompiledMethodUnload;
  372. jvmtiEventDynamicCodeGenerated DynamicCodeGenerated;
  373. jvmtiEventDataDumpRequest DataDumpRequest;
  374. jvmtiEventReserved reserved72;
  375. jvmtiEventMonitorWait MonitorWait;
  376. jvmtiEventMonitorWaited MonitorWaited;
  377. jvmtiEventMonitorContendedEnter MonitorContendedEnter;
  378. jvmtiEventMonitorContendedEntered MonitorContendedEntered;
  379. jvmtiEventReserved reserved77;
  380. jvmtiEventReserved reserved78;
  381. jvmtiEventReserved reserved79;
  382. jvmtiEventReserved reserved80;
  383. jvmtiEventGarbageCollectionStart GarbageCollectionStart;
  384. jvmtiEventGarbageCollectionFinish GarbageCollectionFinish;
  385. jvmtiEventObjectFree ObjectFree;
  386. jvmtiEventVMObjectAlloc VMObjectAlloc;
  387. } jvmtiEventCallbacks;
  388. /*
  389. * Function and Structure Type Definitions
  390. */
  391. struct _jvmtiAddrLocationMap
  392. {
  393. const void *start_address;
  394. jlocation location;
  395. };
  396. typedef struct
  397. {
  398. unsigned int can_tag_objects : 1;
  399. unsigned int can_generate_field_modification_events : 1;
  400. unsigned int can_generate_field_access_events : 1;
  401. unsigned int can_get_bytecodes : 1;
  402. unsigned int can_get_synthetic_attribute : 1;
  403. unsigned int can_get_owned_monitor_info : 1;
  404. unsigned int can_get_current_contended_monitor : 1;
  405. unsigned int can_get_monitor_info : 1;
  406. unsigned int can_pop_frame : 1;
  407. unsigned int can_redefine_classes : 1;
  408. unsigned int can_signal_thread : 1;
  409. unsigned int can_get_source_file_name : 1;
  410. unsigned int can_get_line_numbers : 1;
  411. unsigned int can_get_source_debug_extension : 1;
  412. unsigned int can_access_local_variables : 1;
  413. unsigned int can_maintain_original_method_order : 1;
  414. unsigned int can_generate_single_step_events : 1;
  415. unsigned int can_generate_exception_events : 1;
  416. unsigned int can_generate_frame_pop_events : 1;
  417. unsigned int can_generate_breakpoint_events : 1;
  418. unsigned int can_suspend : 1;
  419. unsigned int can_redefine_any_class : 1;
  420. unsigned int can_get_current_thread_cpu_time : 1;
  421. unsigned int can_get_thread_cpu_time : 1;
  422. unsigned int can_generate_method_entry_events : 1;
  423. unsigned int can_generate_method_exit_events : 1;
  424. unsigned int can_generate_all_class_hook_events : 1;
  425. unsigned int can_generate_compiled_method_load_events : 1;
  426. unsigned int can_generate_monitor_events : 1;
  427. unsigned int can_generate_vm_object_alloc_events : 1;
  428. unsigned int can_generate_native_method_bind_events : 1;
  429. unsigned int can_generate_garbage_collection_events : 1;
  430. unsigned int can_generate_object_free_events : 1;
  431. unsigned int : 15;
  432. unsigned int : 16;
  433. unsigned int : 16;
  434. unsigned int : 16;
  435. unsigned int : 16;
  436. unsigned int : 16;
  437. } jvmtiCapabilities;
  438. typedef struct
  439. {
  440. jclass klass;
  441. jint class_byte_count;
  442. const unsigned char *class_bytes;
  443. } jvmtiClassDefinition;
  444. typedef struct
  445. {
  446. char *name;
  447. jvmtiParamKind kind;
  448. jvmtiParamTypes base_type;
  449. jboolean null_ok;
  450. } jvmtiParamInfo;
  451. typedef struct
  452. {
  453. jint extension_event_index;
  454. char *id;
  455. char *short_description;
  456. jint param_count;
  457. jvmtiParamInfo* params;
  458. } jvmtiExtensionEventInfo;
  459. typedef jvmtiError (JNICALL *jvmtiExtensionFunction)
  460. (jvmtiEnv *jvmti_enf, ...);
  461. typedef struct
  462. {
  463. jvmtiExtensionFunction func;
  464. char *id;
  465. char *short_description;
  466. jint param_count;
  467. jvmtiParamInfo *params;
  468. jint error_count;
  469. jvmtiError *errors;
  470. } jvmtiExtensionFunctionInfo;
  471. typedef struct
  472. {
  473. jmethodID method;
  474. jlocation location;
  475. } jvmtiFrameInfo;
  476. typedef struct
  477. {
  478. jlocation start_location;
  479. jint line_number;
  480. } jvmtiLineNumberEntry;
  481. typedef struct
  482. {
  483. jlocation start_location;
  484. jint length;
  485. char *name;
  486. char *signature;
  487. char *generic_signature;
  488. jint slot;
  489. } jvmtiLocalVariableEntry;
  490. typedef struct
  491. {
  492. jthread owner;
  493. jint entry_count;
  494. jint waiter_count;
  495. jthread *waiters;
  496. jint notify_waiter_count;
  497. jthread *notify_waiters;
  498. } jvmtiMonitorUsage;
  499. typedef struct
  500. {
  501. jthread thread;
  502. jint state;
  503. jvmtiFrameInfo *frame_buffer;
  504. jint frame_count;
  505. } jvmtiStackInfo;
  506. typedef struct
  507. {
  508. jthreadGroup parent;
  509. char *name;
  510. jint max_priority;
  511. jboolean is_daemon;
  512. } jvmtiThreadGroupInfo;
  513. typedef struct
  514. {
  515. char *name;
  516. jint priority;
  517. jboolean is_daemon;
  518. jthreadGroup thread_group;
  519. jobject context_class_loader;
  520. } jvmtiThreadInfo;
  521. typedef struct
  522. {
  523. jlong max_value;
  524. jboolean may_skip_forward;
  525. jboolean may_skip_backward;
  526. jvmtiTimerKind kind;
  527. jlong reserved1;
  528. jlong reserved2;
  529. } jvmtiTimerInfo;
  530. typedef void (JNICALL *jvmtiExtensionEvent)
  531. (jvmtiEnv *jvmti_env, ...);
  532. typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
  533. (jlong class_tag, jlong size, jlong *tag_ptr, void *user_data);
  534. typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback)
  535. (jvmtiHeapRootKind root_kind, jlong class_tag, jlong size, jlong *tag_ptr,
  536. void *user_data);
  537. typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback)
  538. (jvmtiObjectReferenceKind reference_kind, jlong class_tag, jlong size,
  539. jlong *tag_ptr, jlong referrer_tag, jint referrer_index, void *user_data);
  540. typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback)
  541. (jvmtiHeapRootKind root_kind, jlong class_tag, jlong size, jlong *tag_ptr,
  542. jlong thread_tag, jint depth, jmethodID method, jint slot, void *user_data);
  543. typedef void (JNICALL *jvmtiStartFunction)
  544. (jvmtiEnv *env, JNIEnv *jni_env, void *arg);
  545. /*
  546. * JVM Tool Interface Base Types
  547. */
  548. typedef struct JNINativeInterface_ jniNativeInterface;
  549. struct _Jv_jvmtiEnv
  550. {
  551. void *reserved1;
  552. jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv *env,
  553. jvmtiEventMode mode,
  554. jvmtiEvent event_type,
  555. jthread event_thread, ...);
  556. void *reserved3;
  557. jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv *env,
  558. jint *threads_count_ptr,
  559. jthread **threads_ptr);
  560. jvmtiError (JNICALL *SuspendThread) (jvmtiEnv *env,
  561. jthread thread);
  562. jvmtiError (JNICALL *ResumeThread) (jvmtiEnv *env,
  563. jthread thread);
  564. jvmtiError (JNICALL *StopThread) (jvmtiEnv *env,
  565. jthread thread,
  566. jobject exception);
  567. jvmtiError (JNICALL *InterruptThread) (jvmtiEnv *env,
  568. jthread thread);
  569. jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv *env,
  570. jthread thread,
  571. jvmtiThreadInfo *info_ptr);
  572. jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv *env,
  573. jthread thread,
  574. jint *owned_monitor_count_ptr,
  575. jobject **owned_monitors_ptr);
  576. jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv *env,
  577. jthread thread,
  578. jobject *monitor_ptr);
  579. jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv *env,
  580. jthread thread,
  581. jvmtiStartFunction proc,
  582. const void *arg,
  583. jint priority);
  584. jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv *env,
  585. jint *group_count_ptr,
  586. jthreadGroup **groups_ptr);
  587. jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv *env,
  588. jthreadGroup group,
  589. jvmtiThreadGroupInfo *info_ptr);
  590. jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv *env,
  591. jthreadGroup group,
  592. jint *thread_count_ptr,
  593. jthread **threads_ptr,
  594. jint *group_count_ptr,
  595. jthreadGroup **groups_ptr);
  596. jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv *env,
  597. jthread thread,
  598. jint *count_ptr);
  599. jvmtiError (JNICALL *GetThreadState) (jvmtiEnv *env,
  600. jthread thread,
  601. jint *thread_state_ptr);
  602. void *reserved18;
  603. jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv *env,
  604. jthread thread,
  605. jint depth,
  606. jmethodID *method_ptr,
  607. jlocation *location_ptr);
  608. jvmtiError (JNICALL *NotifyPopFrame) (jvmtiEnv *env,
  609. jthread thread,
  610. jint depth);
  611. jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv *env,
  612. jthread thread,
  613. jint depth,
  614. jint slot,
  615. jobject *value_ptr);
  616. jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv *env,
  617. jthread thread,
  618. jint depth,
  619. jint slot,
  620. jint *value_ptr);
  621. jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv *env,
  622. jthread thread,
  623. jint depth,
  624. jint slot,
  625. jlong *value_ptr);
  626. jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv *env,
  627. jthread thread,
  628. jint depth,
  629. jint slot,
  630. jfloat *value_ptr);
  631. jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv *env,
  632. jthread thread,
  633. jint depth,
  634. jint slot,
  635. jdouble *value_ptr);
  636. jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv *env,
  637. jthread thread,
  638. jint depth,
  639. jint slot,
  640. jobject value);
  641. jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv *env,
  642. jthread thread,
  643. jint depth,
  644. jint slot,
  645. jint value);
  646. jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv *env,
  647. jthread thread,
  648. jint depth,
  649. jint slot,
  650. jlong value);
  651. jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv *env,
  652. jthread thread,
  653. jint depth,
  654. jint slot,
  655. jfloat value);
  656. jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv *env,
  657. jthread thread,
  658. jint depth,
  659. jint slot,
  660. jdouble value);
  661. jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv *env,
  662. const char *name,
  663. jrawMonitorID *monitor_ptr);
  664. jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv *env,
  665. jrawMonitorID monitor);
  666. jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv *env,
  667. jrawMonitorID monitor);
  668. jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv *env,
  669. jrawMonitorID monitor);
  670. jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv *env,
  671. jrawMonitorID monitor,
  672. jlong millis);
  673. jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv *env,
  674. jrawMonitorID monitor);
  675. jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv *env,
  676. jrawMonitorID monitor);
  677. jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv *env,
  678. jmethodID method,
  679. jlocation location);
  680. jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv *env,
  681. jmethodID method,
  682. jlocation location);
  683. void *reserved40;
  684. jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv *env,
  685. jclass klass,
  686. jfieldID field);
  687. jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv *env,
  688. jclass klass,
  689. jfieldID field);
  690. jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv *env,
  691. jclass klass,
  692. jfieldID field);
  693. jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv *env,
  694. jclass klass,
  695. jfieldID field);
  696. void *reserved45;
  697. jvmtiError (JNICALL *Allocate) (jvmtiEnv *env,
  698. jlong size,
  699. unsigned char **mem_ptr);
  700. jvmtiError (JNICALL *Deallocate) (jvmtiEnv *env,
  701. unsigned char *mem);
  702. jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv *env,
  703. jclass klass,
  704. char **signature_ptr,
  705. char **generic_ptr);
  706. jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv *env,
  707. jclass klass,
  708. jint *status_ptr);
  709. jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv *env,
  710. jclass klass,
  711. char **source_name_ptr);
  712. jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv *env,
  713. jclass klass,
  714. jint *modifiers_ptr);
  715. jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv *env,
  716. jclass klass,
  717. jint *method_count_ptr,
  718. jmethodID **methods_ptr);
  719. jvmtiError (JNICALL *GetClassFields) (jvmtiEnv *env,
  720. jclass klass,
  721. jint *field_count_ptr,
  722. jfieldID **fields_ptr);
  723. jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv *env,
  724. jclass klass,
  725. jint *interface_count_ptr,
  726. jclass **interfaces_ptr);
  727. jvmtiError (JNICALL *IsInterface) (jvmtiEnv *env,
  728. jclass klass,
  729. jboolean *is_interface_ptr);
  730. jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv *env,
  731. jclass klass,
  732. jboolean *is_array_class_ptr);
  733. jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv *env,
  734. jclass klass,
  735. jobject *classloader_ptr);
  736. jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv *env,
  737. jobject object,
  738. jint *hash_code_ptr);
  739. jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv *env,
  740. jobject object,
  741. jvmtiMonitorUsage *info_ptr);
  742. jvmtiError (JNICALL *GetFieldName) (jvmtiEnv *env,
  743. jclass klass,
  744. jfieldID field,
  745. char **name_ptr,
  746. char **signature_ptr,
  747. char **generic_ptr);
  748. jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv *env,
  749. jclass klass,
  750. jfieldID field,
  751. jclass *declaring_class_ptr);
  752. jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv *env,
  753. jclass klass,
  754. jfieldID field,
  755. jint *modifiers_ptr);
  756. jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv *env,
  757. jclass klass,
  758. jfieldID field,
  759. jboolean *is_synthetic_ptr);
  760. jvmtiError (JNICALL *GetMethodName) (jvmtiEnv *env,
  761. jmethodID method,
  762. char **name_ptr,
  763. char **signature_ptr,
  764. char **generic_ptr);
  765. jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv *env,
  766. jmethodID method,
  767. jclass *declaring_class_ptr);
  768. jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv *env,
  769. jmethodID method,
  770. jint *modifiers_ptr);
  771. void *reserved67;
  772. jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv *env,
  773. jmethodID method,
  774. jint *max_ptr);
  775. jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv *env,
  776. jmethodID method,
  777. jint *size_ptr);
  778. jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv *env,
  779. jmethodID method,
  780. jint *entry_count_ptr,
  781. jvmtiLineNumberEntry **table_ptr);
  782. jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv *env,
  783. jmethodID method,
  784. jlocation *start_location_ptr,
  785. jlocation *end_location_ptr);
  786. jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv *env,
  787. jmethodID method,
  788. jint *entry_count_ptr,
  789. jvmtiLocalVariableEntry **table_ptr);
  790. void *reserved73;
  791. void *reserved74;
  792. jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv *env,
  793. jmethodID method,
  794. jint *bytecode_count_ptr,
  795. unsigned char **bytecodes_ptr);
  796. jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv *env,
  797. jmethodID method,
  798. jboolean *is_native_ptr);
  799. jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv *env,
  800. jmethodID method,
  801. jboolean *is_synthetic_ptr);
  802. jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv *env,
  803. jint *class_count_ptr,
  804. jclass **classes_ptr);
  805. jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv *env,
  806. jobject initiating_loader,
  807. jint *class_count_ptr,
  808. jclass **classes_ptr);
  809. jvmtiError (JNICALL *PopFrame) (jvmtiEnv *env,
  810. jthread thread);
  811. void *reserved81;
  812. void *reserved82;
  813. void *reserved83;
  814. void *reserved84;
  815. void *reserved85;
  816. void *reserved86;
  817. jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv *env,
  818. jint class_count,
  819. const jvmtiClassDefinition* class_definitions);
  820. jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv *env,
  821. jint *version_ptr);
  822. jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv *env,
  823. jvmtiCapabilities *capabilities_ptr);
  824. jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv *env,
  825. jclass klass,
  826. char **source_debug_extension_ptr);
  827. jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv *env,
  828. jmethodID method,
  829. jboolean *is_obsolete_ptr);
  830. jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv *env,
  831. jint request_count,
  832. const jthread *request_list,
  833. jvmtiError *results);
  834. jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv *env,
  835. jint request_count,
  836. const jthread *request_list,
  837. jvmtiError *results);
  838. void *reserved94;
  839. void *reserved95;
  840. void *reserved96;
  841. void *reserved97;
  842. void *reserved98;
  843. void *reserved99;
  844. jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv *env,
  845. jint max_frame_count,
  846. jvmtiStackInfo **stack_info_ptr,
  847. jint *thread_count_ptr);
  848. jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv *env,
  849. jint thread_count,
  850. const jthread *thread_list,
  851. jint max_frame_count,
  852. jvmtiStackInfo **stack_info_ptr);
  853. jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv *env,
  854. jthread thread,
  855. void **data_ptr);
  856. jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv *env,
  857. jthread thread,
  858. const void *data);
  859. jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv *env,
  860. jthread thread,
  861. jint start_depth,
  862. jint max_frame_count,
  863. jvmtiFrameInfo *frame_buffer,
  864. jint *count_ptr);
  865. void *reserved105;
  866. jvmtiError (JNICALL *GetTag) (jvmtiEnv *env,
  867. jobject object,
  868. jlong *tag_ptr);
  869. jvmtiError (JNICALL *SetTag) (jvmtiEnv *env,
  870. jobject object,
  871. jlong tag);
  872. jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv *env);
  873. jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv *env,
  874. jobject object,
  875. jvmtiObjectReferenceCallback object_reference_callback,
  876. void *user_data);
  877. jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv *env,
  878. jvmtiHeapRootCallback heap_root_callback,
  879. jvmtiStackReferenceCallback stack_ref_callback,
  880. jvmtiObjectReferenceCallback object_ref_callback,
  881. void *user_data);
  882. jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv *env,
  883. jvmtiHeapObjectFilter object_filter,
  884. jvmtiHeapObjectCallback heap_object_callback,
  885. void *user_data);
  886. jvmtiError (JNICALL *IterateOverInstanceOfClass) (jvmtiEnv *env,
  887. jclass klass,
  888. jvmtiHeapObjectFilter object_filter,
  889. jvmtiHeapObjectCallback heap_object_callback,
  890. void *user_data);
  891. void *reserved113;
  892. jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv *env,
  893. jint tag_count,
  894. const jlong *tags,
  895. jint *count_ptr,
  896. jobject **object_result_ptr,
  897. jlong **tag_result_ptr);
  898. void *reserved115;
  899. void *reserved116;
  900. void *reserved117;
  901. void *reserved118;
  902. void *reserved119;
  903. jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv *env,
  904. const jniNativeInterface *function_table);
  905. jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv *env,
  906. jniNativeInterface **function_table_ptr);
  907. jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv *env,
  908. const jvmtiEventCallbacks *callbacks,
  909. jint size_of_callbacks);
  910. jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv *env,
  911. jvmtiEvent event_type);
  912. jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv *env,
  913. jint *extension_count_ptr,
  914. jvmtiExtensionFunctionInfo **extensions);
  915. jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv *env,
  916. jint *extension_count_ptr,
  917. jvmtiExtensionEventInfo **extensions);
  918. jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv *env,
  919. jint extension_event_index,
  920. jvmtiExtensionEvent callback);
  921. jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv *env);
  922. jvmtiError (JNICALL *GetErrorName) (jvmtiEnv *env,
  923. jvmtiError error,
  924. char **name_ptr);
  925. jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv *env,
  926. jvmtiJlocationFormat *format_ptr);
  927. jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv *env,
  928. jint *count_ptr,
  929. char ***property_ptr);
  930. jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv *env,
  931. const char *property,
  932. char **value_ptr);
  933. jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv *env,
  934. const char *property,
  935. const char *value);
  936. jvmtiError (JNICALL *GetPhase) (jvmtiEnv *env,
  937. jvmtiPhase *phase_ptr);
  938. jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv *env,
  939. jvmtiTimerInfo *info_ptr);
  940. jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv *env,
  941. jlong *nanos_ptr);
  942. jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv *env,
  943. jvmtiTimerInfo *info_ptr);
  944. jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv *env,
  945. jthread thread,
  946. jlong *nanos_ptr);
  947. jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv *env,
  948. jvmtiTimerInfo *info_ptr);
  949. jvmtiError (JNICALL *GetTime) (jvmtiEnv *env,
  950. jlong *nanos_ptr);
  951. jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv *env,
  952. jvmtiCapabilities *capabilities_ptr);
  953. void *reserved141;
  954. jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv *env,
  955. const jvmtiCapabilities *capabilities_ptr);
  956. jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv *env,
  957. const jvmtiCapabilities *capabilities_ptr);
  958. jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv *env,
  959. jint *processor_count_ptr);
  960. void *reserved145;
  961. void *reserved146;
  962. jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv *env,
  963. void **data_ptr);
  964. jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv *env,
  965. const void *data);
  966. jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv *env,
  967. const char *segment);
  968. jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv *env,
  969. jvmtiVerboseFlag flag,
  970. jboolean value);
  971. void *reserved151;
  972. void *reserved152;
  973. void *reserved153;
  974. jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv *env,
  975. jobject object,
  976. jlong *size_ptr);
  977. };
  978. #ifdef __cplusplus
  979. class _Jv_JVMTIEnv
  980. {
  981. public:
  982. /* Method table */
  983. struct _Jv_jvmtiEnv *p;
  984. #ifdef _CLASSPATH_JVMTIENV_CONTENTS
  985. _CLASSPATH_JVMTIENV_CONTENTS
  986. #endif
  987. jvmtiError SetEventNotificationMode (jvmtiEventMode mode,
  988. jvmtiEvent event_type,
  989. jthread event_thread, ...)
  990. {
  991. va_list args;
  992. va_start (args, event_thread);
  993. jvmtiError result = p->SetEventNotificationMode (this, mode, event_type,
  994. event_thread, args);
  995. va_end (args);
  996. return result;
  997. }
  998. jvmtiError GetAllThreads (jint *threads_count_ptr, jthread **threads_ptr)
  999. { return p->GetAllThreads (this, threads_count_ptr, threads_ptr); }
  1000. jvmtiError SuspendThread (jthread thread)
  1001. { return p->SuspendThread (this, thread); }
  1002. jvmtiError ResumeThread (jthread thread)
  1003. { return p->ResumeThread (this, thread); }
  1004. jvmtiError StopThread (jthread thread, jobject exception)
  1005. { return p->StopThread (this, thread, exception); }
  1006. jvmtiError InterruptThread (jthread thread)
  1007. { return p->InterruptThread (this, thread); }
  1008. jvmtiError GetThreadInfo (jthread thread, jvmtiThreadInfo *info_ptr)
  1009. { return p->GetThreadInfo (this, thread, info_ptr); }
  1010. jvmtiError GetOwnedMonitorInfo (jthread thread,
  1011. jint *owned_monitor_count_ptr,
  1012. jobject **owned_monitors_ptr)
  1013. {
  1014. return p->GetOwnedMonitorInfo (this, thread, owned_monitor_count_ptr,
  1015. owned_monitors_ptr);
  1016. }
  1017. jvmtiError GetCurrentContendedMonitor (jthread thread, jobject *monitor_ptr)
  1018. { return p->GetCurrentContendedMonitor (this, thread, monitor_ptr); }
  1019. jvmtiError RunAgentThread (jthread thread, jvmtiStartFunction proc,
  1020. const void *arg, jint priority)
  1021. { return p->RunAgentThread (this, thread, proc, arg, priority); }
  1022. jvmtiError GetTopThreadGroups (jint *group_count_ptr,
  1023. jthreadGroup **groups_ptr)
  1024. { return p->GetTopThreadGroups (this, group_count_ptr, groups_ptr); }
  1025. jvmtiError GetThreadGroupInfo (jthreadGroup group,
  1026. jvmtiThreadGroupInfo *info_ptr)
  1027. { return p->GetThreadGroupInfo (this, group, info_ptr); }
  1028. jvmtiError GetThreadGroupChildren (jthreadGroup group,
  1029. jint *thread_count_ptr,
  1030. jthread **threads_ptr,
  1031. jint *group_count_ptr,
  1032. jthreadGroup **groups_ptr)
  1033. {
  1034. return p->GetThreadGroupChildren (this, group, thread_count_ptr,
  1035. threads_ptr, group_count_ptr,
  1036. groups_ptr);
  1037. }
  1038. jvmtiError GetFrameCount (jthread thread, jint *count_ptr)
  1039. { return p->GetFrameCount (this, thread, count_ptr); }
  1040. jvmtiError GetThreadState (jthread thread, jint *thread_state_ptr)
  1041. { return p->GetThreadState (this, thread, thread_state_ptr); }
  1042. jvmtiError GetFrameLocation (jthread thread, jint depth,
  1043. jmethodID *method_ptr, jlocation *location_ptr)
  1044. {
  1045. return p->GetFrameLocation (this, thread, depth, method_ptr,
  1046. location_ptr);
  1047. }
  1048. jvmtiError NotifyPopFrame (jthread thread, jint depth)
  1049. { return p->NotifyPopFrame (this, thread, depth); }
  1050. jvmtiError GetLocalObject (jthread thread, jint depth, jint slot,
  1051. jobject *value_ptr)
  1052. { return p->GetLocalObject (this, thread, depth, slot, value_ptr); }
  1053. jvmtiError GetLocalInt (jthread thread, jint depth, jint slot,
  1054. jint *value_ptr)
  1055. { return p->GetLocalInt (this, thread, depth, slot, value_ptr); }
  1056. jvmtiError GetLocalLong (jthread thread, jint depth, jint slot,
  1057. jlong *value_ptr)
  1058. { return p->GetLocalLong (this, thread, depth, slot, value_ptr); }
  1059. jvmtiError GetLocalFloat (jthread thread, jint depth, jint slot,
  1060. jfloat *value_ptr)
  1061. { return p->GetLocalFloat (this, thread, depth, slot, value_ptr); }
  1062. jvmtiError GetLocalDouble (jthread thread, jint depth, jint slot,
  1063. jdouble *value_ptr)
  1064. { return p->GetLocalDouble (this, thread, depth, slot, value_ptr); }
  1065. jvmtiError SetLocalObject (jthread thread, jint depth, jint slot,
  1066. jobject value)
  1067. { return p->SetLocalObject (this, thread, depth, slot, value); }
  1068. jvmtiError SetLocalInt (jthread thread, jint depth, jint slot,
  1069. jint value)
  1070. { return p->SetLocalInt (this, thread, depth, slot, value); }
  1071. jvmtiError SetLocalLong (jthread thread, jint depth, jint slot,
  1072. jlong value)
  1073. { return p->SetLocalLong (this, thread, depth, slot, value); }
  1074. jvmtiError SetLocalFloat (jthread thread, jint depth, jint slot,
  1075. jfloat value)
  1076. { return p->SetLocalFloat (this, thread, depth, slot, value); }
  1077. jvmtiError SetLocalDouble (jthread thread, jint depth, jint slot,
  1078. jdouble value)
  1079. { return p->SetLocalDouble (this, thread, depth, slot, value); }
  1080. jvmtiError CreateRawMonitor (const char *name, jrawMonitorID *monitor_ptr)
  1081. { return p->CreateRawMonitor (this, name, monitor_ptr); }
  1082. jvmtiError DestroyRawMonitor (jrawMonitorID monitor)
  1083. { return p->DestroyRawMonitor (this, monitor); }
  1084. jvmtiError RawMonitorEnter (jrawMonitorID monitor)
  1085. { return p->RawMonitorEnter (this, monitor); }
  1086. jvmtiError RawMonitorExit (jrawMonitorID monitor)
  1087. { return p->RawMonitorExit (this, monitor); }
  1088. jvmtiError RawMonitorWait (jrawMonitorID monitor, jlong millis)
  1089. { return p->RawMonitorWait (this, monitor, millis); }
  1090. jvmtiError RawMonitorNotify (jrawMonitorID monitor)
  1091. { return p->RawMonitorNotify (this, monitor); }
  1092. jvmtiError RawMonitorNotifyAll (jrawMonitorID monitor)
  1093. { return p->RawMonitorNotifyAll (this, monitor); }
  1094. jvmtiError SetBreakpoint (jmethodID method, jlocation location)
  1095. { return p->SetBreakpoint (this, method, location); }
  1096. jvmtiError ClearBreakpoint (jmethodID method, jlocation location)
  1097. { return p->ClearBreakpoint (this, method, location); }
  1098. jvmtiError SetFieldAccessWatch (jclass klass, jfieldID field)
  1099. { return p->SetFieldAccessWatch (this, klass, field); }
  1100. jvmtiError ClearFieldAccessWatch (jclass klass, jfieldID field)
  1101. { return p->ClearFieldAccessWatch (this, klass, field); }
  1102. jvmtiError SetFieldModificationWatch (jclass klass, jfieldID field)
  1103. { return p->SetFieldModificationWatch (this, klass, field); }
  1104. jvmtiError ClearFieldModificationWatch (jclass klass, jfieldID field)
  1105. { return p->ClearFieldModificationWatch (this, klass, field); }
  1106. jvmtiError Allocate (jlong size, unsigned char **mem_ptr)
  1107. { return p->Allocate (this, size, mem_ptr); }
  1108. jvmtiError Deallocate (unsigned char *mem)
  1109. { return p->Deallocate (this, mem); }
  1110. jvmtiError GetClassSignature (jclass klass, char **signature_ptr,
  1111. char **generic_ptr)
  1112. { return p->GetClassSignature (this, klass, signature_ptr, generic_ptr); }
  1113. jvmtiError GetClassStatus (jclass klass, jint *status_ptr)
  1114. { return p->GetClassStatus (this, klass, status_ptr); }
  1115. jvmtiError GetSourceFileName (jclass klass, char **source_name_ptr)
  1116. { return p->GetSourceFileName (this, klass, source_name_ptr); }
  1117. jvmtiError GetClassModifiers (jclass klass, jint *modifiers_ptr)
  1118. { return p->GetClassModifiers (this, klass, modifiers_ptr); }
  1119. jvmtiError GetClassMethods (jclass klass, jint *method_count_ptr,
  1120. jmethodID **methods_ptr)
  1121. { return p->GetClassMethods (this, klass, method_count_ptr, methods_ptr); }
  1122. jvmtiError GetClassFields (jclass klass, jint *field_count_ptr,
  1123. jfieldID **fields_ptr)
  1124. { return p->GetClassFields (this, klass, field_count_ptr, fields_ptr); }
  1125. jvmtiError GetImplementedInterfaces (jclass klass,
  1126. jint *interface_count_ptr,
  1127. jclass **interfaces_ptr)
  1128. {
  1129. return p->GetImplementedInterfaces (this, klass, interface_count_ptr,
  1130. interfaces_ptr);
  1131. }
  1132. jvmtiError IsInterface (jclass klass, jboolean *is_interface_ptr)
  1133. { return p->IsInterface (this, klass, is_interface_ptr); }
  1134. jvmtiError IsArrayClass (jclass klass, jboolean *is_array_class_ptr)
  1135. { return p->IsArrayClass (this, klass, is_array_class_ptr); }
  1136. jvmtiError GetClassLoader (jclass klass, jobject *classloader_ptr)
  1137. { return p->GetClassLoader (this, klass, classloader_ptr); }
  1138. jvmtiError GetObjectHashCode (jobject object, jint *hash_code_ptr)
  1139. { return p->GetObjectHashCode (this, object, hash_code_ptr); }
  1140. jvmtiError GetObjectMonitorUsage (jobject object,
  1141. jvmtiMonitorUsage *info_ptr)
  1142. { return p->GetObjectMonitorUsage (this, object, info_ptr); }
  1143. jvmtiError GetFieldName (jclass klass, jfieldID field, char **name_ptr,
  1144. char **signature_ptr, char **generic_ptr)
  1145. {
  1146. return p->GetFieldName (this, klass, field, name_ptr,
  1147. signature_ptr, generic_ptr);
  1148. }
  1149. jvmtiError GetFieldDeclaringClass (jclass klass, jfieldID field,
  1150. jclass *declaring_class_ptr)
  1151. {
  1152. return p->GetFieldDeclaringClass (this, klass, field,
  1153. declaring_class_ptr);
  1154. }
  1155. jvmtiError GetFieldModifiers (jclass klass, jfieldID field,
  1156. jint *modifiers_ptr)
  1157. { return p->GetFieldModifiers (this, klass, field, modifiers_ptr); }
  1158. jvmtiError IsFieldSynthetic (jclass klass, jfieldID field,
  1159. jboolean *is_synthetic_ptr)
  1160. { return p->IsFieldSynthetic (this, klass, field, is_synthetic_ptr); }
  1161. jvmtiError GetMethodName (jmethodID method, char **name_ptr,
  1162. char **signature_ptr, char **generic_ptr)
  1163. {
  1164. return p->GetMethodName (this, method, name_ptr, signature_ptr,
  1165. generic_ptr);
  1166. }
  1167. jvmtiError GetMethodDeclaringClass (jmethodID method,
  1168. jclass *declaring_class_ptr)
  1169. { return p->GetMethodDeclaringClass (this, method, declaring_class_ptr); }
  1170. jvmtiError GetMethodModifiers (jmethodID method, jint *modifiers_ptr)
  1171. { return p->GetMethodModifiers (this, method, modifiers_ptr); }
  1172. jvmtiError GetMaxLocals (jmethodID method, jint *max_ptr)
  1173. { return p->GetMaxLocals (this, method, max_ptr); }
  1174. jvmtiError GetArgumentsSize (jmethodID method, jint *size_ptr)
  1175. { return p->GetArgumentsSize (this, method, size_ptr); }
  1176. jvmtiError GetLineNumberTable (jmethodID method, jint *entry_count_ptr,
  1177. jvmtiLineNumberEntry **table_ptr)
  1178. { return p->GetLineNumberTable (this, method, entry_count_ptr, table_ptr); }
  1179. jvmtiError GetMethodLocation (jmethodID method,
  1180. jlocation *start_location_ptr,
  1181. jlocation *end_location_ptr)
  1182. {
  1183. return p->GetMethodLocation (this, method, start_location_ptr,
  1184. end_location_ptr);
  1185. }
  1186. jvmtiError GetLocalVariableTable (jmethodID method, jint *entry_count_ptr,
  1187. jvmtiLocalVariableEntry **table_ptr)
  1188. {
  1189. return p->GetLocalVariableTable (this, method, entry_count_ptr,
  1190. table_ptr);
  1191. }
  1192. jvmtiError GetBytecodes (jmethodID method, jint *bytecode_count_ptr,
  1193. unsigned char **bytecodes_ptr)
  1194. {
  1195. return p->GetBytecodes (this, method, bytecode_count_ptr,
  1196. bytecodes_ptr);
  1197. }
  1198. jvmtiError IsMethodNative (jmethodID method, jboolean *is_native_ptr)
  1199. { return p->IsMethodNative (this, method, is_native_ptr); }
  1200. jvmtiError IsMethodSynthetic (jmethodID method, jboolean *is_synthetic_ptr)
  1201. { return p->IsMethodSynthetic (this, method, is_synthetic_ptr); }
  1202. jvmtiError GetLoadedClasses (jint *class_count_ptr, jclass **classes_ptr)
  1203. { return p->GetLoadedClasses (this, class_count_ptr, classes_ptr); }
  1204. jvmtiError GetClassLoaderClasses (jobject initiating_loader,
  1205. jint *class_count_ptr,
  1206. jclass **classes_ptr)
  1207. {
  1208. return p->GetClassLoaderClasses (this, initiating_loader,
  1209. class_count_ptr, classes_ptr);
  1210. }
  1211. jvmtiError PopFrame (jthread thread)
  1212. { return p->PopFrame (this, thread); }
  1213. jvmtiError RedefineClasses (jint class_count,
  1214. const jvmtiClassDefinition* class_definitions)
  1215. { return p->RedefineClasses (this, class_count, class_definitions); }
  1216. jvmtiError GetVersionNumber (jint *version_ptr)
  1217. { return p->GetVersionNumber (this, version_ptr); }
  1218. jvmtiError GetCapabilities (jvmtiCapabilities *capabilities_ptr)
  1219. { return p->GetCapabilities (this, capabilities_ptr); }
  1220. jvmtiError GetSourceDebugExtension (jclass klass,
  1221. char **source_debug_extension_ptr)
  1222. {
  1223. return p->GetSourceDebugExtension (this, klass,
  1224. source_debug_extension_ptr);
  1225. }
  1226. jvmtiError IsMethodObsolete (jmethodID method, jboolean *is_obsolete_ptr)
  1227. { return p->IsMethodObsolete (this, method, is_obsolete_ptr); }
  1228. jvmtiError SuspendThreadList (jint request_count,
  1229. const jthread *request_list,
  1230. jvmtiError *results)
  1231. { return p->SuspendThreadList (this, request_count, request_list, results); }
  1232. jvmtiError ResumeThreadList (jint request_count,
  1233. const jthread *request_list,
  1234. jvmtiError *results)
  1235. { return p->ResumeThreadList (this, request_count, request_list, results); }
  1236. jvmtiError GetAllStackTraces (jint max_frame_count,
  1237. jvmtiStackInfo **stack_info_ptr,
  1238. jint *thread_count_ptr)
  1239. {
  1240. return p->GetAllStackTraces (this, max_frame_count, stack_info_ptr,
  1241. thread_count_ptr);
  1242. }
  1243. jvmtiError GetThreadListStackTraces (jint thread_count,
  1244. const jthread *thread_list,
  1245. jint max_frame_count,
  1246. jvmtiStackInfo **stack_info_ptr)
  1247. {
  1248. return p->GetThreadListStackTraces (this, thread_count, thread_list,
  1249. max_frame_count, stack_info_ptr);
  1250. }
  1251. jvmtiError GetThreadLocalStorage (jthread thread, void **data_ptr)
  1252. { return p->GetThreadLocalStorage (this, thread, data_ptr); }
  1253. jvmtiError SetThreadLocalStorage (jthread thread, const void *data)
  1254. { return p->SetThreadLocalStorage (this, thread, data); }
  1255. jvmtiError GetStackTrace (jthread thread, jint start_depth,
  1256. jint max_frame_count,
  1257. jvmtiFrameInfo *frame_buffer, jint *count_ptr)
  1258. {
  1259. return p->GetStackTrace (this, thread, start_depth, max_frame_count,
  1260. frame_buffer, count_ptr);
  1261. }
  1262. jvmtiError GetTag (jobject object, jlong *tag_ptr)
  1263. { return p->GetTag (this, object, tag_ptr); }
  1264. jvmtiError SetTag (jobject object, jlong tag)
  1265. { return p->SetTag (this, object, tag); }
  1266. jvmtiError ForceGarbageCollection (void)
  1267. { return p->ForceGarbageCollection (this); }
  1268. jvmtiError IterateOverObjectsReachableFromObject (jobject object,
  1269. jvmtiObjectReferenceCallback object_reference_callback,
  1270. void *user_data)
  1271. {
  1272. return p->IterateOverObjectsReachableFromObject (this, object,
  1273. object_reference_callback,
  1274. user_data);
  1275. }
  1276. jvmtiError IterateOverReachableObjects (jvmtiHeapRootCallback heap_root_callback,
  1277. jvmtiStackReferenceCallback stack_ref_callback,
  1278. jvmtiObjectReferenceCallback object_ref_callback,
  1279. void *user_data)
  1280. {
  1281. return p->IterateOverReachableObjects (this, heap_root_callback,
  1282. stack_ref_callback,
  1283. object_ref_callback,
  1284. user_data);
  1285. }
  1286. jvmtiError IterateOverHeap (jvmtiHeapObjectFilter object_filter,
  1287. jvmtiHeapObjectCallback heap_object_callback,
  1288. void *user_data)
  1289. {
  1290. return p->IterateOverHeap (this, object_filter, heap_object_callback,
  1291. user_data);
  1292. }
  1293. jvmtiError IterateOverInstanceOfClass (jclass klass,
  1294. jvmtiHeapObjectFilter object_filter,
  1295. jvmtiHeapObjectCallback heap_object_callback,
  1296. void *user_data)
  1297. {
  1298. return p->IterateOverInstanceOfClass (this, klass, object_filter,
  1299. heap_object_callback, user_data);
  1300. }
  1301. jvmtiError GetObjectsWithTags (jint tag_count, const jlong *tags,
  1302. jint *count_ptr, jobject **object_result_ptr,
  1303. jlong **tag_result_ptr)
  1304. {
  1305. return p->GetObjectsWithTags (this, tag_count, tags, count_ptr,
  1306. object_result_ptr, tag_result_ptr);
  1307. }
  1308. jvmtiError SetJNIFunctionTable (const jniNativeInterface *function_table)
  1309. { return p->SetJNIFunctionTable (this, function_table); }
  1310. jvmtiError GetJNIFunctionTable (jniNativeInterface **function_table_ptr)
  1311. { return p->GetJNIFunctionTable (this, function_table_ptr); }
  1312. jvmtiError SetEventCallbacks (const jvmtiEventCallbacks *callbacks,
  1313. jint size_of_callbacks)
  1314. { return p->SetEventCallbacks (this, callbacks, size_of_callbacks); }
  1315. jvmtiError GenerateEvents (jvmtiEvent event_type)
  1316. { return p->GenerateEvents (this, event_type); }
  1317. jvmtiError GetExtensionFunctions (jint *extension_count_ptr,
  1318. jvmtiExtensionFunctionInfo **extensions)
  1319. { return p->GetExtensionFunctions (this, extension_count_ptr, extensions); }
  1320. jvmtiError GetExtensionEvents (jint *extension_count_ptr,
  1321. jvmtiExtensionEventInfo **extensions)
  1322. { return p->GetExtensionEvents (this, extension_count_ptr, extensions); }
  1323. jvmtiError SetExtensionEventCallback (jint extension_event_index,
  1324. jvmtiExtensionEvent callback)
  1325. {
  1326. return p->SetExtensionEventCallback (this, extension_event_index,
  1327. callback);
  1328. }
  1329. jvmtiError DisposeEnvironment (void)
  1330. { return p->DisposeEnvironment (this); }
  1331. jvmtiError GetErrorName (jvmtiError error, char **name_ptr)
  1332. { return p->GetErrorName (this, error, name_ptr); }
  1333. jvmtiError GetJLocationFormat (jvmtiJlocationFormat *format_ptr)
  1334. { return p->GetJLocationFormat (this, format_ptr); }
  1335. jvmtiError GetSystemProperties (jint *count_ptr, char ***property_ptr)
  1336. { return p->GetSystemProperties (this, count_ptr, property_ptr); }
  1337. jvmtiError GetSystemProperty (const char *property, char **value_ptr)
  1338. { return p->GetSystemProperty (this, property, value_ptr); }
  1339. jvmtiError SetSystemProperty (const char *property, const char *value)
  1340. { return p->SetSystemProperty (this, property, value); }
  1341. jvmtiError GetPhase (jvmtiPhase *phase_ptr)
  1342. { return p->GetPhase (this, phase_ptr); }
  1343. jvmtiError GetCurrentThreadCpuTimerInfo (jvmtiTimerInfo *info_ptr)
  1344. { return p->GetCurrentThreadCpuTimerInfo (this, info_ptr); }
  1345. jvmtiError GetCurrentThreadCpuTime (jlong *nanos_ptr)
  1346. { return p->GetCurrentThreadCpuTime (this, nanos_ptr); }
  1347. jvmtiError GetThreadCpuTimerInfo (jvmtiTimerInfo *info_ptr)
  1348. { return p->GetThreadCpuTimerInfo (this, info_ptr); }
  1349. jvmtiError GetThreadCpuTime (jthread thread, jlong *nanos_ptr)
  1350. { return p->GetThreadCpuTime (this, thread, nanos_ptr); }
  1351. jvmtiError GetTimerInfo (jvmtiTimerInfo *info_ptr)
  1352. { return p->GetTimerInfo (this, info_ptr); }
  1353. jvmtiError GetTime (jlong *nanos_ptr)
  1354. {return p->GetTime (this, nanos_ptr); }
  1355. jvmtiError GetPotentialCapabilities (jvmtiCapabilities *capabilities_ptr)
  1356. { return p->GetPotentialCapabilities (this, capabilities_ptr); }
  1357. jvmtiError AddCapabilities (const jvmtiCapabilities *capabilities_ptr)
  1358. { return p->AddCapabilities (this, capabilities_ptr); }
  1359. jvmtiError RelinquishCapabilities (const jvmtiCapabilities *capabilities_ptr)
  1360. { return p->RelinquishCapabilities (this, capabilities_ptr); }
  1361. jvmtiError GetAvailableProcessors (jint *processor_count_ptr)
  1362. { return p->GetAvailableProcessors (this, processor_count_ptr); }
  1363. jvmtiError GetEnvironmentLocalStorage (void **data_ptr)
  1364. { return p->GetEnvironmentLocalStorage (this, data_ptr); }
  1365. jvmtiError SetEnvironmentLocalStorage (const void *data)
  1366. { return p->SetEnvironmentLocalStorage (this, data); }
  1367. jvmtiError AddToBootstrapClassLoaderSearch (const char *segment)
  1368. { return p->AddToBootstrapClassLoaderSearch (this, segment); }
  1369. jvmtiError SetVerboseFlag (jvmtiVerboseFlag flag, jboolean value)
  1370. { return p->SetVerboseFlag (this, flag, value); }
  1371. jvmtiError GetObjectSize (jobject object, jlong *size_ptr)
  1372. { return p->GetObjectSize (this, object, size_ptr); }
  1373. };
  1374. #endif /* __cplusplus */
  1375. /*
  1376. * Miscellaneous flags, constants, etc
  1377. */
  1378. /* Class status flags */
  1379. #define JVMTI_CLASS_STATUS_VERIFIED 1
  1380. #define JVMTI_CLASS_STATUS_PREPARED 2
  1381. #define JVMTI_CLASS_STATUS_INITIALIZED 4
  1382. #define JVMTI_CLASS_STATUS_ERROR 8
  1383. #define JVMTI_CLASS_STATUS_ARRAY 16
  1384. #define JVMTI_CLASS_STATUS_PRIMITIVE 32
  1385. /* Thread state flags */
  1386. #define JVMTI_THREAD_STATE_ALIVE 0x0001
  1387. #define JVMTI_THREAD_STATE_TERMINATED 0x0002
  1388. #define JVMTI_THREAD_STATE_RUNNABLE 0x0004
  1389. #define JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER 0x0400
  1390. #define JVMTI_THREAD_STATE_WAITING 0x0080
  1391. #define JVMTI_THREAD_STATE_WAITING_INDEFINITELY 0x0010
  1392. #define JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT 0x0020
  1393. #define JVMTI_THREAD_STATE_SLEEPING 0x0040
  1394. #define JVMTI_THREAD_STATE_IN_OBJECT_WAIT 0x0100
  1395. #define JVMTI_THREAD_STATE_PARKED 0x0200
  1396. #define JVMTI_THREAD_STATE_SUSPENDED 0x100000
  1397. #define JVMTI_THREAD_STATE_INTERRUPTED 0x200000
  1398. #define JVMTI_THREAD_STATE_IN_NATIVE 0x400000
  1399. #define JVMTI_THREAD_STATE_VENDOR_1 0x10000000
  1400. #define JVMTI_THREAD_STATE_VENDOR_2 0x20000000
  1401. #define JVMTI_THREAD_STATE_VENDOR_3 0x40000000
  1402. /* java.lang.Thread.State conversion masks */
  1403. #define JVMTI_JAVA_LANG_THREAD_STATE_MASK \
  1404. (JVMTI_THREAD_STATE_TERMINATED \
  1405. | JVMTI_THREAD_STATE_ALIVE \
  1406. | JVMTI_THREAD_STATE_RUNNABLE \
  1407. | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER \
  1408. | JVMTI_THREAD_STATE_WAITING \
  1409. | JVMTI_THREAD_STATE_WAITING_INDEFINITELY \
  1410. | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)
  1411. #define JVMTI_JAVA_LANG_THREAD_STATE_NEW 0
  1412. #define JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED JVMTI_THREAD_STATE_TERMINATED
  1413. #define JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE \
  1414. (JVMTI_THREAD_STATE_ALIVE \
  1415. | JVMTI_THREAD_STATE_RUNNABLE)
  1416. #define JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED \
  1417. (JVMTI_THREAD_STATE_ALIVE \
  1418. | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER)
  1419. #define JVMTI_JAVA_LANG_THREAD_STATE_WAITING \
  1420. (JVMTI_THREAD_STATE_ALIVE \
  1421. | JVMTI_THREAD_STATE_WAITING \
  1422. | JVMTI_THREAD_STATE_WAITING_INDEFINITELY)
  1423. #define JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING \
  1424. (JVMTI_THREAD_STATE_ALIVE \
  1425. | JVMTI_THREAD_STATE_WAITING \
  1426. | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)
  1427. /* Thread priorities */
  1428. #define JVMTI_THREAD_MIN_PRIORITY 1
  1429. #define JVMTI_THREAD_NORM_PRIORITY 5
  1430. #define JVMTI_THREAD_MAX_PRIORITY 10
  1431. /* Keep c-font-lock-extra-types in order: JNI followed by JVMTI,
  1432. all in alphabetical order */
  1433. /* Local Variables: */
  1434. /* c-font-lock-extra-types: ("\\sw+_t"
  1435. "JNIEnv" "JNINativeMethod" "JavaVM" "JavaVMOption" "jarray"
  1436. "jboolean" "jbooleanArray" "jbyte" "jbyteArray" "jchar" "jcharArray"
  1437. "jclass" "jdouble" "jdoubleArray" "jfieldID" "jfloat" "jfloatArray"
  1438. "jint" "jintArray" "jlong" "jlongArray" "jmethodID" "jobject" "jstring" "jthrowable"
  1439. "jvalue" "jweak"
  1440. "jvmtiEnv" "jvmtiError"
  1441. "jthread" "jthreadGroup" "jlocation" "jrawMonitorID") */
  1442. /* End: */
  1443. #endif /* !_CLASSPATH_JVMTI_H */