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 &lt;jvmti.h&gt;
 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>&lt;agent-lib-name&gt;</i><code>=</code><i>&lt;options&gt;</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>&lt;agent-lib-name&gt;</i> is expanded to an
 496         operating system specific file name.
 497         The <i>&lt;options&gt;</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>&lt;path-to-agent&gt;</i><code>=</code><i>&lt;options&gt;</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>&lt;options&gt;</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_&lt;agent-lib-name&gt;</code> entry point where
 527     &lt;agent-lib-name&gt; 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_&lt;agent-lib-name&gt;</code> function with
 592     <i>&lt;options&gt;</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>=&lt;options&gt;</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_&lt;agent-lib-name&gt;</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_&lt;agent-lib-name&gt;</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>&lt;vm&gt;</i> is the Java VM.
 658     The <i>&lt;options&gt;</i> argument is the startup options provided to the agent.
 659     <i>&lt;options&gt;</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_&lt;agent-lib-name&gt;</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_&lt;agent-lib-name
 670     &gt;</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_&lt;agent-lib-name&gt;</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, &amp;class_count, &amp;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(&amp;class_count, &amp;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, &amp;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)-&gt;GetThreadState(jvmti, thread, &amp;state);
1412         if (err == JVMTI_ERROR_NONE) {
1413            if (state &amp; 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 &amp; 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 &amp; (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 &amp; JVMTI_THREAD_STATE_IN_OBJECT_WAIT)  {
1428              if (state &amp; 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)-&gt;GetThreadState(jvmti, thread, &amp;state);
1446             abortOnError(err);
1447             switch (state &amp; 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)-&gt;GetStackTrace(jvmti, aThread, 0, 5,
2462                                frames, &amp;count);
2463 if (err == JVMTI_ERROR_NONE &amp;&amp; count &gt;= 1) {
2464    char *methodName;
2465    err = (*jvmti)-&gt;GetMethodName(jvmti, frames[0].method,
2466                        &amp;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)-&gt;GetAllStackTraces(jvmti, MAX_FRAMES, &amp;stack_info, &amp;thread_count);
2565 if (err != JVMTI_ERROR_NONE) {
2566    ...
2567 }
2568 for (ti = 0; ti &lt; thread_count; ++ti) {
2569    jvmtiStackInfo *infop = &amp;stack_info[ti];
2570    jthread thread = infop-&gt;thread;
2571    jint state = infop-&gt;state;
2572    jvmtiFrameInfo *frames = infop-&gt;frame_buffer;
2573    int fi;
2574 
2575    myThreadAndStatePrinter(thread, state);
2576    for (fi = 0; fi &lt; infop-&gt;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)-&gt;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-&gt;NewGlobalRef(env, lobj);
9245 }
9246 
9247 void
9248 myInit() {
9249    jvmtiError err;
9250 
9251    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;original_jni_Functions);
9252    if (err != JVMTI_ERROR_NONE) {
9253       die();
9254    }
9255    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;redirected_jni_Functions);
9256    if (err != JVMTI_ERROR_NONE) {
9257       die();
9258    }
9259    redirectedJNIFunctions-&gt;NewGlobalRef = MyNewGlobalRef;
9260       err = (*jvmti_env)-&gt;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)-&gt;GetPotentialCapabilities(jvmti, &amp;capa);
10055         if (err == JVMTI_ERROR_NONE) {
10056            err = (*jvmti)-&gt;AddCapabilities(jvmti, &amp;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)-&gt;GetCapabilities(jvmti, &amp;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 
10355       <capabilityfield id="can_sample_heap" since="9">
10356         <description>
10357           Can sample the heap.
10358           If this capability is enabled then the heap sampling methods can be called.
10359         </description>
10360       </capabilityfield>
10361     </capabilitiestypedef>
10362 
10363     <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140">
10364       <synopsis>Get Potential Capabilities</synopsis>
10365       <description>
10366         Returns via <paramlink id="capabilities_ptr"></paramlink> the <jvmti/>
10367         features that can potentially be possessed by this environment
10368         at this time.
10369         The returned capabilities differ from the complete set of capabilities
10370         implemented by the VM in two cases: another environment possesses
10371         capabilities that can only be possessed by one environment, or the
10372         current <functionlink id="GetPhase">phase</functionlink> is live,
10373         and certain capabilities can only be added during the <code>OnLoad</code> phase.
10374         The <functionlink id="AddCapabilities"></functionlink> function
10375         may be used to set any or all or these capabilities.
10376         Currently possessed capabilities are included.
10377         <p/>
10378         Typically this function is used in the <code>OnLoad</code> function.
10379         Some virtual machines may allow a limited set of capabilities to be
10380         added in the live phase.
10381         In this case, the set of potentially available capabilities
10382         will likely differ from the <code>OnLoad</code> phase set.
10383         <p/>
10384         See the
10385         <internallink id="capabilityExamples">Capability Examples</internallink>.
10386       </description>
10387       <origin>new</origin>
10388       <capabilities>
10389       </capabilities>
10390       <parameters>
10391         <param id="capabilities_ptr">
10392           <outptr><struct>jvmtiCapabilities</struct></outptr>
10393           <description>
10394             On return, points to the <jvmti/> capabilities that may be added.
10395           </description>
10396         </param>
10397       </parameters>
10398       <errors>
10399       </errors>
10400     </function>
10401 
10402     <elide>
10403     <function id="EstimateCostOfCapabilities" phase="onload" num="141">
10404       <synopsis>Estimate Cost Of Capabilities</synopsis>
10405       <description>
10406         <issue>There is strong opposition to this function.  The concern is
10407           that it would be difficult or impossible to provide meaningful
10408           numbers, as the amount of impact is conditional on many factors
10409           that a single number could not represent.  There is doubt that
10410           conditional implementations would be used or are even a good idea.
10411           The thought is that release documentation for the implementation
10412           would be the best means of exposing this information.
10413           Unless new arguments are presented, I intend to remove this
10414           function in the next revision.
10415         </issue>
10416         <p/>
10417         Return via the <paramlink id="time_impact_ptr"></paramlink> and
10418         <paramlink id="space_impact_ptr"></paramlink> an estimate of the impact
10419         of adding the capabilities pointed to by
10420         <paramlink id="capabilities_ptr"></paramlink>.
10421         The returned estimates are in percentage of additional overhead, thus
10422         a time impact of 100 mean the application might run
10423         at half the speed.
10424         The estimates are very rough approximations and are not guaranteed.
10425         Note also, that the estimates are of the impact of having the
10426         capability available--when and if it is used the impact may be
10427         much greater.
10428         Estimates can be for a single capability or for a set of
10429         capabilities.  Note that the costs are not necessarily additive,
10430         adding support for one capability might make another available
10431         for free or conversely having two capabilities at once may
10432         have multiplicative impact.
10433         Estimates are relative to the current set of capabilities -
10434         that is, how much more impact given the currently possessed capabilities.
10435         <p/>
10436         Typically this function is used in the OnLoad function,
10437         some virtual machines may allow a limited set of capabilities to be
10438         added in the live phase.
10439         In this case, the set of potentially available capabilities
10440         will likely differ from the OnLoad phase set.
10441         <p/>
10442         See the
10443         <internallink id="capabilityExamples">Capability Examples</internallink>.
10444       </description>
10445       <origin>new</origin>
10446       <capabilities>
10447       </capabilities>
10448       <parameters>
10449         <param id="capabilities_ptr">
10450           <inptr><struct>jvmtiCapabilities</struct></inptr>
10451           <description>
10452             points to the <jvmti/> capabilities to evaluate.
10453           </description>
10454         </param>
10455         <param id="time_impact_ptr">
10456           <outptr><jint/></outptr>
10457           <description>
10458             On return, points to the estimated percentage increase in
10459             run time if this capability was added.
10460           </description>
10461         </param>
10462         <param id="space_impact_ptr">
10463           <outptr><jint/></outptr>
10464           <description>
10465             On return, points to the estimated percentage increase in
10466             memory space used if this capability was added.
10467           </description>
10468         </param>
10469       </parameters>
10470       <errors>
10471         <error id="JVMTI_ERROR_NOT_AVAILABLE">
10472           The desired capabilities are not even potentially available.
10473         </error>
10474       </errors>
10475     </function>
10476     </elide>
10477 
10478     <function id="AddCapabilities" jkernel="yes" phase="onload" num="142">
10479       <synopsis>Add Capabilities</synopsis>
10480       <description>
10481         Set new capabilities by adding the capabilities
10482         whose values are set to one (<code>1</code>) in
10483         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10484         All previous capabilities are retained.
10485         Typically this function is used in the <code>OnLoad</code> function.
10486         Some virtual machines may allow a limited set of capabilities to be
10487         added in the live phase.
10488         <p/>
10489         See the
10490         <internallink id="capabilityExamples">Capability Examples</internallink>.
10491       </description>
10492       <origin>new</origin>
10493       <capabilities>
10494       </capabilities>
10495       <parameters>
10496         <param id="capabilities_ptr">
10497           <inptr><struct>jvmtiCapabilities</struct></inptr>
10498           <description>
10499             Points to the <jvmti/> capabilities to add.
10500           </description>
10501         </param>
10502       </parameters>
10503       <errors>
10504         <error id="JVMTI_ERROR_NOT_AVAILABLE">
10505           The desired capabilities are not even potentially available.
10506         </error>
10507       </errors>
10508     </function>
10509 
10510 
10511     <function id="RelinquishCapabilities" phase="onload" num="143">
10512       <synopsis>Relinquish Capabilities</synopsis>
10513       <description>
10514         Relinquish the capabilities
10515         whose values are set to one (<code>1</code>) in
10516         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10517         Some implementations may allow only one environment to have a capability
10518         (see the <internallink id="capability">capability introduction</internallink>).
10519         This function releases capabilities
10520         so that they may be used by other agents.
10521         All other capabilities are retained.
10522         The capability will no longer be present in <functionlink id="GetCapabilities"></functionlink>.
10523         Attempting to relinquish a capability that the agent does not possess is not an error.
10524           <issue>
10525             It is possible for the agent to be actively using capabilities
10526             which are being relinquished.  For example, a thread is currently
10527             suspended and can_suspend is being relinquished or an event is currently
10528             enabled and can_generate_whatever is being relinquished.
10529             There are three possible ways we could spec this:
10530             <ul>
10531               <li>relinquish automatically releases them</li>
10532               <li>relinquish checks and returns some error code if held</li>
10533               <li>it is the agent's responsibility and it is not checked</li>
10534             </ul>
10535             One of these should be chosen.
10536           </issue>
10537       </description>
10538       <origin>new</origin>
10539       <capabilities>
10540       </capabilities>
10541       <parameters>
10542         <param id="capabilities_ptr">
10543           <inptr><struct>jvmtiCapabilities</struct></inptr>
10544           <description>
10545             Points to the <jvmti/> capabilities to relinquish.
10546           </description>
10547         </param>
10548       </parameters>
10549       <errors>
10550       </errors>
10551     </function>
10552 
10553 
10554 
10555     <function id="GetCapabilities" jkernel="yes" phase="any" num="89">
10556       <synopsis>Get Capabilities</synopsis>
10557         <description>
10558           Returns via <paramlink id="capabilities_ptr"></paramlink> the optional <jvmti/>
10559           features which this environment currently possesses.
10560           Each possessed capability is indicated by a one (<code>1</code>) in the
10561           corresponding field of the <internallink id="jvmtiCapabilities">capabilities
10562           structure</internallink>.
10563           An environment does not possess a capability unless it has been successfully added with
10564           <functionlink id="AddCapabilities"/>.
10565           An environment only loses possession of a capability if it has been relinquished with
10566           <functionlink id="RelinquishCapabilities"/>. Thus, this function returns the net result
10567           of the <code>AddCapabilities</code> and <code>RelinquishCapabilities</code> calls which
10568           have been made.
10569           <p/>
10570           See the
10571           <internallink id="capabilityExamples">Capability Examples</internallink>.
10572         </description>
10573       <origin>jvmdiClone</origin>
10574       <capabilities>
10575       </capabilities>
10576       <parameters>
10577         <param id="capabilities_ptr">
10578           <outptr><struct>jvmtiCapabilities</struct></outptr>
10579           <description>
10580             On return, points to the <jvmti/> capabilities.
10581           </description>
10582         </param>
10583       </parameters>
10584       <errors>
10585       </errors>
10586     </function>
10587 
10588   </category>
10589 
10590 
10591   <category id="timers" label="Timers">
10592 
10593       <intro>
10594         These functions provide timing information.
10595         The resolution at which the time is updated is not specified.
10596         They provides nanosecond precision, but not necessarily nanosecond accuracy.
10597         Details about the timers, such as their maximum values, can be accessed with
10598         the timer information functions.
10599       </intro>
10600 
10601       <typedef id="jvmtiTimerInfo" label="Timer Info">
10602         <description>
10603           The information function for each timer returns this data structure.
10604         </description>
10605         <field id="max_value">
10606           <jlong/>
10607             <description>
10608               The maximum value the timer can reach.
10609               After this value is reached the timer wraps back to zero.
10610               This is an unsigned value.  If tested or printed as a jlong (signed value)
10611               it may appear to be a negative number.
10612             </description>
10613         </field>
10614         <field id="may_skip_forward">
10615           <jboolean/>
10616           <description>
10617             If true, the timer can be externally adjusted and as a result skip forward.
10618             If false, the timer value will never increase faster than real time.
10619           </description>
10620         </field>
10621         <field id="may_skip_backward">
10622           <jboolean/>
10623           <description>
10624             If true, the timer can be externally adjusted and as a result skip backward.
10625             If false, the timer value will be monotonically increasing.
10626           </description>
10627         </field>
10628         <field id="kind">
10629           <enum>jvmtiTimerKind</enum>
10630           <description>
10631             The kind of timer.
10632             On a platform that does not distinguish between user and system time, <datalink
10633                  id="JVMTI_TIMER_TOTAL_CPU"><code>JVMTI_TIMER_TOTAL_CPU</code></datalink>
10634             is returned.
10635           </description>
10636         </field>
10637         <field id="reserved1">
10638           <jlong/>
10639             <description>
10640               Reserved for future use.
10641             </description>
10642         </field>
10643         <field id="reserved2">
10644           <jlong/>
10645             <description>
10646               Reserved for future use.
10647             </description>
10648         </field>
10649       </typedef>
10650 
10651       <intro>
10652         Where the timer kind is --
10653 
10654         <constants id="jvmtiTimerKind" label="Timer Kinds" kind="enum">
10655           <constant id="JVMTI_TIMER_USER_CPU" num="30">
10656             CPU time that a thread is in user mode.
10657           </constant>
10658           <constant id="JVMTI_TIMER_TOTAL_CPU" num="31">
10659             CPU time that a thread is in user or system mode.
10660           </constant>
10661           <constant id="JVMTI_TIMER_ELAPSED" num="32">
10662             Elapsed time.
10663           </constant>
10664         </constants>
10665       </intro>
10666 
10667     <function id="GetCurrentThreadCpuTimerInfo" callbacksafe="safe"  impl="innative notrace" phase="start" num="134">
10668       <synopsis>Get Current Thread CPU Timer Information</synopsis>
10669       <description>
10670         Get information about the
10671         <functionlink id="GetCurrentThreadCpuTime"/> timer.
10672         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10673         are filled in with details about the timer.
10674         This information is specific to the platform and the implementation of
10675         <functionlink id="GetCurrentThreadCpuTime"/> and thus
10676         does not vary by thread nor does it vary
10677         during a particular invocation of the VM.
10678         <p/>
10679         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10680         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10681         returned by <code>GetCurrentThreadCpuTimerInfo</code>
10682         and <functionlink id="GetThreadCpuTimerInfo"/>
10683         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10684       </description>
10685       <origin>new</origin>
10686       <capabilities>
10687         <required id="can_get_current_thread_cpu_time">
10688             Can get current thread CPU time.
10689         </required>
10690       </capabilities>
10691       <parameters>
10692         <param id="info_ptr">
10693           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10694           <description>
10695             On return, filled with information describing the time
10696             returned by <functionlink id="GetCurrentThreadCpuTime"/>.
10697           </description>
10698         </param>
10699       </parameters>
10700       <errors>
10701       </errors>
10702     </function>
10703 
10704     <function id="GetCurrentThreadCpuTime" callbacksafe="safe" impl="innative notrace" phase="start" num="135">
10705       <synopsis>Get Current Thread CPU Time</synopsis>
10706       <description>
10707             Return the CPU time utilized by the current thread.
10708             <p/>
10709             Note that the <functionlink id="GetThreadCpuTime"/>
10710             function provides CPU time for any thread, including
10711             the current thread. <code>GetCurrentThreadCpuTime</code>
10712             exists to support platforms which cannot
10713             supply CPU time for threads other than the current
10714             thread or which have more accurate information for
10715             the current thread (see
10716             <functionlink id="GetCurrentThreadCpuTimerInfo"/> vs
10717             <functionlink id="GetThreadCpuTimerInfo"/>).
10718             On many platforms this call will be equivalent to:
10719 <example>
10720   GetThreadCpuTime(env, NULL, nanos_ptr)
10721 </example>
10722       </description>
10723       <origin>new</origin>
10724       <capabilities>
10725         <required id="can_get_current_thread_cpu_time">
10726             Can get current thread CPU time.
10727             <p/>
10728             If this capability is enabled after threads have started,
10729             the implementation may choose any time up
10730             to and including the time that the capability is enabled
10731             as the point where CPU time collection starts.
10732             <p/>
10733             This capability must be potentially available on any
10734             platform where
10735             <internallink id="jvmtiCapabilities.can_get_thread_cpu_time"><code>can_get_thread_cpu_time</code></internallink>
10736             is potentially available.
10737         </required>
10738       </capabilities>
10739       <parameters>
10740         <param id="nanos_ptr">
10741           <outptr><jlong/></outptr>
10742           <description>
10743             On return, points to the CPU time used by this thread
10744             in nanoseconds.
10745             This is an unsigned value.  If tested or printed as a jlong (signed value)
10746             it may appear to be a negative number.
10747           </description>
10748         </param>
10749       </parameters>
10750       <errors>
10751       </errors>
10752     </function>
10753 
10754     <function id="GetThreadCpuTimerInfo" num="136">
10755       <synopsis>Get Thread CPU Timer Information</synopsis>
10756       <description>
10757         Get information about the
10758         <functionlink id="GetThreadCpuTime"/> timer.
10759         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10760         are filled in with details about the timer.
10761         This information is specific to the platform and the implementation of
10762         <functionlink id="GetThreadCpuTime"/> and thus
10763         does not vary by thread nor does it vary
10764         during a particular invocation of the VM.
10765         <p/>
10766         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10767         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10768         returned by <functionlink id="GetCurrentThreadCpuTimerInfo"/>
10769         and <code>GetThreadCpuTimerInfo</code>
10770         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10771       </description>
10772       <origin>new</origin>
10773       <capabilities>
10774         <required id="can_get_thread_cpu_time">
10775             Can get thread CPU time.
10776         </required>
10777       </capabilities>
10778       <parameters>
10779         <param id="info_ptr">
10780           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10781           <description>
10782             On return, filled with information describing the time
10783             returned by <functionlink id="GetThreadCpuTime"/>.
10784           </description>
10785         </param>
10786       </parameters>
10787       <errors>
10788       </errors>
10789     </function>
10790 
10791     <function id="GetThreadCpuTime" num="137">
10792       <synopsis>Get Thread CPU Time</synopsis>
10793       <description>
10794           Return the CPU time utilized by the specified thread.
10795           <p/>
10796           Get information about this timer with
10797           <functionlink id="GetThreadCpuTimerInfo"/>.
10798       </description>
10799       <origin>new</origin>
10800       <capabilities>
10801         <required id="can_get_thread_cpu_time">
10802             Can get thread CPU time.
10803             <p/>
10804             If this capability is enabled after threads have started,
10805             the implementation may choose any time up
10806             to and including the time that the capability is enabled
10807             as the point where CPU time collection starts.
10808         </required>
10809       </capabilities>
10810       <parameters>
10811         <param id="thread">
10812           <jthread null="current"/>
10813             <description>
10814               The thread to query.
10815             </description>
10816         </param>
10817         <param id="nanos_ptr">
10818           <outptr><jlong/></outptr>
10819           <description>
10820             On return, points to the CPU time used by the specified thread
10821             in nanoseconds.
10822             This is an unsigned value.  If tested or printed as a jlong (signed value)
10823             it may appear to be a negative number.
10824           </description>
10825         </param>
10826       </parameters>
10827       <errors>
10828       </errors>
10829     </function>
10830 
10831     <function id="GetTimerInfo" phase="any" callbacksafe="safe" num="138">
10832       <synopsis>Get Timer Information</synopsis>
10833       <description>
10834         Get information about the
10835         <functionlink id="GetTime"/> timer.
10836         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10837         are filled in with details about the timer.
10838         This information will not change during a particular invocation of the VM.
10839       </description>
10840       <origin>new</origin>
10841       <capabilities>
10842       </capabilities>
10843       <parameters>
10844         <param id="info_ptr">
10845           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10846           <description>
10847             On return, filled with information describing the time
10848             returned by <functionlink id="GetTime"/>.
10849           </description>
10850         </param>
10851       </parameters>
10852       <errors>
10853       </errors>
10854     </function>
10855 
10856     <function id="GetTime" phase="any" callbacksafe="safe" num="139">
10857       <synopsis>Get Time</synopsis>
10858       <description>
10859           Return the current value of the system timer, in nanoseconds.
10860           <p/>
10861           The value returned represents nanoseconds since some fixed but
10862           arbitrary time (perhaps in the future, so values may be
10863           negative).  This function provides nanosecond precision, but not
10864           necessarily nanosecond accuracy. No guarantees are made about
10865           how frequently values change.
10866           <p/>
10867           Get information about this timer with
10868           <functionlink id="GetTimerInfo"/>.
10869       </description>
10870       <origin>new</origin>
10871       <capabilities>
10872       </capabilities>
10873       <parameters>
10874         <param id="nanos_ptr">
10875           <outptr><jlong/></outptr>
10876           <description>
10877             On return, points to the time in nanoseconds.
10878             This is an unsigned value.  If tested or printed as a jlong (signed value)
10879             it may appear to be a negative number.
10880           </description>
10881         </param>
10882       </parameters>
10883       <errors>
10884       </errors>
10885     </function>
10886 
10887     <function id="GetAvailableProcessors" phase="any" num="144">
10888       <synopsis>Get Available Processors</synopsis>
10889       <description>
10890           Returns the number of processors available to the Java virtual machine.
10891           <p/>
10892           This value may change during a particular invocation of the virtual machine.
10893           Applications that are sensitive to the number of available processors should
10894           therefore occasionally poll this property.
10895       </description>
10896       <origin>new</origin>
10897       <capabilities>
10898       </capabilities>
10899       <parameters>
10900         <param id="processor_count_ptr">
10901           <outptr><jint/></outptr>
10902           <description>
10903             On return, points to the maximum number of processors available to the
10904             virtual machine; never smaller than one.
10905           </description>
10906         </param>
10907       </parameters>
10908       <errors>
10909       </errors>
10910     </function>
10911 
10912   </category>
10913 
10914 
10915   <category id="classLoaderSearch" label="Class Loader Search">
10916 
10917     <intro>
10918       These functions allow the agent to add to the locations that a class loader searches for a class.
10919       This is useful for installing instrumentation under the correct class loader.
10920     </intro>
10921 
10922     <function id="AddToBootstrapClassLoaderSearch" jkernel="yes" phase="onload" num="149">
10923       <synopsis>Add To Bootstrap Class Loader Search</synopsis>
10924       <description>
10925           This function can be used to cause instrumentation classes to be defined by the
10926           bootstrap class loader. See <vmspec chapter="5.3.1"/>.
10927           After the bootstrap
10928           class loader unsuccessfully searches for a class, the specified platform-dependent
10929           search path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in
10930           the <paramlink id="segment"/>. This function may be called multiple times to add multiple segments,
10931           the segments will be searched in the order that this function was called.
10932           <p/>
10933           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
10934           search path segment to be searched after the bootstrap class loader unsuccessfully searches
10935           for a class. The segment is typically a directory or JAR file.
10936           <p/>
10937           In the live phase the <paramlink id="segment"/> may be used to specify any platform-dependent
10938           path to a <externallink id="jar/jar.html">
10939           JAR file</externallink>. The agent should take care that the JAR file does not
10940           contain any classes or resources other than those to be defined by the bootstrap
10941           class loader for the purposes of instrumentation.
10942           <p/>
10943           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
10944           reference that the Java virtual machine has previously unsuccessfully attempted
10945           to resolve always fails with the same error that was thrown as a result of the
10946           initial resolution attempt. Consequently, if the JAR file contains an entry
10947           that corresponds to a class for which the Java virtual machine has
10948           unsuccessfully attempted to resolve a reference, then subsequent attempts to
10949           resolve that reference will fail with the same error as the initial attempt.
10950       </description>
10951       <origin>new</origin>
10952       <capabilities>
10953       </capabilities>
10954       <parameters>
10955         <param id="segment">
10956           <inbuf><char/></inbuf>
10957           <description>
10958             The platform-dependent search path segment, encoded as a
10959             <internallink id="mUTF">modified UTF-8</internallink> string.
10960           </description>
10961         </param>
10962       </parameters>
10963       <errors>
10964         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
10965           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
10966            existing JAR file is an invalid path.
10967         </error>
10968       </errors>
10969     </function>
10970 
10971     <function id="AddToSystemClassLoaderSearch" jkernel="yes" phase="onload" num="151" since="1.1">
10972       <synopsis>Add To System Class Loader Search</synopsis>
10973       <description>
10974           This function can be used to cause instrumentation classes to be
10975           defined by the system class loader. See <vmspec chapter="5.3.2"/>.
10976           After the class loader unsuccessfully searches for a class, the specified platform-dependent search
10977           path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in the
10978           <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, the
10979           segments will be searched in the order that this function was called.
10980           <p/>
10981           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
10982           search path segment to be searched after the system class loader unsuccessfully searches
10983           for a class. The segment is typically a directory or JAR file.
10984           <p/>
10985           In the live phase the <paramlink id="segment"/> is a platform-dependent path to a
10986           <externallink id="jar/jar.html">JAR file</externallink> to be
10987           searched after the system class loader unsuccessfully searches for a class. The agent should
10988           take care that the JAR file does not contain any classes or resources other than those to be
10989           defined by the system class loader for the purposes of instrumentation.
10990           <p/>
10991           In the live phase the system class loader supports adding a JAR file to be searched if
10992           the system class loader implements a method name <code>appendToClassPathForInstrumentation</code>
10993           which takes a single parameter of type <code>java.lang.String</code>. The method is not required
10994           to have <code>public</code> access.
10995           <p/>
10996           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
10997           reference that the Java virtual machine has previously unsuccessfully attempted
10998           to resolve always fails with the same error that was thrown as a result of the
10999           initial resolution attempt. Consequently, if the JAR file contains an entry
11000           that corresponds to a class for which the Java virtual machine has
11001           unsuccessfully attempted to resolve a reference, then subsequent attempts to
11002           resolve that reference will fail with the same error as the initial attempt.
11003       </description>
11004       <origin>new</origin>
11005       <capabilities>
11006       </capabilities>
11007       <parameters>
11008         <param id="segment">
11009           <inbuf><char/></inbuf>
11010           <description>
11011             The platform-dependent search path segment, encoded as a
11012             <internallink id="mUTF">modified UTF-8</internallink> string.
11013           </description>
11014         </param>
11015       </parameters>
11016       <errors>
11017         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11018           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
11019            existing JAR file is an invalid path.
11020         </error>
11021         <error id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED">
11022           Operation not supported by the system class loader.
11023         </error>
11024       </errors>
11025     </function>
11026 
11027   </category>
11028 
11029 
11030   <category id="props" label="System Properties">
11031 
11032     <intro>
11033       These functions get and set system properties.
11034     </intro>
11035 
11036     <function id="GetSystemProperties" phase="onload" num="130">
11037       <synopsis>Get System Properties</synopsis>
11038       <description>
11039         The list of VM system property keys which may be used with
11040         <functionlink id="GetSystemProperty"/> is returned.
11041         It is strongly recommended that virtual machines provide the
11042         following property keys:
11043         <ul>
11044           <li><code>java.vm.vendor</code></li>
11045           <li><code>java.vm.version</code></li>
11046           <li><code>java.vm.name</code></li>
11047           <li><code>java.vm.info</code></li>
11048           <li><code>java.library.path</code></li>
11049           <li><code>java.class.path</code></li>
11050         </ul>
11051         Provides access to system properties defined by and used
11052         by the VM.
11053         Properties set on the command-line are included.
11054         This allows getting and setting of these properties
11055         before the VM even begins executing bytecodes.
11056         Since this is a VM view of system properties, the set of available
11057         properties will usually be different than that
11058         in <code>java.lang.System.getProperties</code>.
11059         JNI method invocation may be used to access
11060         <code>java.lang.System.getProperties</code>.
11061         <p/>
11062         The set of properties may grow during execution.
11063       </description>
11064       <origin>new</origin>
11065       <capabilities>
11066       </capabilities>
11067       <parameters>
11068         <param id="count_ptr">
11069           <outptr><jint/></outptr>
11070           <description>
11071             On return, points to the number of property keys returned.
11072           </description>
11073         </param>
11074         <param id="property_ptr">
11075           <allocallocbuf outcount="count_ptr"><char/></allocallocbuf>
11076           <description>
11077             On return, points to an array of property keys, encoded as
11078             <internallink id="mUTF">modified UTF-8</internallink> strings.
11079           </description>
11080         </param>
11081       </parameters>
11082       <errors>
11083       </errors>
11084     </function>
11085 
11086     <function id="GetSystemProperty" phase="onload" num="131">
11087       <synopsis>Get System Property</synopsis>
11088       <description>
11089         Return a VM system property value given the property key.
11090         <p/>
11091         The function <functionlink id="GetSystemProperties"/>
11092         returns the set of property keys which may be used.
11093         The properties which can be retrieved may grow during
11094         execution.
11095         <p/>
11096         Since this is a VM view of system properties, the values
11097         of properties may differ from that returned by
11098         <code>java.lang.System.getProperty(String)</code>.
11099         A typical VM might copy the values of the VM system
11100         properties into the <code>Properties</code> held by
11101         <code>java.lang.System</code> during the initialization
11102         of that class. Thereafter any changes to the VM system
11103         properties (with <functionlink id="SetSystemProperty"/>)
11104         or the <code>java.lang.System</code> system properties
11105         (with <code>java.lang.System.setProperty(String,String)</code>)
11106         would cause the values to diverge.
11107         JNI method invocation may be used to access
11108         <code>java.lang.System.getProperty(String)</code>.
11109       </description>
11110       <origin>new</origin>
11111       <capabilities>
11112       </capabilities>
11113       <parameters>
11114         <param id="property">
11115           <inbuf><char/></inbuf>
11116           <description>
11117             The key of the property to retrieve, encoded as a
11118             <internallink id="mUTF">modified UTF-8</internallink> string.
11119           </description>
11120         </param>
11121         <param id="value_ptr">
11122           <allocbuf><char/></allocbuf>
11123           <description>
11124             On return, points to the property value, encoded as a
11125             <internallink id="mUTF">modified UTF-8</internallink> string.
11126           </description>
11127         </param>
11128       </parameters>
11129       <errors>
11130         <error id="JVMTI_ERROR_NOT_AVAILABLE">
11131           This property is not available.
11132           Use <functionlink id="GetSystemProperties"/> to find available properties.
11133         </error>
11134       </errors>
11135     </function>
11136 
11137     <function id="SetSystemProperty" phase="onloadOnly" num="132">
11138       <synopsis>Set System Property</synopsis>
11139       <description>
11140         Set a VM system property value.
11141         <p/>
11142         The function <functionlink id="GetSystemProperties"/>
11143         returns the set of property keys, some of these may be settable.
11144         See <functionlink id="GetSystemProperty"/>.
11145       </description>
11146       <origin>new</origin>
11147       <capabilities>
11148       </capabilities>
11149       <parameters>
11150         <param id="property">
11151           <inbuf><char/></inbuf>
11152           <description>
11153             The key of the property, encoded as a
11154             <internallink id="mUTF">modified UTF-8</internallink> string.
11155           </description>
11156         </param>
11157         <param id="value_ptr">
11158           <inbuf>
11159             <char/>
11160             <nullok>
11161               do not set the value, but return <errorlink id="JVMTI_ERROR_NOT_AVAILABLE"/>
11162               if the property is not writeable
11163             </nullok>
11164           </inbuf>
11165           <description>
11166             The property value to set, encoded as a
11167             <internallink id="mUTF">modified UTF-8</internallink> string.
11168           </description>
11169         </param>
11170       </parameters>
11171       <errors>
11172         <error id="JVMTI_ERROR_NOT_AVAILABLE">
11173           This property is not available or is not writeable.
11174         </error>
11175       </errors>
11176     </function>
11177 
11178   </category>
11179 
11180   <category id="general" label="General">
11181 
11182     <intro>
11183     </intro>
11184 
11185     <function id="GetPhase" jkernel="yes" phase="any" num="133">
11186       <synopsis>Get Phase</synopsis>
11187       <description>
11188           Return the current phase of VM execution.
11189           The phases proceed in sequence:
11190           <constants id="jvmtiPhase" label="Phases of execution" kind="enum">
11191             <constant id="JVMTI_PHASE_ONLOAD" num="1">
11192               <code>OnLoad</code> phase: while in the
11193               <internallink id="onload"><code>Agent_OnLoad</code></internallink>
11194               or, for statically linked agents, the <internallink id="onload">
11195               <code>Agent_OnLoad_&lt;agent-lib-name&gt;
11196               </code></internallink> function.
11197             </constant>
11198             <constant id="JVMTI_PHASE_PRIMORDIAL" num="2">
11199               Primordial phase: between return from <code>Agent_OnLoad</code>
11200               or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> and the
11201               <code>VMStart</code> event.
11202             </constant>
11203             <constant id="JVMTI_PHASE_START" num="6">
11204               Start phase: when the <eventlink id="VMStart"><code>VMStart</code></eventlink> event
11205               is sent and until the <code>VMInit</code> event is sent.
11206             </constant>
11207             <constant id="JVMTI_PHASE_LIVE" num="4">
11208               Live phase: when the <eventlink id="VMInit"><code>VMInit</code></eventlink> event is sent
11209               and until the <eventlink id="VMDeath"></eventlink> event returns.
11210             </constant>
11211             <constant id="JVMTI_PHASE_DEAD" num="8">
11212               Dead phase: after the <eventlink id="VMDeath"></eventlink> event returns or after
11213               start-up failure.
11214             </constant>
11215           </constants>
11216           In the case of start-up failure the VM will proceed directly to the dead
11217           phase skipping intermediate phases and neither a <code>VMInit</code> nor
11218           <code>VMDeath</code> event will be sent.
11219           <p/>
11220           Most <jvmti/> functions operate only in the live phase.
11221           The following functions operate in either the <code>OnLoad</code> or live phases:
11222           <functionphaselist phase="onload"/>
11223           The following functions operate in only the <code>OnLoad</code> phase:
11224           <functionphaselist phase="onloadOnly"/>
11225           The following functions operate in the start or live phases:
11226           <functionphaselist phase="start"/>
11227           The following functions operate in any phase:
11228           <functionphaselist phase="any"/>
11229           JNI functions (except the Invocation API) must only be used in the start or live phases.
11230           <p/>
11231           Most <jvmti/> events are sent only in the live phase.
11232           The following events operate in others phases:
11233           <eventphaselist phase="start"/>
11234           <eventphaselist phase="any"/>
11235       </description>
11236       <origin>new</origin>
11237       <capabilities>
11238       </capabilities>
11239       <parameters>
11240         <param id="phase_ptr">
11241           <outptr><enum>jvmtiPhase</enum></outptr>
11242           <description>
11243             On return, points to the phase.
11244           </description>
11245         </param>
11246       </parameters>
11247       <errors>
11248       </errors>
11249     </function>
11250 
11251     <function id="DisposeEnvironment" jkernel="yes" phase="any" num="127">
11252       <synopsis>Dispose Environment</synopsis>
11253       <description>
11254         Shutdown a <jvmti/> connection created with JNI <code>GetEnv</code>
11255         (see <internallink id="environments"><jvmti/> Environments</internallink>).
11256         Dispose of any resources held by the environment.
11257         <issue>
11258             What resources are reclaimed? What is undone?
11259             Breakpoints,watchpoints removed?
11260         </issue>
11261         Threads suspended by this environment are not resumed by this call,
11262         this must be done explicitly by the agent.
11263         Memory allocated by this environment via calls to <jvmti/> functions
11264         is not released, this can be done explicitly by the agent
11265         by calling <functionlink id="Deallocate"/>.
11266         Raw monitors created by this environment are not destroyed,
11267         this can be done explicitly by the agent
11268         by calling <functionlink id="DestroyRawMonitor"/>.
11269         The state of threads waiting on raw monitors created by this environment
11270         are not affected.
11271         <p/>
11272         Any <functionlink id="SetNativeMethodPrefix">native method
11273         prefixes</functionlink> for this environment will be unset;
11274         the agent must remove any prefixed native methods before
11275         dispose is called.
11276         <p/>
11277         Any <internallink id="capability">capabilities</internallink>
11278         held by this environment are relinquished.
11279         <p/>
11280         Events enabled by this environment will no longer be sent, however
11281         event handlers currently running will continue to run.  Caution must
11282         be exercised in the design of event handlers whose environment may
11283         be disposed and thus become invalid during their execution.
11284         <p/>
11285         This environment may not be used after this call.
11286         This call returns to the caller.
11287       </description>
11288       <origin>new</origin>
11289       <capabilities>
11290       </capabilities>
11291       <parameters>
11292       </parameters>
11293       <errors>
11294       </errors>
11295     </function>
11296 
11297     <function id="SetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="148">
11298       <synopsis>Set Environment Local Storage</synopsis>
11299       <description>
11300         The VM stores a pointer value associated with each environment.
11301         This pointer value is called <i>environment-local storage</i>.
11302         This value is <code>NULL</code> unless set with this function.
11303         Agents can allocate memory in which they store environment specific
11304         information. By setting environment-local storage it can then be
11305         accessed with
11306         <functionlink id="GetEnvironmentLocalStorage"></functionlink>.
11307         <p/>
11308         Called by the agent to set the value of the <jvmti/>
11309         environment-local storage. <jvmti/> supplies to the agent a pointer-size
11310         environment-local storage that can be used to record per-environment
11311         information.
11312       </description>
11313       <origin>new</origin>
11314       <capabilities>
11315       </capabilities>
11316       <parameters>
11317         <param id="data">
11318           <inbuf>
11319             <void/>
11320             <nullok>value is set to <code>NULL</code></nullok>
11321           </inbuf>
11322           <description>
11323             The value to be entered into the environment-local storage.
11324           </description>
11325         </param>
11326       </parameters>
11327       <errors>
11328       </errors>
11329     </function>
11330 
11331     <function id="GetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="147">
11332       <synopsis>Get Environment Local Storage</synopsis>
11333       <description>
11334         Called by the agent to get the value of the <jvmti/> environment-local
11335         storage.
11336       </description>
11337       <origin>new</origin>
11338       <capabilities>
11339       </capabilities>
11340       <parameters>
11341         <param id="data_ptr">
11342           <agentbuf><void/></agentbuf>
11343           <description>
11344             Pointer through which the value of the environment local
11345             storage is returned.
11346             If environment-local storage has not been set with
11347             <functionlink id="SetEnvironmentLocalStorage"></functionlink> returned
11348             pointer is <code>NULL</code>.
11349           </description>
11350         </param>
11351       </parameters>
11352       <errors>
11353       </errors>
11354     </function>
11355 
11356     <function id="GetVersionNumber" jkernel="yes" phase="any" num="88">
11357       <synopsis>Get Version Number</synopsis>
11358       <description>
11359         Return the <jvmti/> version via <code>version_ptr</code>.
11360         The return value is the version identifier.
11361         The version identifier includes major, minor and micro
11362         version as well as the interface type.
11363         <constants id="jvmtiVersionInterfaceTypes" label="Version Interface Types" kind="bits">
11364           <constant id="JVMTI_VERSION_INTERFACE_JNI" num="0x00000000">
11365             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for JNI.
11366           </constant>
11367           <constant id="JVMTI_VERSION_INTERFACE_JVMTI" num="0x30000000">
11368             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for <jvmti/>.
11369           </constant>
11370         </constants>
11371         <constants id="jvmtiVersionMasks" label="Version Masks" kind="bits">
11372           <constant id="JVMTI_VERSION_MASK_INTERFACE_TYPE" num="0x70000000">
11373             Mask to extract interface type.
11374             The value of the version returned by this function masked with
11375             <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> is always
11376             <code>JVMTI_VERSION_INTERFACE_JVMTI</code>
11377             since this is a <jvmti/> function.
11378           </constant>
11379           <constant id="JVMTI_VERSION_MASK_MAJOR" num="0x0FFF0000">
11380             Mask to extract major version number.
11381           </constant>
11382           <constant id="JVMTI_VERSION_MASK_MINOR" num="0x0000FF00">
11383             Mask to extract minor version number.
11384           </constant>
11385           <constant id="JVMTI_VERSION_MASK_MICRO" num="0x000000FF">
11386             Mask to extract micro version number.
11387           </constant>
11388         </constants>
11389         <constants id="jvmtiVersionShifts" label="Version Shifts" kind="bits">
11390           <constant id="JVMTI_VERSION_SHIFT_MAJOR" num="16">
11391             Shift to extract major version number.
11392           </constant>
11393           <constant id="JVMTI_VERSION_SHIFT_MINOR" num="8">
11394             Shift to extract minor version number.
11395           </constant>
11396           <constant id="JVMTI_VERSION_SHIFT_MICRO" num="0">
11397             Shift to extract micro version number.
11398           </constant>
11399         </constants>
11400       </description>
11401       <origin>jvmdi</origin>
11402       <capabilities>
11403       </capabilities>
11404       <parameters>
11405         <param id="version_ptr">
11406           <outptr><jint/></outptr>
11407           <description>
11408             On return, points to the <jvmti/> version.
11409           </description>
11410         </param>
11411       </parameters>
11412       <errors>
11413       </errors>
11414     </function>
11415 
11416 
11417     <function id="GetErrorName" phase="any" num="128">
11418       <synopsis>Get Error Name</synopsis>
11419       <description>
11420         Return the symbolic name for an
11421           <internallink id="ErrorSection">error code</internallink>.
11422         <p/>
11423         For example
11424         <code>GetErrorName(env, JVMTI_ERROR_NONE, &amp;err_name)</code>
11425         would return in <code>err_name</code> the string
11426         <code>"JVMTI_ERROR_NONE"</code>.
11427       </description>
11428       <origin>new</origin>
11429       <capabilities>
11430       </capabilities>
11431       <parameters>
11432         <param id="error">
11433           <enum>jvmtiError</enum>
11434           <description>
11435             The error code.
11436           </description>
11437         </param>
11438         <param id="name_ptr">
11439           <allocbuf><char/></allocbuf>
11440           <description>
11441             On return, points to the error name.
11442             The name is encoded as a
11443             <internallink id="mUTF">modified UTF-8</internallink> string,
11444             but is restricted to the ASCII subset.
11445           </description>
11446         </param>
11447       </parameters>
11448       <errors>
11449       </errors>
11450     </function>
11451 
11452     <function id="SetVerboseFlag" phase="any" num="150">
11453       <synopsis>Set Verbose Flag</synopsis>
11454       <description>
11455         <constants id="jvmtiVerboseFlag" label="Verbose Flag Enumeration" kind="enum">
11456           <constant id="JVMTI_VERBOSE_OTHER" num="0">
11457             Verbose output other than the below.
11458           </constant>
11459           <constant id="JVMTI_VERBOSE_GC" num="1">
11460             Verbose garbage collector output, like that specified with <code>-verbose:gc</code>.
11461           </constant>
11462           <constant id="JVMTI_VERBOSE_CLASS" num="2">
11463             Verbose class loading output, like that specified with <code>-verbose:class</code>.
11464           </constant>
11465           <constant id="JVMTI_VERBOSE_JNI" num="4">
11466             Verbose JNI output, like that specified with <code>-verbose:jni</code>.
11467           </constant>
11468         </constants>
11469         Control verbose output.
11470         This is the output which typically is sent to <code>stderr</code>.
11471       </description>
11472       <origin>new</origin>
11473       <capabilities>
11474       </capabilities>
11475       <parameters>
11476         <param id="flag">
11477           <enum>jvmtiVerboseFlag</enum>
11478           <description>
11479             Which verbose flag to set.
11480           </description>
11481         </param>
11482         <param id="value">
11483           <jboolean/>
11484           <description>
11485             New value of the flag.
11486           </description>
11487         </param>
11488       </parameters>
11489       <errors>
11490       </errors>
11491     </function>
11492 
11493 
11494     <function id="GetJLocationFormat" phase="any" num="129">
11495       <synopsis>Get JLocation Format</synopsis>
11496       <description>
11497         Although the greatest functionality is achieved with location information
11498         referencing the virtual machine bytecode index, the definition of
11499         <code>jlocation</code> has intentionally been left unconstrained to allow VM
11500         implementations that do not have this information.
11501         <p/>
11502         This function describes the representation of <code>jlocation</code> used in this VM.
11503         If the returned format is <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>,
11504         <code>jlocation</code>s can
11505         be used as in indices into the array returned by
11506         <functionlink id="GetBytecodes"></functionlink>.
11507         <constants id="jvmtiJlocationFormat" label="JLocation Format Enumeration" kind="enum">
11508           <constant id="JVMTI_JLOCATION_JVMBCI" num="1">
11509             <code>jlocation</code> values represent virtual machine
11510             bytecode indices--that is, offsets into the
11511             virtual machine code for a method.
11512           </constant>
11513           <constant id="JVMTI_JLOCATION_MACHINEPC" num="2">
11514             <code>jlocation</code> values represent native machine
11515             program counter values.
11516           </constant>
11517           <constant id="JVMTI_JLOCATION_OTHER" num="0">
11518             <code>jlocation</code> values have some other representation.
11519           </constant>
11520         </constants>
11521       </description>
11522       <origin>new</origin>
11523       <capabilities>
11524       </capabilities>
11525       <parameters>
11526         <param id="format_ptr">
11527           <outptr><enum>jvmtiJlocationFormat</enum></outptr>
11528           <description>
11529             On return, points to the format identifier for <code>jlocation</code> values.
11530           </description>
11531         </param>
11532       </parameters>
11533       <errors>
11534       </errors>
11535     </function>
11536 
11537   </category>
11538 
11539   <category id="heap_monitoring" label="Heap Monitoring">
11540     <typedef id="jvmtiStackTrace" label="Stack Trace">
11541       <field id="frames">
11542         <allocfieldbuf outcount="frame_count">
11543           <struct>jvmtiFrameInfo</struct>
11544         </allocfieldbuf>
11545         <description>Pointer to the call frames.</description>
11546       </field>
11547       <field id="frame_count">
11548         <jint/>
11549         <description>The number of frames for the trace.</description>
11550       </field>
11551       <field id="size">
11552         <jint/>
11553         <description>The size of the object allocation.</description>
11554       </field>
11555       <field id="thread_id">
11556         <jlong/>
11557         <description>The thread id number.</description>
11558       </field>
11559     </typedef>
11560 
11561     <typedef id="jvmtiStackTraces" label="Stack Traces">
11562       <field id="stack_traces">
11563         <allocfieldbuf outcount="trace_count">
11564           <struct>jvmtiStackTrace</struct>
11565         </allocfieldbuf>
11566         <description>
11567           The <datalink id="jvmtiStackTrace"/> array with the various stack traces.
11568         </description>
11569       </field>
11570 
11571       <field id="trace_count">
11572         <jint/>
11573         <description>
11574           Number of traces pointed by the array <datalink id="jvmtiStackTraces"/>.
11575         </description>
11576       </field>
11577     </typedef>
11578 
11579     <typedef id="jvmtiHeapSamplingStats" label="Heap Sampling Statistics">
11580       <field id="sample_count">
11581         <jlong/>
11582         <description>
11583           The number of sampled allocations during the lifetime of the sampler.
11584           For very long sampling, this number can overflow.
11585         </description>
11586       </field>
11587 
11588       <field id="garbage_collected_samples">
11589         <jlong/>
11590         <description>
11591           The number of samples already garbage collected.
11592           For very long sampling, this number can overflow.
11593         </description>
11594       </field>
11595 
11596       <field id="sample_rate_accumulation">
11597         <jlong/>
11598         <description>
11599           Accumulation of the sample rates chosen.
11600           For very long sampling, this number can overflow.
11601         </description>
11602       </field>
11603 
11604       <field id="sample_rate_count">
11605         <jlong/>
11606         <description>
11607           The number of sample rates chosen.
11608           For very long sampling, this number can overflow.
11609         </description>
11610       </field>
11611 
11612       <field id="stack_depth_accumulation">
11613         <jlong/>
11614         <description>
11615           Accumulation of stack depths collected by the sampler.
11616           For very long sampling, this number can overflow.
11617         </description>
11618       </field>
11619     </typedef>
11620 
11621     <function id="StartHeapSampling" phase="any" num="156">
11622       <synopsis>Start Heap Sampling</synopsis>
11623       <description>
11624         Start the heap sampler in the JVM. The function provides, via its argument, the sampling
11625         rate requested and will fill internal data structures with heap allocation samples. The
11626         samples are obtained via the <functionlink id="GetLiveTraces"></functionlink>,
11627         <functionlink id="GetGarbageTraces"></functionlink>, <functionlink id="GetFrequentGarbageTraces"></functionlink>,
11628         functions.
11629 
11630         Starting the heap sampler resets internal traces and counters. Therefore stopping the sampler
11631         puts internal trace samples and counters on pause for post-processing.
11632       </description>
11633       <origin>new</origin>
11634       <capabilities>
11635         <required id="can_sample_heap"></required>
11636       </capabilities>
11637       <parameters>
11638         <param id="monitoring_rate">
11639           <jint/>
11640           <description>
11641             The monitoring rate used for sampling. The sampler will use a statistical approach to
11642             provide in average sampling every <paramlink id="monitoring_rate"/> allocated bytes.
11643 
11644             Note: a low monitoring rate will incur a higher overhead, therefore, the sampler should
11645             only be used when knowing it may impact performance.
11646           </description>
11647         </param>
11648         <param id="max_gc_storage">
11649           <jint/>
11650           <description>
11651             The maximum storage used for the GC samples in the sampler. By default, the value is 200.
11652           </description>
11653         </param>
11654       </parameters>
11655       <errors>
11656         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11657           <paramlink id="monitoring_period"></paramlink> is less than zero.
11658         </error>
11659       </errors>
11660     </function>
11661 
11662     <function id="StopHeapSampling" phase="any" num="157">
11663       <synopsis>Stop Heap Sampling</synopsis>
11664       <description>
11665         Stop the heap sampler in the JVM.
11666         Any sample obtained during sampling is still available via the <functionlink id="GetLiveTraces"></functionlink>,
11667         <functionlink id="GetGarbageTraces"></functionlink>, <functionlink id="GetFrequentGarbageTraces"></functionlink>,
11668         functions.
11669 
11670         Starting the heap sampler resets internal traces and counters. Therefore stopping the sampler
11671         puts internal trace samples and counters on pause for post-processing.
11672       </description>
11673       <origin>new</origin>
11674       <capabilities>
11675         <required id="can_sample_heap"></required>
11676       </capabilities>
11677       <parameters>
11678       </parameters>
11679       <errors>
11680       </errors>
11681     </function>
11682 
11683     <function id="GetLiveTraces" num="158">
11684       <synopsis>Get Live Traces</synopsis>
11685       <description>
11686         Get Live Heap Sampled traces.  The fields of the <datalink id="jvmtiStackTraces"/>
11687         structure are filled in with details of the specified sampled allocation.
11688 
11689         This method can be called at any time but if the sampler has not been started via at least
11690         one call to <functionlink id="StartHeapSampling"></functionlink> it returns no traces.
11691       </description>
11692       <origin>new</origin>
11693       <capabilities>
11694         <required id="can_sample_heap"></required>
11695       </capabilities>
11696       <parameters>
11697         <param id="stack_traces">
11698           <outptr><struct>jvmtiStackTraces</struct></outptr>
11699           <description>
11700             The stack trace data structure to be filled.
11701           </description>
11702         </param>
11703       </parameters>
11704       <errors>
11705       </errors>
11706     </function>
11707 
11708     <function id="GetGarbageTraces" num="159">
11709       <synopsis>Get Garbage Traces</synopsis>
11710       <description>
11711         Get the recent garbage heap sampled traces.  The fields of the <datalink id="jvmtiStackTraces"/>
11712         structure are filled in with details of the specified sampled allocation.
11713 
11714         This method can be called at any time but if the sampler has not been started via at least
11715         one call to <functionlink id="StartHeapSampling"></functionlink> it returns no traces.
11716       </description>
11717       <origin>new</origin>
11718       <capabilities>
11719         <required id="can_sample_heap"></required>
11720       </capabilities>
11721       <parameters>
11722         <param id="stack_traces">
11723           <outptr><struct>jvmtiStackTraces</struct></outptr>
11724           <description>
11725             The stack trace data structure to be filled.
11726           </description>
11727         </param>
11728       </parameters>
11729       <errors>
11730       </errors>
11731     </function>
11732 
11733     <function id="GetFrequentGarbageTraces" num="160">
11734       <synopsis>Get Frequent Garbage Traces</synopsis>
11735       <description>
11736         Get the frequent garbage heap sampled traces.  The fields of the <datalink id="jvmtiStackTraces"/>
11737         structure are filled in with details of the specified sampled allocation.
11738 
11739         This method can be called at any time but if the sampler has not been started via at least
11740         one call to <functionlink id="StartHeapSampling"></functionlink> it returns no traces.
11741       </description>
11742       <origin>new</origin>
11743       <capabilities>
11744         <required id="can_sample_heap"></required>
11745       </capabilities>
11746       <parameters>
11747         <param id="stack_traces">
11748           <outptr><struct>jvmtiStackTraces</struct></outptr>
11749           <description>
11750             The stack trace data structure to be filled.
11751           </description>
11752         </param>
11753       </parameters>
11754       <errors>
11755       </errors>
11756     </function>
11757 
11758     <function id="ReleaseTraces" num="161">
11759       <synopsis>Release traces provided by the heap monitoring</synopsis>
11760       <description>
11761         Release traces provided by any of the trace retrieval methods.
11762       </description>
11763       <origin>new</origin>
11764       <capabilities>
11765         <required id="can_sample_heap"></required>
11766       </capabilities>
11767       <parameters>
11768         <param id="stack_traces">
11769           <outptr><struct>jvmtiStackTraces</struct></outptr>
11770           <description>
11771             The stack trace data structure to be released.
11772           </description>
11773         </param>
11774       </parameters>
11775       <errors>
11776       </errors>
11777     </function>
11778 
11779     <function id="GetHeapSamplingStats" num="162">
11780       <synopsis>Get the heap sampling statistics</synopsis>
11781       <description>
11782         Returns a <datalink id="jvmtiHeapSamplingStats"/> to understand the heap sampling behavior and current
11783         internal data storage status.
11784 
11785         This method can be called at any time but if the sampler has not been started via at least
11786         one call to <functionlink id="StartHeapSampling"></functionlink> it returns a zeroed-out structure.
11787       </description>
11788       <origin>new</origin>
11789       <capabilities>
11790         <required id="can_sample_heap"></required>
11791       </capabilities>
11792       <parameters>
11793         <param id="stats">
11794           <outptr><struct>jvmtiHeapSamplingStats</struct></outptr>
11795           <description>
11796             The structure to be filled with the heap sampler's statistics.
11797           </description>
11798         </param>
11799       </parameters>
11800       <errors>
11801       </errors>
11802     </function>
11803   </category>
11804 
11805 </functionsection>
11806 
11807 <errorsection label="Error Reference">
11808   <intro>
11809     Every <jvmti/> function returns a <b><code>jvmtiError</code></b> error code.
11810     <p/>
11811     It is the responsibility of the agent to call <jvmti/> functions with
11812     valid parameters and in the proper context (calling thread is attached,
11813     phase is correct, etc.).
11814     Detecting some error conditions may be difficult, inefficient, or
11815     impossible for an implementation.
11816     The errors listed in
11817     <internallink id="reqerrors">Function Specific Required Errors</internallink>
11818     must be detected by the implementation.
11819     All other errors represent the recommended response to the error
11820     condition.
11821   </intro>
11822 
11823   <errorcategory id="universal-error" label="Universal Errors">
11824     <intro>
11825       The following errors may be returned by any function
11826     </intro>
11827 
11828     <errorid id="JVMTI_ERROR_NONE" num="0">
11829       No error has occurred.  This is the error code that is returned
11830       on successful completion of the function.
11831     </errorid>
11832     <errorid id="JVMTI_ERROR_NULL_POINTER" num="100">
11833       Pointer is unexpectedly <code>NULL</code>.
11834     </errorid>
11835     <errorid id="JVMTI_ERROR_OUT_OF_MEMORY" num="110">
11836       The function attempted to allocate memory and no more memory was
11837       available for allocation.
11838     </errorid>
11839     <errorid id="JVMTI_ERROR_ACCESS_DENIED" num="111">
11840       The desired functionality has not been enabled in this virtual machine.
11841     </errorid>
11842     <errorid id="JVMTI_ERROR_UNATTACHED_THREAD" num="115">
11843       The thread being used to call this function is not attached
11844       to the virtual machine.  Calls must be made from attached threads.
11845       See <code>AttachCurrentThread</code> in the JNI invocation API.
11846     </errorid>
11847     <errorid id="JVMTI_ERROR_INVALID_ENVIRONMENT" num="116">
11848       The <jvmti/> environment provided is no longer connected or is
11849       not an environment.
11850     </errorid>
11851     <errorid id="JVMTI_ERROR_WRONG_PHASE" num="112">
11852       The desired functionality is not available in the current
11853         <functionlink id="GetPhase">phase</functionlink>.
11854       Always returned if the virtual machine has completed running.
11855     </errorid>
11856     <errorid id="JVMTI_ERROR_INTERNAL" num="113">
11857       An unexpected internal error has occurred.
11858     </errorid>
11859   </errorcategory>
11860 
11861   <errorcategory id="reqerrors" label="Function Specific Required Errors">
11862     <intro>
11863       The following errors are returned by some <jvmti/> functions and must
11864       be returned by the implementation when the condition occurs.
11865     </intro>
11866 
11867     <errorid id="JVMTI_ERROR_INVALID_PRIORITY" num="12">
11868       Invalid priority.
11869     </errorid>
11870     <errorid id="JVMTI_ERROR_THREAD_NOT_SUSPENDED" num="13">
11871       Thread was not suspended.
11872     </errorid>
11873     <errorid id="JVMTI_ERROR_THREAD_SUSPENDED" num="14">
11874       Thread already suspended.
11875     </errorid>
11876     <errorid id="JVMTI_ERROR_THREAD_NOT_ALIVE" num="15">
11877       This operation requires the thread to be alive--that is,
11878       it must be started and not yet have died.
11879     </errorid>
11880     <errorid id="JVMTI_ERROR_CLASS_NOT_PREPARED" num="22">
11881       The class has been loaded but not yet prepared.
11882     </errorid>
11883     <errorid id="JVMTI_ERROR_NO_MORE_FRAMES" num="31">
11884       There are no Java programming language or JNI stack frames at the specified depth.
11885     </errorid>
11886     <errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32">
11887       Information about the frame is not available (e.g. for native frames).
11888     </errorid>
11889     <errorid id="JVMTI_ERROR_DUPLICATE" num="40">
11890       Item already set.
11891     </errorid>
11892     <errorid id="JVMTI_ERROR_NOT_FOUND" num="41">
11893       Desired element (e.g. field or breakpoint) not found
11894     </errorid>
11895     <errorid id="JVMTI_ERROR_NOT_MONITOR_OWNER" num="51">
11896       This thread doesn't own the raw monitor.
11897     </errorid>
11898     <errorid id="JVMTI_ERROR_INTERRUPT" num="52">
11899       The call has been interrupted before completion.
11900     </errorid>
11901     <errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79">
11902       The class cannot be modified.
11903     </errorid>
11904     <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80">
11905       The module cannot be modified.
11906     </errorid>
11907     <errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98">
11908       The functionality is not available in this virtual machine.
11909     </errorid>
11910     <errorid id="JVMTI_ERROR_ABSENT_INFORMATION" num="101">
11911       The requested information is not available.
11912     </errorid>
11913     <errorid id="JVMTI_ERROR_INVALID_EVENT_TYPE" num="102">
11914       The specified event type ID is not recognized.
11915     </errorid>
11916     <errorid id="JVMTI_ERROR_NATIVE_METHOD" num="104">
11917       The requested information is not available for native method.
11918     </errorid>
11919     <errorid id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED" num="106">
11920       The class loader does not support this operation.
11921     </errorid>
11922   </errorcategory>
11923 
11924   <errorcategory id="function-specific-errors" label="Function Specific Agent Errors">
11925     <intro>
11926       The following errors are returned by some <jvmti/> functions.
11927       They are returned in the event of invalid parameters passed by the
11928       agent or usage in an invalid context.
11929       An implementation is not required to detect these errors.
11930     </intro>
11931 
11932     <errorid id="JVMTI_ERROR_INVALID_THREAD" num="10">
11933       The passed thread is not a valid thread.
11934     </errorid>
11935     <errorid id="JVMTI_ERROR_INVALID_FIELDID" num="25">
11936       Invalid field.
11937     </errorid>
11938     <errorid id="JVMTI_ERROR_INVALID_MODULE" num="26">
11939       Invalid module.
11940     </errorid>
11941     <errorid id="JVMTI_ERROR_INVALID_METHODID" num="23">
11942       Invalid method.
11943     </errorid>
11944     <errorid id="JVMTI_ERROR_INVALID_LOCATION" num="24">
11945       Invalid location.
11946     </errorid>
11947     <errorid id="JVMTI_ERROR_INVALID_OBJECT" num="20">
11948       Invalid object.
11949     </errorid>
11950     <errorid id="JVMTI_ERROR_INVALID_CLASS" num="21">
11951       Invalid class.
11952     </errorid>
11953     <errorid id="JVMTI_ERROR_TYPE_MISMATCH" num="34">
11954       The variable is not an appropriate type for the function used.
11955     </errorid>
11956     <errorid id="JVMTI_ERROR_INVALID_SLOT" num="35">
11957       Invalid slot.
11958     </errorid>
11959     <errorid id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY" num="99">
11960       The capability being used is false in this environment.
11961     </errorid>
11962     <errorid id="JVMTI_ERROR_INVALID_THREAD_GROUP" num="11">
11963       Thread group invalid.
11964     </errorid>
11965     <errorid id="JVMTI_ERROR_INVALID_MONITOR" num="50">
11966       Invalid raw monitor.
11967     </errorid>
11968     <errorid id="JVMTI_ERROR_ILLEGAL_ARGUMENT" num="103">
11969       Illegal argument.
11970     </errorid>
11971     <errorid id="JVMTI_ERROR_INVALID_TYPESTATE" num="65">
11972       The state of the thread has been modified, and is now inconsistent.
11973     </errorid>
11974     <errorid id="JVMTI_ERROR_UNSUPPORTED_VERSION" num="68">
11975       A new class file has a version number not supported by this VM.
11976     </errorid>
11977     <errorid id="JVMTI_ERROR_INVALID_CLASS_FORMAT" num="60">
11978       A new class file is malformed (the VM would return a <code>ClassFormatError</code>).
11979     </errorid>
11980     <errorid id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION" num="61">
11981       The new class file definitions would lead to a circular
11982       definition (the VM would return a <code>ClassCircularityError</code>).
11983     </errorid>
11984     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED" num="63">
11985       A new class file would require adding a method.
11986     </errorid>
11987     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED" num="64">
11988       A new class version changes a field.
11989     </errorid>
11990     <errorid id="JVMTI_ERROR_FAILS_VERIFICATION" num="62">
11991       The class bytes fail verification.
11992     </errorid>
11993     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED" num="66">
11994       A direct superclass is different for the new class
11995       version, or the set of directly implemented
11996       interfaces is different.
11997     </errorid>
11998     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED" num="67">
11999       A new class version does not declare a method
12000       declared in the old class version.
12001     </errorid>
12002     <errorid id="JVMTI_ERROR_NAMES_DONT_MATCH" num="69">
12003       The class name defined in the new class file is
12004       different from the name in the old class object.
12005     </errorid>
12006     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED" num="70">
12007       A new class version has different modifiers.
12008     </errorid>
12009     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED" num="71">
12010       A method in the new class version has different modifiers
12011       than its counterpart in the old class version.
12012     </errorid>
12013   </errorcategory>
12014 </errorsection>
12015 
12016 <eventsection label="Events">
12017   <intro label="Handling Events" id="eventIntro">
12018     Agents can be informed of many events that occur in application
12019     programs.
12020     <p/>
12021     To handle events, designate a set of callback functions with
12022     <functionlink id="SetEventCallbacks"></functionlink>.
12023     For each event the corresponding callback function will be
12024     called.
12025     Arguments to the callback function provide additional
12026     information about the event.
12027     <p/>
12028     The callback function is usually called from within an application
12029     thread. The <jvmti/> implementation does not
12030     queue events in any way. This means
12031     that event callback functions must be written
12032     carefully. Here are some general guidelines. See
12033     the individual event descriptions for further
12034     suggestions.
12035     <p/>
12036     <ul>
12037       <li>Any exception thrown during the execution of an event callback can
12038         overwrite any current pending exception in the current application thread.
12039         Care must be taken to preserve a pending exception
12040         when an event callback makes a JNI call that might generate an exception.
12041       </li>
12042       <li>Event callback functions must be re-entrant. The <jvmti/> implementation does
12043         not queue events. If an agent needs to process events one at a time, it
12044         can use a raw monitor inside the
12045         event callback functions to serialize event processing.
12046       </li>
12047       <li>Event callback functions that execute JNI's FindClass function to load
12048         classes need to note that FindClass locates the class loader associated
12049         with the current native method. For the purposes of class loading, an
12050         event callback that includes a JNI environment as a parameter to the
12051         callback will treated as if it is a native call, where the native method
12052         is in the class of the event thread's current frame.
12053       </li>
12054     </ul>
12055     <p/>
12056     Some <jvmti/> events identify objects with JNI references.
12057     All references
12058     in <jvmti/> events are JNI local references and will become invalid
12059     after the event callback returns.
12060     Unless stated otherwise, memory referenced by pointers sent in event
12061     callbacks may not be referenced after the event callback returns.
12062     <p/>
12063     Except where stated otherwise, events are delivered on the thread
12064     that caused the event.
12065     Events are sent at the time they occur.
12066     The specification for each event includes the set of
12067     <functionlink id="GetPhase">phases</functionlink> in which it can be sent;
12068     if an event triggering activity occurs during another phase, no event
12069     is sent.
12070     <p/>
12071     A thread that generates an event does not change its execution status
12072     (for example, the event does not cause the thread to be suspended).
12073     If an agent wishes the event to result in suspension, then the agent
12074     is responsible for explicitly suspending the thread with
12075     <functionlink id="SuspendThread"></functionlink>.
12076     <p/>
12077     If an event is enabled in multiple environments, the event will be sent
12078     to each agent in the order that the environments were created.
12079   </intro>
12080 
12081   <intro label="Enabling Events" id="enablingevents">
12082     All events are initially disabled.  In order to receive any
12083     event:
12084       <ul>
12085         <li>
12086           If the event requires a capability, that capability must
12087           be added with
12088           <functionlink id="AddCapabilities"></functionlink>.
12089         </li>
12090         <li>
12091           A callback for the event must be set with
12092           <functionlink id="SetEventCallbacks"></functionlink>.
12093         </li>
12094         <li>
12095           The event must be enabled with
12096           <functionlink id="SetEventNotificationMode"></functionlink>.
12097         </li>
12098       </ul>
12099   </intro>
12100 
12101   <intro label="Multiple Co-located Events" id="eventorder">
12102     In many situations it is possible for multiple events to occur
12103     at the same location in one thread. When this happens, all the events
12104     are reported through the event callbacks in the order specified in this section.
12105     <p/>
12106     If the current location is at the entry point of a method, the
12107     <eventlink id="MethodEntry"></eventlink> event is reported before
12108     any other event at the current location in the same thread.
12109     <p/>
12110     If an exception catch has been detected at the current location,
12111     either because it is the beginning of a catch clause or a native method
12112     that cleared a pending exception has returned, the
12113     <code>exceptionCatch</code> event is reported before
12114     any other event at the current location in the same thread.
12115     <p/>
12116     If a <code>singleStep</code> event or
12117     <code>breakpoint</code> event is triggered at the
12118     current location, the event is defined to occur
12119     immediately before the code at the current location is executed.
12120     These events are reported before any events which are triggered
12121     by the execution of code at the current location in the same
12122     thread (specifically:
12123     <code>exception</code>,
12124     <code>fieldAccess</code>, and
12125     <code>fieldModification</code>).
12126     If both a step and breakpoint event are triggered for the same thread and
12127     location, the step event is reported before the breakpoint event.
12128     <p/>
12129     If the current location is the exit point of a method (that is, the last
12130     location before returning to the caller), the
12131     <eventlink id="MethodExit"></eventlink> event and
12132     the <eventlink id="FramePop"></eventlink> event (if requested)
12133     are reported after all other events at the current location in the same
12134     thread. There is no specified ordering of these two events
12135     with respect to each other.
12136     <p/>
12137     Co-located events can be triggered during the processing of some other
12138     event by the agent at the same location in the same thread.
12139     If such an event, of type <i>y</i>, is triggered during the processing of
12140     an event of type <i>x</i>, and if <i>x</i>
12141     precedes <i>y</i> in the ordering specified above, the co-located event
12142     <i>y</i> is reported for the current thread and location. If <i>x</i> does not precede
12143     <i>y</i>, <i>y</i> is not reported for the current thread and location.
12144     For example, if a breakpoint is set at the current location
12145     during the processing of <eventlink id="SingleStep"></eventlink>,
12146     that breakpoint will be reported before the thread moves off the current
12147     location.
12148     <p/>The following events are never considered to be co-located with
12149     other events.
12150     <ul>
12151       <li><eventlink id="VMStart"></eventlink></li>
12152       <li><eventlink id="VMInit"></eventlink></li>
12153       <li><eventlink id="VMDeath"></eventlink></li>
12154       <li><eventlink id="ThreadStart"></eventlink></li>
12155       <li><eventlink id="ThreadEnd"></eventlink></li>
12156       <li><eventlink id="ClassLoad"></eventlink></li>
12157       <li><eventlink id="ClassPrepare"></eventlink></li>
12158     </ul>
12159   </intro>
12160 
12161   <intro label="Event Callbacks" id="jvmtiEventCallbacks">
12162       The event callback structure below is used to specify the handler function
12163       for events.  It is set with the
12164       <functionlink id="SetEventCallbacks"></functionlink> function.
12165   </intro>
12166 
12167   <event label="Single Step"
12168          id="SingleStep" const="JVMTI_EVENT_SINGLE_STEP" filtered="thread" num="60">
12169     <description>
12170       Single step events allow the agent to trace thread execution
12171       at the finest granularity allowed by the VM. A single step event is
12172       generated whenever a thread reaches a new location.
12173       Typically, single step events represent the completion of one VM
12174       instruction as defined in <vmspec/>. However, some implementations
12175       may define locations differently. In any case the
12176       <code>method</code> and <code>location</code>
12177       parameters  uniquely identify the current location and allow
12178       the mapping to source file and line number when that information is
12179       available.
12180       <p/>
12181       No single step events are generated from within native methods.
12182     </description>
12183     <origin>jvmdi</origin>
12184     <capabilities>
12185       <required id="can_generate_single_step_events"></required>
12186     </capabilities>
12187     <parameters>
12188       <param id="jni_env">
12189         <outptr>
12190           <struct>JNIEnv</struct>
12191         </outptr>
12192           <description>
12193             The JNI environment of the event (current) thread
12194           </description>
12195       </param>
12196       <param id="thread">
12197         <jthread/>
12198           <description>
12199             Thread about to execution a new instruction
12200           </description>
12201       </param>
12202       <param id="klass">
12203         <jclass method="method"/>
12204           <description>
12205             Class of the method about to execute a new instruction
12206           </description>
12207       </param>
12208       <param id="method">
12209         <jmethodID class="klass"/>
12210           <description>
12211             Method about to execute a new instruction
12212           </description>
12213       </param>
12214       <param id="location">
12215         <jlocation/>
12216         <description>
12217           Location of the new instruction
12218         </description>
12219       </param>
12220     </parameters>
12221   </event>
12222 
12223   <event label="Breakpoint"
12224          id="Breakpoint" const="JVMTI_EVENT_BREAKPOINT" filtered="thread" num="62">
12225     <description>
12226       Breakpoint events are generated whenever a thread reaches a location
12227       designated as a breakpoint with <functionlink id="SetBreakpoint"></functionlink>.
12228       The <code>method</code> and <code>location</code>
12229       parameters uniquely identify the current location and allow
12230       the mapping to source file and line number when that information is
12231       available.
12232     </description>
12233     <origin>jvmdi</origin>
12234     <capabilities>
12235       <required id="can_generate_breakpoint_events"></required>
12236     </capabilities>
12237     <parameters>
12238       <param id="jni_env">
12239         <outptr>
12240           <struct>JNIEnv</struct>
12241         </outptr>
12242           <description>
12243             The JNI environment of the event (current) thread.
12244           </description>
12245       </param>
12246       <param id="thread">
12247         <jthread/>
12248           <description>
12249             Thread that hit the breakpoint
12250           </description>
12251       </param>
12252       <param id="klass">
12253         <jclass method="method"/>
12254           <description>
12255             Class of the method that hit the breakpoint
12256           </description>
12257       </param>
12258       <param id="method">
12259         <jmethodID class="klass"/>
12260           <description>
12261             Method that hit the breakpoint
12262           </description>
12263       </param>
12264       <param id="location">
12265         <jlocation/>
12266         <description>
12267           location of the breakpoint
12268         </description>
12269       </param>
12270     </parameters>
12271   </event>
12272 
12273   <event label="Field Access"
12274          id="FieldAccess" const="JVMTI_EVENT_FIELD_ACCESS" filtered="thread" num="63">
12275     <description>
12276       Field access events are generated whenever a thread accesses
12277       a field that was designated as a watchpoint
12278       with <functionlink id="SetFieldAccessWatch"></functionlink>.
12279       The <code>method</code> and <code>location</code>
12280       parameters uniquely identify the current location and allow
12281       the mapping to source file and line number when that information is
12282       available.
12283     </description>
12284     <origin>jvmdi</origin>
12285     <capabilities>
12286       <required id="can_generate_field_access_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 accessing the field
12301           </description>
12302       </param>
12303       <param id="klass">
12304         <jclass method="method"/>
12305           <description>
12306             Class of the method where the access is occurring
12307           </description>
12308       </param>
12309       <param id="method">
12310         <jmethodID class="klass"/>
12311           <description>
12312             Method where the access is occurring
12313           </description>
12314       </param>
12315       <param id="location">
12316         <jlocation/>
12317         <description>
12318           Location where the access is occurring
12319         </description>
12320       </param>
12321       <param id="field_klass">
12322         <jclass field="field"/>
12323           <description>
12324             Class of the field being accessed
12325           </description>
12326       </param>
12327       <param id="object">
12328         <jobject/>
12329           <description>
12330             Object with the field being accessed if the field is an
12331             instance field; <code>NULL</code> otherwise
12332           </description>
12333       </param>
12334       <param id="field">
12335         <jfieldID class="field_klass"/>
12336           <description>
12337             Field being accessed
12338           </description>
12339       </param>
12340     </parameters>
12341   </event>
12342 
12343   <event label="Field Modification"
12344          id="FieldModification" const="JVMTI_EVENT_FIELD_MODIFICATION" filtered="thread" num="64">
12345     <description>
12346       Field modification events are generated whenever a thread modifies
12347       a field that was designated as a watchpoint
12348       with <functionlink id="SetFieldModificationWatch"></functionlink>.
12349       The <code>method</code> and <code>location</code>
12350       parameters uniquely identify the current location and allow
12351       the mapping to source file and line number when that information is
12352       available.
12353     </description>
12354     <origin>jvmdi</origin>
12355     <capabilities>
12356       <required id="can_generate_field_modification_events"></required>
12357     </capabilities>
12358     <parameters>
12359       <param id="jni_env">
12360         <outptr>
12361           <struct>JNIEnv</struct>
12362         </outptr>
12363           <description>
12364             The JNI environment of the event (current) thread
12365           </description>
12366       </param>
12367       <param id="thread">
12368         <jthread/>
12369           <description>
12370             Thread modifying the field
12371           </description>
12372       </param>
12373       <param id="klass">
12374         <jclass method="method"/>
12375           <description>
12376             Class of the method where the modification is occurring
12377           </description>
12378       </param>
12379       <param id="method">
12380         <jmethodID class="klass"/>
12381           <description>
12382             Method where the modification is occurring
12383           </description>
12384       </param>
12385       <param id="location">
12386         <jlocation/>
12387         <description>
12388           Location where the modification is occurring
12389         </description>
12390       </param>
12391       <param id="field_klass">
12392         <jclass field="field"/>
12393           <description>
12394             Class of the field being modified
12395           </description>
12396       </param>
12397       <param id="object">
12398         <jobject/>
12399           <description>
12400             Object with the field being modified if the field is an
12401             instance field; <code>NULL</code> otherwise
12402           </description>
12403       </param>
12404       <param id="field">
12405         <jfieldID class="field_klass"/>
12406           <description>
12407             Field being modified
12408           </description>
12409       </param>
12410       <param id="signature_type">
12411         <char/>
12412         <description>
12413           Signature type of the new value
12414         </description>
12415       </param>
12416       <param id="new_value">
12417         <jvalue/>
12418         <description>
12419           The new value
12420         </description>
12421       </param>
12422     </parameters>
12423   </event>
12424 
12425   <event label="Frame Pop"
12426          id="FramePop" const="JVMTI_EVENT_FRAME_POP" filtered="thread" num="61">
12427     <description>
12428       Frame pop events are generated upon exit from a single method
12429       in a single frame as specified
12430       in a call to <functionlink id="NotifyFramePop"></functionlink>.
12431       This is true whether termination is caused by
12432       executing its return instruction
12433       or by throwing an exception to its caller
12434       (see <paramlink id="was_popped_by_exception"></paramlink>).
12435       However, frame pops caused by the <functionlink id="PopFrame"/>
12436       function are not reported.
12437       <p/>
12438       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12439       identifies the executable location in the returning method,
12440       immediately prior to the return.
12441     </description>
12442     <origin>jvmdi</origin>
12443     <capabilities>
12444       <required id="can_generate_frame_pop_events"></required>
12445     </capabilities>
12446     <parameters>
12447       <param id="jni_env">
12448         <outptr>
12449           <struct>JNIEnv</struct>
12450         </outptr>
12451           <description>
12452             The JNI environment of the event (current) thread
12453           </description>
12454       </param>
12455       <param id="thread">
12456         <jthread/>
12457           <description>
12458             Thread that is popping the frame
12459           </description>
12460       </param>
12461       <param id="klass">
12462         <jclass method="method"/>
12463           <description>
12464             Class of the method being popped
12465           </description>
12466       </param>
12467       <param id="method">
12468         <jmethodID class="klass"/>
12469           <description>
12470             Method being popped
12471           </description>
12472       </param>
12473       <param id="was_popped_by_exception">
12474         <jboolean/>
12475         <description>
12476           True if frame was popped by a thrown exception.
12477           False if method exited through its return instruction.
12478         </description>
12479       </param>
12480     </parameters>
12481   </event>
12482 
12483   <event label="Method Entry"
12484          id="MethodEntry" const="JVMTI_EVENT_METHOD_ENTRY" filtered="thread" num="65">
12485     <description>
12486       Method entry events are generated upon entry of Java
12487       programming language methods (including native methods).
12488       <p/>
12489       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12490       identifies the initial executable location in
12491       the method.
12492       <p/>
12493       Enabling method
12494       entry or exit events will significantly degrade performance on many platforms and is thus
12495       not advised for performance critical usage (such as profiling).
12496       <internallink id="bci">Bytecode instrumentation</internallink> should be
12497       used in these cases.
12498     </description>
12499     <origin>jvmdi</origin>
12500     <capabilities>
12501       <required id="can_generate_method_entry_events"></required>
12502     </capabilities>
12503     <parameters>
12504       <param id="jni_env">
12505         <outptr>
12506           <struct>JNIEnv</struct>
12507         </outptr>
12508           <description>
12509             The JNI environment of the event (current) thread
12510           </description>
12511       </param>
12512       <param id="thread">
12513         <jthread/>
12514           <description>
12515             Thread entering the method
12516           </description>
12517       </param>
12518       <param id="klass">
12519         <jclass method="method"/>
12520           <description>
12521             Class of the method being entered
12522           </description>
12523       </param>
12524       <param id="method">
12525         <jmethodID class="klass"/>
12526           <description>
12527             Method being entered
12528           </description>
12529       </param>
12530     </parameters>
12531   </event>
12532 
12533   <event label="Method Exit"
12534          id="MethodExit" const="JVMTI_EVENT_METHOD_EXIT" filtered="thread" num="66">
12535     <description>
12536       Method exit events are generated upon exit from Java
12537       programming language methods (including native methods).
12538       This is true whether termination is caused by
12539       executing its return instruction
12540       or by throwing an exception to its caller
12541       (see <paramlink id="was_popped_by_exception"></paramlink>).
12542       <p/>
12543       The <code>method</code> field uniquely identifies the
12544       method being entered or exited. The <code>frame</code> field provides
12545       access to the stack frame for the method.
12546       <p/>
12547       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12548       identifies the executable location in the returning method
12549       immediately prior to the return.
12550       <p/>
12551         Enabling method
12552         entry or exit events will significantly degrade performance on many platforms and is thus
12553         not advised for performance critical usage (such as profiling).
12554         <internallink id="bci">Bytecode instrumentation</internallink> should be
12555         used in these cases.
12556     </description>
12557     <origin>jvmdi</origin>
12558     <capabilities>
12559       <required id="can_generate_method_exit_events"></required>
12560     </capabilities>
12561     <parameters>
12562       <param id="jni_env">
12563         <outptr>
12564           <struct>JNIEnv</struct>
12565         </outptr>
12566           <description>
12567             The JNI environment of the event (current) thread
12568           </description>
12569       </param>
12570       <param id="thread">
12571         <jthread/>
12572           <description>
12573             Thread exiting the method
12574           </description>
12575       </param>
12576       <param id="klass">
12577         <jclass method="method"/>
12578           <description>
12579             Class of the method being exited
12580           </description>
12581       </param>
12582       <param id="method">
12583         <jmethodID class="klass"/>
12584           <description>
12585             Method being exited
12586           </description>
12587       </param>
12588       <param id="was_popped_by_exception">
12589         <jboolean/>
12590         <description>
12591           True if frame was popped by a thrown exception.
12592           False if method exited through its return instruction.
12593         </description>
12594       </param>
12595       <param id="return_value">
12596         <jvalue/>
12597         <description>
12598           The return value of the method being exited.
12599           Undefined and should not be used if
12600           <paramlink id="was_popped_by_exception"></paramlink>
12601           is true.
12602         </description>
12603       </param>
12604     </parameters>
12605   </event>
12606 
12607   <event label="Native Method Bind" phase="any"
12608          id="NativeMethodBind" const="JVMTI_EVENT_NATIVE_METHOD_BIND" num="67">
12609     <description>
12610       A Native Method Bind event is sent when a VM binds a
12611       Java programming language native method
12612       to the address of a function that implements the native method.
12613       This will occur when the native method is called for the first time
12614       and also occurs when the JNI function <code>RegisterNatives</code> is called.
12615       This event allows the bind to be redirected to an agent-specified
12616       proxy function.
12617       This event is not sent when the native method is unbound.
12618       Typically, this proxy function will need to be specific to a
12619       particular method or, to handle the general case, automatically
12620       generated assembly code, since after instrumentation code is
12621       executed the function at the original binding
12622       address will usually be invoked.
12623       The original binding can be restored or the redirection changed
12624       by use of the JNI function <code>RegisterNatives</code>.
12625       Some events may be sent during the primordial phase, JNI and
12626       most of <jvmti/> cannot be used at this time but the method and
12627       address can be saved for use later.
12628     </description>
12629     <origin>new</origin>
12630     <capabilities>
12631       <required id="can_generate_native_method_bind_events"></required>
12632     </capabilities>
12633     <parameters>
12634       <param id="jni_env">
12635         <outptr>
12636           <struct>JNIEnv</struct>
12637         </outptr>
12638           <description>
12639             The JNI environment of the event (current) thread
12640             Will be <code>NULL</code> if sent during the primordial
12641             <functionlink id="GetPhase">phase</functionlink>.
12642           </description>
12643       </param>
12644       <param id="thread">
12645         <jthread/>
12646           <description>
12647             Thread requesting the bind
12648           </description>
12649       </param>
12650       <param id="klass">
12651         <jclass method="method"/>
12652           <description>
12653             Class of the method being bound
12654           </description>
12655       </param>
12656       <param id="method">
12657         <jmethodID class="klass"/>
12658           <description>
12659             Native method being bound
12660           </description>
12661       </param>
12662       <param id="address">
12663         <outptr><void/></outptr>
12664         <description>
12665           The address the VM is about to bind to--that is, the
12666           address of the implementation of the native method
12667         </description>
12668       </param>
12669       <param id="new_address_ptr">
12670         <agentbuf><void/></agentbuf>
12671         <description>
12672           if the referenced address is changed (that is, if
12673           <code>*new_address_ptr</code> is set), the binding
12674           will instead be made to the supplied address.
12675         </description>
12676       </param>
12677     </parameters>
12678   </event>
12679 
12680   <event label="Exception"
12681          id="Exception" const="JVMTI_EVENT_EXCEPTION" filtered="thread" num="58">
12682     <description>
12683       Exception events are generated whenever an exception is first detected
12684       in a Java programming language method.
12685       Where "exception" means any <code>java.lang.Throwable</code>.
12686       The exception may have been thrown by a Java programming language or native
12687       method, but in the case of native methods, the event is not generated
12688       until the exception is first seen by a Java programming language method. If an exception is
12689       set and cleared in a native method (and thus is never visible to Java programming language code),
12690       no exception event is generated.
12691       <p/>
12692       The <code>method</code> and <code>location</code>
12693       parameters  uniquely identify the current location
12694       (where the exception was detected) and allow
12695       the mapping to source file and line number when that information is
12696       available. The <code>exception</code> field identifies the thrown
12697       exception object. The <code>catch_method</code>
12698       and <code>catch_location</code> identify the location of the catch clause,
12699       if any, that handles the thrown exception. If there is no such catch clause,
12700       each field is set to 0. There is no guarantee that the thread will ever
12701       reach this catch clause. If there are native methods on the call stack
12702       between the throw location and the catch clause, the exception may
12703       be reset by one of those native methods.
12704       Similarly, exceptions that are reported as uncaught (<code>catch_klass</code>
12705       et al. set to 0) may in fact be caught by native code.
12706       Agents can check for these occurrences by monitoring
12707       <eventlink id="ExceptionCatch"></eventlink> events.
12708       Note that finally clauses are implemented as catch and re-throw. Therefore they
12709       will be reported in the catch location.
12710     </description>
12711     <origin>jvmdi</origin>
12712     <capabilities>
12713       <required id="can_generate_exception_events"></required>
12714     </capabilities>
12715     <parameters>
12716       <param id="jni_env">
12717         <outptr>
12718           <struct>JNIEnv</struct>
12719         </outptr>
12720           <description>
12721             The JNI environment of the event (current) thread
12722           </description>
12723       </param>
12724       <param id="thread">
12725         <jthread/>
12726           <description>
12727             Thread generating the exception
12728           </description>
12729       </param>
12730       <param id="klass">
12731         <jclass method="method"/>
12732           <description>
12733             Class generating the exception
12734           </description>
12735       </param>
12736       <param id="method">
12737         <jmethodID class="klass"/>
12738           <description>
12739             Method generating the exception
12740           </description>
12741       </param>
12742       <param id="location">
12743         <jlocation/>
12744         <description>
12745           Location where exception occurred
12746         </description>
12747       </param>
12748       <param id="exception">
12749         <jobject/>
12750           <description>
12751             The exception being thrown
12752           </description>
12753       </param>
12754       <param id="catch_klass">
12755         <jclass method="catch_method"/>
12756           <description>
12757             Class that will catch the exception, or <code>NULL</code> if no known catch
12758           </description>
12759       </param>
12760       <param id="catch_method">
12761         <jmethodID class="catch_klass"/>
12762           <description>
12763             Method that will catch the exception, or <code>NULL</code> if no known catch
12764           </description>
12765       </param>
12766       <param id="catch_location">
12767         <jlocation/>
12768         <description>
12769           location which will catch the exception or zero if no known catch
12770         </description>
12771       </param>
12772     </parameters>
12773   </event>
12774 
12775   <event label="Exception Catch"
12776          id="ExceptionCatch" const="JVMTI_EVENT_EXCEPTION_CATCH" filtered="thread" num="59">
12777     <description>
12778       Exception catch events are generated whenever a thrown exception is caught.
12779       Where "exception" means any <code>java.lang.Throwable</code>.
12780       If the exception is caught in a Java programming language method, the event is generated
12781       when the catch clause is reached. If the exception is caught in a native
12782       method, the event is generated as soon as control is returned to a Java programming language
12783       method. Exception catch events are generated for any exception for which
12784       a throw was detected in a Java programming language method.
12785       Note that finally clauses are implemented as catch and re-throw. Therefore they
12786       will generate exception catch events.
12787       <p/>
12788       The <code>method</code> and <code>location</code>
12789       parameters uniquely identify the current location
12790       and allow the mapping to source file and line number when that information is
12791       available. For exceptions caught in a Java programming language method, the
12792       <code>exception</code> object identifies the exception object. Exceptions
12793       caught in native methods are not necessarily available by the time the
12794       exception catch is reported, so the <code>exception</code> field is set
12795       to <code>NULL</code>.
12796     </description>
12797     <origin>jvmdi</origin>
12798     <capabilities>
12799       <required id="can_generate_exception_events"></required>
12800     </capabilities>
12801     <parameters>
12802       <param id="jni_env">
12803         <outptr>
12804           <struct>JNIEnv</struct>
12805         </outptr>
12806           <description>
12807             The JNI environment of the event (current) thread
12808           </description>
12809       </param>
12810       <param id="thread">
12811         <jthread/>
12812           <description>
12813             Thread catching the exception
12814           </description>
12815       </param>
12816       <param id="klass">
12817         <jclass method="method"/>
12818           <description>
12819             Class catching the exception
12820           </description>
12821       </param>
12822       <param id="method">
12823         <jmethodID class="klass"/>
12824           <description>
12825             Method catching the exception
12826           </description>
12827       </param>
12828       <param id="location">
12829         <jlocation/>
12830         <description>
12831           Location where exception is being caught
12832         </description>
12833       </param>
12834       <param id="exception">
12835         <jobject/>
12836           <description>
12837             Exception being caught
12838           </description>
12839       </param>
12840     </parameters>
12841   </event>
12842 
12843   <event label="Thread Start"
12844          id="ThreadStart" const="JVMTI_EVENT_THREAD_START" num="52" phase="start">
12845     <description>
12846       Thread start events are generated by a new thread before its initial
12847       method executes.
12848       <p/>
12849       A thread may be listed in the array returned by
12850       <functionlink id="GetAllThreads"></functionlink>
12851       before its thread start event is generated.
12852       It is possible for other events to be generated
12853       on a thread before its thread start event.
12854       <p/>
12855       The event is sent on the newly started <paramlink id="thread"></paramlink>.
12856     </description>
12857     <origin>jvmdi</origin>
12858     <capabilities>
12859     </capabilities>
12860     <parameters>
12861       <param id="jni_env">
12862         <outptr>
12863           <struct>JNIEnv</struct>
12864         </outptr>
12865           <description>
12866             The JNI environment of the event (current) thread.
12867           </description>
12868       </param>
12869       <param id="thread">
12870         <jthread/>
12871           <description>
12872             Thread starting
12873           </description>
12874       </param>
12875     </parameters>
12876   </event>
12877 
12878   <event label="Thread End"
12879          id="ThreadEnd" const="JVMTI_EVENT_THREAD_END" filtered="thread" num="53" phase="start">
12880     <description>
12881       Thread end events are generated by a terminating thread
12882       after its initial method has finished execution.
12883       <p/>
12884       A thread may be listed in the array returned by
12885       <functionlink id="GetAllThreads"></functionlink>
12886       after its thread end event is generated.
12887       No events are generated on a thread
12888       after its thread end event.
12889       <p/>
12890       The event is sent on the dying <paramlink id="thread"></paramlink>.
12891     </description>
12892     <origin>jvmdi</origin>
12893     <capabilities>
12894     </capabilities>
12895     <parameters>
12896       <param id="jni_env">
12897         <outptr>
12898           <struct>JNIEnv</struct>
12899         </outptr>
12900           <description>
12901             The JNI environment of the event (current) thread.
12902           </description>
12903       </param>
12904       <param id="thread">
12905         <jthread/>
12906           <description>
12907             Thread ending
12908           </description>
12909       </param>
12910     </parameters>
12911   </event>
12912 
12913   <event label="Class Load"
12914          id="ClassLoad" const="JVMTI_EVENT_CLASS_LOAD" filtered="thread" phase="start" num="55">
12915     <description>
12916       A class load event is generated when a class is first loaded. The order
12917       of class load events generated by a particular thread are guaranteed
12918       to match the order of class loading within that thread.
12919       Array class creation does not generate a class load event.
12920       The creation of a primitive class (for example, java.lang.Integer.TYPE)
12921       does not generate a class load event.
12922       <p/>
12923       This event is sent at an early stage in loading the class. As
12924       a result the class should be used carefully.  Note, for example,
12925       that methods and fields are not yet loaded, so queries for methods,
12926       fields, subclasses, and so on will not give correct results.
12927       See "Loading of Classes and Interfaces" in the <i>Java Language
12928       Specification</i>.  For most
12929       purposes the <eventlink id="ClassPrepare"></eventlink> event will
12930       be more useful.
12931     </description>
12932     <origin>jvmdi</origin>
12933     <capabilities>
12934     </capabilities>
12935     <parameters>
12936       <param id="jni_env">
12937         <outptr>
12938           <struct>JNIEnv</struct>
12939         </outptr>
12940           <description>
12941             The JNI environment of the event (current) thread
12942           </description>
12943       </param>
12944       <param id="thread">
12945         <jthread/>
12946           <description>
12947             Thread loading the class
12948           </description>
12949       </param>
12950       <param id="klass">
12951         <jclass/>
12952           <description>
12953             Class being loaded
12954           </description>
12955       </param>
12956     </parameters>
12957   </event>
12958 
12959   <elide>
12960   <event label="Class Unload"
12961          id="ClassUnload" const="JVMTI_EVENT_CLASS_UNLOAD" num="57">
12962     <description>
12963       A class unload event is generated when the class is about to be unloaded.
12964       Class unload events take place during garbage collection and must be
12965       handled extremely carefully. The garbage collector holds many locks
12966       and has suspended all other threads, so the event handler cannot depend
12967       on the ability to acquire any locks. The class unload event handler should
12968       do as little as possible, perhaps by queuing information to be processed
12969       later.  In particular, the <code>jclass</code> should be used only in
12970       the JNI function <code>isSameObject</code> or in the following <jvmti/> functions:
12971       <ul>
12972         <li><functionlink id="GetClassSignature"></functionlink></li>
12973         <li><functionlink id="GetSourceFileName"></functionlink></li>
12974         <li><functionlink id="IsInterface"></functionlink></li>
12975         <li><functionlink id="IsArrayClass"></functionlink></li>
12976       </ul>
12977     </description>
12978     <origin>jvmdi</origin>
12979     <capabilities>
12980     </capabilities>
12981     <parameters>
12982       <param id="jni_env">
12983         <outptr>
12984           <struct>JNIEnv</struct>
12985         </outptr>
12986           <description>
12987             The JNI environment of the event (current) thread
12988           </description>
12989       </param>
12990       <param id="thread">
12991         <jthread/>
12992           <description>
12993             Thread generating the class unload
12994           </description>
12995       </param>
12996       <param id="klass">
12997         <jclass/>
12998           <description>
12999             Class being unloaded
13000           </description>
13001       </param>
13002     </parameters>
13003   </event>
13004   </elide>
13005 
13006   <event label="Class Prepare"
13007          id="ClassPrepare" const="JVMTI_EVENT_CLASS_PREPARE" filtered="thread" phase="start" num="56">
13008     <description>
13009       A class prepare event is generated when class preparation is complete.
13010       At this point, class fields, methods, and implemented interfaces are
13011       available, and no code from the class has been executed. Since array
13012       classes never have fields or methods, class prepare events are not
13013       generated for them. Class prepare events are not generated for
13014       primitive classes (for example, <code>java.lang.Integer.TYPE</code>).
13015     </description>
13016     <origin>jvmdi</origin>
13017     <capabilities>
13018     </capabilities>
13019     <parameters>
13020       <param id="jni_env">
13021         <outptr>
13022           <struct>JNIEnv</struct>
13023         </outptr>
13024           <description>
13025             The JNI environment of the event (current) thread
13026           </description>
13027       </param>
13028       <param id="thread">
13029         <jthread/>
13030           <description>
13031             Thread generating the class prepare
13032           </description>
13033       </param>
13034       <param id="klass">
13035         <jclass/>
13036           <description>
13037             Class being prepared
13038           </description>
13039       </param>
13040     </parameters>
13041   </event>
13042 
13043   <event label="Class File Load Hook" phase="any"
13044          id="ClassFileLoadHook" const="JVMTI_EVENT_CLASS_FILE_LOAD_HOOK" num="54">
13045     <description>
13046       This event is sent when the VM obtains class file data,
13047       but before it constructs
13048       the in-memory representation for that class.
13049       This event is also sent when the class is being modified by the
13050       <functionlink id="RetransformClasses"/> function or
13051       the <functionlink id="RedefineClasses"/> function,
13052       called in any <jvmti/> environment.
13053       The agent can instrument
13054       the existing class file data sent by the VM to include profiling/debugging hooks.
13055       See the description of
13056       <internallink id="bci">bytecode instrumentation</internallink>
13057       for usage information.
13058       <p/>
13059     When the capabilities
13060     <internallink id="jvmtiCapabilities.can_generate_early_class_hook_events">
13061     <code>can_generate_early_class_hook_events</code></internallink> and
13062     <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
13063     <code>can_generate_all_class_hook_events</code></internallink>
13064     are enabled then this event may be sent in the primordial phase.
13065     Otherwise, this event may be sent before the VM is initialized (the start
13066     <functionlink id="GetPhase">phase</functionlink>).
13067     Some classes might not be compatible
13068     with the function (eg. ROMized classes or implementation defined classes) and this event will
13069     not be generated for these classes.
13070     <p/>
13071     The agent must allocate the space for the modified
13072     class file data buffer
13073     using the memory allocation function
13074     <functionlink id="Allocate"></functionlink> because the
13075     VM is responsible for freeing the new class file data buffer
13076     using <functionlink id="Deallocate"></functionlink>.
13077     <p/>
13078     If the agent wishes to modify the class file, it must set
13079     <code>new_class_data</code> to point
13080     to the newly instrumented class file data buffer and set
13081     <code>new_class_data_len</code> to the length of that
13082     buffer before returning
13083     from this call.  If no modification is desired, the agent simply
13084     does not set <code>new_class_data</code>.  If multiple agents
13085     have enabled this event the results are chained. That is, if
13086     <code>new_class_data</code> has been set, it becomes the
13087     <code>class_data</code> for the next agent.
13088     <p/>
13089     When handling a class load in the live phase, then the
13090     <functionlink id="GetNamedModule"></functionlink>
13091     function can be used to map class loader and a package name to a module.
13092     When a class is being redefined or retransformed then
13093     <code>class_being_redefined</code> is non <code>NULL</code> and so
13094     the JNI <code>GetModule</code> function can also be used
13095     to obtain the Module.
13096     <p/>
13097     The order that this event is sent to each environment differs
13098     from other events.
13099     This event is sent to environments in the following order:
13100     <ul>
13101       <li><fieldlink id="can_retransform_classes"
13102                      struct="jvmtiCapabilities">retransformation
13103                                                 incapable</fieldlink>
13104           environments, in the
13105           order in which they were created
13106       </li>
13107       <li><fieldlink id="can_retransform_classes"
13108                      struct="jvmtiCapabilities">retransformation
13109                                                 capable</fieldlink>
13110           environments, in the
13111           order in which they were created
13112       </li>
13113     </ul>
13114     When triggered by <functionlink id="RetransformClasses"/>,
13115     this event is sent only to <fieldlink id="can_retransform_classes"
13116                      struct="jvmtiCapabilities">retransformation
13117                                                 capable</fieldlink>
13118     environments.
13119   </description>
13120   <origin>jvmpi</origin>
13121     <capabilities>
13122       <capability id="can_generate_all_class_hook_events"></capability>
13123       <capability id="can_generate_early_class_hook_events"></capability>
13124     </capabilities>
13125     <parameters>
13126       <param id="jni_env">
13127         <outptr>
13128           <struct>JNIEnv</struct>
13129         </outptr>
13130           <description>
13131             The JNI environment of the event (current) thread.
13132           </description>
13133       </param>
13134       <param id="class_being_redefined">
13135         <jclass/>
13136         <description>
13137           The class being
13138           <functionlink id="RedefineClasses">redefined</functionlink> or
13139           <functionlink id="RetransformClasses">retransformed</functionlink>.
13140           <code>NULL</code> if sent by class load.
13141         </description>
13142       </param>
13143       <param id="loader">
13144         <jobject/>
13145           <description>
13146             The class loader loading the class.
13147             <code>NULL</code> if the bootstrap class loader.
13148           </description>
13149       </param>
13150       <param id="name">
13151         <vmbuf><char/></vmbuf>
13152         <description>
13153             Name of class being loaded as a VM internal qualified name
13154             (for example, "java/util/List"), encoded as a
13155             <internallink id="mUTF">modified UTF-8</internallink> string.
13156             Note: if the class is defined with a <code>NULL</code> name or
13157             without a name specified, <code>name</code> will be <code>NULL</code>.
13158         </description>
13159       </param>
13160       <param id="protection_domain">
13161         <jobject/>
13162         <description>
13163           The <code>ProtectionDomain</code> of the class.
13164         </description>
13165       </param>
13166       <param id="class_data_len">
13167         <jint/>
13168         <description>
13169           Length of current class file data buffer.
13170         </description>
13171       </param>
13172       <param id="class_data">
13173         <vmbuf><uchar/></vmbuf>
13174         <description>
13175           Pointer to the current class file data buffer.
13176         </description>
13177       </param>
13178       <param id="new_class_data_len">
13179         <outptr><jint/></outptr>
13180         <description>
13181           Pointer to the length of the new class file data buffer.
13182         </description>
13183       </param>
13184       <param id="new_class_data">
13185         <agentbuf incount="new_class_data_len"><uchar/></agentbuf>
13186         <description>
13187           Pointer to the pointer to the instrumented class file data buffer.
13188         </description>
13189       </param>
13190     </parameters>
13191   </event>
13192 
13193   <event label="VM Start Event"
13194          id="VMStart" const="JVMTI_EVENT_VM_START" num="57" phase="start">
13195     <description>
13196       The VM start event signals the start of the VM.
13197       At this time JNI is live but the VM is not yet fully initialized.
13198       Once this event is generated, the agent is free to call any JNI function.
13199       This event signals the beginning of the start phase,
13200       <jvmti/> functions permitted in the start phase may be called.
13201       <p/>
13202       The timing of this event may depend on whether the agent has added the
13203       <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
13204       <code>can_generate_early_vmstart</code></internallink> capability or not.
13205       If the capability has been added then the VM posts the event as early
13206       as possible. The VM is capable of executing bytecode but it may not have
13207       initialized to the point where it can load classes in modules other than
13208       <code>java.base</code>, or even arbitrary classes in <code>java.base</code>.
13209       Agents that do load-time instrumentation in this
13210       phase must take great care when instrumenting code that potentially
13211       executes in this phase. Extreme care should also be taken with JNI
13212       <code>FindClass</code> as it may not be possible to load classes and attempts
13213       to do so may result in unpredictable behavior, maybe even stability issues
13214       on some VM implementations.
13215       If the capability has not been added then the VM delays posting this
13216       event until it is capable of loading classes in modules other than
13217       <code>java.base</code> or the VM has completed its initialization.
13218       Agents that create more than one JVM TI environment, where the
13219       capability is added to some but not all environments, may observe the
13220       start phase beginning earlier in the JVM TI environments that possess
13221       the capabilty.
13222       <p/>
13223       In the case of VM start-up failure, this event will not be sent.
13224     </description>
13225     <origin>jvmdi</origin>
13226     <capabilities>
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     </parameters>
13238   </event>
13239 
13240   <event label="VM Initialization Event"
13241          id="VMInit" const="JVMTI_EVENT_VM_INIT" num="50">
13242     <description>
13243       The VM initialization event signals the completion of VM initialization. Once
13244       this event is generated, the agent is free to call any JNI or <jvmti/>
13245       function. The VM initialization event can be preceded by or can be concurrent
13246       with other events, but
13247       the preceding events should be handled carefully, if at all, because the
13248       VM has not completed its initialization. The thread start event for the
13249       main application thread is guaranteed not to occur until after the
13250       handler for the VM initialization event returns.
13251       <p/>
13252       In the case of VM start-up failure, this event will not be sent.
13253     </description>
13254     <origin>jvmdi</origin>
13255     <capabilities>
13256     </capabilities>
13257     <parameters>
13258       <param id="jni_env">
13259         <outptr>
13260           <struct>JNIEnv</struct>
13261         </outptr>
13262           <description>
13263             The JNI environment of the event (current) thread.
13264           </description>
13265       </param>
13266       <param id="thread">
13267         <jthread/>
13268           <description>
13269             The initial thread
13270           </description>
13271       </param>
13272     </parameters>
13273   </event>
13274 
13275   <event label="VM Death Event"
13276          id="VMDeath" const="JVMTI_EVENT_VM_DEATH" num="51">
13277     <description>
13278       The VM death event notifies the agent of the termination of the VM.
13279       No events will occur after the VMDeath event.
13280       <p/>
13281       In the case of VM start-up failure, this event will not be sent.
13282       Note that <internallink id="onunload">Agent_OnUnload</internallink>
13283       will still be called in these cases.
13284     </description>
13285     <origin>jvmdi</origin>
13286     <capabilities>
13287     </capabilities>
13288     <parameters>
13289       <param id="jni_env">
13290         <outptr>
13291           <struct>JNIEnv</struct>
13292         </outptr>
13293           <description>
13294             The JNI environment of the event (current) thread
13295           </description>
13296       </param>
13297     </parameters>
13298   </event>
13299 
13300   <event label="Compiled Method Load" phase="start"
13301          id="CompiledMethodLoad" const="JVMTI_EVENT_COMPILED_METHOD_LOAD" num="68">
13302     <description>
13303       Sent when a method is compiled and loaded into memory by the VM.
13304       If it is unloaded, the <eventlink id="CompiledMethodUnload"/> event is sent.
13305       If it is moved, the <eventlink id="CompiledMethodUnload"/> event is sent,
13306       followed by a new <code>CompiledMethodLoad</code> event.
13307       Note that a single method may have multiple compiled forms, and that
13308       this event will be sent for each form.
13309       Note also that several methods may be inlined into a single
13310       address range, and that this event will be sent for each method.
13311       <p/>
13312       These events can be sent after their initial occurrence with
13313       <functionlink id="GenerateEvents"></functionlink>.
13314     </description>
13315     <origin>jvmpi</origin>
13316     <typedef id="jvmtiAddrLocationMap" label="Native address to location entry">
13317       <field id="start_address">
13318         <vmbuf><void/></vmbuf>
13319         <description>
13320           Starting native address of code corresponding to a location
13321         </description>
13322       </field>
13323       <field id="location">
13324         <jlocation/>
13325         <description>
13326           Corresponding location. See
13327           <functionlink id="GetJLocationFormat"></functionlink>
13328           for the meaning of location.
13329         </description>
13330       </field>
13331     </typedef>
13332     <capabilities>
13333       <required id="can_generate_compiled_method_load_events"></required>
13334     </capabilities>
13335     <parameters>
13336       <param id="klass">
13337         <jclass method="method"/>
13338           <description>
13339             Class of the method being compiled and loaded
13340           </description>
13341       </param>
13342       <param id="method">
13343         <jmethodID class="klass"/>
13344           <description>
13345             Method being compiled and loaded
13346           </description>
13347       </param>
13348       <param id="code_size">
13349         <jint/>
13350         <description>
13351           Size of compiled code
13352         </description>
13353       </param>
13354       <param id="code_addr">
13355         <vmbuf><void/></vmbuf>
13356         <description>
13357           Address where compiled method code is loaded
13358         </description>
13359       </param>
13360       <param id="map_length">
13361         <jint/>
13362         <description>
13363           Number of <typelink id="jvmtiAddrLocationMap"></typelink>
13364           entries in the address map.
13365           Zero if mapping information cannot be supplied.
13366         </description>
13367       </param>
13368       <param id="map">
13369         <vmbuf><struct>jvmtiAddrLocationMap</struct></vmbuf>
13370         <description>
13371           Map from native addresses to location.
13372           The native address range of each entry is from
13373           <fieldlink id="start_address" struct="jvmtiAddrLocationMap"></fieldlink>
13374           to <code>start_address-1</code> of the next entry.
13375           <code>NULL</code> if mapping information cannot be supplied.
13376         </description>
13377       </param>
13378       <param id="compile_info">
13379         <vmbuf><void/></vmbuf>
13380         <description>
13381           VM-specific compilation information.
13382           The referenced compile information is managed by the VM
13383           and must not depend on the agent for collection.
13384           A VM implementation defines the content and lifetime
13385           of the information.
13386         </description>
13387       </param>
13388     </parameters>
13389   </event>
13390 
13391   <event label="Compiled Method Unload" phase="start"
13392          id="CompiledMethodUnload" const="JVMTI_EVENT_COMPILED_METHOD_UNLOAD" num="69">
13393     <description>
13394       Sent when a compiled method is unloaded from memory.
13395       This event might not be sent on the thread which performed the unload.
13396       This event may be sent sometime after the unload occurs, but
13397       will be sent before the memory is reused
13398       by a newly generated compiled method. This event may be sent after
13399       the class is unloaded.
13400     </description>
13401     <origin>jvmpi</origin>
13402     <capabilities>
13403       <required id="can_generate_compiled_method_load_events"></required>
13404     </capabilities>
13405     <parameters>
13406       <param id="klass">
13407         <jclass method="method"/>
13408           <description>
13409             Class of the compiled method being unloaded.
13410           </description>
13411       </param>
13412       <param id="method">
13413         <jmethodID class="klass"/>
13414           <description>
13415             Compiled method being unloaded.
13416             For identification of the compiled method only -- the class
13417             may be unloaded and therefore the method should not be used
13418             as an argument to further JNI or <jvmti/> functions.
13419           </description>
13420       </param>
13421       <param id="code_addr">
13422         <vmbuf><void/></vmbuf>
13423         <description>
13424           Address where compiled method code was loaded.
13425           For identification of the compiled method only --
13426           the space may have been reclaimed.
13427         </description>
13428       </param>
13429     </parameters>
13430   </event>
13431 
13432   <event label="Dynamic Code Generated" phase="any"
13433          id="DynamicCodeGenerated" const="JVMTI_EVENT_DYNAMIC_CODE_GENERATED" num="70">
13434     <description>
13435       Sent when a component of the virtual machine is generated dynamically.
13436       This does not correspond to Java programming language code that is
13437       compiled--see <eventlink id="CompiledMethodLoad"></eventlink>.
13438       This is for native code--for example, an interpreter that is generated
13439       differently depending on command-line options.
13440       <p/>
13441       Note that this event has no controlling capability.
13442       If a VM cannot generate these events, it simply does not send any.
13443       <p/>
13444       These events can be sent after their initial occurrence with
13445       <functionlink id="GenerateEvents"></functionlink>.
13446     </description>
13447     <origin>jvmpi</origin>
13448     <capabilities>
13449     </capabilities>
13450     <parameters>
13451       <param id="name">
13452         <vmbuf><char/></vmbuf>
13453         <description>
13454           Name of the code, encoded as a
13455           <internallink id="mUTF">modified UTF-8</internallink> string.
13456           Intended for display to an end-user.
13457           The name might not be unique.
13458         </description>
13459       </param>
13460       <param id="address">
13461         <vmbuf><void/></vmbuf>
13462         <description>
13463           Native address of the code
13464         </description>
13465       </param>
13466       <param id="length">
13467         <jint/>
13468         <description>
13469           Length in bytes of the code
13470         </description>
13471       </param>
13472     </parameters>
13473   </event>
13474 
13475   <event label="Data Dump Request"
13476          id="DataDumpRequest" const="JVMTI_EVENT_DATA_DUMP_REQUEST" num="71">
13477     <description>
13478       Sent by the VM to request the agent to dump its data.  This
13479       is just a hint and the agent need not react to this event.
13480       This is useful for processing command-line signals from users.  For
13481       example, in the Java 2 SDK a CTRL-Break on Win32 and a CTRL-\ on Solaris
13482       causes the VM to send this event to the agent.
13483     </description>
13484     <origin>jvmpi</origin>
13485     <capabilities>
13486     </capabilities>
13487     <parameters>
13488     </parameters>
13489   </event>
13490 
13491   <event label="Monitor Contended Enter"
13492          id="MonitorContendedEnter" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTER" filtered="thread" num="75">
13493     <description>
13494       Sent when a thread is attempting to enter a Java programming language
13495       monitor already acquired by another thread.
13496     </description>
13497     <origin>jvmpi</origin>
13498     <capabilities>
13499       <required id="can_generate_monitor_events"></required>
13500     </capabilities>
13501     <parameters>
13502       <param id="jni_env">
13503         <outptr>
13504           <struct>JNIEnv</struct>
13505         </outptr>
13506           <description>
13507             The JNI environment of the event (current) thread
13508           </description>
13509       </param>
13510       <param id="thread">
13511         <jthread/>
13512           <description>
13513             JNI local reference to the thread
13514             attempting to enter the monitor
13515           </description>
13516       </param>
13517       <param id="object">
13518         <jobject/>
13519           <description>
13520             JNI local reference to the monitor
13521           </description>
13522       </param>
13523     </parameters>
13524   </event>
13525 
13526   <event label="Monitor Contended Entered"
13527          id="MonitorContendedEntered" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTERED" filtered="thread" num="76">
13528     <description>
13529       Sent when a thread enters a Java programming language
13530       monitor after waiting for it to be released by another thread.
13531     </description>
13532     <origin>jvmpi</origin>
13533     <capabilities>
13534       <required id="can_generate_monitor_events"></required>
13535     </capabilities>
13536     <parameters>
13537       <param id="jni_env">
13538         <outptr>
13539           <struct>JNIEnv</struct>
13540         </outptr>
13541           <description>
13542             The JNI environment of the event (current) thread
13543           </description>
13544       </param>
13545       <param id="thread">
13546         <jthread/>
13547           <description>
13548             JNI local reference to the thread entering
13549             the monitor
13550           </description>
13551       </param>
13552       <param id="object">
13553         <jobject/>
13554           <description>
13555             JNI local reference to the monitor
13556           </description>
13557       </param>
13558     </parameters>
13559   </event>
13560 
13561   <event label="Monitor Wait"
13562          id="MonitorWait" const="JVMTI_EVENT_MONITOR_WAIT" filtered="thread" num="73">
13563     <description>
13564       Sent when a thread is about to wait on an object.
13565     </description>
13566     <origin>jvmpi</origin>
13567     <capabilities>
13568       <required id="can_generate_monitor_events"></required>
13569     </capabilities>
13570     <parameters>
13571       <param id="jni_env">
13572         <outptr>
13573           <struct>JNIEnv</struct>
13574         </outptr>
13575           <description>
13576             The JNI environment of the event (current) thread
13577           </description>
13578       </param>
13579       <param id="thread">
13580         <jthread/>
13581           <description>
13582             JNI local reference to the thread about to wait
13583           </description>
13584       </param>
13585       <param id="object">
13586         <jobject/>
13587           <description>
13588             JNI local reference to the monitor
13589           </description>
13590       </param>
13591       <param id="timeout">
13592         <jlong/>
13593         <description>
13594           The number of milliseconds the thread will wait
13595         </description>
13596       </param>
13597     </parameters>
13598   </event>
13599 
13600   <event label="Monitor Waited"
13601          id="MonitorWaited" const="JVMTI_EVENT_MONITOR_WAITED" filtered="thread" num="74">
13602     <description>
13603       Sent when a thread finishes waiting on an object.
13604     </description>
13605     <origin>jvmpi</origin>
13606     <capabilities>
13607       <required id="can_generate_monitor_events"></required>
13608     </capabilities>
13609     <parameters>
13610       <param id="jni_env">
13611         <outptr>
13612           <struct>JNIEnv</struct>
13613         </outptr>
13614           <description>
13615             The JNI environment of the event (current) thread
13616           </description>
13617       </param>
13618       <param id="thread">
13619         <jthread/>
13620           <description>
13621             JNI local reference to the thread that was finished waiting
13622           </description>
13623       </param>
13624       <param id="object">
13625         <jobject/>
13626           <description>
13627             JNI local reference to the monitor.
13628           </description>
13629       </param>
13630       <param id="timed_out">
13631         <jboolean/>
13632         <description>
13633           True if the monitor timed out
13634         </description>
13635       </param>
13636     </parameters>
13637   </event>
13638 
13639   <event label="Resource Exhausted"
13640          id="ResourceExhausted" const="JVMTI_EVENT_RESOURCE_EXHAUSTED" num="80"
13641          since="1.1">
13642     <description>
13643       Sent when a VM resource needed by a running application has been exhausted.
13644       Except as required by the optional capabilities, the set of resources
13645       which report exhaustion is implementation dependent.
13646       <p/>
13647       The following bit flags define the properties of the resource exhaustion:
13648       <constants id="jvmtiResourceExhaustionFlags"
13649                  label="Resource Exhaustion Flags"
13650                  kind="bits"
13651                  since="1.1">
13652         <constant id="JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR" num="0x0001">
13653           After this event returns, the VM will throw a
13654           <code>java.lang.OutOfMemoryError</code>.
13655         </constant>
13656         <constant id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP" num="0x0002">
13657           The VM was unable to allocate memory from the <tm>Java</tm>
13658           platform <i>heap</i>.
13659           The <i>heap</i> is the runtime
13660           data area from which memory for all class instances and
13661           arrays are allocated.
13662         </constant>
13663         <constant id="JVMTI_RESOURCE_EXHAUSTED_THREADS" num="0x0004">
13664           The VM was unable to create a thread.
13665         </constant>
13666       </constants>
13667     </description>
13668     <origin>new</origin>
13669     <capabilities>
13670       <capability id="can_generate_resource_exhaustion_heap_events">
13671         Can generate events when the VM is unable to allocate memory from the
13672         <internallink id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP">heap</internallink>.
13673       </capability>
13674       <capability id="can_generate_resource_exhaustion_threads_events">
13675         Can generate events when the VM is unable to
13676         <internallink id="JVMTI_RESOURCE_EXHAUSTED_THREADS">create
13677         a thread</internallink>.
13678       </capability>
13679     </capabilities>
13680     <parameters>
13681       <param id="jni_env">
13682         <outptr>
13683           <struct>JNIEnv</struct>
13684         </outptr>
13685           <description>
13686             The JNI environment of the event (current) thread
13687           </description>
13688       </param>
13689       <param id="flags">
13690         <jint/>
13691         <description>
13692           Flags defining the properties of the of resource exhaustion
13693           as specified by the
13694           <internallink id="jvmtiResourceExhaustionFlags">Resource
13695           Exhaustion Flags</internallink>.
13696           </description>
13697         </param>
13698       <param id="reserved">
13699         <vmbuf><void/></vmbuf>
13700         <description>
13701           Reserved.
13702         </description>
13703       </param>
13704       <param id="description">
13705         <vmbuf><char/></vmbuf>
13706         <description>
13707           Description of the resource exhaustion, encoded as a
13708           <internallink id="mUTF">modified UTF-8</internallink> string.
13709         </description>
13710       </param>
13711     </parameters>
13712   </event>
13713 
13714   <event label="VM Object Allocation"
13715          id="VMObjectAlloc" const="JVMTI_EVENT_VM_OBJECT_ALLOC" num="84">
13716     <description>
13717       Sent when a method causes the virtual machine to allocate an
13718       Object visible to Java programming language code and the
13719       allocation is not detectable by other intrumentation mechanisms.
13720       Generally object allocation should be detected by instrumenting
13721       the bytecodes of allocating methods.
13722       Object allocation generated in native code by JNI function
13723       calls should be detected using
13724       <internallink id="jniIntercept">JNI function interception</internallink>.
13725       Some methods might not have associated bytecodes and are not
13726       native methods, they instead are executed directly by the
13727       VM. These methods should send this event.
13728       Virtual machines which are incapable of bytecode instrumentation
13729       for some or all of their methods can send this event.
13730       <p/>
13731       Typical examples where this event might be sent:
13732       <ul>
13733         <li>Reflection -- for example, <code>java.lang.Class.newInstance()</code></li>
13734         <li>Methods not represented by bytecodes -- for example, VM intrinsics and
13735             J2ME preloaded classes</li>
13736       </ul>
13737       Cases where this event would not be generated:
13738       <ul>
13739         <li>Allocation due to bytecodes -- for example, the <code>new</code>
13740             and <code>newarray</code> VM instructions</li>
13741         <li>Allocation due to JNI function calls -- for example,
13742             <code>AllocObject</code></li>
13743         <li>Allocations during VM initialization</li>
13744         <li>VM internal objects</li>
13745       </ul>
13746     </description>
13747     <origin>new</origin>
13748     <capabilities>
13749       <required id="can_generate_vm_object_alloc_events"></required>
13750     </capabilities>
13751     <parameters>
13752       <param id="jni_env">
13753         <outptr>
13754           <struct>JNIEnv</struct>
13755         </outptr>
13756           <description>
13757             The JNI environment of the event (current) thread
13758           </description>
13759       </param>
13760       <param id="thread">
13761         <jthread/>
13762           <description>
13763             Thread allocating the object.
13764           </description>
13765       </param>
13766       <param id="object">
13767         <jobject/>
13768           <description>
13769             JNI local reference to the object that was allocated
13770           </description>
13771       </param>
13772       <param id="object_klass">
13773         <jclass/>
13774           <description>
13775             JNI local reference to the class of the object
13776           </description>
13777       </param>
13778       <param id="size">
13779         <jlong/>
13780         <description>
13781             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
13782         </description>
13783       </param>
13784     </parameters>
13785   </event>
13786 
13787   <event label="Object Free"
13788          id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83">
13789     <description>
13790       An Object Free event is sent when the garbage collector frees an object.
13791       Events are only sent for tagged objects--see
13792       <internallink id="Heap">heap functions</internallink>.
13793       <p/>
13794       The event handler must not use JNI functions and
13795       must not use <jvmti/> functions except those which
13796       specifically allow such use (see the raw monitor, memory management,
13797       and environment local storage functions).
13798     </description>
13799     <origin>new</origin>
13800     <capabilities>
13801       <required id="can_generate_object_free_events"></required>
13802     </capabilities>
13803     <parameters>
13804       <param id="tag">
13805         <jlong/>
13806         <description>
13807           The freed object's tag
13808         </description>
13809       </param>
13810     </parameters>
13811   </event>
13812 
13813   <event label="Garbage Collection Start"
13814          id="GarbageCollectionStart" const="JVMTI_EVENT_GARBAGE_COLLECTION_START" num="81">
13815     <description>
13816       A Garbage Collection Start event is sent when a
13817       garbage collection pause begins.
13818       Only stop-the-world collections are reported--that is, collections during
13819       which all threads cease to modify the state of the Java virtual machine.
13820       This means that some collectors will never generate these events.
13821       This event is sent while the VM is still stopped, thus
13822       the event handler must not use JNI functions and
13823       must not use <jvmti/> functions except those which
13824       specifically allow such use (see the raw monitor, memory management,
13825       and environment local storage functions).
13826       <p/>
13827       This event is always sent as a matched pair with
13828       <eventlink id="GarbageCollectionFinish"/>
13829       (assuming both events are enabled) and no garbage collection
13830       events will occur between them.
13831     </description>
13832     <origin>new</origin>
13833     <capabilities>
13834       <required id="can_generate_garbage_collection_events"></required>
13835     </capabilities>
13836     <parameters>
13837     </parameters>
13838   </event>
13839 
13840   <event label="Garbage Collection Finish"
13841          id="GarbageCollectionFinish" const="JVMTI_EVENT_GARBAGE_COLLECTION_FINISH" num="82">
13842     <description>
13843       A Garbage Collection Finish event is sent when a
13844       garbage collection pause ends.
13845       This event is sent while the VM is still stopped, thus
13846       the event handler must not use JNI functions and
13847       must not use <jvmti/> functions except those which
13848       specifically allow such use (see the raw monitor, memory management,
13849       and environment local storage functions).
13850       <p/>
13851       Some agents may need to do post garbage collection operations that
13852       require the use of the disallowed <jvmti/> or JNI functions. For these
13853       cases an agent thread can be created which waits on a raw monitor,
13854       and the handler for the Garbage Collection Finish event simply
13855       notifies the raw monitor
13856       <p/>
13857       This event is always sent as a matched pair with
13858       <eventlink id="GarbageCollectionStart"/> (assuming both events are enabled).
13859       <issue>
13860         The most important use of this event is to provide timing information,
13861         and thus additional information is not required.  However,
13862         information about the collection which is "free" should be included -
13863         what that information is needs to be determined.
13864       </issue>
13865     </description>
13866     <origin>new</origin>
13867     <capabilities>
13868       <required id="can_generate_garbage_collection_events"></required>
13869     </capabilities>
13870     <parameters>
13871     </parameters>
13872   </event>
13873 
13874   <elide>
13875   <event label="Verbose Output" phase="any"
13876          id="VerboseOutput" const="JVMTI_EVENT_VERBOSE_OUTPUT" num="85">
13877     <description>
13878       Send verbose messages as strings.
13879         <issue>
13880           This format is extremely fragile, as it can change with each
13881           platform, collector and version.  Alternatives include:
13882           <ul>
13883             <li>building off Java programming language M and M APIs</li>
13884             <li>XML</li>
13885             <li>key/value pairs</li>
13886             <li>removing it</li>
13887           </ul>
13888         </issue>
13889         <issue>
13890           Though this seemed trivial to implement.
13891           In the RI it appears this will be quite complex.
13892         </issue>
13893     </description>
13894     <origin>new</origin>
13895     <capabilities>
13896     </capabilities>
13897     <parameters>
13898       <param id="flag">
13899         <enum>jvmtiVerboseFlag</enum>
13900         <description>
13901           Which verbose output is being sent.
13902         </description>
13903       </param>
13904       <param id="message">
13905         <vmbuf><char/></vmbuf>
13906         <description>
13907           Message text, encoded as a
13908           <internallink id="mUTF">modified UTF-8</internallink> string.
13909         </description>
13910       </param>
13911     </parameters>
13912   </event>
13913   </elide>
13914 
13915 </eventsection>
13916 
13917 <datasection>
13918   <intro>
13919     <jvmti/> extends the data types defined by JNI.
13920   </intro>
13921   <basetypes id="jniTypes" label="JNI Types Used in the JVM Tool Interface">
13922     <basetype id="jboolean">
13923       <description>
13924         Holds a Java programming language <code>boolean</code>.
13925         Unsigned 8 bits.
13926       </description>
13927     </basetype>
13928     <basetype id="jchar">
13929       <description>
13930         Holds a Java programming language <code>char</code>.
13931         Unsigned 16 bits.
13932       </description>
13933     </basetype>
13934     <basetype id="jint">
13935       <description>
13936         Holds a Java programming language <code>int</code>.
13937         Signed 32 bits.
13938       </description>
13939     </basetype>
13940     <basetype id="jlong">
13941       <description>
13942         Holds a Java programming language <code>long</code>.
13943         Signed 64 bits.
13944       </description>
13945     </basetype>
13946     <basetype id="jfloat">
13947       <description>
13948         Holds a Java programming language <code>float</code>.
13949         32 bits.
13950       </description>
13951     </basetype>
13952     <basetype id="jdouble">
13953       <description>
13954         Holds a Java programming language <code>double</code>.
13955         64 bits.
13956       </description>
13957     </basetype>
13958     <basetype id="jobject">
13959       <description>
13960         Holds a Java programming language object.
13961       </description>
13962     </basetype>
13963     <basetype id="jclass">
13964       <description>
13965         Holds a Java programming language class.
13966       </description>
13967     </basetype>
13968     <basetype id="jvalue">
13969       <description>
13970         Is a union of all primitive types and <code>jobject</code>.  Thus, holds any Java
13971         programming language value.
13972       </description>
13973     </basetype>
13974     <basetype id="jfieldID">
13975       <description>
13976         Identifies a Java programming language field.
13977         <code>jfieldID</code>s returned by <jvmti/> functions and events may be
13978         safely stored.
13979       </description>
13980     </basetype>
13981     <basetype id="jmethodID">
13982       <description>
13983         Identifies a Java programming language method, initializer, or constructor.
13984         <code>jmethodID</code>s returned by <jvmti/> functions and events may be
13985         safely stored.  However, if the class is unloaded, they become invalid
13986         and must not be used.
13987       </description>
13988     </basetype>
13989     <basetype id="JNIEnv">
13990       <description>
13991         Pointer to the JNI function table.  Pointer to this (<code>JNIEnv *</code>)
13992         is a JNI environment.
13993       </description>
13994     </basetype>
13995   </basetypes>
13996 
13997   <basetypes id="jvmtiTypes" label="JVM Tool Interface Base Types">
13998     <basetype id="jvmtiEnv">
13999       <description>
14000         The <jvmti/> <internallink id="environments">environment</internallink> pointer.
14001         See the <internallink id="FunctionSection">Function Section</internallink>.
14002         <code>jvmtiEnv</code> points to the
14003         <internallink id="FunctionTable">function table</internallink> pointer.
14004       </description>
14005     </basetype>
14006     <basetype id="jthread">
14007       <definition>typedef jobject jthread;</definition>
14008       <description>
14009         Subtype of <datalink id="jobject"></datalink> that holds a thread.
14010       </description>
14011     </basetype>
14012     <basetype id="jthreadGroup">
14013       <definition>typedef jobject jthreadGroup;</definition>
14014       <description>
14015         Subtype of <datalink id="jobject"></datalink> that holds a thread group.
14016       </description>
14017     </basetype>
14018     <basetype id="jlocation">
14019       <definition>typedef jlong jlocation;</definition>
14020       <description>
14021         A 64 bit value, representing a monotonically increasing
14022         executable position within a method.
14023         <code>-1</code> indicates a native method.
14024         See <functionlink id="GetJLocationFormat"></functionlink> for the format on a
14025         given VM.
14026       </description>
14027     </basetype>
14028     <basetype id="jrawMonitorID">
14029       <definition>struct _jrawMonitorID;
14030 typedef struct _jrawMonitorID *jrawMonitorID;</definition>
14031       <description>
14032         A raw monitor.
14033       </description>
14034     </basetype>
14035     <basetype id="jvmtiError">
14036       <description>
14037         Holds an error return code.
14038         See the <internallink id="ErrorSection">Error section</internallink> for possible values.
14039         <example>
14040 typedef enum {
14041     JVMTI_ERROR_NONE = 0,
14042     JVMTI_ERROR_INVALID_THREAD = 10,
14043       ...
14044 } jvmtiError;
14045 </example>
14046       </description>
14047     </basetype>
14048     <basetype id="jvmtiEvent">
14049       <description>
14050         An identifier for an event type.
14051         See the <internallink id="EventSection">Event section</internallink> for possible values.
14052         It is guaranteed that future versions of this specification will
14053         never assign zero as an event type identifier.
14054 <example>
14055 typedef enum {
14056     JVMTI_EVENT_SINGLE_STEP = 1,
14057     JVMTI_EVENT_BREAKPOINT = 2,
14058       ...
14059 } jvmtiEvent;
14060 </example>
14061       </description>
14062     </basetype>
14063     <basetype id="jvmtiEventCallbacks" name="eventCallbacks">
14064       <description>
14065         The callbacks used for events.
14066 <example>
14067 typedef struct {
14068     jvmtiEventVMInit VMInit;
14069     jvmtiEventVMDeath VMDeath;
14070       ...
14071 } jvmtiEventCallbacks;
14072 </example>
14073         See <internallink id="jvmtiEventCallbacks">event callbacks</internallink>
14074         for the complete structure.
14075         <p/>
14076         Where, for example, the VM initialization callback is defined:
14077 <example>
14078 typedef void (JNICALL *jvmtiEventVMInit)
14079     (jvmtiEnv *jvmti_env,
14080      JNIEnv* jni_env,
14081      jthread thread);
14082 </example>
14083         See the individual events for the callback function definition.
14084       </description>
14085     </basetype>
14086     <basetype id="jniNativeInterface">
14087       <definition>typedef struct JNINativeInterface_ jniNativeInterface;</definition>
14088       <description>
14089         Typedef for the JNI function table <code>JNINativeInterface</code>
14090         defined in the
14091         <externallink id="jni/functions.html#interface-function-table">
14092           JNI Specification</externallink>.
14093         The JNI reference implementation defines this with an underscore.
14094       </description>
14095     </basetype>
14096   </basetypes>
14097 
14098 </datasection>
14099 
14100 <issuessection label="Issues">
14101   <intro id="suspendRequired" label="Resolved Issue: Suspend - Required or Automatic">
14102     JVMDI requires that the agent suspend threads before calling
14103     certain sensitive functions.  JVMPI requires garbage collection to be
14104     disabled before calling certain sensitive functions.
14105     It was suggested that rather than have this requirement, that
14106     VM place itself in a suitable state before performing an
14107     operation.  This makes considerable sense since each VM
14108     knows its requirements and can most easily arrange a
14109     safe state.
14110     <p/>
14111     The ability to externally suspend/resume threads will, of
14112     course, remain.  The ability to enable/disable garbage collection will not.
14113     <p/>
14114     This issue is resolved--suspend will not
14115     be required.  The spec has been updated to reflect this.
14116   </intro>
14117 
14118   <intro id="stackSampling" label="Resolved Issue: Call Stack Sampling">
14119     There are a variety of approaches to sampling call stacks.
14120     The biggest bifurcation is between VM controlled and agent
14121     controlled.
14122     <p/>
14123     This issue is resolved--agent controlled
14124     sampling will be the approach.
14125   </intro>
14126 
14127   <intro id="threadRepresentation" label="Resolved Issue: Thread Representation">
14128     JVMDI represents threads as jthread.  JVMPI primarily
14129     uses JNIEnv* to represent threads.
14130     <p/>
14131     The Expert Group has chosen jthread as the representation
14132     for threads in <jvmti/>.
14133     JNIEnv* is sent by
14134     events since it is needed to JNI functions.  JNIEnv, per the
14135     JNI spec, are not supposed to be used outside their thread.
14136   </intro>
14137 
14138   <intro id="design" label="Resolved Issue: Method Representation">
14139     The JNI spec allows an implementation to depend on jclass/jmethodID
14140     pairs, rather than simply a jmethodID, to reference a method.
14141     JVMDI, for consistency, choose the same representation.
14142     JVMPI, however, specifies that a jmethodID alone maps to a
14143     method.  Both of the Sun <tm>J2SE</tm> virtual machines (Classic and <tm>HotSpot</tm>) store
14144     pointers in jmethodIDs, and as a result, a jmethodID is sufficient.
14145     In fact, any JVM implementation that supports JVMPI must have
14146     such a representation.
14147     <jvmti/> will use jmethodID as a unique representation of a method
14148     (no jclass is used).
14149     There should be efficiency gains, particularly in
14150     functionality like stack dumping, to this representation.
14151     <p/>
14152     Note that fields were not used in JVMPI and that the access profile
14153     of fields differs from methods--for implementation efficiency
14154     reasons, a jclass/jfieldID pair will still be needed for field
14155     reference.
14156   </intro>
14157 
14158   <intro id="localReferenceIssue" label="Resolved Issue: Local References">
14159     Functions return local references.
14160   </intro>
14161 
14162   <intro id="frameRep" label="Resolved Issue: Representation of frames">
14163     In JVMDI, a frame ID is used to represent a frame.  Problem with this
14164     is that a VM must track when a frame becomes invalid, a far better
14165     approach, and the one used in <jvmti/>, is to reference frames by depth.
14166   </intro>
14167 
14168   <intro id="requiredCapabilities" label="Issue: Required Capabilities">
14169     Currently, having a required capabilities means that the functionality
14170     is optional.   Capabilities are useful even for required functionality
14171     since they can inform the VM is needed set-up.  Thus, there should be
14172     a set of capabilities that a conformant implementation must provide
14173     (if requested during Agent_OnLoad).
14174   </intro>
14175 
14176   <intro id="taghint" label="Proposal: add tag hint function">
14177     A hint of the percentage of objects that will be tagged would
14178     help the VM pick a good implementation.
14179   </intro>
14180 
14181   <intro id="moreMonitorQueries" label="Request: More Monitor Quires">
14182   How difficult or easy would be to extend the monitor_info category to include
14183     <pre>
14184   - current number of monitors
14185   - enumeration of monitors
14186   - enumeration of threads waiting on a given monitor
14187     </pre>
14188   The reason for my question is the fact that current get_monitor_info support
14189   requires the agent to specify a given thread to get the info which is probably
14190   OK in the profiling/debugging space, while in the monitoring space the agent
14191   could be watching the monitor list and then decide which thread to ask for
14192   the info. You might ask why is this important for monitoring .... I think it
14193   can aid in the detection/prediction of application contention caused by hot-locks.
14194   </intro>
14195 </issuessection>
14196 
14197 <changehistory id="ChangeHistory" update="09/05/07">
14198   <intro>
14199     The <jvmti/> specification is an evolving document with major, minor,
14200     and micro version numbers.
14201     A released version of the specification is uniquely identified
14202     by its major and minor version.
14203     The functions, events, and capabilities in this specification
14204     indicate a "Since" value which is the major and minor version in
14205     which it was introduced.
14206     The version of the specification implemented by the VM can
14207     be retrieved at runtime with the <functionlink id="GetVersionNumber"/>
14208     function.
14209   </intro>
14210   <change date="14 Nov 2002">
14211     Converted to XML document.
14212   </change>
14213   <change date="14 Nov 2002">
14214     Elided heap dump functions (for now) since what was there
14215     was wrong.
14216   </change>
14217   <change date="18 Nov 2002">
14218     Added detail throughout.
14219   </change>
14220   <change date="18 Nov 2002">
14221     Changed JVMTI_THREAD_STATUS_RUNNING to JVMTI_THREAD_STATUS_RUNNABLE.
14222   </change>
14223   <change date="19 Nov 2002">
14224     Added AsyncGetStackTrace.
14225   </change>
14226   <change date="19 Nov 2002">
14227     Added jframeID return to GetStackTrace.
14228   </change>
14229   <change date="19 Nov 2002">
14230     Elided GetCurrentFrame and GetCallingFrame functions (for now) since what was there
14231     since they are redundant with GetStackTrace.
14232   </change>
14233   <change date="19 Nov 2002">
14234     Elided ClearAllBreakpoints since it has always been redundant.
14235   </change>
14236   <change date="19 Nov 2002">
14237     Added GetSystemProperties.
14238   </change>
14239   <change date="19 Nov 2002">
14240     Changed the thread local storage functions to use jthread.
14241   </change>
14242   <change date="20 Nov 2002">
14243     Added GetJLocationFormat.
14244   </change>
14245   <change date="22 Nov 2002">
14246     Added events and introductory text.
14247   </change>
14248   <change date="22 Nov 2002">
14249     Cross reference type and constant definitions.
14250   </change>
14251   <change date="24 Nov 2002">
14252     Added DTD.
14253   </change>
14254   <change date="24 Nov 2002">
14255     Added capabilities function section.
14256   </change>
14257   <change date="29 Nov 2002">
14258     Assign capabilities to each function and event.
14259   </change>
14260   <change date="29 Nov 2002">
14261     Add <internallink id="jniIntercept">JNI interception functions</internallink>.
14262   </change>
14263   <change date="30 Nov 2002">
14264     Auto generate SetEventNotificationMode capabilities.
14265   </change>
14266   <change date="30 Nov 2002">
14267     Add <eventlink id="VMObjectAlloc"></eventlink> event.
14268   </change>
14269   <change date="30 Nov 2002">
14270     Add <eventlink id="DynamicCodeGenerated"></eventlink> event.
14271   </change>
14272   <change date="30 Nov 2002">
14273     Add const to declarations.
14274   </change>
14275   <change date="30 Nov 2002">
14276     Change method exit and frame pop to send on exception.
14277   </change>
14278   <change date="1 Dec 2002">
14279     Add ForceGarbageCollection.
14280   </change>
14281   <change date="2 Dec 2002">
14282     Redo Xrun section; clarify GetStackTrace and add example;
14283     Fix width problems; use "agent" consistently.
14284   </change>
14285   <change date="8 Dec 2002">
14286     Remove previous start-up intro.
14287     Add <internallink id="environments"><jvmti/> Environments</internallink>
14288     section.
14289   </change>
14290   <change date="8 Dec 2002">
14291     Add <functionlink id="DisposeEnvironment"></functionlink>.
14292   </change>
14293   <change date="9 Dec 2002">
14294     Numerous minor updates.
14295   </change>
14296   <change date="15 Dec 2002">
14297     Add heap profiling functions added:
14298     get/set annotation, iterate live objects/heap.
14299     Add heap profiling functions place holder added:
14300     heap roots.
14301     Heap profiling event added: object free.
14302     Heap profiling event redesigned: vm object allocation.
14303     Heap profiling event placeholders added: garbage collection start/finish.
14304     Native method bind event added.
14305   </change>
14306   <change date="19 Dec 2002">
14307     Revamp suspend/resume functions.
14308     Add origin information with jvmdi tag.
14309     Misc fixes.
14310   </change>
14311   <change date="24 Dec 2002">
14312     Add semantics to types.
14313   </change>
14314   <change date="27 Dec 2002">
14315     Add local reference section.
14316     Autogenerate parameter descriptions from types.
14317   </change>
14318   <change date="28 Dec 2002">
14319     Document that RunAgentThread sends threadStart.
14320   </change>
14321   <change date="29 Dec 2002">
14322     Remove redundant local ref and dealloc warning.
14323     Convert GetRawMonitorName to allocated buffer.
14324     Add GenerateEvents.
14325   </change>
14326   <change date="30 Dec 2002">
14327     Make raw monitors a type and rename to "jrawMonitorID".
14328   </change>
14329   <change date="1 Jan 2003">
14330     Include origin information.
14331     Clean-up JVMDI issue references.
14332     Remove Deallocate warnings which are now automatically generated.
14333   </change>
14334   <change date="2 Jan 2003">
14335     Fix representation issues for jthread.
14336   </change>
14337   <change date="3 Jan 2003">
14338     Make capabilities buffered out to 64 bits - and do it automatically.
14339   </change>
14340   <change date="4 Jan 2003">
14341     Make constants which are enumeration into enum types.
14342     Parameters now of enum type.
14343     Clean-up and index type section.
14344     Replace remaining datadef entities with callback.
14345   </change>
14346   <change date="7 Jan 2003">
14347     Correct GenerateEvents description.
14348     More internal semantics work.
14349   </change>
14350   <change date="9 Jan 2003">
14351     Replace previous GetSystemProperties with two functions
14352     which use allocated information instead fixed.
14353     Add SetSystemProperty.
14354     More internal semantics work.
14355   </change>
14356   <change date="12 Jan 2003">
14357     Add varargs to end of SetEventNotificationMode.
14358   </change>
14359   <change date="20 Jan 2003">
14360     Finish fixing spec to reflect that alloc sizes are jlong.
14361   </change>
14362   <change date="22 Jan 2003">
14363     Allow NULL as RunAgentThread arg.
14364   </change>
14365   <change date="22 Jan 2003">
14366     Fixed names to standardized naming convention
14367     Removed AsyncGetStackTrace.
14368   </change>
14369   <change date="29 Jan 2003">
14370     Since we are using jthread, removed GetThread.
14371   </change>
14372   <change date="31 Jan 2003">
14373     Change GetFieldName to allow NULLs like GetMethodName.
14374   </change>
14375   <change date="29 Feb 2003" version="v40">
14376       Rewrite the introductory text, adding sections on
14377       start-up, environments and bytecode instrumentation.
14378       Change the command line arguments per EG discussions.
14379       Add an introduction to the capabilities section.
14380       Add the extension mechanism category and functions.
14381       Mark for deletion, but clarified anyhow, SuspendAllThreads.
14382       Rename IterateOverLiveObjects to IterateOverReachableObjects and
14383       change the text accordingly.
14384       Clarify IterateOverHeap.
14385       Clarify CompiledMethodLoad.
14386       Discuss prerequisite state for Calling Functions.
14387       Clarify SetAllocationHooks.
14388       Added issues ("To be resolved:") through-out.
14389       And so on...
14390   </change>
14391   <change date="6 Mar 2003" version="v41">
14392       Remove struct from the call to GetOwnedMonitorInfo.
14393       Automatically generate most error documentation, remove
14394       (rather broken) hand written error doc.
14395       Better describe capability use (empty initial set).
14396       Add min value to jint params.
14397       Remove the capability can_access_thread_local_storage.
14398       Rename error JVMTI_ERROR_NOT_IMPLEMENTED to JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
14399       same for *NOT_IMPLEMENTED.
14400       Description fixes.
14401   </change>
14402   <change date="8 Mar 2003" version="v42">
14403       Rename GetClassSignature to GetClassName.
14404       Rename IterateOverClassObjects to IterateOverInstancesOfClass.
14405       Remove GetMaxStack (operand stack isn't used in <jvmti/>).
14406       Description fixes: define launch-time, remove native frame pop
14407       from PopFrame, and assorted clarifications.
14408   </change>
14409   <change date="8 Mar 2003" version="v43">
14410       Fix minor editing problem.
14411   </change>
14412   <change date="10 Mar 2003" version="v44">
14413       Add phase information.
14414       Remap (compact) event numbers.
14415   </change>
14416   <change date="11 Mar 2003" version="v45">
14417       More phase information - allow "any".
14418       Elide raw monitor queries and events.
14419       Minor description fixes.
14420   </change>
14421   <change date="12 Mar 2003" version="v46">
14422       Add GetPhase.
14423       Use "phase" through document.
14424       Elide GetRawMonitorName.
14425       Elide GetObjectMonitors.
14426   </change>
14427   <change date="12 Mar 2003" version="v47">
14428       Fixes from link, XML, and spell checking.
14429       Auto-generate the callback structure.
14430   </change>
14431   <change date="13 Mar 2003" version="v48">
14432       One character XML fix.
14433   </change>
14434   <change date="13 Mar 2003" version="v49">
14435       Change function parameter names to be consistent with
14436       event parameters (fooBarBaz becomes foo_bar_baz).
14437   </change>
14438   <change date="14 Mar 2003" version="v50">
14439       Fix broken link.  Fix thread markers.
14440   </change>
14441   <change date="14 Mar 2003" version="v51">
14442       Change constants so they are under 128 to workaround
14443       compiler problems.
14444   </change>
14445   <change date="23 Mar 2003" version="v52">
14446       Overhaul capabilities.  Separate GetStackTrace into
14447       GetStackTrace and GetStackFrames.
14448   </change>
14449   <change date="8 Apr 2003" version="v54">
14450       Use depth instead of jframeID to reference frames.
14451       Remove the now irrelevant GetCurrentFrame, GetCallerFrame and GetStackFrames.
14452       Remove frame arg from events.
14453   </change>
14454   <change date="9 Apr 2003" version="v55">
14455       Remove GetObjectWithAnnotation since tests show bufferred approach more efficient.
14456       Add missing annotation_count to GetObjectsWithAnnotations
14457   </change>
14458   <change date="10 Apr 2003" version="v56">
14459       Remove confusing parenthetical statement in GetObjectsWithAnnotations
14460   </change>
14461   <change date="13 Apr 2003" version="v58">
14462       Replace jclass/jmethodID representation of method with simply jmethodID;
14463       Pass JvmtiEnv* as first arg of every event; remove JNIEnv* where inappropriate.
14464       Replace can_access_frames with can_access_local_variables; remove from purely stack access.
14465       Use can_get_synthetic_attribute; fix description.
14466       Clarify that zero length arrays must be deallocated.
14467       Clarify RelinquishCapabilities.
14468       Generalize JVMTI_ERROR_VM_DEAD to JVMTI_ERROR_WRONG_PHASE.
14469   </change>
14470   <change date="27 Apr 2003" version="v59">
14471       Remove lingering indirect references to OBSOLETE_METHOD_ID.
14472   </change>
14473   <change date="4 May 2003" version="v60">
14474       Allow DestroyRawMonitor during OnLoad.
14475   </change>
14476   <change date="7 May 2003" version="v61">
14477       Added not monitor owner error return to DestroyRawMonitor.
14478   </change>
14479   <change date="13 May 2003" version="v62">
14480       Clarify semantics of raw monitors.
14481       Change flags on <code>GetThreadStatus</code>.
14482       <code>GetClassLoader</code> return NULL for the bootstrap class loader.
14483       Add <code>GetClassName</code> issue.
14484       Define local variable signature.
14485       Disallow zero in annotations array of <code>GetObjectsWithAnnotations</code>.
14486       Remove over specification in <code>GetObjectsWithAnnotations</code>.
14487       Elide <code>SetAllocationHooks</code>.
14488       Elide <code>SuspendAllThreads</code>.
14489   </change>
14490   <change date="14 May 2003" version="v63">
14491       Define the data type <code>jvmtiEventCallbacks</code>.
14492       Zero length allocations return NULL.
14493       Keep SetAllocationHooks in JVMDI, but remove from <jvmti/>.
14494       Add JVMTI_THREAD_STATUS_FLAG_INTERRUPTED.
14495   </change>
14496   <change date="15 May 2003" version="v64">
14497       Better wording, per review.
14498   </change>
14499   <change date="15 May 2003" version="v65">
14500       First Alpha.
14501       Make jmethodID and jfieldID unique, jclass not used.
14502   </change>
14503   <change date="27 May 2003" version="v66">
14504       Fix minor XSLT errors.
14505   </change>
14506   <change date="13 June 2003" version="v67">
14507       Undo making jfieldID unique (jmethodID still is).
14508   </change>
14509   <change date="17 June 2003" version="v68">
14510       Changes per June 11th Expert Group meeting --
14511       Overhaul Heap functionality: single callback,
14512       remove GetHeapRoots, add reachable iterators,
14513       and rename "annotation" to "tag".
14514       NULL thread parameter on most functions is current
14515       thread.
14516       Add timers.
14517       Remove ForceExit.
14518       Add GetEnvironmentLocalStorage.
14519       Add verbose flag and event.
14520       Add AddToBootstrapClassLoaderSearch.
14521       Update ClassFileLoadHook.
14522   </change>
14523   <change date="18 June 2003" version="v69">
14524       Clean up issues sections.
14525       Rename GetClassName back to GetClassSignature and
14526       fix description.
14527       Add generic signature to GetClassSignature,
14528       GetFieldSignature, GetMethodSignature, and
14529       GetLocalVariableTable.
14530       Elide EstimateCostOfCapabilities.
14531       Clarify that the system property functions operate
14532       on the VM view of system properties.
14533       Clarify Agent_OnLoad.
14534       Remove "const" from JNIEnv* in events.
14535       Add metadata accessors.
14536   </change>
14537   <change date="18 June 2003" version="v70">
14538       Add start_depth to GetStackTrace.
14539       Move system properties to a new category.
14540       Add GetObjectSize.
14541       Remove "X" from command line flags.
14542       XML, HTML, and spell check corrections.
14543   </change>
14544   <change date="19 June 2003" version="v71">
14545       Fix JVMTI_HEAP_ROOT_THREAD to be 6.
14546       Make each synopsis match the function name.
14547       Fix unclear wording.
14548   </change>
14549   <change date="26 June 2003" version="v72">
14550       SetThreadLocalStorage and SetEnvironmentLocalStorage should allow value
14551       to be set to NULL.
14552       NotifyFramePop, GetFrameLocationm and all the local variable operations
14553       needed to have their wording about frames fixed.
14554       Grammar and clarity need to be fixed throughout.
14555       Capitalization and puntuation need to be consistent.
14556       Need micro version number and masks for accessing major, minor, and micro.
14557       The error code lists should indicate which must be returned by
14558       an implementation.
14559       The command line properties should be visible in the properties functions.
14560       Disallow popping from the current thread.
14561       Allow implementations to return opaque frame error when they cannot pop.
14562       The NativeMethodBind event should be sent during any phase.
14563       The DynamicCodeGenerated event should be sent during any phase.
14564       The following functions should be allowed to operate before VMInit:
14565         Set/GetEnvironmentLocalStorage
14566         GetMethodDeclaringClass
14567         GetClassSignature
14568         GetClassModifiers
14569         IsInterface
14570         IsArrayClass
14571         GetMethodName
14572         GetMethodModifiers
14573         GetMaxLocals
14574         GetArgumentsSize
14575         GetLineNumberTable
14576         GetMethodLocation
14577         IsMethodNative
14578         IsMethodSynthetic.
14579       Other changes (to XSL):
14580       Argument description should show asterisk after not before pointers.
14581       NotifyFramePop, GetFrameLocationm and all the local variable operations
14582       should hsve the NO_MORE_FRAMES error added.
14583       Not alive threads should have a different error return than invalid thread.
14584   </change>
14585   <change date="7 July 2003" version="v73">
14586       VerboseOutput event was missing message parameter.
14587       Minor fix-ups.
14588   </change>
14589   <change date="14 July 2003" version="v74">
14590       Technical Publications Department corrections.
14591       Allow thread and environment local storage to be set to NULL.
14592   </change>
14593   <change date="23 July 2003" version="v75">
14594       Use new Agent_OnLoad rather than overloaded JVM_OnLoad.
14595       Add JNICALL to callbacks (XSL).
14596       Document JNICALL requirement for both events and callbacks (XSL).
14597       Restrict RedefineClasses to methods and attributes.
14598       Elide the VerboseOutput event.
14599       VMObjectAlloc: restrict when event is sent and remove method parameter.
14600       Finish loose ends from Tech Pubs edit.
14601   </change>
14602   <change date="24 July 2003" version="v76">
14603       Change ClassFileLoadHook event to send the class instead of a boolean of redefine.
14604   </change>
14605   <change date="24 July 2003" version="v77">
14606       XML fixes.
14607       Minor text clarifications and corrections.
14608   </change>
14609   <change date="24 July 2003" version="v78">
14610       Remove GetExceptionHandlerTable and GetThrownExceptions from <jvmti/>.
14611       Clarify that stack frames are JVM Spec frames.
14612       Split can_get_source_info into can_get_source_file_name, can_get_line_numbers,
14613       and can_get_source_debug_extension.
14614       PopFrame cannot have a native calling method.
14615       Removed incorrect statement in GetClassloaderClasses
14616       (see <vmspec chapter="4.4"/>).
14617   </change>
14618   <change date="24 July 2003" version="v79">
14619       XML and text fixes.
14620       Move stack frame description into Stack Frame category.
14621   </change>
14622   <change date="26 July 2003" version="v80">
14623       Allow NULL (means bootstrap loader) for GetClassloaderClasses.
14624       Add new heap reference kinds for references from classes.
14625       Add timer information struct and query functions.
14626       Add AvailableProcessors.
14627       Rename GetOtherThreadCpuTime to GetThreadCpuTime.
14628       Explicitly add JVMTI_ERROR_INVALID_THREAD and JVMTI_ERROR_THREAD_NOT_ALIVE
14629       to SetEventNotification mode.
14630       Add initial thread to the VM_INIT event.
14631       Remove platform assumptions from AddToBootstrapClassLoaderSearch.
14632   </change>
14633   <change date="26 July 2003" version="v81">
14634       Grammar and clarity changes per review.
14635   </change>
14636   <change date="27 July 2003" version="v82">
14637       More grammar and clarity changes per review.
14638       Add Agent_OnUnload.
14639   </change>
14640   <change date="28 July 2003" version="v83">
14641       Change return type of Agent_OnUnload to void.
14642   </change>
14643   <change date="28 July 2003" version="v84">
14644       Rename JVMTI_REFERENCE_ARRAY to JVMTI_REFERENCE_ARRAY_ELEMENT.
14645   </change>
14646   <change date="28 July 2003" version="v85">
14647       Steal java.lang.Runtime.availableProcessors() wording for
14648       AvailableProcessors().
14649       Guarantee that zero will never be an event ID.
14650       Remove some issues which are no longer issues.
14651       Per review, rename and more completely document the timer
14652       information functions.
14653   </change>
14654   <change date="29 July 2003" version="v86">
14655       Non-spec visible change to XML controlled implementation:
14656         SetThreadLocalStorage must run in VM mode.
14657   </change>
14658   <change date="5 August 2003" version="0.1.87">
14659       Add GetErrorName.
14660       Add varargs warning to jvmtiExtensionEvent.
14661       Remove "const" on the jvmtiEnv* of jvmtiExtensionEvent.
14662       Remove unused can_get_exception_info capability.
14663       Pass jvmtiEnv* and JNIEnv* to the jvmtiStartFunction.
14664       Fix jvmtiExtensionFunctionInfo.func declared type.
14665       Extension function returns error code.
14666       Use new version numbering.
14667   </change>
14668   <change date="5 August 2003" version="0.2.88">
14669       Remove the ClassUnload event.
14670   </change>
14671   <change date="8 August 2003" version="0.2.89">
14672       Heap reference iterator callbacks return an enum that
14673       allows outgoing object references to be ignored.
14674       Allow JNIEnv as a param type to extension events/functions.
14675   </change>
14676   <change date="15 August 2003" version="0.2.90">
14677       Fix a typo.
14678   </change>
14679   <change date="2 September 2003" version="0.2.91">
14680       Remove all metadata functions: GetClassMetadata,
14681       GetFieldMetadata, and GetMethodMetadata.
14682   </change>
14683   <change date="1 October 2003" version="0.2.92">
14684       Mark the functions Allocate. Deallocate, RawMonitor*,
14685       SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage
14686       as safe for use in heap callbacks and GC events.
14687   </change>
14688   <change date="24 November 2003" version="0.2.93">
14689       Add pass through opaque user data pointer to heap iterate
14690       functions and callbacks.
14691       In the CompiledMethodUnload event, send the code address.
14692       Add GarbageCollectionOccurred event.
14693       Add constant pool reference kind.
14694       Mark the functions CreateRawMonitor and DestroyRawMonitor
14695       as safe for use in heap callbacks and GC events.
14696       Clarify: VMDeath, GetCurrentThreadCpuTimerInfo,
14697       GetThreadCpuTimerInfo, IterateOverReachableObjects,
14698       IterateOverObjectsReachableFromObject, GetTime and
14699       JVMTI_ERROR_NULL_POINTER.
14700       Add missing errors to: GenerateEvents and
14701       AddToBootstrapClassLoaderSearch.
14702       Fix description of ClassFileLoadHook name parameter.
14703       In heap callbacks and GC/ObjectFree events, specify
14704       that only explicitly allowed functions can be called.
14705       Allow GetCurrentThreadCpuTimerInfo, GetCurrentThreadCpuTime,
14706       GetTimerInfo, and GetTime during callback.
14707       Allow calling SetTag/GetTag during the onload phase.
14708       SetEventNotificationMode, add: error attempted inappropriate
14709       thread level control.
14710       Remove jvmtiExceptionHandlerEntry.
14711       Fix handling of native methods on the stack --
14712       location_ptr param of GetFrameLocation, remove
14713       JVMTI_ERROR_OPAQUE_FRAME from GetFrameLocation,
14714       jvmtiFrameInfo.location, and jlocation.
14715       Remove typo (from JVMPI) implying that the MonitorWaited
14716       event is sent on sleep.
14717   </change>
14718   <change date="25 November 2003" version="0.2.94">
14719       Clarifications and typos.
14720   </change>
14721   <change date="3 December 2003" version="0.2.95">
14722       Allow NULL user_data in heap iterators.
14723   </change>
14724   <change date="28 January 2004" version="0.2.97">
14725       Add GetThreadState, deprecate GetThreadStatus.
14726   </change>
14727   <change date="29 January 2004" version="0.2.98">
14728       INVALID_SLOT and TYPE_MISMATCH errors should be optional.
14729   </change>
14730   <change date="12 February 2004" version="0.2.102">
14731       Remove MonitorContendedExit.
14732       Added JNIEnv parameter to VMObjectAlloc.
14733       Clarified definition of class_tag and referrer_index
14734       parameters to heap callbacks.
14735   </change>
14736   <change date="16 Febuary 2004" version="0.2.103">
14737       Document JAVA_TOOL_OPTIONS.
14738   </change>
14739   <change date="17 Febuary 2004" version="0.2.105">
14740       Divide start phase into primordial and start.
14741       Add VMStart event
14742       Change phase associations of functions and events.
14743   </change>
14744   <change date="18 Febuary 2004" version="0.3.6">
14745       Elide deprecated GetThreadStatus.
14746       Bump minor version, subtract 100 from micro version
14747   </change>
14748   <change date="18 Febuary 2004" version="0.3.7">
14749       Document that timer nanosecond values are unsigned.
14750       Clarify text having to do with native methods.
14751   </change>
14752   <change date="19 Febuary 2004" version="0.3.8">
14753       Fix typos.
14754       Remove elided deprecated GetThreadStatus.
14755   </change>
14756   <change date="23 Febuary 2004" version="0.3.9">
14757       Require NotifyFramePop to act on suspended threads.
14758   </change>
14759   <change date="24 Febuary 2004" version="0.3.10">
14760       Add capabilities
14761         (<internallink id="jvmtiCapabilities.can_redefine_any_class"
14762          ><code>can_redefine_any_class</code></internallink>
14763       and
14764          <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events"
14765          ><code>can_generate_all_class_hook_events</code></internallink>)
14766       and an error (<errorlink id="JVMTI_ERROR_UNMODIFIABLE_CLASS"></errorlink>)
14767       which allow some classes to be unmodifiable.
14768   </change>
14769   <change date="28 Febuary 2004" version="0.3.11">
14770       Add JVMTI_ERROR_MUST_POSSESS_CAPABILITY to SetEventNotificationMode.
14771   </change>
14772   <change date="8 March 2004" version="0.3.12">
14773       Clarified CompiledMethodUnload so that it is clear the event
14774       may be posted after the class has been unloaded.
14775   </change>
14776   <change date="5 March 2004" version="0.3.13">
14777       Change the size parameter of VMObjectAlloc to jlong to match GetObjectSize.
14778   </change>
14779   <change date="13 March 2004" version="0.3.14">
14780       Added guideline for the use of the JNI FindClass function in event
14781       callback functions.
14782   </change>
14783   <change date="15 March 2004" version="0.3.15">
14784       Add GetAllStackTraces and GetThreadListStackTraces.
14785   </change>
14786   <change date="19 March 2004" version="0.3.16">
14787       ClassLoad and ClassPrepare events can be posted during start phase.
14788   </change>
14789   <change date="25 March 2004" version="0.3.17">
14790       Add JVMTI_ERROR_NATIVE_METHOD to GetLineNumberTable, GetLocalVariableTable,
14791       GetMaxLocals, GetArgumentsSize, GetMethodLocation, GetBytecodes.
14792   </change>
14793   <change date="29 March 2004" version="0.3.18">
14794       Return the timer kind in the timer information structure.
14795   </change>
14796   <change date="31 March 2004" version="0.3.19">
14797       Spec clarifications:
14798       JVMTI_THREAD_STATE_IN_NATIVE might not include JNI or <jvmti/>.
14799       ForceGarbageCollection does not run finalizers.
14800       The context of the specification is the Java platform.
14801       Warn about early instrumentation.
14802   </change>
14803   <change date="1 April 2004" version="0.3.20">
14804       Refinements to the above clarifications and
14805       Clarify that an error returned by Agent_OnLoad terminates the VM.
14806   </change>
14807   <change date="1 April 2004" version="0.3.21">
14808       Array class creation does not generate a class load event.
14809   </change>
14810   <change date="7 April 2004" version="0.3.22">
14811       Align thread state hierarchy more closely with java.lang.Thread.State.
14812   </change>
14813   <change date="12 April 2004" version="0.3.23">
14814       Clarify the documentation of thread state.
14815   </change>
14816   <change date="19 April 2004" version="0.3.24">
14817       Remove GarbageCollectionOccurred event -- can be done by agent.
14818   </change>
14819   <change date="22 April 2004" version="0.3.25">
14820       Define "command-line option".
14821   </change>
14822   <change date="29 April 2004" version="0.3.26">
14823       Describe the intended use of bytecode instrumentation.
14824       Fix description of extension event first parameter.
14825   </change>
14826   <change date="30 April 2004" version="0.3.27">
14827       Clarification and typos.
14828   </change>
14829   <change date="18 May 2004" version="0.3.28">
14830       Remove DataDumpRequest event.
14831   </change>
14832   <change date="18 May 2004" version="0.3.29">
14833       Clarify RawMonitorWait with zero timeout.
14834       Clarify thread state after RunAgentThread.
14835   </change>
14836   <change date="24 May 2004" version="0.3.30">
14837       Clean-up: fix bad/old links, etc.
14838   </change>
14839   <change date="30 May 2004" version="0.3.31">
14840       Clarifications including:
14841       All character strings are modified UTF-8.
14842       Agent thread visibiity.
14843       Meaning of obsolete method version.
14844       Thread invoking heap callbacks,
14845   </change>
14846   <change date="1 June 2004" version="1.0.32">
14847       Bump major.minor version numbers to "1.0".
14848   </change>
14849   <change date="2 June 2004" version="1.0.33">
14850       Clarify interaction between ForceGarbageCollection
14851       and ObjectFree.
14852   </change>
14853   <change date="6 June 2004" version="1.0.34">
14854       Restrict AddToBootstrapClassLoaderSearch and
14855       SetSystemProperty to the OnLoad phase only.
14856   </change>
14857   <change date="11 June 2004" version="1.0.35">
14858       Fix typo in SetTag.
14859   </change>
14860   <change date="18 June 2004" version="1.0.36">
14861       Fix trademarks.
14862       Add missing parameter in example GetThreadState usage.
14863   </change>
14864   <change date="4 August 2004" version="1.0.37">
14865       Copyright updates.
14866   </change>
14867   <change date="5 November 2004" version="1.0.38">
14868       Add missing function table layout.
14869       Add missing description of C++ member function format of functions.
14870       Clarify that name in CFLH can be NULL.
14871       Released as part of <tm>J2SE</tm> 5.0.
14872   </change>
14873   <change date="24 April 2005" version="1.1.47">
14874       Bump major.minor version numbers to "1.1".
14875       Add ForceEarlyReturn* functions.
14876       Add GetOwnedMonitorStackDepthInfo function.
14877       Add GetCurrentThread function.
14878       Add "since" version marker.
14879       Add AddToSystemClassLoaderSearch.
14880       Allow AddToBootstrapClassLoaderSearch be used in live phase.
14881       Fix historic rubbish in the descriptions of the heap_object_callback
14882       parameter of IterateOverHeap and IterateOverInstancesOfClass functions;
14883       disallow NULL for this parameter.
14884       Clarify, correct and make consistent: wording about current thread,
14885       opaque frames and insufficient number of frames in PopFrame.
14886       Consistently use "current frame" rather than "topmost".
14887       Clarify the JVMTI_ERROR_TYPE_MISMATCH errors in GetLocal* and SetLocal*
14888       by making them compatible with those in ForceEarlyReturn*.
14889       Many other clarifications and wording clean ups.
14890   </change>
14891   <change date="25 April 2005" version="1.1.48">
14892       Add GetConstantPool.
14893       Switch references to the first edition of the VM Spec, to the seconds edition.
14894   </change>
14895   <change date="26 April 2005" version="1.1.49">
14896       Clarify minor/major version order in GetConstantPool.
14897   </change>
14898   <change date="26 April 2005" version="1.1.50">
14899       Add SetNativeMethodPrefix and SetNativeMethodPrefixes.
14900       Reassign GetOwnedMonitorStackDepthInfo to position 153.
14901       Break out Class Loader Search in its own documentation category.
14902       Deal with overly long lines in XML source.
14903   </change>
14904   <change date="29 April 2005" version="1.1.51">
14905       Allow agents be started in the live phase.
14906       Added paragraph about deploying agents.
14907   </change>
14908   <change date="30 April 2005" version="1.1.52">
14909       Add specification description to SetNativeMethodPrefix(es).
14910       Better define the conditions on GetConstantPool.
14911   </change>
14912   <change date="30 April 2005" version="1.1.53">
14913       Break out the GetClassVersionNumber function from GetConstantPool.
14914       Clean-up the references to the VM Spec.
14915   </change>
14916   <change date="1 May 2005" version="1.1.54">
14917       Allow SetNativeMethodPrefix(es) in any phase.
14918       Add clarifications about the impact of redefinition on GetConstantPool.
14919   </change>
14920   <change date="2 May 2005" version="1.1.56">
14921       Various clarifications to SetNativeMethodPrefix(es).
14922   </change>
14923   <change date="2 May 2005" version="1.1.57">
14924       Add missing performance warning to the method entry event.
14925   </change>
14926   <change date="5 May 2005" version="1.1.58">
14927       Remove internal JVMDI support.
14928   </change>
14929   <change date="8 May 2005" version="1.1.59">
14930       Add <functionlink id="RetransformClasses"/>.
14931       Revamp the bytecode instrumentation documentation.
14932       Change <functionlink id="IsMethodObsolete"/> to no longer
14933       require the can_redefine_classes capability.
14934   </change>
14935   <change date="11 May 2005" version="1.1.63">
14936       Clarifications for retransformation.
14937   </change>
14938   <change date="11 May 2005" version="1.1.64">
14939       Clarifications for retransformation, per review.
14940       Lock "retransformation (in)capable" at class load enable time.
14941   </change>
14942   <change date="4 June 2005" version="1.1.67">
14943       Add new heap functionity which supports reporting primitive values,
14944       allows setting the referrer tag, and has more powerful filtering:
14945       FollowReferences, IterateThroughHeap, and their associated
14946       callbacks, structs, enums, and constants.
14947   </change>
14948   <change date="4 June 2005" version="1.1.68">
14949       Clarification.
14950   </change>
14951   <change date="6 June 2005" version="1.1.69">
14952       FollowReferences, IterateThroughHeap: Put callbacks in a struct;
14953       Add missing error codes; reduce bits in the visit control flags.
14954   </change>
14955   <change date="14 June 2005" version="1.1.70">
14956       More on new heap functionity: spec clean-up per review.
14957   </change>
14958   <change date="15 June 2005" version="1.1.71">
14959       More on new heap functionity: Rename old heap section to Heap (1.0).
14960   </change>
14961   <change date="21 June 2005" version="1.1.72">
14962       Fix typos.
14963   </change>
14964   <change date="27 June 2005" version="1.1.73">
14965       Make referrer info structure a union.
14966   </change>
14967   <change date="9 September 2005" version="1.1.74">
14968       In new heap functions:
14969       Add missing superclass reference kind.
14970       Use a single scheme for computing field indexes.
14971       Remove outdated references to struct based referrer info.
14972   </change>
14973   <change date="12 September 2005" version="1.1.75">
14974       Don't callback during FollowReferences on frivolous java.lang.Object superclass.
14975   </change>
14976   <change date="13 September 2005" version="1.1.76">
14977       In string primitive callback, length now Unicode length.
14978       In array and string primitive callbacks, value now "const".
14979       Note possible compiler impacts on setting JNI function table.
14980   </change>
14981   <change date="13 September 2005" version="1.1.77">
14982       GetClassVersionNumbers() and GetConstantPool() should return
14983       error on array or primitive class.
14984   </change>
14985   <change date="14 September 2005" version="1.1.78">
14986       Grammar fixes.
14987   </change>
14988   <change date="26 September 2005" version="1.1.79">
14989       Add IsModifiableClass query.
14990   </change>
14991   <change date="9 February 2006" version="1.1.81">
14992       Add referrer_class_tag parameter to jvmtiHeapReferenceCallback.
14993   </change>
14994   <change date="13 February 2006" version="1.1.82">
14995       Doc fixes: update can_redefine_any_class to include retransform.
14996       Clarify that exception events cover all Throwables.
14997       In GetStackTrace, no test is done for start_depth too big if start_depth is zero,
14998       Clarify fields reported in Primitive Field Callback -- static vs instance.
14999       Repair confusing names of heap types, including callback names.
15000       Require consistent usage of stack depth in the face of thread launch methods.
15001       Note incompatibility of <jvmti/> memory management with other systems.
15002   </change>
15003   <change date="14 February 2006" version="1.1.85">
15004       Fix typos and missing renames.
15005   </change>
15006   <change date="13 March 2006" version="1.1.86">
15007       Clarify that jmethodIDs and jfieldIDs can be saved.
15008       Clarify that Iterate Over Instances Of Class includes subclasses.
15009   </change>
15010   <change date="14 March 2006" version="1.1.87">
15011       Better phrasing.
15012   </change>
15013   <change date="16 March 2006" version="1.1.88">
15014       Match the referrer_index for static fields in Object Reference Callback
15015       with the Reference Implementation (and all other known implementations);
15016       that is, make it match the definition for instance fields.
15017       In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover
15018       an invalid thread in the list; and specify that not started threads
15019       return empty stacks.
15020   </change>
15021   <change date="17 March 2006" version="1.1.89">
15022       Typo.
15023   </change>
15024   <change date="25 March 2006" version="1.1.90">
15025       Typo.
15026   </change>
15027   <change date="6 April 2006" version="1.1.91">
15028       Remove restrictions on AddToBootstrapClassLoaderSearch and
15029       AddToSystemClassLoaderSearch.
15030   </change>
15031   <change date="1 May 2006" version="1.1.93">
15032       Changed spec to return -1 for monitor stack depth for the
15033       implementation which can not determine stack depth.
15034   </change>
15035   <change date="3 May 2006" version="1.1.94">
15036       Corrections for readability and accuracy courtesy of Alan Pratt of IBM.
15037       List the object relationships reported in FollowReferences.
15038   </change>
15039   <change date="5 May 2006" version="1.1.95">
15040       Clarify the object relationships reported in FollowReferences.
15041   </change>
15042   <change date="28 June 2006" version="1.1.98">
15043       Clarify DisposeEnvironment; add warning.
15044       Fix typos in SetLocalXXX "retrieve" => "set".
15045       Clarify that native method prefixes must remain set while used.
15046       Clarify that exactly one Agent_OnXXX is called per agent.
15047       Clarify that library loading is independent from start-up.
15048       Remove ambiguous reference to Agent_OnLoad in the Agent_OnUnload spec.
15049   </change>
15050   <change date="31 July 2006" version="1.1.99">
15051       Clarify the interaction between functions and exceptions.
15052       Clarify and give examples of field indices.
15053       Remove confusing "That is" sentence from MonitorWait and MonitorWaited events.
15054       Update links to point to Java 6.
15055   </change>
15056   <change date="6 August 2006" version="1.1.102">
15057       Add ResourceExhaustedEvent.
15058   </change>
15059   <change date="11 October 2012" version="1.2.2">
15060       Fixed the "HTTP" and "Missing Anchor" errors reported by the LinkCheck tool.
15061   </change>
15062   <change date="19 June 2013" version="1.2.3">
15063       Added support for statically linked agents.
15064   </change>
15065   <change date="13 October 2016" version="9.0.0">
15066       Support for modules:
15067        - The majorversion is 9 now
15068        - The ClassFileLoadHook events are not sent during the primordial phase anymore.
15069        - Allow CompiledMethodLoad events at start phase
15070        - Add new capabilities:
15071           - can_generate_early_vmstart
15072           - can_generate_early_class_hook_events
15073        - Add new functions:
15074           - GetAllModules
15075           - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides
15076           - IsModifiableModule
15077       Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to
15078       disallow some implementation defined classes.
15079   </change>
15080   <change date="12 February 2017" version="9.0.0">
15081       Minor update for GetCurrentThread function:
15082        - The function may return NULL in the start phase if the
15083          can_generate_early_vmstart capability is enabled.
15084   </change>
15085 </changehistory>
15086 
15087 </specification>
15088 <!-- Keep this comment at the end of the file
15089 Local variables:
15090 mode: sgml
15091 sgml-omittag:t
15092 sgml-shorttag:t
15093 sgml-namecase-general:t
15094 sgml-general-insert-case:lower
15095 sgml-minimize-attributes:nil
15096 sgml-always-quote-attributes:t
15097 sgml-indent-step:2
15098 sgml-indent-data:t
15099 sgml-parent-document:nil
15100 sgml-exposed-tags:nil
15101 sgml-local-catalogs:nil
15102 sgml-local-ecat-files:nil
15103 End:
15104 -->