1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 <?xml-stylesheet type="text/xsl" href="jvmti.xsl"?> 3 <!-- 4 Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. 5 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6 7 This code is free software; you can redistribute it and/or modify it 8 under the terms of the GNU General Public License version 2 only, as 9 published by the Free Software Foundation. 10 11 This code is distributed in the hope that it will be useful, but WITHOUT 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 version 2 for more details (a copy is included in the LICENSE file that 15 accompanied this code). 16 17 You should have received a copy of the GNU General Public License version 18 2 along with this work; if not, write to the Free Software Foundation, 19 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 21 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 or visit www.oracle.com if you need additional information or have any 23 questions. 24 --> 25 26 <!DOCTYPE specification [ 27 <!ELEMENT specification (title, intro*, functionsection, errorsection, 28 eventsection, datasection, issuessection, changehistory)> 29 <!ATTLIST specification label CDATA #REQUIRED 30 majorversion CDATA #REQUIRED 31 minorversion CDATA #REQUIRED 32 microversion CDATA #REQUIRED> 33 34 <!ELEMENT title (#PCDATA|jvmti|tm)*> 35 <!ATTLIST title subtitle CDATA #REQUIRED> 36 37 <!ELEMENT intro ANY> 38 <!ATTLIST intro id CDATA #IMPLIED 39 label CDATA ""> 40 41 <!ELEMENT functionsection (intro*, category*)> 42 <!ATTLIST functionsection label CDATA #REQUIRED> 43 44 <!ELEMENT category ((intro|typedef|uniontypedef|capabilitiestypedef)*, 45 (function|callback|elide)*)> 46 <!ATTLIST category id CDATA #REQUIRED 47 label CDATA #REQUIRED> 48 49 <!ELEMENT function (synopsis, typedef*, description?, origin, 50 (capabilities|eventcapabilities), 51 parameters, errors)> 52 <!ATTLIST function id CDATA #REQUIRED 53 num CDATA #REQUIRED 54 phase (onload|onloadOnly|start|live|any) #IMPLIED 55 callbacksafe (safe|unsafe) #IMPLIED 56 impl CDATA #IMPLIED 57 hide CDATA #IMPLIED 58 jkernel (yes|no) #IMPLIED 59 since CDATA "1.0"> 60 61 <!ELEMENT callback ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject| 62 jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void), 63 synopsis, description?, parameters)> 64 <!ATTLIST callback id CDATA #REQUIRED 65 since CDATA "1.0"> 66 67 <!ELEMENT synopsis (#PCDATA|jvmti)*> 68 69 <!ELEMENT typedef (description?, field*)> 70 <!ATTLIST typedef id CDATA #REQUIRED 71 label CDATA #REQUIRED 72 since CDATA "1.0"> 73 74 <!ELEMENT uniontypedef (description?, field*)> 75 <!ATTLIST uniontypedef id CDATA #REQUIRED 76 label CDATA #REQUIRED 77 since CDATA "1.0"> 78 79 <!ELEMENT field ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject| 80 jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|allocfieldbuf|inptr|inbuf|outbuf|vmbuf|ptrtype|struct), 81 description)> 82 <!ATTLIST field id CDATA #REQUIRED> 83 84 <!ELEMENT capabilitiestypedef (description?, capabilityfield*)> 85 <!ATTLIST capabilitiestypedef id CDATA #REQUIRED 86 label CDATA #REQUIRED> 87 88 <!ELEMENT capabilityfield (description)> 89 <!ATTLIST capabilityfield id CDATA #REQUIRED 90 disp1 CDATA "" 91 disp2 CDATA "" 92 since CDATA "1.0"> 93 94 <!ELEMENT description ANY> 95 96 <!ELEMENT capabilities (required*, capability*)> 97 98 <!ELEMENT eventcapabilities EMPTY> 99 100 <!ELEMENT required ANY> 101 <!ATTLIST required id CDATA #REQUIRED> 102 103 <!ELEMENT capability ANY> 104 <!ATTLIST capability id CDATA #REQUIRED> 105 106 <!ELEMENT parameters (param*)> 107 108 <!ELEMENT param ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject| 109 jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct|ptrtype| 110 outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf), 111 description)> 112 <!ATTLIST param id CDATA #REQUIRED> 113 114 <!ELEMENT jmethodID EMPTY> 115 <!ATTLIST jmethodID class CDATA #IMPLIED 116 native CDATA #IMPLIED> 117 118 <!ELEMENT jfieldID EMPTY> 119 <!ATTLIST jfieldID class CDATA #IMPLIED> 120 121 <!ELEMENT jclass EMPTY> 122 <!ATTLIST jclass method CDATA #IMPLIED 123 field CDATA #IMPLIED> 124 125 <!ELEMENT jframeID EMPTY> 126 <!ATTLIST jframeID thread CDATA #IMPLIED> 127 128 <!ELEMENT jrawMonitorID EMPTY> 129 130 <!ELEMENT jthread EMPTY> 131 <!ATTLIST jthread started CDATA #IMPLIED 132 null CDATA #IMPLIED 133 frame CDATA #IMPLIED 134 impl CDATA #IMPLIED> 135 136 <!ELEMENT varargs EMPTY> 137 138 <!ELEMENT jthreadGroup EMPTY> 139 <!ELEMENT jobject EMPTY> 140 <!ELEMENT jvalue EMPTY> 141 <!ELEMENT jchar EMPTY> 142 <!ELEMENT jint EMPTY> 143 <!ATTLIST jint min CDATA #IMPLIED> 144 <!ELEMENT jlong EMPTY> 145 <!ELEMENT jfloat EMPTY> 146 <!ELEMENT jdouble EMPTY> 147 <!ELEMENT jlocation EMPTY> 148 <!ELEMENT jboolean EMPTY> 149 <!ELEMENT char EMPTY> 150 <!ELEMENT uchar EMPTY> 151 <!ELEMENT size_t EMPTY> 152 <!ELEMENT void EMPTY> 153 <!ELEMENT enum (#PCDATA)*> 154 <!ELEMENT struct (#PCDATA)*> 155 156 <!ELEMENT nullok ANY> 157 158 <!ELEMENT ptrtype ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 159 jthreadGroup|jobject|jvalue), nullok?)> 160 161 <!ELEMENT outptr ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 162 jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble| 163 jlocation|jboolean|char|uchar|size_t|void), nullok?)> 164 165 <!ELEMENT allocbuf ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 166 jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble| 167 jlocation|jboolean|char|uchar|size_t|void), nullok?)> 168 <!ATTLIST allocbuf incount CDATA #IMPLIED 169 outcount CDATA #IMPLIED> 170 171 <!ELEMENT allocallocbuf ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 172 jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble| 173 jlocation|jboolean|char|uchar|size_t|void), nullok?)> 174 <!ATTLIST allocallocbuf incount CDATA #IMPLIED 175 outcount CDATA #IMPLIED> 176 177 <!ELEMENT inptr (struct, nullok?)> 178 179 <!ELEMENT inbuf ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 180 jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble| 181 jlocation|jboolean|char|uchar|size_t|void), nullok?)> 182 <!ATTLIST inbuf incount CDATA #IMPLIED> 183 184 <!ELEMENT outbuf ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 185 jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble| 186 jlocation|jboolean|char|uchar|size_t|void|outbuf), nullok?)> 187 <!ATTLIST outbuf incount CDATA #IMPLIED 188 outcount CDATA #IMPLIED> 189 190 <!ELEMENT vmbuf ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 191 jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble| 192 jlocation|jboolean|char|uchar|size_t|void), nullok?)> 193 <!ATTLIST vmbuf incount CDATA #IMPLIED 194 outcount CDATA #IMPLIED> 195 196 <!ELEMENT agentbuf ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 197 jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble| 198 jlocation|jboolean|char|uchar|size_t|void), nullok?)> 199 <!ATTLIST agentbuf incount CDATA #IMPLIED 200 outcount CDATA #IMPLIED> 201 202 <!ELEMENT allocfieldbuf ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread| 203 jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble| 204 jlocation|jboolean|char|uchar|size_t|void))> 205 <!ATTLIST allocfieldbuf outcount CDATA #IMPLIED> 206 207 <!ELEMENT errors (error*)> 208 209 <!ELEMENT error ANY> 210 <!ATTLIST error id CDATA #REQUIRED> 211 212 <!ELEMENT errorsection (intro*, errorcategory*)> 213 <!ATTLIST errorsection label CDATA #REQUIRED> 214 215 <!ELEMENT errorcategory (intro*, errorid*)> 216 <!ATTLIST errorcategory id CDATA #REQUIRED 217 label CDATA #REQUIRED> 218 219 <!ELEMENT errorid ANY> 220 <!ATTLIST errorid id CDATA #REQUIRED 221 num CDATA #REQUIRED> 222 223 <!ELEMENT datasection (intro*, basetypes*)> 224 225 <!ELEMENT basetypes (intro*, basetype*)> 226 <!ATTLIST basetypes id CDATA #REQUIRED 227 label CDATA #REQUIRED> 228 229 <!ELEMENT basetype (definition?,description)> 230 <!ATTLIST basetype id CDATA #REQUIRED 231 name CDATA #IMPLIED> 232 233 <!ELEMENT definition (#PCDATA|jvmti)*> 234 235 <!ELEMENT eventsection (intro*, (event|elide)*)> 236 <!ATTLIST eventsection label CDATA #REQUIRED> 237 238 <!ELEMENT event (description, origin, typedef*, capabilities, parameters)> 239 <!ATTLIST event id CDATA #REQUIRED 240 label CDATA #REQUIRED 241 const CDATA #REQUIRED 242 num CDATA #REQUIRED 243 phase (onload|start|live|any) #IMPLIED 244 filtered (thread|global) #IMPLIED 245 since CDATA "1.0"> 246 247 <!ELEMENT issuessection (intro*)> 248 <!ATTLIST issuessection label CDATA #REQUIRED> 249 250 <!ELEMENT changehistory (intro*, change*)> 251 <!ATTLIST changehistory update CDATA #REQUIRED 252 id CDATA #REQUIRED> 253 254 <!ELEMENT change ANY> 255 <!ATTLIST change date CDATA #REQUIRED 256 version CDATA #IMPLIED> 257 258 <!ELEMENT functionlink (#PCDATA|jvmti|code|i|b)*> 259 <!ATTLIST functionlink id CDATA #REQUIRED> 260 261 <!ELEMENT datalink (#PCDATA|jvmti|code|i|b)*> 262 <!ATTLIST datalink id CDATA #REQUIRED> 263 264 <!ELEMENT typelink (#PCDATA|jvmti|code|i|b)*> 265 <!ATTLIST typelink id CDATA #REQUIRED> 266 267 <!ELEMENT fieldlink (#PCDATA|jvmti|code|i|b)*> 268 <!ATTLIST fieldlink id CDATA #REQUIRED 269 struct CDATA #REQUIRED> 270 271 <!ELEMENT paramlink (#PCDATA|jvmti|code|i|b)*> 272 <!ATTLIST paramlink id CDATA #REQUIRED> 273 274 <!ELEMENT eventlink (#PCDATA|jvmti|code|i|b)*> 275 <!ATTLIST eventlink id CDATA #REQUIRED> 276 277 <!ELEMENT errorlink (#PCDATA|jvmti|code|i|b|tm)*> 278 <!ATTLIST errorlink id CDATA #REQUIRED> 279 280 <!ELEMENT externallink (#PCDATA|jvmti|code|i|b|tm)*> 281 <!ATTLIST externallink id CDATA #REQUIRED> 282 283 <!ELEMENT vmspec EMPTY> 284 <!ATTLIST vmspec chapter CDATA #IMPLIED> 285 286 <!ELEMENT internallink (#PCDATA|jvmti|code|i|b)*> 287 <!ATTLIST internallink id CDATA #REQUIRED> 288 289 <!ELEMENT functionphaselist EMPTY> 290 <!ATTLIST functionphaselist phase (onload|onloadOnly|start|live|any) #REQUIRED> 291 292 <!ELEMENT eventphaselist EMPTY> 293 <!ATTLIST eventphaselist phase (onload|start|live|any) #REQUIRED> 294 295 <!ELEMENT issue ANY> 296 297 <!ELEMENT rationale ANY> 298 299 <!ELEMENT todo ANY> 300 301 <!ELEMENT origin (#PCDATA)*> 302 303 <!ELEMENT elide (intro|function|callback|event)*> 304 <!ATTLIST elide why CDATA #IMPLIED> 305 306 <!ELEMENT constants (constant*)> 307 <!ATTLIST constants id CDATA #REQUIRED 308 label CDATA #REQUIRED 309 kind (enum|bits|const) #REQUIRED 310 since CDATA "1.0"> 311 312 <!ELEMENT constant ANY> 313 <!ATTLIST constant id CDATA #REQUIRED 314 num CDATA #REQUIRED> 315 316 <!ELEMENT tm (#PCDATA)> 317 318 <!ELEMENT i (#PCDATA|jvmti|tm)*> 319 320 <!ELEMENT b (#PCDATA|jvmti|code)*> 321 322 <!ELEMENT code (#PCDATA|space)*> 323 324 <!ELEMENT pre ANY> 325 326 <!ELEMENT space EMPTY> 327 328 <!ELEMENT jvmti EMPTY> 329 330 <!ELEMENT example (#PCDATA|i)*> 331 332 <!ELEMENT br EMPTY> 333 334 <!ELEMENT p EMPTY> 335 336 <!ELEMENT dl (dt|dd)+> 337 338 <!ELEMENT dd ANY> 339 340 <!ELEMENT dt (#PCDATA|jvmti|code|i|b)*> 341 342 <!ELEMENT table (tr)+> 343 344 <!ELEMENT tr (td|th)*> 345 346 <!ELEMENT td ANY> 347 <!ATTLIST td align (left|right|center) "center"> 348 349 <!ELEMENT th ANY> 350 <!ATTLIST th align (left|right|center) "center"> 351 352 <!ELEMENT ul (li)+> 353 <!ATTLIST ul type (disc|circle|square) "disc"> 354 355 <!ELEMENT li ANY> 356 ]> 357 358 <specification label="JVM(TM) Tool Interface" 359 majorversion="9" 360 minorversion="0" 361 microversion="0"> 362 <title subtitle="Version"> 363 <tm>JVM</tm> Tool Interface 364 </title> 365 366 <intro id="whatIs" label="What is the JVM Tool Interface?"> 367 The <tm>JVM</tm> Tool Interface (<jvmti/>) 368 is a programming interface used by development and monitoring tools. 369 It provides both a way to inspect the state and 370 to control the execution of applications running in the 371 <tm>Java</tm> virtual machine (VM). 372 <p/> 373 <jvmti/> is intended to provide a VM interface for the full breadth of tools 374 that need access to VM state, including but not limited to: profiling, 375 debugging, monitoring, thread analysis, and coverage analysis tools. 376 <p/> 377 <jvmti/> may not be available in all implementations of the <tm>Java</tm> virtual 378 machine. 379 <p/> 380 <jvmti/> is a two-way interface. 381 A client of <jvmti/>, hereafter called an <i>agent</i>, 382 can be notified of 383 interesting occurrences through <internallink id="EventSection">events</internallink>. 384 <jvmti/> 385 can query and control the application through many 386 <internallink id="FunctionSection">functions</internallink>, 387 either in response to events or 388 independent of them. 389 <p/> 390 Agents run in the same process with and communicate directly with 391 the virtual machine executing 392 the application being examined. This communication is 393 through a native interface (<jvmti/>). The native in-process interface allows 394 maximal control with minimal intrusion on the part of a tool. 395 Typically, agents are relatively compact. They can be controlled 396 by a separate process which implements the bulk of a tool's 397 function without interfering with the target application's normal execution. 398 </intro> 399 400 <intro id="architecture" label="Architecture"> 401 Tools can be written directly to <jvmti/> or indirectly 402 through higher level interfaces. 403 The Java Platform Debugger Architecture includes <jvmti/>, but also 404 contains higher-level, out-of-process debugger interfaces. The higher-level 405 interfaces are more appropriate than <jvmti/> for many tools. 406 For more information on the Java Platform Debugger Architecture, 407 see the 408 <externallink id="jpda/architecture.html">Java 409 Platform Debugger Architecture website</externallink>. 410 </intro> 411 412 <intro id="writingAgents" label="Writing Agents"> 413 Agents can be written in any native language that supports C 414 language calling conventions and C or C++ 415 definitions. 416 <p/> 417 The function, event, data type, and constant definitions needed for 418 using <jvmti/> are defined in the include file <code>jvmti.h</code>. 419 To use these definitions add the <tm>J2SE</tm> include directory 420 to your include path and add 421 <example> 422 #include <jvmti.h> 423 </example> 424 to your source code. 425 </intro> 426 427 <intro id="deployingAgents" label="Deploying Agents"> 428 An agent is deployed in a platform specific manner but is typically the 429 platform equivalent of a dynamic library. On the <tm>Windows</tm> operating 430 system, for example, an agent library is a "Dynamic Linked Library" (DLL). 431 On the <tm>Solaris</tm> Operating Environment, an agent library is a shared 432 object (<code>.so</code> file). 433 <p/> 434 435 An agent may be started at VM startup by specifying the agent library 436 name using a <internallink id="starting">command line option</internallink>. 437 Some implementations may support a mechanism to <internallink id="onattach"> 438 start agents</internallink> in the live <functionlink id="GetPhase">phase</functionlink>. 439 The details of how this is initiated are implementation specific. 440 </intro> 441 442 <intro id="entryPoint" label="Statically Linked Agents (since version 1.2.3)"> 443 444 A native JVMTI Agent may be <i>statically linked</i> with the VM. 445 The manner in which the library and VM image are combined is 446 implementation-dependent. 447 An agent L whose image has been combined with the VM is defined as 448 <i>statically linked</i> if and only if the agent exports a function 449 called Agent_OnLoad_L. 450 <p/> 451 If a <i>statically linked</i> agent L exports a function called 452 Agent_OnLoad_L and a function called Agent_OnLoad, the Agent_OnLoad 453 function will be ignored. 454 If an agent L is <i>statically linked</i>, an Agent_OnLoad_L 455 function will be invoked with the same arguments and expected return 456 value as specified for the Agent_OnLoad function. 457 An agent L that is <i>statically linked</i> will prohibit an agent of 458 the same name from being loaded dynamically. 459 <p/> 460 The VM will invoke the Agent_OnUnload_L function of the agent, if such 461 a function is exported, at the same point during VM execution as it would 462 have called the dynamic entry point Agent_OnUnLoad. A statically loaded 463 agent cannot be unloaded. The Agent_OnUnload_L function will still be 464 called to do any other agent shutdown related tasks. 465 If a <i>statically linked</i> agent L exports a function called 466 Agent_OnUnLoad_L and a function called Agent_OnUnLoad, the Agent_OnUnLoad 467 function will be ignored. 468 <p/> 469 If an agent L is <i>statically linked</i>, an Agent_OnAttach_L function 470 will be invoked with the same arguments and expected return value as 471 specified for the Agent_OnAttach function. 472 If a <i>statically linked</i> agent L exports a function called 473 Agent_OnAttach_L and a function called Agent_OnAttach, the Agent_OnAttach 474 function will be ignored. 475 </intro> 476 477 <intro id="starting" label="Agent Command Line Options"> 478 The term "command-line option" is used below to 479 mean options supplied in the <code>JavaVMInitArgs</code> argument 480 to the <code>JNI_CreateJavaVM</code> function of the JNI 481 Invocation API. 482 <p/> 483 One of the two following 484 command-line options is used on VM startup to 485 properly load and run agents. 486 These arguments identify the library containing 487 the agent as well as an options 488 string to be passed in at startup. 489 <dl> 490 <dt><code>-agentlib:</code><i><agent-lib-name></i><code>=</code><i><options></i></dt> 491 <dd> 492 The name following <code>-agentlib:</code> is the name of the 493 library to load. Lookup of the library, both its full name and location, 494 proceeds in a platform-specific manner. 495 Typically, the <i><agent-lib-name></i> is expanded to an 496 operating system specific file name. 497 The <i><options></i> will be passed to the agent on start-up. 498 For example, if the option 499 <code>-agentlib:foo=opt1,opt2</code> is specified, the VM will attempt to 500 load the shared library <code>foo.dll</code> from the system <code>PATH</code> 501 under <tm>Windows</tm> or <code>libfoo.so</code> from the 502 <code>LD_LIBRARY_PATH</code> under the <tm>Solaris</tm> operating 503 environment. 504 If the agent library is statically linked into the executable 505 then no actual loading takes place. 506 <p/> 507 </dd> 508 <dt><code>-agentpath:</code><i><path-to-agent></i><code>=</code><i><options></i></dt> 509 <dd> 510 The path following <code>-agentpath:</code> is the absolute path from which 511 to load the library. 512 No library name expansion will occur. 513 The <i><options></i> will be passed to the agent on start-up. 514 For example, if the option 515 <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code> is specified, the VM will attempt to 516 load the shared library <code>c:\myLibs\foo.dll</code>. If the agent 517 library is statically linked into the executable 518 then no actual loading takes place. 519 <p/> 520 </dd> 521 </dl> 522 For a dynamic shared library agent, the start-up routine 523 <internallink id="onload"><code>Agent_OnLoad</code></internallink> 524 in the library will be invoked. If the agent library is statically linked 525 into the executable then the system will attempt to invoke the 526 <code>Agent_OnLoad_<agent-lib-name></code> entry point where 527 <agent-lib-name> is the basename of the 528 agent. In the above example <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code>, 529 the system will attempt to find and call the <code>Agent_OnLoad_foo</code> start-up routine. 530 <p/> 531 Libraries loaded with <code>-agentlib:</code> or <code>-agentpath:</code> 532 will be searched for JNI native method implementations to facilitate the 533 use of Java programming language code in tools, as is needed for 534 <internallink id="bci">bytecode instrumentation</internallink>. 535 <p/> 536 The agent libraries will be searched after all other libraries have been 537 searched (agents wishing to override or intercept the native method 538 implementations of non-agent methods can use the 539 <eventlink id="NativeMethodBind">NativeMethodBind event</eventlink>). 540 <p/> 541 These switches do the above and nothing more - they do not change the 542 state of the VM or <jvmti/>. No command line options are needed 543 to enable <jvmti/> 544 or aspects of <jvmti/>, this is handled programmatically 545 by the use of 546 <internallink id="capability">capabilities</internallink>. 547 </intro> 548 549 <intro id="startup" label="Agent Start-Up"> 550 The VM starts each agent by invoking a start-up function. 551 If the agent is started in the <code>OnLoad</code> 552 <functionlink id="GetPhase">phase</functionlink> the function 553 <internallink id="onload"><code>Agent_OnLoad</code></internallink> 554 or <internallink id="onload"><code>Agent_OnLoad_L</code></internallink> 555 for statically linked agents will be invoked. 556 If the agent is started in the live 557 <functionlink id="GetPhase">phase</functionlink> the function 558 <internallink id="onattach"><code>Agent_OnAttach</code></internallink> 559 or <internallink id="onattach"><code>Agent_OnAttach_L</code></internallink> 560 for statically linked agents will be invoked. 561 Exactly one call to a start-up function is made per agent. 562 </intro> 563 564 <intro id="onload" label="Agent Start-Up (OnLoad phase)"> 565 If an agent is started during the <code>OnLoad</code> phase then its 566 agent library must export a start-up function with the following prototype: 567 <example> 568 JNIEXPORT jint JNICALL 569 Agent_OnLoad(JavaVM *vm, char *options, void *reserved)</example> 570 Or for a statically linked agent named 'L': 571 <example> 572 JNIEXPORT jint JNICALL 573 Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved)</example> 574 575 The VM will start the agent by calling this function. 576 It will be called early enough in VM initialization that: 577 <ul> 578 <li><functionlink id="SetSystemProperty">system properties</functionlink> 579 may be set before they have been used in the start-up of the VM</li> 580 <li>the full set of 581 <internallink id="capability">capabilities</internallink> 582 is still available (note that capabilities that configure the VM 583 may only be available at this time--see the 584 <internallink id="capability">Capability function section</internallink>)</li> 585 <li>no bytecodes have executed</li> 586 <li>no classes have been loaded</li> 587 <li>no objects have been created</li> 588 </ul> 589 <p/> 590 The VM will call the <code>Agent_OnLoad</code> or 591 <code>Agent_OnLoad_<agent-lib-name></code> function with 592 <i><options></i> as the second argument - 593 that is, using the command-line option examples, 594 <code>"opt1,opt2"</code> will be passed to the <code>char *options</code> 595 argument of <code>Agent_OnLoad</code>. 596 The <code>options</code> argument is encoded as a 597 <internallink id="mUTF">modified UTF-8</internallink> string. 598 If <i>=<options></i> is not specified, 599 a zero length string is passed to <code>options</code>. 600 The lifespan of the <code>options</code> string is the 601 <code>Agent_OnLoad</code> or <code>Agent_OnLoad_<agent-lib-name></code> 602 call. If needed beyond this time the string or parts of the string must 603 be copied. 604 The period between when <code>Agent_OnLoad</code> is called and when it 605 returns is called the <i>OnLoad phase</i>. 606 Since the VM is not initialized during the OnLoad 607 <functionlink id="GetPhase">phase</functionlink>, 608 the set of allowed operations 609 inside <code>Agent_OnLoad</code> is restricted (see the function descriptions for the 610 functionality available at this time). 611 The agent can safely process the options and set 612 event callbacks with <functionlink id="SetEventCallbacks"></functionlink>. Once 613 the VM initialization event is received 614 (that is, the <eventlink id="VMInit">VMInit</eventlink> 615 callback is invoked), the agent 616 can complete its initialization. 617 <rationale> 618 Early startup is required so that agents can set the desired capabilities, 619 many of which must be set before the VM is initialized. 620 In JVMDI, the -Xdebug command-line option provided 621 very coarse-grain control of capabilities. 622 JVMPI implementations use various tricks to provide a single "JVMPI on" switch. 623 No reasonable command-line 624 option could provide the fine-grain of control required to balance needed capabilities vs 625 performance impact. 626 Early startup is also needed so that agents can control the execution 627 environment - modifying the file system and system properties to install 628 their functionality. 629 </rationale> 630 <p/> 631 The return value from <code>Agent_OnLoad</code> or 632 <code>Agent_OnLoad_<agent-lib-name></code> is used to indicate an error. 633 Any value other than zero indicates an error and causes termination of the VM. 634 </intro> 635 636 <intro id="onattach" label="Agent Start-Up (Live phase)"> 637 A VM may support a mechanism that allows agents to be started in the VM during the live 638 <functionlink id="GetPhase">phase</functionlink>. The details of how this is supported, 639 are implementation specific. For example, a tool may use some platform specific mechanism, 640 or implementation specific API, to attach to the running VM, and request it start a given 641 agent. 642 <p/> 643 If an agent is started during the live phase then its agent library 644 must export a start-up function 645 with the following prototype: 646 <example> 647 JNIEXPORT jint JNICALL 648 Agent_OnAttach(JavaVM* vm, char *options, void *reserved)</example> 649 Or for a statically linked agent named 'L': 650 <example> 651 JNIEXPORT jint JNICALL 652 Agent_OnAttach_L(JavaVM* vm, char *options, void *reserved)</example> 653 654 <p/> 655 The VM will start the agent by calling this function. 656 It will be called in the context of a thread 657 that is attached to the VM. The first argument <i><vm></i> is the Java VM. 658 The <i><options></i> argument is the startup options provided to the agent. 659 <i><options></i> is encoded as a <internallink id="mUTF">modified UTF-8 660 </internallink> string. 661 If startup options were not provided, a zero length string is passed to 662 <code>options</code>. The lifespan of the <code>options</code> string is the 663 <code>Agent_OnAttach</code> or <code>Agent_OnAttach_<agent-lib-name></code> call. 664 If needed beyond this time the string or parts of the string must be copied. 665 <p/> 666 Note that some <internallink id="capability">capabilities</internallink> 667 may not be available in the live phase. 668 <p/> 669 The <code>Agent_OnAttach</code> or <code>Agent_OnAttach_<agent-lib-name 670 ></code> function initializes the agent and returns a value 671 to the VM to indicate if an error occurred. Any value other than zero indicates an error. 672 An error does not cause the VM to terminate. Instead the VM ignores the error, or takes 673 some implementation specific action -- for example it might print an error to standard error, 674 or record the error in a system log. 675 </intro> 676 677 <intro id="onunload" label="Agent Shutdown"> 678 The library may optionally export a 679 shutdown function with the following prototype: 680 <example> 681 JNIEXPORT void JNICALL 682 Agent_OnUnload(JavaVM *vm)</example> 683 Or for a statically linked agent named 'L': 684 <example> 685 JNIEXPORT void JNICALL 686 Agent_OnUnload_L(JavaVM *vm)</example> 687 688 This function will be called by the VM when the library is about to be unloaded. 689 The library will be unloaded (unless it is statically linked into the 690 executable) and this function will be called if some platform specific 691 mechanism causes the unload (an unload mechanism is not specified in this document) 692 or the library is (in effect) unloaded by the termination of the VM whether through 693 normal termination or VM failure, including start-up failure. 694 Uncontrolled shutdown is, of couse, an exception to this rule. 695 Note the distinction between this function and the 696 <eventlink id="VMDeath">VM Death event</eventlink>: for the VM Death event 697 to be sent, the VM must have run at least to the point of initialization and a valid 698 <jvmti/> environment must exist which has set a callback for VMDeath 699 and enabled the event. 700 None of these are required for <code>Agent_OnUnload</code> or 701 <code>Agent_OnUnload_<agent-lib-name></code> and this function 702 is also called if the library is unloaded for other reasons. 703 In the case that a VM Death event is sent, it will be sent before this 704 function is called (assuming this function is called due to VM termination). 705 This function can be used to clean-up resources allocated by the agent. 706 </intro> 707 708 <intro id="tooloptions" label="JAVA_TOOL_OPTIONS"> 709 Since the command-line cannot always be accessed or modified, for example in embedded VMs 710 or simply VMs launched deep within scripts, a <code>JAVA_TOOL_OPTIONS</code> variable is 711 provided so that agents may be launched in these cases. 712 <p/> 713 Platforms which support environment variables or other named strings, may support the 714 <code>JAVA_TOOL_OPTIONS</code> variable. This variable will be broken into options at white-space 715 boundaries. White-space characters include space, tab, carriage-return, new-line, 716 vertical-tab, and form-feed. Sequences of white-space characters are considered 717 equivalent to a single white-space character. No white-space is included in the options 718 unless quoted. Quoting is as follows: 719 <ul> 720 <li>All characters enclosed between a pair of single quote marks (''), except a single 721 quote, are quoted.</li> 722 <li>Double quote characters have no special meaning inside a pair of single quote marks.</li> 723 <li>All characters enclosed between a pair of double quote marks (""), except a double 724 quote, are quoted.</li> 725 <li>Single quote characters have no special meaning inside a pair of double quote marks.</li> 726 <li>A quoted part can start or end anywhere in the variable.</li> 727 <li>White-space characters have no special meaning when quoted -- they are included in 728 the option like any other character and do not mark white-space boundaries.</li> 729 <li>The pair of quote marks is not included in the option.</li> 730 </ul> 731 <code>JNI_CreateJavaVM</code> (in the JNI Invocation API) will prepend these options to the options supplied 732 in its <code>JavaVMInitArgs</code> argument. Platforms may disable this feature in cases where security is 733 a concern; for example, the Reference Implementation disables this feature on Unix systems when 734 the effective user or group ID differs from the real ID. 735 This feature is intended to support the initialization of tools -- specifically including the 736 launching of native or Java programming language agents. Multiple tools may wish to use this 737 feature, so the variable should not be overwritten, instead, options should be appended to 738 the variable. Note that since the variable is processed at the time of the JNI Invocation 739 API create VM call, options processed by a launcher (e.g., VM selection options) will not be handled. 740 </intro> 741 742 <intro id="environments" label="Environments"> 743 The <jvmti/> specification supports the use of multiple simultaneous 744 <jvmti/> agents. 745 Each agent has its own <jvmti/> environment. 746 That is, the <jvmti/> state is 747 separate for each agent - changes to one environment do not affect the 748 others. The state of a <jvmti/> 749 environment includes: 750 <ul> 751 <li><functionlink id="SetEventCallbacks">the event callbacks</functionlink></li> 752 <li><functionlink id="SetEventNotificationMode">the set of events which are enabled</functionlink></li> 753 <li><internallink id="capability">the capabilities</internallink></li> 754 <li><internallink id="memory">the memory allocation/deallocation hooks</internallink></li> 755 </ul> 756 Although their <jvmti/> state 757 is separate, agents inspect and modify the shared state 758 of the VM, they also share the native environment in which they execute. 759 As such, an agent can perturb the results of other agents or cause them 760 to fail. It is the responsibility of the agent writer to specify the level 761 of compatibility with other agents. <jvmti/> implementations are not capable 762 of preventing destructive interactions between agents. Techniques to reduce 763 the likelihood of these occurrences are beyond the scope of this document. 764 <p/> 765 An agent creates a <jvmti/> environment 766 by passing a <jvmti/> version 767 as the interface ID to the JNI Invocation API function 768 <externallink id="jni/invocation.html#getenv"> 769 <code>GetEnv</code></externallink>. 770 See <internallink id="jvmtiEnvAccess">Accessing <jvmti/> Functions</internallink> 771 for more details on the creation and use of 772 <jvmti/> environments. 773 Typically, <jvmti/> environments are created by calling <code>GetEnv</code> from 774 <internallink id="onload"><code>Agent_OnLoad</code></internallink>. 775 </intro> 776 777 <intro id="bci" label="Bytecode Instrumentation"> 778 This interface does not include some events that one might expect in an interface with 779 profiling support. Some examples include object allocation events and full speed 780 method enter and exit events. The interface instead provides support for 781 <i>bytecode instrumentation</i>, the ability to alter the Java virtual machine 782 bytecode instructions which comprise the target program. Typically, these alterations 783 are to add "events" to the code of a method - for example, to add, at the beginning of a method, 784 a call to <code>MyProfiler.methodEntered()</code>. 785 Since the changes are purely additive, they do not modify application 786 state or behavior. 787 Because the inserted agent code is standard bytecodes, the VM can run at full speed, 788 optimizing not only the target program but also the instrumentation. If the 789 instrumentation does not involve switching from bytecode execution, no expensive 790 state transitions are needed. The result is high performance events. 791 This approach also provides complete control to the agent: instrumentation can be 792 restricted to "interesting" portions of the code (e.g., the end user's code) and 793 can be conditional. Instrumentation can run entirely in Java programming language 794 code or can call into the native agent. Instrumentation can simply maintain 795 counters or can statistically sample events. 796 <p/> 797 Instrumentation can be inserted in one of three ways: 798 <ul> 799 <li> 800 Static Instrumentation: The class file is instrumented before it 801 is loaded into the VM - for example, by creating a duplicate directory of 802 <code>*.class</code> files which have been modified to add the instrumentation. 803 This method is extremely awkward and, in general, an agent cannot know 804 the origin of the class files which will be loaded. 805 </li> 806 <li> 807 Load-Time Instrumentation: When a class file is loaded by the VM, the raw 808 bytes of the class file are sent for instrumentation to the agent. 809 The <eventlink id="ClassFileLoadHook"/> 810 event, triggered by the class load, 811 provides this functionality. This mechanism provides efficient 812 and complete access to one-time instrumentation. 813 </li> 814 <li> 815 Dynamic Instrumentation: A class which is already loaded (and possibly 816 even running) is modified. This optional feature is provided by the 817 <eventlink id="ClassFileLoadHook"/> event, triggered by calling the 818 <functionlink id="RetransformClasses"/> function. 819 Classes can be modified multiple times and can be returned to their 820 original state. 821 The mechanism allows instrumentation which changes during the 822 course of execution. 823 </li> 824 </ul> 825 <p/> 826 The class modification functionality provided in this interface 827 is intended to provide a mechanism for instrumentation 828 (the <eventlink id="ClassFileLoadHook"/> event 829 and the <functionlink id="RetransformClasses"/> function) 830 and, during development, for fix-and-continue debugging 831 (the <functionlink id="RedefineClasses"/> function). 832 <p/> 833 Care must be taken to avoid perturbing dependencies, especially when 834 instrumenting core classes. For example, an approach to getting notification 835 of every object allocation is to instrument the constructor on 836 <code>Object</code>. Assuming that the constructor is initially 837 empty, the constructor could be changed to: 838 <example> 839 public Object() { 840 MyProfiler.allocationTracker(this); 841 } 842 </example> 843 However, if this change was made using the 844 <eventlink id="ClassFileLoadHook"/> 845 event then this might impact a typical VM as follows: 846 the first created object will call the constructor causing a class load of 847 <code>MyProfiler</code>; which will then cause 848 object creation, and since <code>MyProfiler</code> isn't loaded yet, 849 infinite recursion; resulting in a stack overflow. A refinement of this 850 would be to delay invoking the tracking method until a safe time. For 851 example, <code>trackAllocations</code> could be set in the 852 handler for the <code>VMInit</code> event. 853 <example> 854 static boolean trackAllocations = false; 855 856 public Object() { 857 if (trackAllocations) { 858 MyProfiler.allocationTracker(this); 859 } 860 } 861 </example> 862 <p/> 863 The <functionlink id="SetNativeMethodPrefix"/> allows native methods 864 to be instrumented by the use of wrapper methods. 865 </intro> 866 867 <intro id="bcimodules" label="Bytecode Instrumentation of code in modules"> 868 Agents can use the functions <functionlink id="AddModuleReads"/>, 869 <functionlink id="AddModuleExports"/>, <functionlink id="AddModuleOpens"/>, 870 <functionlink id="AddModuleUses"/> and <functionlink id="AddModuleProvides"/> 871 to update a module to expand the set of modules that it reads, the set of 872 packages that it exports or opens to other modules, or the services that it 873 uses and provides. 874 <p/> 875 As an aid to agents that deploy supporting classes on the search path of 876 the bootstrap class loader, or the search path of the class loader that 877 loads the main class, the Java virtual machine arranges for the module 878 of classes transformed by the <eventlink id="ClassFileLoadHook"/> event to 879 read the unnamed module of both class loaders. 880 </intro> 881 882 <intro id="mUTF" label="Modified UTF-8 String Encoding"> 883 <jvmti/> uses modified UTF-8 to encode character strings. 884 This is the same encoding used by JNI. 885 Modified UTF-8 differs 886 from standard UTF-8 in the representation of supplementary characters 887 and of the null character. See the 888 <externallink id="jni/types.html#modified-utf-8-strings"> 889 Modified UTF-8 Strings</externallink> 890 section of the JNI specification for details. 891 </intro> 892 893 <intro id="context" label="Specification Context"> 894 Since this interface provides access to the state of applications running in the 895 Java virtual machine; 896 terminology refers to the Java platform and not the native 897 platform (unless stated otherwise). For example: 898 <ul> 899 <li>"thread" means Java programming language thread.</li> 900 <li>"stack frame" means Java virtual machine stack frame.</li> 901 <li>"class" means Java programming language class.</li> 902 <li>"heap" means Java virtual machine heap.</li> 903 <li>"monitor" means Java programming language object monitor.</li> 904 </ul> 905 <p/> 906 Sun, Sun Microsystems, the Sun logo, Java, and JVM 907 are trademarks or registered trademarks of Oracle 908 and/or its affiliates, in the U.S. and other countries. 909 </intro> 910 911 912 <functionsection label="Functions"> 913 <intro id="jvmtiEnvAccess" label="Accessing Functions"> 914 Native code accesses <jvmti/> features 915 by calling <jvmti/> functions. 916 Access to <jvmti/> functions is by use of an interface pointer 917 in the same manner as 918 <externallink id="jni/design.html">Java 919 Native Interface (JNI) functions</externallink> are accessed. 920 The <jvmti/> interface pointer is called the 921 <i>environment pointer</i>. 922 <p/> 923 An environment pointer is a pointer to an environment and has 924 the type <code>jvmtiEnv*</code>. 925 An environment has information about its <jvmti/> connection. 926 The first value in the environment is a pointer to the function table. 927 The function table is an array of pointers to <jvmti/> functions. 928 Every function pointer is at a predefined offset inside the 929 array. 930 <p/> 931 When used from the C language: 932 double indirection is used to access the functions; 933 the environment pointer provides context and is the first 934 parameter of each function call; for example: 935 <example> 936 jvmtiEnv *jvmti; 937 ... 938 jvmtiError err = (*jvmti)->GetLoadedClasses(jvmti, &class_count, &classes); 939 </example> 940 <p/> 941 When used from the C++ language: 942 functions are accessed as member functions of <code>jvmtiEnv</code>; 943 the environment pointer is not passed to the function call; for example: 944 <example> 945 jvmtiEnv *jvmti; 946 ... 947 jvmtiError err = jvmti->GetLoadedClasses(&class_count, &classes); 948 </example> 949 Unless otherwise stated, all examples and declarations in this 950 specification use the C language. 951 <p/> 952 A <jvmti/> environment can be obtained through the JNI Invocation API 953 <code>GetEnv</code> function: 954 <example> 955 jvmtiEnv *jvmti; 956 ... 957 (*jvm)->GetEnv(jvm, &jvmti, JVMTI_VERSION_1_0); 958 </example> 959 Each call to <code>GetEnv</code> 960 creates a new <jvmti/> connection and thus 961 a new <jvmti/> environment. 962 The <code>version</code> argument of <code>GetEnv</code> must be 963 a <jvmti/> version. 964 The returned environment may have a different version than the 965 requested version but the returned environment must be compatible. 966 <code>GetEnv</code> will return <code>JNI_EVERSION</code> if a 967 compatible version is not available, if <jvmti/> is not supported or 968 <jvmti/> is not supported in the current VM configuration. 969 Other interfaces may be added for creating <jvmti/> environments 970 in specific contexts. 971 Each environment has its own state (for example, 972 <functionlink id="SetEventNotificationMode">desired events</functionlink>, 973 <functionlink id="SetEventCallbacks">event handling functions</functionlink>, and 974 <functionlink id="AddCapabilities">capabilities</functionlink>). 975 An environment is released with 976 <functionlink id="DisposeEnvironment"></functionlink>. 977 Thus, unlike JNI which has one environment per thread, <jvmti/> environments work 978 across threads and are created dynamically. 979 </intro> 980 981 <intro id="functionReturn" label="Function Return Values"> 982 <jvmti/> functions always return an 983 <internallink id="ErrorSection">error code</internallink> via the 984 <datalink id="jvmtiError"/> function return value. 985 Some functions can return additional 986 values through pointers provided by the calling function. 987 In some cases, <jvmti/> functions allocate memory that your program must 988 explicitly deallocate. This is indicated in the individual <jvmti/> 989 function descriptions. Empty lists, arrays, sequences, etc are 990 returned as <code>NULL</code>. 991 <p/> 992 In the event that the <jvmti/> function encounters 993 an error (any return value other than <code>JVMTI_ERROR_NONE</code>) the values 994 of memory referenced by argument pointers is undefined, but no memory 995 will have been allocated and no global references will have been allocated. 996 If the error occurs because of invalid input, no action will have occurred. 997 </intro> 998 999 <intro id="refs" label="Managing JNI Object References"> 1000 <jvmti/> functions identify objects with JNI references 1001 (<datalink id="jobject"/> and <datalink id="jclass"/>) 1002 and their derivatives 1003 (<datalink id="jthread"/> and <datalink id="jthreadGroup"/>). 1004 References passed to 1005 <jvmti/> functions can be either global or local, but they must be 1006 strong references. All references returned by <jvmti/> functions are 1007 local references--these local references are created 1008 during the <jvmti/> call. 1009 Local references are a resource that must be managed (see the 1010 <externallink id="jni/functions.html#local-references"> 1011 JNI Documentation</externallink>). 1012 When threads return from native code all local references 1013 are freed. Note that some threads, including typical 1014 agent threads, will never return from native code. 1015 A thread is ensured the ability to create sixteen local 1016 references without the need for any explicit management. 1017 For threads executing a limited number of <jvmti/> calls before 1018 returning from native code 1019 (for example, threads processing events), 1020 it may be determined that no explicit management 1021 is needed. 1022 However, long running agent threads will need explicit 1023 local reference management--usually with the JNI functions 1024 <code>PushLocalFrame</code> and <code>PopLocalFrame</code>. 1025 Conversely, to preserve references beyond the 1026 return from native code, they must be converted to global references. 1027 These rules do not apply to <datalink id="jmethodID"/> and <datalink id="jfieldID"/> 1028 as they are not <datalink id="jobject"/>s. 1029 </intro> 1030 1031 <intro id="prereqState" label="Prerequisite State for Calling Functions"> 1032 Unless the function explicitly states that the agent must bring 1033 a thread or the VM to a particular state (for example, suspended), 1034 the <jvmti/> implementation is responsible for bringing the VM to a 1035 safe and consistent state for performing the function. 1036 </intro> 1037 1038 <intro id="functionsExceptions" label="Exceptions and Functions"> 1039 <jvmti/> functions never throw exceptions; error conditions are 1040 communicated via the 1041 <internallink id="functionReturn">function return value</internallink>. 1042 Any existing exception state is preserved across a call to a 1043 <jvmti/> function. 1044 See the 1045 <externallink 1046 id="jni/design.html#java-exceptions" 1047 >Java Exceptions</externallink> 1048 section of the JNI specification for information on handling exceptions. 1049 </intro> 1050 1051 <category id="memory" label="Memory Management"> 1052 <intro> 1053 These functions provide for the allocation and deallocation of 1054 memory used by <jvmti/> functionality and can be used to provide 1055 working memory for agents. 1056 Memory managed by <jvmti/> is not compatible with other memory 1057 allocation libraries and mechanisms. 1058 </intro> 1059 1060 <function id="Allocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="46"> 1061 <synopsis>Allocate</synopsis> 1062 <description> 1063 Allocate an area of memory through the <jvmti/> allocator. 1064 The allocated 1065 memory should be freed with <functionlink id="Deallocate"></functionlink>. 1066 </description> 1067 <origin>jvmdi</origin> 1068 <capabilities> 1069 </capabilities> 1070 <parameters> 1071 <param id="size"> 1072 <jlong/> 1073 <description> 1074 The number of bytes to allocate. 1075 <rationale> 1076 <code>jlong</code> is used for compatibility with JVMDI. 1077 </rationale> 1078 </description> 1079 </param> 1080 <param id="mem_ptr"> 1081 <allocbuf incount="size"><uchar/></allocbuf> 1082 <description> 1083 On return, a pointer to the beginning of the allocated memory. 1084 If <code>size</code> is zero, <code>NULL</code> is returned. 1085 </description> 1086 </param> 1087 </parameters> 1088 <errors> 1089 <error id="JVMTI_ERROR_OUT_OF_MEMORY"> 1090 Memory request cannot be honored. 1091 </error> 1092 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 1093 <paramlink id="size"></paramlink> is less than zero. 1094 </error> 1095 </errors> 1096 </function> 1097 1098 <function id="Deallocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="47"> 1099 <synopsis>Deallocate</synopsis> 1100 <description> 1101 Deallocate <code>mem</code> using the <jvmti/> allocator. 1102 This function should 1103 be used to deallocate any memory allocated and returned 1104 by a <jvmti/> function 1105 (including memory allocated with <functionlink id="Allocate"></functionlink>). 1106 All allocated memory must be deallocated 1107 or the memory cannot be reclaimed. 1108 </description> 1109 <origin>jvmdi</origin> 1110 <capabilities> 1111 </capabilities> 1112 <parameters> 1113 <param id="mem"> 1114 <outbuf> 1115 <uchar/> 1116 <nullok>the call is ignored</nullok> 1117 </outbuf> 1118 <description> 1119 A pointer to the beginning of the allocated memory. 1120 Please ignore "On return, the elements are set." 1121 <todo>keep it from generating "On return, the elements are set"</todo> 1122 </description> 1123 </param> 1124 </parameters> 1125 <errors> 1126 </errors> 1127 </function> 1128 </category> 1129 1130 <category id="threadCategory" label="Thread"> 1131 <intro> 1132 </intro> 1133 1134 <function id="GetThreadState" num="17"> 1135 <synopsis>Get Thread State</synopsis> 1136 <description> 1137 Get the state of a thread. The state of the thread is represented by the 1138 answers to the hierarchical set of questions below: 1139 <ul type="circle"> 1140 <li><i>Alive?</i> 1141 <ul> 1142 <li>Not alive. 1143 <ul type="circle"> 1144 <li><i>Why not alive?</i> 1145 <ul> 1146 <li>New.</li> 1147 <li>Terminated (<datalink 1148 id="JVMTI_THREAD_STATE_TERMINATED"><code>JVMTI_THREAD_STATE_TERMINATED</code></datalink>)</li> 1149 </ul> 1150 </li> 1151 </ul> 1152 </li> 1153 <li>Alive (<datalink 1154 id="JVMTI_THREAD_STATE_ALIVE"><code>JVMTI_THREAD_STATE_ALIVE</code></datalink>) 1155 <ul type="circle"> 1156 <li><i>Suspended?</i> 1157 <ul> 1158 <li>Suspended (<datalink 1159 id="JVMTI_THREAD_STATE_SUSPENDED"><code>JVMTI_THREAD_STATE_SUSPENDED</code></datalink>)</li> 1160 <li>Not suspended</li> 1161 </ul> 1162 </li> 1163 <li><i>Interrupted?</i> 1164 <ul> 1165 <li>Interrupted (<datalink 1166 id="JVMTI_THREAD_STATE_INTERRUPTED"><code>JVMTI_THREAD_STATE_INTERRUPTED</code></datalink>)</li> 1167 <li>Not interrupted.</li> 1168 </ul> 1169 </li> 1170 <li><i>In native?</i> 1171 <ul> 1172 <li>In native code (<datalink 1173 id="JVMTI_THREAD_STATE_IN_NATIVE"><code>JVMTI_THREAD_STATE_IN_NATIVE</code></datalink>)</li> 1174 <li>In Java programming language code</li> 1175 </ul> 1176 </li> 1177 <li><i>What alive state?</i> 1178 <ul> 1179 <li>Runnable (<datalink 1180 id="JVMTI_THREAD_STATE_RUNNABLE"><code>JVMTI_THREAD_STATE_RUNNABLE</code></datalink>)</li> 1181 <li>Blocked (<datalink 1182 id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER"><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></datalink>)</li> 1183 <li>Waiting (<datalink 1184 id="JVMTI_THREAD_STATE_WAITING"><code>JVMTI_THREAD_STATE_WAITING</code></datalink>) 1185 <ul type="circle"> 1186 <li><i>Timed wait?</i> 1187 <ul> 1188 <li>Indefinite (<datalink 1189 id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY"><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></datalink></li> 1190 <li>Timed (<datalink 1191 id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT"><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></datalink>)</li> 1192 </ul> 1193 </li> 1194 <li><i>Why waiting?</i> 1195 <ul> 1196 <li>Object.wait (<datalink 1197 id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT"><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></datalink>)</li> 1198 <li>LockSupport.park (<datalink 1199 id="JVMTI_THREAD_STATE_PARKED"><code>JVMTI_THREAD_STATE_PARKED</code></datalink>)</li> 1200 <li>Sleeping (<datalink 1201 id="JVMTI_THREAD_STATE_SLEEPING"><code>JVMTI_THREAD_STATE_SLEEPING</code></datalink>)</li> 1202 </ul> 1203 </li> 1204 </ul> 1205 </li> 1206 </ul> 1207 </li> 1208 </ul> 1209 </li> 1210 </ul> 1211 </li> 1212 </ul> 1213 <p/> 1214 The answers are represented by the following bit vector. 1215 <constants id="jvmtiThreadState" label="Thread State Flags" kind="bits"> 1216 <constant id="JVMTI_THREAD_STATE_ALIVE" num="0x0001"> 1217 Thread is alive. Zero if thread is new (not started) or terminated. 1218 </constant> 1219 <constant id="JVMTI_THREAD_STATE_TERMINATED" num="0x0002"> 1220 Thread has completed execution. 1221 </constant> 1222 <constant id="JVMTI_THREAD_STATE_RUNNABLE" num="0x0004"> 1223 Thread is runnable. 1224 </constant> 1225 <constant id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER" num="0x0400"> 1226 Thread is waiting to enter a synchronization block/method or, 1227 after an <code>Object.wait()</code>, waiting to re-enter a 1228 synchronization block/method. 1229 </constant> 1230 <constant id="JVMTI_THREAD_STATE_WAITING" num="0x0080"> 1231 Thread is waiting. 1232 </constant> 1233 <constant id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY" num="0x0010"> 1234 Thread is waiting without a timeout. 1235 For example, <code>Object.wait()</code>. 1236 </constant> 1237 <constant id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT" num="0x0020"> 1238 Thread is waiting with a maximum time to wait specified. 1239 For example, <code>Object.wait(long)</code>. 1240 </constant> 1241 <constant id="JVMTI_THREAD_STATE_SLEEPING" num="0x0040"> 1242 Thread is sleeping -- <code>Thread.sleep(long)</code>. 1243 </constant> 1244 <constant id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT" num="0x0100"> 1245 Thread is waiting on an object monitor -- <code>Object.wait</code>. 1246 </constant> 1247 <constant id="JVMTI_THREAD_STATE_PARKED" num="0x0200"> 1248 Thread is parked, for example: <code>LockSupport.park</code>, 1249 <code>LockSupport.parkUtil</code> and <code>LockSupport.parkNanos</code>. 1250 </constant> 1251 <constant id="JVMTI_THREAD_STATE_SUSPENDED" num="0x100000"> 1252 Thread suspended. 1253 <code>java.lang.Thread.suspend()</code> 1254 or a <jvmti/> suspend function 1255 (such as <functionlink id="SuspendThread"></functionlink>) 1256 has been called on the thread. If this bit 1257 is set, the other bits refer to the thread state before suspension. 1258 </constant> 1259 <constant id="JVMTI_THREAD_STATE_INTERRUPTED" num="0x200000"> 1260 Thread has been interrupted. 1261 </constant> 1262 <constant id="JVMTI_THREAD_STATE_IN_NATIVE" num="0x400000"> 1263 Thread is in native code--that is, a native method is running 1264 which has not called back into the VM or Java programming 1265 language code. 1266 <p/> 1267 This flag is not set when running VM compiled Java programming 1268 language code nor is it set when running VM code or 1269 VM support code. Native VM interface functions, such as JNI and 1270 <jvmti/> functions, may be implemented as VM code. 1271 </constant> 1272 <constant id="JVMTI_THREAD_STATE_VENDOR_1" num="0x10000000"> 1273 Defined by VM vendor. 1274 </constant> 1275 <constant id="JVMTI_THREAD_STATE_VENDOR_2" num="0x20000000"> 1276 Defined by VM vendor. 1277 </constant> 1278 <constant id="JVMTI_THREAD_STATE_VENDOR_3" num="0x40000000"> 1279 Defined by VM vendor. 1280 </constant> 1281 </constants> 1282 The following definitions are used to convert <jvmti/> thread state 1283 to <code>java.lang.Thread.State</code> style states. 1284 <constants id="jvmtiJavaLangThreadState" label="java.lang.Thread.State Conversion Masks" kind="bits"> 1285 <constant id="JVMTI_JAVA_LANG_THREAD_STATE_MASK" 1286 num="JVMTI_THREAD_STATE_TERMINATED | JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT"> 1287 Mask the state with this before comparison 1288 </constant> 1289 <constant id="JVMTI_JAVA_LANG_THREAD_STATE_NEW" 1290 num="0"> 1291 <code>java.lang.Thread.State.NEW</code> 1292 </constant> 1293 <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED" 1294 num="JVMTI_THREAD_STATE_TERMINATED"> 1295 <code>java.lang.Thread.State.TERMINATED</code> 1296 </constant> 1297 <constant id="JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE" 1298 num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE"> 1299 <code>java.lang.Thread.State.RUNNABLE</code> 1300 </constant> 1301 <constant id="JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED" 1302 num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER"> 1303 <code>java.lang.Thread.State.BLOCKED</code> 1304 </constant> 1305 <constant id="JVMTI_JAVA_LANG_THREAD_STATE_WAITING" 1306 num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY"> 1307 <code>java.lang.Thread.State.WAITING</code> 1308 </constant> 1309 <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING" 1310 num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT"> 1311 <code>java.lang.Thread.State.TIMED_WAITING</code> 1312 </constant> 1313 </constants> 1314 <b>Rules</b> 1315 <p/> 1316 There can be no more than one answer to a question, although there can be no 1317 answer (because the answer is unknown, does not apply, or none of the answers is 1318 correct). An answer is set only when the enclosing answers match. 1319 That is, no more than one of 1320 <ul type="circle"> 1321 <li><code>JVMTI_THREAD_STATE_RUNNABLE</code></li> 1322 <li><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></li> 1323 <li><code>JVMTI_THREAD_STATE_WAITING</code></li> 1324 </ul> 1325 can be set (a <tm>J2SE</tm> compliant implementation will always set 1326 one of these if <code>JVMTI_THREAD_STATE_ALIVE</code> is set). 1327 And if any of these are set, the enclosing answer 1328 <code>JVMTI_THREAD_STATE_ALIVE</code> is set. 1329 No more than one of 1330 <ul type="circle"> 1331 <li><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></li> 1332 <li><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></li> 1333 </ul> 1334 can be set (a <tm>J2SE</tm> compliant implementation will always set 1335 one of these if <code>JVMTI_THREAD_STATE_WAITING</code> is set). 1336 And if either is set, the enclosing answers 1337 <code>JVMTI_THREAD_STATE_ALIVE</code> and 1338 <code>JVMTI_THREAD_STATE_WAITING</code> are set. 1339 No more than one of 1340 <ul type="circle"> 1341 <li><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></li> 1342 <li><code>JVMTI_THREAD_STATE_PARKED</code></li> 1343 <li><code>JVMTI_THREAD_STATE_SLEEPING</code></li> 1344 </ul> 1345 can be set. And if any of these is set, the enclosing answers 1346 <code>JVMTI_THREAD_STATE_ALIVE</code> and 1347 <code>JVMTI_THREAD_STATE_WAITING</code> are set. 1348 Also, if <code>JVMTI_THREAD_STATE_SLEEPING</code> is set, 1349 then <code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code> is set. 1350 If a state <i>A</i> is implemented using the mechanism of 1351 state <i>B</i> then it is state <i>A</i> which 1352 is returned by this function. 1353 For example, if <code>Thread.sleep(long)</code> 1354 is implemented using <code>Object.wait(long)</code> 1355 then it is still <code>JVMTI_THREAD_STATE_SLEEPING</code> 1356 which is returned. 1357 More than one of 1358 <ul type="circle"> 1359 <li><code>JVMTI_THREAD_STATE_SUSPENDED</code></li> 1360 <li><code>JVMTI_THREAD_STATE_INTERRUPTED</code></li> 1361 <li><code>JVMTI_THREAD_STATE_IN_NATIVE</code></li> 1362 </ul> 1363 can be set, but if any is set, 1364 <code>JVMTI_THREAD_STATE_ALIVE</code> is set. 1365 <p/> 1366 And finally, 1367 <code>JVMTI_THREAD_STATE_TERMINATED</code> cannot be set unless 1368 <code>JVMTI_THREAD_STATE_ALIVE</code> is not set. 1369 <p/> 1370 The thread state representation is designed for extension in future versions 1371 of the specification; thread state values should be used accordingly, that is 1372 they should not be used as ordinals. 1373 Most queries can be made by testing a single bit, if use in a switch statement is desired, 1374 the state bits should be masked with the interesting bits. 1375 All bits not defined above are reserved for future use. 1376 A VM, compliant to the current specification, must set reserved bits to zero. 1377 An agent should ignore reserved bits -- 1378 they should not be assumed to be zero and thus should not be included in comparisons. 1379 <p/> 1380 <b>Examples</b> 1381 <p/> 1382 Note that the values below exclude reserved and vendor bits. 1383 <p/> 1384 The state of a thread blocked at a <code>synchronized</code>-statement would be: 1385 <example> 1386 JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER 1387 </example> 1388 The state of a thread which hasn't started yet would be: 1389 <example> 1390 0 1391 </example> 1392 The state of a thread at a <code>Object.wait(3000)</code> would be: 1393 <example> 1394 JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_WAITING + 1395 JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT + 1396 JVMTI_THREAD_STATE_MONITOR_WAITING 1397 </example> 1398 The state of a thread suspended while runnable would be: 1399 <example> 1400 JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_RUNNABLE + JVMTI_THREAD_STATE_SUSPENDED 1401 </example> 1402 <p/> 1403 <b>Testing the State</b> 1404 <p/> 1405 In most cases, the thread state can be determined by testing the one bit corresponding 1406 to that question. For example, the code to test if a thread is sleeping: 1407 <example> 1408 jint state; 1409 jvmtiError err; 1410 1411 err = (*jvmti)->GetThreadState(jvmti, thread, &state); 1412 if (err == JVMTI_ERROR_NONE) { 1413 if (state & JVMTI_THREAD_STATE_SLEEPING) { ... 1414 </example> 1415 <p/> 1416 For waiting (that is, in <code>Object.wait</code>, parked, or sleeping) it would be: 1417 <example> 1418 if (state & JVMTI_THREAD_STATE_WAITING) { ... 1419 </example> 1420 For some states, more than one bit will need to be tested as is the case 1421 when testing if a thread has not yet been started: 1422 <example> 1423 if ((state & (JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_TERMINATED)) == 0) { ... 1424 </example> 1425 To distinguish timed from untimed <code>Object.wait</code>: 1426 <example> 1427 if (state & JVMTI_THREAD_STATE_IN_OBJECT_WAIT) { 1428 if (state & JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT) { 1429 printf("in Object.wait(long timeout)\n"); 1430 } else { 1431 printf("in Object.wait()\n"); 1432 } 1433 } 1434 </example> 1435 <p/> 1436 <b>Relationship to <code>java.lang.Thread.State</code></b> 1437 <p/> 1438 The thread state represented by <code>java.lang.Thread.State</code> 1439 returned from <code>java.lang.Thread.getState()</code> is a subset of the 1440 information returned from this function. 1441 The corresponding <code>java.lang.Thread.State</code> can be determined 1442 by using the provided conversion masks. 1443 For example, this returns the name of the <code>java.lang.Thread.State</code> thread state: 1444 <example> 1445 err = (*jvmti)->GetThreadState(jvmti, thread, &state); 1446 abortOnError(err); 1447 switch (state & JVMTI_JAVA_LANG_THREAD_STATE_MASK) { 1448 case JVMTI_JAVA_LANG_THREAD_STATE_NEW: 1449 return "NEW"; 1450 case JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED: 1451 return "TERMINATED"; 1452 case JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE: 1453 return "RUNNABLE"; 1454 case JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED: 1455 return "BLOCKED"; 1456 case JVMTI_JAVA_LANG_THREAD_STATE_WAITING: 1457 return "WAITING"; 1458 case JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING: 1459 return "TIMED_WAITING"; 1460 } 1461 </example> 1462 </description> 1463 <origin>new</origin> 1464 <capabilities> 1465 </capabilities> 1466 <parameters> 1467 <param id="thread"> 1468 <jthread null="current" started="maybe" impl="noconvert"/> 1469 <description> 1470 The thread to query. 1471 </description> 1472 </param> 1473 <param id="thread_state_ptr"> 1474 <outptr><jint/></outptr> 1475 <description> 1476 On return, points to state flags, 1477 as defined by the <internallink id="jvmtiThreadState">Thread State Flags</internallink>. 1478 </description> 1479 </param> 1480 </parameters> 1481 <errors> 1482 </errors> 1483 </function> 1484 1485 <function id="GetCurrentThread" phase="start" num="18" since="1.1"> 1486 <synopsis>Get Current Thread</synopsis> 1487 <description> 1488 Get the current thread. 1489 The current thread is the Java programming language thread which has called the function. 1490 The function may return <code>NULL</code> in the start phase if the 1491 <internallink id="jvmtiCapabilities.can_generate_early_vmstart"> 1492 <code>can_generate_early_vmstart</code></internallink> capability is enabled 1493 and the <code>java.lang.Thread</code> class has not been initialized yet. 1494 <p/> 1495 Note that most <jvmti/> functions that take a thread 1496 as an argument will accept <code>NULL</code> to mean 1497 the current thread. 1498 </description> 1499 <origin>new</origin> 1500 <capabilities> 1501 </capabilities> 1502 <parameters> 1503 <param id="thread_ptr"> 1504 <outptr><jthread/></outptr> 1505 <description> 1506 On return, points to the current thread, or <code>NULL</code>. 1507 </description> 1508 </param> 1509 </parameters> 1510 <errors> 1511 </errors> 1512 </function> 1513 1514 <function id="GetAllThreads" num="4"> 1515 <synopsis>Get All Threads</synopsis> 1516 <description> 1517 Get all live threads. 1518 The threads are Java programming language threads; 1519 that is, threads that are attached to the VM. 1520 A thread is live if <code>java.lang.Thread.isAlive()</code> 1521 would return <code>true</code>, that is, the thread has 1522 been started and has not yet died. 1523 The universe of threads is determined by the context of the <jvmti/> 1524 environment, which typically is all threads attached to the VM. 1525 Note that this includes <jvmti/> agent threads 1526 (see <functionlink id="RunAgentThread"/>). 1527 </description> 1528 <origin>jvmdi</origin> 1529 <capabilities> 1530 </capabilities> 1531 <parameters> 1532 <param id="threads_count_ptr"> 1533 <outptr><jint/></outptr> 1534 <description> 1535 On return, points to the number of running threads. 1536 </description> 1537 </param> 1538 <param id="threads_ptr"> 1539 <allocbuf outcount="threads_count_ptr"><jthread/></allocbuf> 1540 <description> 1541 On return, points to an array of references, one 1542 for each running thread. 1543 </description> 1544 </param> 1545 </parameters> 1546 <errors> 1547 </errors> 1548 </function> 1549 1550 <function id="SuspendThread" num="5"> 1551 <synopsis>Suspend Thread</synopsis> 1552 <description> 1553 Suspend the specified thread. If the calling thread is specified, 1554 this function will not return until some other thread calls 1555 <functionlink id="ResumeThread"></functionlink>. 1556 If the thread is currently suspended, this function 1557 does nothing and returns an error. 1558 </description> 1559 <origin>jvmdi</origin> 1560 <capabilities> 1561 <required id="can_suspend"></required> 1562 </capabilities> 1563 <parameters> 1564 <param id="thread"> 1565 <jthread null="current"/> 1566 <description> 1567 The thread to suspend. 1568 </description> 1569 </param> 1570 </parameters> 1571 <errors> 1572 <error id="JVMTI_ERROR_THREAD_SUSPENDED"> 1573 Thread already suspended. 1574 </error> 1575 </errors> 1576 </function> 1577 1578 <elide> 1579 <function id="SuspendAllThreads" num="101"> 1580 <synopsis>Suspend All Threads</synopsis> 1581 <description> 1582 <issue> 1583 There has been no explicit call for this function, and it will 1584 thus be removed if there is no interest. 1585 </issue> 1586 Suspend all live threads except: 1587 <ul> 1588 <li>already suspended threads</li> 1589 <li>those listed in <paramlink id="except_list"></paramlink></li> 1590 <li>certain system (non application) threads, as determined 1591 by the VM implementation</li> 1592 </ul> 1593 The threads are Java programming language threads; 1594 native threads which are not attached to the VM are not 1595 Java programming language threads. 1596 A thread is live if <code>java.lang.Thread.isAlive()</code> 1597 would return <code>true</code>, that is, the thread has 1598 been started and has not yet died. 1599 The universe of threads is determined 1600 by the context of the <jvmti/> 1601 environment, which, typically, is all threads attached to the VM, 1602 except critical VM internal threads and <jvmti/> agent threads 1603 (see <functionlink id="RunAgentThread"/>). 1604 <p/> 1605 If the calling thread is specified, 1606 all other threads are suspended first then the caller thread is suspended - 1607 this function will not return until some other thread calls 1608 <functionlink id="ResumeThread"></functionlink>. 1609 <p/> 1610 The list of actually 1611 suspended threads is returned in 1612 <paramlink id="suspended_list_ptr"></paramlink>. 1613 Suspension is as defined in <functionlink id="SuspendThread"></functionlink>. 1614 <functionlink id="ResumeThreadList"></functionlink> 1615 can be used to resume the suspended threads. 1616 </description> 1617 <origin>new</origin> 1618 <capabilities> 1619 <required id="can_suspend"></required> 1620 </capabilities> 1621 <parameters> 1622 <param id="except_count"> 1623 <jint min="0"/> 1624 <description> 1625 The number of threads in the list of threads not to be suspended. 1626 </description> 1627 </param> 1628 <param id="except_list"> 1629 <inbuf incount="except_count"> 1630 <jthread/> 1631 <nullok>not an error if <code>except_count == 0</code></nullok> 1632 </inbuf> 1633 <description> 1634 The list of threads not to be suspended. 1635 </description> 1636 </param> 1637 <param id="suspended_count_ptr"> 1638 <outptr><jint/></outptr> 1639 <description> 1640 On return, points to the number of threads suspended by this call. 1641 </description> 1642 </param> 1643 <param id="suspended_list_ptr"> 1644 <allocbuf outcount="suspended_count_ptr"><jthread/></allocbuf> 1645 <description> 1646 On return, points to an array of references, one 1647 for each thread suspended. 1648 </description> 1649 </param> 1650 </parameters> 1651 <errors> 1652 <error id="JVMTI_ERROR_INVALID_THREAD"> 1653 A thread in <paramlink id="except_list"></paramlink> was invalid. 1654 </error> 1655 <error id="JVMTI_ERROR_NULL_POINTER"> 1656 Both <paramlink id="except_list"></paramlink> was <code>NULL</code> 1657 and <paramlink id="except_count"></paramlink> was non-zero. 1658 </error> 1659 </errors> 1660 </function> 1661 </elide> 1662 1663 <function id="SuspendThreadList" num="92"> 1664 <synopsis>Suspend Thread List</synopsis> 1665 <description> 1666 Suspend the <paramlink id="request_count"></paramlink> 1667 threads specified in the 1668 <paramlink id="request_list"></paramlink> array. 1669 Threads may be resumed with 1670 <functionlink id="ResumeThreadList"></functionlink> or 1671 <functionlink id="ResumeThread"></functionlink>. 1672 If the calling thread is specified in the 1673 <paramlink id="request_list"></paramlink> array, this function will 1674 not return until some other thread resumes it. 1675 Errors encountered in the suspension of a thread 1676 are returned in the <paramlink id="results"></paramlink> 1677 array, <b>not</b> in the return value of this function. 1678 Threads that are currently suspended do not change state. 1679 </description> 1680 <origin>jvmdi</origin> 1681 <capabilities> 1682 <required id="can_suspend"></required> 1683 </capabilities> 1684 <parameters> 1685 <param id="request_count"> 1686 <jint min="0"/> 1687 <description> 1688 The number of threads to suspend. 1689 </description> 1690 </param> 1691 <param id="request_list"> 1692 <inbuf incount="request_count"><jthread/></inbuf> 1693 <description> 1694 The list of threads to suspend. 1695 </description> 1696 </param> 1697 <param id="results"> 1698 <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf> 1699 <description> 1700 An agent supplied array of 1701 <paramlink id="request_count"></paramlink> elements. 1702 On return, filled with the error code for 1703 the suspend of the corresponding thread. 1704 The error code will be 1705 <errorlink id="JVMTI_ERROR_NONE"></errorlink> 1706 if the thread was suspended by this call. 1707 Possible error codes are those specified 1708 for <functionlink id="SuspendThread"></functionlink>. 1709 </description> 1710 </param> 1711 </parameters> 1712 <errors> 1713 </errors> 1714 </function> 1715 1716 <function id="ResumeThread" num="6"> 1717 <synopsis>Resume Thread</synopsis> 1718 <description> 1719 Resume a suspended thread. 1720 Any threads currently suspended through 1721 a <jvmti/> suspend function (eg. 1722 <functionlink id="SuspendThread"></functionlink>) 1723 or <code>java.lang.Thread.suspend()</code> 1724 will resume execution; 1725 all other threads are unaffected. 1726 </description> 1727 <origin>jvmdi</origin> 1728 <capabilities> 1729 <required id="can_suspend"></required> 1730 </capabilities> 1731 <parameters> 1732 <param id="thread"> 1733 <jthread/> 1734 <description> 1735 The thread to resume. 1736 </description> 1737 </param> 1738 </parameters> 1739 <errors> 1740 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 1741 Thread was not suspended. 1742 </error> 1743 <error id="JVMTI_ERROR_INVALID_TYPESTATE"> 1744 The state of the thread has been modified, and is now inconsistent. 1745 </error> 1746 </errors> 1747 </function> 1748 1749 <function id="ResumeThreadList" num="93"> 1750 <synopsis>Resume Thread List</synopsis> 1751 <description> 1752 Resume the <paramlink id="request_count"></paramlink> 1753 threads specified in the 1754 <paramlink id="request_list"></paramlink> array. 1755 Any thread suspended through 1756 a <jvmti/> suspend function (eg. 1757 <functionlink id="SuspendThreadList"></functionlink>) 1758 or <code>java.lang.Thread.suspend()</code> 1759 will resume execution. 1760 </description> 1761 <origin>jvmdi</origin> 1762 <capabilities> 1763 <required id="can_suspend"></required> 1764 </capabilities> 1765 <parameters> 1766 <param id="request_count"> 1767 <jint min="0"/> 1768 <description> 1769 The number of threads to resume. 1770 </description> 1771 </param> 1772 <param id="request_list"> 1773 <inbuf incount="request_count"><jthread/></inbuf> 1774 <description> 1775 The threads to resume. 1776 </description> 1777 </param> 1778 <param id="results"> 1779 <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf> 1780 <description> 1781 An agent supplied array of 1782 <paramlink id="request_count"></paramlink> elements. 1783 On return, filled with the error code for 1784 the resume of the corresponding thread. 1785 The error code will be 1786 <errorlink id="JVMTI_ERROR_NONE"></errorlink> 1787 if the thread was suspended by this call. 1788 Possible error codes are those specified 1789 for <functionlink id="ResumeThread"></functionlink>. 1790 </description> 1791 </param> 1792 </parameters> 1793 <errors> 1794 </errors> 1795 </function> 1796 1797 <function id="StopThread" num="7"> 1798 <synopsis>Stop Thread</synopsis> 1799 <description> 1800 Send the specified asynchronous exception to the specified thread 1801 (similar to <code>java.lang.Thread.stop</code>). 1802 Normally, this function is used to kill the specified thread with an 1803 instance of the exception <code>ThreadDeath</code>. 1804 </description> 1805 <origin>jvmdi</origin> 1806 <capabilities> 1807 <required id="can_signal_thread"></required> 1808 </capabilities> 1809 <parameters> 1810 <param id="thread"> 1811 <jthread/> 1812 <description> 1813 The thread to stop. 1814 </description> 1815 </param> 1816 <param id="exception"> 1817 <jobject/> 1818 <description> 1819 The asynchronous exception object. 1820 </description> 1821 </param> 1822 </parameters> 1823 <errors> 1824 </errors> 1825 </function> 1826 1827 <function id="InterruptThread" num="8"> 1828 <synopsis>Interrupt Thread</synopsis> 1829 <description> 1830 Interrupt the specified thread 1831 (similar to <code>java.lang.Thread.interrupt</code>). 1832 </description> 1833 <origin>jvmdi</origin> 1834 <capabilities> 1835 <required id="can_signal_thread"></required> 1836 </capabilities> 1837 <parameters> 1838 <param id="thread"> 1839 <jthread impl="noconvert"/> 1840 <description> 1841 The thread to interrupt. 1842 </description> 1843 </param> 1844 </parameters> 1845 <errors> 1846 </errors> 1847 </function> 1848 1849 <function id="GetThreadInfo" num="9"> 1850 <synopsis>Get Thread Info</synopsis> 1851 <typedef id="jvmtiThreadInfo" label="Thread information structure"> 1852 <field id="name"> 1853 <allocfieldbuf><char/></allocfieldbuf> 1854 <description> 1855 The thread name, encoded as a 1856 <internallink id="mUTF">modified UTF-8</internallink> string. 1857 </description> 1858 </field> 1859 <field id="priority"> 1860 <jint/> 1861 <description> 1862 The thread priority. See the thread priority constants: 1863 <datalink id="jvmtiThreadPriority"></datalink>. 1864 </description> 1865 </field> 1866 <field id="is_daemon"> 1867 <jboolean/> 1868 <description> 1869 Is this a daemon thread? 1870 </description> 1871 </field> 1872 <field id="thread_group"> 1873 <jthreadGroup/> 1874 <description> 1875 The thread group to which this thread belongs. 1876 <code>NULL</code> if the thread has died. 1877 </description> 1878 </field> 1879 <field id="context_class_loader"> 1880 <jobject/> 1881 <description> 1882 The context class loader associated with this thread. 1883 </description> 1884 </field> 1885 </typedef> 1886 <description> 1887 Get thread information. The fields of the <datalink id="jvmtiThreadInfo"/> structure 1888 are filled in with details of the specified thread. 1889 </description> 1890 <origin>jvmdi</origin> 1891 <capabilities> 1892 </capabilities> 1893 <parameters> 1894 <param id="thread"> 1895 <jthread null="current" impl="noconvert" started="maybe"/> 1896 <description> 1897 The thread to query. 1898 </description> 1899 </param> 1900 <param id="info_ptr"> 1901 <outptr><struct>jvmtiThreadInfo</struct></outptr> 1902 <description> 1903 On return, filled with information describing the specified thread. 1904 </description> 1905 </param> 1906 </parameters> 1907 <errors> 1908 </errors> 1909 </function> 1910 1911 <function id="GetOwnedMonitorInfo" num="10"> 1912 <synopsis>Get Owned Monitor Info</synopsis> 1913 <description> 1914 Get information about the monitors owned by the 1915 specified thread. 1916 </description> 1917 <origin>jvmdiClone</origin> 1918 <capabilities> 1919 <required id="can_get_owned_monitor_info"></required> 1920 </capabilities> 1921 <parameters> 1922 <param id="thread"> 1923 <jthread null="current"/> 1924 <description> 1925 The thread to query. 1926 </description> 1927 </param> 1928 <param id="owned_monitor_count_ptr"> 1929 <outptr><jint/></outptr> 1930 <description> 1931 The number of monitors returned. 1932 </description> 1933 </param> 1934 <param id="owned_monitors_ptr"> 1935 <allocbuf outcount="owned_monitor_count_ptr"><jobject/></allocbuf> 1936 <description> 1937 The array of owned monitors. 1938 </description> 1939 </param> 1940 </parameters> 1941 <errors> 1942 </errors> 1943 </function> 1944 1945 <function id="GetOwnedMonitorStackDepthInfo" num="153" since="1.1"> 1946 <synopsis>Get Owned Monitor Stack Depth Info</synopsis> 1947 <typedef id="jvmtiMonitorStackDepthInfo" 1948 label="Monitor stack depth information structure"> 1949 <field id="monitor"> 1950 <jobject/> 1951 <description> 1952 The owned monitor. 1953 </description> 1954 </field> 1955 <field id="stack_depth"> 1956 <jint/> 1957 <description> 1958 The stack depth. Corresponds to the stack depth used in the 1959 <internallink id="stack">Stack Frame functions</internallink>. 1960 That is, zero is the current frame, one is the frame which 1961 called the current frame. And it is negative one if the 1962 implementation cannot determine the stack depth (e.g., for 1963 monitors acquired by JNI <code>MonitorEnter</code>). 1964 </description> 1965 </field> 1966 </typedef> 1967 <description> 1968 Get information about the monitors owned by the 1969 specified thread and the depth of the stack frame which locked them. 1970 </description> 1971 <origin>new</origin> 1972 <capabilities> 1973 <required id="can_get_owned_monitor_stack_depth_info"></required> 1974 </capabilities> 1975 <parameters> 1976 <param id="thread"> 1977 <jthread null="current"/> 1978 <description> 1979 The thread to query. 1980 </description> 1981 </param> 1982 <param id="monitor_info_count_ptr"> 1983 <outptr><jint/></outptr> 1984 <description> 1985 The number of monitors returned. 1986 </description> 1987 </param> 1988 <param id="monitor_info_ptr"> 1989 <allocbuf outcount="monitor_info_count_ptr"> 1990 <struct>jvmtiMonitorStackDepthInfo</struct> 1991 </allocbuf> 1992 <description> 1993 The array of owned monitor depth information. 1994 </description> 1995 </param> 1996 </parameters> 1997 <errors> 1998 </errors> 1999 </function> 2000 2001 <function id="GetCurrentContendedMonitor" num="11"> 2002 <synopsis>Get Current Contended Monitor</synopsis> 2003 <description> 2004 Get the object, if any, whose monitor the specified thread is waiting to 2005 enter or waiting to regain through <code>java.lang.Object.wait</code>. 2006 </description> 2007 <origin>jvmdi</origin> 2008 <capabilities> 2009 <required id="can_get_current_contended_monitor"></required> 2010 </capabilities> 2011 <parameters> 2012 <param id="thread"> 2013 <jthread null="current"/> 2014 <description> 2015 The thread to query. 2016 </description> 2017 </param> 2018 <param id="monitor_ptr"> 2019 <outptr><jobject/></outptr> 2020 <description> 2021 On return, filled with the current contended monitor, or 2022 NULL if there is none. 2023 </description> 2024 </param> 2025 </parameters> 2026 <errors> 2027 </errors> 2028 </function> 2029 2030 <callback id="jvmtiStartFunction"> 2031 <void/> 2032 <synopsis>Agent Start Function</synopsis> 2033 <description> 2034 Agent supplied callback function. 2035 This function is the entry point for an agent thread 2036 started with 2037 <functionlink id="RunAgentThread"></functionlink>. 2038 </description> 2039 <parameters> 2040 <param id="jvmti_env"> 2041 <outptr> 2042 <struct>jvmtiEnv</struct> 2043 </outptr> 2044 <description> 2045 The <jvmti/> environment. 2046 </description> 2047 </param> 2048 <param id="jni_env"> 2049 <outptr> 2050 <struct>JNIEnv</struct> 2051 </outptr> 2052 <description> 2053 The JNI environment. 2054 </description> 2055 </param> 2056 <param id="arg"> 2057 <outptr> 2058 <void/> 2059 </outptr> 2060 <description> 2061 The <code>arg</code> parameter passed to 2062 <functionlink id="RunAgentThread"></functionlink>. 2063 </description> 2064 </param> 2065 </parameters> 2066 </callback> 2067 2068 <function id="RunAgentThread" num="12"> 2069 <synopsis>Run Agent Thread</synopsis> 2070 <description> 2071 Starts the execution of an agent thread. with the specified native function. 2072 The parameter <paramlink id="arg"></paramlink> is forwarded on to the 2073 <functionlink id="jvmtiStartFunction">start function</functionlink> 2074 (specified with <paramlink id="proc"></paramlink>) as its single argument. 2075 This function allows the creation of agent threads 2076 for handling communication with another process or for handling events 2077 without the need to load a special subclass of <code>java.lang.Thread</code> or 2078 implementer of <code>java.lang.Runnable</code>. 2079 Instead, the created thread can run entirely in native code. 2080 However, the created thread does require a newly created instance 2081 of <code>java.lang.Thread</code> (referenced by the argument <code>thread</code>) to 2082 which it will be associated. 2083 The thread object can be created with JNI calls. 2084 <p/> 2085 The following common thread priorities are provided for your convenience: 2086 <constants id="jvmtiThreadPriority" label="Thread Priority Constants" kind="const"> 2087 <constant id="JVMTI_THREAD_MIN_PRIORITY" num="1"> 2088 Minimum possible thread priority 2089 </constant> 2090 <constant id="JVMTI_THREAD_NORM_PRIORITY" num="5"> 2091 Normal thread priority 2092 </constant> 2093 <constant id="JVMTI_THREAD_MAX_PRIORITY" num="10"> 2094 Maximum possible thread priority 2095 </constant> 2096 </constants> 2097 <p/> 2098 The new thread is started as a daemon thread with the specified 2099 <paramlink id="priority"></paramlink>. 2100 If enabled, a <eventlink id="ThreadStart"/> event will be sent. 2101 <p/> 2102 Since the thread has been started, the thread will be live when this function 2103 returns, unless the thread has died immediately. 2104 <p/> 2105 The thread group of the thread is ignored -- specifically, the thread is not 2106 added to the thread group and the thread is not seen on queries of the thread 2107 group at either the Java programming language or <jvmti/> levels. 2108 <p/> 2109 The thread is not visible to Java programming language queries but is 2110 included in <jvmti/> queries (for example, 2111 <functionlink id="GetAllThreads"/> and 2112 <functionlink id="GetAllStackTraces"/>). 2113 <p/> 2114 Upon execution of <code>proc</code>, the new thread will be attached to the 2115 VM -- see the JNI documentation on 2116 <externallink id="jni/invocation.html#attaching-to-the-vm" 2117 >Attaching to the VM</externallink>. 2118 </description> 2119 <origin>jvmdiClone</origin> 2120 <capabilities> 2121 </capabilities> 2122 <parameters> 2123 <param id="thread"> 2124 <jthread impl="noconvert" started="no"/> 2125 <description> 2126 The thread to run. 2127 </description> 2128 </param> 2129 <param id="proc"> 2130 <ptrtype> 2131 <struct>jvmtiStartFunction</struct> 2132 </ptrtype> 2133 <description> 2134 The start function. 2135 </description> 2136 </param> 2137 <param id="arg"> 2138 <inbuf> 2139 <void/> 2140 <nullok><code>NULL</code> is passed to the start function</nullok> 2141 </inbuf> 2142 <description> 2143 The argument to the start function. 2144 </description> 2145 </param> 2146 <param id="priority"> 2147 <jint/> 2148 <description> 2149 The priority of the started thread. Any thread 2150 priority allowed by <code>java.lang.Thread.setPriority</code> can be used including 2151 those in <datalink id="jvmtiThreadPriority"></datalink>. 2152 </description> 2153 </param> 2154 </parameters> 2155 <errors> 2156 <error id="JVMTI_ERROR_INVALID_PRIORITY"> 2157 <paramlink id="priority"/> is less than 2158 <datalink id="JVMTI_THREAD_MIN_PRIORITY"/> 2159 or greater than 2160 <datalink id="JVMTI_THREAD_MAX_PRIORITY"/> 2161 </error> 2162 </errors> 2163 </function> 2164 2165 <function id="SetThreadLocalStorage" jkernel="yes" impl="notrace" phase="start" num="103"> 2166 <synopsis>Set Thread Local Storage</synopsis> 2167 <description> 2168 The VM stores a pointer value associated with each environment-thread 2169 pair. This pointer value is called <i>thread-local storage</i>. 2170 This value is <code>NULL</code> unless set with this function. 2171 Agents can allocate memory in which they store thread specific 2172 information. By setting thread-local storage it can then be 2173 accessed with 2174 <functionlink id="GetThreadLocalStorage"></functionlink>. 2175 <p/> 2176 This function is called by the agent to set the value of the <jvmti/> 2177 thread-local storage. <jvmti/> supplies to the agent a pointer-size 2178 thread-local storage that can be used to record per-thread 2179 information. 2180 </description> 2181 <origin>jvmpi</origin> 2182 <capabilities> 2183 </capabilities> 2184 <parameters> 2185 <param id="thread"> 2186 <jthread null="current"/> 2187 <description> 2188 Store to this thread. 2189 </description> 2190 </param> 2191 <param id="data"> 2192 <inbuf> 2193 <void/> 2194 <nullok>value is set to <code>NULL</code></nullok> 2195 </inbuf> 2196 <description> 2197 The value to be entered into the thread-local storage. 2198 </description> 2199 </param> 2200 </parameters> 2201 <errors> 2202 </errors> 2203 </function> 2204 2205 <function id="GetThreadLocalStorage" jkernel="yes" impl="innative notrace" phase="start" num="102"> 2206 <synopsis>Get Thread Local Storage</synopsis> 2207 <description> 2208 Called by the agent to get the value of the <jvmti/> thread-local 2209 storage. 2210 </description> 2211 <origin>jvmpi</origin> 2212 <capabilities> 2213 </capabilities> 2214 <parameters> 2215 <param id="thread"> 2216 <jthread null="current" impl="noconvert"/> 2217 <description> 2218 Retrieve from this thread. 2219 </description> 2220 </param> 2221 <param id="data_ptr"> 2222 <agentbuf><void/></agentbuf> 2223 <description> 2224 Pointer through which the value of the thread local 2225 storage is returned. 2226 If thread-local storage has not been set with 2227 <functionlink id="SetThreadLocalStorage"></functionlink> the returned 2228 pointer is <code>NULL</code>. 2229 </description> 2230 </param> 2231 </parameters> 2232 <errors> 2233 </errors> 2234 </function> 2235 2236 </category> 2237 2238 <category id="thread_groups" label="Thread Group"> 2239 <intro> 2240 </intro> 2241 2242 <function id="GetTopThreadGroups" num="13"> 2243 <synopsis>Get Top Thread Groups</synopsis> 2244 <description> 2245 Return all top-level (parentless) thread groups in the VM. 2246 </description> 2247 <origin>jvmdi</origin> 2248 <capabilities> 2249 </capabilities> 2250 <parameters> 2251 <param id="group_count_ptr"> 2252 <outptr><jint/></outptr> 2253 <description> 2254 On return, points to the number of top-level thread groups. 2255 </description> 2256 </param> 2257 <param id="groups_ptr"> 2258 <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf> 2259 <description> 2260 On return, refers to a pointer to the top-level thread group array. 2261 </description> 2262 </param> 2263 </parameters> 2264 <errors> 2265 </errors> 2266 </function> 2267 2268 <function id="GetThreadGroupInfo" num="14"> 2269 <synopsis>Get Thread Group Info</synopsis> 2270 <typedef id="jvmtiThreadGroupInfo" label="Thread group information structure"> 2271 <field id="parent"> 2272 <jthreadGroup/> 2273 <description> 2274 The parent thread group. 2275 </description> 2276 </field> 2277 <field id="name"> 2278 <allocfieldbuf><char/></allocfieldbuf> 2279 <description> 2280 The thread group's name, encoded as a 2281 <internallink id="mUTF">modified UTF-8</internallink> string. 2282 </description> 2283 </field> 2284 <field id="max_priority"> 2285 <jint/> 2286 <description> 2287 The maximum priority for this thread group. 2288 </description> 2289 </field> 2290 <field id="is_daemon"> 2291 <jboolean/> 2292 <description> 2293 Is this a daemon thread group? 2294 </description> 2295 </field> 2296 </typedef> 2297 <description> 2298 Get information about the thread group. The fields of the 2299 <functionlink id="jvmtiThreadGroupInfo"></functionlink> structure 2300 are filled in with details of the specified thread group. 2301 </description> 2302 <origin>jvmdi</origin> 2303 <capabilities> 2304 </capabilities> 2305 <parameters> 2306 <param id="group"> 2307 <jthreadGroup/> 2308 <description> 2309 The thread group to query. 2310 </description> 2311 </param> 2312 <param id="info_ptr"> 2313 <outptr><struct>jvmtiThreadGroupInfo</struct></outptr> 2314 <description> 2315 On return, filled with information describing the specified 2316 thread group. 2317 </description> 2318 </param> 2319 </parameters> 2320 <errors> 2321 </errors> 2322 </function> 2323 2324 <function id="GetThreadGroupChildren" num="15"> 2325 <synopsis>Get Thread Group Children</synopsis> 2326 <description> 2327 Get the live threads and active subgroups in this thread group. 2328 </description> 2329 <origin>jvmdi</origin> 2330 <capabilities> 2331 </capabilities> 2332 <parameters> 2333 <param id="group"> 2334 <jthreadGroup/> 2335 <description> 2336 The group to query. 2337 </description> 2338 </param> 2339 <param id="thread_count_ptr"> 2340 <outptr><jint/></outptr> 2341 <description> 2342 On return, points to the number of live threads in this thread group. 2343 </description> 2344 </param> 2345 <param id="threads_ptr"> 2346 <allocbuf outcount="thread_count_ptr"><jthread/></allocbuf> 2347 <description> 2348 On return, points to an array of the live threads in this thread group. 2349 </description> 2350 </param> 2351 <param id="group_count_ptr"> 2352 <outptr><jint/></outptr> 2353 <description> 2354 On return, points to the number of active child thread groups 2355 </description> 2356 </param> 2357 <param id="groups_ptr"> 2358 <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf> 2359 <description> 2360 On return, points to an array of the active child thread groups. 2361 </description> 2362 </param> 2363 </parameters> 2364 <errors> 2365 </errors> 2366 </function> 2367 </category> 2368 2369 <category id="stack" label="Stack Frame"> 2370 <intro> 2371 These functions provide information about the stack of a thread. 2372 Stack frames are referenced by depth. 2373 The frame at depth zero is the current frame. 2374 <p/> 2375 Stack frames are as described in 2376 <vmspec chapter="3.6"/>, 2377 That is, they correspond to method 2378 invocations (including native methods) but do not correspond to platform native or 2379 VM internal frames. 2380 <p/> 2381 A <jvmti/> implementation may use method invocations to launch a thread and 2382 the corresponding frames may be included in the stack as presented by these functions -- 2383 that is, there may be frames shown 2384 deeper than <code>main()</code> and <code>run()</code>. 2385 However this presentation must be consistent across all <jvmti/> functionality which 2386 uses stack frames or stack depth. 2387 </intro> 2388 2389 <typedef id="jvmtiFrameInfo" label="Stack frame information structure"> 2390 <description> 2391 Information about a stack frame is returned in this structure. 2392 </description> 2393 <field id="method"> 2394 <jmethodID/> 2395 <description> 2396 The method executing in this frame. 2397 </description> 2398 </field> 2399 <field id="location"> 2400 <jlocation/> 2401 <description> 2402 The index of the instruction executing in this frame. 2403 <code>-1</code> if the frame is executing a native method. 2404 </description> 2405 </field> 2406 </typedef> 2407 2408 <typedef id="jvmtiStackInfo" label="Stack information structure"> 2409 <description> 2410 Information about a set of stack frames is returned in this structure. 2411 </description> 2412 <field id="thread"> 2413 <jthread/> 2414 <description> 2415 On return, the thread traced. 2416 </description> 2417 </field> 2418 <field id="state"> 2419 <jint/> 2420 <description> 2421 On return, the thread state. See <functionlink id="GetThreadState"></functionlink>. 2422 </description> 2423 </field> 2424 <field id="frame_buffer"> 2425 <outbuf incount="max_frame_count"> 2426 <struct>jvmtiFrameInfo</struct> 2427 </outbuf> 2428 <description> 2429 On return, this agent allocated buffer is filled 2430 with stack frame information. 2431 </description> 2432 </field> 2433 <field id="frame_count"> 2434 <jint/> 2435 <description> 2436 On return, the number of records filled into 2437 <code>frame_buffer</code>. 2438 This will be 2439 min(<code>max_frame_count</code>, <i>stackDepth</i>). 2440 </description> 2441 </field> 2442 </typedef> 2443 2444 <function id="GetStackTrace" num="104"> 2445 <synopsis>Get Stack Trace</synopsis> 2446 <description> 2447 Get information about the stack of a thread. 2448 If <paramlink id="max_frame_count"></paramlink> is less than the depth of the stack, 2449 the <paramlink id="max_frame_count"></paramlink> topmost frames are returned, 2450 otherwise the entire stack is returned. 2451 The topmost frames, those most recently invoked, are at the beginning of the returned buffer. 2452 <p/> 2453 The following example causes up to five of the topmost frames 2454 to be returned and (if there are any frames) the currently 2455 executing method name to be printed. 2456 <example> 2457 jvmtiFrameInfo frames[5]; 2458 jint count; 2459 jvmtiError err; 2460 2461 err = (*jvmti)->GetStackTrace(jvmti, aThread, 0, 5, 2462 frames, &count); 2463 if (err == JVMTI_ERROR_NONE && count >= 1) { 2464 char *methodName; 2465 err = (*jvmti)->GetMethodName(jvmti, frames[0].method, 2466 &methodName, NULL, NULL); 2467 if (err == JVMTI_ERROR_NONE) { 2468 printf("Executing method: %s", methodName); 2469 } 2470 } 2471 </example> 2472 <todo> 2473 check example code. 2474 </todo> 2475 <p/> 2476 The <paramlink id="thread"></paramlink> need not be suspended 2477 to call this function. 2478 <p/> 2479 The <functionlink id="GetLineNumberTable"></functionlink> 2480 function can be used to map locations to line numbers. Note that 2481 this mapping can be done lazily. 2482 </description> 2483 <origin>jvmpi</origin> 2484 <capabilities> 2485 </capabilities> 2486 <parameters> 2487 <param id="thread"> 2488 <jthread null="current"/> 2489 <description> 2490 Fetch the stack trace of this thread. 2491 </description> 2492 </param> 2493 <param id="start_depth"> 2494 <jint/> 2495 <description> 2496 Begin retrieving frames at this depth. 2497 If non-negative, count from the current frame, 2498 the first frame retrieved is at depth <code>start_depth</code>. 2499 For example, if zero, start from the current frame; if one, start from the 2500 caller of the current frame; if two, start from the caller of the 2501 caller of the current frame; and so on. 2502 If negative, count from below the oldest frame, 2503 the first frame retrieved is at depth <i>stackDepth</i><code> + start_depth</code>, 2504 where <i>stackDepth</i> is the count of frames on the stack. 2505 For example, if negative one, only the oldest frame is retrieved; 2506 if negative two, start from the frame called by the oldest frame. 2507 </description> 2508 </param> 2509 <param id="max_frame_count"> 2510 <jint min="0"/> 2511 <description> 2512 The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve. 2513 </description> 2514 </param> 2515 <param id="frame_buffer"> 2516 <outbuf incount="max_frame_count" outcount="count_ptr"> 2517 <struct>jvmtiFrameInfo</struct> 2518 </outbuf> 2519 <description> 2520 On return, this agent allocated buffer is filled 2521 with stack frame information. 2522 </description> 2523 </param> 2524 <param id="count_ptr"> 2525 <outptr><jint/></outptr> 2526 <description> 2527 On return, points to the number of records filled in. 2528 For non-negative <code>start_depth</code>, this will be 2529 min(<code>max_frame_count</code>, <i>stackDepth</i><code> - start_depth</code>). 2530 For negative <code>start_depth</code>, this will be 2531 min(<code>max_frame_count</code>, <code>-start_depth</code>). 2532 </description> 2533 </param> 2534 </parameters> 2535 <errors> 2536 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 2537 <paramlink id="start_depth"/> is positive and greater than or equal to <i>stackDepth</i>. 2538 Or <paramlink id="start_depth"/> is negative and less than <i>-stackDepth</i>. 2539 </error> 2540 </errors> 2541 </function> 2542 2543 2544 <function id="GetAllStackTraces" num="100"> 2545 <synopsis>Get All Stack Traces</synopsis> 2546 <description> 2547 Get information about the stacks of all live threads 2548 (including <internallink id="RunAgentThread">agent threads</internallink>). 2549 If <paramlink id="max_frame_count"/> is less than the depth of a stack, 2550 the <paramlink id="max_frame_count"/> topmost frames are returned for that thread, 2551 otherwise the entire stack is returned. 2552 The topmost frames, those most recently invoked, are at the beginning of the returned buffer. 2553 <p/> 2554 All stacks are collected simultaneously, that is, no changes will occur to the 2555 thread state or stacks between the sampling of one thread and the next. 2556 The threads need not be suspended. 2557 2558 <example> 2559 jvmtiStackInfo *stack_info; 2560 jint thread_count; 2561 int ti; 2562 jvmtiError err; 2563 2564 err = (*jvmti)->GetAllStackTraces(jvmti, MAX_FRAMES, &stack_info, &thread_count); 2565 if (err != JVMTI_ERROR_NONE) { 2566 ... 2567 } 2568 for (ti = 0; ti < thread_count; ++ti) { 2569 jvmtiStackInfo *infop = &stack_info[ti]; 2570 jthread thread = infop->thread; 2571 jint state = infop->state; 2572 jvmtiFrameInfo *frames = infop->frame_buffer; 2573 int fi; 2574 2575 myThreadAndStatePrinter(thread, state); 2576 for (fi = 0; fi < infop->frame_count; fi++) { 2577 myFramePrinter(frames[fi].method, frames[fi].location); 2578 } 2579 } 2580 /* this one Deallocate call frees all data allocated by GetAllStackTraces */ 2581 err = (*jvmti)->Deallocate(jvmti, stack_info); 2582 </example> 2583 <todo> 2584 check example code. 2585 </todo> 2586 2587 </description> 2588 <origin>new</origin> 2589 <capabilities> 2590 </capabilities> 2591 <parameters> 2592 <param id="max_frame_count"> 2593 <jint min="0"/> 2594 <description> 2595 The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread. 2596 </description> 2597 </param> 2598 <param id="stack_info_ptr"> 2599 <allocbuf> 2600 <struct>jvmtiStackInfo</struct> 2601 </allocbuf> 2602 <description> 2603 On return, this buffer is filled 2604 with stack information for each thread. 2605 The number of <datalink id="jvmtiStackInfo"/> records is determined 2606 by <paramlink id="thread_count_ptr"/>. 2607 <p/> 2608 Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/> 2609 buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>. 2610 These buffers must not be separately deallocated. 2611 </description> 2612 </param> 2613 <param id="thread_count_ptr"> 2614 <outptr><jint/></outptr> 2615 <description> 2616 The number of threads traced. 2617 </description> 2618 </param> 2619 </parameters> 2620 <errors> 2621 </errors> 2622 </function> 2623 2624 <function id="GetThreadListStackTraces" num="101"> 2625 <synopsis>Get Thread List Stack Traces</synopsis> 2626 <description> 2627 Get information about the stacks of the supplied threads. 2628 If <paramlink id="max_frame_count"/> is less than the depth of a stack, 2629 the <paramlink id="max_frame_count"/> topmost frames are returned for that thread, 2630 otherwise the entire stack is returned. 2631 The topmost frames, those most recently invoked, are at the beginning of the returned buffer. 2632 <p/> 2633 All stacks are collected simultaneously, that is, no changes will occur to the 2634 thread state or stacks between the sampling one thread and the next. 2635 The threads need not be suspended. 2636 <p/> 2637 If a thread has not yet started or terminates before the stack information is collected, 2638 a zero length stack (<datalink id="jvmtiStackInfo.frame_count"/> will be zero) 2639 will be returned and the thread <datalink id="jvmtiStackInfo.state"/> can be checked. 2640 <p/> 2641 See the example for the similar function 2642 <functionlink id="GetAllStackTraces"/>. 2643 </description> 2644 <origin>new</origin> 2645 <capabilities> 2646 </capabilities> 2647 <parameters> 2648 <param id="thread_count"> 2649 <jint min="0"/> 2650 <description> 2651 The number of threads to trace. 2652 </description> 2653 </param> 2654 <param id="thread_list"> 2655 <inbuf incount="thread_count"><jthread/></inbuf> 2656 <description> 2657 The list of threads to trace. 2658 </description> 2659 </param> 2660 <param id="max_frame_count"> 2661 <jint min="0"/> 2662 <description> 2663 The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread. 2664 </description> 2665 </param> 2666 <param id="stack_info_ptr"> 2667 <allocbuf outcount="thread_count"> 2668 <struct>jvmtiStackInfo</struct> 2669 </allocbuf> 2670 <description> 2671 On return, this buffer is filled 2672 with stack information for each thread. 2673 The number of <datalink id="jvmtiStackInfo"/> records is determined 2674 by <paramlink id="thread_count"/>. 2675 <p/> 2676 Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/> 2677 buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>. 2678 These buffers must not be separately deallocated. 2679 </description> 2680 </param> 2681 </parameters> 2682 <errors> 2683 <error id="JVMTI_ERROR_INVALID_THREAD"> 2684 An element in <paramlink id="thread_list"/> is not a thread object. 2685 </error> 2686 </errors> 2687 </function> 2688 2689 <elide> 2690 <function id="AsyncGetStackTrace" num="1000"> 2691 <synopsis>Get Stack Trace--Asynchronous</synopsis> 2692 <description> 2693 Get information about the entire stack of a thread (or a sub-section of it). 2694 This is the asynchronous version of <functionlink id="GetStackTrace"></functionlink> 2695 and is reentrant and safe to call 2696 from asynchronous signal handlers. 2697 The stack trace is returned only for the calling thread. 2698 <p/> 2699 The <functionlink id="GetLineNumberTable"></functionlink> 2700 function can be used to map locations to line numbers. Note that 2701 this mapping can be done lazily. 2702 </description> 2703 <origin>jvmpi</origin> 2704 <capabilities> 2705 <required id="can_get_async_stack_trace"></required> 2706 <capability id="can_show_JVM_spec_async_frames"> 2707 If <code>false</code>, 2708 <paramlink id="use_java_stack"></paramlink> 2709 must be <code>false</code>. 2710 </capability> 2711 </capabilities> 2712 <parameters> 2713 <param id="use_java_stack"> 2714 <jboolean/> 2715 <description> 2716 Return the stack showing <vmspec/> 2717 model of the stack; 2718 otherwise, show the internal representation of the stack with 2719 inlined and optimized methods missing. If the virtual machine 2720 is using the <i>Java Virtual Machine Specification</i> stack model 2721 internally, this flag is ignored. 2722 </description> 2723 </param> 2724 <param id="max_count"> 2725 <jint min="0"/> 2726 <description> 2727 The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve. 2728 Retrieve this many unless the stack depth is less than <code>max_count</code>. 2729 </description> 2730 </param> 2731 <param id="frame_buffer"> 2732 <outbuf incount="max_count" outcount="count_ptr"> 2733 <struct>jvmtiFrameInfo</struct> 2734 <nullok>this information is not returned</nullok> 2735 </outbuf> 2736 <description> 2737 The agent passes in a buffer 2738 large enough to hold <code>max_count</code> records of 2739 <datalink id="jvmtiFrameInfo"></datalink>. This buffer must be 2740 pre-allocated by the agent. 2741 </description> 2742 </param> 2743 <param id="count_ptr"> 2744 <outptr><jint/></outptr> 2745 <description> 2746 On return, points to the number of records filled in.. 2747 </description> 2748 </param> 2749 </parameters> 2750 <errors> 2751 <error id="JVMTI_ERROR_UNATTACHED_THREAD"> 2752 The thread being used to call this function is not attached 2753 to the virtual machine. Calls must be made from attached threads. 2754 </error> 2755 </errors> 2756 </function> 2757 </elide> 2758 2759 <function id="GetFrameCount" num="16"> 2760 <synopsis>Get Frame Count</synopsis> 2761 <description> 2762 Get the number of frames currently in the specified thread's call stack. 2763 <p/> 2764 If this function is called for a thread actively executing bytecodes (for example, 2765 not the current thread and not suspended), the information returned is transient. 2766 </description> 2767 <origin>jvmdi</origin> 2768 <capabilities> 2769 </capabilities> 2770 <parameters> 2771 <param id="thread"> 2772 <jthread null="current"/> 2773 <description> 2774 The thread to query. 2775 </description> 2776 </param> 2777 <param id="count_ptr"> 2778 <outptr><jint/></outptr> 2779 <description> 2780 On return, points to the number of frames in the call stack. 2781 </description> 2782 </param> 2783 </parameters> 2784 <errors> 2785 </errors> 2786 </function> 2787 2788 <function id="PopFrame" num="80"> 2789 <synopsis>Pop Frame</synopsis> 2790 <description> 2791 Pop the current frame of <code>thread</code>'s stack. 2792 Popping a frame takes you to the previous frame. 2793 When the thread is resumed, the execution 2794 state of the thread is reset to the state 2795 immediately before the called method was invoked. 2796 That is (using <vmspec/> terminology): 2797 <ul> 2798 <li>the current frame is discarded as the previous frame becomes the current one</li> 2799 <li>the operand stack is restored--the argument values are added back 2800 and if the invoke was not <code>invokestatic</code>, 2801 <code>objectref</code> is added back as well</li> 2802 <li>the Java virtual machine PC is restored to the opcode 2803 of the invoke instruction</li> 2804 </ul> 2805 Note however, that any changes to the arguments, which 2806 occurred in the called method, remain; 2807 when execution continues, the first instruction to 2808 execute will be the invoke. 2809 <p/> 2810 Between calling <code>PopFrame</code> and resuming the 2811 thread the state of the stack is undefined. 2812 To pop frames beyond the first, 2813 these three steps must be repeated: 2814 <ul> 2815 <li>suspend the thread via an event (step, breakpoint, ...)</li> 2816 <li>call <code>PopFrame</code></li> 2817 <li>resume the thread</li> 2818 </ul> 2819 <p/> 2820 A lock acquired by calling the called method 2821 (if it is a <code>synchronized</code> method) 2822 and locks acquired by entering <code>synchronized</code> 2823 blocks within the called method are released. 2824 Note: this does not apply to native locks or 2825 <code>java.util.concurrent.locks</code> locks. 2826 <p/> 2827 Finally blocks are not executed. 2828 <p/> 2829 Changes to global state are not addressed and thus remain changed. 2830 <p/> 2831 The specified thread must be suspended (which implies it cannot be the current thread). 2832 <p/> 2833 Both the called method and calling method must be non-native Java programming 2834 language methods. 2835 <p/> 2836 No <jvmti/> events are generated by this function. 2837 </description> 2838 <origin>jvmdi</origin> 2839 <capabilities> 2840 <required id="can_pop_frame"></required> 2841 </capabilities> 2842 <parameters> 2843 <param id="thread"> 2844 <jthread/> 2845 <description> 2846 The thread whose current frame is to be popped. 2847 </description> 2848 </param> 2849 </parameters> 2850 <errors> 2851 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 2852 Called or calling method is a native method. 2853 The implementation is unable to pop this frame. 2854 </error> 2855 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 2856 Thread was not suspended. 2857 </error> 2858 <error id="JVMTI_ERROR_NO_MORE_FRAMES"> 2859 There are less than two stack frames on the call stack. 2860 </error> 2861 </errors> 2862 </function> 2863 2864 <function id="GetFrameLocation" num="19"> 2865 <synopsis>Get Frame Location</synopsis> 2866 <description> 2867 <p/> 2868 For a Java programming language frame, return the location of the instruction 2869 currently executing. 2870 </description> 2871 <origin>jvmdiClone</origin> 2872 <capabilities> 2873 </capabilities> 2874 <parameters> 2875 <param id="thread"> 2876 <jthread null="current" frame="frame"/> 2877 <description> 2878 The thread of the frame to query. 2879 </description> 2880 </param> 2881 <param id="depth"> 2882 <jframeID thread="thread"/> 2883 <description> 2884 The depth of the frame to query. 2885 </description> 2886 </param> 2887 <param id="method_ptr"> 2888 <outptr><jmethodID/></outptr> 2889 <description> 2890 On return, points to the method for the current location. 2891 </description> 2892 </param> 2893 <param id="location_ptr"> 2894 <outptr><jlocation/></outptr> 2895 <description> 2896 On return, points to the index of the currently 2897 executing instruction. 2898 Is set to <code>-1</code> if the frame is executing 2899 a native method. 2900 </description> 2901 </param> 2902 </parameters> 2903 <errors> 2904 </errors> 2905 </function> 2906 2907 <function id="NotifyFramePop" num="20"> 2908 <synopsis>Notify Frame Pop</synopsis> 2909 <description> 2910 When the frame that is currently at <paramlink id="depth"></paramlink> 2911 is popped from the stack, generate a 2912 <eventlink id="FramePop"></eventlink> event. See the 2913 <eventlink id="FramePop"></eventlink> event for details. 2914 Only frames corresponding to non-native Java programming language 2915 methods can receive notification. 2916 <p/> 2917 The specified thread must either be the current thread 2918 or the thread must be suspended. 2919 </description> 2920 <origin>jvmdi</origin> 2921 <capabilities> 2922 <required id="can_generate_frame_pop_events"></required> 2923 </capabilities> 2924 <parameters> 2925 <param id="thread"> 2926 <jthread null="current" frame="depth"/> 2927 <description> 2928 The thread of the frame for which the frame pop event will be generated. 2929 </description> 2930 </param> 2931 <param id="depth"> 2932 <jframeID thread="thread"/> 2933 <description> 2934 The depth of the frame for which the frame pop event will be generated. 2935 </description> 2936 </param> 2937 </parameters> 2938 <errors> 2939 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 2940 The frame at <code>depth</code> is executing a 2941 native method. 2942 </error> 2943 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 2944 Thread was not suspended and was not the current thread. 2945 </error> 2946 </errors> 2947 </function> 2948 2949 </category> 2950 2951 <category id="ForceEarlyReturn" label="Force Early Return"> 2952 <intro> 2953 These functions allow an agent to force a method 2954 to return at any point during its execution. 2955 The method which will return early is referred to as the <i>called method</i>. 2956 The called method is the current method 2957 (as defined by 2958 <vmspec chapter="3.6"/>) 2959 for the specified thread at 2960 the time the function is called. 2961 <p/> 2962 The specified thread must be suspended or must be the current thread. 2963 The return occurs when execution of Java programming 2964 language code is resumed on this thread. 2965 Between calling one of these functions and resumption 2966 of thread execution, the state of the stack is undefined. 2967 <p/> 2968 No further instructions are executed in the called method. 2969 Specifically, finally blocks are not executed. 2970 Note: this can cause inconsistent states in the application. 2971 <p/> 2972 A lock acquired by calling the called method 2973 (if it is a <code>synchronized</code> method) 2974 and locks acquired by entering <code>synchronized</code> 2975 blocks within the called method are released. 2976 Note: this does not apply to native locks or 2977 <code>java.util.concurrent.locks</code> locks. 2978 <p/> 2979 Events, such as <eventlink id="MethodExit"></eventlink>, 2980 are generated as they would be in a normal return. 2981 <p/> 2982 The called method must be a non-native Java programming 2983 language method. 2984 Forcing return on a thread with only one frame on the 2985 stack causes the thread to exit when resumed. 2986 </intro> 2987 2988 <function id="ForceEarlyReturnObject" num="81" since="1.1"> 2989 <synopsis>Force Early Return - Object</synopsis> 2990 <description> 2991 This function can be used to return from a method whose 2992 result type is <code>Object</code> 2993 or a subclass of <code>Object</code>. 2994 </description> 2995 <origin>new</origin> 2996 <capabilities> 2997 <required id="can_force_early_return"></required> 2998 </capabilities> 2999 <parameters> 3000 <param id="thread"> 3001 <jthread null="current"/> 3002 <description> 3003 The thread whose current frame is to return early. 3004 </description> 3005 </param> 3006 <param id="value"> 3007 <jobject/> 3008 <description> 3009 The return value for the called frame. 3010 An object or <code>NULL</code>. 3011 </description> 3012 </param> 3013 </parameters> 3014 <errors> 3015 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 3016 Attempted to return early from a frame 3017 corresponding to a native method. 3018 Or the implementation is unable to provide 3019 this functionality on this frame. 3020 </error> 3021 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 3022 The result type of the called method is not 3023 <code>Object</code> or a subclass of <code>Object</code>. 3024 </error> 3025 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 3026 The supplied <paramlink id="value"/> is not compatible with the 3027 result type of the called method. 3028 </error> 3029 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 3030 Thread was not the current thread and was not suspended. 3031 </error> 3032 <error id="JVMTI_ERROR_NO_MORE_FRAMES"> 3033 There are no more frames on the call stack. 3034 </error> 3035 </errors> 3036 </function> 3037 3038 <function id="ForceEarlyReturnInt" num="82" since="1.1"> 3039 <synopsis>Force Early Return - Int</synopsis> 3040 <description> 3041 This function can be used to return from a method whose 3042 result type is <code>int</code>, <code>short</code>, 3043 <code>char</code>, <code>byte</code>, or 3044 <code>boolean</code>. 3045 </description> 3046 <origin>new</origin> 3047 <capabilities> 3048 <required id="can_force_early_return"></required> 3049 </capabilities> 3050 <parameters> 3051 <param id="thread"> 3052 <jthread null="current"/> 3053 <description> 3054 The thread whose current frame is to return early. 3055 </description> 3056 </param> 3057 <param id="value"> 3058 <jint/> 3059 <description> 3060 The return value for the called frame. 3061 </description> 3062 </param> 3063 </parameters> 3064 <errors> 3065 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 3066 Attempted to return early from a frame 3067 corresponding to a native method. 3068 Or the implementation is unable to provide 3069 this functionality on this frame. 3070 </error> 3071 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 3072 The result type of the called method is not 3073 <code>int</code>, <code>short</code>, 3074 <code>char</code>, <code>byte</code>, or 3075 <code>boolean</code>. 3076 </error> 3077 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 3078 Thread was not the current thread and was not suspended. 3079 </error> 3080 <error id="JVMTI_ERROR_NO_MORE_FRAMES"> 3081 There are no frames on the call stack. 3082 </error> 3083 </errors> 3084 </function> 3085 3086 <function id="ForceEarlyReturnLong" num="83" since="1.1"> 3087 <synopsis>Force Early Return - Long</synopsis> 3088 <description> 3089 This function can be used to return from a method whose 3090 result type is <code>long</code>. 3091 </description> 3092 <origin>new</origin> 3093 <capabilities> 3094 <required id="can_force_early_return"></required> 3095 </capabilities> 3096 <parameters> 3097 <param id="thread"> 3098 <jthread null="current"/> 3099 <description> 3100 The thread whose current frame is to return early. 3101 </description> 3102 </param> 3103 <param id="value"> 3104 <jlong/> 3105 <description> 3106 The return value for the called frame. 3107 </description> 3108 </param> 3109 </parameters> 3110 <errors> 3111 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 3112 Attempted to return early from a frame 3113 corresponding to a native method. 3114 Or the implementation is unable to provide 3115 this functionality on this frame. 3116 </error> 3117 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 3118 The result type of the called method is not <code>long</code>. 3119 </error> 3120 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 3121 Thread was not the current thread and was not suspended. 3122 </error> 3123 <error id="JVMTI_ERROR_NO_MORE_FRAMES"> 3124 There are no frames on the call stack. 3125 </error> 3126 </errors> 3127 </function> 3128 3129 <function id="ForceEarlyReturnFloat" num="84" since="1.1"> 3130 <synopsis>Force Early Return - Float</synopsis> 3131 <description> 3132 This function can be used to return from a method whose 3133 result type is <code>float</code>. 3134 </description> 3135 <origin>new</origin> 3136 <capabilities> 3137 <required id="can_force_early_return"></required> 3138 </capabilities> 3139 <parameters> 3140 <param id="thread"> 3141 <jthread null="current"/> 3142 <description> 3143 The thread whose current frame is to return early. 3144 </description> 3145 </param> 3146 <param id="value"> 3147 <jfloat/> 3148 <description> 3149 The return value for the called frame. 3150 </description> 3151 </param> 3152 </parameters> 3153 <errors> 3154 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 3155 Attempted to return early from a frame 3156 corresponding to a native method. 3157 Or the implementation is unable to provide 3158 this functionality on this frame. 3159 </error> 3160 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 3161 The result type of the called method is not <code>float</code>. 3162 </error> 3163 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 3164 Thread was not the current thread and was not suspended. 3165 </error> 3166 <error id="JVMTI_ERROR_NO_MORE_FRAMES"> 3167 There are no frames on the call stack. 3168 </error> 3169 </errors> 3170 </function> 3171 3172 <function id="ForceEarlyReturnDouble" num="85" since="1.1"> 3173 <synopsis>Force Early Return - Double</synopsis> 3174 <description> 3175 This function can be used to return from a method whose 3176 result type is <code>double</code>. 3177 </description> 3178 <origin>new</origin> 3179 <capabilities> 3180 <required id="can_force_early_return"></required> 3181 </capabilities> 3182 <parameters> 3183 <param id="thread"> 3184 <jthread null="current"/> 3185 <description> 3186 The thread whose current frame is to return early. 3187 </description> 3188 </param> 3189 <param id="value"> 3190 <jdouble/> 3191 <description> 3192 The return value for the called frame. 3193 </description> 3194 </param> 3195 </parameters> 3196 <errors> 3197 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 3198 Attempted to return early from a frame corresponding to a native method. 3199 Or the implementation is unable to provide this functionality on this frame. 3200 </error> 3201 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 3202 The result type of the called method is not <code>double</code>. 3203 </error> 3204 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 3205 Thread was not the current thread and was not suspended. 3206 </error> 3207 <error id="JVMTI_ERROR_NO_MORE_FRAMES"> 3208 There are no frames on the call stack. 3209 </error> 3210 </errors> 3211 </function> 3212 3213 <function id="ForceEarlyReturnVoid" num="86" since="1.1"> 3214 <synopsis>Force Early Return - Void</synopsis> 3215 <description> 3216 This function can be used to return from a method with no result type. 3217 That is, the called method must be declared <code>void</code>. 3218 </description> 3219 <origin>new</origin> 3220 <capabilities> 3221 <required id="can_force_early_return"></required> 3222 </capabilities> 3223 <parameters> 3224 <param id="thread"> 3225 <jthread null="current"/> 3226 <description> 3227 The thread whose current frame is to return early. 3228 </description> 3229 </param> 3230 </parameters> 3231 <errors> 3232 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 3233 Attempted to return early from a frame 3234 corresponding to a native method. 3235 Or the implementation is unable to provide 3236 this functionality on this frame. 3237 </error> 3238 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 3239 The called method has a result type. 3240 </error> 3241 <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED"> 3242 Thread was not the current thread and was not suspended. 3243 </error> 3244 <error id="JVMTI_ERROR_NO_MORE_FRAMES"> 3245 There are no frames on the call stack. 3246 </error> 3247 </errors> 3248 </function> 3249 3250 </category> 3251 3252 <category id="Heap" label="Heap"> 3253 <intro> 3254 These functions are used to analyze the heap. 3255 Functionality includes the ability to view the objects in the 3256 heap and to tag these objects. 3257 </intro> 3258 3259 <intro id="objectTags" label="Object Tags"> 3260 A <i>tag</i> is a value associated with an object. 3261 Tags are explicitly set by the agent using the 3262 <functionlink id="SetTag"></functionlink> function or by 3263 callback functions such as <functionlink id="jvmtiHeapIterationCallback"/>. 3264 <p/> 3265 Tags are local to the environment; that is, the tags of one 3266 environment are not visible in another. 3267 <p/> 3268 Tags are <code>jlong</code> values which can be used 3269 simply to mark an object or to store a pointer to more detailed 3270 information. Objects which have not been tagged have a 3271 tag of zero. 3272 Setting a tag to zero makes the object untagged. 3273 </intro> 3274 3275 <intro id="heapCallbacks" label="Heap Callback Functions"> 3276 Heap functions which iterate through the heap and recursively 3277 follow object references use agent supplied callback functions 3278 to deliver the information. 3279 <p/> 3280 These heap callback functions must adhere to the following restrictions -- 3281 These callbacks must not use JNI functions. 3282 These callbacks must not use <jvmti/> functions except 3283 <i>callback safe</i> functions which 3284 specifically allow such use (see the raw monitor, memory management, 3285 and environment local storage functions). 3286 <p/> 3287 An implementation may invoke a callback on an internal thread or 3288 the thread which called the iteration function. 3289 Heap callbacks are single threaded -- no more than one callback will 3290 be invoked at a time. 3291 <p/> 3292 The Heap Filter Flags can be used to prevent reporting 3293 based on the tag status of an object or its class. 3294 If no flags are set (the <code>jint</code> is zero), objects 3295 will not be filtered out. 3296 3297 <constants id="jvmtiHeapFilter" label="Heap Filter Flags" kind="bits"> 3298 <constant id="JVMTI_HEAP_FILTER_TAGGED" num="0x4"> 3299 Filter out tagged objects. Objects which are tagged are not included. 3300 </constant> 3301 <constant id="JVMTI_HEAP_FILTER_UNTAGGED" num="0x8"> 3302 Filter out untagged objects. Objects which are not tagged are not included. 3303 </constant> 3304 <constant id="JVMTI_HEAP_FILTER_CLASS_TAGGED" num="0x10"> 3305 Filter out objects with tagged classes. Objects whose class is tagged are not included. 3306 </constant> 3307 <constant id="JVMTI_HEAP_FILTER_CLASS_UNTAGGED" num="0x20"> 3308 Filter out objects with untagged classes. Objects whose class is not tagged are not included. 3309 </constant> 3310 </constants> 3311 3312 <p/> 3313 The Heap Visit Control Flags are returned by the heap callbacks 3314 and can be used to abort the iteration. For the 3315 <functionlink id="jvmtiHeapReferenceCallback">Heap 3316 Reference Callback</functionlink>, it can also be used 3317 to prune the graph of traversed references 3318 (<code>JVMTI_VISIT_OBJECTS</code> is not set). 3319 3320 <constants id="jvmtiHeapVisitControl" 3321 label="Heap Visit Control Flags" 3322 kind="bits" 3323 since="1.1"> 3324 <constant id="JVMTI_VISIT_OBJECTS" num="0x100"> 3325 If we are visiting an object and if this callback 3326 was initiated by <functionlink id="FollowReferences"/>, 3327 traverse the references of this object. 3328 Otherwise ignored. 3329 </constant> 3330 <constant id="JVMTI_VISIT_ABORT" num="0x8000"> 3331 Abort the iteration. Ignore all other bits. 3332 </constant> 3333 </constants> 3334 3335 <p/> 3336 The Heap Reference Enumeration is provided by the 3337 <functionlink id="jvmtiHeapReferenceCallback">Heap 3338 Reference Callback</functionlink> and 3339 <functionlink id="jvmtiPrimitiveFieldCallback">Primitive Field 3340 Callback</functionlink> to 3341 describe the kind of reference 3342 being reported. 3343 3344 <constants id="jvmtiHeapReferenceKind" 3345 label="Heap Reference Enumeration" 3346 kind="enum" 3347 since="1.1"> 3348 <constant id="JVMTI_HEAP_REFERENCE_CLASS" num="1"> 3349 Reference from an object to its class. 3350 </constant> 3351 <constant id="JVMTI_HEAP_REFERENCE_FIELD" num="2"> 3352 Reference from an object to the value of one of its instance fields. 3353 </constant> 3354 <constant id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT" num="3"> 3355 Reference from an array to one of its elements. 3356 </constant> 3357 <constant id="JVMTI_HEAP_REFERENCE_CLASS_LOADER" num="4"> 3358 Reference from a class to its class loader. 3359 </constant> 3360 <constant id="JVMTI_HEAP_REFERENCE_SIGNERS" num="5"> 3361 Reference from a class to its signers array. 3362 </constant> 3363 <constant id="JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN" num="6"> 3364 Reference from a class to its protection domain. 3365 </constant> 3366 <constant id="JVMTI_HEAP_REFERENCE_INTERFACE" num="7"> 3367 Reference from a class to one of its interfaces. 3368 Note: interfaces are defined via a constant pool reference, 3369 so the referenced interfaces may also be reported with a 3370 <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind. 3371 </constant> 3372 <constant id="JVMTI_HEAP_REFERENCE_STATIC_FIELD" num="8"> 3373 Reference from a class to the value of one of its static fields. 3374 </constant> 3375 <constant id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL" num="9"> 3376 Reference from a class to a resolved entry in the constant pool. 3377 </constant> 3378 <constant id="JVMTI_HEAP_REFERENCE_SUPERCLASS" num="10"> 3379 Reference from a class to its superclass. 3380 A callback is not sent if the superclass is <code>java.lang.Object</code>. 3381 Note: loaded classes define superclasses via a constant pool 3382 reference, so the referenced superclass may also be reported with 3383 a <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind. 3384 </constant> 3385 <constant id="JVMTI_HEAP_REFERENCE_JNI_GLOBAL" num="21"> 3386 Heap root reference: JNI global reference. 3387 </constant> 3388 <constant id="JVMTI_HEAP_REFERENCE_SYSTEM_CLASS" num="22"> 3389 Heap root reference: System class. 3390 </constant> 3391 <constant id="JVMTI_HEAP_REFERENCE_MONITOR" num="23"> 3392 Heap root reference: monitor. 3393 </constant> 3394 <constant id="JVMTI_HEAP_REFERENCE_STACK_LOCAL" num="24"> 3395 Heap root reference: local variable on the stack. 3396 </constant> 3397 <constant id="JVMTI_HEAP_REFERENCE_JNI_LOCAL" num="25"> 3398 Heap root reference: JNI local reference. 3399 </constant> 3400 <constant id="JVMTI_HEAP_REFERENCE_THREAD" num="26"> 3401 Heap root reference: Thread. 3402 </constant> 3403 <constant id="JVMTI_HEAP_REFERENCE_OTHER" num="27"> 3404 Heap root reference: other heap root reference. 3405 </constant> 3406 </constants> 3407 3408 <p/> 3409 Definitions for the single character type descriptors of 3410 primitive types. 3411 3412 <constants id="jvmtiPrimitiveType" 3413 label="Primitive Type Enumeration" 3414 kind="enum" 3415 since="1.1"> 3416 <constant id="JVMTI_PRIMITIVE_TYPE_BOOLEAN" num="90"> 3417 'Z' - Java programming language <code>boolean</code> - JNI <code>jboolean</code> 3418 </constant> 3419 <constant id="JVMTI_PRIMITIVE_TYPE_BYTE" num="66"> 3420 'B' - Java programming language <code>byte</code> - JNI <code>jbyte</code> 3421 </constant> 3422 <constant id="JVMTI_PRIMITIVE_TYPE_CHAR" num="67"> 3423 'C' - Java programming language <code>char</code> - JNI <code>jchar</code> 3424 </constant> 3425 <constant id="JVMTI_PRIMITIVE_TYPE_SHORT" num="83"> 3426 'S' - Java programming language <code>short</code> - JNI <code>jshort</code> 3427 </constant> 3428 <constant id="JVMTI_PRIMITIVE_TYPE_INT" num="73"> 3429 'I' - Java programming language <code>int</code> - JNI <code>jint</code> 3430 </constant> 3431 <constant id="JVMTI_PRIMITIVE_TYPE_LONG" num="74"> 3432 'J' - Java programming language <code>long</code> - JNI <code>jlong</code> 3433 </constant> 3434 <constant id="JVMTI_PRIMITIVE_TYPE_FLOAT" num="70"> 3435 'F' - Java programming language <code>float</code> - JNI <code>jfloat</code> 3436 </constant> 3437 <constant id="JVMTI_PRIMITIVE_TYPE_DOUBLE" num="68"> 3438 'D' - Java programming language <code>double</code> - JNI <code>jdouble</code> 3439 </constant> 3440 </constants> 3441 </intro> 3442 3443 <typedef id="jvmtiHeapReferenceInfoField" 3444 label="Reference information structure for Field references" 3445 since="1.1"> 3446 <description> 3447 Reference information returned for 3448 <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> and 3449 <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references. 3450 </description> 3451 <field id="index"> 3452 <jint/> 3453 <description> 3454 For <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>, the 3455 referrer object is not a class or an inteface. 3456 In this case, <code>index</code> is the index of the field 3457 in the class of the referrer object. 3458 This class is referred to below as <i>C</i>. 3459 <p/> 3460 For <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>, 3461 the referrer object is a class (referred to below as <i>C</i>) 3462 or an interface (referred to below as <i>I</i>). 3463 In this case, <code>index</code> is the index of the field in 3464 that class or interface. 3465 <p/> 3466 If the referrer object is not an interface, then the field 3467 indices are determined as follows: 3468 <ul> 3469 <li>make a list of all the fields in <i>C</i> and its 3470 superclasses, starting with all the fields in 3471 <code>java.lang.Object</code> and ending with all the 3472 fields in <i>C</i>.</li> 3473 <li>Within this list, put 3474 the fields for a given class in the order returned by 3475 <functionlink id="GetClassFields"/>.</li> 3476 <li>Assign the fields in this list indices 3477 <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i> 3478 is the count of the fields in all the interfaces 3479 implemented by <i>C</i>. 3480 Note that <i>C</i> implements all interfaces 3481 directly implemented by its superclasses; as well 3482 as all superinterfaces of these interfaces.</li> 3483 </ul> 3484 If the referrer object is an interface, then the field 3485 indices are determined as follows: 3486 <ul> 3487 <li>make a list of the fields directly declared in 3488 <i>I</i>.</li> 3489 <li>Within this list, put 3490 the fields in the order returned by 3491 <functionlink id="GetClassFields"/>.</li> 3492 <li>Assign the fields in this list indices 3493 <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i> 3494 is the count of the fields in all the superinterfaces 3495 of <i>I</i>.</li> 3496 </ul> 3497 All fields are included in this computation, regardless of 3498 field modifier (static, public, private, etc). 3499 <p/> 3500 For example, given the following classes and interfaces: 3501 <example> 3502 interface I0 { 3503 int p = 0; 3504 } 3505 3506 interface I1 extends I0 { 3507 int x = 1; 3508 } 3509 3510 interface I2 extends I0 { 3511 int y = 2; 3512 } 3513 3514 class C1 implements I1 { 3515 public static int a = 3; 3516 private int b = 4; 3517 } 3518 3519 class C2 extends C1 implements I2 { 3520 static int q = 5; 3521 final int r = 6; 3522 } 3523 </example> 3524 Assume that <functionlink id="GetClassFields"/> called on 3525 <code>C1</code> returns the fields of <code>C1</code> in the 3526 order: a, b; and that the fields of <code>C2</code> are 3527 returned in the order: q, r. 3528 An instance of class <code>C1</code> will have the 3529 following field indices: 3530 <dl><dd><table> 3531 <tr> 3532 <td> 3533 a 3534 </td> 3535 <td> 3536 2 3537 </td> 3538 <td align="left"> 3539 The count of the fields in the interfaces 3540 implemented by <code>C1</code> is two (<i>n</i>=2): 3541 <code>p</code> of <code>I0</code> 3542 and <code>x</code> of <code>I1</code>. 3543 </td> 3544 </tr> 3545 <tr> 3546 <td> 3547 b 3548 </td> 3549 <td> 3550 3 3551 </td> 3552 <td align="left"> 3553 the subsequent index. 3554 </td> 3555 </tr> 3556 </table></dd></dl> 3557 The class <code>C1</code> will have the same field indices. 3558 <p/> 3559 An instance of class <code>C2</code> will have the 3560 following field indices: 3561 <dl><dd><table> 3562 <tr> 3563 <td> 3564 a 3565 </td> 3566 <td> 3567 3 3568 </td> 3569 <td align="left"> 3570 The count of the fields in the interfaces 3571 implemented by <code>C2</code> is three (<i>n</i>=3): 3572 <code>p</code> of <code>I0</code>, 3573 <code>x</code> of <code>I1</code> and <code>y</code> of <code>I2</code> 3574 (an interface of <code>C2</code>). Note that the field <code>p</code> 3575 of <code>I0</code> is only included once. 3576 </td> 3577 </tr> 3578 <tr> 3579 <td> 3580 b 3581 </td> 3582 <td> 3583 4 3584 </td> 3585 <td align="left"> 3586 the subsequent index to "a". 3587 </td> 3588 </tr> 3589 <tr> 3590 <td> 3591 q 3592 </td> 3593 <td> 3594 5 3595 </td> 3596 <td align="left"> 3597 the subsequent index to "b". 3598 </td> 3599 </tr> 3600 <tr> 3601 <td> 3602 r 3603 </td> 3604 <td> 3605 6 3606 </td> 3607 <td align="left"> 3608 the subsequent index to "q". 3609 </td> 3610 </tr> 3611 </table></dd></dl> 3612 The class <code>C2</code> will have the same field indices. 3613 Note that a field may have a different index depending on the 3614 object that is viewing it -- for example field "a" above. 3615 Note also: not all field indices may be visible from the 3616 callbacks, but all indices are shown for illustrative purposes. 3617 <p/> 3618 The interface <code>I1</code> will have the 3619 following field indices: 3620 <dl><dd><table> 3621 <tr> 3622 <td> 3623 x 3624 </td> 3625 <td> 3626 1 3627 </td> 3628 <td align="left"> 3629 The count of the fields in the superinterfaces 3630 of <code>I1</code> is one (<i>n</i>=1): 3631 <code>p</code> of <code>I0</code>. 3632 </td> 3633 </tr> 3634 </table></dd></dl> 3635 </description> 3636 </field> 3637 </typedef> 3638 3639 <typedef id="jvmtiHeapReferenceInfoArray" 3640 label="Reference information structure for Array references" 3641 since="1.1"> 3642 <description> 3643 Reference information returned for 3644 <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references. 3645 </description> 3646 <field id="index"> 3647 <jint/> 3648 <description> 3649 The array index. 3650 </description> 3651 </field> 3652 </typedef> 3653 3654 <typedef id="jvmtiHeapReferenceInfoConstantPool" 3655 label="Reference information structure for Constant Pool references" 3656 since="1.1"> 3657 <description> 3658 Reference information returned for 3659 <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references. 3660 </description> 3661 <field id="index"> 3662 <jint/> 3663 <description> 3664 The index into the constant pool of the class. See the description in 3665 <vmspec chapter="4.4"/>. 3666 </description> 3667 </field> 3668 </typedef> 3669 3670 <typedef id="jvmtiHeapReferenceInfoStackLocal" 3671 label="Reference information structure for Local Variable references" 3672 since="1.1"> 3673 <description> 3674 Reference information returned for 3675 <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references. 3676 </description> 3677 <field id="thread_tag"> 3678 <jlong/> 3679 <description> 3680 The tag of the thread corresponding to this stack, zero if not tagged. 3681 </description> 3682 </field> 3683 <field id="thread_id"> 3684 <jlong/> 3685 <description> 3686 The unique thread ID of the thread corresponding to this stack. 3687 </description> 3688 </field> 3689 <field id="depth"> 3690 <jint/> 3691 <description> 3692 The depth of the frame. 3693 </description> 3694 </field> 3695 <field id="method"> 3696 <jmethodID/> 3697 <description> 3698 The method executing in this frame. 3699 </description> 3700 </field> 3701 <field id="location"> 3702 <jlocation/> 3703 <description> 3704 The currently executing location in this frame. 3705 </description> 3706 </field> 3707 <field id="slot"> 3708 <jint/> 3709 <description> 3710 The slot number of the local variable. 3711 </description> 3712 </field> 3713 </typedef> 3714 3715 <typedef id="jvmtiHeapReferenceInfoJniLocal" 3716 label="Reference information structure for JNI local references" 3717 since="1.1"> 3718 <description> 3719 Reference information returned for 3720 <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references. 3721 </description> 3722 <field id="thread_tag"> 3723 <jlong/> 3724 <description> 3725 The tag of the thread corresponding to this stack, zero if not tagged. 3726 </description> 3727 </field> 3728 <field id="thread_id"> 3729 <jlong/> 3730 <description> 3731 The unique thread ID of the thread corresponding to this stack. 3732 </description> 3733 </field> 3734 <field id="depth"> 3735 <jint/> 3736 <description> 3737 The depth of the frame. 3738 </description> 3739 </field> 3740 <field id="method"> 3741 <jmethodID/> 3742 <description> 3743 The method executing in this frame. 3744 </description> 3745 </field> 3746 </typedef> 3747 3748 <typedef id="jvmtiHeapReferenceInfoReserved" 3749 label="Reference information structure for Other references" 3750 since="1.1"> 3751 <description> 3752 Reference information returned for other references. 3753 </description> 3754 <field id="reserved1"> 3755 <jlong/> 3756 <description> 3757 reserved for future use. 3758 </description> 3759 </field> 3760 <field id="reserved2"> 3761 <jlong/> 3762 <description> 3763 reserved for future use. 3764 </description> 3765 </field> 3766 <field id="reserved3"> 3767 <jlong/> 3768 <description> 3769 reserved for future use. 3770 </description> 3771 </field> 3772 <field id="reserved4"> 3773 <jlong/> 3774 <description> 3775 reserved for future use. 3776 </description> 3777 </field> 3778 <field id="reserved5"> 3779 <jlong/> 3780 <description> 3781 reserved for future use. 3782 </description> 3783 </field> 3784 <field id="reserved6"> 3785 <jlong/> 3786 <description> 3787 reserved for future use. 3788 </description> 3789 </field> 3790 <field id="reserved7"> 3791 <jlong/> 3792 <description> 3793 reserved for future use. 3794 </description> 3795 </field> 3796 <field id="reserved8"> 3797 <jlong/> 3798 <description> 3799 reserved for future use. 3800 </description> 3801 </field> 3802 </typedef> 3803 3804 <uniontypedef id="jvmtiHeapReferenceInfo" 3805 label="Reference information structure" 3806 since="1.1"> 3807 <description> 3808 The information returned about referrers. 3809 Represented as a union of the various kinds of reference information. 3810 </description> 3811 <field id="field"> 3812 <struct>jvmtiHeapReferenceInfoField</struct> 3813 <description> 3814 The referrer information for 3815 <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> 3816 and <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references. 3817 </description> 3818 </field> 3819 <field id="array"> 3820 <struct>jvmtiHeapReferenceInfoArray</struct> 3821 <description> 3822 The referrer information for 3823 For <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references. 3824 </description> 3825 </field> 3826 <field id="constant_pool"> 3827 <struct>jvmtiHeapReferenceInfoConstantPool</struct> 3828 <description> 3829 The referrer information for 3830 For <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references. 3831 </description> 3832 </field> 3833 <field id="stack_local"> 3834 <struct>jvmtiHeapReferenceInfoStackLocal</struct> 3835 <description> 3836 The referrer information for 3837 For <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references. 3838 </description> 3839 </field> 3840 <field id="jni_local"> 3841 <struct>jvmtiHeapReferenceInfoJniLocal</struct> 3842 <description> 3843 The referrer information for 3844 For <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references. 3845 </description> 3846 </field> 3847 <field id="other"> 3848 <struct>jvmtiHeapReferenceInfoReserved</struct> 3849 <description> 3850 reserved for future use. 3851 </description> 3852 </field> 3853 </uniontypedef> 3854 3855 <typedef id="jvmtiHeapCallbacks" 3856 label="Heap callback function structure" 3857 since="1.1"> 3858 <field id="heap_iteration_callback"> 3859 <ptrtype> 3860 <struct>jvmtiHeapIterationCallback</struct> 3861 </ptrtype> 3862 <description> 3863 The callback to be called to describe an 3864 object in the heap. Used by the 3865 <functionlink id="IterateThroughHeap"/> function, ignored by the 3866 <functionlink id="FollowReferences"/> function. 3867 </description> 3868 </field> 3869 <field id="heap_reference_callback"> 3870 <ptrtype> 3871 <struct>jvmtiHeapReferenceCallback</struct> 3872 </ptrtype> 3873 <description> 3874 The callback to be called to describe an 3875 object reference. Used by the 3876 <functionlink id="FollowReferences"/> function, ignored by the 3877 <functionlink id="IterateThroughHeap"/> function. 3878 </description> 3879 </field> 3880 <field id="primitive_field_callback"> 3881 <ptrtype> 3882 <struct>jvmtiPrimitiveFieldCallback</struct> 3883 </ptrtype> 3884 <description> 3885 The callback to be called to describe a 3886 primitive field. 3887 </description> 3888 </field> 3889 <field id="array_primitive_value_callback"> 3890 <ptrtype> 3891 <struct>jvmtiArrayPrimitiveValueCallback</struct> 3892 </ptrtype> 3893 <description> 3894 The callback to be called to describe an 3895 array of primitive values. 3896 </description> 3897 </field> 3898 <field id="string_primitive_value_callback"> 3899 <ptrtype> 3900 <struct>jvmtiStringPrimitiveValueCallback</struct> 3901 </ptrtype> 3902 <description> 3903 The callback to be called to describe a String value. 3904 </description> 3905 </field> 3906 <field id="reserved5"> 3907 <ptrtype> 3908 <struct>jvmtiReservedCallback</struct> 3909 </ptrtype> 3910 <description> 3911 Reserved for future use.. 3912 </description> 3913 </field> 3914 <field id="reserved6"> 3915 <ptrtype> 3916 <struct>jvmtiReservedCallback</struct> 3917 </ptrtype> 3918 <description> 3919 Reserved for future use.. 3920 </description> 3921 </field> 3922 <field id="reserved7"> 3923 <ptrtype> 3924 <struct>jvmtiReservedCallback</struct> 3925 </ptrtype> 3926 <description> 3927 Reserved for future use.. 3928 </description> 3929 </field> 3930 <field id="reserved8"> 3931 <ptrtype> 3932 <struct>jvmtiReservedCallback</struct> 3933 </ptrtype> 3934 <description> 3935 Reserved for future use.. 3936 </description> 3937 </field> 3938 <field id="reserved9"> 3939 <ptrtype> 3940 <struct>jvmtiReservedCallback</struct> 3941 </ptrtype> 3942 <description> 3943 Reserved for future use.. 3944 </description> 3945 </field> 3946 <field id="reserved10"> 3947 <ptrtype> 3948 <struct>jvmtiReservedCallback</struct> 3949 </ptrtype> 3950 <description> 3951 Reserved for future use.. 3952 </description> 3953 </field> 3954 <field id="reserved11"> 3955 <ptrtype> 3956 <struct>jvmtiReservedCallback</struct> 3957 </ptrtype> 3958 <description> 3959 Reserved for future use.. 3960 </description> 3961 </field> 3962 <field id="reserved12"> 3963 <ptrtype> 3964 <struct>jvmtiReservedCallback</struct> 3965 </ptrtype> 3966 <description> 3967 Reserved for future use.. 3968 </description> 3969 </field> 3970 <field id="reserved13"> 3971 <ptrtype> 3972 <struct>jvmtiReservedCallback</struct> 3973 </ptrtype> 3974 <description> 3975 Reserved for future use.. 3976 </description> 3977 </field> 3978 <field id="reserved14"> 3979 <ptrtype> 3980 <struct>jvmtiReservedCallback</struct> 3981 </ptrtype> 3982 <description> 3983 Reserved for future use.. 3984 </description> 3985 </field> 3986 <field id="reserved15"> 3987 <ptrtype> 3988 <struct>jvmtiReservedCallback</struct> 3989 </ptrtype> 3990 <description> 3991 Reserved for future use.. 3992 </description> 3993 </field> 3994 </typedef> 3995 3996 3997 <intro> 3998 <rationale> 3999 The heap dumping functionality (below) uses a callback 4000 for each object. While it would seem that a buffered approach 4001 would provide better throughput, tests do 4002 not show this to be the case--possibly due to locality of 4003 memory reference or array access overhead. 4004 </rationale> 4005 4006 <issue> 4007 Still under investigation as to if java.lang.ref references 4008 are reported as a different type of reference. 4009 </issue> 4010 4011 <issue> 4012 Should or can an indication of the cost or relative cost of 4013 these operations be included? 4014 </issue> 4015 4016 </intro> 4017 4018 <callback id="jvmtiHeapIterationCallback" since="1.1"> 4019 <jint/> 4020 <synopsis>Heap Iteration Callback</synopsis> 4021 <description> 4022 Agent supplied callback function. 4023 Describes (but does not pass in) an object in the heap. 4024 <p/> 4025 This function should return a bit vector of the desired 4026 <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>. 4027 This will determine if the entire iteration should be aborted 4028 (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored). 4029 <p/> 4030 See the <internallink id="heapCallbacks">heap callback 4031 function restrictions</internallink>. 4032 </description> 4033 <parameters> 4034 <param id="class_tag"> 4035 <jlong/> 4036 <description> 4037 The tag of the class of object (zero if the class is not tagged). 4038 If the object represents a runtime class, 4039 the <code>class_tag</code> is the tag 4040 associated with <code>java.lang.Class</code> 4041 (zero if <code>java.lang.Class</code> is not tagged). 4042 </description> 4043 </param> 4044 <param id="size"> 4045 <jlong/> 4046 <description> 4047 Size of the object (in bytes). See <functionlink id="GetObjectSize"/>. 4048 </description> 4049 </param> 4050 <param id="tag_ptr"> 4051 <outptr><jlong/></outptr> 4052 <description> 4053 The object tag value, or zero if the object is not tagged. 4054 To set the tag value to be associated with the object 4055 the agent sets the <code>jlong</code> pointed to by the parameter. 4056 </description> 4057 </param> 4058 <param id="length"> 4059 <jint/> 4060 <description> 4061 If this object is an array, the length of the array. Otherwise negative one (-1). 4062 </description> 4063 </param> 4064 <param id="user_data"> 4065 <outptr><void/></outptr> 4066 <description> 4067 The user supplied data that was passed into the iteration function. 4068 </description> 4069 </param> 4070 </parameters> 4071 </callback> 4072 4073 <callback id="jvmtiHeapReferenceCallback" since="1.1"> 4074 <jint/> 4075 <synopsis>Heap Reference Callback</synopsis> 4076 <description> 4077 Agent supplied callback function. 4078 Describes a reference from an object or the VM (the referrer) to another object 4079 (the referree) or a heap root to a referree. 4080 <p/> 4081 This function should return a bit vector of the desired 4082 <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>. 4083 This will determine if the objects referenced by the referree 4084 should be visited or if the entire iteration should be aborted. 4085 <p/> 4086 See the <internallink id="heapCallbacks">heap callback 4087 function restrictions</internallink>. 4088 </description> 4089 <parameters> 4090 <param id="reference_kind"> 4091 <enum>jvmtiHeapReferenceKind</enum> 4092 <description> 4093 The kind of reference. 4094 </description> 4095 </param> 4096 <param id="reference_info"> 4097 <inptr> 4098 <struct>jvmtiHeapReferenceInfo</struct> 4099 </inptr> 4100 <description> 4101 Details about the reference. 4102 Set when the <datalink id="jvmtiHeapReferenceCallback.reference_kind">reference_kind</datalink> is 4103 <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>, 4104 <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>, 4105 <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/>, 4106 <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/>, 4107 <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/>, 4108 or <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/>. 4109 Otherwise <code>NULL</code>. 4110 </description> 4111 </param> 4112 <param id="class_tag"> 4113 <jlong/> 4114 <description> 4115 The tag of the class of referree object (zero if the class is not tagged). 4116 If the referree object represents a runtime class, 4117 the <code>class_tag</code> is the tag 4118 associated with <code>java.lang.Class</code> 4119 (zero if <code>java.lang.Class</code> is not tagged). 4120 </description> 4121 </param> 4122 <param id="referrer_class_tag"> 4123 <jlong/> 4124 <description> 4125 The tag of the class of the referrer object (zero if the class is not tagged 4126 or the referree is a heap root). If the referrer object represents a runtime 4127 class, the <code>referrer_class_tag</code> is the tag associated with 4128 the <code>java.lang.Class</code> 4129 (zero if <code>java.lang.Class</code> is not tagged). 4130 </description> 4131 </param> 4132 <param id="size"> 4133 <jlong/> 4134 <description> 4135 Size of the referree object (in bytes). 4136 See <functionlink id="GetObjectSize"/>. 4137 </description> 4138 </param> 4139 <param id="tag_ptr"> 4140 <outptr><jlong/></outptr> 4141 <description> 4142 Points to the referree object tag value, or zero if the object is not 4143 tagged. 4144 To set the tag value to be associated with the object 4145 the agent sets the <code>jlong</code> pointed to by the parameter. 4146 </description> 4147 </param> 4148 <param id="referrer_tag_ptr"> 4149 <outptr><jlong/></outptr> 4150 <description> 4151 Points to the tag of the referrer object, or 4152 points to the zero if the referrer 4153 object is not tagged. 4154 <code>NULL</code> if the referrer in not an object (that is, 4155 this callback is reporting a heap root). 4156 To set the tag value to be associated with the referrer object 4157 the agent sets the <code>jlong</code> pointed to by the parameter. 4158 If this callback is reporting a reference from an object to itself, 4159 <code>referrer_tag_ptr == tag_ptr</code>. 4160 </description> 4161 </param> 4162 <param id="length"> 4163 <jint/> 4164 <description> 4165 If this object is an array, the length of the array. Otherwise negative one (-1). 4166 </description> 4167 </param> 4168 <param id="user_data"> 4169 <outptr><void/></outptr> 4170 <description> 4171 The user supplied data that was passed into the iteration function. 4172 </description> 4173 </param> 4174 </parameters> 4175 </callback> 4176 4177 <callback id="jvmtiPrimitiveFieldCallback" since="1.1"> 4178 <jint/> 4179 <synopsis>Primitive Field Callback</synopsis> 4180 <description> 4181 Agent supplied callback function which 4182 describes a primitive field of an object (<i>the object</i>). 4183 A primitive field is a field whose type is a primitive type. 4184 This callback will describe a static field if the object is a class, 4185 and otherwise will describe an instance field. 4186 <p/> 4187 This function should return a bit vector of the desired 4188 <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>. 4189 This will determine if the entire iteration should be aborted 4190 (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored). 4191 <p/> 4192 See the <internallink id="heapCallbacks">heap callback 4193 function restrictions</internallink>. 4194 </description> 4195 <parameters> 4196 <param id="kind"> 4197 <enum>jvmtiHeapReferenceKind</enum> 4198 <description> 4199 The kind of field -- instance or static (<datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> or 4200 <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>). 4201 </description> 4202 </param> 4203 <param id="info"> 4204 <inptr> 4205 <struct>jvmtiHeapReferenceInfo</struct> 4206 </inptr> 4207 <description> 4208 Which field (the field index). 4209 </description> 4210 </param> 4211 <param id="object_class_tag"> 4212 <jlong/> 4213 <description> 4214 The tag of the class of the object (zero if the class is not tagged). 4215 If the object represents a runtime class, the 4216 <code>object_class_tag</code> is the tag 4217 associated with <code>java.lang.Class</code> 4218 (zero if <code>java.lang.Class</code> is not tagged). 4219 </description> 4220 </param> 4221 <param id="object_tag_ptr"> 4222 <outptr><jlong/></outptr> 4223 <description> 4224 Points to the tag of the object, or zero if the object is not 4225 tagged. 4226 To set the tag value to be associated with the object 4227 the agent sets the <code>jlong</code> pointed to by the parameter. 4228 </description> 4229 </param> 4230 <param id="value"> 4231 <jvalue/> 4232 <description> 4233 The value of the field. 4234 </description> 4235 </param> 4236 <param id="value_type"> 4237 <enum>jvmtiPrimitiveType</enum> 4238 <description> 4239 The type of the field. 4240 </description> 4241 </param> 4242 <param id="user_data"> 4243 <outptr><void/></outptr> 4244 <description> 4245 The user supplied data that was passed into the iteration function. 4246 </description> 4247 </param> 4248 </parameters> 4249 </callback> 4250 4251 <callback id="jvmtiArrayPrimitiveValueCallback" since="1.1"> 4252 <jint/> 4253 <synopsis>Array Primitive Value Callback</synopsis> 4254 <description> 4255 Agent supplied callback function. 4256 Describes the values in an array of a primitive type. 4257 <p/> 4258 This function should return a bit vector of the desired 4259 <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>. 4260 This will determine if the entire iteration should be aborted 4261 (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored). 4262 <p/> 4263 See the <internallink id="heapCallbacks">heap callback 4264 function restrictions</internallink>. 4265 </description> 4266 <parameters> 4267 <param id="class_tag"> 4268 <jlong/> 4269 <description> 4270 The tag of the class of the array object (zero if the class is not tagged). 4271 </description> 4272 </param> 4273 <param id="size"> 4274 <jlong/> 4275 <description> 4276 Size of the array (in bytes). 4277 See <functionlink id="GetObjectSize"/>. 4278 </description> 4279 </param> 4280 <param id="tag_ptr"> 4281 <outptr><jlong/></outptr> 4282 <description> 4283 Points to the tag of the array object, or zero if the object is not 4284 tagged. 4285 To set the tag value to be associated with the object 4286 the agent sets the <code>jlong</code> pointed to by the parameter. 4287 </description> 4288 </param> 4289 <param id="element_count"> 4290 <jint/> 4291 <description> 4292 The length of the primitive array. 4293 </description> 4294 </param> 4295 <param id="element_type"> 4296 <enum>jvmtiPrimitiveType</enum> 4297 <description> 4298 The type of the elements of the array. 4299 </description> 4300 </param> 4301 <param id="elements"> 4302 <vmbuf><void/></vmbuf> 4303 <description> 4304 The elements of the array in a packed array of <code>element_count</code> 4305 items of <code>element_type</code> size each. 4306 </description> 4307 </param> 4308 <param id="user_data"> 4309 <outptr><void/></outptr> 4310 <description> 4311 The user supplied data that was passed into the iteration function. 4312 </description> 4313 </param> 4314 </parameters> 4315 </callback> 4316 4317 <callback id="jvmtiStringPrimitiveValueCallback" since="1.1"> 4318 <jint/> 4319 <synopsis>String Primitive Value Callback</synopsis> 4320 <description> 4321 Agent supplied callback function. 4322 Describes the value of a java.lang.String. 4323 <p/> 4324 This function should return a bit vector of the desired 4325 <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>. 4326 This will determine if the entire iteration should be aborted 4327 (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored). 4328 <p/> 4329 See the <internallink id="heapCallbacks">heap callback 4330 function restrictions</internallink>. 4331 </description> 4332 <parameters> 4333 <param id="class_tag"> 4334 <jlong/> 4335 <description> 4336 The tag of the class of the String class (zero if the class is not tagged). 4337 <issue>Is this needed?</issue> 4338 </description> 4339 </param> 4340 <param id="size"> 4341 <jlong/> 4342 <description> 4343 Size of the string (in bytes). 4344 See <functionlink id="GetObjectSize"/>. 4345 </description> 4346 </param> 4347 <param id="tag_ptr"> 4348 <outptr><jlong/></outptr> 4349 <description> 4350 Points to the tag of the String object, or zero if the object is not 4351 tagged. 4352 To set the tag value to be associated with the object 4353 the agent sets the <code>jlong</code> pointed to by the parameter. 4354 </description> 4355 </param> 4356 <param id="value"> 4357 <vmbuf><jchar/></vmbuf> 4358 <description> 4359 The value of the String, encoded as a Unicode string. 4360 </description> 4361 </param> 4362 <param id="value_length"> 4363 <jint/> 4364 <description> 4365 The length of the string. 4366 The length is equal to the number of 16-bit Unicode 4367 characters in the string. 4368 </description> 4369 </param> 4370 <param id="user_data"> 4371 <outptr><void/></outptr> 4372 <description> 4373 The user supplied data that was passed into the iteration function. 4374 </description> 4375 </param> 4376 </parameters> 4377 </callback> 4378 4379 4380 <callback id="jvmtiReservedCallback" since="1.1"> 4381 <jint/> 4382 <synopsis>reserved for future use Callback</synopsis> 4383 <description> 4384 Placeholder -- reserved for future use. 4385 </description> 4386 <parameters> 4387 </parameters> 4388 </callback> 4389 4390 <function id="FollowReferences" num="115" since="1.1"> 4391 <synopsis>Follow References</synopsis> 4392 <description> 4393 This function initiates a traversal over the objects that are 4394 directly and indirectly reachable from the specified object or, 4395 if <code>initial_object</code> is not specified, all objects 4396 reachable from the heap roots. 4397 The heap root are the set of system classes, 4398 JNI globals, references from thread stacks, and other objects used as roots 4399 for the purposes of garbage collection. 4400 <p/> 4401 This function operates by traversing the reference graph. 4402 Let <i>A</i>, <i>B</i>, ... represent objects. 4403 When a reference from <i>A</i> to <i>B</i> is traversed, 4404 when a reference from a heap root to <i>B</i> is traversed, 4405 or when <i>B</i> is specified as the <paramlink id="initial_object"/>, 4406 then <i>B</i> is said to be <i>visited</i>. 4407 A reference from <i>A</i> to <i>B</i> is not traversed until <i>A</i> 4408 is visited. 4409 References are reported in the same order that the references are traversed. 4410 Object references are reported by invoking the agent supplied 4411 callback function <functionlink id="jvmtiHeapReferenceCallback"/>. 4412 In a reference from <i>A</i> to <i>B</i>, <i>A</i> is known 4413 as the <i>referrer</i> and <i>B</i> as the <i>referree</i>. 4414 The callback is invoked exactly once for each reference from a referrer; 4415 this is true even if there are reference cycles or multiple paths to 4416 the referrer. 4417 There may be more than one reference between a referrer and a referree, 4418 each reference is reported. 4419 These references may be distinguished by examining the 4420 <datalink 4421 id="jvmtiHeapReferenceCallback.reference_kind"><code>reference_kind</code></datalink> 4422 and 4423 <datalink 4424 id="jvmtiHeapReferenceCallback.reference_info"><code>reference_info</code></datalink> 4425 parameters of the <functionlink id="jvmtiHeapReferenceCallback"/> callback. 4426 <p/> 4427 This function reports a Java programming language view of object references, 4428 not a virtual machine implementation view. The following object references 4429 are reported when they are non-null: 4430 <ul> 4431 <li>Instance objects report references to each non-primitive instance fields 4432 (including inherited fields).</li> 4433 <li>Instance objects report a reference to the object type (class).</li> 4434 <li>Classes report a reference to the superclass and directly 4435 implemented/extended interfaces.</li> 4436 <li>Classes report a reference to the class loader, protection domain, 4437 signers, and resolved entries in the constant pool.</li> 4438 <li>Classes report a reference to each directly declared non-primitive 4439 static field.</li> 4440 <li>Arrays report a reference to the array type (class) and each 4441 array element.</li> 4442 <li>Primitive arrays report a reference to the array type.</li> 4443 </ul> 4444 <p/> 4445 This function can also be used to examine primitive (non-object) values. 4446 The primitive value of an array or String 4447 is reported after the object has been visited; 4448 it is reported by invoking the agent supplied callback function 4449 <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or 4450 <functionlink id="jvmtiStringPrimitiveValueCallback"/>. 4451 A primitive field 4452 is reported after the object with that field is visited; 4453 it is reported by invoking the agent supplied callback function 4454 <functionlink id="jvmtiPrimitiveFieldCallback"/>. 4455 <p/> 4456 Whether a callback is provided or is <code>NULL</code> only determines 4457 whether the callback will be invoked, it does not influence 4458 which objects are visited nor does it influence whether other callbacks 4459 will be invoked. 4460 However, the 4461 <datalink id="jvmtiHeapVisitControl">visit control flags</datalink> 4462 returned by <functionlink id="jvmtiHeapReferenceCallback"/> 4463 do determine if the objects referenced by the 4464 current object as visited. 4465 The <datalink id="jvmtiHeapFilter">heap filter flags</datalink> 4466 and <paramlink id="klass"/> provided as parameters to this function 4467 do not control which objects are visited but they do control which 4468 objects and primitive values are reported by the callbacks. 4469 For example, if the only callback that was set is 4470 <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code> 4471 is set to the array of bytes class, then only arrays of byte will be 4472 reported. 4473 The table below summarizes this: 4474 <p/> 4475 <table> 4476 <tr> 4477 <th/> 4478 <th> 4479 Controls objects visited 4480 </th> 4481 <th> 4482 Controls objects reported 4483 </th> 4484 <th> 4485 Controls primitives reported 4486 </th> 4487 </tr> 4488 <tr> 4489 <th align="left"> 4490 the 4491 <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink> 4492 returned by <functionlink id="jvmtiHeapReferenceCallback"/> 4493 </th> 4494 <td> 4495 <b>Yes</b> 4496 </td> 4497 <td> 4498 <b>Yes</b>, since visits are controlled 4499 </td> 4500 <td> 4501 <b>Yes</b>, since visits are controlled 4502 </td> 4503 </tr> 4504 <tr> 4505 <th align="left"> 4506 <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> 4507 in <paramlink id="callbacks"/> set 4508 </th> 4509 <td> 4510 No 4511 </td> 4512 <td> 4513 <b>Yes</b> 4514 </td> 4515 <td> 4516 No 4517 </td> 4518 </tr> 4519 <tr> 4520 <th align="left"> 4521 <paramlink id="heap_filter"/> 4522 </th> 4523 <td> 4524 No 4525 </td> 4526 <td> 4527 <b>Yes</b> 4528 </td> 4529 <td> 4530 <b>Yes</b> 4531 </td> 4532 </tr> 4533 <tr> 4534 <th align="left"> 4535 <paramlink id="klass"/> 4536 </th> 4537 <td> 4538 No 4539 </td> 4540 <td> 4541 <b>Yes</b> 4542 </td> 4543 <td> 4544 <b>Yes</b> 4545 </td> 4546 </tr> 4547 </table> 4548 <p/> 4549 During the execution of this function the state of the heap 4550 does not change: no objects are allocated, no objects are 4551 garbage collected, and the state of objects (including 4552 held values) does not change. 4553 As a result, threads executing Java 4554 programming language code, threads attempting to resume the 4555 execution of Java programming language code, and threads 4556 attempting to execute JNI functions are typically stalled. 4557 </description> 4558 <origin>new</origin> 4559 <capabilities> 4560 <required id="can_tag_objects"></required> 4561 </capabilities> 4562 <parameters> 4563 <param id="heap_filter"> 4564 <jint/> 4565 <description> 4566 This bit vector of 4567 <datalink id="jvmtiHeapFilter">heap filter flags</datalink>. 4568 restricts the objects for which the callback function is called. 4569 This applies to both the object and primitive callbacks. 4570 </description> 4571 </param> 4572 <param id="klass"> 4573 <ptrtype> 4574 <jclass/> 4575 <nullok>callbacks are not limited to instances of a particular 4576 class</nullok> 4577 </ptrtype> 4578 <description> 4579 Callbacks are only reported when the object is an instance of 4580 this class. 4581 Objects which are instances of a subclass of <code>klass</code> 4582 are not reported. 4583 If <code>klass</code> is an interface, no objects are reported. 4584 This applies to both the object and primitive callbacks. 4585 </description> 4586 </param> 4587 <param id="initial_object"> 4588 <ptrtype> 4589 <jobject/> 4590 <nullok>references are followed from the heap roots</nullok> 4591 </ptrtype> 4592 <description> 4593 The object to follow 4594 </description> 4595 </param> 4596 <param id="callbacks"> 4597 <inptr> 4598 <struct>jvmtiHeapCallbacks</struct> 4599 </inptr> 4600 <description> 4601 Structure defining the set of callback functions. 4602 </description> 4603 </param> 4604 <param id="user_data"> 4605 <inbuf> 4606 <void/> 4607 <nullok><code>NULL</code> is passed as the user supplied data</nullok> 4608 </inbuf> 4609 <description> 4610 User supplied data to be passed to the callback. 4611 </description> 4612 </param> 4613 </parameters> 4614 <errors> 4615 <error id="JVMTI_ERROR_INVALID_CLASS"> 4616 <paramlink id="klass"/> is not a valid class. 4617 </error> 4618 <error id="JVMTI_ERROR_INVALID_OBJECT"> 4619 <paramlink id="initial_object"/> is not a valid object. 4620 </error> 4621 </errors> 4622 </function> 4623 4624 4625 <function id="IterateThroughHeap" num="116" since="1.1"> 4626 <synopsis>Iterate Through Heap</synopsis> 4627 <description> 4628 Initiate an iteration over all objects in the heap. 4629 This includes both reachable and 4630 unreachable objects. Objects are visited in no particular order. 4631 <p/> 4632 Heap objects are reported by invoking the agent supplied 4633 callback function <functionlink id="jvmtiHeapIterationCallback"/>. 4634 References between objects are not reported. 4635 If only reachable objects are desired, or if object reference information 4636 is needed, use <functionlink id="FollowReferences"/>. 4637 <p/> 4638 This function can also be used to examine primitive (non-object) values. 4639 The primitive value of an array or String 4640 is reported after the object has been visited; 4641 it is reported by invoking the agent supplied callback function 4642 <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or 4643 <functionlink id="jvmtiStringPrimitiveValueCallback"/>. 4644 A primitive field 4645 is reported after the object with that field is visited; 4646 it is reported by invoking the agent supplied 4647 callback function 4648 <functionlink id="jvmtiPrimitiveFieldCallback"/>. 4649 <p/> 4650 Unless the iteration is aborted by the 4651 <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink> 4652 returned by a callback, all objects in the heap are visited. 4653 Whether a callback is provided or is <code>NULL</code> only determines 4654 whether the callback will be invoked, it does not influence 4655 which objects are visited nor does it influence whether other callbacks 4656 will be invoked. 4657 The <datalink id="jvmtiHeapFilter">heap filter flags</datalink> 4658 and <paramlink id="klass"/> provided as parameters to this function 4659 do not control which objects are visited but they do control which 4660 objects and primitive values are reported by the callbacks. 4661 For example, if the only callback that was set is 4662 <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code> 4663 is set to the array of bytes class, then only arrays of byte will be 4664 reported. The table below summarizes this (contrast this with 4665 <functionlink id="FollowReferences"/>): 4666 <p/> 4667 <table> 4668 <tr> 4669 <th/> 4670 <th> 4671 Controls objects visited 4672 </th> 4673 <th> 4674 Controls objects reported 4675 </th> 4676 <th> 4677 Controls primitives reported 4678 </th> 4679 </tr> 4680 <tr> 4681 <th align="left"> 4682 the 4683 <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink> 4684 returned by <functionlink id="jvmtiHeapIterationCallback"/> 4685 </th> 4686 <td> 4687 No<br/>(unless they abort the iteration) 4688 </td> 4689 <td> 4690 No<br/>(unless they abort the iteration) 4691 </td> 4692 <td> 4693 No<br/>(unless they abort the iteration) 4694 </td> 4695 </tr> 4696 <tr> 4697 <th align="left"> 4698 <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> 4699 in <paramlink id="callbacks"/> set 4700 </th> 4701 <td> 4702 No 4703 </td> 4704 <td> 4705 <b>Yes</b> 4706 </td> 4707 <td> 4708 No 4709 </td> 4710 </tr> 4711 <tr> 4712 <th align="left"> 4713 <paramlink id="heap_filter"/> 4714 </th> 4715 <td> 4716 No 4717 </td> 4718 <td> 4719 <b>Yes</b> 4720 </td> 4721 <td> 4722 <b>Yes</b> 4723 </td> 4724 </tr> 4725 <tr> 4726 <th align="left"> 4727 <paramlink id="klass"/> 4728 </th> 4729 <td> 4730 No 4731 </td> 4732 <td> 4733 <b>Yes</b> 4734 </td> 4735 <td> 4736 <b>Yes</b> 4737 </td> 4738 </tr> 4739 </table> 4740 <p/> 4741 During the execution of this function the state of the heap 4742 does not change: no objects are allocated, no objects are 4743 garbage collected, and the state of objects (including 4744 held values) does not change. 4745 As a result, threads executing Java 4746 programming language code, threads attempting to resume the 4747 execution of Java programming language code, and threads 4748 attempting to execute JNI functions are typically stalled. 4749 </description> 4750 <origin>new</origin> 4751 <capabilities> 4752 <required id="can_tag_objects"></required> 4753 </capabilities> 4754 <parameters> 4755 <param id="heap_filter"> 4756 <jint/> 4757 <description> 4758 This bit vector of 4759 <datalink id="jvmtiHeapFilter">heap filter flags</datalink>. 4760 restricts the objects for which the callback function is called. 4761 This applies to both the object and primitive callbacks. 4762 </description> 4763 </param> 4764 <param id="klass"> 4765 <ptrtype> 4766 <jclass/> 4767 <nullok>callbacks are not limited to instances of a particular class</nullok> 4768 </ptrtype> 4769 <description> 4770 Callbacks are only reported when the object is an instance of 4771 this class. 4772 Objects which are instances of a subclass of <code>klass</code> 4773 are not reported. 4774 If <code>klass</code> is an interface, no objects are reported. 4775 This applies to both the object and primitive callbacks. 4776 </description> 4777 </param> 4778 <param id="callbacks"> 4779 <inptr> 4780 <struct>jvmtiHeapCallbacks</struct> 4781 </inptr> 4782 <description> 4783 Structure defining the set callback functions. 4784 </description> 4785 </param> 4786 <param id="user_data"> 4787 <inbuf> 4788 <void/> 4789 <nullok><code>NULL</code> is passed as the user supplied data</nullok> 4790 </inbuf> 4791 <description> 4792 User supplied data to be passed to the callback. 4793 </description> 4794 </param> 4795 </parameters> 4796 <errors> 4797 <error id="JVMTI_ERROR_INVALID_CLASS"> 4798 <paramlink id="klass"/> is not a valid class. 4799 </error> 4800 </errors> 4801 </function> 4802 4803 <function id="GetTag" phase="start" num="106"> 4804 <synopsis>Get Tag</synopsis> 4805 <description> 4806 Retrieve the tag associated with an object. 4807 The tag is a long value typically used to store a 4808 unique identifier or pointer to object information. 4809 The tag is set with 4810 <functionlink id="SetTag"></functionlink>. 4811 Objects for which no tags have been set return a 4812 tag value of zero. 4813 </description> 4814 <origin>new</origin> 4815 <capabilities> 4816 <required id="can_tag_objects"></required> 4817 </capabilities> 4818 <parameters> 4819 <param id="object"> 4820 <jobject/> 4821 <description> 4822 The object whose tag is to be retrieved. 4823 </description> 4824 </param> 4825 <param id="tag_ptr"> 4826 <outptr><jlong/></outptr> 4827 <description> 4828 On return, the referenced long is set to the value 4829 of the tag. 4830 </description> 4831 </param> 4832 </parameters> 4833 <errors> 4834 </errors> 4835 </function> 4836 4837 <function id="SetTag" phase="start" num="107"> 4838 <synopsis>Set Tag</synopsis> 4839 <description> 4840 Set the tag associated with an object. 4841 The tag is a long value typically used to store a 4842 unique identifier or pointer to object information. 4843 The tag is visible with 4844 <functionlink id="GetTag"></functionlink>. 4845 </description> 4846 <origin>new</origin> 4847 <capabilities> 4848 <required id="can_tag_objects"></required> 4849 </capabilities> 4850 <parameters> 4851 <param id="object"> 4852 <jobject/> 4853 <description> 4854 The object whose tag is to be set. 4855 </description> 4856 </param> 4857 <param id="tag"> 4858 <jlong/> 4859 <description> 4860 The new value of the tag. 4861 </description> 4862 </param> 4863 </parameters> 4864 <errors> 4865 </errors> 4866 </function> 4867 4868 <function id="GetObjectsWithTags" num="114"> 4869 <synopsis>Get Objects With Tags</synopsis> 4870 <description> 4871 Return objects in the heap with the specified tags. 4872 The format is parallel arrays of objects and tags. 4873 </description> 4874 <origin>new</origin> 4875 <capabilities> 4876 <required id="can_tag_objects"></required> 4877 </capabilities> 4878 <parameters> 4879 <param id="tag_count"> 4880 <jint min="0"/> 4881 <description> 4882 Number of tags to scan for. 4883 </description> 4884 </param> 4885 <param id="tags"> 4886 <inbuf incount="tag_count"> 4887 <jlong/> 4888 </inbuf> 4889 <description> 4890 Scan for objects with these tags. 4891 Zero is not permitted in this array. 4892 </description> 4893 </param> 4894 <param id="count_ptr"> 4895 <outptr> 4896 <jint/> 4897 </outptr> 4898 <description> 4899 Return the number of objects with any of the tags 4900 in <paramlink id="tags"/>. 4901 </description> 4902 </param> 4903 <param id="object_result_ptr"> 4904 <allocbuf outcount="count_ptr"> 4905 <jobject/> 4906 <nullok>this information is not returned</nullok> 4907 </allocbuf> 4908 <description> 4909 Returns the array of objects with any of the tags 4910 in <paramlink id="tags"/>. 4911 </description> 4912 </param> 4913 <param id="tag_result_ptr"> 4914 <allocbuf outcount="count_ptr"> 4915 <jlong/> 4916 <nullok>this information is not returned</nullok> 4917 </allocbuf> 4918 <description> 4919 For each object in <paramlink id="object_result_ptr"/>, 4920 return the tag at the corresponding index. 4921 </description> 4922 </param> 4923 </parameters> 4924 <errors> 4925 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 4926 Zero is present in <paramlink id="tags"></paramlink>. 4927 </error> 4928 </errors> 4929 </function> 4930 4931 <function id="ForceGarbageCollection" num="108"> 4932 <synopsis>Force Garbage Collection</synopsis> 4933 <description> 4934 Force the VM to perform a garbage collection. 4935 The garbage collection is as complete as possible. 4936 This function does not cause finalizers to be run. 4937 This function does not return until the garbage collection 4938 is finished. 4939 <p/> 4940 Although garbage collection is as complete 4941 as possible there is no guarantee that all 4942 <eventlink id="ObjectFree"/> 4943 events will have been 4944 sent by the time that this function 4945 returns. In particular, an object may be 4946 prevented from being freed because it 4947 is awaiting finalization. 4948 </description> 4949 <origin>new</origin> 4950 <capabilities> 4951 </capabilities> 4952 <parameters> 4953 </parameters> 4954 <errors> 4955 </errors> 4956 </function> 4957 4958 4959 </category> 4960 4961 <category id="Heap_1_0" label="Heap (1.0)"> 4962 <intro> 4963 <b> 4964 These functions and data types were introduced in the original 4965 <jvmti/> version 1.0 and have been superseded by more 4966 </b> 4967 <internallink id="Heap"><b>powerful and flexible versions</b></internallink> 4968 <b> 4969 which: 4970 </b> 4971 <ul> 4972 <li> 4973 <b> 4974 Allow access to primitive values (the value of Strings, arrays, 4975 and primitive fields) 4976 </b> 4977 </li> 4978 <li> 4979 <b> 4980 Allow the tag of the referrer to be set, thus enabling more 4981 efficient localized reference graph building 4982 </b> 4983 </li> 4984 <li> 4985 <b> 4986 Provide more extensive filtering abilities 4987 </b> 4988 </li> 4989 <li> 4990 <b> 4991 Are extensible, allowing their abilities to grow in future versions of <jvmti/> 4992 </b> 4993 </li> 4994 </ul> 4995 <p/> 4996 <b>Please use the </b> 4997 <internallink id="Heap"><b>current Heap functions</b></internallink>. 4998 <p/> 4999 <constants id="jvmtiHeapObjectFilter" label="Heap Object Filter Enumeration" kind="enum"> 5000 <constant id="JVMTI_HEAP_OBJECT_TAGGED" num="1"> 5001 Tagged objects only. 5002 </constant> 5003 <constant id="JVMTI_HEAP_OBJECT_UNTAGGED" num="2"> 5004 Untagged objects only. 5005 </constant> 5006 <constant id="JVMTI_HEAP_OBJECT_EITHER" num="3"> 5007 Either tagged or untagged objects. 5008 </constant> 5009 </constants> 5010 5011 <constants id="jvmtiHeapRootKind" label="Heap Root Kind Enumeration" kind="enum"> 5012 <constant id="JVMTI_HEAP_ROOT_JNI_GLOBAL" num="1"> 5013 JNI global reference. 5014 </constant> 5015 <constant id="JVMTI_HEAP_ROOT_SYSTEM_CLASS" num="2"> 5016 System class. 5017 </constant> 5018 <constant id="JVMTI_HEAP_ROOT_MONITOR" num="3"> 5019 Monitor. 5020 </constant> 5021 <constant id="JVMTI_HEAP_ROOT_STACK_LOCAL" num="4"> 5022 Stack local. 5023 </constant> 5024 <constant id="JVMTI_HEAP_ROOT_JNI_LOCAL" num="5"> 5025 JNI local reference. 5026 </constant> 5027 <constant id="JVMTI_HEAP_ROOT_THREAD" num="6"> 5028 Thread. 5029 </constant> 5030 <constant id="JVMTI_HEAP_ROOT_OTHER" num="7"> 5031 Other. 5032 </constant> 5033 </constants> 5034 5035 <constants id="jvmtiObjectReferenceKind" label="Object Reference Enumeration" kind="enum"> 5036 <constant id="JVMTI_REFERENCE_CLASS" num="1"> 5037 Reference from an object to its class. 5038 </constant> 5039 <constant id="JVMTI_REFERENCE_FIELD" num="2"> 5040 Reference from an object to the value of one of its instance fields. 5041 For references of this kind the <code>referrer_index</code> 5042 parameter to the <internallink id="jvmtiObjectReferenceCallback"> 5043 jvmtiObjectReferenceCallback</internallink> is the index of the 5044 the instance field. The index is based on the order of all the 5045 object's fields. This includes all fields of the directly declared 5046 static and instance fields in the class, and includes all fields (both 5047 public and private) fields declared in superclasses and superinterfaces. 5048 The index is thus calculated by summing the index of the field in the directly 5049 declared class (see <functionlink id="GetClassFields"/>), with the total 5050 number of fields (both public and private) declared in all superclasses 5051 and superinterfaces. The index starts at zero. 5052 </constant> 5053 <constant id="JVMTI_REFERENCE_ARRAY_ELEMENT" num="3"> 5054 Reference from an array to one of its elements. 5055 For references of this kind the <code>referrer_index</code> 5056 parameter to the <internallink id="jvmtiObjectReferenceCallback"> 5057 jvmtiObjectReferenceCallback</internallink> is the array index. 5058 </constant> 5059 <constant id="JVMTI_REFERENCE_CLASS_LOADER" num="4"> 5060 Reference from a class to its class loader. 5061 </constant> 5062 <constant id="JVMTI_REFERENCE_SIGNERS" num="5"> 5063 Reference from a class to its signers array. 5064 </constant> 5065 <constant id="JVMTI_REFERENCE_PROTECTION_DOMAIN" num="6"> 5066 Reference from a class to its protection domain. 5067 </constant> 5068 <constant id="JVMTI_REFERENCE_INTERFACE" num="7"> 5069 Reference from a class to one of its interfaces. 5070 </constant> 5071 <constant id="JVMTI_REFERENCE_STATIC_FIELD" num="8"> 5072 Reference from a class to the value of one of its static fields. 5073 For references of this kind the <code>referrer_index</code> 5074 parameter to the <internallink id="jvmtiObjectReferenceCallback"> 5075 jvmtiObjectReferenceCallback</internallink> is the index of the 5076 the static field. The index is based on the order of all the 5077 object's fields. This includes all fields of the directly declared 5078 static and instance fields in the class, and includes all fields (both 5079 public and private) fields declared in superclasses and superinterfaces. 5080 The index is thus calculated by summing the index of the field in the directly 5081 declared class (see <functionlink id="GetClassFields"/>), with the total 5082 number of fields (both public and private) declared in all superclasses 5083 and superinterfaces. The index starts at zero. 5084 Note: this definition differs from that in the <jvmti/> 1.0 Specification. 5085 <rationale>No known implementations used the 1.0 definition.</rationale> 5086 </constant> 5087 <constant id="JVMTI_REFERENCE_CONSTANT_POOL" num="9"> 5088 Reference from a class to a resolved entry in the constant pool. 5089 For references of this kind the <code>referrer_index</code> 5090 parameter to the <internallink id="jvmtiObjectReferenceCallback"> 5091 jvmtiObjectReferenceCallback</internallink> is the index into 5092 constant pool table of the class, starting at 1. See 5093 <vmspec chapter="4.4"/>. 5094 </constant> 5095 </constants> 5096 5097 <constants id="jvmtiIterationControl" label="Iteration Control Enumeration" kind="enum"> 5098 <constant id="JVMTI_ITERATION_CONTINUE" num="1"> 5099 Continue the iteration. 5100 If this is a reference iteration, follow the references of this object. 5101 </constant> 5102 <constant id="JVMTI_ITERATION_IGNORE" num="2"> 5103 Continue the iteration. 5104 If this is a reference iteration, ignore the references of this object. 5105 </constant> 5106 <constant id="JVMTI_ITERATION_ABORT" num="0"> 5107 Abort the iteration. 5108 </constant> 5109 </constants> 5110 </intro> 5111 5112 <callback id="jvmtiHeapObjectCallback"> 5113 <enum>jvmtiIterationControl</enum> 5114 <synopsis>Heap Object Callback</synopsis> 5115 <description> 5116 Agent supplied callback function. 5117 Describes (but does not pass in) an object in the heap. 5118 <p/> 5119 Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration, 5120 or <code>JVMTI_ITERATION_ABORT</code> to stop iteration. 5121 <p/> 5122 See the <internallink id="heapCallbacks">heap callback 5123 function restrictions</internallink>. 5124 </description> 5125 <parameters> 5126 <param id="class_tag"> 5127 <jlong/> 5128 <description> 5129 The tag of the class of object (zero if the class is not tagged). 5130 If the object represents a runtime class, 5131 the <code>class_tag</code> is the tag 5132 associated with <code>java.lang.Class</code> 5133 (zero if <code>java.lang.Class</code> is not tagged). 5134 </description> 5135 </param> 5136 <param id="size"> 5137 <jlong/> 5138 <description> 5139 Size of the object (in bytes). See <functionlink id="GetObjectSize"/>. 5140 </description> 5141 </param> 5142 <param id="tag_ptr"> 5143 <outptr><jlong/></outptr> 5144 <description> 5145 The object tag value, or zero if the object is not tagged. 5146 To set the tag value to be associated with the object 5147 the agent sets the <code>jlong</code> pointed to by the parameter. 5148 </description> 5149 </param> 5150 <param id="user_data"> 5151 <outptr><void/></outptr> 5152 <description> 5153 The user supplied data that was passed into the iteration function. 5154 </description> 5155 </param> 5156 </parameters> 5157 </callback> 5158 5159 <callback id="jvmtiHeapRootCallback"> 5160 <enum>jvmtiIterationControl</enum> 5161 <synopsis>Heap Root Object Callback</synopsis> 5162 <description> 5163 Agent supplied callback function. 5164 Describes (but does not pass in) an object that is a root for the purposes 5165 of garbage collection. 5166 <p/> 5167 Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration, 5168 <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing 5169 references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration. 5170 <p/> 5171 See the <internallink id="heapCallbacks">heap callback 5172 function restrictions</internallink>. 5173 </description> 5174 <parameters> 5175 <param id="root_kind"> 5176 <enum>jvmtiHeapRootKind</enum> 5177 <description> 5178 The kind of heap root. 5179 </description> 5180 </param> 5181 <param id="class_tag"> 5182 <jlong/> 5183 <description> 5184 The tag of the class of object (zero if the class is not tagged). 5185 If the object represents a runtime class, the <code>class_tag</code> is the tag 5186 associated with <code>java.lang.Class</code> 5187 (zero if <code>java.lang.Class</code> is not tagged). 5188 </description> 5189 </param> 5190 <param id="size"> 5191 <jlong/> 5192 <description> 5193 Size of the object (in bytes). See <functionlink id="GetObjectSize"/>. 5194 </description> 5195 </param> 5196 <param id="tag_ptr"> 5197 <outptr><jlong/></outptr> 5198 <description> 5199 The object tag value, or zero if the object is not tagged. 5200 To set the tag value to be associated with the object 5201 the agent sets the <code>jlong</code> pointed to by the parameter. 5202 </description> 5203 </param> 5204 <param id="user_data"> 5205 <outptr><void/></outptr> 5206 <description> 5207 The user supplied data that was passed into the iteration function. 5208 </description> 5209 </param> 5210 </parameters> 5211 </callback> 5212 5213 <callback id="jvmtiStackReferenceCallback"> 5214 <enum>jvmtiIterationControl</enum> 5215 <synopsis>Stack Reference Object Callback</synopsis> 5216 <description> 5217 Agent supplied callback function. 5218 Describes (but does not pass in) an object on the stack that is a root for 5219 the purposes of garbage collection. 5220 <p/> 5221 Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration, 5222 <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing 5223 references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration. 5224 <p/> 5225 See the <internallink id="heapCallbacks">heap callback 5226 function restrictions</internallink>. 5227 </description> 5228 <parameters> 5229 <param id="root_kind"> 5230 <enum>jvmtiHeapRootKind</enum> 5231 <description> 5232 The kind of root (either <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or 5233 <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>). 5234 </description> 5235 </param> 5236 <param id="class_tag"> 5237 <jlong/> 5238 <description> 5239 The tag of the class of object (zero if the class is not tagged). 5240 If the object represents a runtime class, the <code>class_tag</code> is the tag 5241 associated with <code>java.lang.Class</code> 5242 (zero if <code>java.lang.Class</code> is not tagged). 5243 </description> 5244 </param> 5245 <param id="size"> 5246 <jlong/> 5247 <description> 5248 Size of the object (in bytes). See <functionlink id="GetObjectSize"/>. 5249 </description> 5250 </param> 5251 <param id="tag_ptr"> 5252 <outptr><jlong/></outptr> 5253 <description> 5254 The object tag value, or zero if the object is not tagged. 5255 To set the tag value to be associated with the object 5256 the agent sets the <code>jlong</code> pointed to by the parameter. 5257 </description> 5258 </param> 5259 <param id="thread_tag"> 5260 <jlong/> 5261 <description> 5262 The tag of the thread corresponding to this stack, zero if not tagged. 5263 </description> 5264 </param> 5265 <param id="depth"> 5266 <jint/> 5267 <description> 5268 The depth of the frame. 5269 </description> 5270 </param> 5271 <param id="method"> 5272 <jmethodID/> 5273 <description> 5274 The method executing in this frame. 5275 </description> 5276 </param> 5277 <param id="slot"> 5278 <jint/> 5279 <description> 5280 The slot number. 5281 </description> 5282 </param> 5283 <param id="user_data"> 5284 <outptr><void/></outptr> 5285 <description> 5286 The user supplied data that was passed into the iteration function. 5287 </description> 5288 </param> 5289 </parameters> 5290 </callback> 5291 5292 <callback id="jvmtiObjectReferenceCallback"> 5293 <enum>jvmtiIterationControl</enum> 5294 <synopsis>Object Reference Callback</synopsis> 5295 <description> 5296 Agent supplied callback function. 5297 Describes a reference from an object (the referrer) to another object 5298 (the referree). 5299 <p/> 5300 Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration, 5301 <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing 5302 references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration. 5303 <p/> 5304 See the <internallink id="heapCallbacks">heap callback 5305 function restrictions</internallink>. 5306 </description> 5307 <parameters> 5308 <param id="reference_kind"> 5309 <enum>jvmtiObjectReferenceKind</enum> 5310 <description> 5311 The type of reference. 5312 </description> 5313 </param> 5314 <param id="class_tag"> 5315 <jlong/> 5316 <description> 5317 The tag of the class of referree object (zero if the class is not tagged). 5318 If the referree object represents a runtime class, 5319 the <code>class_tag</code> is the tag 5320 associated with <code>java.lang.Class</code> 5321 (zero if <code>java.lang.Class</code> is not tagged). 5322 </description> 5323 </param> 5324 <param id="size"> 5325 <jlong/> 5326 <description> 5327 Size of the referree object (in bytes). 5328 See <functionlink id="GetObjectSize"/>. 5329 </description> 5330 </param> 5331 <param id="tag_ptr"> 5332 <outptr><jlong/></outptr> 5333 <description> 5334 The referree object tag value, or zero if the object is not 5335 tagged. 5336 To set the tag value to be associated with the object 5337 the agent sets the <code>jlong</code> pointed to by the parameter. 5338 </description> 5339 </param> 5340 <param id="referrer_tag"> 5341 <jlong/> 5342 <description> 5343 The tag of the referrer object, or zero if the referrer 5344 object is not tagged. 5345 </description> 5346 </param> 5347 <param id="referrer_index"> 5348 <jint/> 5349 <description> 5350 For references of type <code>JVMTI_REFERENCE_FIELD</code> or 5351 <code>JVMTI_REFERENCE_STATIC_FIELD</code> the index 5352 of the field in the referrer object. The index is based on the 5353 order of all the object's fields - see <internallink 5354 id="JVMTI_REFERENCE_FIELD">JVMTI_REFERENCE_FIELD</internallink> 5355 or <internallink 5356 id="JVMTI_REFERENCE_STATIC_FIELD">JVMTI_REFERENCE_STATIC_FIELD 5357 </internallink> for further description. 5358 <p/> 5359 For references of type <code>JVMTI_REFERENCE_ARRAY_ELEMENT</code> 5360 the array index - see <internallink id="JVMTI_REFERENCE_ARRAY_ELEMENT"> 5361 JVMTI_REFERENCE_ARRAY_ELEMENT</internallink> for further description. 5362 <p/> 5363 For references of type <code>JVMTI_REFERENCE_CONSTANT_POOL</code> 5364 the index into the constant pool of the class - see 5365 <internallink id="JVMTI_REFERENCE_CONSTANT_POOL"> 5366 JVMTI_REFERENCE_CONSTANT_POOL</internallink> for further 5367 description. 5368 <p/> 5369 For references of other kinds the <code>referrer_index</code> is 5370 <code>-1</code>. 5371 </description> 5372 </param> 5373 <param id="user_data"> 5374 <outptr><void/></outptr> 5375 <description> 5376 The user supplied data that was passed into the iteration function. 5377 </description> 5378 </param> 5379 </parameters> 5380 </callback> 5381 5382 <function id="IterateOverObjectsReachableFromObject" num="109"> 5383 <synopsis>Iterate Over Objects Reachable From Object</synopsis> 5384 <description> 5385 This function iterates over all objects that are directly 5386 and indirectly reachable from the specified object. 5387 For each object <i>A</i> (known 5388 as the referrer) with a reference to object <i>B</i> the specified 5389 callback function is called to describe the object reference. 5390 The callback is called exactly once for each reference from a referrer; 5391 this is true even if there are reference cycles or multiple paths to 5392 the referrer. 5393 There may be more than one reference between a referrer and a referree, 5394 These may be distinguished by the 5395 <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and 5396 <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>. 5397 The callback for an object will always occur after the callback for 5398 its referrer. 5399 <p/> 5400 See <functionlink id="FollowReferences"/> for the object 5401 references which are reported. 5402 <p/> 5403 During the execution of this function the state of the heap 5404 does not change: no objects are allocated, no objects are 5405 garbage collected, and the state of objects (including 5406 held values) does not change. 5407 As a result, threads executing Java 5408 programming language code, threads attempting to resume the 5409 execution of Java programming language code, and threads 5410 attempting to execute JNI functions are typically stalled. 5411 </description> 5412 <origin>new</origin> 5413 <capabilities> 5414 <required id="can_tag_objects"></required> 5415 </capabilities> 5416 <parameters> 5417 <param id="object"> 5418 <jobject/> 5419 <description> 5420 The object 5421 </description> 5422 </param> 5423 <param id="object_reference_callback"> 5424 <ptrtype> 5425 <struct>jvmtiObjectReferenceCallback</struct> 5426 </ptrtype> 5427 <description> 5428 The callback to be called to describe each 5429 object reference. 5430 </description> 5431 </param> 5432 <param id="user_data"> 5433 <inbuf> 5434 <void/> 5435 <nullok><code>NULL</code> is passed as the user supplied data</nullok> 5436 </inbuf> 5437 <description> 5438 User supplied data to be passed to the callback. 5439 </description> 5440 </param> 5441 </parameters> 5442 <errors> 5443 </errors> 5444 </function> 5445 5446 <function id="IterateOverReachableObjects" num="110"> 5447 <synopsis>Iterate Over Reachable Objects</synopsis> 5448 <description> 5449 This function iterates over the root objects and all objects that 5450 are directly and indirectly reachable from the root objects. 5451 The root objects comprise the set of system classes, 5452 JNI globals, references from thread stacks, and other objects used as roots 5453 for the purposes of garbage collection. 5454 <p/> 5455 For each root the <paramlink id="heap_root_callback"></paramlink> 5456 or <paramlink id="stack_ref_callback"></paramlink> callback is called. 5457 An object can be a root object for more than one reason and in that case 5458 the appropriate callback is called for each reason. 5459 <p/> 5460 For each object reference the <paramlink id="object_ref_callback"></paramlink> 5461 callback function is called to describe the object reference. 5462 The callback is called exactly once for each reference from a referrer; 5463 this is true even if there are reference cycles or multiple paths to 5464 the referrer. 5465 There may be more than one reference between a referrer and a referree, 5466 These may be distinguished by the 5467 <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and 5468 <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>. 5469 The callback for an object will always occur after the callback for 5470 its referrer. 5471 <p/> 5472 See <functionlink id="FollowReferences"/> for the object 5473 references which are reported. 5474 <p/> 5475 Roots are always reported to the profiler before any object references 5476 are reported. In other words, the <paramlink id="object_ref_callback"></paramlink> 5477 callback will not be called until the appropriate callback has been called 5478 for all roots. If the <paramlink id="object_ref_callback"></paramlink> callback is 5479 specified as <code>NULL</code> then this function returns after 5480 reporting the root objects to the profiler. 5481 <p/> 5482 During the execution of this function the state of the heap 5483 does not change: no objects are allocated, no objects are 5484 garbage collected, and the state of objects (including 5485 held values) does not change. 5486 As a result, threads executing Java 5487 programming language code, threads attempting to resume the 5488 execution of Java programming language code, and threads 5489 attempting to execute JNI functions are typically stalled. 5490 </description> 5491 <origin>new</origin> 5492 <capabilities> 5493 <required id="can_tag_objects"></required> 5494 </capabilities> 5495 <parameters> 5496 <param id="heap_root_callback"> 5497 <ptrtype> 5498 <struct>jvmtiHeapRootCallback</struct> 5499 <nullok>do not report heap roots</nullok> 5500 </ptrtype> 5501 <description> 5502 The callback function to be called for each heap root of type 5503 <code>JVMTI_HEAP_ROOT_JNI_GLOBAL</code>, 5504 <code>JVMTI_HEAP_ROOT_SYSTEM_CLASS</code>, 5505 <code>JVMTI_HEAP_ROOT_MONITOR</code>, 5506 <code>JVMTI_HEAP_ROOT_THREAD</code>, or 5507 <code>JVMTI_HEAP_ROOT_OTHER</code>. 5508 </description> 5509 </param> 5510 <param id="stack_ref_callback"> 5511 <ptrtype> 5512 <struct>jvmtiStackReferenceCallback</struct> 5513 <nullok>do not report stack references</nullok> 5514 </ptrtype> 5515 <description> 5516 The callback function to be called for each heap root of 5517 <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or 5518 <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>. 5519 </description> 5520 </param> 5521 <param id="object_ref_callback"> 5522 <ptrtype> 5523 <struct>jvmtiObjectReferenceCallback</struct> 5524 <nullok>do not follow references from the root objects</nullok> 5525 </ptrtype> 5526 <description> 5527 The callback function to be called for each object reference. 5528 </description> 5529 </param> 5530 <param id="user_data"> 5531 <inbuf> 5532 <void/> 5533 <nullok><code>NULL</code> is passed as the user supplied data</nullok> 5534 </inbuf> 5535 <description> 5536 User supplied data to be passed to the callback. 5537 </description> 5538 </param> 5539 </parameters> 5540 <errors> 5541 </errors> 5542 </function> 5543 5544 <function id="IterateOverHeap" num="111"> 5545 <synopsis>Iterate Over Heap</synopsis> 5546 <description> 5547 Iterate over all objects in the heap. This includes both reachable and 5548 unreachable objects. 5549 <p/> 5550 The <paramlink id="object_filter"></paramlink> parameter indicates the 5551 objects for which the callback function is called. If this parameter 5552 is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be 5553 called for every object that is tagged. If the parameter is 5554 <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be 5555 for objects that are not tagged. If the parameter 5556 is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be 5557 called for every object in the heap, irrespective of whether it is 5558 tagged or not. 5559 <p/> 5560 During the execution of this function the state of the heap 5561 does not change: no objects are allocated, no objects are 5562 garbage collected, and the state of objects (including 5563 held values) does not change. 5564 As a result, threads executing Java 5565 programming language code, threads attempting to resume the 5566 execution of Java programming language code, and threads 5567 attempting to execute JNI functions are typically stalled. 5568 </description> 5569 <origin>new</origin> 5570 <capabilities> 5571 <required id="can_tag_objects"></required> 5572 </capabilities> 5573 <parameters> 5574 <param id="object_filter"> 5575 <enum>jvmtiHeapObjectFilter</enum> 5576 <description> 5577 Indicates the objects for which the callback function is called. 5578 </description> 5579 </param> 5580 <param id="heap_object_callback"> 5581 <ptrtype> 5582 <struct>jvmtiHeapObjectCallback</struct> 5583 </ptrtype> 5584 <description> 5585 The iterator function to be called for each 5586 object matching the <paramlink id="object_filter"/>. 5587 </description> 5588 </param> 5589 <param id="user_data"> 5590 <inbuf> 5591 <void/> 5592 <nullok><code>NULL</code> is passed as the user supplied data</nullok> 5593 </inbuf> 5594 <description> 5595 User supplied data to be passed to the callback. 5596 </description> 5597 </param> 5598 </parameters> 5599 <errors> 5600 </errors> 5601 </function> 5602 5603 <function id="IterateOverInstancesOfClass" num="112"> 5604 <synopsis>Iterate Over Instances Of Class</synopsis> 5605 <description> 5606 Iterate over all objects in the heap that are instances of the specified class. 5607 This includes direct instances of the specified class and 5608 instances of all subclasses of the specified class. 5609 This includes both reachable and unreachable objects. 5610 <p/> 5611 The <paramlink id="object_filter"></paramlink> parameter indicates the 5612 objects for which the callback function is called. If this parameter 5613 is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be 5614 called for every object that is tagged. If the parameter is 5615 <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be 5616 called for objects that are not tagged. If the parameter 5617 is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be 5618 called for every object in the heap, irrespective of whether it is 5619 tagged or not. 5620 <p/> 5621 During the execution of this function the state of the heap 5622 does not change: no objects are allocated, no objects are 5623 garbage collected, and the state of objects (including 5624 held values) does not change. 5625 As a result, threads executing Java 5626 programming language code, threads attempting to resume the 5627 execution of Java programming language code, and threads 5628 attempting to execute JNI functions are typically stalled. 5629 </description> 5630 <origin>new</origin> 5631 <capabilities> 5632 <required id="can_tag_objects"></required> 5633 </capabilities> 5634 <parameters> 5635 <param id="klass"> 5636 <jclass/> 5637 <description> 5638 Iterate over objects of this class only. 5639 </description> 5640 </param> 5641 <param id="object_filter"> 5642 <enum>jvmtiHeapObjectFilter</enum> 5643 <description> 5644 Indicates the objects for which the callback function is called. 5645 </description> 5646 </param> 5647 <param id="heap_object_callback"> 5648 <ptrtype> 5649 <struct>jvmtiHeapObjectCallback</struct> 5650 </ptrtype> 5651 <description> 5652 The iterator function to be called for each 5653 <paramlink id="klass"/> instance matching 5654 the <paramlink id="object_filter"/>. 5655 </description> 5656 </param> 5657 <param id="user_data"> 5658 <inbuf> 5659 <void/> 5660 <nullok><code>NULL</code> is passed as the user supplied data</nullok> 5661 </inbuf> 5662 <description> 5663 User supplied data to be passed to the callback. 5664 </description> 5665 </param> 5666 </parameters> 5667 <errors> 5668 </errors> 5669 </function> 5670 5671 </category> 5672 5673 <category id="local" label="Local Variable"> 5674 5675 <intro> 5676 These functions are used to retrieve or set the value of a local variable. 5677 The variable is identified by the depth of the frame containing its 5678 value and the variable's slot number within that frame. 5679 The mapping of variables to 5680 slot numbers can be obtained with the function 5681 <functionlink id="GetLocalVariableTable"></functionlink>. 5682 </intro> 5683 5684 <function id="GetLocalObject" num="21"> 5685 <synopsis>Get Local Variable - Object</synopsis> 5686 <description> 5687 This function can be used to retrieve the value of a local 5688 variable whose type is <code>Object</code> or a subclass of <code>Object</code>. 5689 </description> 5690 <origin>jvmdi</origin> 5691 <capabilities> 5692 <required id="can_access_local_variables"></required> 5693 </capabilities> 5694 <parameters> 5695 <param id="thread"> 5696 <jthread null="current" frame="frame"/> 5697 <description> 5698 The thread of the frame containing the variable's value. 5699 </description> 5700 </param> 5701 <param id="depth"> 5702 <jframeID thread="thread"/> 5703 <description> 5704 The depth of the frame containing the variable's value. 5705 </description> 5706 </param> 5707 <param id="slot"> 5708 <jint/> 5709 <description> 5710 The variable's slot number. 5711 </description> 5712 </param> 5713 <param id="value_ptr"> 5714 <outptr><jobject/></outptr> 5715 <description> 5716 On return, points to the variable's value. 5717 </description> 5718 </param> 5719 </parameters> 5720 <errors> 5721 <error id="JVMTI_ERROR_INVALID_SLOT"> 5722 Invalid <code>slot</code>. 5723 </error> 5724 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 5725 The variable type is not 5726 <code>Object</code> or a subclass of <code>Object</code>. 5727 </error> 5728 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 5729 Not a visible frame 5730 </error> 5731 </errors> 5732 </function> 5733 5734 <function id="GetLocalInstance" num="155" since="1.2"> 5735 <synopsis>Get Local Instance</synopsis> 5736 <description> 5737 This function can be used to retrieve the value of the local object 5738 variable at slot 0 (the "<code>this</code>" object) from non-static 5739 frames. This function can retrieve the "<code>this</code>" object from 5740 native method frames, whereas <code>GetLocalObject()</code> would 5741 return <code>JVMTI_ERROR_OPAQUE_FRAME</code> in those cases. 5742 </description> 5743 <origin>new</origin> 5744 <capabilities> 5745 <required id="can_access_local_variables"></required> 5746 </capabilities> 5747 <parameters> 5748 <param id="thread"> 5749 <jthread null="current" frame="frame"/> 5750 <description> 5751 The thread of the frame containing the variable's value. 5752 </description> 5753 </param> 5754 <param id="depth"> 5755 <jframeID thread="thread"/> 5756 <description> 5757 The depth of the frame containing the variable's value. 5758 </description> 5759 </param> 5760 <param id="value_ptr"> 5761 <outptr><jobject/></outptr> 5762 <description> 5763 On return, points to the variable's value. 5764 </description> 5765 </param> 5766 </parameters> 5767 <errors> 5768 <error id="JVMTI_ERROR_INVALID_SLOT"> 5769 If the specified frame is a static method frame. 5770 </error> 5771 </errors> 5772 </function> 5773 <function id="GetLocalInt" num="22"> 5774 <synopsis>Get Local Variable - Int</synopsis> 5775 <description> 5776 This function can be used to retrieve the value of a local 5777 variable whose type is <code>int</code>, 5778 <code>short</code>, <code>char</code>, <code>byte</code>, or 5779 <code>boolean</code>. 5780 </description> 5781 <origin>jvmdi</origin> 5782 <capabilities> 5783 <required id="can_access_local_variables"></required> 5784 </capabilities> 5785 <parameters> 5786 <param id="thread"> 5787 <jthread null="current" frame="frame"/> 5788 <description> 5789 The thread of the frame containing the variable's value. 5790 </description> 5791 </param> 5792 <param id="depth"> 5793 <jframeID thread="thread"/> 5794 <description> 5795 The depth of the frame containing the variable's value. 5796 </description> 5797 </param> 5798 <param id="slot"> 5799 <jint/> 5800 <description> 5801 The variable's slot number. 5802 </description> 5803 </param> 5804 <param id="value_ptr"> 5805 <outptr><jint/></outptr> 5806 <description> 5807 On return, points to the variable's value. 5808 </description> 5809 </param> 5810 </parameters> 5811 <errors> 5812 <error id="JVMTI_ERROR_INVALID_SLOT"> 5813 Invalid <code>slot</code>. 5814 </error> 5815 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 5816 The variable type is not 5817 <code>int</code>, <code>short</code>, 5818 <code>char</code>, <code>byte</code>, or 5819 <code>boolean</code>. 5820 </error> 5821 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 5822 Not a visible frame 5823 </error> 5824 </errors> 5825 </function> 5826 5827 <function id="GetLocalLong" num="23"> 5828 <synopsis>Get Local Variable - Long</synopsis> 5829 <description> 5830 This function can be used to retrieve the value of a local 5831 variable whose type is <code>long</code>. 5832 </description> 5833 <origin>jvmdi</origin> 5834 <capabilities> 5835 <required id="can_access_local_variables"></required> 5836 </capabilities> 5837 <parameters> 5838 <param id="thread"> 5839 <jthread null="current" frame="frame"/> 5840 <description> 5841 The thread of the frame containing the variable's value. 5842 </description> 5843 </param> 5844 <param id="depth"> 5845 <jframeID thread="thread"/> 5846 <description> 5847 The depth of the frame containing the variable's value. 5848 </description> 5849 </param> 5850 <param id="slot"> 5851 <jint/> 5852 <description> 5853 The variable's slot number. 5854 </description> 5855 </param> 5856 <param id="value_ptr"> 5857 <outptr><jlong/></outptr> 5858 <description> 5859 On return, points to the variable's value. 5860 </description> 5861 </param> 5862 </parameters> 5863 <errors> 5864 <error id="JVMTI_ERROR_INVALID_SLOT"> 5865 Invalid <code>slot</code>. 5866 </error> 5867 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 5868 The variable type is not <code>long</code>. 5869 </error> 5870 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 5871 Not a visible frame 5872 </error> 5873 </errors> 5874 </function> 5875 5876 <function id="GetLocalFloat" num="24"> 5877 <synopsis>Get Local Variable - Float</synopsis> 5878 <description> 5879 This function can be used to retrieve the value of a local 5880 variable whose type is <code>float</code>. 5881 </description> 5882 <origin>jvmdi</origin> 5883 <capabilities> 5884 <required id="can_access_local_variables"></required> 5885 </capabilities> 5886 <parameters> 5887 <param id="thread"> 5888 <jthread null="current" frame="frame"/> 5889 <description> 5890 The thread of the frame containing the variable's value. 5891 </description> 5892 </param> 5893 <param id="depth"> 5894 <jframeID thread="thread"/> 5895 <description> 5896 The depth of the frame containing the variable's value. 5897 </description> 5898 </param> 5899 <param id="slot"> 5900 <jint/> 5901 <description> 5902 The variable's slot number. 5903 </description> 5904 </param> 5905 <param id="value_ptr"> 5906 <outptr><jfloat/></outptr> 5907 <description> 5908 On return, points to the variable's value. 5909 </description> 5910 </param> 5911 </parameters> 5912 <errors> 5913 <error id="JVMTI_ERROR_INVALID_SLOT"> 5914 Invalid <code>slot</code>. 5915 </error> 5916 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 5917 The variable type is not <code>float</code>. 5918 </error> 5919 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 5920 Not a visible frame 5921 </error> 5922 </errors> 5923 </function> 5924 5925 <function id="GetLocalDouble" num="25"> 5926 <synopsis>Get Local Variable - Double</synopsis> 5927 <description> 5928 This function can be used to retrieve the value of a local 5929 variable whose type is <code>long</code>. 5930 </description> 5931 <origin>jvmdi</origin> 5932 <capabilities> 5933 <required id="can_access_local_variables"></required> 5934 </capabilities> 5935 <parameters> 5936 <param id="thread"> 5937 <jthread null="current" frame="frame"/> 5938 <description> 5939 The thread of the frame containing the variable's value. 5940 </description> 5941 </param> 5942 <param id="depth"> 5943 <jframeID thread="thread"/> 5944 <description> 5945 The depth of the frame containing the variable's value. 5946 </description> 5947 </param> 5948 <param id="slot"> 5949 <jint/> 5950 <description> 5951 The variable's slot number. 5952 </description> 5953 </param> 5954 <param id="value_ptr"> 5955 <outptr><jdouble/></outptr> 5956 <description> 5957 On return, points to the variable's value. 5958 </description> 5959 </param> 5960 </parameters> 5961 <errors> 5962 <error id="JVMTI_ERROR_INVALID_SLOT"> 5963 Invalid <code>slot</code>. 5964 </error> 5965 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 5966 The variable type is not <code>double</code>. 5967 </error> 5968 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 5969 Not a visible frame 5970 </error> 5971 </errors> 5972 </function> 5973 5974 <function id="SetLocalObject" num="26"> 5975 <synopsis>Set Local Variable - Object</synopsis> 5976 <description> 5977 This function can be used to set the value of a local 5978 variable whose type is <code>Object</code> or a subclass of <code>Object</code>. 5979 </description> 5980 <origin>jvmdi</origin> 5981 <capabilities> 5982 <required id="can_access_local_variables"></required> 5983 </capabilities> 5984 <parameters> 5985 <param id="thread"> 5986 <jthread null="current" frame="frame"/> 5987 <description> 5988 The thread of the frame containing the variable's value. 5989 </description> 5990 </param> 5991 <param id="depth"> 5992 <jframeID thread="thread"/> 5993 <description> 5994 The depth of the frame containing the variable's value. 5995 </description> 5996 </param> 5997 <param id="slot"> 5998 <jint/> 5999 <description> 6000 The variable's slot number. 6001 </description> 6002 </param> 6003 <param id="value"> 6004 <jobject/> 6005 <description> 6006 The new value for the variable. 6007 </description> 6008 </param> 6009 </parameters> 6010 <errors> 6011 <error id="JVMTI_ERROR_INVALID_SLOT"> 6012 Invalid <code>slot</code>. 6013 </error> 6014 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 6015 The variable type is not 6016 <code>Object</code> or a subclass of <code>Object</code>. 6017 </error> 6018 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 6019 The supplied <paramlink id="value"/> is not compatible 6020 with the variable type. 6021 </error> 6022 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 6023 Not a visible frame 6024 </error> 6025 </errors> 6026 </function> 6027 6028 <function id="SetLocalInt" num="27"> 6029 <synopsis>Set Local Variable - Int</synopsis> 6030 <description> 6031 This function can be used to set the value of a local 6032 variable whose type is <code>int</code>, 6033 <code>short</code>, <code>char</code>, <code>byte</code>, or 6034 <code>boolean</code>. 6035 </description> 6036 <origin>jvmdi</origin> 6037 <capabilities> 6038 <required id="can_access_local_variables"></required> 6039 </capabilities> 6040 <parameters> 6041 <param id="thread"> 6042 <jthread null="current" frame="frame"/> 6043 <description> 6044 The thread of the frame containing the variable's value. 6045 </description> 6046 </param> 6047 <param id="depth"> 6048 <jframeID thread="thread"/> 6049 <description> 6050 The depth of the frame containing the variable's value. 6051 </description> 6052 </param> 6053 <param id="slot"> 6054 <jint/> 6055 <description> 6056 The variable's slot number. 6057 </description> 6058 </param> 6059 <param id="value"> 6060 <jint/> 6061 <description> 6062 The new value for the variable. 6063 </description> 6064 </param> 6065 </parameters> 6066 <errors> 6067 <error id="JVMTI_ERROR_INVALID_SLOT"> 6068 Invalid <code>slot</code>. 6069 </error> 6070 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 6071 The variable type is not 6072 <code>int</code>, <code>short</code>, 6073 <code>char</code>, <code>byte</code>, or 6074 <code>boolean</code>. 6075 </error> 6076 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 6077 Not a visible frame 6078 </error> 6079 </errors> 6080 </function> 6081 6082 <function id="SetLocalLong" num="28"> 6083 <synopsis>Set Local Variable - Long</synopsis> 6084 <description> 6085 This function can be used to set the value of a local 6086 variable whose type is <code>long</code>. 6087 </description> 6088 <origin>jvmdi</origin> 6089 <capabilities> 6090 <required id="can_access_local_variables"></required> 6091 </capabilities> 6092 <parameters> 6093 <param id="thread"> 6094 <jthread null="current" frame="frame"/> 6095 <description> 6096 The thread of the frame containing the variable's value. 6097 </description> 6098 </param> 6099 <param id="depth"> 6100 <jframeID thread="thread"/> 6101 <description> 6102 The depth of the frame containing the variable's value. 6103 </description> 6104 </param> 6105 <param id="slot"> 6106 <jint/> 6107 <description> 6108 The variable's slot number. 6109 </description> 6110 </param> 6111 <param id="value"> 6112 <jlong/> 6113 <description> 6114 The new value for the variable. 6115 </description> 6116 </param> 6117 </parameters> 6118 <errors> 6119 <error id="JVMTI_ERROR_INVALID_SLOT"> 6120 Invalid <code>slot</code>. 6121 </error> 6122 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 6123 The variable type is not <code>long</code>. 6124 </error> 6125 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 6126 Not a visible frame 6127 </error> 6128 </errors> 6129 </function> 6130 6131 <function id="SetLocalFloat" num="29"> 6132 <synopsis>Set Local Variable - Float</synopsis> 6133 <description> 6134 This function can be used to set the value of a local 6135 variable whose type is <code>float</code>. 6136 </description> 6137 <origin>jvmdi</origin> 6138 <capabilities> 6139 <required id="can_access_local_variables"></required> 6140 </capabilities> 6141 <parameters> 6142 <param id="thread"> 6143 <jthread null="current" frame="frame"/> 6144 <description> 6145 The thread of the frame containing the variable's value. 6146 </description> 6147 </param> 6148 <param id="depth"> 6149 <jframeID thread="thread"/> 6150 <description> 6151 The depth of the frame containing the variable's value. 6152 </description> 6153 </param> 6154 <param id="slot"> 6155 <jint/> 6156 <description> 6157 The variable's slot number. 6158 </description> 6159 </param> 6160 <param id="value"> 6161 <jfloat/> 6162 <description> 6163 The new value for the variable. 6164 </description> 6165 </param> 6166 </parameters> 6167 <errors> 6168 <error id="JVMTI_ERROR_INVALID_SLOT"> 6169 Invalid <code>slot</code>. 6170 </error> 6171 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 6172 The variable type is not <code>float</code>. 6173 </error> 6174 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 6175 Not a visible frame 6176 </error> 6177 </errors> 6178 </function> 6179 6180 <function id="SetLocalDouble" num="30"> 6181 <synopsis>Set Local Variable - Double</synopsis> 6182 <description> 6183 This function can be used to set the value of a local 6184 variable whose type is <code>double</code>. 6185 </description> 6186 <origin>jvmdi</origin> 6187 <capabilities> 6188 <required id="can_access_local_variables"></required> 6189 </capabilities> 6190 <parameters> 6191 <param id="thread"> 6192 <jthread null="current" frame="frame"/> 6193 <description> 6194 The thread of the frame containing the variable's value. 6195 </description> 6196 </param> 6197 <param id="depth"> 6198 <jframeID thread="thread"/> 6199 <description> 6200 The depth of the frame containing the variable's value. 6201 </description> 6202 </param> 6203 <param id="slot"> 6204 <jint/> 6205 <description> 6206 The variable's slot number. 6207 </description> 6208 </param> 6209 <param id="value"> 6210 <jdouble/> 6211 <description> 6212 The new value for the variable. 6213 </description> 6214 </param> 6215 </parameters> 6216 <errors> 6217 <error id="JVMTI_ERROR_INVALID_SLOT"> 6218 Invalid <code>slot</code>. 6219 </error> 6220 <error id="JVMTI_ERROR_TYPE_MISMATCH"> 6221 The variable type is not <code>double</code>. 6222 </error> 6223 <error id="JVMTI_ERROR_OPAQUE_FRAME"> 6224 Not a visible frame 6225 </error> 6226 </errors> 6227 </function> 6228 </category> 6229 6230 <category id="breakpointCategory" label="Breakpoint"> 6231 6232 <intro> 6233 </intro> 6234 6235 <function id="SetBreakpoint" num="38"> 6236 <synopsis>Set Breakpoint</synopsis> 6237 <description> 6238 Set a breakpoint at the instruction indicated by 6239 <code>method</code> and <code>location</code>. 6240 An instruction can only have one breakpoint. 6241 <p/> 6242 Whenever the designated instruction is about to be executed, a 6243 <eventlink id="Breakpoint"></eventlink> event is generated. 6244 </description> 6245 <origin>jvmdi</origin> 6246 <capabilities> 6247 <required id="can_generate_breakpoint_events"></required> 6248 </capabilities> 6249 <parameters> 6250 <param id="klass"> 6251 <jclass method="method"/> 6252 <description> 6253 The class in which to set the breakpoint 6254 </description> 6255 </param> 6256 <param id="method"> 6257 <jmethodID class="klass"/> 6258 <description> 6259 The method in which to set the breakpoint 6260 </description> 6261 </param> 6262 <param id="location"> 6263 <jlocation/> 6264 <description> 6265 the index of the instruction at which to set the breakpoint 6266 6267 </description> 6268 </param> 6269 </parameters> 6270 <errors> 6271 <error id="JVMTI_ERROR_DUPLICATE"> 6272 The designated bytecode already has a breakpoint. 6273 </error> 6274 </errors> 6275 </function> 6276 6277 <function id="ClearBreakpoint" num="39"> 6278 <synopsis>Clear Breakpoint</synopsis> 6279 <description> 6280 Clear the breakpoint at the bytecode indicated by 6281 <code>method</code> and <code>location</code>. 6282 </description> 6283 <origin>jvmdi</origin> 6284 <capabilities> 6285 <required id="can_generate_breakpoint_events"></required> 6286 </capabilities> 6287 <parameters> 6288 <param id="klass"> 6289 <jclass method="method"/> 6290 <description> 6291 The class in which to clear the breakpoint 6292 </description> 6293 </param> 6294 <param id="method"> 6295 <jmethodID class="klass"/> 6296 <description> 6297 The method in which to clear the breakpoint 6298 </description> 6299 </param> 6300 <param id="location"> 6301 <jlocation/> 6302 <description> 6303 the index of the instruction at which to clear the breakpoint 6304 </description> 6305 </param> 6306 </parameters> 6307 <errors> 6308 <error id="JVMTI_ERROR_NOT_FOUND"> 6309 There's no breakpoint at the designated bytecode. 6310 </error> 6311 </errors> 6312 </function> 6313 6314 </category> 6315 6316 <category id="fieldWatch" label="Watched Field"> 6317 6318 <intro> 6319 </intro> 6320 6321 <function id="SetFieldAccessWatch" num="41"> 6322 <synopsis>Set Field Access Watch</synopsis> 6323 <description> 6324 Generate a <eventlink id="FieldAccess"></eventlink> event 6325 when the field specified 6326 by <code>klass</code> and 6327 <code>field</code> is about to be accessed. 6328 An event will be generated for each access of the field 6329 until it is canceled with 6330 <functionlink id="ClearFieldAccessWatch"></functionlink>. 6331 Field accesses from Java programming language code or from JNI code are watched, 6332 fields modified by other means are not watched. 6333 Note that <jvmti/> users should be aware that their own field accesses 6334 will trigger the watch. 6335 A field can only have one field access watch set. 6336 Modification of a field is not considered an access--use 6337 <functionlink id="SetFieldModificationWatch"></functionlink> 6338 to monitor modifications. 6339 </description> 6340 <origin>jvmdi</origin> 6341 <capabilities> 6342 <required id="can_generate_field_access_events"></required> 6343 </capabilities> 6344 <parameters> 6345 <param id="klass"> 6346 <jclass field="field"/> 6347 <description> 6348 The class containing the field to watch 6349 </description> 6350 </param> 6351 <param id="field"> 6352 <jfieldID class="klass"/> 6353 <description> 6354 The field to watch 6355 6356 </description> 6357 </param> 6358 </parameters> 6359 <errors> 6360 <error id="JVMTI_ERROR_DUPLICATE"> 6361 The designated field is already being watched for accesses. 6362 </error> 6363 </errors> 6364 </function> 6365 6366 <function id="ClearFieldAccessWatch" num="42"> 6367 <synopsis>Clear Field Access Watch</synopsis> 6368 <description> 6369 Cancel a field access watch previously set by 6370 <functionlink id="SetFieldAccessWatch"></functionlink>, on the 6371 field specified 6372 by <code>klass</code> and 6373 <code>field</code>. 6374 </description> 6375 <origin>jvmdi</origin> 6376 <capabilities> 6377 <required id="can_generate_field_access_events"></required> 6378 </capabilities> 6379 <parameters> 6380 <param id="klass"> 6381 <jclass field="field"/> 6382 <description> 6383 The class containing the field to watch 6384 </description> 6385 </param> 6386 <param id="field"> 6387 <jfieldID class="klass"/> 6388 <description> 6389 The field to watch 6390 6391 </description> 6392 </param> 6393 </parameters> 6394 <errors> 6395 <error id="JVMTI_ERROR_NOT_FOUND"> 6396 The designated field is not being watched for accesses. 6397 </error> 6398 </errors> 6399 </function> 6400 6401 <function id="SetFieldModificationWatch" num="43"> 6402 <synopsis>Set Field Modification Watch</synopsis> 6403 <description> 6404 Generate a <eventlink id="FieldModification"></eventlink> event 6405 when the field specified 6406 by <code>klass</code> and 6407 <code>field</code> is about to be modified. 6408 An event will be generated for each modification of the field 6409 until it is canceled with 6410 <functionlink id="ClearFieldModificationWatch"></functionlink>. 6411 Field modifications from Java programming language code or from JNI code are watched, 6412 fields modified by other means are not watched. 6413 Note that <jvmti/> users should be aware that their own field modifications 6414 will trigger the watch. 6415 A field can only have one field modification watch set. 6416 </description> 6417 <origin>jvmdi</origin> 6418 <capabilities> 6419 <required id="can_generate_field_modification_events"></required> 6420 </capabilities> 6421 <parameters> 6422 <param id="klass"> 6423 <jclass field="field"/> 6424 <description> 6425 The class containing the field to watch 6426 </description> 6427 </param> 6428 <param id="field"> 6429 <jfieldID class="klass"/> 6430 <description> 6431 The field to watch 6432 6433 </description> 6434 </param> 6435 </parameters> 6436 <errors> 6437 <error id="JVMTI_ERROR_DUPLICATE"> 6438 The designated field is already being watched for modifications. 6439 </error> 6440 </errors> 6441 </function> 6442 6443 <function id="ClearFieldModificationWatch" num="44"> 6444 <synopsis>Clear Field Modification Watch</synopsis> 6445 <description> 6446 6447 Cancel a field modification watch previously set by 6448 <functionlink id="SetFieldModificationWatch"></functionlink>, on the 6449 field specified 6450 by <code>klass</code> and 6451 <code>field</code>. 6452 </description> 6453 <origin>jvmdi</origin> 6454 <capabilities> 6455 <required id="can_generate_field_modification_events"></required> 6456 </capabilities> 6457 <parameters> 6458 <param id="klass"> 6459 <jclass field="field"/> 6460 <description> 6461 The class containing the field to watch 6462 </description> 6463 </param> 6464 <param id="field"> 6465 <jfieldID class="klass"/> 6466 <description> 6467 The field to watch 6468 6469 </description> 6470 </param> 6471 </parameters> 6472 <errors> 6473 <error id="JVMTI_ERROR_NOT_FOUND"> 6474 The designated field is not being watched for modifications. 6475 </error> 6476 </errors> 6477 </function> 6478 </category> 6479 6480 <category id="module" label="Module"> 6481 6482 <intro> 6483 </intro> 6484 6485 <function id="GetAllModules" num="3" since="9"> 6486 <synopsis>Get All Modules</synopsis> 6487 <description> 6488 Return an array of all modules loaded in the virtual machine. 6489 The array includes the unnamed module for each class loader. 6490 The number of modules in the array is returned via 6491 <code>module_count_ptr</code>, and the array itself via 6492 <code>modules_ptr</code>. 6493 <p/> 6494 </description> 6495 <origin>new</origin> 6496 <capabilities> 6497 </capabilities> 6498 <parameters> 6499 <param id="module_count_ptr"> 6500 <outptr><jint/></outptr> 6501 <description> 6502 On return, points to the number of returned modules. 6503 </description> 6504 </param> 6505 <param id="modules_ptr"> 6506 <allocbuf outcount="module_count_ptr"><jobject/></allocbuf> 6507 <description> 6508 On return, points to an array of references, one 6509 for each module. 6510 </description> 6511 </param> 6512 </parameters> 6513 <errors> 6514 </errors> 6515 </function> 6516 6517 <function id="GetNamedModule" num="40" since="9"> 6518 <synopsis>Get Named Module</synopsis> 6519 <description> 6520 Return the <code>java.lang.Module</code> object for a named 6521 module defined to a class loader that contains a given package. 6522 The module is returned via <code>module_ptr</code>. 6523 <p/> 6524 If a named module is defined to the class loader and it 6525 contains the package then that named module is returned, 6526 otherwise <code>NULL</code> is returned. 6527 <p/> 6528 </description> 6529 <origin>new</origin> 6530 <capabilities> 6531 </capabilities> 6532 <parameters> 6533 <param id="class_loader"> 6534 <ptrtype> 6535 <jobject/> 6536 <nullok>the bootstrap loader is assumed</nullok> 6537 </ptrtype> 6538 <description> 6539 A class loader. 6540 If the <code>class_loader</code> is not <code>NULL</code> 6541 or a subclass of <code>java.lang.ClassLoader</code> 6542 this function returns 6543 <errorlink id="JVMTI_ERROR_ILLEGAL_ARGUMENT"></errorlink>. 6544 </description> 6545 </param> 6546 <param id="package_name"> 6547 <inbuf><char/></inbuf> 6548 <description> 6549 The name of the package, encoded as a 6550 <internallink id="mUTF">modified UTF-8</internallink> string. 6551 The package name is in internal form (JVMS 4.2.1); 6552 identifiers are separated by forward slashes rather than periods. 6553 </description> 6554 </param> 6555 <param id="module_ptr"> 6556 <outptr><jobject/></outptr> 6557 <description> 6558 On return, points to a <code>java.lang.Module</code> object 6559 or points to <code>NULL</code>. 6560 </description> 6561 </param> 6562 </parameters> 6563 <errors> 6564 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 6565 If class loader is not <code>NULL</code> and is not a class loader object. 6566 </error> 6567 </errors> 6568 </function> 6569 6570 <function id="AddModuleReads" num="94" since="9"> 6571 <synopsis>Add Module Reads</synopsis> 6572 <description> 6573 Update a module to read another module. This function is a no-op 6574 when <paramlink id="module"></paramlink> is an unnamed module. 6575 This function facilitates the instrumentation of code 6576 in named modules where that instrumentation requires 6577 expanding the set of modules that a module reads. 6578 </description> 6579 <origin>new</origin> 6580 <capabilities> 6581 </capabilities> 6582 <parameters> 6583 <param id="module"> 6584 <ptrtype><jobject/></ptrtype> 6585 <description> 6586 The module to update. 6587 </description> 6588 </param> 6589 <param id="to_module"> 6590 <ptrtype><jobject/></ptrtype> 6591 <description> 6592 The additional module to read. 6593 </description> 6594 </param> 6595 </parameters> 6596 <errors> 6597 <error id="JVMTI_ERROR_INVALID_MODULE"> 6598 If <paramlink id="module"></paramlink> is not a module object. 6599 </error> 6600 <error id="JVMTI_ERROR_INVALID_MODULE"> 6601 If <paramlink id="to_module"></paramlink> is not a module object. 6602 </error> 6603 <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE"> 6604 if the module cannot be modified. 6605 See <functionlink id="IsModifiableModule"/>. 6606 </error> 6607 </errors> 6608 </function> 6609 6610 <function id="AddModuleExports" num="95" since="9"> 6611 <synopsis>Add Module Exports</synopsis> 6612 <description> 6613 Update a module to export a package to another module. 6614 This function is a no-op when <paramlink id="module"></paramlink> 6615 is an unnamed module or an open module. 6616 This function facilitates the instrumentation of code 6617 in named modules where that instrumentation requires 6618 expanding the set of packages that a module exports. 6619 </description> 6620 <origin>new</origin> 6621 <capabilities> 6622 </capabilities> 6623 <parameters> 6624 <param id="module"> 6625 <ptrtype><jobject/></ptrtype> 6626 <description> 6627 The module to update. 6628 </description> 6629 </param> 6630 <param id="pkg_name"> 6631 <inbuf><char/></inbuf> 6632 <description> 6633 The exported package name. 6634 </description> 6635 </param> 6636 <param id="to_module"> 6637 <ptrtype><jobject/></ptrtype> 6638 <description> 6639 The module the package is exported to. 6640 If the <code>to_module</code> is not a subclass of 6641 <code>java.lang.Module</code> this function returns 6642 <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>. 6643 </description> 6644 </param> 6645 </parameters> 6646 <errors> 6647 <error id="JVMTI_ERROR_INVALID_MODULE"> 6648 If <paramlink id="module"></paramlink> is not a module object. 6649 </error> 6650 <error id="JVMTI_ERROR_INVALID_MODULE"> 6651 If <paramlink id="to_module"></paramlink> is not a module object. 6652 </error> 6653 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 6654 If the package <paramlink id="pkg_name"></paramlink> 6655 does not belong to the module. 6656 </error> 6657 <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE"> 6658 if the module cannot be modified. 6659 See <functionlink id="IsModifiableModule"/>. 6660 </error> 6661 </errors> 6662 </function> 6663 6664 <function id="AddModuleOpens" num="96" since="9"> 6665 <synopsis>Add Module Opens</synopsis> 6666 <description> 6667 Update a module to open a package to another module. 6668 This function is a no-op when <paramlink id="module"></paramlink> 6669 is an unnamed module or an open module. 6670 This function facilitates the instrumentation of code 6671 in modules where that instrumentation requires 6672 expanding the set of packages that a module opens to 6673 other modules. 6674 </description> 6675 <origin>new</origin> 6676 <capabilities> 6677 </capabilities> 6678 <parameters> 6679 <param id="module"> 6680 <ptrtype><jobject/></ptrtype> 6681 <description> 6682 The module to update. 6683 </description> 6684 </param> 6685 <param id="pkg_name"> 6686 <inbuf><char/></inbuf> 6687 <description> 6688 The package name of the package to open. 6689 </description> 6690 </param> 6691 <param id="to_module"> 6692 <ptrtype><jobject/></ptrtype> 6693 <description> 6694 The module with the package to open. 6695 If the <code>to_module</code> is not a subclass of 6696 <code>java.lang.Module</code> this function returns 6697 <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>. 6698 </description> 6699 </param> 6700 </parameters> 6701 <errors> 6702 <error id="JVMTI_ERROR_INVALID_MODULE"> 6703 If <paramlink id="module"></paramlink> is not a module object. 6704 </error> 6705 <error id="JVMTI_ERROR_INVALID_MODULE"> 6706 If <paramlink id="to_module"></paramlink> is not a module object. 6707 </error> 6708 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 6709 If the package <paramlink id="pkg_name"></paramlink> 6710 does not belong to the module. 6711 </error> 6712 <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE"> 6713 if the module cannot be modified. 6714 See <functionlink id="IsModifiableModule"/>. 6715 </error> 6716 </errors> 6717 </function> 6718 6719 <function id="AddModuleUses" num="97" since="9"> 6720 <synopsis>Add Module Uses</synopsis> 6721 <description> 6722 Updates a module to add a service to the set of services that 6723 a module uses. This function is a no-op when the module 6724 is an unnamed module. 6725 This function facilitates the instrumentation of code 6726 in named modules where that instrumentation requires 6727 expanding the set of services that a module is using. 6728 </description> 6729 <origin>new</origin> 6730 <capabilities> 6731 </capabilities> 6732 <parameters> 6733 <param id="module"> 6734 <ptrtype><jobject/></ptrtype> 6735 <description> 6736 The module to update. 6737 </description> 6738 </param> 6739 <param id="service"> 6740 <ptrtype><jclass/></ptrtype> 6741 <description> 6742 The service to use. 6743 </description> 6744 </param> 6745 </parameters> 6746 <errors> 6747 <error id="JVMTI_ERROR_INVALID_MODULE"> 6748 If <paramlink id="module"></paramlink> is not a module object. 6749 </error> 6750 <error id="JVMTI_ERROR_INVALID_CLASS"> 6751 If <paramlink id="service"></paramlink> is not a class object. 6752 </error> 6753 <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE"> 6754 if the module cannot be modified. 6755 See <functionlink id="IsModifiableModule"/>. 6756 </error> 6757 </errors> 6758 </function> 6759 6760 <function id="AddModuleProvides" num="98" since="9"> 6761 <synopsis>Add Module Provides</synopsis> 6762 <description> 6763 Updates a module to add a service to the set of services that 6764 a module provides. This function is a no-op when the module 6765 is an unnamed module. 6766 This function facilitates the instrumentation of code 6767 in named modules where that instrumentation requires 6768 changes to the services that are provided. 6769 </description> 6770 <origin>new</origin> 6771 <capabilities> 6772 </capabilities> 6773 <parameters> 6774 <param id="module"> 6775 <ptrtype><jobject/></ptrtype> 6776 <description> 6777 The module to update. 6778 </description> 6779 </param> 6780 <param id="service"> 6781 <ptrtype><jclass/></ptrtype> 6782 <description> 6783 The service to provide. 6784 </description> 6785 </param> 6786 <param id="impl_class"> 6787 <ptrtype><jclass/></ptrtype> 6788 <description> 6789 The implementation class for the provided service. 6790 </description> 6791 </param> 6792 </parameters> 6793 <errors> 6794 <error id="JVMTI_ERROR_INVALID_MODULE"> 6795 If <paramlink id="module"></paramlink> is not a module object. 6796 </error> 6797 <error id="JVMTI_ERROR_INVALID_CLASS"> 6798 If <paramlink id="service"></paramlink> is not a class object. 6799 </error> 6800 <error id="JVMTI_ERROR_INVALID_CLASS"> 6801 If <paramlink id="impl_class"></paramlink> is not a class object. 6802 </error> 6803 <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE"> 6804 if the module cannot be modified. 6805 See <functionlink id="IsModifiableModule"/>. 6806 </error> 6807 </errors> 6808 </function> 6809 6810 <function id="IsModifiableModule" num="99" since="9"> 6811 <synopsis>Is Modifiable Module</synopsis> 6812 <description> 6813 Determines whether a module is modifiable. 6814 If a module is modifiable then this module can be updated with 6815 <functionlink id="AddModuleReads"/>, <functionlink id="AddModuleExports"/>, 6816 <functionlink id="AddModuleOpens"/>, <functionlink id="AddModuleUses"/>, 6817 and <functionlink id="AddModuleProvides"/>. If a module is not modifiable 6818 then the module can not be updated with these functions. The result of 6819 this function is always <code>JNI_TRUE</code> when called to determine 6820 if an unnamed module is modifiable. 6821 </description> 6822 <origin>new</origin> 6823 <capabilities> 6824 </capabilities> 6825 <parameters> 6826 <param id="module"> 6827 <ptrtype><jobject/></ptrtype> 6828 <description> 6829 The module to query. 6830 </description> 6831 </param> 6832 <param id="is_modifiable_module_ptr"> 6833 <outptr><jboolean/></outptr> 6834 <description> 6835 On return, points to the boolean result of this function. 6836 </description> 6837 </param> 6838 </parameters> 6839 <errors> 6840 <error id="JVMTI_ERROR_INVALID_MODULE"> 6841 If <paramlink id="module"></paramlink> is not a module object. 6842 </error> 6843 </errors> 6844 </function> 6845 6846 </category> 6847 6848 <category id="class" label="Class"> 6849 6850 <intro> 6851 </intro> 6852 6853 <function id="GetLoadedClasses" jkernel="yes" num="78"> 6854 <synopsis>Get Loaded Classes</synopsis> 6855 <description> 6856 Return an array of all classes loaded in the virtual machine. 6857 The number of classes in the array is returned via 6858 <code>class_count_ptr</code>, and the array itself via 6859 <code>classes_ptr</code>. 6860 <p/> 6861 Array classes of all types (including arrays of primitive types) are 6862 included in the returned list. Primitive classes (for example, 6863 <code>java.lang.Integer.TYPE</code>) are <i>not</i> included in this list. 6864 </description> 6865 <origin>jvmdi</origin> 6866 <capabilities> 6867 </capabilities> 6868 <parameters> 6869 <param id="class_count_ptr"> 6870 <outptr><jint/></outptr> 6871 <description> 6872 On return, points to the number of classes. 6873 </description> 6874 </param> 6875 <param id="classes_ptr"> 6876 <allocbuf outcount="class_count_ptr"><jclass/></allocbuf> 6877 <description> 6878 On return, points to an array of references, one 6879 for each class. 6880 </description> 6881 </param> 6882 </parameters> 6883 <errors> 6884 </errors> 6885 </function> 6886 6887 <function id="GetClassLoaderClasses" jkernel="yes" num="79"> 6888 <synopsis>Get Classloader Classes</synopsis> 6889 <description> 6890 Returns an array of those classes for which this class loader has 6891 been recorded as an initiating loader. Each 6892 class in the returned array was created by this class loader, 6893 either by defining it directly or by delegation to another class loader. 6894 See <vmspec chapter="5.3"/>. 6895 <p/> 6896 The number of classes in the array is returned via 6897 <code>class_count_ptr</code>, and the array itself via 6898 <code>classes_ptr</code>. 6899 </description> 6900 <origin>jvmdi</origin> 6901 <capabilities> 6902 </capabilities> 6903 <parameters> 6904 <param id="initiating_loader"> 6905 <ptrtype> 6906 <jobject/> 6907 <nullok>the classes initiated by the bootstrap loader will be returned</nullok> 6908 </ptrtype> 6909 <description> 6910 An initiating class loader. 6911 </description> 6912 </param> 6913 <param id="class_count_ptr"> 6914 <outptr><jint/></outptr> 6915 <description> 6916 On return, points to the number of classes. 6917 </description> 6918 </param> 6919 <param id="classes_ptr"> 6920 <allocbuf outcount="class_count_ptr"><jclass/></allocbuf> 6921 <description> 6922 On return, points to an array of references, one 6923 for each class. 6924 </description> 6925 </param> 6926 </parameters> 6927 <errors> 6928 </errors> 6929 </function> 6930 6931 <function id="GetClassSignature" phase="start" num="48"> 6932 <synopsis>Get Class Signature</synopsis> 6933 <description> 6934 For the class indicated by <code>klass</code>, return the 6935 <externallink id="jni/types.html#type-signatures">JNI 6936 type signature</externallink> 6937 and the generic signature of the class. 6938 For example, <code>java.util.List</code> is <code>"Ljava/util/List;"</code> 6939 and <code>int[]</code> is <code>"[I"</code> 6940 The returned name for primitive classes 6941 is the type signature character of the corresponding primitive type. 6942 For example, <code>java.lang.Integer.TYPE</code> is <code>"I"</code>. 6943 </description> 6944 <origin>jvmdiClone</origin> 6945 <capabilities> 6946 </capabilities> 6947 <parameters> 6948 <param id="klass"> 6949 <jclass/> 6950 <description> 6951 The class to query. 6952 </description> 6953 </param> 6954 <param id="signature_ptr"> 6955 <allocbuf> 6956 <char/> 6957 <nullok>the signature is not returned</nullok> 6958 </allocbuf> 6959 <description> 6960 On return, points to the JNI type signature of the class, encoded as a 6961 <internallink id="mUTF">modified UTF-8</internallink> string. 6962 </description> 6963 </param> 6964 <param id="generic_ptr"> 6965 <allocbuf> 6966 <char/> 6967 <nullok>the generic signature is not returned</nullok> 6968 </allocbuf> 6969 <description> 6970 On return, points to the generic signature of the class, encoded as a 6971 <internallink id="mUTF">modified UTF-8</internallink> string. 6972 If there is no generic signature attribute for the class, then, 6973 on return, points to <code>NULL</code>. 6974 </description> 6975 </param> 6976 </parameters> 6977 <errors> 6978 </errors> 6979 </function> 6980 6981 <function id="GetClassStatus" phase="start" num="49"> 6982 <synopsis>Get Class Status</synopsis> 6983 <description> 6984 Get the status of the class. Zero or more of the following bits can be 6985 set. 6986 <constants id="jvmtiClassStatus" label="Class Status Flags" kind="bits"> 6987 <constant id="JVMTI_CLASS_STATUS_VERIFIED" num="1"> 6988 Class bytecodes have been verified 6989 </constant> 6990 <constant id="JVMTI_CLASS_STATUS_PREPARED" num="2"> 6991 Class preparation is complete 6992 </constant> 6993 <constant id="JVMTI_CLASS_STATUS_INITIALIZED" num="4"> 6994 Class initialization is complete. Static initializer has been run. 6995 </constant> 6996 <constant id="JVMTI_CLASS_STATUS_ERROR" num="8"> 6997 Error during initialization makes class unusable 6998 </constant> 6999 <constant id="JVMTI_CLASS_STATUS_ARRAY" num="16"> 7000 Class is an array. If set, all other bits are zero. 7001 </constant> 7002 <constant id="JVMTI_CLASS_STATUS_PRIMITIVE" num="32"> 7003 Class is a primitive class (for example, <code>java.lang.Integer.TYPE</code>). 7004 If set, all other bits are zero. 7005 </constant> 7006 </constants> 7007 </description> 7008 <origin>jvmdi</origin> 7009 <capabilities> 7010 </capabilities> 7011 <parameters> 7012 <param id="klass"> 7013 <jclass/> 7014 <description> 7015 The class to query. 7016 </description> 7017 </param> 7018 <param id="status_ptr"> 7019 <outptr><jint/></outptr> 7020 <description> 7021 On return, points to the current state of this class as one or 7022 more of the <internallink id="jvmtiClassStatus">class status flags</internallink>. 7023 </description> 7024 </param> 7025 </parameters> 7026 <errors> 7027 </errors> 7028 </function> 7029 7030 <function id="GetSourceFileName" phase="start" num="50"> 7031 <synopsis>Get Source File Name</synopsis> 7032 <description> 7033 For the class indicated by <code>klass</code>, return the source file 7034 name via <code>source_name_ptr</code>. The returned string 7035 is a file name only and never contains a directory name. 7036 <p/> 7037 For primitive classes (for example, <code>java.lang.Integer.TYPE</code>) 7038 and for arrays this function returns 7039 <errorlink id="JVMTI_ERROR_ABSENT_INFORMATION"></errorlink>. 7040 </description> 7041 <origin>jvmdi</origin> 7042 <capabilities> 7043 <required id="can_get_source_file_name"></required> 7044 </capabilities> 7045 <parameters> 7046 <param id="klass"> 7047 <jclass/> 7048 <description> 7049 The class to query. 7050 </description> 7051 </param> 7052 <param id="source_name_ptr"> 7053 <allocbuf><char/></allocbuf> 7054 <description> 7055 On return, points to the class's source file name, encoded as a 7056 <internallink id="mUTF">modified UTF-8</internallink> string. 7057 </description> 7058 </param> 7059 </parameters> 7060 <errors> 7061 <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 7062 Class information does not include a source file name. This includes 7063 cases where the class is an array class or primitive class. 7064 </error> 7065 </errors> 7066 </function> 7067 7068 <function id="GetClassModifiers" phase="start" num="51"> 7069 <synopsis>Get Class Modifiers</synopsis> 7070 <description> 7071 For the class indicated by <code>klass</code>, return the access 7072 flags 7073 via <code>modifiers_ptr</code>. 7074 Access flags are defined in <vmspec chapter="4"/>. 7075 <p/> 7076 If the class is an array class, then its public, private, and protected 7077 modifiers are the same as those of its component type. For arrays of 7078 primitives, this component type is represented by one of the primitive 7079 classes (for example, <code>java.lang.Integer.TYPE</code>). 7080 <p/> 7081 If the class is a primitive class, its public modifier is always true, 7082 and its protected and private modifiers are always false. 7083 <p/> 7084 If the class is an array class or a primitive class then its final 7085 modifier is always true and its interface modifier is always false. 7086 The values of its other modifiers are not determined by this specification. 7087 7088 </description> 7089 <origin>jvmdi</origin> 7090 <capabilities> 7091 </capabilities> 7092 <parameters> 7093 <param id="klass"> 7094 <jclass/> 7095 <description> 7096 The class to query. 7097 </description> 7098 </param> 7099 <param id="modifiers_ptr"> 7100 <outptr><jint/></outptr> 7101 <description> 7102 On return, points to the current access flags of this class. 7103 7104 </description> 7105 </param> 7106 </parameters> 7107 <errors> 7108 </errors> 7109 </function> 7110 7111 <function id="GetClassMethods" phase="start" num="52"> 7112 <synopsis>Get Class Methods</synopsis> 7113 <description> 7114 For the class indicated by <code>klass</code>, return a count of 7115 methods via <code>method_count_ptr</code> and a list of 7116 method IDs via <code>methods_ptr</code>. The method list contains 7117 constructors and static initializers as well as true methods. 7118 Only directly declared methods are returned (not inherited methods). 7119 An empty method list is returned for array classes and primitive classes 7120 (for example, <code>java.lang.Integer.TYPE</code>). 7121 </description> 7122 <origin>jvmdi</origin> 7123 <capabilities> 7124 <capability id="can_maintain_original_method_order"/> 7125 </capabilities> 7126 <parameters> 7127 <param id="klass"> 7128 <jclass/> 7129 <description> 7130 The class to query. 7131 </description> 7132 </param> 7133 <param id="method_count_ptr"> 7134 <outptr><jint/></outptr> 7135 <description> 7136 On return, points to the number of methods declared in this class. 7137 </description> 7138 </param> 7139 <param id="methods_ptr"> 7140 <allocbuf outcount="method_count_ptr"><jmethodID class="klass"/></allocbuf> 7141 <description> 7142 On return, points to the method ID array. 7143 </description> 7144 </param> 7145 </parameters> 7146 <errors> 7147 <error id="JVMTI_ERROR_CLASS_NOT_PREPARED"> 7148 <paramlink id="klass"></paramlink> is not prepared. 7149 </error> 7150 </errors> 7151 </function> 7152 7153 <function id="GetClassFields" phase="start" num="53"> 7154 <synopsis>Get Class Fields</synopsis> 7155 <description> 7156 For the class indicated by <code>klass</code>, return a count of fields 7157 via <code>field_count_ptr</code> and a list of field IDs via 7158 <code>fields_ptr</code>. 7159 Only directly declared fields are returned (not inherited fields). 7160 Fields are returned in the order they occur in the class file. 7161 An empty field list is returned for array classes and primitive classes 7162 (for example, <code>java.lang.Integer.TYPE</code>). 7163 Use JNI to determine the length of an array. 7164 </description> 7165 <origin>jvmdi</origin> 7166 <capabilities> 7167 </capabilities> 7168 <parameters> 7169 <param id="klass"> 7170 <jclass/> 7171 <description> 7172 The class to query. 7173 </description> 7174 </param> 7175 <param id="field_count_ptr"> 7176 <outptr><jint/></outptr> 7177 <description> 7178 On return, points to the number of fields declared in this class. 7179 </description> 7180 </param> 7181 <param id="fields_ptr"> 7182 <allocbuf outcount="field_count_ptr"><jfieldID/></allocbuf> 7183 <description> 7184 On return, points to the field ID array. 7185 </description> 7186 </param> 7187 </parameters> 7188 <errors> 7189 <error id="JVMTI_ERROR_CLASS_NOT_PREPARED"> 7190 <paramlink id="klass"></paramlink> is not prepared. 7191 </error> 7192 </errors> 7193 </function> 7194 7195 <function id="GetImplementedInterfaces" phase="start" num="54"> 7196 <synopsis>Get Implemented Interfaces</synopsis> 7197 <description> 7198 Return the direct super-interfaces of this class. For a class, this 7199 function returns the interfaces declared in its <code>implements</code> 7200 clause. For an interface, this function returns the interfaces declared in 7201 its <code>extends</code> clause. 7202 An empty interface list is returned for array classes and primitive classes 7203 (for example, <code>java.lang.Integer.TYPE</code>). 7204 </description> 7205 <origin>jvmdi</origin> 7206 <capabilities> 7207 </capabilities> 7208 <parameters> 7209 <param id="klass"> 7210 <jclass/> 7211 <description> 7212 The class to query. 7213 </description> 7214 </param> 7215 <param id="interface_count_ptr"> 7216 <outptr><jint/></outptr> 7217 <description> 7218 On return, points to the number of interfaces. 7219 </description> 7220 </param> 7221 <param id="interfaces_ptr"> 7222 <allocbuf outcount="interface_count_ptr"><jclass/></allocbuf> 7223 <description> 7224 On return, points to the interface array. 7225 </description> 7226 </param> 7227 </parameters> 7228 <errors> 7229 <error id="JVMTI_ERROR_CLASS_NOT_PREPARED"> 7230 <paramlink id="klass"></paramlink> is not prepared. 7231 </error> 7232 </errors> 7233 </function> 7234 7235 <function id="GetClassVersionNumbers" phase="start" num="145" since="1.1"> 7236 <synopsis>Get Class Version Numbers</synopsis> 7237 <description> 7238 For the class indicated by <code>klass</code>, 7239 return the minor and major version numbers, 7240 as defined in 7241 <vmspec chapter="4"/>. 7242 </description> 7243 <origin>new</origin> 7244 <capabilities> 7245 </capabilities> 7246 <parameters> 7247 <param id="klass"> 7248 <jclass/> 7249 <description> 7250 The class to query. 7251 </description> 7252 </param> 7253 <param id="minor_version_ptr"> 7254 <outptr><jint/></outptr> 7255 <description> 7256 On return, points to the value of the 7257 <code>minor_version</code> item of the 7258 Class File Format. 7259 Note: to be consistent with the Class File Format, 7260 the minor version number is the first parameter. 7261 </description> 7262 </param> 7263 <param id="major_version_ptr"> 7264 <outptr><jint/></outptr> 7265 <description> 7266 On return, points to the value of the 7267 <code>major_version</code> item of the 7268 Class File Format. 7269 </description> 7270 </param> 7271 </parameters> 7272 <errors> 7273 <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 7274 The class is a primitive or array class. 7275 </error> 7276 </errors> 7277 </function> 7278 7279 <function id="GetConstantPool" phase="start" num="146" since="1.1"> 7280 <synopsis>Get Constant Pool</synopsis> 7281 <description> 7282 For the class indicated by <code>klass</code>, 7283 return the raw bytes of the constant pool in the format of the 7284 <code>constant_pool</code> item of 7285 <vmspec chapter="4"/>. 7286 The format of the constant pool may differ between versions 7287 of the Class File Format, so, the 7288 <functionlink id="GetClassVersionNumbers">minor and major 7289 class version numbers</functionlink> should be checked for 7290 compatibility. 7291 <p/> 7292 The returned constant pool might not have the same layout or 7293 contents as the constant pool in the defining class file. 7294 The constant pool returned by GetConstantPool() may have 7295 more or fewer entries than the defining constant pool. 7296 Entries may be in a different order. 7297 The constant pool returned by GetConstantPool() will match the 7298 constant pool used by 7299 <functionlink id="GetBytecodes">GetBytecodes()</functionlink>. 7300 That is, the bytecodes returned by GetBytecodes() will have 7301 constant pool indices which refer to constant pool entries returned 7302 by GetConstantPool(). 7303 Note that since <functionlink id="RetransformClasses"/> 7304 and <functionlink id="RedefineClasses"/> can change 7305 the constant pool, the constant pool returned by this function 7306 can change accordingly. Thus, the correspondence between 7307 GetConstantPool() and GetBytecodes() does not hold if there 7308 is an intervening class retransformation or redefinition. 7309 The value of a constant pool entry used by a given bytecode will 7310 match that of the defining class file (even if the indices don't match). 7311 Constant pool entries which are not used directly or indirectly by 7312 bytecodes (for example, UTF-8 strings associated with annotations) are 7313 not required to exist in the returned constant pool. 7314 </description> 7315 <origin>new</origin> 7316 <capabilities> 7317 <required id="can_get_constant_pool"></required> 7318 </capabilities> 7319 <parameters> 7320 <param id="klass"> 7321 <jclass/> 7322 <description> 7323 The class to query. 7324 </description> 7325 </param> 7326 <param id="constant_pool_count_ptr"> 7327 <outptr><jint/></outptr> 7328 <description> 7329 On return, points to the number of entries 7330 in the constant pool table plus one. 7331 This corresponds to the <code>constant_pool_count</code> 7332 item of the Class File Format. 7333 </description> 7334 </param> 7335 <param id="constant_pool_byte_count_ptr"> 7336 <outptr><jint/></outptr> 7337 <description> 7338 On return, points to the number of bytes 7339 in the returned raw constant pool. 7340 </description> 7341 </param> 7342 <param id="constant_pool_bytes_ptr"> 7343 <allocbuf outcount="constant_pool_byte_count_ptr"><uchar/></allocbuf> 7344 <description> 7345 On return, points to the raw constant pool, that is the bytes 7346 defined by the <code>constant_pool</code> item of the 7347 Class File Format 7348 </description> 7349 </param> 7350 </parameters> 7351 <errors> 7352 <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 7353 The class is a primitive or array class. 7354 </error> 7355 </errors> 7356 </function> 7357 7358 <function id="IsInterface" phase="start" num="55"> 7359 <synopsis>Is Interface</synopsis> 7360 <description> 7361 Determines whether a class object reference represents an interface. 7362 The <code>jboolean</code> result is 7363 <code>JNI_TRUE</code> if the "class" is actually an interface, 7364 <code>JNI_FALSE</code> otherwise. 7365 </description> 7366 <origin>jvmdi</origin> 7367 <capabilities> 7368 </capabilities> 7369 <parameters> 7370 <param id="klass"> 7371 <jclass/> 7372 <description> 7373 The class to query. 7374 </description> 7375 </param> 7376 <param id="is_interface_ptr"> 7377 <outptr><jboolean/></outptr> 7378 <description> 7379 On return, points to the boolean result of this function. 7380 7381 </description> 7382 </param> 7383 </parameters> 7384 <errors> 7385 </errors> 7386 </function> 7387 7388 <function id="IsArrayClass" phase="start" num="56"> 7389 <synopsis>Is Array Class</synopsis> 7390 <description> 7391 Determines whether a class object reference represents an array. 7392 The <code>jboolean</code> result is 7393 <code>JNI_TRUE</code> if the class is an array, 7394 <code>JNI_FALSE</code> otherwise. 7395 </description> 7396 <origin>jvmdi</origin> 7397 <capabilities> 7398 </capabilities> 7399 <parameters> 7400 <param id="klass"> 7401 <jclass/> 7402 <description> 7403 The class to query. 7404 </description> 7405 </param> 7406 <param id="is_array_class_ptr"> 7407 <outptr><jboolean/></outptr> 7408 <description> 7409 On return, points to the boolean result of this function. 7410 7411 </description> 7412 </param> 7413 </parameters> 7414 <errors> 7415 </errors> 7416 </function> 7417 7418 <function id="IsModifiableClass" jkernel="yes" phase="start" num="45" since="1.1"> 7419 <synopsis>Is Modifiable Class</synopsis> 7420 <description> 7421 Determines whether a class is modifiable. 7422 If a class is modifiable (<paramlink id="is_modifiable_class_ptr"/> 7423 returns <code>JNI_TRUE</code>) the class can be 7424 redefined with <functionlink id="RedefineClasses"/> (assuming 7425 the agent possesses the 7426 <fieldlink id="can_redefine_classes" struct="jvmtiCapabilities"/> 7427 capability) or 7428 retransformed with <functionlink id="RetransformClasses"/> (assuming 7429 the agent possesses the 7430 <fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/> 7431 capability). 7432 If a class is not modifiable (<paramlink id="is_modifiable_class_ptr"/> 7433 returns <code>JNI_FALSE</code>) the class can be neither 7434 redefined nor retransformed. 7435 <p/> 7436 Primitive classes (for example, <code>java.lang.Integer.TYPE</code>), 7437 array classes, and some implementation defined classes are never modifiable. 7438 <p/> 7439 </description> 7440 <origin>new</origin> 7441 <capabilities> 7442 <capability id="can_redefine_any_class"> 7443 If possessed then all classes (except primitive, array, and some implementation defined 7444 classes) are modifiable (redefine or retransform). 7445 </capability> 7446 <capability id="can_retransform_any_class"> 7447 If possessed then all classes (except primitive, array, and some implementation defined 7448 classes) are modifiable with <functionlink id="RetransformClasses"/>. 7449 </capability> 7450 <capability id="can_redefine_classes"> 7451 No effect on the result of the function. 7452 But must additionally be possessed to modify the class with 7453 <functionlink id="RedefineClasses"/>. 7454 </capability> 7455 <capability id="can_retransform_classes"> 7456 No effect on the result of the function. 7457 But must additionally be possessed to modify the class with 7458 <functionlink id="RetransformClasses"/>. 7459 </capability> 7460 </capabilities> 7461 <parameters> 7462 <param id="klass"> 7463 <jclass/> 7464 <description> 7465 The class to query. 7466 </description> 7467 </param> 7468 <param id="is_modifiable_class_ptr"> 7469 <outptr><jboolean/></outptr> 7470 <description> 7471 On return, points to the boolean result of this function. 7472 </description> 7473 </param> 7474 </parameters> 7475 <errors> 7476 </errors> 7477 </function> 7478 7479 <function id="GetClassLoader" phase="start" num="57"> 7480 <synopsis>Get Class Loader</synopsis> 7481 <description> 7482 For the class indicated by <code>klass</code>, return via 7483 <code>classloader_ptr</code> a reference to the class loader for the 7484 class. 7485 </description> 7486 <origin>jvmdi</origin> 7487 <capabilities> 7488 </capabilities> 7489 <parameters> 7490 <param id="klass"> 7491 <jclass/> 7492 <description> 7493 The class to query. 7494 </description> 7495 </param> 7496 <param id="classloader_ptr"> 7497 <outptr><jobject/></outptr> 7498 <description> 7499 On return, points to the class loader that loaded 7500 this class. 7501 If the class was not created by a class loader 7502 or if the class loader is the bootstrap class loader, 7503 points to <code>NULL</code>. 7504 </description> 7505 </param> 7506 </parameters> 7507 <errors> 7508 </errors> 7509 7510 </function> 7511 7512 <function id="GetSourceDebugExtension" phase="start" num="90"> 7513 <synopsis>Get Source Debug Extension</synopsis> 7514 <description> 7515 For the class indicated by <code>klass</code>, return the debug 7516 extension via <code>source_debug_extension_ptr</code>. 7517 The returned string 7518 contains exactly the debug extension information present in the 7519 class file of <code>klass</code>. 7520 </description> 7521 <origin>jvmdi</origin> 7522 <capabilities> 7523 <required id="can_get_source_debug_extension"></required> 7524 </capabilities> 7525 <parameters> 7526 <param id="klass"> 7527 <jclass/> 7528 <description> 7529 The class to query. 7530 </description> 7531 </param> 7532 <param id="source_debug_extension_ptr"> 7533 <allocbuf><char/></allocbuf> 7534 <description> 7535 On return, points to the class's debug extension, encoded as a 7536 <internallink id="mUTF">modified UTF-8</internallink> string. 7537 </description> 7538 </param> 7539 </parameters> 7540 <errors> 7541 <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 7542 Class information does not include a debug extension. 7543 </error> 7544 </errors> 7545 </function> 7546 7547 <function id="RetransformClasses" jkernel="yes" num="152" since="1.1"> 7548 <synopsis>Retransform Classes</synopsis> 7549 <description> 7550 This function facilitates the 7551 <internallink id="bci">bytecode instrumentation</internallink> 7552 of already loaded classes. 7553 To replace the class definition without reference to the existing 7554 bytecodes, as one might do when recompiling from source for 7555 fix-and-continue debugging, <functionlink id="RedefineClasses"/> 7556 function should be used instead. 7557 <p/> 7558 When classes are initially loaded or when they are 7559 <functionlink id="RedefineClasses">redefined</functionlink>, 7560 the initial class file bytes can be transformed with the 7561 <eventlink id="ClassFileLoadHook"/> event. 7562 This function reruns the transformation process 7563 (whether or not a transformation has previously occurred). 7564 This retransformation follows these steps: 7565 <ul> 7566 <li>starting from the initial class file bytes 7567 </li> 7568 <li>for each <fieldlink id="can_retransform_classes" 7569 struct="jvmtiCapabilities">retransformation 7570 incapable</fieldlink> 7571 agent which received a 7572 <code>ClassFileLoadHook</code> event during the previous 7573 load or redefine, the bytes it returned 7574 (via the <code>new_class_data</code> parameter) 7575 are reused as the output of the transformation; 7576 note that this is equivalent to reapplying 7577 the previous transformation, unaltered. except that 7578 the <code>ClassFileLoadHook</code> event 7579 is <b>not</b> sent to these agents 7580 </li> 7581 <li>for each <fieldlink id="can_retransform_classes" 7582 struct="jvmtiCapabilities">retransformation 7583 capable</fieldlink> 7584 agent, the <code>ClassFileLoadHook</code> event is sent, 7585 allowing a new transformation to be applied 7586 </li> 7587 <li>the transformed class file bytes are installed as the new 7588 definition of the class 7589 </li> 7590 </ul> 7591 See the <eventlink id="ClassFileLoadHook"/> event for more details. 7592 <p/> 7593 The initial class file bytes represent the bytes passed to 7594 <code>ClassLoader.defineClass</code> 7595 or <code>RedefineClasses</code> (before any transformations 7596 were applied), however they may not exactly match them. 7597 The constant pool may differ in ways described in 7598 <functionlink id="GetConstantPool"/>. 7599 Constant pool indices in the bytecodes of methods will correspond. 7600 Some attributes may not be present. 7601 Where order is not meaningful, for example the order of methods, 7602 order may not be preserved. 7603 <p/> 7604 Retransformation can cause new versions of methods to be installed. 7605 Old method versions may become 7606 <internallink id="obsoleteMethods">obsolete</internallink> 7607 The new method version will be used on new invokes. 7608 If a method has active stack frames, those active frames continue to 7609 run the bytecodes of the original method version. 7610 <p/> 7611 This function does not cause any initialization except that which 7612 would occur under the customary JVM semantics. 7613 In other words, retransforming a class does not cause its initializers to be 7614 run. The values of static fields will remain as they were 7615 prior to the call. 7616 <p/> 7617 Threads need not be suspended. 7618 <p/> 7619 All breakpoints in the class are cleared. 7620 <p/> 7621 All attributes are updated. 7622 <p/> 7623 Instances of the retransformed class are not affected -- fields retain their 7624 previous values. 7625 <functionlink id="GetTag">Tags</functionlink> on the instances are 7626 also unaffected. 7627 <p/> 7628 In response to this call, no events other than the 7629 <eventlink id="ClassFileLoadHook"/> event 7630 will be sent. 7631 <p/> 7632 The retransformation may change method bodies, the constant pool and attributes. 7633 The retransformation must not add, remove or rename fields or methods, change the 7634 signatures of methods, change modifiers, or change inheritance. 7635 These restrictions may be lifted in future versions. 7636 See the error return description below for information on error codes 7637 returned if an unsupported retransformation is attempted. 7638 The class file bytes are not verified or installed until they have passed 7639 through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the 7640 returned error code reflects the result of the transformations. 7641 If any error code is returned other than <code>JVMTI_ERROR_NONE</code>, 7642 none of the classes to be retransformed will have a new definition installed. 7643 When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>) 7644 all of the classes to be retransformed will have their new definitions installed. 7645 </description> 7646 <origin>new</origin> 7647 <capabilities> 7648 <required id="can_retransform_classes"></required> 7649 <capability id="can_retransform_any_class"></capability> 7650 </capabilities> 7651 <parameters> 7652 <param id="class_count"> 7653 <jint min="0"/> 7654 <description> 7655 The number of classes to be retransformed. 7656 </description> 7657 </param> 7658 <param id="classes"> 7659 <inbuf incount="class_count"><jclass/></inbuf> 7660 <description> 7661 The array of classes to be retransformed. 7662 </description> 7663 </param> 7664 </parameters> 7665 <errors> 7666 <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS"> 7667 One of the <paramlink id="classes"/> cannot be modified. 7668 See <functionlink id="IsModifiableClass"/>. 7669 </error> 7670 <error id="JVMTI_ERROR_INVALID_CLASS"> 7671 One of the <paramlink id="classes"/> is not a valid class. 7672 </error> 7673 <error id="JVMTI_ERROR_UNSUPPORTED_VERSION"> 7674 A retransformed class file has a version number not supported by this VM. 7675 </error> 7676 <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT"> 7677 A retransformed class file is malformed (The VM would return a <code>ClassFormatError</code>). 7678 </error> 7679 <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION"> 7680 The retransformed class file definitions would lead to a circular definition 7681 (the VM would return a <code>ClassCircularityError</code>). 7682 </error> 7683 <error id="JVMTI_ERROR_FAILS_VERIFICATION"> 7684 The retransformed class file bytes fail verification. 7685 </error> 7686 <error id="JVMTI_ERROR_NAMES_DONT_MATCH"> 7687 The class name defined in a retransformed class file is 7688 different from the name in the old class object. 7689 </error> 7690 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED"> 7691 A retransformed class file would require adding a method. 7692 </error> 7693 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED"> 7694 A retransformed class file changes a field. 7695 </error> 7696 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED"> 7697 A direct superclass is different for a retransformed class file, 7698 or the set of directly implemented 7699 interfaces is different. 7700 </error> 7701 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED"> 7702 A retransformed class file does not declare a method 7703 declared in the old class version. 7704 </error> 7705 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED"> 7706 A retransformed class file has different class modifiers. 7707 </error> 7708 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED"> 7709 A method in the retransformed class file has different modifiers 7710 than its counterpart in the old class version. 7711 </error> 7712 </errors> 7713 </function> 7714 7715 <function id="RedefineClasses" jkernel="yes" num="87"> 7716 <synopsis>Redefine Classes</synopsis> 7717 <typedef id="jvmtiClassDefinition" label="Class redefinition description"> 7718 <field id="klass"> 7719 <jclass/> 7720 <description> 7721 Class object for this class 7722 </description> 7723 </field> 7724 <field id="class_byte_count"> 7725 <jint/> 7726 <description> 7727 Number of bytes defining class (below) 7728 </description> 7729 </field> 7730 <field id="class_bytes"> 7731 <inbuf incount="class_byte_count"><uchar/></inbuf> 7732 <description> 7733 Bytes defining class (in <vmspec chapter="4"/>) 7734 </description> 7735 </field> 7736 </typedef> 7737 <description> 7738 All classes given are redefined according to the definitions 7739 supplied. 7740 This function is used to replace the definition of a class 7741 with a new definition, as might be needed in fix-and-continue 7742 debugging. 7743 Where the existing class file bytes are to be transformed, for 7744 example in 7745 <internallink id="bci">bytecode instrumentation</internallink>, 7746 <functionlink id="RetransformClasses"/> should be used. 7747 <p/> 7748 Redefinition can cause new versions of methods to be installed. 7749 Old method versions may become 7750 <internallink id="obsoleteMethods">obsolete</internallink> 7751 The new method version will be used on new invokes. 7752 If a method has active stack frames, those active frames continue to 7753 run the bytecodes of the original method version. 7754 If resetting of stack frames is desired, use 7755 <functionlink id="PopFrame"></functionlink> 7756 to pop frames with obsolete method versions. 7757 <p/> 7758 This function does not cause any initialization except that which 7759 would occur under the customary JVM semantics. 7760 In other words, redefining a class does not cause its initializers to be 7761 run. The values of static fields will remain as they were 7762 prior to the call. 7763 <p/> 7764 Threads need not be suspended. 7765 <p/> 7766 All breakpoints in the class are cleared. 7767 <p/> 7768 All attributes are updated. 7769 <p/> 7770 Instances of the redefined class are not affected -- fields retain their 7771 previous values. 7772 <functionlink id="GetTag">Tags</functionlink> on the instances are 7773 also unaffected. 7774 <p/> 7775 In response to this call, the <jvmti/> event 7776 <eventlink id="ClassFileLoadHook">Class File Load Hook</eventlink> 7777 will be sent (if enabled), but no other <jvmti/> events will be sent. 7778 <p/> 7779 The redefinition may change method bodies, the constant pool and attributes. 7780 The redefinition must not add, remove or rename fields or methods, change the 7781 signatures of methods, change modifiers, or change inheritance. 7782 These restrictions may be lifted in future versions. 7783 See the error return description below for information on error codes 7784 returned if an unsupported redefinition is attempted. 7785 The class file bytes are not verified or installed until they have passed 7786 through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the 7787 returned error code reflects the result of the transformations applied 7788 to the bytes passed into <paramlink id="class_definitions"/>. 7789 If any error code is returned other than <code>JVMTI_ERROR_NONE</code>, 7790 none of the classes to be redefined will have a new definition installed. 7791 When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>) 7792 all of the classes to be redefined will have their new definitions installed. 7793 </description> 7794 <origin>jvmdi</origin> 7795 <capabilities> 7796 <required id="can_redefine_classes"></required> 7797 <capability id="can_redefine_any_class"></capability> 7798 </capabilities> 7799 <parameters> 7800 <param id="class_count"> 7801 <jint min="0"/> 7802 <description> 7803 The number of classes specified in <code>class_definitions</code> 7804 </description> 7805 </param> 7806 <param id="class_definitions"> 7807 <inbuf incount="class_count"><struct>jvmtiClassDefinition</struct></inbuf> 7808 <description> 7809 The array of new class definitions 7810 </description> 7811 </param> 7812 </parameters> 7813 <errors> 7814 <error id="JVMTI_ERROR_NULL_POINTER"> 7815 One of <code>class_bytes</code> is <code>NULL</code>. 7816 </error> 7817 <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS"> 7818 An element of <code>class_definitions</code> cannot be modified. 7819 See <functionlink id="IsModifiableClass"/>. 7820 </error> 7821 <error id="JVMTI_ERROR_INVALID_CLASS"> 7822 An element of <code>class_definitions</code> is not a valid class. 7823 </error> 7824 <error id="JVMTI_ERROR_UNSUPPORTED_VERSION"> 7825 A new class file has a version number not supported by this VM. 7826 </error> 7827 <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT"> 7828 A new class file is malformed (The VM would return a <code>ClassFormatError</code>). 7829 </error> 7830 <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION"> 7831 The new class file definitions would lead to a circular definition 7832 (the VM would return a <code>ClassCircularityError</code>). 7833 </error> 7834 <error id="JVMTI_ERROR_FAILS_VERIFICATION"> 7835 The class bytes fail verification. 7836 </error> 7837 <error id="JVMTI_ERROR_NAMES_DONT_MATCH"> 7838 The class name defined in a new class file is 7839 different from the name in the old class object. 7840 </error> 7841 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED"> 7842 A new class file would require adding a method. 7843 </error> 7844 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED"> 7845 A new class version changes a field. 7846 </error> 7847 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED"> 7848 A direct superclass is different for a new class 7849 version, or the set of directly implemented 7850 interfaces is different. 7851 </error> 7852 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED"> 7853 A new class version does not declare a method 7854 declared in the old class version. 7855 </error> 7856 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED"> 7857 A new class version has different modifiers. 7858 </error> 7859 <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED"> 7860 A method in the new class version has different modifiers 7861 than its counterpart in the old class version. 7862 </error> 7863 <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE"> 7864 A module cannot be modified. 7865 See <functionlink id="IsModifiableModule"/>. 7866 </error> 7867 </errors> 7868 </function> 7869 7870 </category> 7871 7872 <category id="object" label="Object"> 7873 7874 <function id="GetObjectSize" jkernel="yes" phase="start" num="154"> 7875 <synopsis>Get Object Size</synopsis> 7876 <description> 7877 For the object indicated by <code>object</code>, 7878 return via <code>size_ptr</code> the size of the object. 7879 This size is an implementation-specific approximation of 7880 the amount of storage consumed by this object. 7881 It may include some or all of the object's overhead, and thus 7882 is useful for comparison within an implementation but not 7883 between implementations. 7884 The estimate may change during a single invocation of the JVM. 7885 </description> 7886 <origin>new</origin> 7887 <capabilities> 7888 </capabilities> 7889 <parameters> 7890 <param id="object"> 7891 <jobject/> 7892 <description> 7893 The object to query. 7894 </description> 7895 </param> 7896 <param id="size_ptr"> 7897 <outptr><jlong/></outptr> 7898 <description> 7899 On return, points to the object's size in bytes. 7900 </description> 7901 </param> 7902 </parameters> 7903 <errors> 7904 </errors> 7905 </function> 7906 7907 <function id="GetObjectHashCode" phase="start" num="58"> 7908 <synopsis>Get Object Hash Code</synopsis> 7909 <description> 7910 For the object indicated by <code>object</code>, 7911 return via <code>hash_code_ptr</code> a hash code. 7912 This hash code could be used to maintain a hash table of object references, 7913 however, on some implementations this can cause significant performance 7914 impacts--in most cases 7915 <internallink id="Heap">tags</internallink> 7916 will be a more efficient means of associating information with objects. 7917 This function guarantees 7918 the same hash code value for a particular object throughout its life 7919 </description> 7920 <origin>jvmdi</origin> 7921 <capabilities> 7922 </capabilities> 7923 <parameters> 7924 <param id="object"> 7925 <jobject/> 7926 <description> 7927 The object to query. 7928 </description> 7929 </param> 7930 <param id="hash_code_ptr"> 7931 <outptr><jint/></outptr> 7932 <description> 7933 On return, points to the object's hash code. 7934 </description> 7935 </param> 7936 </parameters> 7937 <errors> 7938 </errors> 7939 </function> 7940 7941 <function id="GetObjectMonitorUsage" num="59"> 7942 <synopsis>Get Object Monitor Usage</synopsis> 7943 <typedef id="jvmtiMonitorUsage" label="Object monitor usage information"> 7944 <field id="owner"> 7945 <jthread/> 7946 <description> 7947 The thread owning this monitor, or <code>NULL</code> if unused 7948 </description> 7949 </field> 7950 <field id="entry_count"> 7951 <jint/> 7952 <description> 7953 The number of times the owning thread has entered the monitor 7954 </description> 7955 </field> 7956 <field id="waiter_count"> 7957 <jint/> 7958 <description> 7959 The number of threads waiting to own this monitor 7960 </description> 7961 </field> 7962 <field id="waiters"> 7963 <allocfieldbuf><jthread/></allocfieldbuf> 7964 <description> 7965 The <code>waiter_count</code> waiting threads 7966 </description> 7967 </field> 7968 <field id="notify_waiter_count"> 7969 <jint/> 7970 <description> 7971 The number of threads waiting to be notified by this monitor 7972 </description> 7973 </field> 7974 <field id="notify_waiters"> 7975 <allocfieldbuf><jthread/></allocfieldbuf> 7976 <description> 7977 The <code>notify_waiter_count</code> threads waiting to be notified 7978 </description> 7979 </field> 7980 </typedef> 7981 <description> 7982 Get information about the object's monitor. 7983 The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure 7984 are filled in with information about usage of the monitor. 7985 <todo> 7986 Decide and then clarify suspend requirements. 7987 </todo> 7988 </description> 7989 <origin>jvmdi</origin> 7990 <capabilities> 7991 <required id="can_get_monitor_info"></required> 7992 </capabilities> 7993 <parameters> 7994 <param id="object"> 7995 <jobject/> 7996 <description> 7997 The object to query. 7998 </description> 7999 </param> 8000 <param id="info_ptr"> 8001 <outptr><struct>jvmtiMonitorUsage</struct></outptr> 8002 <description> 8003 On return, filled with monitor information for the 8004 specified object. 8005 </description> 8006 </param> 8007 </parameters> 8008 <errors> 8009 </errors> 8010 </function> 8011 8012 <elide> 8013 <function id="GetObjectMonitors" num="116"> 8014 <synopsis>Get Object Monitors</synopsis> 8015 <description> 8016 Return the list of object monitors. 8017 <p/> 8018 Note: details about each monitor can be examined with 8019 <functionlink id="GetObjectMonitorUsage"></functionlink>. 8020 </description> 8021 <origin>new</origin> 8022 <capabilities> 8023 <required id="can_get_monitor_info"></required> 8024 </capabilities> 8025 <parameters> 8026 <param id="monitorCnt"> 8027 <outptr><jint/></outptr> 8028 <description> 8029 On return, pointer to the number 8030 of monitors returned in <code>monitors_ptr</code>. 8031 </description> 8032 </param> 8033 <param id="monitors_ptr"> 8034 <allocbuf outcount="monitorCnt"><jobject/></allocbuf> 8035 <description> 8036 On return, pointer to the monitor list. 8037 </description> 8038 </param> 8039 </parameters> 8040 <errors> 8041 </errors> 8042 </function> 8043 </elide> 8044 8045 </category> 8046 8047 <category id="fieldCategory" label="Field"> 8048 8049 <intro> 8050 </intro> 8051 8052 <function id="GetFieldName" phase="start" num="60"> 8053 <synopsis>Get Field Name (and Signature)</synopsis> 8054 <description> 8055 For the field indicated by <paramlink id="klass"/> and <paramlink id="field"/>, 8056 return the field name via <paramlink id="name_ptr"/> and field signature via 8057 <paramlink id="signature_ptr"/>. 8058 <p/> 8059 Field signatures are defined in the 8060 <externallink id="jni/index.html">JNI Specification</externallink> 8061 and are referred to as <code>field descriptors</code> in 8062 <vmspec chapter="4.3.2"/>. 8063 </description> 8064 <origin>jvmdiClone</origin> 8065 <capabilities> 8066 </capabilities> 8067 <parameters> 8068 <param id="klass"> 8069 <jclass field="field"/> 8070 <description> 8071 The class of the field to query. 8072 </description> 8073 </param> 8074 <param id="field"> 8075 <jfieldID class="klass"/> 8076 <description> 8077 The field to query. 8078 </description> 8079 </param> 8080 <param id="name_ptr"> 8081 <allocbuf> 8082 <char/> 8083 <nullok>the name is not returned</nullok> 8084 </allocbuf> 8085 <description> 8086 On return, points to the field name, encoded as a 8087 <internallink id="mUTF">modified UTF-8</internallink> string. 8088 </description> 8089 </param> 8090 <param id="signature_ptr"> 8091 <allocbuf> 8092 <char/> 8093 <nullok>the signature is not returned</nullok> 8094 </allocbuf> 8095 <description> 8096 On return, points to the field signature, encoded as a 8097 <internallink id="mUTF">modified UTF-8</internallink> string. 8098 </description> 8099 </param> 8100 <param id="generic_ptr"> 8101 <allocbuf> 8102 <char/> 8103 <nullok>the generic signature is not returned</nullok> 8104 </allocbuf> 8105 <description> 8106 On return, points to the generic signature of the field, encoded as a 8107 <internallink id="mUTF">modified UTF-8</internallink> string. 8108 If there is no generic signature attribute for the field, then, 8109 on return, points to <code>NULL</code>. 8110 </description> 8111 </param> 8112 </parameters> 8113 <errors> 8114 </errors> 8115 </function> 8116 8117 <function id="GetFieldDeclaringClass" phase="start" num="61"> 8118 <synopsis>Get Field Declaring Class</synopsis> 8119 <description> 8120 For the field indicated by <code>klass</code> and <code>field</code> 8121 return the class that defined it via <code>declaring_class_ptr</code>. 8122 The declaring class will either be <code>klass</code>, a superclass, or 8123 an implemented interface. 8124 </description> 8125 <origin>jvmdi</origin> 8126 <capabilities> 8127 </capabilities> 8128 <parameters> 8129 <param id="klass"> 8130 <jclass field="field"/> 8131 <description> 8132 The class to query. 8133 </description> 8134 </param> 8135 <param id="field"> 8136 <jfieldID class="klass"/> 8137 <description> 8138 The field to query. 8139 </description> 8140 </param> 8141 <param id="declaring_class_ptr"> 8142 <outptr><jclass/></outptr> 8143 <description> 8144 On return, points to the declaring class 8145 </description> 8146 </param> 8147 </parameters> 8148 <errors> 8149 </errors> 8150 </function> 8151 8152 <function id="GetFieldModifiers" phase="start" num="62"> 8153 <synopsis>Get Field Modifiers</synopsis> 8154 <description> 8155 For the field indicated by <code>klass</code> and <code>field</code> 8156 return the access flags via <code>modifiers_ptr</code>. 8157 Access flags are defined in <vmspec chapter="4"/>. 8158 </description> 8159 <origin>jvmdi</origin> 8160 <capabilities> 8161 </capabilities> 8162 <parameters> 8163 <param id="klass"> 8164 <jclass field="field"/> 8165 <description> 8166 The class to query. 8167 </description> 8168 </param> 8169 <param id="field"> 8170 <jfieldID class="klass"/> 8171 <description> 8172 The field to query. 8173 </description> 8174 </param> 8175 <param id="modifiers_ptr"> 8176 <outptr><jint/></outptr> 8177 <description> 8178 On return, points to the access flags. 8179 </description> 8180 </param> 8181 </parameters> 8182 <errors> 8183 </errors> 8184 </function> 8185 8186 <function id="IsFieldSynthetic" phase="start" num="63"> 8187 <synopsis>Is Field Synthetic</synopsis> 8188 <description> 8189 For the field indicated by <code>klass</code> and <code>field</code>, return a 8190 value indicating whether the field is synthetic via <code>is_synthetic_ptr</code>. 8191 Synthetic fields are generated by the compiler but not present in the 8192 original source code. 8193 </description> 8194 <origin>jvmdi</origin> 8195 <capabilities> 8196 <required id="can_get_synthetic_attribute"></required> 8197 </capabilities> 8198 <parameters> 8199 <param id="klass"> 8200 <jclass field="field"/> 8201 <description> 8202 The class of the field to query. 8203 </description> 8204 </param> 8205 <param id="field"> 8206 <jfieldID class="klass"/> 8207 <description> 8208 The field to query. 8209 </description> 8210 </param> 8211 <param id="is_synthetic_ptr"> 8212 <outptr><jboolean/></outptr> 8213 <description> 8214 On return, points to the boolean result of this function. 8215 </description> 8216 </param> 8217 </parameters> 8218 <errors> 8219 </errors> 8220 </function> 8221 8222 </category> 8223 8224 <category id="method" label="Method"> 8225 8226 <intro> 8227 These functions provide information about a method (represented as a 8228 <typelink id="jmethodID"/>) and set how methods are processed. 8229 </intro> 8230 8231 <intro id="obsoleteMethods" label="Obsolete Methods"> 8232 The functions <functionlink id="RetransformClasses"/> and 8233 <functionlink id="RedefineClasses"/> can cause new versions 8234 of methods to be installed. 8235 An original version of a method is considered equivalent 8236 to the new version if: 8237 <ul> 8238 <li>their bytecodes are the same except for indices into the 8239 constant pool and </li> 8240 <li>the referenced constants are equal.</li> 8241 </ul> 8242 An original method version which is not equivalent to the 8243 new method version is called obsolete and is assigned a new method ID; 8244 the original method ID now refers to the new method version. 8245 A method ID can be tested for obsolescence with 8246 <functionlink id="IsMethodObsolete"/>. 8247 </intro> 8248 8249 <function id="GetMethodName" phase="start" num="64"> 8250 <synopsis>Get Method Name (and Signature)</synopsis> 8251 <description> 8252 For the method indicated by <code>method</code>, 8253 return the method name via <code>name_ptr</code> and method signature via 8254 <code>signature_ptr</code>. 8255 <p/> 8256 Method signatures are defined in the 8257 <externallink id="jni/index.html">JNI Specification</externallink> 8258 and are referred to as <code>method descriptors</code> in 8259 <vmspec chapter="4.3.3"/>. 8260 Note this is different 8261 than method signatures as defined in the <i>Java Language Specification</i>. 8262 </description> 8263 <origin>jvmdiClone</origin> 8264 <capabilities> 8265 </capabilities> 8266 <parameters> 8267 <param id="method"> 8268 <jmethodID/> 8269 <description> 8270 The method to query. 8271 </description> 8272 </param> 8273 <param id="name_ptr"> 8274 <allocbuf> 8275 <char/> 8276 <nullok>the name is not returned</nullok> 8277 </allocbuf> 8278 <description> 8279 On return, points to the method name, encoded as a 8280 <internallink id="mUTF">modified UTF-8</internallink> string. 8281 </description> 8282 </param> 8283 <param id="signature_ptr"> 8284 <allocbuf> 8285 <char/> 8286 <nullok>the signature is not returned</nullok> 8287 </allocbuf> 8288 <description> 8289 On return, points to the method signature, encoded as a 8290 <internallink id="mUTF">modified UTF-8</internallink> string. 8291 </description> 8292 </param> 8293 <param id="generic_ptr"> 8294 <allocbuf> 8295 <char/> 8296 <nullok>the generic signature is not returned</nullok> 8297 </allocbuf> 8298 <description> 8299 On return, points to the generic signature of the method, encoded as a 8300 <internallink id="mUTF">modified UTF-8</internallink> string. 8301 If there is no generic signature attribute for the method, then, 8302 on return, points to <code>NULL</code>. 8303 </description> 8304 </param> 8305 </parameters> 8306 <errors> 8307 </errors> 8308 </function> 8309 8310 <function id="GetMethodDeclaringClass" phase="start" num="65"> 8311 <synopsis>Get Method Declaring Class</synopsis> 8312 <description> 8313 For the method indicated by <code>method</code>, 8314 return the class that defined it via <code>declaring_class_ptr</code>. 8315 </description> 8316 <origin>jvmdi</origin> 8317 <capabilities> 8318 </capabilities> 8319 <parameters> 8320 <param id="klass"> 8321 <jclass method="method"/> 8322 <description> 8323 The class to query. 8324 </description> 8325 </param> 8326 <param id="method"> 8327 <jmethodID class="klass"/> 8328 <description> 8329 The method to query. 8330 </description> 8331 </param> 8332 <param id="declaring_class_ptr"> 8333 <outptr><jclass/></outptr> 8334 <description> 8335 On return, points to the declaring class 8336 </description> 8337 </param> 8338 </parameters> 8339 <errors> 8340 </errors> 8341 </function> 8342 8343 <function id="GetMethodModifiers" phase="start" num="66"> 8344 <synopsis>Get Method Modifiers</synopsis> 8345 <description> 8346 For the method indicated by <code>method</code>, 8347 return the access flags via <code>modifiers_ptr</code>. 8348 Access flags are defined in <vmspec chapter="4"/>. 8349 </description> 8350 <origin>jvmdi</origin> 8351 <capabilities> 8352 </capabilities> 8353 <parameters> 8354 <param id="klass"> 8355 <jclass method="method"/> 8356 <description> 8357 The class to query. 8358 </description> 8359 </param> 8360 <param id="method"> 8361 <jmethodID class="klass"/> 8362 <description> 8363 The method to query. 8364 </description> 8365 </param> 8366 <param id="modifiers_ptr"> 8367 <outptr><jint/></outptr> 8368 <description> 8369 On return, points to the access flags. 8370 </description> 8371 </param> 8372 </parameters> 8373 <errors> 8374 </errors> 8375 </function> 8376 8377 <function id="GetMaxLocals" phase="start" num="68"> 8378 <synopsis>Get Max Locals</synopsis> 8379 <description> 8380 For the method indicated by <code>method</code>, 8381 return the number of local variable slots used by the method, 8382 including the local variables used to pass parameters to the 8383 method on its invocation. 8384 <p/> 8385 See <code>max_locals</code> in <vmspec chapter="4.7.3"/>. 8386 </description> 8387 <origin>jvmdi</origin> 8388 <capabilities> 8389 </capabilities> 8390 <parameters> 8391 <param id="klass"> 8392 <jclass method="method"/> 8393 <description> 8394 The class to query. 8395 </description> 8396 </param> 8397 <param id="method"> 8398 <jmethodID class="klass" native="error"/> 8399 <description> 8400 The method to query. 8401 </description> 8402 </param> 8403 <param id="max_ptr"> 8404 <outptr><jint/></outptr> 8405 <description> 8406 On return, points to the maximum number of local slots 8407 </description> 8408 </param> 8409 </parameters> 8410 <errors> 8411 </errors> 8412 </function> 8413 8414 <function id="GetArgumentsSize" phase="start" num="69"> 8415 <synopsis>Get Arguments Size</synopsis> 8416 <description> 8417 For the method indicated by <code>method</code>, 8418 return via <code>max_ptr</code> the number of local variable slots used 8419 by the method's arguments. 8420 Note that two-word arguments use two slots. 8421 </description> 8422 <origin>jvmdi</origin> 8423 <capabilities> 8424 </capabilities> 8425 <parameters> 8426 <param id="klass"> 8427 <jclass method="method"/> 8428 <description> 8429 The class to query. 8430 </description> 8431 </param> 8432 <param id="method"> 8433 <jmethodID class="klass" native="error"/> 8434 <description> 8435 The method to query. 8436 </description> 8437 </param> 8438 <param id="size_ptr"> 8439 <outptr><jint/></outptr> 8440 <description> 8441 On return, points to the number of argument slots 8442 </description> 8443 </param> 8444 </parameters> 8445 <errors> 8446 </errors> 8447 </function> 8448 8449 <function id="GetLineNumberTable" phase="start" num="70"> 8450 <synopsis>Get Line Number Table</synopsis> 8451 <typedef id="jvmtiLineNumberEntry" label="Line number table entry"> 8452 <field id="start_location"> 8453 <jlocation/> 8454 <description> 8455 the <datalink id="jlocation"></datalink> where the line begins 8456 </description> 8457 </field> 8458 <field id="line_number"> 8459 <jint/> 8460 <description> 8461 the line number 8462 </description> 8463 </field> 8464 </typedef> 8465 <description> 8466 For the method indicated by <code>method</code>, 8467 return a table of source line number entries. The size of the table is 8468 returned via <code>entry_count_ptr</code> and the table itself is 8469 returned via <code>table_ptr</code>. 8470 </description> 8471 <origin>jvmdi</origin> 8472 <capabilities> 8473 <required id="can_get_line_numbers"></required> 8474 </capabilities> 8475 <parameters> 8476 <param id="klass"> 8477 <jclass method="method"/> 8478 <description> 8479 The class to query. 8480 </description> 8481 </param> 8482 <param id="method"> 8483 <jmethodID class="klass" native="error"/> 8484 <description> 8485 The method to query. 8486 </description> 8487 </param> 8488 <param id="entry_count_ptr"> 8489 <outptr><jint/></outptr> 8490 <description> 8491 On return, points to the number of entries in the table 8492 </description> 8493 </param> 8494 <param id="table_ptr"> 8495 <allocbuf outcount="entry_count_ptr"><struct>jvmtiLineNumberEntry</struct></allocbuf> 8496 <description> 8497 On return, points to the line number table pointer. 8498 </description> 8499 </param> 8500 </parameters> 8501 <errors> 8502 <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 8503 Class information does not include line numbers. 8504 </error> 8505 </errors> 8506 </function> 8507 8508 <function id="GetMethodLocation" phase="start" num="71"> 8509 <synopsis>Get Method Location</synopsis> 8510 <description> 8511 For the method indicated by <code>method</code>, 8512 return the beginning and ending addresses through 8513 <code>start_location_ptr</code> and <code>end_location_ptr</code>. In a 8514 conventional byte code indexing scheme, 8515 <code>start_location_ptr</code> will always point to zero 8516 and <code>end_location_ptr</code> 8517 will always point to the byte code count minus one. 8518 </description> 8519 <origin>jvmdi</origin> 8520 <capabilities> 8521 </capabilities> 8522 <parameters> 8523 <param id="klass"> 8524 <jclass method="method"/> 8525 <description> 8526 The class to query. 8527 </description> 8528 </param> 8529 <param id="method"> 8530 <jmethodID class="klass" native="error"/> 8531 <description> 8532 The method to query. 8533 </description> 8534 </param> 8535 <param id="start_location_ptr"> 8536 <outptr><jlocation/></outptr> 8537 <description> 8538 On return, points to the first location, or 8539 <code>-1</code> if location information is not available. 8540 If the information is available and 8541 <functionlink id="GetJLocationFormat"></functionlink> 8542 returns <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink> 8543 then this will always be zero. 8544 </description> 8545 </param> 8546 <param id="end_location_ptr"> 8547 <outptr><jlocation/></outptr> 8548 <description> 8549 On return, points to the last location, 8550 or <code>-1</code> if location information is not available. 8551 </description> 8552 </param> 8553 </parameters> 8554 <errors> 8555 <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 8556 Class information does not include method sizes. 8557 </error> 8558 </errors> 8559 </function> 8560 8561 <function id="GetLocalVariableTable" num="72"> 8562 <synopsis>Get Local Variable Table</synopsis> 8563 <typedef id="jvmtiLocalVariableEntry" label="Local variable table entry"> 8564 <field id="start_location"> 8565 <jlocation/> 8566 <description> 8567 The code array index where the local variable is first valid 8568 (that is, where it must have a value). 8569 </description> 8570 </field> 8571 <field id="length"> 8572 <jint/> 8573 <description> 8574 The length of the valid section for this local variable. 8575 The last code array index where the local variable is valid 8576 is <code>start_location + length</code>. 8577 </description> 8578 </field> 8579 <field id="name"> 8580 <allocfieldbuf><char/></allocfieldbuf> 8581 <description> 8582 The local variable name, encoded as a 8583 <internallink id="mUTF">modified UTF-8</internallink> string. 8584 </description> 8585 </field> 8586 <field id="signature"> 8587 <allocfieldbuf><char/></allocfieldbuf> 8588 <description> 8589 The local variable's type signature, encoded as a 8590 <internallink id="mUTF">modified UTF-8</internallink> string. 8591 The signature format is the same as that defined in 8592 <vmspec chapter="4.3.2"/>. 8593 </description> 8594 </field> 8595 <field id="generic_signature"> 8596 <allocfieldbuf><char/></allocfieldbuf> 8597 <description> 8598 The local variable's generic signature, encoded as a 8599 <internallink id="mUTF">modified UTF-8</internallink> string. 8600 The value of this field will be <code>NULL</code> for any local 8601 variable which does not have a generic type. 8602 </description> 8603 </field> 8604 <field id="slot"> 8605 <jint/> 8606 <description> 8607 The local variable's slot. See <internallink id="local">Local Variables</internallink>. 8608 </description> 8609 </field> 8610 </typedef> 8611 <description> 8612 Return local variable information. 8613 </description> 8614 <origin>jvmdiClone</origin> 8615 <capabilities> 8616 <required id="can_access_local_variables"></required> 8617 </capabilities> 8618 <parameters> 8619 <param id="method"> 8620 <jmethodID native="error"/> 8621 <description> 8622 The method to query. 8623 </description> 8624 </param> 8625 <param id="entry_count_ptr"> 8626 <outptr><jint/></outptr> 8627 <description> 8628 On return, points to the number of entries in the table 8629 </description> 8630 </param> 8631 <param id="table_ptr"> 8632 <allocbuf outcount="entry_count_ptr"><struct>jvmtiLocalVariableEntry</struct></allocbuf> 8633 <description> 8634 On return, points to an array of local variable table entries. 8635 </description> 8636 </param> 8637 </parameters> 8638 <errors> 8639 <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 8640 Class information does not include local variable 8641 information. 8642 </error> 8643 </errors> 8644 </function> 8645 8646 <function id="GetBytecodes" phase="start" num="75"> 8647 <synopsis>Get Bytecodes</synopsis> 8648 <description> 8649 For the method indicated by <code>method</code>, 8650 return the byte codes that implement the method. The number of 8651 bytecodes is returned via <code>bytecode_count_ptr</code>. The byte codes 8652 themselves are returned via <code>bytecodes_ptr</code>. 8653 </description> 8654 <origin>jvmdi</origin> 8655 <capabilities> 8656 <required id="can_get_bytecodes"></required> 8657 </capabilities> 8658 <parameters> 8659 <param id="klass"> 8660 <jclass method="method"/> 8661 <description> 8662 The class to query. 8663 </description> 8664 </param> 8665 <param id="method"> 8666 <jmethodID class="klass" native="error"/> 8667 <description> 8668 The method to query. 8669 </description> 8670 </param> 8671 <param id="bytecode_count_ptr"> 8672 <outptr><jint/></outptr> 8673 <description> 8674 On return, points to the length of the byte code array 8675 </description> 8676 </param> 8677 <param id="bytecodes_ptr"> 8678 <allocbuf outcount="bytecode_count_ptr"><uchar/></allocbuf> 8679 <description> 8680 On return, points to the pointer to the byte code array 8681 </description> 8682 </param> 8683 </parameters> 8684 <errors> 8685 </errors> 8686 </function> 8687 8688 <function id="IsMethodNative" phase="start" num="76"> 8689 <synopsis>Is Method Native</synopsis> 8690 <description> 8691 For the method indicated by <code>method</code>, return a 8692 value indicating whether the method is native via <code>is_native_ptr</code> 8693 </description> 8694 <origin>jvmdi</origin> 8695 <capabilities> 8696 </capabilities> 8697 <parameters> 8698 <param id="klass"> 8699 <jclass method="method"/> 8700 <description> 8701 The class to query. 8702 </description> 8703 </param> 8704 <param id="method"> 8705 <jmethodID class="klass"/> 8706 <description> 8707 The method to query. 8708 </description> 8709 </param> 8710 <param id="is_native_ptr"> 8711 <outptr><jboolean/></outptr> 8712 <description> 8713 On return, points to the boolean result of this function. 8714 </description> 8715 </param> 8716 </parameters> 8717 <errors> 8718 </errors> 8719 </function> 8720 8721 <function id="IsMethodSynthetic" phase="start" num="77"> 8722 <synopsis>Is Method Synthetic</synopsis> 8723 <description> 8724 For the method indicated by <code>method</code>, return a 8725 value indicating whether the method is synthetic via <code>is_synthetic_ptr</code>. 8726 Synthetic methods are generated by the compiler but not present in the 8727 original source code. 8728 </description> 8729 <origin>jvmdi</origin> 8730 <capabilities> 8731 <required id="can_get_synthetic_attribute"></required> 8732 </capabilities> 8733 <parameters> 8734 <param id="klass"> 8735 <jclass method="method"/> 8736 <description> 8737 The class to query. 8738 </description> 8739 </param> 8740 <param id="method"> 8741 <jmethodID class="klass"/> 8742 <description> 8743 The method to query. 8744 </description> 8745 </param> 8746 <param id="is_synthetic_ptr"> 8747 <outptr><jboolean/></outptr> 8748 <description> 8749 On return, points to the boolean result of this function. 8750 </description> 8751 </param> 8752 </parameters> 8753 <errors> 8754 </errors> 8755 </function> 8756 8757 <function id="IsMethodObsolete" phase="start" num="91"> 8758 <synopsis>Is Method Obsolete</synopsis> 8759 <description> 8760 Determine if a method ID refers to an 8761 <internallink id="obsoleteMethods">obsolete</internallink> 8762 method version. 8763 </description> 8764 <origin>jvmdi</origin> 8765 <capabilities> 8766 </capabilities> 8767 <parameters> 8768 <param id="klass"> 8769 <jclass method="method"/> 8770 <description> 8771 The class to query. 8772 </description> 8773 </param> 8774 <param id="method"> 8775 <jmethodID class="klass"/> 8776 <description> 8777 The method ID to query. 8778 </description> 8779 </param> 8780 <param id="is_obsolete_ptr"> 8781 <outptr><jboolean/></outptr> 8782 <description> 8783 On return, points to the boolean result of this function. 8784 </description> 8785 </param> 8786 </parameters> 8787 <errors> 8788 </errors> 8789 </function> 8790 8791 <function id="SetNativeMethodPrefix" jkernel="yes" phase="any" num="73" since="1.1"> 8792 <synopsis>Set Native Method Prefix</synopsis> 8793 <description> 8794 This function modifies the failure handling of 8795 native method resolution by allowing retry 8796 with a prefix applied to the name. 8797 When used with the 8798 <eventlink id="ClassFileLoadHook">ClassFileLoadHook 8799 event</eventlink>, it enables native methods to be 8800 <internallink id="bci">instrumented</internallink>. 8801 <p/> 8802 Since native methods cannot be directly instrumented 8803 (they have no bytecodes), they must be wrapped with 8804 a non-native method which can be instrumented. 8805 For example, if we had: 8806 <example> 8807 native boolean foo(int x);</example> 8808 <p/> 8809 We could transform the class file (with the 8810 ClassFileLoadHook event) so that this becomes: 8811 <example> 8812 boolean foo(int x) { 8813 <i>... record entry to foo ...</i> 8814 return wrapped_foo(x); 8815 } 8816 8817 native boolean wrapped_foo(int x);</example> 8818 <p/> 8819 Where foo becomes a wrapper for the actual native method 8820 with the appended prefix "wrapped_". Note that 8821 "wrapped_" would be a poor choice of prefix since it 8822 might conceivably form the name of an existing method 8823 thus something like "$$$MyAgentWrapped$$$_" would be 8824 better but would make these examples less readable. 8825 <p/> 8826 The wrapper will allow data to be collected on the native 8827 method call, but now the problem becomes linking up the 8828 wrapped method with the native implementation. 8829 That is, the method <code>wrapped_foo</code> needs to be 8830 resolved to the native implementation of <code>foo</code>, 8831 which might be: 8832 <example> 8833 Java_somePackage_someClass_foo(JNIEnv* env, jint x)</example> 8834 <p/> 8835 This function allows the prefix to be specified and the 8836 proper resolution to occur. 8837 Specifically, when the standard resolution fails, the 8838 resolution is retried taking the prefix into consideration. 8839 There are two ways that resolution occurs, explicit 8840 resolution with the JNI function <code>RegisterNatives</code> 8841 and the normal automatic resolution. For 8842 <code>RegisterNatives</code>, the VM will attempt this 8843 association: 8844 <example> 8845 method(foo) -> nativeImplementation(foo)</example> 8846 <p/> 8847 When this fails, the resolution will be retried with 8848 the specified prefix prepended to the method name, 8849 yielding the correct resolution: 8850 <example> 8851 method(wrapped_foo) -> nativeImplementation(foo)</example> 8852 <p/> 8853 For automatic resolution, the VM will attempt: 8854 <example> 8855 method(wrapped_foo) -> nativeImplementation(wrapped_foo)</example> 8856 <p/> 8857 When this fails, the resolution will be retried with 8858 the specified prefix deleted from the implementation name, 8859 yielding the correct resolution: 8860 <example> 8861 method(wrapped_foo) -> nativeImplementation(foo)</example> 8862 <p/> 8863 Note that since the prefix is only used when standard 8864 resolution fails, native methods can be wrapped selectively. 8865 <p/> 8866 Since each <jvmti/> environment is independent and 8867 can do its own transformation of the bytecodes, more 8868 than one layer of wrappers may be applied. Thus each 8869 environment needs its own prefix. Since transformations 8870 are applied in order, the prefixes, if applied, will 8871 be applied in the same order. 8872 The order of transformation application is described in 8873 the <eventlink id="ClassFileLoadHook"/> event. 8874 Thus if three environments applied 8875 wrappers, <code>foo</code> might become 8876 <code>$env3_$env2_$env1_foo</code>. But if, say, 8877 the second environment did not apply a wrapper to 8878 <code>foo</code> it would be just 8879 <code>$env3_$env1_foo</code>. To be able to 8880 efficiently determine the sequence of prefixes, 8881 an intermediate prefix is only applied if its non-native 8882 wrapper exists. Thus, in the last example, even though 8883 <code>$env1_foo</code> is not a native method, the 8884 <code>$env1_</code> prefix is applied since 8885 <code>$env1_foo</code> exists. 8886 <p/> 8887 Since the prefixes are used at resolution time 8888 and since resolution may be arbitrarily delayed, a 8889 native method prefix must remain set as long as there 8890 are corresponding prefixed native methods. 8891 </description> 8892 <origin>new</origin> 8893 <capabilities> 8894 <required id="can_set_native_method_prefix"></required> 8895 </capabilities> 8896 <parameters> 8897 <param id="prefix"> 8898 <inbuf> 8899 <char/> 8900 <nullok> 8901 any existing prefix in this environment is cancelled 8902 </nullok> 8903 </inbuf> 8904 <description> 8905 The prefix to apply, encoded as a 8906 <internallink id="mUTF">modified UTF-8</internallink> string. 8907 </description> 8908 </param> 8909 </parameters> 8910 <errors> 8911 </errors> 8912 </function> 8913 8914 <function id="SetNativeMethodPrefixes" jkernel="yes" phase="any" num="74" since="1.1"> 8915 <synopsis>Set Native Method Prefixes</synopsis> 8916 <description> 8917 For a normal agent, <functionlink id="SetNativeMethodPrefix"/> 8918 will provide all needed native method prefixing. 8919 For a meta-agent that performs multiple independent class 8920 file transformations (for example as a proxy for another 8921 layer of agents) this function allows each transformation 8922 to have its own prefix. 8923 The prefixes are applied in the order supplied and are 8924 processed in the same manor as described for the 8925 application of prefixes from multiple <jvmti/> environments 8926 in <functionlink id="SetNativeMethodPrefix"/>. 8927 <p/> 8928 Any previous prefixes are replaced. Thus, calling this 8929 function with a <paramlink id="prefix_count"/> of <code>0</code> 8930 disables prefixing in this environment. 8931 <p/> 8932 <functionlink id="SetNativeMethodPrefix"/> and this function 8933 are the two ways to set the prefixes. 8934 Calling <code>SetNativeMethodPrefix</code> with 8935 a prefix is the same as calling this function with 8936 <paramlink id="prefix_count"/> of <code>1</code>. 8937 Calling <code>SetNativeMethodPrefix</code> with 8938 <code>NULL</code> is the same as calling this function with 8939 <paramlink id="prefix_count"/> of <code>0</code>. 8940 </description> 8941 <origin>new</origin> 8942 <capabilities> 8943 <required id="can_set_native_method_prefix"></required> 8944 </capabilities> 8945 <parameters> 8946 <param id="prefix_count"> 8947 <jint min="0"/> 8948 <description> 8949 The number of prefixes to apply. 8950 </description> 8951 </param> 8952 <param id="prefixes"> 8953 <agentbuf> 8954 <char/> 8955 </agentbuf> 8956 <description> 8957 The prefixes to apply for this environment, each encoded as a 8958 <internallink id="mUTF">modified UTF-8</internallink> string. 8959 </description> 8960 </param> 8961 </parameters> 8962 <errors> 8963 </errors> 8964 </function> 8965 8966 </category> 8967 8968 <category id="RawMonitors" label="Raw Monitor"> 8969 8970 <function id="CreateRawMonitor" phase="onload" callbacksafe="safe" num="31"> 8971 <synopsis>Create Raw Monitor</synopsis> 8972 <description> 8973 Create a raw monitor. 8974 </description> 8975 <origin>jvmdi</origin> 8976 <capabilities> 8977 </capabilities> 8978 <parameters> 8979 <param id="name"> 8980 <inbuf><char/></inbuf> 8981 <description> 8982 A name to identify the monitor, encoded as a 8983 <internallink id="mUTF">modified UTF-8</internallink> string. 8984 </description> 8985 </param> 8986 <param id="monitor_ptr"> 8987 <outptr><jrawMonitorID/></outptr> 8988 <description> 8989 On return, points to the created monitor. 8990 </description> 8991 </param> 8992 </parameters> 8993 <errors> 8994 </errors> 8995 </function> 8996 8997 <function id="DestroyRawMonitor" phase="onload" callbacksafe="safe" num="32"> 8998 <synopsis>Destroy Raw Monitor</synopsis> 8999 <description> 9000 Destroy the raw monitor. 9001 If the monitor being destroyed has been entered by this thread, it will be 9002 exited before it is destroyed. 9003 If the monitor being destroyed has been entered by another thread, 9004 an error will be returned and the monitor will not be destroyed. 9005 </description> 9006 <origin>jvmdi</origin> 9007 <capabilities> 9008 </capabilities> 9009 <parameters> 9010 <param id="monitor"> 9011 <jrawMonitorID/> 9012 <description> 9013 The monitor 9014 </description> 9015 </param> 9016 </parameters> 9017 <errors> 9018 <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 9019 Not monitor owner 9020 </error> 9021 </errors> 9022 </function> 9023 9024 <function id="RawMonitorEnter" phase="any" callbacksafe="safe" impl="innative notrace" num="33"> 9025 <synopsis>Raw Monitor Enter</synopsis> 9026 <description> 9027 Gain exclusive ownership of a raw monitor. 9028 The same thread may enter a monitor more then once. 9029 The thread must 9030 <functionlink id="RawMonitorExit">exit</functionlink> 9031 the monitor the same number of times as it is entered. 9032 If a monitor is entered during <code>OnLoad</code> (before attached threads exist) 9033 and has not exited when attached threads come into existence, the enter 9034 is considered to have occurred on the main thread. 9035 </description> 9036 <origin>jvmdi</origin> 9037 <capabilities> 9038 </capabilities> 9039 <parameters> 9040 <param id="monitor"> 9041 <jrawMonitorID/> 9042 <description> 9043 The monitor 9044 </description> 9045 </param> 9046 </parameters> 9047 <errors> 9048 </errors> 9049 </function> 9050 9051 <function id="RawMonitorExit" phase="any" callbacksafe="safe" impl="innative notrace" num="34"> 9052 <synopsis>Raw Monitor Exit</synopsis> 9053 <description> 9054 Release exclusive ownership of a raw monitor. 9055 </description> 9056 <origin>jvmdi</origin> 9057 <capabilities> 9058 </capabilities> 9059 <parameters> 9060 <param id="monitor"> 9061 <jrawMonitorID/> 9062 <description> 9063 The monitor 9064 </description> 9065 </param> 9066 </parameters> 9067 <errors> 9068 <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 9069 Not monitor owner 9070 </error> 9071 </errors> 9072 </function> 9073 9074 <function id="RawMonitorWait" phase="any" callbacksafe="safe" impl="innative notrace" num="35"> 9075 <synopsis>Raw Monitor Wait</synopsis> 9076 <description> 9077 Wait for notification of the raw monitor. 9078 <p/> 9079 Causes the current thread to wait until either another thread calls 9080 <functionlink id="RawMonitorNotify"/> or 9081 <functionlink id="RawMonitorNotifyAll"/> 9082 for the specified raw monitor, or the specified 9083 <paramlink id="millis">timeout</paramlink> 9084 has elapsed. 9085 </description> 9086 <origin>jvmdi</origin> 9087 <capabilities> 9088 </capabilities> 9089 <parameters> 9090 <param id="monitor"> 9091 <jrawMonitorID/> 9092 <description> 9093 The monitor 9094 </description> 9095 </param> 9096 <param id="millis"> 9097 <jlong/> 9098 <description> 9099 The timeout, in milliseconds. If the timeout is 9100 zero, then real time is not taken into consideration 9101 and the thread simply waits until notified. 9102 </description> 9103 </param> 9104 </parameters> 9105 <errors> 9106 <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 9107 Not monitor owner 9108 </error> 9109 <error id="JVMTI_ERROR_INTERRUPT"> 9110 Wait was interrupted, try again 9111 </error> 9112 </errors> 9113 </function> 9114 9115 <function id="RawMonitorNotify" phase="any" callbacksafe="safe" impl="notrace" num="36"> 9116 <synopsis>Raw Monitor Notify</synopsis> 9117 <description> 9118 Notify a single thread waiting on the raw monitor. 9119 </description> 9120 <origin>jvmdi</origin> 9121 <capabilities> 9122 </capabilities> 9123 <parameters> 9124 <param id="monitor"> 9125 <jrawMonitorID/> 9126 <description> 9127 The monitor 9128 </description> 9129 </param> 9130 </parameters> 9131 <errors> 9132 <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 9133 Not monitor owner 9134 </error> 9135 </errors> 9136 </function> 9137 9138 <function id="RawMonitorNotifyAll" phase="any" callbacksafe="safe" impl="notrace" num="37"> 9139 <synopsis>Raw Monitor Notify All</synopsis> 9140 <description> 9141 Notify all threads waiting on the raw monitor. 9142 </description> 9143 <origin>jvmdi</origin> 9144 <capabilities> 9145 </capabilities> 9146 <parameters> 9147 <param id="monitor"> 9148 <jrawMonitorID/> 9149 <description> 9150 The monitor 9151 </description> 9152 </param> 9153 </parameters> 9154 <errors> 9155 <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 9156 Not monitor owner 9157 </error> 9158 </errors> 9159 </function> 9160 9161 <elide> 9162 <function id="GetRawMonitorUse" num="118"> 9163 <synopsis>Get Raw Monitor Use</synopsis> 9164 <description> 9165 The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure 9166 are filled in with information about usage of the raw monitor. 9167 </description> 9168 <origin>new</origin> 9169 <capabilities> 9170 <required id="can_get_raw_monitor_usage"></required> 9171 </capabilities> 9172 <parameters> 9173 <param id="monitor"> 9174 <jrawMonitorID/> 9175 <description> 9176 the raw monitor to query. 9177 </description> 9178 </param> 9179 <param id="info_ptr"> 9180 <outptr><struct>jvmtiMonitorUsage</struct></outptr> 9181 <description> 9182 On return, filled with monitor information for the 9183 specified raw monitor. 9184 </description> 9185 </param> 9186 </parameters> 9187 <errors> 9188 </errors> 9189 </function> 9190 9191 <function id="GetRawMonitors" num="119"> 9192 <synopsis>Get Raw Monitors</synopsis> 9193 <description> 9194 Return the list of raw monitors. 9195 <p/> 9196 Note: details about each monitor can be examined with 9197 <functionlink id="GetRawMonitorUse"></functionlink>. 9198 </description> 9199 <origin>new</origin> 9200 <capabilities> 9201 <required id="can_get_raw_monitor_usage"></required> 9202 </capabilities> 9203 <parameters> 9204 <param id="monitorCnt"> 9205 <outptr><jint/></outptr> 9206 <description> 9207 On return, pointer to the number 9208 of monitors returned in <code>monitors_ptr</code>. 9209 </description> 9210 </param> 9211 <param id="monitors_ptr"> 9212 <allocbuf outcount="monitorCnt"><jrawMonitorID/></allocbuf> 9213 <description> 9214 On return, pointer to the monitor list. 9215 </description> 9216 </param> 9217 </parameters> 9218 <errors> 9219 </errors> 9220 </function> 9221 </elide> 9222 </category> 9223 9224 <category id="jniIntercept" label="JNI Function Interception"> 9225 9226 <intro> 9227 Provides the ability to intercept and resend 9228 Java Native Interface (JNI) function calls 9229 by manipulating the JNI function table. 9230 See <externallink id="jni/functions.html">JNI 9231 Functions</externallink> in the <i>Java Native Interface Specification</i>. 9232 <p/> 9233 The following example illustrates intercepting the 9234 <code>NewGlobalRef</code> JNI call in order to count reference 9235 creation. 9236 <example> 9237 JNIEnv original_jni_Functions; 9238 JNIEnv redirected_jni_Functions; 9239 int my_global_ref_count = 0; 9240 9241 jobject 9242 MyNewGlobalRef(JNIEnv *jni_env, jobject lobj) { 9243 ++my_global_ref_count; 9244 return originalJNIFunctions->NewGlobalRef(env, lobj); 9245 } 9246 9247 void 9248 myInit() { 9249 jvmtiError err; 9250 9251 err = (*jvmti_env)->GetJNIFunctionTable(jvmti_env, &original_jni_Functions); 9252 if (err != JVMTI_ERROR_NONE) { 9253 die(); 9254 } 9255 err = (*jvmti_env)->GetJNIFunctionTable(jvmti_env, &redirected_jni_Functions); 9256 if (err != JVMTI_ERROR_NONE) { 9257 die(); 9258 } 9259 redirectedJNIFunctions->NewGlobalRef = MyNewGlobalRef; 9260 err = (*jvmti_env)->SetJNIFunctionTable(jvmti_env, redirected_jni_Functions); 9261 if (err != JVMTI_ERROR_NONE) { 9262 die(); 9263 } 9264 } 9265 </example> 9266 Sometime after <code>myInit</code> is called the user's JNI 9267 code is executed which makes the call to create a new global 9268 reference. Instead of going to the normal JNI implementation 9269 the call goes to <code>myNewGlobalRef</code>. Note that a 9270 copy of the original function table is kept so that the normal 9271 JNI function can be called after the data is collected. 9272 Note also that any JNI functions which are not overwritten 9273 will behave normally. 9274 <todo> 9275 check that the example compiles and executes. 9276 </todo> 9277 </intro> 9278 9279 <function id="SetJNIFunctionTable" phase="start" num="120"> 9280 <synopsis>Set JNI Function Table</synopsis> 9281 <description> 9282 Set the JNI function table 9283 in all current and future JNI environments. 9284 As a result, all future JNI calls are directed to the specified functions. 9285 Use <functionlink id="GetJNIFunctionTable"></functionlink> to get the 9286 function table to pass to this function. 9287 For this function to take effect the the updated table entries must be 9288 used by the JNI clients. 9289 Since the table is defined <code>const</code> some compilers may optimize 9290 away the access to the table, thus preventing this function from taking 9291 effect. 9292 The table is copied--changes to the local copy of the 9293 table have no effect. 9294 This function affects only the function table, all other aspects of the environment are 9295 unaffected. 9296 See the examples <internallink id="jniIntercept">above</internallink>. 9297 </description> 9298 <origin>new</origin> 9299 <capabilities> 9300 </capabilities> 9301 <parameters> 9302 <param id="function_table"> 9303 <inptr> 9304 <struct>jniNativeInterface</struct> 9305 </inptr> 9306 <description> 9307 Points to the new JNI function table. 9308 </description> 9309 </param> 9310 </parameters> 9311 <errors> 9312 </errors> 9313 </function> 9314 9315 <function id="GetJNIFunctionTable" phase="start" num="121"> 9316 <synopsis>Get JNI Function Table</synopsis> 9317 <description> 9318 Get the JNI function table. 9319 The JNI function table is copied into allocated memory. 9320 If <functionlink id="SetJNIFunctionTable"></functionlink> 9321 has been called, the modified (not the original) function 9322 table is returned. 9323 Only the function table is copied, no other aspects of the environment 9324 are copied. 9325 See the examples <internallink id="jniIntercept">above</internallink>. 9326 </description> 9327 <origin>new</origin> 9328 <capabilities> 9329 </capabilities> 9330 <parameters> 9331 <param id="function_table"> 9332 <allocbuf> 9333 <struct>jniNativeInterface</struct> 9334 </allocbuf> 9335 <description> 9336 On return, <code>*function_table</code> 9337 points a newly allocated copy of the JNI function table. 9338 </description> 9339 </param> 9340 </parameters> 9341 <errors> 9342 </errors> 9343 </function> 9344 9345 </category> 9346 9347 <category id="eventManagement" label="Event Management"> 9348 9349 <function id="SetEventCallbacks" jkernel="yes" phase="onload" num="122"> 9350 <synopsis>Set Event Callbacks</synopsis> 9351 <description> 9352 Set the functions to be called for each event. 9353 The callbacks are specified by supplying a replacement function table. 9354 The function table is copied--changes to the local copy of the 9355 table have no effect. 9356 This is an atomic action, all callbacks are set at once. 9357 No events are sent before this function is called. 9358 When an entry is <code>NULL</code> or when the event is beyond 9359 <paramlink id="size_of_callbacks"></paramlink> no event is sent. 9360 Details on events are 9361 described <internallink id="EventSection">later</internallink> in this document. 9362 An event must be enabled and have a callback in order to be 9363 sent--the order in which this function and 9364 <functionlink id="SetEventNotificationMode"></functionlink> 9365 are called does not affect the result. 9366 </description> 9367 <origin>new</origin> 9368 <capabilities> 9369 </capabilities> 9370 <parameters> 9371 <param id="callbacks"> 9372 <inptr> 9373 <struct>jvmtiEventCallbacks</struct> 9374 <nullok>remove the existing callbacks</nullok> 9375 </inptr> 9376 <description> 9377 The new event callbacks. 9378 </description> 9379 </param> 9380 <param id="size_of_callbacks"> 9381 <jint min="0"/> 9382 <description> 9383 <code>sizeof(jvmtiEventCallbacks)</code>--for version 9384 compatibility. 9385 </description> 9386 </param> 9387 </parameters> 9388 <errors> 9389 </errors> 9390 </function> 9391 9392 <function id="SetEventNotificationMode" jkernel="yes" phase="onload" num="2"> 9393 <synopsis>Set Event Notification Mode</synopsis> 9394 <description> 9395 Control the generation of events. 9396 <constants id="jvmtiEventMode" label="Event Enable/Disable" kind="enum"> 9397 <constant id="JVMTI_ENABLE" num="1"> 9398 If <paramlink id="mode"></paramlink> is <code>JVMTI_ENABLE</code>, 9399 the event <paramlink id="event_type"></paramlink> will be enabled 9400 </constant> 9401 <constant id="JVMTI_DISABLE" num="0"> 9402 If <paramlink id="mode"></paramlink> is <code>JVMTI_DISABLE</code>, 9403 the event <paramlink id="event_type"></paramlink> will be disabled 9404 </constant> 9405 </constants> 9406 If <code>thread</code> is <code>NULL</code>, 9407 the event is enabled or disabled globally; otherwise, it is 9408 enabled or disabled for a particular thread. 9409 An event is generated for 9410 a particular thread if it is enabled either at the thread or global 9411 levels. 9412 <p/> 9413 See <internallink id="EventIndex">below</internallink> for information on specific events. 9414 <p/> 9415 The following events cannot be controlled at the thread 9416 level through this function. 9417 <ul> 9418 <li><eventlink id="VMInit"></eventlink></li> 9419 <li><eventlink id="VMStart"></eventlink></li> 9420 <li><eventlink id="VMDeath"></eventlink></li> 9421 <li><eventlink id="ThreadStart"></eventlink></li> 9422 <li><eventlink id="CompiledMethodLoad"></eventlink></li> 9423 <li><eventlink id="CompiledMethodUnload"></eventlink></li> 9424 <li><eventlink id="DynamicCodeGenerated"></eventlink></li> 9425 <li><eventlink id="DataDumpRequest"></eventlink></li> 9426 </ul> 9427 <p/> 9428 Initially, no events are enabled at either the thread level 9429 or the global level. 9430 <p/> 9431 Any needed capabilities (see Event Enabling Capabilities below) must be possessed 9432 before calling this function. 9433 <p/> 9434 Details on events are 9435 described <internallink id="EventSection">below</internallink>. 9436 </description> 9437 <origin>jvmdiClone</origin> 9438 <eventcapabilities></eventcapabilities> 9439 <parameters> 9440 <param id="mode"> 9441 <enum>jvmtiEventMode</enum> 9442 <description> 9443 <code>JVMTI_ENABLE</code> or <code>JVMTI_DISABLE</code> 9444 </description> 9445 </param> 9446 <param id="event_type"> 9447 <enum>jvmtiEvent</enum> 9448 <description> 9449 the event to control 9450 </description> 9451 </param> 9452 <param id="event_thread"> 9453 <ptrtype> 9454 <jthread impl="noconvert"/> 9455 <nullok>event is controlled at the global level</nullok> 9456 </ptrtype> 9457 <description> 9458 The thread to control 9459 </description> 9460 </param> 9461 <param id="..."> 9462 <varargs/> 9463 <description> 9464 for future expansion 9465 </description> 9466 </param> 9467 </parameters> 9468 <errors> 9469 <error id="JVMTI_ERROR_INVALID_THREAD"> 9470 <paramlink id="event_thread"/> is non-<code>NULL</code> and is not a valid thread. 9471 </error> 9472 <error id="JVMTI_ERROR_THREAD_NOT_ALIVE"> 9473 <paramlink id="event_thread"/> is non-<code>NULL</code> and is not live (has not been started or is now dead). 9474 </error> 9475 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 9476 thread level control was attempted on events which do not 9477 permit thread level control. 9478 </error> 9479 <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY"> 9480 The Required Event Enabling Capability is not possessed. 9481 </error> 9482 </errors> 9483 </function> 9484 9485 <function id="GenerateEvents" num="123"> 9486 <synopsis>Generate Events</synopsis> 9487 <description> 9488 Generate events to represent the current state of the VM. 9489 For example, if <paramlink id="event_type"/> is 9490 <code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code>, 9491 a <eventlink id="CompiledMethodLoad"></eventlink> event will be 9492 sent for each currently compiled method. 9493 Methods that were loaded and now have been unloaded are not sent. 9494 The history of what events have previously been sent does not 9495 effect what events are sent by this function--for example, 9496 all currently compiled methods 9497 will be sent each time this function is called. 9498 <p/> 9499 This function is useful when 9500 events may have been missed due to the agent attaching after program 9501 execution begins; this function generates the missed events. 9502 <p/> 9503 Attempts to execute Java programming language code or 9504 JNI functions may be paused until this function returns - 9505 so neither should be called from the thread sending the event. 9506 This function returns only after the missed events have been 9507 sent, processed and have returned. 9508 The event may be sent on a different thread than the thread 9509 on which the event occurred. 9510 The callback for the event must be set with 9511 <functionlink id="SetEventCallbacks"></functionlink> 9512 and the event must be enabled with 9513 <functionlink id="SetEventNotificationMode"></functionlink> 9514 or the events will not occur. 9515 If the VM no longer has the information to generate some or 9516 all of the requested events, the events are simply not sent - 9517 no error is returned. 9518 <p/> 9519 Only the following events are supported: 9520 <ul> 9521 <li><eventlink id="CompiledMethodLoad"></eventlink></li> 9522 <li><eventlink id="DynamicCodeGenerated"></eventlink></li> 9523 </ul> 9524 </description> 9525 <origin>new</origin> 9526 <capabilities> 9527 <capability id="can_generate_compiled_method_load_events"></capability> 9528 </capabilities> 9529 <parameters> 9530 <param id="event_type"> 9531 <enum>jvmtiEvent</enum> 9532 <description> 9533 The type of event to generate. Must be one of these: 9534 <ul> 9535 <li><eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink></li> 9536 <li><eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink></li> 9537 </ul> 9538 </description> 9539 </param> 9540 </parameters> 9541 <errors> 9542 <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY"> 9543 <paramlink id="event_type"/> is 9544 <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink> 9545 and <fieldlink id="can_generate_compiled_method_load_events" struct="jvmtiCapabilities"></fieldlink> 9546 is <code>false</code>. 9547 </error> 9548 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 9549 <paramlink id="event_type"/> is other than 9550 <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink> 9551 or <eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink>. 9552 </error> 9553 </errors> 9554 </function> 9555 9556 </category> 9557 9558 <category id="extension" label="Extension Mechanism"> 9559 9560 <intro> 9561 These functions 9562 allow a <jvmti/> implementation to provide functions and events 9563 beyond those defined in this specification. 9564 <p/> 9565 Both extension functions and extension events have parameters 9566 each of which has a 'type' and 'kind' chosen from the following tables: 9567 9568 <constants id="jvmtiParamTypes" label="Extension Function/Event Parameter Types" kind="enum"> 9569 <constant id="JVMTI_TYPE_JBYTE" num="101"> 9570 Java programming language primitive type - <code>byte</code>. 9571 JNI type <code>jbyte</code>. 9572 </constant> 9573 <constant id="JVMTI_TYPE_JCHAR" num="102"> 9574 Java programming language primitive type - <code>char</code>. 9575 JNI type <code>jchar</code>. 9576 </constant> 9577 <constant id="JVMTI_TYPE_JSHORT" num="103"> 9578 Java programming language primitive type - <code>short</code>. 9579 JNI type <code>jshort</code>. 9580 </constant> 9581 <constant id="JVMTI_TYPE_JINT" num="104"> 9582 Java programming language primitive type - <code>int</code>. 9583 JNI type <datalink id="jint"></datalink>. 9584 </constant> 9585 <constant id="JVMTI_TYPE_JLONG" num="105"> 9586 Java programming language primitive type - <code>long</code>. 9587 JNI type <datalink id="jlong"></datalink>. 9588 </constant> 9589 <constant id="JVMTI_TYPE_JFLOAT" num="106"> 9590 Java programming language primitive type - <code>float</code>. 9591 JNI type <datalink id="jfloat"></datalink>. 9592 </constant> 9593 <constant id="JVMTI_TYPE_JDOUBLE" num="107"> 9594 Java programming language primitive type - <code>double</code>. 9595 JNI type <datalink id="jdouble"></datalink>. 9596 </constant> 9597 <constant id="JVMTI_TYPE_JBOOLEAN" num="108"> 9598 Java programming language primitive type - <code>boolean</code>. 9599 JNI type <datalink id="jboolean"></datalink>. 9600 </constant> 9601 <constant id="JVMTI_TYPE_JOBJECT" num="109"> 9602 Java programming language object type - <code>java.lang.Object</code>. 9603 JNI type <datalink id="jobject"></datalink>. 9604 Returned values are JNI local references and must be managed. 9605 </constant> 9606 <constant id="JVMTI_TYPE_JTHREAD" num="110"> 9607 Java programming language object type - <code>java.lang.Thread</code>. 9608 <jvmti/> type <datalink id="jthread"></datalink>. 9609 Returned values are JNI local references and must be managed. 9610 </constant> 9611 <constant id="JVMTI_TYPE_JCLASS" num="111"> 9612 Java programming language object type - <code>java.lang.Class</code>. 9613 JNI type <datalink id="jclass"></datalink>. 9614 Returned values are JNI local references and must be managed. 9615 </constant> 9616 <constant id="JVMTI_TYPE_JVALUE" num="112"> 9617 Union of all Java programming language primitive and object types - 9618 JNI type <datalink id="jvalue"></datalink>. 9619 Returned values which represent object types are JNI local references and must be managed. 9620 </constant> 9621 <constant id="JVMTI_TYPE_JFIELDID" num="113"> 9622 Java programming language field identifier - 9623 JNI type <datalink id="jfieldID"></datalink>. 9624 </constant> 9625 <constant id="JVMTI_TYPE_JMETHODID" num="114"> 9626 Java programming language method identifier - 9627 JNI type <datalink id="jmethodID"></datalink>. 9628 </constant> 9629 <constant id="JVMTI_TYPE_CCHAR" num="115"> 9630 C programming language type - <code>char</code>. 9631 </constant> 9632 <constant id="JVMTI_TYPE_CVOID" num="116"> 9633 C programming language type - <code>void</code>. 9634 </constant> 9635 <constant id="JVMTI_TYPE_JNIENV" num="117"> 9636 JNI environment - <code>JNIEnv</code>. 9637 Should be used with the correct <datalink id="jvmtiParamKind"/> to make it a pointer type. 9638 </constant> 9639 </constants> 9640 9641 <constants id="jvmtiParamKind" label="Extension Function/Event Parameter Kinds" kind="enum"> 9642 <constant id="JVMTI_KIND_IN" num="91"> 9643 Ingoing argument - <code>foo</code>. 9644 </constant> 9645 <constant id="JVMTI_KIND_IN_PTR" num="92"> 9646 Ingoing pointer argument - <code>const foo*</code>. 9647 </constant> 9648 <constant id="JVMTI_KIND_IN_BUF" num="93"> 9649 Ingoing array argument - <code>const foo*</code>. 9650 </constant> 9651 <constant id="JVMTI_KIND_ALLOC_BUF" num="94"> 9652 Outgoing allocated array argument - <code>foo**</code>. 9653 Free with <code>Deallocate</code>. 9654 </constant> 9655 <constant id="JVMTI_KIND_ALLOC_ALLOC_BUF" num="95"> 9656 Outgoing allocated array of allocated arrays argument - <code>foo***</code>. 9657 Free with <code>Deallocate</code>. 9658 </constant> 9659 <constant id="JVMTI_KIND_OUT" num="96"> 9660 Outgoing argument - <code>foo*</code>. 9661 </constant> 9662 <constant id="JVMTI_KIND_OUT_BUF" num="97"> 9663 Outgoing array argument (pre-allocated by agent) - <code>foo*</code>. 9664 Do not <code>Deallocate</code>. 9665 </constant> 9666 </constants> 9667 9668 </intro> 9669 9670 <typedef id="jvmtiParamInfo" label="Extension Function/Event Parameter Info"> 9671 <field id="name"> 9672 <allocfieldbuf><char/></allocfieldbuf> 9673 <description> 9674 The parameter name, encoded as a 9675 <internallink id="mUTF">modified UTF-8</internallink> string 9676 </description> 9677 </field> 9678 <field id="kind"> 9679 <enum>jvmtiParamKind</enum> 9680 <description> 9681 The kind of the parameter - type modifiers 9682 </description> 9683 </field> 9684 <field id="base_type"> 9685 <enum>jvmtiParamTypes</enum> 9686 <description> 9687 The base type of the parameter - modified by <code>kind</code> 9688 </description> 9689 </field> 9690 <field id="null_ok"> 9691 <jboolean/> 9692 <description> 9693 Is a <code>NULL</code> argument permitted? Applies only to pointer and object types. 9694 </description> 9695 </field> 9696 </typedef> 9697 9698 <callback id="jvmtiExtensionFunction"> 9699 <enum>jvmtiError</enum> 9700 <synopsis>Extension Function</synopsis> 9701 <description> 9702 This is the implementation-specific extension function. 9703 </description> 9704 <parameters> 9705 <param id="jvmti_env"> 9706 <outptr> 9707 <struct>jvmtiEnv</struct> 9708 </outptr> 9709 <description> 9710 The <jvmti/> environment is the only fixed parameter for extension functions. 9711 </description> 9712 </param> 9713 <param id="..."> 9714 <varargs/> 9715 <description> 9716 The extension function-specific parameters 9717 </description> 9718 </param> 9719 </parameters> 9720 </callback> 9721 9722 <function id="GetExtensionFunctions" phase="onload" num="124"> 9723 <synopsis>Get Extension Functions</synopsis> 9724 9725 <typedef id="jvmtiExtensionFunctionInfo" label="Extension Function Info"> 9726 <field id="func"> 9727 <ptrtype> 9728 <struct>jvmtiExtensionFunction</struct> 9729 </ptrtype> 9730 <description> 9731 The actual function to call 9732 </description> 9733 </field> 9734 <field id="id"> 9735 <allocfieldbuf><char/></allocfieldbuf> 9736 <description> 9737 The identifier for the extension function, encoded as a 9738 <internallink id="mUTF">modified UTF-8</internallink> string. 9739 Uses package name conventions. 9740 For example, <code>com.sun.hotspot.bar</code> 9741 </description> 9742 </field> 9743 <field id="short_description"> 9744 <allocfieldbuf><char/></allocfieldbuf> 9745 <description> 9746 A one sentence description of the function, encoded as a 9747 <internallink id="mUTF">modified UTF-8</internallink> string. 9748 </description> 9749 </field> 9750 <field id="param_count"> 9751 <jint/> 9752 <description> 9753 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code> 9754 </description> 9755 </field> 9756 <field id="params"> 9757 <allocfieldbuf outcount="param_count"> 9758 <struct>jvmtiParamInfo</struct> 9759 </allocfieldbuf> 9760 <description> 9761 Array of 9762 <fieldlink id="param_count" struct="jvmtiExtensionFunctionInfo"></fieldlink> 9763 parameters (<code>jvmtiEnv *jvmti_env</code> excluded) 9764 </description> 9765 </field> 9766 <field id="error_count"> 9767 <jint/> 9768 <description> 9769 The number of possible error returns (excluding universal errors) 9770 </description> 9771 </field> 9772 <field id="errors"> 9773 <allocfieldbuf outcount="error_count"> 9774 <enum>jvmtiError</enum> 9775 </allocfieldbuf> 9776 <description> 9777 Array of <fieldlink id="error_count" struct="jvmtiExtensionFunctionInfo"></fieldlink> 9778 possible errors 9779 </description> 9780 </field> 9781 </typedef> 9782 9783 <description> 9784 Returns the set of extension functions. 9785 </description> 9786 <origin>new</origin> 9787 <capabilities> 9788 </capabilities> 9789 <parameters> 9790 <param id="extension_count_ptr"> 9791 <outptr><jint/></outptr> 9792 <description> 9793 On return, points to the number of extension functions 9794 </description> 9795 </param> 9796 <param id="extensions"> 9797 <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionFunctionInfo</struct></allocbuf> 9798 <description> 9799 Returns an array of extension function info, one per function 9800 </description> 9801 </param> 9802 </parameters> 9803 <errors> 9804 </errors> 9805 </function> 9806 9807 <function id="GetExtensionEvents" phase="onload" num="125"> 9808 <synopsis>Get Extension Events</synopsis> 9809 9810 <typedef id="jvmtiExtensionEventInfo" label="Extension Event Info"> 9811 <field id="extension_event_index"> 9812 <jint/> 9813 <description> 9814 The identifying index of the event 9815 </description> 9816 </field> 9817 <field id="id"> 9818 <allocfieldbuf><char/></allocfieldbuf> 9819 <description> 9820 The identifier for the extension event, encoded as a 9821 <internallink id="mUTF">modified UTF-8</internallink> string. 9822 Uses package name conventions. 9823 For example, <code>com.sun.hotspot.bar</code> 9824 </description> 9825 </field> 9826 <field id="short_description"> 9827 <allocfieldbuf><char/></allocfieldbuf> 9828 <description> 9829 A one sentence description of the event, encoded as a 9830 <internallink id="mUTF">modified UTF-8</internallink> string. 9831 </description> 9832 </field> 9833 <field id="param_count"> 9834 <jint/> 9835 <description> 9836 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code> 9837 </description> 9838 </field> 9839 <field id="params"> 9840 <allocfieldbuf outcount="param_count"> 9841 <struct>jvmtiParamInfo</struct> 9842 </allocfieldbuf> 9843 <description> 9844 Array of 9845 <fieldlink id="param_count" struct="jvmtiExtensionEventInfo"></fieldlink> 9846 parameters (<code>jvmtiEnv *jvmti_env</code> excluded) 9847 </description> 9848 </field> 9849 </typedef> 9850 9851 <description> 9852 Returns the set of extension events. 9853 </description> 9854 <origin>new</origin> 9855 <capabilities> 9856 </capabilities> 9857 <parameters> 9858 <param id="extension_count_ptr"> 9859 <outptr><jint/></outptr> 9860 <description> 9861 On return, points to the number of extension events 9862 </description> 9863 </param> 9864 <param id="extensions"> 9865 <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionEventInfo</struct></allocbuf> 9866 <description> 9867 Returns an array of extension event info, one per event 9868 </description> 9869 </param> 9870 </parameters> 9871 <errors> 9872 </errors> 9873 </function> 9874 9875 <callback id="jvmtiExtensionEvent"> 9876 <void/> 9877 <synopsis>Extension Event</synopsis> 9878 <description> 9879 This is the implementation-specific event. 9880 The event handler is set with 9881 <functionlink id="SetExtensionEventCallback"/>. 9882 <p/> 9883 Event handlers for extension events must be declared varargs to match this definition. 9884 Failure to do so could result in calling convention mismatch and undefined behavior 9885 on some platforms. 9886 <p/> 9887 For example, if the <code>jvmtiParamInfo</code> 9888 returned by <functionlink id="GetExtensionEvents"/> indicates that 9889 there is a <code>jint</code> parameter, the event handler should be 9890 declared: 9891 <example> 9892 void JNICALL myHandler(jvmtiEnv* jvmti_env, jint myInt, ...) 9893 </example> 9894 Note the terminal "<code>...</code>" which indicates varargs. 9895 </description> 9896 <parameters> 9897 <param id="jvmti_env"> 9898 <outptr> 9899 <struct>jvmtiEnv</struct> 9900 </outptr> 9901 <description> 9902 The <jvmti/> environment is the only fixed parameter for extension events. 9903 </description> 9904 </param> 9905 <param id="..."> 9906 <varargs/> 9907 <description> 9908 The extension event-specific parameters 9909 </description> 9910 </param> 9911 </parameters> 9912 </callback> 9913 9914 <function id="SetExtensionEventCallback" phase="onload" num="126"> 9915 <synopsis>Set Extension Event Callback</synopsis> 9916 9917 <description> 9918 Sets the callback function for an extension event and 9919 enables the event. Or, if the callback is <code>NULL</code>, disables 9920 the event. Note that unlike standard events, setting 9921 the callback and enabling the event are a single operation. 9922 </description> 9923 <origin>new</origin> 9924 <capabilities> 9925 </capabilities> 9926 <parameters> 9927 <param id="extension_event_index"> 9928 <jint/> 9929 <description> 9930 Identifies which callback to set. 9931 This index is the 9932 <fieldlink id="extension_event_index" struct="jvmtiExtensionEventInfo"></fieldlink> 9933 field of 9934 <datalink id="jvmtiExtensionEventInfo"/>. 9935 </description> 9936 </param> 9937 <param id="callback"> 9938 <ptrtype> 9939 <struct>jvmtiExtensionEvent</struct> 9940 <nullok>disable the event</nullok> 9941 </ptrtype> 9942 <description> 9943 If <code>callback</code> is non-<code>NULL</code>, 9944 set <code>callback</code> to be the event callback function 9945 and enable the event. 9946 </description> 9947 </param> 9948 </parameters> 9949 <errors> 9950 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 9951 <paramlink id="extension_event_index"/> is not an 9952 <fieldlink id="extension_event_index" 9953 struct="jvmtiExtensionEventInfo"/> 9954 returned by 9955 <functionlink id="GetExtensionEvents"/> 9956 </error> 9957 </errors> 9958 </function> 9959 9960 </category> 9961 9962 <category id="capability" label="Capability"> 9963 9964 <intro> 9965 The capabilities functions allow you to change the 9966 functionality available to <jvmti/>--that is, 9967 which <jvmti/> 9968 functions can be called, what events can be generated, 9969 and what functionality these events and functions can 9970 provide. 9971 <p/> 9972 The "Capabilities" section of each function and event describe which 9973 capabilities, if any, they are associated with. "Required Functionality" 9974 means it is available for use and no capabilities must be added to use it. 9975 "Optional Functionality" means the agent must possess the capability 9976 before it can be used. 9977 To possess a capability, the agent must 9978 <functionlink id="AddCapabilities">add the capability</functionlink>. 9979 "Optional Features" describe capabilities which, 9980 if added, extend the feature set. 9981 <p/> 9982 The potentially available capabilities of each <jvmti/> implementation are different. 9983 Depending on the implementation, a capability: 9984 <ul> 9985 <li>may never be added</li> 9986 <li>may be added in either the <code>OnLoad</code> or live phase in any environment</li> 9987 <li>may be added only during the <code>OnLoad</code> phase</li> 9988 <li>may be possessed by only one environment at a time</li> 9989 <li>may be possessed by only one environment at a time, 9990 and only during the <code>OnLoad</code> phase</li> 9991 <li>and so on ...</li> 9992 </ul> 9993 Frequently, the addition of a capability may incur a cost in execution speed, start up 9994 time, and/or memory footprint. Note that the overhead of using a capability 9995 is completely different than the overhead of possessing a capability. 9996 Take single stepping as an example. When single stepping is on (that 9997 is, when the event is enabled and thus actively sending events) 9998 the overhead of sending and processing an event 9999 on each instruction is huge in any implementation. 10000 However, the overhead of possessing the capability may be small or large, 10001 depending on the implementation. Also, when and if a capability is potentially 10002 available depends on the implementation. Some examples: 10003 <ul> 10004 <li>One VM might perform all execution by compiling bytecodes into 10005 native code and be unable to generate single step instructions. 10006 In this implementation the capability can not be added.</li> 10007 <li>Another VM may be able to switch execution to a single stepping 10008 interpreter at any time. In this implementation, having the capability has no 10009 overhead and could be added at any time.</li> 10010 <li>Yet another VM might be able to choose a bytecode compiling or single stepping capable interpreted 10011 execution engine at start up, but be unable to switch between them. 10012 In this implementation the capability would need to be added 10013 during the <code>OnLoad</code> phase (before bytecode 10014 execution begins) and would have a large impact on execution speed 10015 even if single stepping was never used.</li> 10016 <li>Still another VM might be able to add an "is single stepping on" check 10017 into compiled bytecodes or a generated interpreter. Again in this implementation 10018 the capability would need to be added during the <code>OnLoad</code> phase but the overhead (a test 10019 and branch on each instruction) would be considerably less.</li> 10020 </ul> 10021 <p/> 10022 Each <jvmti/> <internallink id="environments">environment</internallink> 10023 has its own set of capabilities. 10024 Initially, that set is empty. 10025 Any desired capability must be added. 10026 If possible, capabilities should be added during the <code>OnLoad</code> phase. For most 10027 virtual machines certain capabilities require special set up for 10028 the virtual machine and this set up must happen 10029 during the <code>OnLoad</code> phase, before the virtual machine begins execution. 10030 Once a capability is added, it can 10031 only be removed if explicitly relinquished by the environment. 10032 <p/> 10033 The agent can, 10034 <functionlink id="GetPotentialCapabilities">determine what 10035 capabilities this VM can potentially provide</functionlink>, 10036 <functionlink id="AddCapabilities">add the capabilities 10037 to be used</functionlink>, 10038 <functionlink id="RelinquishCapabilities">release capabilities 10039 which are no longer needed</functionlink>, and 10040 <functionlink id="GetCapabilities">examine the currently available 10041 capabilities</functionlink>. 10042 </intro> 10043 10044 <intro id="capabilityExamples" label="Capability Examples"> 10045 For example, a freshly started agent (in the <code>OnLoad</code> function) 10046 wants to enable all possible capabilities. 10047 Note that, in general, this is not advisable as the agent may suffer 10048 a performance penalty for functionality it is not using. 10049 The code might look like this in C: 10050 <example> 10051 jvmtiCapabilities capa; 10052 jvmtiError err; 10053 10054 err = (*jvmti)->GetPotentialCapabilities(jvmti, &capa); 10055 if (err == JVMTI_ERROR_NONE) { 10056 err = (*jvmti)->AddCapabilities(jvmti, &capa); 10057 </example> 10058 For example, if an agent wants to check if it can get 10059 the bytecodes of a method (that is, it wants to check 10060 if it previously added this capability and has not 10061 relinquished it), the code might 10062 look like this in C: 10063 <example> 10064 jvmtiCapabilities capa; 10065 jvmtiError err; 10066 10067 err = (*jvmti)->GetCapabilities(jvmti, &capa); 10068 if (err == JVMTI_ERROR_NONE) { 10069 if (capa.can_get_bytecodes) { ... } } 10070 </example> 10071 </intro> 10072 10073 <capabilitiestypedef id="jvmtiCapabilities" label="The Capabilities Structure"> 10074 <description> 10075 The functions in this category use this capabilities structure 10076 which contains boolean flags corresponding to each capability: 10077 </description> 10078 <capabilityfield id="can_tag_objects"> 10079 <description> 10080 Can set and get tags, as described in the 10081 <internallink id="Heap">Heap category</internallink>. 10082 </description> 10083 </capabilityfield> 10084 <capabilityfield id="can_generate_field_modification_events"> 10085 <description> 10086 Can set watchpoints on field modification - 10087 <functionlink id="SetFieldModificationWatch"></functionlink> 10088 </description> 10089 </capabilityfield> 10090 <capabilityfield id="can_generate_field_access_events"> 10091 <description> 10092 Can set watchpoints on field access - 10093 <functionlink id="SetFieldAccessWatch"></functionlink> 10094 </description> 10095 </capabilityfield> 10096 <capabilityfield id="can_get_bytecodes"> 10097 <description> 10098 Can get bytecodes of a method <functionlink id="GetBytecodes"></functionlink> 10099 </description> 10100 </capabilityfield> 10101 <capabilityfield id="can_get_synthetic_attribute"> 10102 <description> 10103 Can test if a field or method is synthetic - 10104 <functionlink id="IsFieldSynthetic"></functionlink> and 10105 <functionlink id="IsMethodSynthetic"></functionlink> 10106 </description> 10107 </capabilityfield> 10108 <capabilityfield id="can_get_owned_monitor_info"> 10109 <description> 10110 Can get information about ownership of monitors - 10111 <functionlink id="GetOwnedMonitorInfo"></functionlink> 10112 </description> 10113 </capabilityfield> 10114 <capabilityfield id="can_get_current_contended_monitor"> 10115 <description> 10116 Can <functionlink id="GetCurrentContendedMonitor"></functionlink> 10117 </description> 10118 </capabilityfield> 10119 <capabilityfield id="can_get_monitor_info"> 10120 <description> 10121 Can <functionlink id="GetObjectMonitorUsage"></functionlink> 10122 </description> 10123 </capabilityfield> 10124 <capabilityfield id="can_pop_frame"> 10125 <description> 10126 Can pop frames off the stack - <functionlink id="PopFrame"></functionlink> 10127 </description> 10128 </capabilityfield> 10129 <capabilityfield id="can_redefine_classes"> 10130 <description> 10131 Can redefine classes with <functionlink id="RedefineClasses"/>. 10132 </description> 10133 </capabilityfield> 10134 <capabilityfield id="can_signal_thread"> 10135 <description> 10136 Can send stop or interrupt to threads 10137 </description> 10138 </capabilityfield> 10139 <capabilityfield id="can_get_source_file_name"> 10140 <description> 10141 Can get the source file name of a class 10142 </description> 10143 </capabilityfield> 10144 <capabilityfield id="can_get_line_numbers"> 10145 <description> 10146 Can get the line number table of a method 10147 </description> 10148 </capabilityfield> 10149 <capabilityfield id="can_get_source_debug_extension"> 10150 <description> 10151 Can get the source debug extension of a class 10152 </description> 10153 </capabilityfield> 10154 <capabilityfield id="can_access_local_variables"> 10155 <description> 10156 Can set and get local variables 10157 </description> 10158 </capabilityfield> 10159 <capabilityfield id="can_maintain_original_method_order"> 10160 <description> 10161 Can return methods in the order they occur in the class file 10162 </description> 10163 </capabilityfield> 10164 <capabilityfield id="can_generate_single_step_events"> 10165 <description> 10166 Can get <eventlink id="SingleStep">single step</eventlink> events 10167 </description> 10168 </capabilityfield> 10169 <capabilityfield id="can_generate_exception_events"> 10170 <description> 10171 Can get <eventlink id="Exception">exception thrown</eventlink> and 10172 <eventlink id="ExceptionCatch">exception catch</eventlink> events 10173 </description> 10174 </capabilityfield> 10175 <capabilityfield id="can_generate_frame_pop_events"> 10176 <description> 10177 Can <functionlink id="NotifyFramePop">set</functionlink> and thus get 10178 <eventlink id="FramePop"></eventlink> events 10179 </description> 10180 </capabilityfield> 10181 <capabilityfield id="can_generate_breakpoint_events"> 10182 <description> 10183 Can <functionlink id="SetBreakpoint">set</functionlink> and thus get 10184 <eventlink id="Breakpoint"></eventlink> events 10185 </description> 10186 </capabilityfield> 10187 <capabilityfield id="can_suspend"> 10188 <description> 10189 Can suspend and resume threads 10190 </description> 10191 </capabilityfield> 10192 <capabilityfield id="can_redefine_any_class"> 10193 <description> 10194 Can modify (retransform or redefine) any modifiable class. 10195 See <functionlink id="IsModifiableClass"/>. 10196 </description> 10197 </capabilityfield> 10198 <capabilityfield id="can_get_current_thread_cpu_time"> 10199 <description> 10200 Can <functionlink id="GetCurrentThreadCpuTime">get</functionlink> 10201 current thread CPU time 10202 </description> 10203 </capabilityfield> 10204 <capabilityfield id="can_get_thread_cpu_time"> 10205 <description> 10206 Can <functionlink id="GetThreadCpuTime">get</functionlink> 10207 thread CPU time 10208 </description> 10209 </capabilityfield> 10210 <capabilityfield id="can_generate_method_entry_events" 10211 disp1="can_generate" disp2="_method_entry_events" 10212 > 10213 <description> 10214 Can generate method entry events on entering a method 10215 </description> 10216 </capabilityfield> 10217 <capabilityfield id="can_generate_method_exit_events" 10218 disp1="can_generate" disp2="_method_exit_events" 10219 > 10220 <description> 10221 Can generate method exit events on leaving a method 10222 </description> 10223 </capabilityfield> 10224 <capabilityfield id="can_generate_all_class_hook_events" 10225 disp1="can_generate" disp2="_all_class_hook_events" 10226 > 10227 <description> 10228 Can generate ClassFileLoadHook events for every loaded class. 10229 </description> 10230 </capabilityfield> 10231 <capabilityfield id="can_generate_compiled_method_load_events" 10232 disp1="can_generate" disp2="_compiled_method_load_events" 10233 > 10234 <description> 10235 Can generate events when a method is compiled or unloaded 10236 </description> 10237 </capabilityfield> 10238 <capabilityfield id="can_generate_monitor_events" 10239 disp1="can_generate" disp2="_monitor_events" 10240 > 10241 <description> 10242 Can generate events on monitor activity 10243 </description> 10244 </capabilityfield> 10245 <capabilityfield id="can_generate_vm_object_alloc_events" 10246 disp1="can_generate" disp2="_vm_object_alloc_events" 10247 > 10248 <description> 10249 Can generate events on VM allocation of an object 10250 </description> 10251 </capabilityfield> 10252 <capabilityfield id="can_generate_native_method_bind_events" 10253 disp1="can_generate" disp2="_native_method_bind_events" 10254 > 10255 <description> 10256 Can generate events when a native method is bound to its 10257 implementation 10258 </description> 10259 </capabilityfield> 10260 <capabilityfield id="can_generate_garbage_collection_events" 10261 disp1="can_generate" disp2="_garbage_collection_events" 10262 > 10263 <description> 10264 Can generate events when garbage collection begins or ends 10265 </description> 10266 </capabilityfield> 10267 <capabilityfield id="can_generate_object_free_events" 10268 disp1="can_generate" disp2="_object_free_events" 10269 > 10270 <description> 10271 Can generate events when the garbage collector frees an object 10272 </description> 10273 </capabilityfield> 10274 <capabilityfield id="can_force_early_return" since="1.1"> 10275 <description> 10276 Can return early from a method, as described in the 10277 <internallink id="ForceEarlyReturn">Force Early Return category</internallink>. 10278 </description> 10279 </capabilityfield> 10280 <capabilityfield id="can_get_owned_monitor_stack_depth_info" since="1.1"> 10281 <description> 10282 Can get information about owned monitors with stack depth - 10283 <functionlink id="GetOwnedMonitorStackDepthInfo"></functionlink> 10284 </description> 10285 </capabilityfield> 10286 <capabilityfield id="can_get_constant_pool" since="1.1"> 10287 <description> 10288 Can get the constant pool of a class - 10289 <functionlink id="GetConstantPool"></functionlink> 10290 </description> 10291 </capabilityfield> 10292 <capabilityfield id="can_set_native_method_prefix" since="1.1"> 10293 <description> 10294 Can set prefix to be applied when native method cannot be resolved - 10295 <functionlink id="SetNativeMethodPrefix"/> and 10296 <functionlink id="SetNativeMethodPrefixes"/> 10297 </description> 10298 </capabilityfield> 10299 <capabilityfield id="can_retransform_classes" since="1.1"> 10300 <description> 10301 Can retransform classes with <functionlink id="RetransformClasses"/>. 10302 In addition to the restrictions imposed by the specific 10303 implementation on this capability (see the 10304 <internallink id="capability">Capability</internallink> section), 10305 this capability must be set before the 10306 <eventlink id="ClassFileLoadHook"/> event is enabled for the 10307 first time in this environment. 10308 An environment that possesses this capability at the time that 10309 <code>ClassFileLoadHook</code> is enabled for the first time is 10310 said to be <i>retransformation capable</i>. 10311 An environment that does not possess this capability at the time that 10312 <code>ClassFileLoadHook</code> is enabled for the first time is 10313 said to be <i>retransformation incapable</i>. 10314 </description> 10315 </capabilityfield> 10316 <capabilityfield id="can_retransform_any_class" since="1.1"> 10317 <description> 10318 <functionlink id="RetransformClasses"/> can be called on any modifiable class. 10319 See <functionlink id="IsModifiableClass"/>. 10320 (<fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/> 10321 must also be set) 10322 </description> 10323 </capabilityfield> 10324 <capabilityfield id="can_generate_resource_exhaustion_heap_events" since="1.1"> 10325 <description> 10326 Can generate events when the VM is unable to allocate memory from 10327 the <tm>Java</tm> platform heap. 10328 See <eventlink id="ResourceExhausted"/>. 10329 </description> 10330 </capabilityfield> 10331 <capabilityfield id="can_generate_resource_exhaustion_threads_events" since="1.1"> 10332 <description> 10333 Can generate events when the VM is unable to create a thread. 10334 See <eventlink id="ResourceExhausted"/>. 10335 </description> 10336 </capabilityfield> 10337 <capabilityfield id="can_generate_early_vmstart" since="9"> 10338 <description> 10339 Can generate the <code>VMStart</code> event early. 10340 See <eventlink id="VMStart"/>. 10341 </description> 10342 </capabilityfield> 10343 <capabilityfield id="can_generate_early_class_hook_events" since="9"> 10344 <description> 10345 Can generate the <eventlink id="ClassFileLoadHook"/> events 10346 in the primordial phase. If this capability and 10347 <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events"> 10348 <code>can_generate_all_class_hook_events</code></internallink> 10349 are enabled then the <eventlink id="ClassFileLoadHook"/> events 10350 can be posted for classes loaded in the primordial phase. 10351 See <eventlink id="ClassFileLoadHook"/>. 10352 </description> 10353 </capabilityfield> 10354 </capabilitiestypedef> 10355 10356 <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140"> 10357 <synopsis>Get Potential Capabilities</synopsis> 10358 <description> 10359 Returns via <paramlink id="capabilities_ptr"></paramlink> the <jvmti/> 10360 features that can potentially be possessed by this environment 10361 at this time. 10362 The returned capabilities differ from the complete set of capabilities 10363 implemented by the VM in two cases: another environment possesses 10364 capabilities that can only be possessed by one environment, or the 10365 current <functionlink id="GetPhase">phase</functionlink> is live, 10366 and certain capabilities can only be added during the <code>OnLoad</code> phase. 10367 The <functionlink id="AddCapabilities"></functionlink> function 10368 may be used to set any or all or these capabilities. 10369 Currently possessed capabilities are included. 10370 <p/> 10371 Typically this function is used in the <code>OnLoad</code> function. 10372 Some virtual machines may allow a limited set of capabilities to be 10373 added in the live phase. 10374 In this case, the set of potentially available capabilities 10375 will likely differ from the <code>OnLoad</code> phase set. 10376 <p/> 10377 See the 10378 <internallink id="capabilityExamples">Capability Examples</internallink>. 10379 </description> 10380 <origin>new</origin> 10381 <capabilities> 10382 </capabilities> 10383 <parameters> 10384 <param id="capabilities_ptr"> 10385 <outptr><struct>jvmtiCapabilities</struct></outptr> 10386 <description> 10387 On return, points to the <jvmti/> capabilities that may be added. 10388 </description> 10389 </param> 10390 </parameters> 10391 <errors> 10392 </errors> 10393 </function> 10394 10395 <elide> 10396 <function id="EstimateCostOfCapabilities" phase="onload" num="141"> 10397 <synopsis>Estimate Cost Of Capabilities</synopsis> 10398 <description> 10399 <issue>There is strong opposition to this function. The concern is 10400 that it would be difficult or impossible to provide meaningful 10401 numbers, as the amount of impact is conditional on many factors 10402 that a single number could not represent. There is doubt that 10403 conditional implementations would be used or are even a good idea. 10404 The thought is that release documentation for the implementation 10405 would be the best means of exposing this information. 10406 Unless new arguments are presented, I intend to remove this 10407 function in the next revision. 10408 </issue> 10409 <p/> 10410 Return via the <paramlink id="time_impact_ptr"></paramlink> and 10411 <paramlink id="space_impact_ptr"></paramlink> an estimate of the impact 10412 of adding the capabilities pointed to by 10413 <paramlink id="capabilities_ptr"></paramlink>. 10414 The returned estimates are in percentage of additional overhead, thus 10415 a time impact of 100 mean the application might run 10416 at half the speed. 10417 The estimates are very rough approximations and are not guaranteed. 10418 Note also, that the estimates are of the impact of having the 10419 capability available--when and if it is used the impact may be 10420 much greater. 10421 Estimates can be for a single capability or for a set of 10422 capabilities. Note that the costs are not necessarily additive, 10423 adding support for one capability might make another available 10424 for free or conversely having two capabilities at once may 10425 have multiplicative impact. 10426 Estimates are relative to the current set of capabilities - 10427 that is, how much more impact given the currently possessed capabilities. 10428 <p/> 10429 Typically this function is used in the OnLoad function, 10430 some virtual machines may allow a limited set of capabilities to be 10431 added in the live phase. 10432 In this case, the set of potentially available capabilities 10433 will likely differ from the OnLoad phase set. 10434 <p/> 10435 See the 10436 <internallink id="capabilityExamples">Capability Examples</internallink>. 10437 </description> 10438 <origin>new</origin> 10439 <capabilities> 10440 </capabilities> 10441 <parameters> 10442 <param id="capabilities_ptr"> 10443 <inptr><struct>jvmtiCapabilities</struct></inptr> 10444 <description> 10445 points to the <jvmti/> capabilities to evaluate. 10446 </description> 10447 </param> 10448 <param id="time_impact_ptr"> 10449 <outptr><jint/></outptr> 10450 <description> 10451 On return, points to the estimated percentage increase in 10452 run time if this capability was added. 10453 </description> 10454 </param> 10455 <param id="space_impact_ptr"> 10456 <outptr><jint/></outptr> 10457 <description> 10458 On return, points to the estimated percentage increase in 10459 memory space used if this capability was added. 10460 </description> 10461 </param> 10462 </parameters> 10463 <errors> 10464 <error id="JVMTI_ERROR_NOT_AVAILABLE"> 10465 The desired capabilities are not even potentially available. 10466 </error> 10467 </errors> 10468 </function> 10469 </elide> 10470 10471 <function id="AddCapabilities" jkernel="yes" phase="onload" num="142"> 10472 <synopsis>Add Capabilities</synopsis> 10473 <description> 10474 Set new capabilities by adding the capabilities 10475 whose values are set to one (<code>1</code>) in 10476 <code>*</code><paramlink id="capabilities_ptr"></paramlink>. 10477 All previous capabilities are retained. 10478 Typically this function is used in the <code>OnLoad</code> function. 10479 Some virtual machines may allow a limited set of capabilities to be 10480 added in the live phase. 10481 <p/> 10482 See the 10483 <internallink id="capabilityExamples">Capability Examples</internallink>. 10484 </description> 10485 <origin>new</origin> 10486 <capabilities> 10487 </capabilities> 10488 <parameters> 10489 <param id="capabilities_ptr"> 10490 <inptr><struct>jvmtiCapabilities</struct></inptr> 10491 <description> 10492 Points to the <jvmti/> capabilities to add. 10493 </description> 10494 </param> 10495 </parameters> 10496 <errors> 10497 <error id="JVMTI_ERROR_NOT_AVAILABLE"> 10498 The desired capabilities are not even potentially available. 10499 </error> 10500 </errors> 10501 </function> 10502 10503 10504 <function id="RelinquishCapabilities" phase="onload" num="143"> 10505 <synopsis>Relinquish Capabilities</synopsis> 10506 <description> 10507 Relinquish the capabilities 10508 whose values are set to one (<code>1</code>) in 10509 <code>*</code><paramlink id="capabilities_ptr"></paramlink>. 10510 Some implementations may allow only one environment to have a capability 10511 (see the <internallink id="capability">capability introduction</internallink>). 10512 This function releases capabilities 10513 so that they may be used by other agents. 10514 All other capabilities are retained. 10515 The capability will no longer be present in <functionlink id="GetCapabilities"></functionlink>. 10516 Attempting to relinquish a capability that the agent does not possess is not an error. 10517 <issue> 10518 It is possible for the agent to be actively using capabilities 10519 which are being relinquished. For example, a thread is currently 10520 suspended and can_suspend is being relinquished or an event is currently 10521 enabled and can_generate_whatever is being relinquished. 10522 There are three possible ways we could spec this: 10523 <ul> 10524 <li>relinquish automatically releases them</li> 10525 <li>relinquish checks and returns some error code if held</li> 10526 <li>it is the agent's responsibility and it is not checked</li> 10527 </ul> 10528 One of these should be chosen. 10529 </issue> 10530 </description> 10531 <origin>new</origin> 10532 <capabilities> 10533 </capabilities> 10534 <parameters> 10535 <param id="capabilities_ptr"> 10536 <inptr><struct>jvmtiCapabilities</struct></inptr> 10537 <description> 10538 Points to the <jvmti/> capabilities to relinquish. 10539 </description> 10540 </param> 10541 </parameters> 10542 <errors> 10543 </errors> 10544 </function> 10545 10546 10547 10548 <function id="GetCapabilities" jkernel="yes" phase="any" num="89"> 10549 <synopsis>Get Capabilities</synopsis> 10550 <description> 10551 Returns via <paramlink id="capabilities_ptr"></paramlink> the optional <jvmti/> 10552 features which this environment currently possesses. 10553 Each possessed capability is indicated by a one (<code>1</code>) in the 10554 corresponding field of the <internallink id="jvmtiCapabilities">capabilities 10555 structure</internallink>. 10556 An environment does not possess a capability unless it has been successfully added with 10557 <functionlink id="AddCapabilities"/>. 10558 An environment only loses possession of a capability if it has been relinquished with 10559 <functionlink id="RelinquishCapabilities"/>. Thus, this function returns the net result 10560 of the <code>AddCapabilities</code> and <code>RelinquishCapabilities</code> calls which 10561 have been made. 10562 <p/> 10563 See the 10564 <internallink id="capabilityExamples">Capability Examples</internallink>. 10565 </description> 10566 <origin>jvmdiClone</origin> 10567 <capabilities> 10568 </capabilities> 10569 <parameters> 10570 <param id="capabilities_ptr"> 10571 <outptr><struct>jvmtiCapabilities</struct></outptr> 10572 <description> 10573 On return, points to the <jvmti/> capabilities. 10574 </description> 10575 </param> 10576 </parameters> 10577 <errors> 10578 </errors> 10579 </function> 10580 10581 </category> 10582 10583 10584 <category id="timers" label="Timers"> 10585 10586 <intro> 10587 These functions provide timing information. 10588 The resolution at which the time is updated is not specified. 10589 They provides nanosecond precision, but not necessarily nanosecond accuracy. 10590 Details about the timers, such as their maximum values, can be accessed with 10591 the timer information functions. 10592 </intro> 10593 10594 <typedef id="jvmtiTimerInfo" label="Timer Info"> 10595 <description> 10596 The information function for each timer returns this data structure. 10597 </description> 10598 <field id="max_value"> 10599 <jlong/> 10600 <description> 10601 The maximum value the timer can reach. 10602 After this value is reached the timer wraps back to zero. 10603 This is an unsigned value. If tested or printed as a jlong (signed value) 10604 it may appear to be a negative number. 10605 </description> 10606 </field> 10607 <field id="may_skip_forward"> 10608 <jboolean/> 10609 <description> 10610 If true, the timer can be externally adjusted and as a result skip forward. 10611 If false, the timer value will never increase faster than real time. 10612 </description> 10613 </field> 10614 <field id="may_skip_backward"> 10615 <jboolean/> 10616 <description> 10617 If true, the timer can be externally adjusted and as a result skip backward. 10618 If false, the timer value will be monotonically increasing. 10619 </description> 10620 </field> 10621 <field id="kind"> 10622 <enum>jvmtiTimerKind</enum> 10623 <description> 10624 The kind of timer. 10625 On a platform that does not distinguish between user and system time, <datalink 10626 id="JVMTI_TIMER_TOTAL_CPU"><code>JVMTI_TIMER_TOTAL_CPU</code></datalink> 10627 is returned. 10628 </description> 10629 </field> 10630 <field id="reserved1"> 10631 <jlong/> 10632 <description> 10633 Reserved for future use. 10634 </description> 10635 </field> 10636 <field id="reserved2"> 10637 <jlong/> 10638 <description> 10639 Reserved for future use. 10640 </description> 10641 </field> 10642 </typedef> 10643 10644 <intro> 10645 Where the timer kind is -- 10646 10647 <constants id="jvmtiTimerKind" label="Timer Kinds" kind="enum"> 10648 <constant id="JVMTI_TIMER_USER_CPU" num="30"> 10649 CPU time that a thread is in user mode. 10650 </constant> 10651 <constant id="JVMTI_TIMER_TOTAL_CPU" num="31"> 10652 CPU time that a thread is in user or system mode. 10653 </constant> 10654 <constant id="JVMTI_TIMER_ELAPSED" num="32"> 10655 Elapsed time. 10656 </constant> 10657 </constants> 10658 </intro> 10659 10660 <function id="GetCurrentThreadCpuTimerInfo" callbacksafe="safe" impl="innative notrace" phase="start" num="134"> 10661 <synopsis>Get Current Thread CPU Timer Information</synopsis> 10662 <description> 10663 Get information about the 10664 <functionlink id="GetCurrentThreadCpuTime"/> timer. 10665 The fields of the <datalink id="jvmtiTimerInfo"/> structure 10666 are filled in with details about the timer. 10667 This information is specific to the platform and the implementation of 10668 <functionlink id="GetCurrentThreadCpuTime"/> and thus 10669 does not vary by thread nor does it vary 10670 during a particular invocation of the VM. 10671 <p/> 10672 Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/> 10673 and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values 10674 returned by <code>GetCurrentThreadCpuTimerInfo</code> 10675 and <functionlink id="GetThreadCpuTimerInfo"/> 10676 may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information. 10677 </description> 10678 <origin>new</origin> 10679 <capabilities> 10680 <required id="can_get_current_thread_cpu_time"> 10681 Can get current thread CPU time. 10682 </required> 10683 </capabilities> 10684 <parameters> 10685 <param id="info_ptr"> 10686 <outptr><struct>jvmtiTimerInfo</struct></outptr> 10687 <description> 10688 On return, filled with information describing the time 10689 returned by <functionlink id="GetCurrentThreadCpuTime"/>. 10690 </description> 10691 </param> 10692 </parameters> 10693 <errors> 10694 </errors> 10695 </function> 10696 10697 <function id="GetCurrentThreadCpuTime" callbacksafe="safe" impl="innative notrace" phase="start" num="135"> 10698 <synopsis>Get Current Thread CPU Time</synopsis> 10699 <description> 10700 Return the CPU time utilized by the current thread. 10701 <p/> 10702 Note that the <functionlink id="GetThreadCpuTime"/> 10703 function provides CPU time for any thread, including 10704 the current thread. <code>GetCurrentThreadCpuTime</code> 10705 exists to support platforms which cannot 10706 supply CPU time for threads other than the current 10707 thread or which have more accurate information for 10708 the current thread (see 10709 <functionlink id="GetCurrentThreadCpuTimerInfo"/> vs 10710 <functionlink id="GetThreadCpuTimerInfo"/>). 10711 On many platforms this call will be equivalent to: 10712 <example> 10713 GetThreadCpuTime(env, NULL, nanos_ptr) 10714 </example> 10715 </description> 10716 <origin>new</origin> 10717 <capabilities> 10718 <required id="can_get_current_thread_cpu_time"> 10719 Can get current thread CPU time. 10720 <p/> 10721 If this capability is enabled after threads have started, 10722 the implementation may choose any time up 10723 to and including the time that the capability is enabled 10724 as the point where CPU time collection starts. 10725 <p/> 10726 This capability must be potentially available on any 10727 platform where 10728 <internallink id="jvmtiCapabilities.can_get_thread_cpu_time"><code>can_get_thread_cpu_time</code></internallink> 10729 is potentially available. 10730 </required> 10731 </capabilities> 10732 <parameters> 10733 <param id="nanos_ptr"> 10734 <outptr><jlong/></outptr> 10735 <description> 10736 On return, points to the CPU time used by this thread 10737 in nanoseconds. 10738 This is an unsigned value. If tested or printed as a jlong (signed value) 10739 it may appear to be a negative number. 10740 </description> 10741 </param> 10742 </parameters> 10743 <errors> 10744 </errors> 10745 </function> 10746 10747 <function id="GetThreadCpuTimerInfo" num="136"> 10748 <synopsis>Get Thread CPU Timer Information</synopsis> 10749 <description> 10750 Get information about the 10751 <functionlink id="GetThreadCpuTime"/> timer. 10752 The fields of the <datalink id="jvmtiTimerInfo"/> structure 10753 are filled in with details about the timer. 10754 This information is specific to the platform and the implementation of 10755 <functionlink id="GetThreadCpuTime"/> and thus 10756 does not vary by thread nor does it vary 10757 during a particular invocation of the VM. 10758 <p/> 10759 Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/> 10760 and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values 10761 returned by <functionlink id="GetCurrentThreadCpuTimerInfo"/> 10762 and <code>GetThreadCpuTimerInfo</code> 10763 may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information. 10764 </description> 10765 <origin>new</origin> 10766 <capabilities> 10767 <required id="can_get_thread_cpu_time"> 10768 Can get thread CPU time. 10769 </required> 10770 </capabilities> 10771 <parameters> 10772 <param id="info_ptr"> 10773 <outptr><struct>jvmtiTimerInfo</struct></outptr> 10774 <description> 10775 On return, filled with information describing the time 10776 returned by <functionlink id="GetThreadCpuTime"/>. 10777 </description> 10778 </param> 10779 </parameters> 10780 <errors> 10781 </errors> 10782 </function> 10783 10784 <function id="GetThreadCpuTime" num="137"> 10785 <synopsis>Get Thread CPU Time</synopsis> 10786 <description> 10787 Return the CPU time utilized by the specified thread. 10788 <p/> 10789 Get information about this timer with 10790 <functionlink id="GetThreadCpuTimerInfo"/>. 10791 </description> 10792 <origin>new</origin> 10793 <capabilities> 10794 <required id="can_get_thread_cpu_time"> 10795 Can get thread CPU time. 10796 <p/> 10797 If this capability is enabled after threads have started, 10798 the implementation may choose any time up 10799 to and including the time that the capability is enabled 10800 as the point where CPU time collection starts. 10801 </required> 10802 </capabilities> 10803 <parameters> 10804 <param id="thread"> 10805 <jthread null="current"/> 10806 <description> 10807 The thread to query. 10808 </description> 10809 </param> 10810 <param id="nanos_ptr"> 10811 <outptr><jlong/></outptr> 10812 <description> 10813 On return, points to the CPU time used by the specified thread 10814 in nanoseconds. 10815 This is an unsigned value. If tested or printed as a jlong (signed value) 10816 it may appear to be a negative number. 10817 </description> 10818 </param> 10819 </parameters> 10820 <errors> 10821 </errors> 10822 </function> 10823 10824 <function id="GetTimerInfo" phase="any" callbacksafe="safe" num="138"> 10825 <synopsis>Get Timer Information</synopsis> 10826 <description> 10827 Get information about the 10828 <functionlink id="GetTime"/> timer. 10829 The fields of the <datalink id="jvmtiTimerInfo"/> structure 10830 are filled in with details about the timer. 10831 This information will not change during a particular invocation of the VM. 10832 </description> 10833 <origin>new</origin> 10834 <capabilities> 10835 </capabilities> 10836 <parameters> 10837 <param id="info_ptr"> 10838 <outptr><struct>jvmtiTimerInfo</struct></outptr> 10839 <description> 10840 On return, filled with information describing the time 10841 returned by <functionlink id="GetTime"/>. 10842 </description> 10843 </param> 10844 </parameters> 10845 <errors> 10846 </errors> 10847 </function> 10848 10849 <function id="GetTime" phase="any" callbacksafe="safe" num="139"> 10850 <synopsis>Get Time</synopsis> 10851 <description> 10852 Return the current value of the system timer, in nanoseconds. 10853 <p/> 10854 The value returned represents nanoseconds since some fixed but 10855 arbitrary time (perhaps in the future, so values may be 10856 negative). This function provides nanosecond precision, but not 10857 necessarily nanosecond accuracy. No guarantees are made about 10858 how frequently values change. 10859 <p/> 10860 Get information about this timer with 10861 <functionlink id="GetTimerInfo"/>. 10862 </description> 10863 <origin>new</origin> 10864 <capabilities> 10865 </capabilities> 10866 <parameters> 10867 <param id="nanos_ptr"> 10868 <outptr><jlong/></outptr> 10869 <description> 10870 On return, points to the time in nanoseconds. 10871 This is an unsigned value. If tested or printed as a jlong (signed value) 10872 it may appear to be a negative number. 10873 </description> 10874 </param> 10875 </parameters> 10876 <errors> 10877 </errors> 10878 </function> 10879 10880 <function id="GetAvailableProcessors" phase="any" num="144"> 10881 <synopsis>Get Available Processors</synopsis> 10882 <description> 10883 Returns the number of processors available to the Java virtual machine. 10884 <p/> 10885 This value may change during a particular invocation of the virtual machine. 10886 Applications that are sensitive to the number of available processors should 10887 therefore occasionally poll this property. 10888 </description> 10889 <origin>new</origin> 10890 <capabilities> 10891 </capabilities> 10892 <parameters> 10893 <param id="processor_count_ptr"> 10894 <outptr><jint/></outptr> 10895 <description> 10896 On return, points to the maximum number of processors available to the 10897 virtual machine; never smaller than one. 10898 </description> 10899 </param> 10900 </parameters> 10901 <errors> 10902 </errors> 10903 </function> 10904 10905 </category> 10906 10907 10908 <category id="classLoaderSearch" label="Class Loader Search"> 10909 10910 <intro> 10911 These functions allow the agent to add to the locations that a class loader searches for a class. 10912 This is useful for installing instrumentation under the correct class loader. 10913 </intro> 10914 10915 <function id="AddToBootstrapClassLoaderSearch" jkernel="yes" phase="onload" num="149"> 10916 <synopsis>Add To Bootstrap Class Loader Search</synopsis> 10917 <description> 10918 This function can be used to cause instrumentation classes to be defined by the 10919 bootstrap class loader. See <vmspec chapter="5.3.1"/>. 10920 After the bootstrap 10921 class loader unsuccessfully searches for a class, the specified platform-dependent 10922 search path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in 10923 the <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, 10924 the segments will be searched in the order that this function was called. 10925 <p/> 10926 In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent 10927 search path segment to be searched after the bootstrap class loader unsuccessfully searches 10928 for a class. The segment is typically a directory or JAR file. 10929 <p/> 10930 In the live phase the <paramlink id="segment"/> may be used to specify any platform-dependent 10931 path to a <externallink id="jar/jar.html"> 10932 JAR file</externallink>. The agent should take care that the JAR file does not 10933 contain any classes or resources other than those to be defined by the bootstrap 10934 class loader for the purposes of instrumentation. 10935 <p/> 10936 <vmspec/> specifies that a subsequent attempt to resolve a symbolic 10937 reference that the Java virtual machine has previously unsuccessfully attempted 10938 to resolve always fails with the same error that was thrown as a result of the 10939 initial resolution attempt. Consequently, if the JAR file contains an entry 10940 that corresponds to a class for which the Java virtual machine has 10941 unsuccessfully attempted to resolve a reference, then subsequent attempts to 10942 resolve that reference will fail with the same error as the initial attempt. 10943 </description> 10944 <origin>new</origin> 10945 <capabilities> 10946 </capabilities> 10947 <parameters> 10948 <param id="segment"> 10949 <inbuf><char/></inbuf> 10950 <description> 10951 The platform-dependent search path segment, encoded as a 10952 <internallink id="mUTF">modified UTF-8</internallink> string. 10953 </description> 10954 </param> 10955 </parameters> 10956 <errors> 10957 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 10958 <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an 10959 existing JAR file is an invalid path. 10960 </error> 10961 </errors> 10962 </function> 10963 10964 <function id="AddToSystemClassLoaderSearch" jkernel="yes" phase="onload" num="151" since="1.1"> 10965 <synopsis>Add To System Class Loader Search</synopsis> 10966 <description> 10967 This function can be used to cause instrumentation classes to be 10968 defined by the system class loader. See <vmspec chapter="5.3.2"/>. 10969 After the class loader unsuccessfully searches for a class, the specified platform-dependent search 10970 path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in the 10971 <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, the 10972 segments will be searched in the order that this function was called. 10973 <p/> 10974 In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent 10975 search path segment to be searched after the system class loader unsuccessfully searches 10976 for a class. The segment is typically a directory or JAR file. 10977 <p/> 10978 In the live phase the <paramlink id="segment"/> is a platform-dependent path to a 10979 <externallink id="jar/jar.html">JAR file</externallink> to be 10980 searched after the system class loader unsuccessfully searches for a class. The agent should 10981 take care that the JAR file does not contain any classes or resources other than those to be 10982 defined by the system class loader for the purposes of instrumentation. 10983 <p/> 10984 In the live phase the system class loader supports adding a JAR file to be searched if 10985 the system class loader implements a method name <code>appendToClassPathForInstrumentation</code> 10986 which takes a single parameter of type <code>java.lang.String</code>. The method is not required 10987 to have <code>public</code> access. 10988 <p/> 10989 <vmspec/> specifies that a subsequent attempt to resolve a symbolic 10990 reference that the Java virtual machine has previously unsuccessfully attempted 10991 to resolve always fails with the same error that was thrown as a result of the 10992 initial resolution attempt. Consequently, if the JAR file contains an entry 10993 that corresponds to a class for which the Java virtual machine has 10994 unsuccessfully attempted to resolve a reference, then subsequent attempts to 10995 resolve that reference will fail with the same error as the initial attempt. 10996 </description> 10997 <origin>new</origin> 10998 <capabilities> 10999 </capabilities> 11000 <parameters> 11001 <param id="segment"> 11002 <inbuf><char/></inbuf> 11003 <description> 11004 The platform-dependent search path segment, encoded as a 11005 <internallink id="mUTF">modified UTF-8</internallink> string. 11006 </description> 11007 </param> 11008 </parameters> 11009 <errors> 11010 <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 11011 <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an 11012 existing JAR file is an invalid path. 11013 </error> 11014 <error id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED"> 11015 Operation not supported by the system class loader. 11016 </error> 11017 </errors> 11018 </function> 11019 11020 </category> 11021 11022 11023 <category id="props" label="System Properties"> 11024 11025 <intro> 11026 These functions get and set system properties. 11027 </intro> 11028 11029 <function id="GetSystemProperties" phase="onload" num="130"> 11030 <synopsis>Get System Properties</synopsis> 11031 <description> 11032 The list of VM system property keys which may be used with 11033 <functionlink id="GetSystemProperty"/> is returned. 11034 It is strongly recommended that virtual machines provide the 11035 following property keys: 11036 <ul> 11037 <li><code>java.vm.vendor</code></li> 11038 <li><code>java.vm.version</code></li> 11039 <li><code>java.vm.name</code></li> 11040 <li><code>java.vm.info</code></li> 11041 <li><code>java.library.path</code></li> 11042 <li><code>java.class.path</code></li> 11043 </ul> 11044 Provides access to system properties defined by and used 11045 by the VM. 11046 Properties set on the command-line are included. 11047 This allows getting and setting of these properties 11048 before the VM even begins executing bytecodes. 11049 Since this is a VM view of system properties, the set of available 11050 properties will usually be different than that 11051 in <code>java.lang.System.getProperties</code>. 11052 JNI method invocation may be used to access 11053 <code>java.lang.System.getProperties</code>. 11054 <p/> 11055 The set of properties may grow during execution. 11056 </description> 11057 <origin>new</origin> 11058 <capabilities> 11059 </capabilities> 11060 <parameters> 11061 <param id="count_ptr"> 11062 <outptr><jint/></outptr> 11063 <description> 11064 On return, points to the number of property keys returned. 11065 </description> 11066 </param> 11067 <param id="property_ptr"> 11068 <allocallocbuf outcount="count_ptr"><char/></allocallocbuf> 11069 <description> 11070 On return, points to an array of property keys, encoded as 11071 <internallink id="mUTF">modified UTF-8</internallink> strings. 11072 </description> 11073 </param> 11074 </parameters> 11075 <errors> 11076 </errors> 11077 </function> 11078 11079 <function id="GetSystemProperty" phase="onload" num="131"> 11080 <synopsis>Get System Property</synopsis> 11081 <description> 11082 Return a VM system property value given the property key. 11083 <p/> 11084 The function <functionlink id="GetSystemProperties"/> 11085 returns the set of property keys which may be used. 11086 The properties which can be retrieved may grow during 11087 execution. 11088 <p/> 11089 Since this is a VM view of system properties, the values 11090 of properties may differ from that returned by 11091 <code>java.lang.System.getProperty(String)</code>. 11092 A typical VM might copy the values of the VM system 11093 properties into the <code>Properties</code> held by 11094 <code>java.lang.System</code> during the initialization 11095 of that class. Thereafter any changes to the VM system 11096 properties (with <functionlink id="SetSystemProperty"/>) 11097 or the <code>java.lang.System</code> system properties 11098 (with <code>java.lang.System.setProperty(String,String)</code>) 11099 would cause the values to diverge. 11100 JNI method invocation may be used to access 11101 <code>java.lang.System.getProperty(String)</code>. 11102 </description> 11103 <origin>new</origin> 11104 <capabilities> 11105 </capabilities> 11106 <parameters> 11107 <param id="property"> 11108 <inbuf><char/></inbuf> 11109 <description> 11110 The key of the property to retrieve, encoded as a 11111 <internallink id="mUTF">modified UTF-8</internallink> string. 11112 </description> 11113 </param> 11114 <param id="value_ptr"> 11115 <allocbuf><char/></allocbuf> 11116 <description> 11117 On return, points to the property value, encoded as a 11118 <internallink id="mUTF">modified UTF-8</internallink> string. 11119 </description> 11120 </param> 11121 </parameters> 11122 <errors> 11123 <error id="JVMTI_ERROR_NOT_AVAILABLE"> 11124 This property is not available. 11125 Use <functionlink id="GetSystemProperties"/> to find available properties. 11126 </error> 11127 </errors> 11128 </function> 11129 11130 <function id="SetSystemProperty" phase="onloadOnly" num="132"> 11131 <synopsis>Set System Property</synopsis> 11132 <description> 11133 Set a VM system property value. 11134 <p/> 11135 The function <functionlink id="GetSystemProperties"/> 11136 returns the set of property keys, some of these may be settable. 11137 See <functionlink id="GetSystemProperty"/>. 11138 </description> 11139 <origin>new</origin> 11140 <capabilities> 11141 </capabilities> 11142 <parameters> 11143 <param id="property"> 11144 <inbuf><char/></inbuf> 11145 <description> 11146 The key of the property, encoded as a 11147 <internallink id="mUTF">modified UTF-8</internallink> string. 11148 </description> 11149 </param> 11150 <param id="value_ptr"> 11151 <inbuf> 11152 <char/> 11153 <nullok> 11154 do not set the value, but return <errorlink id="JVMTI_ERROR_NOT_AVAILABLE"/> 11155 if the property is not writeable 11156 </nullok> 11157 </inbuf> 11158 <description> 11159 The property value to set, encoded as a 11160 <internallink id="mUTF">modified UTF-8</internallink> string. 11161 </description> 11162 </param> 11163 </parameters> 11164 <errors> 11165 <error id="JVMTI_ERROR_NOT_AVAILABLE"> 11166 This property is not available or is not writeable. 11167 </error> 11168 </errors> 11169 </function> 11170 11171 </category> 11172 11173 <category id="general" label="General"> 11174 11175 <intro> 11176 </intro> 11177 11178 <function id="GetPhase" jkernel="yes" phase="any" num="133"> 11179 <synopsis>Get Phase</synopsis> 11180 <description> 11181 Return the current phase of VM execution. 11182 The phases proceed in sequence: 11183 <constants id="jvmtiPhase" label="Phases of execution" kind="enum"> 11184 <constant id="JVMTI_PHASE_ONLOAD" num="1"> 11185 <code>OnLoad</code> phase: while in the 11186 <internallink id="onload"><code>Agent_OnLoad</code></internallink> 11187 or, for statically linked agents, the <internallink id="onload"> 11188 <code>Agent_OnLoad_<agent-lib-name> 11189 </code></internallink> function. 11190 </constant> 11191 <constant id="JVMTI_PHASE_PRIMORDIAL" num="2"> 11192 Primordial phase: between return from <code>Agent_OnLoad</code> 11193 or <code>Agent_OnLoad_<agent-lib-name></code> and the 11194 <code>VMStart</code> event. 11195 </constant> 11196 <constant id="JVMTI_PHASE_START" num="6"> 11197 Start phase: when the <eventlink id="VMStart"><code>VMStart</code></eventlink> event 11198 is sent and until the <code>VMInit</code> event is sent. 11199 </constant> 11200 <constant id="JVMTI_PHASE_LIVE" num="4"> 11201 Live phase: when the <eventlink id="VMInit"><code>VMInit</code></eventlink> event is sent 11202 and until the <eventlink id="VMDeath"></eventlink> event returns. 11203 </constant> 11204 <constant id="JVMTI_PHASE_DEAD" num="8"> 11205 Dead phase: after the <eventlink id="VMDeath"></eventlink> event returns or after 11206 start-up failure. 11207 </constant> 11208 </constants> 11209 In the case of start-up failure the VM will proceed directly to the dead 11210 phase skipping intermediate phases and neither a <code>VMInit</code> nor 11211 <code>VMDeath</code> event will be sent. 11212 <p/> 11213 Most <jvmti/> functions operate only in the live phase. 11214 The following functions operate in either the <code>OnLoad</code> or live phases: 11215 <functionphaselist phase="onload"/> 11216 The following functions operate in only the <code>OnLoad</code> phase: 11217 <functionphaselist phase="onloadOnly"/> 11218 The following functions operate in the start or live phases: 11219 <functionphaselist phase="start"/> 11220 The following functions operate in any phase: 11221 <functionphaselist phase="any"/> 11222 JNI functions (except the Invocation API) must only be used in the start or live phases. 11223 <p/> 11224 Most <jvmti/> events are sent only in the live phase. 11225 The following events operate in others phases: 11226 <eventphaselist phase="start"/> 11227 <eventphaselist phase="any"/> 11228 </description> 11229 <origin>new</origin> 11230 <capabilities> 11231 </capabilities> 11232 <parameters> 11233 <param id="phase_ptr"> 11234 <outptr><enum>jvmtiPhase</enum></outptr> 11235 <description> 11236 On return, points to the phase. 11237 </description> 11238 </param> 11239 </parameters> 11240 <errors> 11241 </errors> 11242 </function> 11243 11244 <function id="DisposeEnvironment" jkernel="yes" phase="any" num="127"> 11245 <synopsis>Dispose Environment</synopsis> 11246 <description> 11247 Shutdown a <jvmti/> connection created with JNI <code>GetEnv</code> 11248 (see <internallink id="environments"><jvmti/> Environments</internallink>). 11249 Dispose of any resources held by the environment. 11250 <issue> 11251 What resources are reclaimed? What is undone? 11252 Breakpoints,watchpoints removed? 11253 </issue> 11254 Threads suspended by this environment are not resumed by this call, 11255 this must be done explicitly by the agent. 11256 Memory allocated by this environment via calls to <jvmti/> functions 11257 is not released, this can be done explicitly by the agent 11258 by calling <functionlink id="Deallocate"/>. 11259 Raw monitors created by this environment are not destroyed, 11260 this can be done explicitly by the agent 11261 by calling <functionlink id="DestroyRawMonitor"/>. 11262 The state of threads waiting on raw monitors created by this environment 11263 are not affected. 11264 <p/> 11265 Any <functionlink id="SetNativeMethodPrefix">native method 11266 prefixes</functionlink> for this environment will be unset; 11267 the agent must remove any prefixed native methods before 11268 dispose is called. 11269 <p/> 11270 Any <internallink id="capability">capabilities</internallink> 11271 held by this environment are relinquished. 11272 <p/> 11273 Events enabled by this environment will no longer be sent, however 11274 event handlers currently running will continue to run. Caution must 11275 be exercised in the design of event handlers whose environment may 11276 be disposed and thus become invalid during their execution. 11277 <p/> 11278 This environment may not be used after this call. 11279 This call returns to the caller. 11280 </description> 11281 <origin>new</origin> 11282 <capabilities> 11283 </capabilities> 11284 <parameters> 11285 </parameters> 11286 <errors> 11287 </errors> 11288 </function> 11289 11290 <function id="SetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="148"> 11291 <synopsis>Set Environment Local Storage</synopsis> 11292 <description> 11293 The VM stores a pointer value associated with each environment. 11294 This pointer value is called <i>environment-local storage</i>. 11295 This value is <code>NULL</code> unless set with this function. 11296 Agents can allocate memory in which they store environment specific 11297 information. By setting environment-local storage it can then be 11298 accessed with 11299 <functionlink id="GetEnvironmentLocalStorage"></functionlink>. 11300 <p/> 11301 Called by the agent to set the value of the <jvmti/> 11302 environment-local storage. <jvmti/> supplies to the agent a pointer-size 11303 environment-local storage that can be used to record per-environment 11304 information. 11305 </description> 11306 <origin>new</origin> 11307 <capabilities> 11308 </capabilities> 11309 <parameters> 11310 <param id="data"> 11311 <inbuf> 11312 <void/> 11313 <nullok>value is set to <code>NULL</code></nullok> 11314 </inbuf> 11315 <description> 11316 The value to be entered into the environment-local storage. 11317 </description> 11318 </param> 11319 </parameters> 11320 <errors> 11321 </errors> 11322 </function> 11323 11324 <function id="GetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="147"> 11325 <synopsis>Get Environment Local Storage</synopsis> 11326 <description> 11327 Called by the agent to get the value of the <jvmti/> environment-local 11328 storage. 11329 </description> 11330 <origin>new</origin> 11331 <capabilities> 11332 </capabilities> 11333 <parameters> 11334 <param id="data_ptr"> 11335 <agentbuf><void/></agentbuf> 11336 <description> 11337 Pointer through which the value of the environment local 11338 storage is returned. 11339 If environment-local storage has not been set with 11340 <functionlink id="SetEnvironmentLocalStorage"></functionlink> returned 11341 pointer is <code>NULL</code>. 11342 </description> 11343 </param> 11344 </parameters> 11345 <errors> 11346 </errors> 11347 </function> 11348 11349 <function id="GetVersionNumber" jkernel="yes" phase="any" num="88"> 11350 <synopsis>Get Version Number</synopsis> 11351 <description> 11352 Return the <jvmti/> version via <code>version_ptr</code>. 11353 The return value is the version identifier. 11354 The version identifier includes major, minor and micro 11355 version as well as the interface type. 11356 <constants id="jvmtiVersionInterfaceTypes" label="Version Interface Types" kind="bits"> 11357 <constant id="JVMTI_VERSION_INTERFACE_JNI" num="0x00000000"> 11358 Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for JNI. 11359 </constant> 11360 <constant id="JVMTI_VERSION_INTERFACE_JVMTI" num="0x30000000"> 11361 Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for <jvmti/>. 11362 </constant> 11363 </constants> 11364 <constants id="jvmtiVersionMasks" label="Version Masks" kind="bits"> 11365 <constant id="JVMTI_VERSION_MASK_INTERFACE_TYPE" num="0x70000000"> 11366 Mask to extract interface type. 11367 The value of the version returned by this function masked with 11368 <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> is always 11369 <code>JVMTI_VERSION_INTERFACE_JVMTI</code> 11370 since this is a <jvmti/> function. 11371 </constant> 11372 <constant id="JVMTI_VERSION_MASK_MAJOR" num="0x0FFF0000"> 11373 Mask to extract major version number. 11374 </constant> 11375 <constant id="JVMTI_VERSION_MASK_MINOR" num="0x0000FF00"> 11376 Mask to extract minor version number. 11377 </constant> 11378 <constant id="JVMTI_VERSION_MASK_MICRO" num="0x000000FF"> 11379 Mask to extract micro version number. 11380 </constant> 11381 </constants> 11382 <constants id="jvmtiVersionShifts" label="Version Shifts" kind="bits"> 11383 <constant id="JVMTI_VERSION_SHIFT_MAJOR" num="16"> 11384 Shift to extract major version number. 11385 </constant> 11386 <constant id="JVMTI_VERSION_SHIFT_MINOR" num="8"> 11387 Shift to extract minor version number. 11388 </constant> 11389 <constant id="JVMTI_VERSION_SHIFT_MICRO" num="0"> 11390 Shift to extract micro version number. 11391 </constant> 11392 </constants> 11393 </description> 11394 <origin>jvmdi</origin> 11395 <capabilities> 11396 </capabilities> 11397 <parameters> 11398 <param id="version_ptr"> 11399 <outptr><jint/></outptr> 11400 <description> 11401 On return, points to the <jvmti/> version. 11402 </description> 11403 </param> 11404 </parameters> 11405 <errors> 11406 </errors> 11407 </function> 11408 11409 11410 <function id="GetErrorName" phase="any" num="128"> 11411 <synopsis>Get Error Name</synopsis> 11412 <description> 11413 Return the symbolic name for an 11414 <internallink id="ErrorSection">error code</internallink>. 11415 <p/> 11416 For example 11417 <code>GetErrorName(env, JVMTI_ERROR_NONE, &err_name)</code> 11418 would return in <code>err_name</code> the string 11419 <code>"JVMTI_ERROR_NONE"</code>. 11420 </description> 11421 <origin>new</origin> 11422 <capabilities> 11423 </capabilities> 11424 <parameters> 11425 <param id="error"> 11426 <enum>jvmtiError</enum> 11427 <description> 11428 The error code. 11429 </description> 11430 </param> 11431 <param id="name_ptr"> 11432 <allocbuf><char/></allocbuf> 11433 <description> 11434 On return, points to the error name. 11435 The name is encoded as a 11436 <internallink id="mUTF">modified UTF-8</internallink> string, 11437 but is restricted to the ASCII subset. 11438 </description> 11439 </param> 11440 </parameters> 11441 <errors> 11442 </errors> 11443 </function> 11444 11445 <function id="SetVerboseFlag" phase="any" num="150"> 11446 <synopsis>Set Verbose Flag</synopsis> 11447 <description> 11448 <constants id="jvmtiVerboseFlag" label="Verbose Flag Enumeration" kind="enum"> 11449 <constant id="JVMTI_VERBOSE_OTHER" num="0"> 11450 Verbose output other than the below. 11451 </constant> 11452 <constant id="JVMTI_VERBOSE_GC" num="1"> 11453 Verbose garbage collector output, like that specified with <code>-verbose:gc</code>. 11454 </constant> 11455 <constant id="JVMTI_VERBOSE_CLASS" num="2"> 11456 Verbose class loading output, like that specified with <code>-verbose:class</code>. 11457 </constant> 11458 <constant id="JVMTI_VERBOSE_JNI" num="4"> 11459 Verbose JNI output, like that specified with <code>-verbose:jni</code>. 11460 </constant> 11461 </constants> 11462 Control verbose output. 11463 This is the output which typically is sent to <code>stderr</code>. 11464 </description> 11465 <origin>new</origin> 11466 <capabilities> 11467 </capabilities> 11468 <parameters> 11469 <param id="flag"> 11470 <enum>jvmtiVerboseFlag</enum> 11471 <description> 11472 Which verbose flag to set. 11473 </description> 11474 </param> 11475 <param id="value"> 11476 <jboolean/> 11477 <description> 11478 New value of the flag. 11479 </description> 11480 </param> 11481 </parameters> 11482 <errors> 11483 </errors> 11484 </function> 11485 11486 11487 <function id="GetJLocationFormat" phase="any" num="129"> 11488 <synopsis>Get JLocation Format</synopsis> 11489 <description> 11490 Although the greatest functionality is achieved with location information 11491 referencing the virtual machine bytecode index, the definition of 11492 <code>jlocation</code> has intentionally been left unconstrained to allow VM 11493 implementations that do not have this information. 11494 <p/> 11495 This function describes the representation of <code>jlocation</code> used in this VM. 11496 If the returned format is <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>, 11497 <code>jlocation</code>s can 11498 be used as in indices into the array returned by 11499 <functionlink id="GetBytecodes"></functionlink>. 11500 <constants id="jvmtiJlocationFormat" label="JLocation Format Enumeration" kind="enum"> 11501 <constant id="JVMTI_JLOCATION_JVMBCI" num="1"> 11502 <code>jlocation</code> values represent virtual machine 11503 bytecode indices--that is, offsets into the 11504 virtual machine code for a method. 11505 </constant> 11506 <constant id="JVMTI_JLOCATION_MACHINEPC" num="2"> 11507 <code>jlocation</code> values represent native machine 11508 program counter values. 11509 </constant> 11510 <constant id="JVMTI_JLOCATION_OTHER" num="0"> 11511 <code>jlocation</code> values have some other representation. 11512 </constant> 11513 </constants> 11514 </description> 11515 <origin>new</origin> 11516 <capabilities> 11517 </capabilities> 11518 <parameters> 11519 <param id="format_ptr"> 11520 <outptr><enum>jvmtiJlocationFormat</enum></outptr> 11521 <description> 11522 On return, points to the format identifier for <code>jlocation</code> values. 11523 </description> 11524 </param> 11525 </parameters> 11526 <errors> 11527 </errors> 11528 </function> 11529 11530 </category> 11531 11532 </functionsection> 11533 11534 <errorsection label="Error Reference"> 11535 <intro> 11536 Every <jvmti/> function returns a <b><code>jvmtiError</code></b> error code. 11537 <p/> 11538 It is the responsibility of the agent to call <jvmti/> functions with 11539 valid parameters and in the proper context (calling thread is attached, 11540 phase is correct, etc.). 11541 Detecting some error conditions may be difficult, inefficient, or 11542 impossible for an implementation. 11543 The errors listed in 11544 <internallink id="reqerrors">Function Specific Required Errors</internallink> 11545 must be detected by the implementation. 11546 All other errors represent the recommended response to the error 11547 condition. 11548 </intro> 11549 11550 <errorcategory id="universal-error" label="Universal Errors"> 11551 <intro> 11552 The following errors may be returned by any function 11553 </intro> 11554 11555 <errorid id="JVMTI_ERROR_NONE" num="0"> 11556 No error has occurred. This is the error code that is returned 11557 on successful completion of the function. 11558 </errorid> 11559 <errorid id="JVMTI_ERROR_NULL_POINTER" num="100"> 11560 Pointer is unexpectedly <code>NULL</code>. 11561 </errorid> 11562 <errorid id="JVMTI_ERROR_OUT_OF_MEMORY" num="110"> 11563 The function attempted to allocate memory and no more memory was 11564 available for allocation. 11565 </errorid> 11566 <errorid id="JVMTI_ERROR_ACCESS_DENIED" num="111"> 11567 The desired functionality has not been enabled in this virtual machine. 11568 </errorid> 11569 <errorid id="JVMTI_ERROR_UNATTACHED_THREAD" num="115"> 11570 The thread being used to call this function is not attached 11571 to the virtual machine. Calls must be made from attached threads. 11572 See <code>AttachCurrentThread</code> in the JNI invocation API. 11573 </errorid> 11574 <errorid id="JVMTI_ERROR_INVALID_ENVIRONMENT" num="116"> 11575 The <jvmti/> environment provided is no longer connected or is 11576 not an environment. 11577 </errorid> 11578 <errorid id="JVMTI_ERROR_WRONG_PHASE" num="112"> 11579 The desired functionality is not available in the current 11580 <functionlink id="GetPhase">phase</functionlink>. 11581 Always returned if the virtual machine has completed running. 11582 </errorid> 11583 <errorid id="JVMTI_ERROR_INTERNAL" num="113"> 11584 An unexpected internal error has occurred. 11585 </errorid> 11586 </errorcategory> 11587 11588 <errorcategory id="reqerrors" label="Function Specific Required Errors"> 11589 <intro> 11590 The following errors are returned by some <jvmti/> functions and must 11591 be returned by the implementation when the condition occurs. 11592 </intro> 11593 11594 <errorid id="JVMTI_ERROR_INVALID_PRIORITY" num="12"> 11595 Invalid priority. 11596 </errorid> 11597 <errorid id="JVMTI_ERROR_THREAD_NOT_SUSPENDED" num="13"> 11598 Thread was not suspended. 11599 </errorid> 11600 <errorid id="JVMTI_ERROR_THREAD_SUSPENDED" num="14"> 11601 Thread already suspended. 11602 </errorid> 11603 <errorid id="JVMTI_ERROR_THREAD_NOT_ALIVE" num="15"> 11604 This operation requires the thread to be alive--that is, 11605 it must be started and not yet have died. 11606 </errorid> 11607 <errorid id="JVMTI_ERROR_CLASS_NOT_PREPARED" num="22"> 11608 The class has been loaded but not yet prepared. 11609 </errorid> 11610 <errorid id="JVMTI_ERROR_NO_MORE_FRAMES" num="31"> 11611 There are no Java programming language or JNI stack frames at the specified depth. 11612 </errorid> 11613 <errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32"> 11614 Information about the frame is not available (e.g. for native frames). 11615 </errorid> 11616 <errorid id="JVMTI_ERROR_DUPLICATE" num="40"> 11617 Item already set. 11618 </errorid> 11619 <errorid id="JVMTI_ERROR_NOT_FOUND" num="41"> 11620 Desired element (e.g. field or breakpoint) not found 11621 </errorid> 11622 <errorid id="JVMTI_ERROR_NOT_MONITOR_OWNER" num="51"> 11623 This thread doesn't own the raw monitor. 11624 </errorid> 11625 <errorid id="JVMTI_ERROR_INTERRUPT" num="52"> 11626 The call has been interrupted before completion. 11627 </errorid> 11628 <errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79"> 11629 The class cannot be modified. 11630 </errorid> 11631 <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80"> 11632 The module cannot be modified. 11633 </errorid> 11634 <errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98"> 11635 The functionality is not available in this virtual machine. 11636 </errorid> 11637 <errorid id="JVMTI_ERROR_ABSENT_INFORMATION" num="101"> 11638 The requested information is not available. 11639 </errorid> 11640 <errorid id="JVMTI_ERROR_INVALID_EVENT_TYPE" num="102"> 11641 The specified event type ID is not recognized. 11642 </errorid> 11643 <errorid id="JVMTI_ERROR_NATIVE_METHOD" num="104"> 11644 The requested information is not available for native method. 11645 </errorid> 11646 <errorid id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED" num="106"> 11647 The class loader does not support this operation. 11648 </errorid> 11649 </errorcategory> 11650 11651 <errorcategory id="function-specific-errors" label="Function Specific Agent Errors"> 11652 <intro> 11653 The following errors are returned by some <jvmti/> functions. 11654 They are returned in the event of invalid parameters passed by the 11655 agent or usage in an invalid context. 11656 An implementation is not required to detect these errors. 11657 </intro> 11658 11659 <errorid id="JVMTI_ERROR_INVALID_THREAD" num="10"> 11660 The passed thread is not a valid thread. 11661 </errorid> 11662 <errorid id="JVMTI_ERROR_INVALID_FIELDID" num="25"> 11663 Invalid field. 11664 </errorid> 11665 <errorid id="JVMTI_ERROR_INVALID_MODULE" num="26"> 11666 Invalid module. 11667 </errorid> 11668 <errorid id="JVMTI_ERROR_INVALID_METHODID" num="23"> 11669 Invalid method. 11670 </errorid> 11671 <errorid id="JVMTI_ERROR_INVALID_LOCATION" num="24"> 11672 Invalid location. 11673 </errorid> 11674 <errorid id="JVMTI_ERROR_INVALID_OBJECT" num="20"> 11675 Invalid object. 11676 </errorid> 11677 <errorid id="JVMTI_ERROR_INVALID_CLASS" num="21"> 11678 Invalid class. 11679 </errorid> 11680 <errorid id="JVMTI_ERROR_TYPE_MISMATCH" num="34"> 11681 The variable is not an appropriate type for the function used. 11682 </errorid> 11683 <errorid id="JVMTI_ERROR_INVALID_SLOT" num="35"> 11684 Invalid slot. 11685 </errorid> 11686 <errorid id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY" num="99"> 11687 The capability being used is false in this environment. 11688 </errorid> 11689 <errorid id="JVMTI_ERROR_INVALID_THREAD_GROUP" num="11"> 11690 Thread group invalid. 11691 </errorid> 11692 <errorid id="JVMTI_ERROR_INVALID_MONITOR" num="50"> 11693 Invalid raw monitor. 11694 </errorid> 11695 <errorid id="JVMTI_ERROR_ILLEGAL_ARGUMENT" num="103"> 11696 Illegal argument. 11697 </errorid> 11698 <errorid id="JVMTI_ERROR_INVALID_TYPESTATE" num="65"> 11699 The state of the thread has been modified, and is now inconsistent. 11700 </errorid> 11701 <errorid id="JVMTI_ERROR_UNSUPPORTED_VERSION" num="68"> 11702 A new class file has a version number not supported by this VM. 11703 </errorid> 11704 <errorid id="JVMTI_ERROR_INVALID_CLASS_FORMAT" num="60"> 11705 A new class file is malformed (the VM would return a <code>ClassFormatError</code>). 11706 </errorid> 11707 <errorid id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION" num="61"> 11708 The new class file definitions would lead to a circular 11709 definition (the VM would return a <code>ClassCircularityError</code>). 11710 </errorid> 11711 <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED" num="63"> 11712 A new class file would require adding a method. 11713 </errorid> 11714 <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED" num="64"> 11715 A new class version changes a field. 11716 </errorid> 11717 <errorid id="JVMTI_ERROR_FAILS_VERIFICATION" num="62"> 11718 The class bytes fail verification. 11719 </errorid> 11720 <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED" num="66"> 11721 A direct superclass is different for the new class 11722 version, or the set of directly implemented 11723 interfaces is different. 11724 </errorid> 11725 <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED" num="67"> 11726 A new class version does not declare a method 11727 declared in the old class version. 11728 </errorid> 11729 <errorid id="JVMTI_ERROR_NAMES_DONT_MATCH" num="69"> 11730 The class name defined in the new class file is 11731 different from the name in the old class object. 11732 </errorid> 11733 <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED" num="70"> 11734 A new class version has different modifiers. 11735 </errorid> 11736 <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED" num="71"> 11737 A method in the new class version has different modifiers 11738 than its counterpart in the old class version. 11739 </errorid> 11740 </errorcategory> 11741 </errorsection> 11742 11743 <eventsection label="Events"> 11744 <intro label="Handling Events" id="eventIntro"> 11745 Agents can be informed of many events that occur in application 11746 programs. 11747 <p/> 11748 To handle events, designate a set of callback functions with 11749 <functionlink id="SetEventCallbacks"></functionlink>. 11750 For each event the corresponding callback function will be 11751 called. 11752 Arguments to the callback function provide additional 11753 information about the event. 11754 <p/> 11755 The callback function is usually called from within an application 11756 thread. The <jvmti/> implementation does not 11757 queue events in any way. This means 11758 that event callback functions must be written 11759 carefully. Here are some general guidelines. See 11760 the individual event descriptions for further 11761 suggestions. 11762 <p/> 11763 <ul> 11764 <li>Any exception thrown during the execution of an event callback can 11765 overwrite any current pending exception in the current application thread. 11766 Care must be taken to preserve a pending exception 11767 when an event callback makes a JNI call that might generate an exception. 11768 </li> 11769 <li>Event callback functions must be re-entrant. The <jvmti/> implementation does 11770 not queue events. If an agent needs to process events one at a time, it 11771 can use a raw monitor inside the 11772 event callback functions to serialize event processing. 11773 </li> 11774 <li>Event callback functions that execute JNI's FindClass function to load 11775 classes need to note that FindClass locates the class loader associated 11776 with the current native method. For the purposes of class loading, an 11777 event callback that includes a JNI environment as a parameter to the 11778 callback will treated as if it is a native call, where the native method 11779 is in the class of the event thread's current frame. 11780 </li> 11781 </ul> 11782 <p/> 11783 Some <jvmti/> events identify objects with JNI references. 11784 All references 11785 in <jvmti/> events are JNI local references and will become invalid 11786 after the event callback returns. 11787 Unless stated otherwise, memory referenced by pointers sent in event 11788 callbacks may not be referenced after the event callback returns. 11789 <p/> 11790 Except where stated otherwise, events are delivered on the thread 11791 that caused the event. 11792 Events are sent at the time they occur. 11793 The specification for each event includes the set of 11794 <functionlink id="GetPhase">phases</functionlink> in which it can be sent; 11795 if an event triggering activity occurs during another phase, no event 11796 is sent. 11797 <p/> 11798 A thread that generates an event does not change its execution status 11799 (for example, the event does not cause the thread to be suspended). 11800 If an agent wishes the event to result in suspension, then the agent 11801 is responsible for explicitly suspending the thread with 11802 <functionlink id="SuspendThread"></functionlink>. 11803 <p/> 11804 If an event is enabled in multiple environments, the event will be sent 11805 to each agent in the order that the environments were created. 11806 </intro> 11807 11808 <intro label="Enabling Events" id="enablingevents"> 11809 All events are initially disabled. In order to receive any 11810 event: 11811 <ul> 11812 <li> 11813 If the event requires a capability, that capability must 11814 be added with 11815 <functionlink id="AddCapabilities"></functionlink>. 11816 </li> 11817 <li> 11818 A callback for the event must be set with 11819 <functionlink id="SetEventCallbacks"></functionlink>. 11820 </li> 11821 <li> 11822 The event must be enabled with 11823 <functionlink id="SetEventNotificationMode"></functionlink>. 11824 </li> 11825 </ul> 11826 </intro> 11827 11828 <intro label="Multiple Co-located Events" id="eventorder"> 11829 In many situations it is possible for multiple events to occur 11830 at the same location in one thread. When this happens, all the events 11831 are reported through the event callbacks in the order specified in this section. 11832 <p/> 11833 If the current location is at the entry point of a method, the 11834 <eventlink id="MethodEntry"></eventlink> event is reported before 11835 any other event at the current location in the same thread. 11836 <p/> 11837 If an exception catch has been detected at the current location, 11838 either because it is the beginning of a catch clause or a native method 11839 that cleared a pending exception has returned, the 11840 <code>exceptionCatch</code> event is reported before 11841 any other event at the current location in the same thread. 11842 <p/> 11843 If a <code>singleStep</code> event or 11844 <code>breakpoint</code> event is triggered at the 11845 current location, the event is defined to occur 11846 immediately before the code at the current location is executed. 11847 These events are reported before any events which are triggered 11848 by the execution of code at the current location in the same 11849 thread (specifically: 11850 <code>exception</code>, 11851 <code>fieldAccess</code>, and 11852 <code>fieldModification</code>). 11853 If both a step and breakpoint event are triggered for the same thread and 11854 location, the step event is reported before the breakpoint event. 11855 <p/> 11856 If the current location is the exit point of a method (that is, the last 11857 location before returning to the caller), the 11858 <eventlink id="MethodExit"></eventlink> event and 11859 the <eventlink id="FramePop"></eventlink> event (if requested) 11860 are reported after all other events at the current location in the same 11861 thread. There is no specified ordering of these two events 11862 with respect to each other. 11863 <p/> 11864 Co-located events can be triggered during the processing of some other 11865 event by the agent at the same location in the same thread. 11866 If such an event, of type <i>y</i>, is triggered during the processing of 11867 an event of type <i>x</i>, and if <i>x</i> 11868 precedes <i>y</i> in the ordering specified above, the co-located event 11869 <i>y</i> is reported for the current thread and location. If <i>x</i> does not precede 11870 <i>y</i>, <i>y</i> is not reported for the current thread and location. 11871 For example, if a breakpoint is set at the current location 11872 during the processing of <eventlink id="SingleStep"></eventlink>, 11873 that breakpoint will be reported before the thread moves off the current 11874 location. 11875 <p/>The following events are never considered to be co-located with 11876 other events. 11877 <ul> 11878 <li><eventlink id="VMStart"></eventlink></li> 11879 <li><eventlink id="VMInit"></eventlink></li> 11880 <li><eventlink id="VMDeath"></eventlink></li> 11881 <li><eventlink id="ThreadStart"></eventlink></li> 11882 <li><eventlink id="ThreadEnd"></eventlink></li> 11883 <li><eventlink id="ClassLoad"></eventlink></li> 11884 <li><eventlink id="ClassPrepare"></eventlink></li> 11885 </ul> 11886 </intro> 11887 11888 <intro label="Event Callbacks" id="jvmtiEventCallbacks"> 11889 The event callback structure below is used to specify the handler function 11890 for events. It is set with the 11891 <functionlink id="SetEventCallbacks"></functionlink> function. 11892 </intro> 11893 11894 <event label="Single Step" 11895 id="SingleStep" const="JVMTI_EVENT_SINGLE_STEP" filtered="thread" num="60"> 11896 <description> 11897 Single step events allow the agent to trace thread execution 11898 at the finest granularity allowed by the VM. A single step event is 11899 generated whenever a thread reaches a new location. 11900 Typically, single step events represent the completion of one VM 11901 instruction as defined in <vmspec/>. However, some implementations 11902 may define locations differently. In any case the 11903 <code>method</code> and <code>location</code> 11904 parameters uniquely identify the current location and allow 11905 the mapping to source file and line number when that information is 11906 available. 11907 <p/> 11908 No single step events are generated from within native methods. 11909 </description> 11910 <origin>jvmdi</origin> 11911 <capabilities> 11912 <required id="can_generate_single_step_events"></required> 11913 </capabilities> 11914 <parameters> 11915 <param id="jni_env"> 11916 <outptr> 11917 <struct>JNIEnv</struct> 11918 </outptr> 11919 <description> 11920 The JNI environment of the event (current) thread 11921 </description> 11922 </param> 11923 <param id="thread"> 11924 <jthread/> 11925 <description> 11926 Thread about to execution a new instruction 11927 </description> 11928 </param> 11929 <param id="klass"> 11930 <jclass method="method"/> 11931 <description> 11932 Class of the method about to execute a new instruction 11933 </description> 11934 </param> 11935 <param id="method"> 11936 <jmethodID class="klass"/> 11937 <description> 11938 Method about to execute a new instruction 11939 </description> 11940 </param> 11941 <param id="location"> 11942 <jlocation/> 11943 <description> 11944 Location of the new instruction 11945 </description> 11946 </param> 11947 </parameters> 11948 </event> 11949 11950 <event label="Breakpoint" 11951 id="Breakpoint" const="JVMTI_EVENT_BREAKPOINT" filtered="thread" num="62"> 11952 <description> 11953 Breakpoint events are generated whenever a thread reaches a location 11954 designated as a breakpoint with <functionlink id="SetBreakpoint"></functionlink>. 11955 The <code>method</code> and <code>location</code> 11956 parameters uniquely identify the current location and allow 11957 the mapping to source file and line number when that information is 11958 available. 11959 </description> 11960 <origin>jvmdi</origin> 11961 <capabilities> 11962 <required id="can_generate_breakpoint_events"></required> 11963 </capabilities> 11964 <parameters> 11965 <param id="jni_env"> 11966 <outptr> 11967 <struct>JNIEnv</struct> 11968 </outptr> 11969 <description> 11970 The JNI environment of the event (current) thread. 11971 </description> 11972 </param> 11973 <param id="thread"> 11974 <jthread/> 11975 <description> 11976 Thread that hit the breakpoint 11977 </description> 11978 </param> 11979 <param id="klass"> 11980 <jclass method="method"/> 11981 <description> 11982 Class of the method that hit the breakpoint 11983 </description> 11984 </param> 11985 <param id="method"> 11986 <jmethodID class="klass"/> 11987 <description> 11988 Method that hit the breakpoint 11989 </description> 11990 </param> 11991 <param id="location"> 11992 <jlocation/> 11993 <description> 11994 location of the breakpoint 11995 </description> 11996 </param> 11997 </parameters> 11998 </event> 11999 12000 <event label="Field Access" 12001 id="FieldAccess" const="JVMTI_EVENT_FIELD_ACCESS" filtered="thread" num="63"> 12002 <description> 12003 Field access events are generated whenever a thread accesses 12004 a field that was designated as a watchpoint 12005 with <functionlink id="SetFieldAccessWatch"></functionlink>. 12006 The <code>method</code> and <code>location</code> 12007 parameters uniquely identify the current location and allow 12008 the mapping to source file and line number when that information is 12009 available. 12010 </description> 12011 <origin>jvmdi</origin> 12012 <capabilities> 12013 <required id="can_generate_field_access_events"></required> 12014 </capabilities> 12015 <parameters> 12016 <param id="jni_env"> 12017 <outptr> 12018 <struct>JNIEnv</struct> 12019 </outptr> 12020 <description> 12021 The JNI environment of the event (current) thread 12022 </description> 12023 </param> 12024 <param id="thread"> 12025 <jthread/> 12026 <description> 12027 Thread accessing the field 12028 </description> 12029 </param> 12030 <param id="klass"> 12031 <jclass method="method"/> 12032 <description> 12033 Class of the method where the access is occurring 12034 </description> 12035 </param> 12036 <param id="method"> 12037 <jmethodID class="klass"/> 12038 <description> 12039 Method where the access is occurring 12040 </description> 12041 </param> 12042 <param id="location"> 12043 <jlocation/> 12044 <description> 12045 Location where the access is occurring 12046 </description> 12047 </param> 12048 <param id="field_klass"> 12049 <jclass field="field"/> 12050 <description> 12051 Class of the field being accessed 12052 </description> 12053 </param> 12054 <param id="object"> 12055 <jobject/> 12056 <description> 12057 Object with the field being accessed if the field is an 12058 instance field; <code>NULL</code> otherwise 12059 </description> 12060 </param> 12061 <param id="field"> 12062 <jfieldID class="field_klass"/> 12063 <description> 12064 Field being accessed 12065 </description> 12066 </param> 12067 </parameters> 12068 </event> 12069 12070 <event label="Field Modification" 12071 id="FieldModification" const="JVMTI_EVENT_FIELD_MODIFICATION" filtered="thread" num="64"> 12072 <description> 12073 Field modification events are generated whenever a thread modifies 12074 a field that was designated as a watchpoint 12075 with <functionlink id="SetFieldModificationWatch"></functionlink>. 12076 The <code>method</code> and <code>location</code> 12077 parameters uniquely identify the current location and allow 12078 the mapping to source file and line number when that information is 12079 available. 12080 </description> 12081 <origin>jvmdi</origin> 12082 <capabilities> 12083 <required id="can_generate_field_modification_events"></required> 12084 </capabilities> 12085 <parameters> 12086 <param id="jni_env"> 12087 <outptr> 12088 <struct>JNIEnv</struct> 12089 </outptr> 12090 <description> 12091 The JNI environment of the event (current) thread 12092 </description> 12093 </param> 12094 <param id="thread"> 12095 <jthread/> 12096 <description> 12097 Thread modifying the field 12098 </description> 12099 </param> 12100 <param id="klass"> 12101 <jclass method="method"/> 12102 <description> 12103 Class of the method where the modification is occurring 12104 </description> 12105 </param> 12106 <param id="method"> 12107 <jmethodID class="klass"/> 12108 <description> 12109 Method where the modification is occurring 12110 </description> 12111 </param> 12112 <param id="location"> 12113 <jlocation/> 12114 <description> 12115 Location where the modification is occurring 12116 </description> 12117 </param> 12118 <param id="field_klass"> 12119 <jclass field="field"/> 12120 <description> 12121 Class of the field being modified 12122 </description> 12123 </param> 12124 <param id="object"> 12125 <jobject/> 12126 <description> 12127 Object with the field being modified if the field is an 12128 instance field; <code>NULL</code> otherwise 12129 </description> 12130 </param> 12131 <param id="field"> 12132 <jfieldID class="field_klass"/> 12133 <description> 12134 Field being modified 12135 </description> 12136 </param> 12137 <param id="signature_type"> 12138 <char/> 12139 <description> 12140 Signature type of the new value 12141 </description> 12142 </param> 12143 <param id="new_value"> 12144 <jvalue/> 12145 <description> 12146 The new value 12147 </description> 12148 </param> 12149 </parameters> 12150 </event> 12151 12152 <event label="Frame Pop" 12153 id="FramePop" const="JVMTI_EVENT_FRAME_POP" filtered="thread" num="61"> 12154 <description> 12155 Frame pop events are generated upon exit from a single method 12156 in a single frame as specified 12157 in a call to <functionlink id="NotifyFramePop"></functionlink>. 12158 This is true whether termination is caused by 12159 executing its return instruction 12160 or by throwing an exception to its caller 12161 (see <paramlink id="was_popped_by_exception"></paramlink>). 12162 However, frame pops caused by the <functionlink id="PopFrame"/> 12163 function are not reported. 12164 <p/> 12165 The location reported by <functionlink id="GetFrameLocation"></functionlink> 12166 identifies the executable location in the returning method, 12167 immediately prior to the return. 12168 </description> 12169 <origin>jvmdi</origin> 12170 <capabilities> 12171 <required id="can_generate_frame_pop_events"></required> 12172 </capabilities> 12173 <parameters> 12174 <param id="jni_env"> 12175 <outptr> 12176 <struct>JNIEnv</struct> 12177 </outptr> 12178 <description> 12179 The JNI environment of the event (current) thread 12180 </description> 12181 </param> 12182 <param id="thread"> 12183 <jthread/> 12184 <description> 12185 Thread that is popping the frame 12186 </description> 12187 </param> 12188 <param id="klass"> 12189 <jclass method="method"/> 12190 <description> 12191 Class of the method being popped 12192 </description> 12193 </param> 12194 <param id="method"> 12195 <jmethodID class="klass"/> 12196 <description> 12197 Method being popped 12198 </description> 12199 </param> 12200 <param id="was_popped_by_exception"> 12201 <jboolean/> 12202 <description> 12203 True if frame was popped by a thrown exception. 12204 False if method exited through its return instruction. 12205 </description> 12206 </param> 12207 </parameters> 12208 </event> 12209 12210 <event label="Method Entry" 12211 id="MethodEntry" const="JVMTI_EVENT_METHOD_ENTRY" filtered="thread" num="65"> 12212 <description> 12213 Method entry events are generated upon entry of Java 12214 programming language methods (including native methods). 12215 <p/> 12216 The location reported by <functionlink id="GetFrameLocation"></functionlink> 12217 identifies the initial executable location in 12218 the method. 12219 <p/> 12220 Enabling method 12221 entry or exit events will significantly degrade performance on many platforms and is thus 12222 not advised for performance critical usage (such as profiling). 12223 <internallink id="bci">Bytecode instrumentation</internallink> should be 12224 used in these cases. 12225 </description> 12226 <origin>jvmdi</origin> 12227 <capabilities> 12228 <required id="can_generate_method_entry_events"></required> 12229 </capabilities> 12230 <parameters> 12231 <param id="jni_env"> 12232 <outptr> 12233 <struct>JNIEnv</struct> 12234 </outptr> 12235 <description> 12236 The JNI environment of the event (current) thread 12237 </description> 12238 </param> 12239 <param id="thread"> 12240 <jthread/> 12241 <description> 12242 Thread entering the method 12243 </description> 12244 </param> 12245 <param id="klass"> 12246 <jclass method="method"/> 12247 <description> 12248 Class of the method being entered 12249 </description> 12250 </param> 12251 <param id="method"> 12252 <jmethodID class="klass"/> 12253 <description> 12254 Method being entered 12255 </description> 12256 </param> 12257 </parameters> 12258 </event> 12259 12260 <event label="Method Exit" 12261 id="MethodExit" const="JVMTI_EVENT_METHOD_EXIT" filtered="thread" num="66"> 12262 <description> 12263 Method exit events are generated upon exit from Java 12264 programming language methods (including native methods). 12265 This is true whether termination is caused by 12266 executing its return instruction 12267 or by throwing an exception to its caller 12268 (see <paramlink id="was_popped_by_exception"></paramlink>). 12269 <p/> 12270 The <code>method</code> field uniquely identifies the 12271 method being entered or exited. The <code>frame</code> field provides 12272 access to the stack frame for the method. 12273 <p/> 12274 The location reported by <functionlink id="GetFrameLocation"></functionlink> 12275 identifies the executable location in the returning method 12276 immediately prior to the return. 12277 <p/> 12278 Enabling method 12279 entry or exit events will significantly degrade performance on many platforms and is thus 12280 not advised for performance critical usage (such as profiling). 12281 <internallink id="bci">Bytecode instrumentation</internallink> should be 12282 used in these cases. 12283 </description> 12284 <origin>jvmdi</origin> 12285 <capabilities> 12286 <required id="can_generate_method_exit_events"></required> 12287 </capabilities> 12288 <parameters> 12289 <param id="jni_env"> 12290 <outptr> 12291 <struct>JNIEnv</struct> 12292 </outptr> 12293 <description> 12294 The JNI environment of the event (current) thread 12295 </description> 12296 </param> 12297 <param id="thread"> 12298 <jthread/> 12299 <description> 12300 Thread exiting the method 12301 </description> 12302 </param> 12303 <param id="klass"> 12304 <jclass method="method"/> 12305 <description> 12306 Class of the method being exited 12307 </description> 12308 </param> 12309 <param id="method"> 12310 <jmethodID class="klass"/> 12311 <description> 12312 Method being exited 12313 </description> 12314 </param> 12315 <param id="was_popped_by_exception"> 12316 <jboolean/> 12317 <description> 12318 True if frame was popped by a thrown exception. 12319 False if method exited through its return instruction. 12320 </description> 12321 </param> 12322 <param id="return_value"> 12323 <jvalue/> 12324 <description> 12325 The return value of the method being exited. 12326 Undefined and should not be used if 12327 <paramlink id="was_popped_by_exception"></paramlink> 12328 is true. 12329 </description> 12330 </param> 12331 </parameters> 12332 </event> 12333 12334 <event label="Native Method Bind" phase="any" 12335 id="NativeMethodBind" const="JVMTI_EVENT_NATIVE_METHOD_BIND" num="67"> 12336 <description> 12337 A Native Method Bind event is sent when a VM binds a 12338 Java programming language native method 12339 to the address of a function that implements the native method. 12340 This will occur when the native method is called for the first time 12341 and also occurs when the JNI function <code>RegisterNatives</code> is called. 12342 This event allows the bind to be redirected to an agent-specified 12343 proxy function. 12344 This event is not sent when the native method is unbound. 12345 Typically, this proxy function will need to be specific to a 12346 particular method or, to handle the general case, automatically 12347 generated assembly code, since after instrumentation code is 12348 executed the function at the original binding 12349 address will usually be invoked. 12350 The original binding can be restored or the redirection changed 12351 by use of the JNI function <code>RegisterNatives</code>. 12352 Some events may be sent during the primordial phase, JNI and 12353 most of <jvmti/> cannot be used at this time but the method and 12354 address can be saved for use later. 12355 </description> 12356 <origin>new</origin> 12357 <capabilities> 12358 <required id="can_generate_native_method_bind_events"></required> 12359 </capabilities> 12360 <parameters> 12361 <param id="jni_env"> 12362 <outptr> 12363 <struct>JNIEnv</struct> 12364 </outptr> 12365 <description> 12366 The JNI environment of the event (current) thread 12367 Will be <code>NULL</code> if sent during the primordial 12368 <functionlink id="GetPhase">phase</functionlink>. 12369 </description> 12370 </param> 12371 <param id="thread"> 12372 <jthread/> 12373 <description> 12374 Thread requesting the bind 12375 </description> 12376 </param> 12377 <param id="klass"> 12378 <jclass method="method"/> 12379 <description> 12380 Class of the method being bound 12381 </description> 12382 </param> 12383 <param id="method"> 12384 <jmethodID class="klass"/> 12385 <description> 12386 Native method being bound 12387 </description> 12388 </param> 12389 <param id="address"> 12390 <outptr><void/></outptr> 12391 <description> 12392 The address the VM is about to bind to--that is, the 12393 address of the implementation of the native method 12394 </description> 12395 </param> 12396 <param id="new_address_ptr"> 12397 <agentbuf><void/></agentbuf> 12398 <description> 12399 if the referenced address is changed (that is, if 12400 <code>*new_address_ptr</code> is set), the binding 12401 will instead be made to the supplied address. 12402 </description> 12403 </param> 12404 </parameters> 12405 </event> 12406 12407 <event label="Exception" 12408 id="Exception" const="JVMTI_EVENT_EXCEPTION" filtered="thread" num="58"> 12409 <description> 12410 Exception events are generated whenever an exception is first detected 12411 in a Java programming language method. 12412 Where "exception" means any <code>java.lang.Throwable</code>. 12413 The exception may have been thrown by a Java programming language or native 12414 method, but in the case of native methods, the event is not generated 12415 until the exception is first seen by a Java programming language method. If an exception is 12416 set and cleared in a native method (and thus is never visible to Java programming language code), 12417 no exception event is generated. 12418 <p/> 12419 The <code>method</code> and <code>location</code> 12420 parameters uniquely identify the current location 12421 (where the exception was detected) and allow 12422 the mapping to source file and line number when that information is 12423 available. The <code>exception</code> field identifies the thrown 12424 exception object. The <code>catch_method</code> 12425 and <code>catch_location</code> identify the location of the catch clause, 12426 if any, that handles the thrown exception. If there is no such catch clause, 12427 each field is set to 0. There is no guarantee that the thread will ever 12428 reach this catch clause. If there are native methods on the call stack 12429 between the throw location and the catch clause, the exception may 12430 be reset by one of those native methods. 12431 Similarly, exceptions that are reported as uncaught (<code>catch_klass</code> 12432 et al. set to 0) may in fact be caught by native code. 12433 Agents can check for these occurrences by monitoring 12434 <eventlink id="ExceptionCatch"></eventlink> events. 12435 Note that finally clauses are implemented as catch and re-throw. Therefore they 12436 will be reported in the catch location. 12437 </description> 12438 <origin>jvmdi</origin> 12439 <capabilities> 12440 <required id="can_generate_exception_events"></required> 12441 </capabilities> 12442 <parameters> 12443 <param id="jni_env"> 12444 <outptr> 12445 <struct>JNIEnv</struct> 12446 </outptr> 12447 <description> 12448 The JNI environment of the event (current) thread 12449 </description> 12450 </param> 12451 <param id="thread"> 12452 <jthread/> 12453 <description> 12454 Thread generating the exception 12455 </description> 12456 </param> 12457 <param id="klass"> 12458 <jclass method="method"/> 12459 <description> 12460 Class generating the exception 12461 </description> 12462 </param> 12463 <param id="method"> 12464 <jmethodID class="klass"/> 12465 <description> 12466 Method generating the exception 12467 </description> 12468 </param> 12469 <param id="location"> 12470 <jlocation/> 12471 <description> 12472 Location where exception occurred 12473 </description> 12474 </param> 12475 <param id="exception"> 12476 <jobject/> 12477 <description> 12478 The exception being thrown 12479 </description> 12480 </param> 12481 <param id="catch_klass"> 12482 <jclass method="catch_method"/> 12483 <description> 12484 Class that will catch the exception, or <code>NULL</code> if no known catch 12485 </description> 12486 </param> 12487 <param id="catch_method"> 12488 <jmethodID class="catch_klass"/> 12489 <description> 12490 Method that will catch the exception, or <code>NULL</code> if no known catch 12491 </description> 12492 </param> 12493 <param id="catch_location"> 12494 <jlocation/> 12495 <description> 12496 location which will catch the exception or zero if no known catch 12497 </description> 12498 </param> 12499 </parameters> 12500 </event> 12501 12502 <event label="Exception Catch" 12503 id="ExceptionCatch" const="JVMTI_EVENT_EXCEPTION_CATCH" filtered="thread" num="59"> 12504 <description> 12505 Exception catch events are generated whenever a thrown exception is caught. 12506 Where "exception" means any <code>java.lang.Throwable</code>. 12507 If the exception is caught in a Java programming language method, the event is generated 12508 when the catch clause is reached. If the exception is caught in a native 12509 method, the event is generated as soon as control is returned to a Java programming language 12510 method. Exception catch events are generated for any exception for which 12511 a throw was detected in a Java programming language method. 12512 Note that finally clauses are implemented as catch and re-throw. Therefore they 12513 will generate exception catch events. 12514 <p/> 12515 The <code>method</code> and <code>location</code> 12516 parameters uniquely identify the current location 12517 and allow the mapping to source file and line number when that information is 12518 available. For exceptions caught in a Java programming language method, the 12519 <code>exception</code> object identifies the exception object. Exceptions 12520 caught in native methods are not necessarily available by the time the 12521 exception catch is reported, so the <code>exception</code> field is set 12522 to <code>NULL</code>. 12523 </description> 12524 <origin>jvmdi</origin> 12525 <capabilities> 12526 <required id="can_generate_exception_events"></required> 12527 </capabilities> 12528 <parameters> 12529 <param id="jni_env"> 12530 <outptr> 12531 <struct>JNIEnv</struct> 12532 </outptr> 12533 <description> 12534 The JNI environment of the event (current) thread 12535 </description> 12536 </param> 12537 <param id="thread"> 12538 <jthread/> 12539 <description> 12540 Thread catching the exception 12541 </description> 12542 </param> 12543 <param id="klass"> 12544 <jclass method="method"/> 12545 <description> 12546 Class catching the exception 12547 </description> 12548 </param> 12549 <param id="method"> 12550 <jmethodID class="klass"/> 12551 <description> 12552 Method catching the exception 12553 </description> 12554 </param> 12555 <param id="location"> 12556 <jlocation/> 12557 <description> 12558 Location where exception is being caught 12559 </description> 12560 </param> 12561 <param id="exception"> 12562 <jobject/> 12563 <description> 12564 Exception being caught 12565 </description> 12566 </param> 12567 </parameters> 12568 </event> 12569 12570 <event label="Thread Start" 12571 id="ThreadStart" const="JVMTI_EVENT_THREAD_START" num="52" phase="start"> 12572 <description> 12573 Thread start events are generated by a new thread before its initial 12574 method executes. 12575 <p/> 12576 A thread may be listed in the array returned by 12577 <functionlink id="GetAllThreads"></functionlink> 12578 before its thread start event is generated. 12579 It is possible for other events to be generated 12580 on a thread before its thread start event. 12581 <p/> 12582 The event is sent on the newly started <paramlink id="thread"></paramlink>. 12583 </description> 12584 <origin>jvmdi</origin> 12585 <capabilities> 12586 </capabilities> 12587 <parameters> 12588 <param id="jni_env"> 12589 <outptr> 12590 <struct>JNIEnv</struct> 12591 </outptr> 12592 <description> 12593 The JNI environment of the event (current) thread. 12594 </description> 12595 </param> 12596 <param id="thread"> 12597 <jthread/> 12598 <description> 12599 Thread starting 12600 </description> 12601 </param> 12602 </parameters> 12603 </event> 12604 12605 <event label="Thread End" 12606 id="ThreadEnd" const="JVMTI_EVENT_THREAD_END" filtered="thread" num="53" phase="start"> 12607 <description> 12608 Thread end events are generated by a terminating thread 12609 after its initial method has finished execution. 12610 <p/> 12611 A thread may be listed in the array returned by 12612 <functionlink id="GetAllThreads"></functionlink> 12613 after its thread end event is generated. 12614 No events are generated on a thread 12615 after its thread end event. 12616 <p/> 12617 The event is sent on the dying <paramlink id="thread"></paramlink>. 12618 </description> 12619 <origin>jvmdi</origin> 12620 <capabilities> 12621 </capabilities> 12622 <parameters> 12623 <param id="jni_env"> 12624 <outptr> 12625 <struct>JNIEnv</struct> 12626 </outptr> 12627 <description> 12628 The JNI environment of the event (current) thread. 12629 </description> 12630 </param> 12631 <param id="thread"> 12632 <jthread/> 12633 <description> 12634 Thread ending 12635 </description> 12636 </param> 12637 </parameters> 12638 </event> 12639 12640 <event label="Class Load" 12641 id="ClassLoad" const="JVMTI_EVENT_CLASS_LOAD" filtered="thread" phase="start" num="55"> 12642 <description> 12643 A class load event is generated when a class is first loaded. The order 12644 of class load events generated by a particular thread are guaranteed 12645 to match the order of class loading within that thread. 12646 Array class creation does not generate a class load event. 12647 The creation of a primitive class (for example, java.lang.Integer.TYPE) 12648 does not generate a class load event. 12649 <p/> 12650 This event is sent at an early stage in loading the class. As 12651 a result the class should be used carefully. Note, for example, 12652 that methods and fields are not yet loaded, so queries for methods, 12653 fields, subclasses, and so on will not give correct results. 12654 See "Loading of Classes and Interfaces" in the <i>Java Language 12655 Specification</i>. For most 12656 purposes the <eventlink id="ClassPrepare"></eventlink> event will 12657 be more useful. 12658 </description> 12659 <origin>jvmdi</origin> 12660 <capabilities> 12661 </capabilities> 12662 <parameters> 12663 <param id="jni_env"> 12664 <outptr> 12665 <struct>JNIEnv</struct> 12666 </outptr> 12667 <description> 12668 The JNI environment of the event (current) thread 12669 </description> 12670 </param> 12671 <param id="thread"> 12672 <jthread/> 12673 <description> 12674 Thread loading the class 12675 </description> 12676 </param> 12677 <param id="klass"> 12678 <jclass/> 12679 <description> 12680 Class being loaded 12681 </description> 12682 </param> 12683 </parameters> 12684 </event> 12685 12686 <elide> 12687 <event label="Class Unload" 12688 id="ClassUnload" const="JVMTI_EVENT_CLASS_UNLOAD" num="57"> 12689 <description> 12690 A class unload event is generated when the class is about to be unloaded. 12691 Class unload events take place during garbage collection and must be 12692 handled extremely carefully. The garbage collector holds many locks 12693 and has suspended all other threads, so the event handler cannot depend 12694 on the ability to acquire any locks. The class unload event handler should 12695 do as little as possible, perhaps by queuing information to be processed 12696 later. In particular, the <code>jclass</code> should be used only in 12697 the JNI function <code>isSameObject</code> or in the following <jvmti/> functions: 12698 <ul> 12699 <li><functionlink id="GetClassSignature"></functionlink></li> 12700 <li><functionlink id="GetSourceFileName"></functionlink></li> 12701 <li><functionlink id="IsInterface"></functionlink></li> 12702 <li><functionlink id="IsArrayClass"></functionlink></li> 12703 </ul> 12704 </description> 12705 <origin>jvmdi</origin> 12706 <capabilities> 12707 </capabilities> 12708 <parameters> 12709 <param id="jni_env"> 12710 <outptr> 12711 <struct>JNIEnv</struct> 12712 </outptr> 12713 <description> 12714 The JNI environment of the event (current) thread 12715 </description> 12716 </param> 12717 <param id="thread"> 12718 <jthread/> 12719 <description> 12720 Thread generating the class unload 12721 </description> 12722 </param> 12723 <param id="klass"> 12724 <jclass/> 12725 <description> 12726 Class being unloaded 12727 </description> 12728 </param> 12729 </parameters> 12730 </event> 12731 </elide> 12732 12733 <event label="Class Prepare" 12734 id="ClassPrepare" const="JVMTI_EVENT_CLASS_PREPARE" filtered="thread" phase="start" num="56"> 12735 <description> 12736 A class prepare event is generated when class preparation is complete. 12737 At this point, class fields, methods, and implemented interfaces are 12738 available, and no code from the class has been executed. Since array 12739 classes never have fields or methods, class prepare events are not 12740 generated for them. Class prepare events are not generated for 12741 primitive classes (for example, <code>java.lang.Integer.TYPE</code>). 12742 </description> 12743 <origin>jvmdi</origin> 12744 <capabilities> 12745 </capabilities> 12746 <parameters> 12747 <param id="jni_env"> 12748 <outptr> 12749 <struct>JNIEnv</struct> 12750 </outptr> 12751 <description> 12752 The JNI environment of the event (current) thread 12753 </description> 12754 </param> 12755 <param id="thread"> 12756 <jthread/> 12757 <description> 12758 Thread generating the class prepare 12759 </description> 12760 </param> 12761 <param id="klass"> 12762 <jclass/> 12763 <description> 12764 Class being prepared 12765 </description> 12766 </param> 12767 </parameters> 12768 </event> 12769 12770 <event label="Class File Load Hook" phase="any" 12771 id="ClassFileLoadHook" const="JVMTI_EVENT_CLASS_FILE_LOAD_HOOK" num="54"> 12772 <description> 12773 This event is sent when the VM obtains class file data, 12774 but before it constructs 12775 the in-memory representation for that class. 12776 This event is also sent when the class is being modified by the 12777 <functionlink id="RetransformClasses"/> function or 12778 the <functionlink id="RedefineClasses"/> function, 12779 called in any <jvmti/> environment. 12780 The agent can instrument 12781 the existing class file data sent by the VM to include profiling/debugging hooks. 12782 See the description of 12783 <internallink id="bci">bytecode instrumentation</internallink> 12784 for usage information. 12785 <p/> 12786 When the capabilities 12787 <internallink id="jvmtiCapabilities.can_generate_early_class_hook_events"> 12788 <code>can_generate_early_class_hook_events</code></internallink> and 12789 <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events"> 12790 <code>can_generate_all_class_hook_events</code></internallink> 12791 are enabled then this event may be sent in the primordial phase. 12792 Otherwise, this event may be sent before the VM is initialized (the start 12793 <functionlink id="GetPhase">phase</functionlink>). 12794 Some classes might not be compatible 12795 with the function (eg. ROMized classes or implementation defined classes) and this event will 12796 not be generated for these classes. 12797 <p/> 12798 The agent must allocate the space for the modified 12799 class file data buffer 12800 using the memory allocation function 12801 <functionlink id="Allocate"></functionlink> because the 12802 VM is responsible for freeing the new class file data buffer 12803 using <functionlink id="Deallocate"></functionlink>. 12804 <p/> 12805 If the agent wishes to modify the class file, it must set 12806 <code>new_class_data</code> to point 12807 to the newly instrumented class file data buffer and set 12808 <code>new_class_data_len</code> to the length of that 12809 buffer before returning 12810 from this call. If no modification is desired, the agent simply 12811 does not set <code>new_class_data</code>. If multiple agents 12812 have enabled this event the results are chained. That is, if 12813 <code>new_class_data</code> has been set, it becomes the 12814 <code>class_data</code> for the next agent. 12815 <p/> 12816 When handling a class load in the live phase, then the 12817 <functionlink id="GetNamedModule"></functionlink> 12818 function can be used to map class loader and a package name to a module. 12819 When a class is being redefined or retransformed then 12820 <code>class_being_redefined</code> is non <code>NULL</code> and so 12821 the JNI <code>GetModule</code> function can also be used 12822 to obtain the Module. 12823 <p/> 12824 The order that this event is sent to each environment differs 12825 from other events. 12826 This event is sent to environments in the following order: 12827 <ul> 12828 <li><fieldlink id="can_retransform_classes" 12829 struct="jvmtiCapabilities">retransformation 12830 incapable</fieldlink> 12831 environments, in the 12832 order in which they were created 12833 </li> 12834 <li><fieldlink id="can_retransform_classes" 12835 struct="jvmtiCapabilities">retransformation 12836 capable</fieldlink> 12837 environments, in the 12838 order in which they were created 12839 </li> 12840 </ul> 12841 When triggered by <functionlink id="RetransformClasses"/>, 12842 this event is sent only to <fieldlink id="can_retransform_classes" 12843 struct="jvmtiCapabilities">retransformation 12844 capable</fieldlink> 12845 environments. 12846 </description> 12847 <origin>jvmpi</origin> 12848 <capabilities> 12849 <capability id="can_generate_all_class_hook_events"></capability> 12850 <capability id="can_generate_early_class_hook_events"></capability> 12851 </capabilities> 12852 <parameters> 12853 <param id="jni_env"> 12854 <outptr> 12855 <struct>JNIEnv</struct> 12856 </outptr> 12857 <description> 12858 The JNI environment of the event (current) thread. 12859 </description> 12860 </param> 12861 <param id="class_being_redefined"> 12862 <jclass/> 12863 <description> 12864 The class being 12865 <functionlink id="RedefineClasses">redefined</functionlink> or 12866 <functionlink id="RetransformClasses">retransformed</functionlink>. 12867 <code>NULL</code> if sent by class load. 12868 </description> 12869 </param> 12870 <param id="loader"> 12871 <jobject/> 12872 <description> 12873 The class loader loading the class. 12874 <code>NULL</code> if the bootstrap class loader. 12875 </description> 12876 </param> 12877 <param id="name"> 12878 <vmbuf><char/></vmbuf> 12879 <description> 12880 Name of class being loaded as a VM internal qualified name 12881 (for example, "java/util/List"), encoded as a 12882 <internallink id="mUTF">modified UTF-8</internallink> string. 12883 Note: if the class is defined with a <code>NULL</code> name or 12884 without a name specified, <code>name</code> will be <code>NULL</code>. 12885 </description> 12886 </param> 12887 <param id="protection_domain"> 12888 <jobject/> 12889 <description> 12890 The <code>ProtectionDomain</code> of the class. 12891 </description> 12892 </param> 12893 <param id="class_data_len"> 12894 <jint/> 12895 <description> 12896 Length of current class file data buffer. 12897 </description> 12898 </param> 12899 <param id="class_data"> 12900 <vmbuf><uchar/></vmbuf> 12901 <description> 12902 Pointer to the current class file data buffer. 12903 </description> 12904 </param> 12905 <param id="new_class_data_len"> 12906 <outptr><jint/></outptr> 12907 <description> 12908 Pointer to the length of the new class file data buffer. 12909 </description> 12910 </param> 12911 <param id="new_class_data"> 12912 <agentbuf incount="new_class_data_len"><uchar/></agentbuf> 12913 <description> 12914 Pointer to the pointer to the instrumented class file data buffer. 12915 </description> 12916 </param> 12917 </parameters> 12918 </event> 12919 12920 <event label="VM Start Event" 12921 id="VMStart" const="JVMTI_EVENT_VM_START" num="57" phase="start"> 12922 <description> 12923 The VM start event signals the start of the VM. 12924 At this time JNI is live but the VM is not yet fully initialized. 12925 Once this event is generated, the agent is free to call any JNI function. 12926 This event signals the beginning of the start phase, 12927 <jvmti/> functions permitted in the start phase may be called. 12928 <p/> 12929 The timing of this event may depend on whether the agent has added the 12930 <internallink id="jvmtiCapabilities.can_generate_early_vmstart"> 12931 <code>can_generate_early_vmstart</code></internallink> capability or not. 12932 If the capability has been added then the VM posts the event as early 12933 as possible. The VM is capable of executing bytecode but it may not have 12934 initialized to the point where it can load classes in modules other than 12935 <code>java.base</code>, or even arbitrary classes in <code>java.base</code>. 12936 Agents that do load-time instrumentation in this 12937 phase must take great care when instrumenting code that potentially 12938 executes in this phase. Extreme care should also be taken with JNI 12939 <code>FindClass</code> as it may not be possible to load classes and attempts 12940 to do so may result in unpredictable behavior, maybe even stability issues 12941 on some VM implementations. 12942 If the capability has not been added then the VM delays posting this 12943 event until it is capable of loading classes in modules other than 12944 <code>java.base</code> or the VM has completed its initialization. 12945 Agents that create more than one JVM TI environment, where the 12946 capability is added to some but not all environments, may observe the 12947 start phase beginning earlier in the JVM TI environments that possess 12948 the capabilty. 12949 <p/> 12950 In the case of VM start-up failure, this event will not be sent. 12951 </description> 12952 <origin>jvmdi</origin> 12953 <capabilities> 12954 </capabilities> 12955 <parameters> 12956 <param id="jni_env"> 12957 <outptr> 12958 <struct>JNIEnv</struct> 12959 </outptr> 12960 <description> 12961 The JNI environment of the event (current) thread. 12962 </description> 12963 </param> 12964 </parameters> 12965 </event> 12966 12967 <event label="VM Initialization Event" 12968 id="VMInit" const="JVMTI_EVENT_VM_INIT" num="50"> 12969 <description> 12970 The VM initialization event signals the completion of VM initialization. Once 12971 this event is generated, the agent is free to call any JNI or <jvmti/> 12972 function. The VM initialization event can be preceded by or can be concurrent 12973 with other events, but 12974 the preceding events should be handled carefully, if at all, because the 12975 VM has not completed its initialization. The thread start event for the 12976 main application thread is guaranteed not to occur until after the 12977 handler for the VM initialization event returns. 12978 <p/> 12979 In the case of VM start-up failure, this event will not be sent. 12980 </description> 12981 <origin>jvmdi</origin> 12982 <capabilities> 12983 </capabilities> 12984 <parameters> 12985 <param id="jni_env"> 12986 <outptr> 12987 <struct>JNIEnv</struct> 12988 </outptr> 12989 <description> 12990 The JNI environment of the event (current) thread. 12991 </description> 12992 </param> 12993 <param id="thread"> 12994 <jthread/> 12995 <description> 12996 The initial thread 12997 </description> 12998 </param> 12999 </parameters> 13000 </event> 13001 13002 <event label="VM Death Event" 13003 id="VMDeath" const="JVMTI_EVENT_VM_DEATH" num="51"> 13004 <description> 13005 The VM death event notifies the agent of the termination of the VM. 13006 No events will occur after the VMDeath event. 13007 <p/> 13008 In the case of VM start-up failure, this event will not be sent. 13009 Note that <internallink id="onunload">Agent_OnUnload</internallink> 13010 will still be called in these cases. 13011 </description> 13012 <origin>jvmdi</origin> 13013 <capabilities> 13014 </capabilities> 13015 <parameters> 13016 <param id="jni_env"> 13017 <outptr> 13018 <struct>JNIEnv</struct> 13019 </outptr> 13020 <description> 13021 The JNI environment of the event (current) thread 13022 </description> 13023 </param> 13024 </parameters> 13025 </event> 13026 13027 <event label="Compiled Method Load" phase="start" 13028 id="CompiledMethodLoad" const="JVMTI_EVENT_COMPILED_METHOD_LOAD" num="68"> 13029 <description> 13030 Sent when a method is compiled and loaded into memory by the VM. 13031 If it is unloaded, the <eventlink id="CompiledMethodUnload"/> event is sent. 13032 If it is moved, the <eventlink id="CompiledMethodUnload"/> event is sent, 13033 followed by a new <code>CompiledMethodLoad</code> event. 13034 Note that a single method may have multiple compiled forms, and that 13035 this event will be sent for each form. 13036 Note also that several methods may be inlined into a single 13037 address range, and that this event will be sent for each method. 13038 <p/> 13039 These events can be sent after their initial occurrence with 13040 <functionlink id="GenerateEvents"></functionlink>. 13041 </description> 13042 <origin>jvmpi</origin> 13043 <typedef id="jvmtiAddrLocationMap" label="Native address to location entry"> 13044 <field id="start_address"> 13045 <vmbuf><void/></vmbuf> 13046 <description> 13047 Starting native address of code corresponding to a location 13048 </description> 13049 </field> 13050 <field id="location"> 13051 <jlocation/> 13052 <description> 13053 Corresponding location. See 13054 <functionlink id="GetJLocationFormat"></functionlink> 13055 for the meaning of location. 13056 </description> 13057 </field> 13058 </typedef> 13059 <capabilities> 13060 <required id="can_generate_compiled_method_load_events"></required> 13061 </capabilities> 13062 <parameters> 13063 <param id="klass"> 13064 <jclass method="method"/> 13065 <description> 13066 Class of the method being compiled and loaded 13067 </description> 13068 </param> 13069 <param id="method"> 13070 <jmethodID class="klass"/> 13071 <description> 13072 Method being compiled and loaded 13073 </description> 13074 </param> 13075 <param id="code_size"> 13076 <jint/> 13077 <description> 13078 Size of compiled code 13079 </description> 13080 </param> 13081 <param id="code_addr"> 13082 <vmbuf><void/></vmbuf> 13083 <description> 13084 Address where compiled method code is loaded 13085 </description> 13086 </param> 13087 <param id="map_length"> 13088 <jint/> 13089 <description> 13090 Number of <typelink id="jvmtiAddrLocationMap"></typelink> 13091 entries in the address map. 13092 Zero if mapping information cannot be supplied. 13093 </description> 13094 </param> 13095 <param id="map"> 13096 <vmbuf><struct>jvmtiAddrLocationMap</struct></vmbuf> 13097 <description> 13098 Map from native addresses to location. 13099 The native address range of each entry is from 13100 <fieldlink id="start_address" struct="jvmtiAddrLocationMap"></fieldlink> 13101 to <code>start_address-1</code> of the next entry. 13102 <code>NULL</code> if mapping information cannot be supplied. 13103 </description> 13104 </param> 13105 <param id="compile_info"> 13106 <vmbuf><void/></vmbuf> 13107 <description> 13108 VM-specific compilation information. 13109 The referenced compile information is managed by the VM 13110 and must not depend on the agent for collection. 13111 A VM implementation defines the content and lifetime 13112 of the information. 13113 </description> 13114 </param> 13115 </parameters> 13116 </event> 13117 13118 <event label="Compiled Method Unload" phase="start" 13119 id="CompiledMethodUnload" const="JVMTI_EVENT_COMPILED_METHOD_UNLOAD" num="69"> 13120 <description> 13121 Sent when a compiled method is unloaded from memory. 13122 This event might not be sent on the thread which performed the unload. 13123 This event may be sent sometime after the unload occurs, but 13124 will be sent before the memory is reused 13125 by a newly generated compiled method. This event may be sent after 13126 the class is unloaded. 13127 </description> 13128 <origin>jvmpi</origin> 13129 <capabilities> 13130 <required id="can_generate_compiled_method_load_events"></required> 13131 </capabilities> 13132 <parameters> 13133 <param id="klass"> 13134 <jclass method="method"/> 13135 <description> 13136 Class of the compiled method being unloaded. 13137 </description> 13138 </param> 13139 <param id="method"> 13140 <jmethodID class="klass"/> 13141 <description> 13142 Compiled method being unloaded. 13143 For identification of the compiled method only -- the class 13144 may be unloaded and therefore the method should not be used 13145 as an argument to further JNI or <jvmti/> functions. 13146 </description> 13147 </param> 13148 <param id="code_addr"> 13149 <vmbuf><void/></vmbuf> 13150 <description> 13151 Address where compiled method code was loaded. 13152 For identification of the compiled method only -- 13153 the space may have been reclaimed. 13154 </description> 13155 </param> 13156 </parameters> 13157 </event> 13158 13159 <event label="Dynamic Code Generated" phase="any" 13160 id="DynamicCodeGenerated" const="JVMTI_EVENT_DYNAMIC_CODE_GENERATED" num="70"> 13161 <description> 13162 Sent when a component of the virtual machine is generated dynamically. 13163 This does not correspond to Java programming language code that is 13164 compiled--see <eventlink id="CompiledMethodLoad"></eventlink>. 13165 This is for native code--for example, an interpreter that is generated 13166 differently depending on command-line options. 13167 <p/> 13168 Note that this event has no controlling capability. 13169 If a VM cannot generate these events, it simply does not send any. 13170 <p/> 13171 These events can be sent after their initial occurrence with 13172 <functionlink id="GenerateEvents"></functionlink>. 13173 </description> 13174 <origin>jvmpi</origin> 13175 <capabilities> 13176 </capabilities> 13177 <parameters> 13178 <param id="name"> 13179 <vmbuf><char/></vmbuf> 13180 <description> 13181 Name of the code, encoded as a 13182 <internallink id="mUTF">modified UTF-8</internallink> string. 13183 Intended for display to an end-user. 13184 The name might not be unique. 13185 </description> 13186 </param> 13187 <param id="address"> 13188 <vmbuf><void/></vmbuf> 13189 <description> 13190 Native address of the code 13191 </description> 13192 </param> 13193 <param id="length"> 13194 <jint/> 13195 <description> 13196 Length in bytes of the code 13197 </description> 13198 </param> 13199 </parameters> 13200 </event> 13201 13202 <event label="Data Dump Request" 13203 id="DataDumpRequest" const="JVMTI_EVENT_DATA_DUMP_REQUEST" num="71"> 13204 <description> 13205 Sent by the VM to request the agent to dump its data. This 13206 is just a hint and the agent need not react to this event. 13207 This is useful for processing command-line signals from users. For 13208 example, in the Java 2 SDK a CTRL-Break on Win32 and a CTRL-\ on Solaris 13209 causes the VM to send this event to the agent. 13210 </description> 13211 <origin>jvmpi</origin> 13212 <capabilities> 13213 </capabilities> 13214 <parameters> 13215 </parameters> 13216 </event> 13217 13218 <event label="Monitor Contended Enter" 13219 id="MonitorContendedEnter" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTER" filtered="thread" num="75"> 13220 <description> 13221 Sent when a thread is attempting to enter a Java programming language 13222 monitor already acquired by another thread. 13223 </description> 13224 <origin>jvmpi</origin> 13225 <capabilities> 13226 <required id="can_generate_monitor_events"></required> 13227 </capabilities> 13228 <parameters> 13229 <param id="jni_env"> 13230 <outptr> 13231 <struct>JNIEnv</struct> 13232 </outptr> 13233 <description> 13234 The JNI environment of the event (current) thread 13235 </description> 13236 </param> 13237 <param id="thread"> 13238 <jthread/> 13239 <description> 13240 JNI local reference to the thread 13241 attempting to enter the monitor 13242 </description> 13243 </param> 13244 <param id="object"> 13245 <jobject/> 13246 <description> 13247 JNI local reference to the monitor 13248 </description> 13249 </param> 13250 </parameters> 13251 </event> 13252 13253 <event label="Monitor Contended Entered" 13254 id="MonitorContendedEntered" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTERED" filtered="thread" num="76"> 13255 <description> 13256 Sent when a thread enters a Java programming language 13257 monitor after waiting for it to be released by another thread. 13258 </description> 13259 <origin>jvmpi</origin> 13260 <capabilities> 13261 <required id="can_generate_monitor_events"></required> 13262 </capabilities> 13263 <parameters> 13264 <param id="jni_env"> 13265 <outptr> 13266 <struct>JNIEnv</struct> 13267 </outptr> 13268 <description> 13269 The JNI environment of the event (current) thread 13270 </description> 13271 </param> 13272 <param id="thread"> 13273 <jthread/> 13274 <description> 13275 JNI local reference to the thread entering 13276 the monitor 13277 </description> 13278 </param> 13279 <param id="object"> 13280 <jobject/> 13281 <description> 13282 JNI local reference to the monitor 13283 </description> 13284 </param> 13285 </parameters> 13286 </event> 13287 13288 <event label="Monitor Wait" 13289 id="MonitorWait" const="JVMTI_EVENT_MONITOR_WAIT" filtered="thread" num="73"> 13290 <description> 13291 Sent when a thread is about to wait on an object. 13292 </description> 13293 <origin>jvmpi</origin> 13294 <capabilities> 13295 <required id="can_generate_monitor_events"></required> 13296 </capabilities> 13297 <parameters> 13298 <param id="jni_env"> 13299 <outptr> 13300 <struct>JNIEnv</struct> 13301 </outptr> 13302 <description> 13303 The JNI environment of the event (current) thread 13304 </description> 13305 </param> 13306 <param id="thread"> 13307 <jthread/> 13308 <description> 13309 JNI local reference to the thread about to wait 13310 </description> 13311 </param> 13312 <param id="object"> 13313 <jobject/> 13314 <description> 13315 JNI local reference to the monitor 13316 </description> 13317 </param> 13318 <param id="timeout"> 13319 <jlong/> 13320 <description> 13321 The number of milliseconds the thread will wait 13322 </description> 13323 </param> 13324 </parameters> 13325 </event> 13326 13327 <event label="Monitor Waited" 13328 id="MonitorWaited" const="JVMTI_EVENT_MONITOR_WAITED" filtered="thread" num="74"> 13329 <description> 13330 Sent when a thread finishes waiting on an object. 13331 </description> 13332 <origin>jvmpi</origin> 13333 <capabilities> 13334 <required id="can_generate_monitor_events"></required> 13335 </capabilities> 13336 <parameters> 13337 <param id="jni_env"> 13338 <outptr> 13339 <struct>JNIEnv</struct> 13340 </outptr> 13341 <description> 13342 The JNI environment of the event (current) thread 13343 </description> 13344 </param> 13345 <param id="thread"> 13346 <jthread/> 13347 <description> 13348 JNI local reference to the thread that was finished waiting 13349 </description> 13350 </param> 13351 <param id="object"> 13352 <jobject/> 13353 <description> 13354 JNI local reference to the monitor. 13355 </description> 13356 </param> 13357 <param id="timed_out"> 13358 <jboolean/> 13359 <description> 13360 True if the monitor timed out 13361 </description> 13362 </param> 13363 </parameters> 13364 </event> 13365 13366 <event label="Resource Exhausted" 13367 id="ResourceExhausted" const="JVMTI_EVENT_RESOURCE_EXHAUSTED" num="80" 13368 since="1.1"> 13369 <description> 13370 Sent when a VM resource needed by a running application has been exhausted. 13371 Except as required by the optional capabilities, the set of resources 13372 which report exhaustion is implementation dependent. 13373 <p/> 13374 The following bit flags define the properties of the resource exhaustion: 13375 <constants id="jvmtiResourceExhaustionFlags" 13376 label="Resource Exhaustion Flags" 13377 kind="bits" 13378 since="1.1"> 13379 <constant id="JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR" num="0x0001"> 13380 After this event returns, the VM will throw a 13381 <code>java.lang.OutOfMemoryError</code>. 13382 </constant> 13383 <constant id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP" num="0x0002"> 13384 The VM was unable to allocate memory from the <tm>Java</tm> 13385 platform <i>heap</i>. 13386 The <i>heap</i> is the runtime 13387 data area from which memory for all class instances and 13388 arrays are allocated. 13389 </constant> 13390 <constant id="JVMTI_RESOURCE_EXHAUSTED_THREADS" num="0x0004"> 13391 The VM was unable to create a thread. 13392 </constant> 13393 </constants> 13394 </description> 13395 <origin>new</origin> 13396 <capabilities> 13397 <capability id="can_generate_resource_exhaustion_heap_events"> 13398 Can generate events when the VM is unable to allocate memory from the 13399 <internallink id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP">heap</internallink>. 13400 </capability> 13401 <capability id="can_generate_resource_exhaustion_threads_events"> 13402 Can generate events when the VM is unable to 13403 <internallink id="JVMTI_RESOURCE_EXHAUSTED_THREADS">create 13404 a thread</internallink>. 13405 </capability> 13406 </capabilities> 13407 <parameters> 13408 <param id="jni_env"> 13409 <outptr> 13410 <struct>JNIEnv</struct> 13411 </outptr> 13412 <description> 13413 The JNI environment of the event (current) thread 13414 </description> 13415 </param> 13416 <param id="flags"> 13417 <jint/> 13418 <description> 13419 Flags defining the properties of the of resource exhaustion 13420 as specified by the 13421 <internallink id="jvmtiResourceExhaustionFlags">Resource 13422 Exhaustion Flags</internallink>. 13423 </description> 13424 </param> 13425 <param id="reserved"> 13426 <vmbuf><void/></vmbuf> 13427 <description> 13428 Reserved. 13429 </description> 13430 </param> 13431 <param id="description"> 13432 <vmbuf><char/></vmbuf> 13433 <description> 13434 Description of the resource exhaustion, encoded as a 13435 <internallink id="mUTF">modified UTF-8</internallink> string. 13436 </description> 13437 </param> 13438 </parameters> 13439 </event> 13440 13441 <event label="VM Object Allocation" 13442 id="VMObjectAlloc" const="JVMTI_EVENT_VM_OBJECT_ALLOC" num="84"> 13443 <description> 13444 Sent when a method causes the virtual machine to allocate an 13445 Object visible to Java programming language code and the 13446 allocation is not detectable by other intrumentation mechanisms. 13447 Generally object allocation should be detected by instrumenting 13448 the bytecodes of allocating methods. 13449 Object allocation generated in native code by JNI function 13450 calls should be detected using 13451 <internallink id="jniIntercept">JNI function interception</internallink>. 13452 Some methods might not have associated bytecodes and are not 13453 native methods, they instead are executed directly by the 13454 VM. These methods should send this event. 13455 Virtual machines which are incapable of bytecode instrumentation 13456 for some or all of their methods can send this event. 13457 <p/> 13458 Typical examples where this event might be sent: 13459 <ul> 13460 <li>Reflection -- for example, <code>java.lang.Class.newInstance()</code></li> 13461 <li>Methods not represented by bytecodes -- for example, VM intrinsics and 13462 J2ME preloaded classes</li> 13463 </ul> 13464 Cases where this event would not be generated: 13465 <ul> 13466 <li>Allocation due to bytecodes -- for example, the <code>new</code> 13467 and <code>newarray</code> VM instructions</li> 13468 <li>Allocation due to JNI function calls -- for example, 13469 <code>AllocObject</code></li> 13470 <li>Allocations during VM initialization</li> 13471 <li>VM internal objects</li> 13472 </ul> 13473 </description> 13474 <origin>new</origin> 13475 <capabilities> 13476 <required id="can_generate_vm_object_alloc_events"></required> 13477 </capabilities> 13478 <parameters> 13479 <param id="jni_env"> 13480 <outptr> 13481 <struct>JNIEnv</struct> 13482 </outptr> 13483 <description> 13484 The JNI environment of the event (current) thread 13485 </description> 13486 </param> 13487 <param id="thread"> 13488 <jthread/> 13489 <description> 13490 Thread allocating the object. 13491 </description> 13492 </param> 13493 <param id="object"> 13494 <jobject/> 13495 <description> 13496 JNI local reference to the object that was allocated 13497 </description> 13498 </param> 13499 <param id="object_klass"> 13500 <jclass/> 13501 <description> 13502 JNI local reference to the class of the object 13503 </description> 13504 </param> 13505 <param id="size"> 13506 <jlong/> 13507 <description> 13508 Size of the object (in bytes). See <functionlink id="GetObjectSize"/>. 13509 </description> 13510 </param> 13511 </parameters> 13512 </event> 13513 13514 <event label="Object Free" 13515 id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83"> 13516 <description> 13517 An Object Free event is sent when the garbage collector frees an object. 13518 Events are only sent for tagged objects--see 13519 <internallink id="Heap">heap functions</internallink>. 13520 <p/> 13521 The event handler must not use JNI functions and 13522 must not use <jvmti/> functions except those which 13523 specifically allow such use (see the raw monitor, memory management, 13524 and environment local storage functions). 13525 </description> 13526 <origin>new</origin> 13527 <capabilities> 13528 <required id="can_generate_object_free_events"></required> 13529 </capabilities> 13530 <parameters> 13531 <param id="tag"> 13532 <jlong/> 13533 <description> 13534 The freed object's tag 13535 </description> 13536 </param> 13537 </parameters> 13538 </event> 13539 13540 <event label="Garbage Collection Start" 13541 id="GarbageCollectionStart" const="JVMTI_EVENT_GARBAGE_COLLECTION_START" num="81"> 13542 <description> 13543 A Garbage Collection Start event is sent when a 13544 garbage collection pause begins. 13545 Only stop-the-world collections are reported--that is, collections during 13546 which all threads cease to modify the state of the Java virtual machine. 13547 This means that some collectors will never generate these events. 13548 This event is sent while the VM is still stopped, thus 13549 the event handler must not use JNI functions and 13550 must not use <jvmti/> functions except those which 13551 specifically allow such use (see the raw monitor, memory management, 13552 and environment local storage functions). 13553 <p/> 13554 This event is always sent as a matched pair with 13555 <eventlink id="GarbageCollectionFinish"/> 13556 (assuming both events are enabled) and no garbage collection 13557 events will occur between them. 13558 </description> 13559 <origin>new</origin> 13560 <capabilities> 13561 <required id="can_generate_garbage_collection_events"></required> 13562 </capabilities> 13563 <parameters> 13564 </parameters> 13565 </event> 13566 13567 <event label="Garbage Collection Finish" 13568 id="GarbageCollectionFinish" const="JVMTI_EVENT_GARBAGE_COLLECTION_FINISH" num="82"> 13569 <description> 13570 A Garbage Collection Finish event is sent when a 13571 garbage collection pause ends. 13572 This event is sent while the VM is still stopped, thus 13573 the event handler must not use JNI functions and 13574 must not use <jvmti/> functions except those which 13575 specifically allow such use (see the raw monitor, memory management, 13576 and environment local storage functions). 13577 <p/> 13578 Some agents may need to do post garbage collection operations that 13579 require the use of the disallowed <jvmti/> or JNI functions. For these 13580 cases an agent thread can be created which waits on a raw monitor, 13581 and the handler for the Garbage Collection Finish event simply 13582 notifies the raw monitor 13583 <p/> 13584 This event is always sent as a matched pair with 13585 <eventlink id="GarbageCollectionStart"/> (assuming both events are enabled). 13586 <issue> 13587 The most important use of this event is to provide timing information, 13588 and thus additional information is not required. However, 13589 information about the collection which is "free" should be included - 13590 what that information is needs to be determined. 13591 </issue> 13592 </description> 13593 <origin>new</origin> 13594 <capabilities> 13595 <required id="can_generate_garbage_collection_events"></required> 13596 </capabilities> 13597 <parameters> 13598 </parameters> 13599 </event> 13600 13601 <elide> 13602 <event label="Verbose Output" phase="any" 13603 id="VerboseOutput" const="JVMTI_EVENT_VERBOSE_OUTPUT" num="85"> 13604 <description> 13605 Send verbose messages as strings. 13606 <issue> 13607 This format is extremely fragile, as it can change with each 13608 platform, collector and version. Alternatives include: 13609 <ul> 13610 <li>building off Java programming language M and M APIs</li> 13611 <li>XML</li> 13612 <li>key/value pairs</li> 13613 <li>removing it</li> 13614 </ul> 13615 </issue> 13616 <issue> 13617 Though this seemed trivial to implement. 13618 In the RI it appears this will be quite complex. 13619 </issue> 13620 </description> 13621 <origin>new</origin> 13622 <capabilities> 13623 </capabilities> 13624 <parameters> 13625 <param id="flag"> 13626 <enum>jvmtiVerboseFlag</enum> 13627 <description> 13628 Which verbose output is being sent. 13629 </description> 13630 </param> 13631 <param id="message"> 13632 <vmbuf><char/></vmbuf> 13633 <description> 13634 Message text, encoded as a 13635 <internallink id="mUTF">modified UTF-8</internallink> string. 13636 </description> 13637 </param> 13638 </parameters> 13639 </event> 13640 </elide> 13641 13642 </eventsection> 13643 13644 <datasection> 13645 <intro> 13646 <jvmti/> extends the data types defined by JNI. 13647 </intro> 13648 <basetypes id="jniTypes" label="JNI Types Used in the JVM Tool Interface"> 13649 <basetype id="jboolean"> 13650 <description> 13651 Holds a Java programming language <code>boolean</code>. 13652 Unsigned 8 bits. 13653 </description> 13654 </basetype> 13655 <basetype id="jchar"> 13656 <description> 13657 Holds a Java programming language <code>char</code>. 13658 Unsigned 16 bits. 13659 </description> 13660 </basetype> 13661 <basetype id="jint"> 13662 <description> 13663 Holds a Java programming language <code>int</code>. 13664 Signed 32 bits. 13665 </description> 13666 </basetype> 13667 <basetype id="jlong"> 13668 <description> 13669 Holds a Java programming language <code>long</code>. 13670 Signed 64 bits. 13671 </description> 13672 </basetype> 13673 <basetype id="jfloat"> 13674 <description> 13675 Holds a Java programming language <code>float</code>. 13676 32 bits. 13677 </description> 13678 </basetype> 13679 <basetype id="jdouble"> 13680 <description> 13681 Holds a Java programming language <code>double</code>. 13682 64 bits. 13683 </description> 13684 </basetype> 13685 <basetype id="jobject"> 13686 <description> 13687 Holds a Java programming language object. 13688 </description> 13689 </basetype> 13690 <basetype id="jclass"> 13691 <description> 13692 Holds a Java programming language class. 13693 </description> 13694 </basetype> 13695 <basetype id="jvalue"> 13696 <description> 13697 Is a union of all primitive types and <code>jobject</code>. Thus, holds any Java 13698 programming language value. 13699 </description> 13700 </basetype> 13701 <basetype id="jfieldID"> 13702 <description> 13703 Identifies a Java programming language field. 13704 <code>jfieldID</code>s returned by <jvmti/> functions and events may be 13705 safely stored. 13706 </description> 13707 </basetype> 13708 <basetype id="jmethodID"> 13709 <description> 13710 Identifies a Java programming language method, initializer, or constructor. 13711 <code>jmethodID</code>s returned by <jvmti/> functions and events may be 13712 safely stored. However, if the class is unloaded, they become invalid 13713 and must not be used. 13714 </description> 13715 </basetype> 13716 <basetype id="JNIEnv"> 13717 <description> 13718 Pointer to the JNI function table. Pointer to this (<code>JNIEnv *</code>) 13719 is a JNI environment. 13720 </description> 13721 </basetype> 13722 </basetypes> 13723 13724 <basetypes id="jvmtiTypes" label="JVM Tool Interface Base Types"> 13725 <basetype id="jvmtiEnv"> 13726 <description> 13727 The <jvmti/> <internallink id="environments">environment</internallink> pointer. 13728 See the <internallink id="FunctionSection">Function Section</internallink>. 13729 <code>jvmtiEnv</code> points to the 13730 <internallink id="FunctionTable">function table</internallink> pointer. 13731 </description> 13732 </basetype> 13733 <basetype id="jthread"> 13734 <definition>typedef jobject jthread;</definition> 13735 <description> 13736 Subtype of <datalink id="jobject"></datalink> that holds a thread. 13737 </description> 13738 </basetype> 13739 <basetype id="jthreadGroup"> 13740 <definition>typedef jobject jthreadGroup;</definition> 13741 <description> 13742 Subtype of <datalink id="jobject"></datalink> that holds a thread group. 13743 </description> 13744 </basetype> 13745 <basetype id="jlocation"> 13746 <definition>typedef jlong jlocation;</definition> 13747 <description> 13748 A 64 bit value, representing a monotonically increasing 13749 executable position within a method. 13750 <code>-1</code> indicates a native method. 13751 See <functionlink id="GetJLocationFormat"></functionlink> for the format on a 13752 given VM. 13753 </description> 13754 </basetype> 13755 <basetype id="jrawMonitorID"> 13756 <definition>struct _jrawMonitorID; 13757 typedef struct _jrawMonitorID *jrawMonitorID;</definition> 13758 <description> 13759 A raw monitor. 13760 </description> 13761 </basetype> 13762 <basetype id="jvmtiError"> 13763 <description> 13764 Holds an error return code. 13765 See the <internallink id="ErrorSection">Error section</internallink> for possible values. 13766 <example> 13767 typedef enum { 13768 JVMTI_ERROR_NONE = 0, 13769 JVMTI_ERROR_INVALID_THREAD = 10, 13770 ... 13771 } jvmtiError; 13772 </example> 13773 </description> 13774 </basetype> 13775 <basetype id="jvmtiEvent"> 13776 <description> 13777 An identifier for an event type. 13778 See the <internallink id="EventSection">Event section</internallink> for possible values. 13779 It is guaranteed that future versions of this specification will 13780 never assign zero as an event type identifier. 13781 <example> 13782 typedef enum { 13783 JVMTI_EVENT_SINGLE_STEP = 1, 13784 JVMTI_EVENT_BREAKPOINT = 2, 13785 ... 13786 } jvmtiEvent; 13787 </example> 13788 </description> 13789 </basetype> 13790 <basetype id="jvmtiEventCallbacks" name="eventCallbacks"> 13791 <description> 13792 The callbacks used for events. 13793 <example> 13794 typedef struct { 13795 jvmtiEventVMInit VMInit; 13796 jvmtiEventVMDeath VMDeath; 13797 ... 13798 } jvmtiEventCallbacks; 13799 </example> 13800 See <internallink id="jvmtiEventCallbacks">event callbacks</internallink> 13801 for the complete structure. 13802 <p/> 13803 Where, for example, the VM initialization callback is defined: 13804 <example> 13805 typedef void (JNICALL *jvmtiEventVMInit) 13806 (jvmtiEnv *jvmti_env, 13807 JNIEnv* jni_env, 13808 jthread thread); 13809 </example> 13810 See the individual events for the callback function definition. 13811 </description> 13812 </basetype> 13813 <basetype id="jniNativeInterface"> 13814 <definition>typedef struct JNINativeInterface_ jniNativeInterface;</definition> 13815 <description> 13816 Typedef for the JNI function table <code>JNINativeInterface</code> 13817 defined in the 13818 <externallink id="jni/functions.html#interface-function-table"> 13819 JNI Specification</externallink>. 13820 The JNI reference implementation defines this with an underscore. 13821 </description> 13822 </basetype> 13823 </basetypes> 13824 13825 </datasection> 13826 13827 <issuessection label="Issues"> 13828 <intro id="suspendRequired" label="Resolved Issue: Suspend - Required or Automatic"> 13829 JVMDI requires that the agent suspend threads before calling 13830 certain sensitive functions. JVMPI requires garbage collection to be 13831 disabled before calling certain sensitive functions. 13832 It was suggested that rather than have this requirement, that 13833 VM place itself in a suitable state before performing an 13834 operation. This makes considerable sense since each VM 13835 knows its requirements and can most easily arrange a 13836 safe state. 13837 <p/> 13838 The ability to externally suspend/resume threads will, of 13839 course, remain. The ability to enable/disable garbage collection will not. 13840 <p/> 13841 This issue is resolved--suspend will not 13842 be required. The spec has been updated to reflect this. 13843 </intro> 13844 13845 <intro id="stackSampling" label="Resolved Issue: Call Stack Sampling"> 13846 There are a variety of approaches to sampling call stacks. 13847 The biggest bifurcation is between VM controlled and agent 13848 controlled. 13849 <p/> 13850 This issue is resolved--agent controlled 13851 sampling will be the approach. 13852 </intro> 13853 13854 <intro id="threadRepresentation" label="Resolved Issue: Thread Representation"> 13855 JVMDI represents threads as jthread. JVMPI primarily 13856 uses JNIEnv* to represent threads. 13857 <p/> 13858 The Expert Group has chosen jthread as the representation 13859 for threads in <jvmti/>. 13860 JNIEnv* is sent by 13861 events since it is needed to JNI functions. JNIEnv, per the 13862 JNI spec, are not supposed to be used outside their thread. 13863 </intro> 13864 13865 <intro id="design" label="Resolved Issue: Method Representation"> 13866 The JNI spec allows an implementation to depend on jclass/jmethodID 13867 pairs, rather than simply a jmethodID, to reference a method. 13868 JVMDI, for consistency, choose the same representation. 13869 JVMPI, however, specifies that a jmethodID alone maps to a 13870 method. Both of the Sun <tm>J2SE</tm> virtual machines (Classic and <tm>HotSpot</tm>) store 13871 pointers in jmethodIDs, and as a result, a jmethodID is sufficient. 13872 In fact, any JVM implementation that supports JVMPI must have 13873 such a representation. 13874 <jvmti/> will use jmethodID as a unique representation of a method 13875 (no jclass is used). 13876 There should be efficiency gains, particularly in 13877 functionality like stack dumping, to this representation. 13878 <p/> 13879 Note that fields were not used in JVMPI and that the access profile 13880 of fields differs from methods--for implementation efficiency 13881 reasons, a jclass/jfieldID pair will still be needed for field 13882 reference. 13883 </intro> 13884 13885 <intro id="localReferenceIssue" label="Resolved Issue: Local References"> 13886 Functions return local references. 13887 </intro> 13888 13889 <intro id="frameRep" label="Resolved Issue: Representation of frames"> 13890 In JVMDI, a frame ID is used to represent a frame. Problem with this 13891 is that a VM must track when a frame becomes invalid, a far better 13892 approach, and the one used in <jvmti/>, is to reference frames by depth. 13893 </intro> 13894 13895 <intro id="requiredCapabilities" label="Issue: Required Capabilities"> 13896 Currently, having a required capabilities means that the functionality 13897 is optional. Capabilities are useful even for required functionality 13898 since they can inform the VM is needed set-up. Thus, there should be 13899 a set of capabilities that a conformant implementation must provide 13900 (if requested during Agent_OnLoad). 13901 </intro> 13902 13903 <intro id="taghint" label="Proposal: add tag hint function"> 13904 A hint of the percentage of objects that will be tagged would 13905 help the VM pick a good implementation. 13906 </intro> 13907 13908 <intro id="moreMonitorQueries" label="Request: More Monitor Quires"> 13909 How difficult or easy would be to extend the monitor_info category to include 13910 <pre> 13911 - current number of monitors 13912 - enumeration of monitors 13913 - enumeration of threads waiting on a given monitor 13914 </pre> 13915 The reason for my question is the fact that current get_monitor_info support 13916 requires the agent to specify a given thread to get the info which is probably 13917 OK in the profiling/debugging space, while in the monitoring space the agent 13918 could be watching the monitor list and then decide which thread to ask for 13919 the info. You might ask why is this important for monitoring .... I think it 13920 can aid in the detection/prediction of application contention caused by hot-locks. 13921 </intro> 13922 </issuessection> 13923 13924 <changehistory id="ChangeHistory" update="09/05/07"> 13925 <intro> 13926 The <jvmti/> specification is an evolving document with major, minor, 13927 and micro version numbers. 13928 A released version of the specification is uniquely identified 13929 by its major and minor version. 13930 The functions, events, and capabilities in this specification 13931 indicate a "Since" value which is the major and minor version in 13932 which it was introduced. 13933 The version of the specification implemented by the VM can 13934 be retrieved at runtime with the <functionlink id="GetVersionNumber"/> 13935 function. 13936 </intro> 13937 <change date="14 Nov 2002"> 13938 Converted to XML document. 13939 </change> 13940 <change date="14 Nov 2002"> 13941 Elided heap dump functions (for now) since what was there 13942 was wrong. 13943 </change> 13944 <change date="18 Nov 2002"> 13945 Added detail throughout. 13946 </change> 13947 <change date="18 Nov 2002"> 13948 Changed JVMTI_THREAD_STATUS_RUNNING to JVMTI_THREAD_STATUS_RUNNABLE. 13949 </change> 13950 <change date="19 Nov 2002"> 13951 Added AsyncGetStackTrace. 13952 </change> 13953 <change date="19 Nov 2002"> 13954 Added jframeID return to GetStackTrace. 13955 </change> 13956 <change date="19 Nov 2002"> 13957 Elided GetCurrentFrame and GetCallingFrame functions (for now) since what was there 13958 since they are redundant with GetStackTrace. 13959 </change> 13960 <change date="19 Nov 2002"> 13961 Elided ClearAllBreakpoints since it has always been redundant. 13962 </change> 13963 <change date="19 Nov 2002"> 13964 Added GetSystemProperties. 13965 </change> 13966 <change date="19 Nov 2002"> 13967 Changed the thread local storage functions to use jthread. 13968 </change> 13969 <change date="20 Nov 2002"> 13970 Added GetJLocationFormat. 13971 </change> 13972 <change date="22 Nov 2002"> 13973 Added events and introductory text. 13974 </change> 13975 <change date="22 Nov 2002"> 13976 Cross reference type and constant definitions. 13977 </change> 13978 <change date="24 Nov 2002"> 13979 Added DTD. 13980 </change> 13981 <change date="24 Nov 2002"> 13982 Added capabilities function section. 13983 </change> 13984 <change date="29 Nov 2002"> 13985 Assign capabilities to each function and event. 13986 </change> 13987 <change date="29 Nov 2002"> 13988 Add <internallink id="jniIntercept">JNI interception functions</internallink>. 13989 </change> 13990 <change date="30 Nov 2002"> 13991 Auto generate SetEventNotificationMode capabilities. 13992 </change> 13993 <change date="30 Nov 2002"> 13994 Add <eventlink id="VMObjectAlloc"></eventlink> event. 13995 </change> 13996 <change date="30 Nov 2002"> 13997 Add <eventlink id="DynamicCodeGenerated"></eventlink> event. 13998 </change> 13999 <change date="30 Nov 2002"> 14000 Add const to declarations. 14001 </change> 14002 <change date="30 Nov 2002"> 14003 Change method exit and frame pop to send on exception. 14004 </change> 14005 <change date="1 Dec 2002"> 14006 Add ForceGarbageCollection. 14007 </change> 14008 <change date="2 Dec 2002"> 14009 Redo Xrun section; clarify GetStackTrace and add example; 14010 Fix width problems; use "agent" consistently. 14011 </change> 14012 <change date="8 Dec 2002"> 14013 Remove previous start-up intro. 14014 Add <internallink id="environments"><jvmti/> Environments</internallink> 14015 section. 14016 </change> 14017 <change date="8 Dec 2002"> 14018 Add <functionlink id="DisposeEnvironment"></functionlink>. 14019 </change> 14020 <change date="9 Dec 2002"> 14021 Numerous minor updates. 14022 </change> 14023 <change date="15 Dec 2002"> 14024 Add heap profiling functions added: 14025 get/set annotation, iterate live objects/heap. 14026 Add heap profiling functions place holder added: 14027 heap roots. 14028 Heap profiling event added: object free. 14029 Heap profiling event redesigned: vm object allocation. 14030 Heap profiling event placeholders added: garbage collection start/finish. 14031 Native method bind event added. 14032 </change> 14033 <change date="19 Dec 2002"> 14034 Revamp suspend/resume functions. 14035 Add origin information with jvmdi tag. 14036 Misc fixes. 14037 </change> 14038 <change date="24 Dec 2002"> 14039 Add semantics to types. 14040 </change> 14041 <change date="27 Dec 2002"> 14042 Add local reference section. 14043 Autogenerate parameter descriptions from types. 14044 </change> 14045 <change date="28 Dec 2002"> 14046 Document that RunAgentThread sends threadStart. 14047 </change> 14048 <change date="29 Dec 2002"> 14049 Remove redundant local ref and dealloc warning. 14050 Convert GetRawMonitorName to allocated buffer. 14051 Add GenerateEvents. 14052 </change> 14053 <change date="30 Dec 2002"> 14054 Make raw monitors a type and rename to "jrawMonitorID". 14055 </change> 14056 <change date="1 Jan 2003"> 14057 Include origin information. 14058 Clean-up JVMDI issue references. 14059 Remove Deallocate warnings which are now automatically generated. 14060 </change> 14061 <change date="2 Jan 2003"> 14062 Fix representation issues for jthread. 14063 </change> 14064 <change date="3 Jan 2003"> 14065 Make capabilities buffered out to 64 bits - and do it automatically. 14066 </change> 14067 <change date="4 Jan 2003"> 14068 Make constants which are enumeration into enum types. 14069 Parameters now of enum type. 14070 Clean-up and index type section. 14071 Replace remaining datadef entities with callback. 14072 </change> 14073 <change date="7 Jan 2003"> 14074 Correct GenerateEvents description. 14075 More internal semantics work. 14076 </change> 14077 <change date="9 Jan 2003"> 14078 Replace previous GetSystemProperties with two functions 14079 which use allocated information instead fixed. 14080 Add SetSystemProperty. 14081 More internal semantics work. 14082 </change> 14083 <change date="12 Jan 2003"> 14084 Add varargs to end of SetEventNotificationMode. 14085 </change> 14086 <change date="20 Jan 2003"> 14087 Finish fixing spec to reflect that alloc sizes are jlong. 14088 </change> 14089 <change date="22 Jan 2003"> 14090 Allow NULL as RunAgentThread arg. 14091 </change> 14092 <change date="22 Jan 2003"> 14093 Fixed names to standardized naming convention 14094 Removed AsyncGetStackTrace. 14095 </change> 14096 <change date="29 Jan 2003"> 14097 Since we are using jthread, removed GetThread. 14098 </change> 14099 <change date="31 Jan 2003"> 14100 Change GetFieldName to allow NULLs like GetMethodName. 14101 </change> 14102 <change date="29 Feb 2003" version="v40"> 14103 Rewrite the introductory text, adding sections on 14104 start-up, environments and bytecode instrumentation. 14105 Change the command line arguments per EG discussions. 14106 Add an introduction to the capabilities section. 14107 Add the extension mechanism category and functions. 14108 Mark for deletion, but clarified anyhow, SuspendAllThreads. 14109 Rename IterateOverLiveObjects to IterateOverReachableObjects and 14110 change the text accordingly. 14111 Clarify IterateOverHeap. 14112 Clarify CompiledMethodLoad. 14113 Discuss prerequisite state for Calling Functions. 14114 Clarify SetAllocationHooks. 14115 Added issues ("To be resolved:") through-out. 14116 And so on... 14117 </change> 14118 <change date="6 Mar 2003" version="v41"> 14119 Remove struct from the call to GetOwnedMonitorInfo. 14120 Automatically generate most error documentation, remove 14121 (rather broken) hand written error doc. 14122 Better describe capability use (empty initial set). 14123 Add min value to jint params. 14124 Remove the capability can_access_thread_local_storage. 14125 Rename error JVMTI_ERROR_NOT_IMPLEMENTED to JVMTI_ERROR_MUST_POSSESS_CAPABILITY; 14126 same for *NOT_IMPLEMENTED. 14127 Description fixes. 14128 </change> 14129 <change date="8 Mar 2003" version="v42"> 14130 Rename GetClassSignature to GetClassName. 14131 Rename IterateOverClassObjects to IterateOverInstancesOfClass. 14132 Remove GetMaxStack (operand stack isn't used in <jvmti/>). 14133 Description fixes: define launch-time, remove native frame pop 14134 from PopFrame, and assorted clarifications. 14135 </change> 14136 <change date="8 Mar 2003" version="v43"> 14137 Fix minor editing problem. 14138 </change> 14139 <change date="10 Mar 2003" version="v44"> 14140 Add phase information. 14141 Remap (compact) event numbers. 14142 </change> 14143 <change date="11 Mar 2003" version="v45"> 14144 More phase information - allow "any". 14145 Elide raw monitor queries and events. 14146 Minor description fixes. 14147 </change> 14148 <change date="12 Mar 2003" version="v46"> 14149 Add GetPhase. 14150 Use "phase" through document. 14151 Elide GetRawMonitorName. 14152 Elide GetObjectMonitors. 14153 </change> 14154 <change date="12 Mar 2003" version="v47"> 14155 Fixes from link, XML, and spell checking. 14156 Auto-generate the callback structure. 14157 </change> 14158 <change date="13 Mar 2003" version="v48"> 14159 One character XML fix. 14160 </change> 14161 <change date="13 Mar 2003" version="v49"> 14162 Change function parameter names to be consistent with 14163 event parameters (fooBarBaz becomes foo_bar_baz). 14164 </change> 14165 <change date="14 Mar 2003" version="v50"> 14166 Fix broken link. Fix thread markers. 14167 </change> 14168 <change date="14 Mar 2003" version="v51"> 14169 Change constants so they are under 128 to workaround 14170 compiler problems. 14171 </change> 14172 <change date="23 Mar 2003" version="v52"> 14173 Overhaul capabilities. Separate GetStackTrace into 14174 GetStackTrace and GetStackFrames. 14175 </change> 14176 <change date="8 Apr 2003" version="v54"> 14177 Use depth instead of jframeID to reference frames. 14178 Remove the now irrelevant GetCurrentFrame, GetCallerFrame and GetStackFrames. 14179 Remove frame arg from events. 14180 </change> 14181 <change date="9 Apr 2003" version="v55"> 14182 Remove GetObjectWithAnnotation since tests show bufferred approach more efficient. 14183 Add missing annotation_count to GetObjectsWithAnnotations 14184 </change> 14185 <change date="10 Apr 2003" version="v56"> 14186 Remove confusing parenthetical statement in GetObjectsWithAnnotations 14187 </change> 14188 <change date="13 Apr 2003" version="v58"> 14189 Replace jclass/jmethodID representation of method with simply jmethodID; 14190 Pass JvmtiEnv* as first arg of every event; remove JNIEnv* where inappropriate. 14191 Replace can_access_frames with can_access_local_variables; remove from purely stack access. 14192 Use can_get_synthetic_attribute; fix description. 14193 Clarify that zero length arrays must be deallocated. 14194 Clarify RelinquishCapabilities. 14195 Generalize JVMTI_ERROR_VM_DEAD to JVMTI_ERROR_WRONG_PHASE. 14196 </change> 14197 <change date="27 Apr 2003" version="v59"> 14198 Remove lingering indirect references to OBSOLETE_METHOD_ID. 14199 </change> 14200 <change date="4 May 2003" version="v60"> 14201 Allow DestroyRawMonitor during OnLoad. 14202 </change> 14203 <change date="7 May 2003" version="v61"> 14204 Added not monitor owner error return to DestroyRawMonitor. 14205 </change> 14206 <change date="13 May 2003" version="v62"> 14207 Clarify semantics of raw monitors. 14208 Change flags on <code>GetThreadStatus</code>. 14209 <code>GetClassLoader</code> return NULL for the bootstrap class loader. 14210 Add <code>GetClassName</code> issue. 14211 Define local variable signature. 14212 Disallow zero in annotations array of <code>GetObjectsWithAnnotations</code>. 14213 Remove over specification in <code>GetObjectsWithAnnotations</code>. 14214 Elide <code>SetAllocationHooks</code>. 14215 Elide <code>SuspendAllThreads</code>. 14216 </change> 14217 <change date="14 May 2003" version="v63"> 14218 Define the data type <code>jvmtiEventCallbacks</code>. 14219 Zero length allocations return NULL. 14220 Keep SetAllocationHooks in JVMDI, but remove from <jvmti/>. 14221 Add JVMTI_THREAD_STATUS_FLAG_INTERRUPTED. 14222 </change> 14223 <change date="15 May 2003" version="v64"> 14224 Better wording, per review. 14225 </change> 14226 <change date="15 May 2003" version="v65"> 14227 First Alpha. 14228 Make jmethodID and jfieldID unique, jclass not used. 14229 </change> 14230 <change date="27 May 2003" version="v66"> 14231 Fix minor XSLT errors. 14232 </change> 14233 <change date="13 June 2003" version="v67"> 14234 Undo making jfieldID unique (jmethodID still is). 14235 </change> 14236 <change date="17 June 2003" version="v68"> 14237 Changes per June 11th Expert Group meeting -- 14238 Overhaul Heap functionality: single callback, 14239 remove GetHeapRoots, add reachable iterators, 14240 and rename "annotation" to "tag". 14241 NULL thread parameter on most functions is current 14242 thread. 14243 Add timers. 14244 Remove ForceExit. 14245 Add GetEnvironmentLocalStorage. 14246 Add verbose flag and event. 14247 Add AddToBootstrapClassLoaderSearch. 14248 Update ClassFileLoadHook. 14249 </change> 14250 <change date="18 June 2003" version="v69"> 14251 Clean up issues sections. 14252 Rename GetClassName back to GetClassSignature and 14253 fix description. 14254 Add generic signature to GetClassSignature, 14255 GetFieldSignature, GetMethodSignature, and 14256 GetLocalVariableTable. 14257 Elide EstimateCostOfCapabilities. 14258 Clarify that the system property functions operate 14259 on the VM view of system properties. 14260 Clarify Agent_OnLoad. 14261 Remove "const" from JNIEnv* in events. 14262 Add metadata accessors. 14263 </change> 14264 <change date="18 June 2003" version="v70"> 14265 Add start_depth to GetStackTrace. 14266 Move system properties to a new category. 14267 Add GetObjectSize. 14268 Remove "X" from command line flags. 14269 XML, HTML, and spell check corrections. 14270 </change> 14271 <change date="19 June 2003" version="v71"> 14272 Fix JVMTI_HEAP_ROOT_THREAD to be 6. 14273 Make each synopsis match the function name. 14274 Fix unclear wording. 14275 </change> 14276 <change date="26 June 2003" version="v72"> 14277 SetThreadLocalStorage and SetEnvironmentLocalStorage should allow value 14278 to be set to NULL. 14279 NotifyFramePop, GetFrameLocationm and all the local variable operations 14280 needed to have their wording about frames fixed. 14281 Grammar and clarity need to be fixed throughout. 14282 Capitalization and puntuation need to be consistent. 14283 Need micro version number and masks for accessing major, minor, and micro. 14284 The error code lists should indicate which must be returned by 14285 an implementation. 14286 The command line properties should be visible in the properties functions. 14287 Disallow popping from the current thread. 14288 Allow implementations to return opaque frame error when they cannot pop. 14289 The NativeMethodBind event should be sent during any phase. 14290 The DynamicCodeGenerated event should be sent during any phase. 14291 The following functions should be allowed to operate before VMInit: 14292 Set/GetEnvironmentLocalStorage 14293 GetMethodDeclaringClass 14294 GetClassSignature 14295 GetClassModifiers 14296 IsInterface 14297 IsArrayClass 14298 GetMethodName 14299 GetMethodModifiers 14300 GetMaxLocals 14301 GetArgumentsSize 14302 GetLineNumberTable 14303 GetMethodLocation 14304 IsMethodNative 14305 IsMethodSynthetic. 14306 Other changes (to XSL): 14307 Argument description should show asterisk after not before pointers. 14308 NotifyFramePop, GetFrameLocationm and all the local variable operations 14309 should hsve the NO_MORE_FRAMES error added. 14310 Not alive threads should have a different error return than invalid thread. 14311 </change> 14312 <change date="7 July 2003" version="v73"> 14313 VerboseOutput event was missing message parameter. 14314 Minor fix-ups. 14315 </change> 14316 <change date="14 July 2003" version="v74"> 14317 Technical Publications Department corrections. 14318 Allow thread and environment local storage to be set to NULL. 14319 </change> 14320 <change date="23 July 2003" version="v75"> 14321 Use new Agent_OnLoad rather than overloaded JVM_OnLoad. 14322 Add JNICALL to callbacks (XSL). 14323 Document JNICALL requirement for both events and callbacks (XSL). 14324 Restrict RedefineClasses to methods and attributes. 14325 Elide the VerboseOutput event. 14326 VMObjectAlloc: restrict when event is sent and remove method parameter. 14327 Finish loose ends from Tech Pubs edit. 14328 </change> 14329 <change date="24 July 2003" version="v76"> 14330 Change ClassFileLoadHook event to send the class instead of a boolean of redefine. 14331 </change> 14332 <change date="24 July 2003" version="v77"> 14333 XML fixes. 14334 Minor text clarifications and corrections. 14335 </change> 14336 <change date="24 July 2003" version="v78"> 14337 Remove GetExceptionHandlerTable and GetThrownExceptions from <jvmti/>. 14338 Clarify that stack frames are JVM Spec frames. 14339 Split can_get_source_info into can_get_source_file_name, can_get_line_numbers, 14340 and can_get_source_debug_extension. 14341 PopFrame cannot have a native calling method. 14342 Removed incorrect statement in GetClassloaderClasses 14343 (see <vmspec chapter="4.4"/>). 14344 </change> 14345 <change date="24 July 2003" version="v79"> 14346 XML and text fixes. 14347 Move stack frame description into Stack Frame category. 14348 </change> 14349 <change date="26 July 2003" version="v80"> 14350 Allow NULL (means bootstrap loader) for GetClassloaderClasses. 14351 Add new heap reference kinds for references from classes. 14352 Add timer information struct and query functions. 14353 Add AvailableProcessors. 14354 Rename GetOtherThreadCpuTime to GetThreadCpuTime. 14355 Explicitly add JVMTI_ERROR_INVALID_THREAD and JVMTI_ERROR_THREAD_NOT_ALIVE 14356 to SetEventNotification mode. 14357 Add initial thread to the VM_INIT event. 14358 Remove platform assumptions from AddToBootstrapClassLoaderSearch. 14359 </change> 14360 <change date="26 July 2003" version="v81"> 14361 Grammar and clarity changes per review. 14362 </change> 14363 <change date="27 July 2003" version="v82"> 14364 More grammar and clarity changes per review. 14365 Add Agent_OnUnload. 14366 </change> 14367 <change date="28 July 2003" version="v83"> 14368 Change return type of Agent_OnUnload to void. 14369 </change> 14370 <change date="28 July 2003" version="v84"> 14371 Rename JVMTI_REFERENCE_ARRAY to JVMTI_REFERENCE_ARRAY_ELEMENT. 14372 </change> 14373 <change date="28 July 2003" version="v85"> 14374 Steal java.lang.Runtime.availableProcessors() wording for 14375 AvailableProcessors(). 14376 Guarantee that zero will never be an event ID. 14377 Remove some issues which are no longer issues. 14378 Per review, rename and more completely document the timer 14379 information functions. 14380 </change> 14381 <change date="29 July 2003" version="v86"> 14382 Non-spec visible change to XML controlled implementation: 14383 SetThreadLocalStorage must run in VM mode. 14384 </change> 14385 <change date="5 August 2003" version="0.1.87"> 14386 Add GetErrorName. 14387 Add varargs warning to jvmtiExtensionEvent. 14388 Remove "const" on the jvmtiEnv* of jvmtiExtensionEvent. 14389 Remove unused can_get_exception_info capability. 14390 Pass jvmtiEnv* and JNIEnv* to the jvmtiStartFunction. 14391 Fix jvmtiExtensionFunctionInfo.func declared type. 14392 Extension function returns error code. 14393 Use new version numbering. 14394 </change> 14395 <change date="5 August 2003" version="0.2.88"> 14396 Remove the ClassUnload event. 14397 </change> 14398 <change date="8 August 2003" version="0.2.89"> 14399 Heap reference iterator callbacks return an enum that 14400 allows outgoing object references to be ignored. 14401 Allow JNIEnv as a param type to extension events/functions. 14402 </change> 14403 <change date="15 August 2003" version="0.2.90"> 14404 Fix a typo. 14405 </change> 14406 <change date="2 September 2003" version="0.2.91"> 14407 Remove all metadata functions: GetClassMetadata, 14408 GetFieldMetadata, and GetMethodMetadata. 14409 </change> 14410 <change date="1 October 2003" version="0.2.92"> 14411 Mark the functions Allocate. Deallocate, RawMonitor*, 14412 SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage 14413 as safe for use in heap callbacks and GC events. 14414 </change> 14415 <change date="24 November 2003" version="0.2.93"> 14416 Add pass through opaque user data pointer to heap iterate 14417 functions and callbacks. 14418 In the CompiledMethodUnload event, send the code address. 14419 Add GarbageCollectionOccurred event. 14420 Add constant pool reference kind. 14421 Mark the functions CreateRawMonitor and DestroyRawMonitor 14422 as safe for use in heap callbacks and GC events. 14423 Clarify: VMDeath, GetCurrentThreadCpuTimerInfo, 14424 GetThreadCpuTimerInfo, IterateOverReachableObjects, 14425 IterateOverObjectsReachableFromObject, GetTime and 14426 JVMTI_ERROR_NULL_POINTER. 14427 Add missing errors to: GenerateEvents and 14428 AddToBootstrapClassLoaderSearch. 14429 Fix description of ClassFileLoadHook name parameter. 14430 In heap callbacks and GC/ObjectFree events, specify 14431 that only explicitly allowed functions can be called. 14432 Allow GetCurrentThreadCpuTimerInfo, GetCurrentThreadCpuTime, 14433 GetTimerInfo, and GetTime during callback. 14434 Allow calling SetTag/GetTag during the onload phase. 14435 SetEventNotificationMode, add: error attempted inappropriate 14436 thread level control. 14437 Remove jvmtiExceptionHandlerEntry. 14438 Fix handling of native methods on the stack -- 14439 location_ptr param of GetFrameLocation, remove 14440 JVMTI_ERROR_OPAQUE_FRAME from GetFrameLocation, 14441 jvmtiFrameInfo.location, and jlocation. 14442 Remove typo (from JVMPI) implying that the MonitorWaited 14443 event is sent on sleep. 14444 </change> 14445 <change date="25 November 2003" version="0.2.94"> 14446 Clarifications and typos. 14447 </change> 14448 <change date="3 December 2003" version="0.2.95"> 14449 Allow NULL user_data in heap iterators. 14450 </change> 14451 <change date="28 January 2004" version="0.2.97"> 14452 Add GetThreadState, deprecate GetThreadStatus. 14453 </change> 14454 <change date="29 January 2004" version="0.2.98"> 14455 INVALID_SLOT and TYPE_MISMATCH errors should be optional. 14456 </change> 14457 <change date="12 February 2004" version="0.2.102"> 14458 Remove MonitorContendedExit. 14459 Added JNIEnv parameter to VMObjectAlloc. 14460 Clarified definition of class_tag and referrer_index 14461 parameters to heap callbacks. 14462 </change> 14463 <change date="16 Febuary 2004" version="0.2.103"> 14464 Document JAVA_TOOL_OPTIONS. 14465 </change> 14466 <change date="17 Febuary 2004" version="0.2.105"> 14467 Divide start phase into primordial and start. 14468 Add VMStart event 14469 Change phase associations of functions and events. 14470 </change> 14471 <change date="18 Febuary 2004" version="0.3.6"> 14472 Elide deprecated GetThreadStatus. 14473 Bump minor version, subtract 100 from micro version 14474 </change> 14475 <change date="18 Febuary 2004" version="0.3.7"> 14476 Document that timer nanosecond values are unsigned. 14477 Clarify text having to do with native methods. 14478 </change> 14479 <change date="19 Febuary 2004" version="0.3.8"> 14480 Fix typos. 14481 Remove elided deprecated GetThreadStatus. 14482 </change> 14483 <change date="23 Febuary 2004" version="0.3.9"> 14484 Require NotifyFramePop to act on suspended threads. 14485 </change> 14486 <change date="24 Febuary 2004" version="0.3.10"> 14487 Add capabilities 14488 (<internallink id="jvmtiCapabilities.can_redefine_any_class" 14489 ><code>can_redefine_any_class</code></internallink> 14490 and 14491 <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events" 14492 ><code>can_generate_all_class_hook_events</code></internallink>) 14493 and an error (<errorlink id="JVMTI_ERROR_UNMODIFIABLE_CLASS"></errorlink>) 14494 which allow some classes to be unmodifiable. 14495 </change> 14496 <change date="28 Febuary 2004" version="0.3.11"> 14497 Add JVMTI_ERROR_MUST_POSSESS_CAPABILITY to SetEventNotificationMode. 14498 </change> 14499 <change date="8 March 2004" version="0.3.12"> 14500 Clarified CompiledMethodUnload so that it is clear the event 14501 may be posted after the class has been unloaded. 14502 </change> 14503 <change date="5 March 2004" version="0.3.13"> 14504 Change the size parameter of VMObjectAlloc to jlong to match GetObjectSize. 14505 </change> 14506 <change date="13 March 2004" version="0.3.14"> 14507 Added guideline for the use of the JNI FindClass function in event 14508 callback functions. 14509 </change> 14510 <change date="15 March 2004" version="0.3.15"> 14511 Add GetAllStackTraces and GetThreadListStackTraces. 14512 </change> 14513 <change date="19 March 2004" version="0.3.16"> 14514 ClassLoad and ClassPrepare events can be posted during start phase. 14515 </change> 14516 <change date="25 March 2004" version="0.3.17"> 14517 Add JVMTI_ERROR_NATIVE_METHOD to GetLineNumberTable, GetLocalVariableTable, 14518 GetMaxLocals, GetArgumentsSize, GetMethodLocation, GetBytecodes. 14519 </change> 14520 <change date="29 March 2004" version="0.3.18"> 14521 Return the timer kind in the timer information structure. 14522 </change> 14523 <change date="31 March 2004" version="0.3.19"> 14524 Spec clarifications: 14525 JVMTI_THREAD_STATE_IN_NATIVE might not include JNI or <jvmti/>. 14526 ForceGarbageCollection does not run finalizers. 14527 The context of the specification is the Java platform. 14528 Warn about early instrumentation. 14529 </change> 14530 <change date="1 April 2004" version="0.3.20"> 14531 Refinements to the above clarifications and 14532 Clarify that an error returned by Agent_OnLoad terminates the VM. 14533 </change> 14534 <change date="1 April 2004" version="0.3.21"> 14535 Array class creation does not generate a class load event. 14536 </change> 14537 <change date="7 April 2004" version="0.3.22"> 14538 Align thread state hierarchy more closely with java.lang.Thread.State. 14539 </change> 14540 <change date="12 April 2004" version="0.3.23"> 14541 Clarify the documentation of thread state. 14542 </change> 14543 <change date="19 April 2004" version="0.3.24"> 14544 Remove GarbageCollectionOccurred event -- can be done by agent. 14545 </change> 14546 <change date="22 April 2004" version="0.3.25"> 14547 Define "command-line option". 14548 </change> 14549 <change date="29 April 2004" version="0.3.26"> 14550 Describe the intended use of bytecode instrumentation. 14551 Fix description of extension event first parameter. 14552 </change> 14553 <change date="30 April 2004" version="0.3.27"> 14554 Clarification and typos. 14555 </change> 14556 <change date="18 May 2004" version="0.3.28"> 14557 Remove DataDumpRequest event. 14558 </change> 14559 <change date="18 May 2004" version="0.3.29"> 14560 Clarify RawMonitorWait with zero timeout. 14561 Clarify thread state after RunAgentThread. 14562 </change> 14563 <change date="24 May 2004" version="0.3.30"> 14564 Clean-up: fix bad/old links, etc. 14565 </change> 14566 <change date="30 May 2004" version="0.3.31"> 14567 Clarifications including: 14568 All character strings are modified UTF-8. 14569 Agent thread visibiity. 14570 Meaning of obsolete method version. 14571 Thread invoking heap callbacks, 14572 </change> 14573 <change date="1 June 2004" version="1.0.32"> 14574 Bump major.minor version numbers to "1.0". 14575 </change> 14576 <change date="2 June 2004" version="1.0.33"> 14577 Clarify interaction between ForceGarbageCollection 14578 and ObjectFree. 14579 </change> 14580 <change date="6 June 2004" version="1.0.34"> 14581 Restrict AddToBootstrapClassLoaderSearch and 14582 SetSystemProperty to the OnLoad phase only. 14583 </change> 14584 <change date="11 June 2004" version="1.0.35"> 14585 Fix typo in SetTag. 14586 </change> 14587 <change date="18 June 2004" version="1.0.36"> 14588 Fix trademarks. 14589 Add missing parameter in example GetThreadState usage. 14590 </change> 14591 <change date="4 August 2004" version="1.0.37"> 14592 Copyright updates. 14593 </change> 14594 <change date="5 November 2004" version="1.0.38"> 14595 Add missing function table layout. 14596 Add missing description of C++ member function format of functions. 14597 Clarify that name in CFLH can be NULL. 14598 Released as part of <tm>J2SE</tm> 5.0. 14599 </change> 14600 <change date="24 April 2005" version="1.1.47"> 14601 Bump major.minor version numbers to "1.1". 14602 Add ForceEarlyReturn* functions. 14603 Add GetOwnedMonitorStackDepthInfo function. 14604 Add GetCurrentThread function. 14605 Add "since" version marker. 14606 Add AddToSystemClassLoaderSearch. 14607 Allow AddToBootstrapClassLoaderSearch be used in live phase. 14608 Fix historic rubbish in the descriptions of the heap_object_callback 14609 parameter of IterateOverHeap and IterateOverInstancesOfClass functions; 14610 disallow NULL for this parameter. 14611 Clarify, correct and make consistent: wording about current thread, 14612 opaque frames and insufficient number of frames in PopFrame. 14613 Consistently use "current frame" rather than "topmost". 14614 Clarify the JVMTI_ERROR_TYPE_MISMATCH errors in GetLocal* and SetLocal* 14615 by making them compatible with those in ForceEarlyReturn*. 14616 Many other clarifications and wording clean ups. 14617 </change> 14618 <change date="25 April 2005" version="1.1.48"> 14619 Add GetConstantPool. 14620 Switch references to the first edition of the VM Spec, to the seconds edition. 14621 </change> 14622 <change date="26 April 2005" version="1.1.49"> 14623 Clarify minor/major version order in GetConstantPool. 14624 </change> 14625 <change date="26 April 2005" version="1.1.50"> 14626 Add SetNativeMethodPrefix and SetNativeMethodPrefixes. 14627 Reassign GetOwnedMonitorStackDepthInfo to position 153. 14628 Break out Class Loader Search in its own documentation category. 14629 Deal with overly long lines in XML source. 14630 </change> 14631 <change date="29 April 2005" version="1.1.51"> 14632 Allow agents be started in the live phase. 14633 Added paragraph about deploying agents. 14634 </change> 14635 <change date="30 April 2005" version="1.1.52"> 14636 Add specification description to SetNativeMethodPrefix(es). 14637 Better define the conditions on GetConstantPool. 14638 </change> 14639 <change date="30 April 2005" version="1.1.53"> 14640 Break out the GetClassVersionNumber function from GetConstantPool. 14641 Clean-up the references to the VM Spec. 14642 </change> 14643 <change date="1 May 2005" version="1.1.54"> 14644 Allow SetNativeMethodPrefix(es) in any phase. 14645 Add clarifications about the impact of redefinition on GetConstantPool. 14646 </change> 14647 <change date="2 May 2005" version="1.1.56"> 14648 Various clarifications to SetNativeMethodPrefix(es). 14649 </change> 14650 <change date="2 May 2005" version="1.1.57"> 14651 Add missing performance warning to the method entry event. 14652 </change> 14653 <change date="5 May 2005" version="1.1.58"> 14654 Remove internal JVMDI support. 14655 </change> 14656 <change date="8 May 2005" version="1.1.59"> 14657 Add <functionlink id="RetransformClasses"/>. 14658 Revamp the bytecode instrumentation documentation. 14659 Change <functionlink id="IsMethodObsolete"/> to no longer 14660 require the can_redefine_classes capability. 14661 </change> 14662 <change date="11 May 2005" version="1.1.63"> 14663 Clarifications for retransformation. 14664 </change> 14665 <change date="11 May 2005" version="1.1.64"> 14666 Clarifications for retransformation, per review. 14667 Lock "retransformation (in)capable" at class load enable time. 14668 </change> 14669 <change date="4 June 2005" version="1.1.67"> 14670 Add new heap functionity which supports reporting primitive values, 14671 allows setting the referrer tag, and has more powerful filtering: 14672 FollowReferences, IterateThroughHeap, and their associated 14673 callbacks, structs, enums, and constants. 14674 </change> 14675 <change date="4 June 2005" version="1.1.68"> 14676 Clarification. 14677 </change> 14678 <change date="6 June 2005" version="1.1.69"> 14679 FollowReferences, IterateThroughHeap: Put callbacks in a struct; 14680 Add missing error codes; reduce bits in the visit control flags. 14681 </change> 14682 <change date="14 June 2005" version="1.1.70"> 14683 More on new heap functionity: spec clean-up per review. 14684 </change> 14685 <change date="15 June 2005" version="1.1.71"> 14686 More on new heap functionity: Rename old heap section to Heap (1.0). 14687 </change> 14688 <change date="21 June 2005" version="1.1.72"> 14689 Fix typos. 14690 </change> 14691 <change date="27 June 2005" version="1.1.73"> 14692 Make referrer info structure a union. 14693 </change> 14694 <change date="9 September 2005" version="1.1.74"> 14695 In new heap functions: 14696 Add missing superclass reference kind. 14697 Use a single scheme for computing field indexes. 14698 Remove outdated references to struct based referrer info. 14699 </change> 14700 <change date="12 September 2005" version="1.1.75"> 14701 Don't callback during FollowReferences on frivolous java.lang.Object superclass. 14702 </change> 14703 <change date="13 September 2005" version="1.1.76"> 14704 In string primitive callback, length now Unicode length. 14705 In array and string primitive callbacks, value now "const". 14706 Note possible compiler impacts on setting JNI function table. 14707 </change> 14708 <change date="13 September 2005" version="1.1.77"> 14709 GetClassVersionNumbers() and GetConstantPool() should return 14710 error on array or primitive class. 14711 </change> 14712 <change date="14 September 2005" version="1.1.78"> 14713 Grammar fixes. 14714 </change> 14715 <change date="26 September 2005" version="1.1.79"> 14716 Add IsModifiableClass query. 14717 </change> 14718 <change date="9 February 2006" version="1.1.81"> 14719 Add referrer_class_tag parameter to jvmtiHeapReferenceCallback. 14720 </change> 14721 <change date="13 February 2006" version="1.1.82"> 14722 Doc fixes: update can_redefine_any_class to include retransform. 14723 Clarify that exception events cover all Throwables. 14724 In GetStackTrace, no test is done for start_depth too big if start_depth is zero, 14725 Clarify fields reported in Primitive Field Callback -- static vs instance. 14726 Repair confusing names of heap types, including callback names. 14727 Require consistent usage of stack depth in the face of thread launch methods. 14728 Note incompatibility of <jvmti/> memory management with other systems. 14729 </change> 14730 <change date="14 February 2006" version="1.1.85"> 14731 Fix typos and missing renames. 14732 </change> 14733 <change date="13 March 2006" version="1.1.86"> 14734 Clarify that jmethodIDs and jfieldIDs can be saved. 14735 Clarify that Iterate Over Instances Of Class includes subclasses. 14736 </change> 14737 <change date="14 March 2006" version="1.1.87"> 14738 Better phrasing. 14739 </change> 14740 <change date="16 March 2006" version="1.1.88"> 14741 Match the referrer_index for static fields in Object Reference Callback 14742 with the Reference Implementation (and all other known implementations); 14743 that is, make it match the definition for instance fields. 14744 In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover 14745 an invalid thread in the list; and specify that not started threads 14746 return empty stacks. 14747 </change> 14748 <change date="17 March 2006" version="1.1.89"> 14749 Typo. 14750 </change> 14751 <change date="25 March 2006" version="1.1.90"> 14752 Typo. 14753 </change> 14754 <change date="6 April 2006" version="1.1.91"> 14755 Remove restrictions on AddToBootstrapClassLoaderSearch and 14756 AddToSystemClassLoaderSearch. 14757 </change> 14758 <change date="1 May 2006" version="1.1.93"> 14759 Changed spec to return -1 for monitor stack depth for the 14760 implementation which can not determine stack depth. 14761 </change> 14762 <change date="3 May 2006" version="1.1.94"> 14763 Corrections for readability and accuracy courtesy of Alan Pratt of IBM. 14764 List the object relationships reported in FollowReferences. 14765 </change> 14766 <change date="5 May 2006" version="1.1.95"> 14767 Clarify the object relationships reported in FollowReferences. 14768 </change> 14769 <change date="28 June 2006" version="1.1.98"> 14770 Clarify DisposeEnvironment; add warning. 14771 Fix typos in SetLocalXXX "retrieve" => "set". 14772 Clarify that native method prefixes must remain set while used. 14773 Clarify that exactly one Agent_OnXXX is called per agent. 14774 Clarify that library loading is independent from start-up. 14775 Remove ambiguous reference to Agent_OnLoad in the Agent_OnUnload spec. 14776 </change> 14777 <change date="31 July 2006" version="1.1.99"> 14778 Clarify the interaction between functions and exceptions. 14779 Clarify and give examples of field indices. 14780 Remove confusing "That is" sentence from MonitorWait and MonitorWaited events. 14781 Update links to point to Java 6. 14782 </change> 14783 <change date="6 August 2006" version="1.1.102"> 14784 Add ResourceExhaustedEvent. 14785 </change> 14786 <change date="11 October 2012" version="1.2.2"> 14787 Fixed the "HTTP" and "Missing Anchor" errors reported by the LinkCheck tool. 14788 </change> 14789 <change date="19 June 2013" version="1.2.3"> 14790 Added support for statically linked agents. 14791 </change> 14792 <change date="13 October 2016" version="9.0.0"> 14793 Support for modules: 14794 - The majorversion is 9 now 14795 - The ClassFileLoadHook events are not sent during the primordial phase anymore. 14796 - Allow CompiledMethodLoad events at start phase 14797 - Add new capabilities: 14798 - can_generate_early_vmstart 14799 - can_generate_early_class_hook_events 14800 - Add new functions: 14801 - GetAllModules 14802 - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides 14803 - IsModifiableModule 14804 Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to 14805 disallow some implementation defined classes. 14806 </change> 14807 <change date="12 February 2017" version="9.0.0"> 14808 Minor update for GetCurrentThread function: 14809 - The function may return NULL in the start phase if the 14810 can_generate_early_vmstart capability is enabled. 14811 </change> 14812 </changehistory> 14813 14814 </specification> 14815 <!-- Keep this comment at the end of the file 14816 Local variables: 14817 mode: sgml 14818 sgml-omittag:t 14819 sgml-shorttag:t 14820 sgml-namecase-general:t 14821 sgml-general-insert-case:lower 14822 sgml-minimize-attributes:nil 14823 sgml-always-quote-attributes:t 14824 sgml-indent-step:2 14825 sgml-indent-data:t 14826 sgml-parent-document:nil 14827 sgml-exposed-tags:nil 14828 sgml-local-catalogs:nil 14829 sgml-local-ecat-files:nil 14830 End: 14831 -->