1 <?xml version="1.0" encoding="ISO-8859-1"?>
   2 <?xml-stylesheet type="text/xsl" href="jvmti.xsl"?>
   3 <!--
   4  Copyright (c) 2002, 2019, 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 
  31    <!ELEMENT title (#PCDATA|jvmti|tm)*>
  32    <!ATTLIST title subtitle CDATA #REQUIRED>
  33 
  34    <!ELEMENT intro ANY>
  35    <!ATTLIST intro id CDATA #IMPLIED
  36                    label CDATA "">
  37 
  38    <!ELEMENT functionsection (intro*, category*)>
  39    <!ATTLIST functionsection label CDATA #REQUIRED>
  40 
  41    <!ELEMENT category ((intro|typedef|uniontypedef|capabilitiestypedef)*,
  42                           (function|callback|elide)*)>
  43    <!ATTLIST category id CDATA #REQUIRED
  44                       label CDATA #REQUIRED>
  45 
  46    <!ELEMENT function (synopsis, typedef*, description?, origin,
  47                          (capabilities|eventcapabilities),
  48                          parameters, errors)>
  49    <!ATTLIST function id CDATA #REQUIRED
  50                       num CDATA #REQUIRED
  51                       phase (onload|onloadOnly|start|live|any) #IMPLIED
  52                       callbacksafe (safe|unsafe) #IMPLIED
  53                       impl CDATA #IMPLIED
  54                       hide CDATA #IMPLIED
  55                       jkernel (yes|no) #IMPLIED
  56                       since CDATA "1.0">
  57 
  58    <!ELEMENT callback ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
  59                         jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void),
  60                         synopsis, description?, parameters)>
  61    <!ATTLIST callback id CDATA #REQUIRED
  62                       since CDATA "1.0">
  63 
  64    <!ELEMENT synopsis (#PCDATA|jvmti)*>
  65 
  66    <!ELEMENT typedef (description?, field*)>
  67    <!ATTLIST typedef id CDATA #REQUIRED
  68                      label CDATA #REQUIRED
  69                      since CDATA "1.0">
  70 
  71    <!ELEMENT uniontypedef (description?, field*)>
  72    <!ATTLIST uniontypedef id CDATA #REQUIRED
  73                      label CDATA #REQUIRED
  74                      since CDATA "1.0">
  75 
  76    <!ELEMENT field ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
  77                      jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|allocfieldbuf|inptr|inbuf|outbuf|vmbuf|ptrtype|struct),
  78                     description)>
  79    <!ATTLIST field id CDATA #REQUIRED>
  80 
  81    <!ELEMENT capabilitiestypedef (description?, capabilityfield*)>
  82    <!ATTLIST capabilitiestypedef id CDATA #REQUIRED
  83                      label CDATA #REQUIRED>
  84 
  85    <!ELEMENT capabilityfield (description)>
  86    <!ATTLIST capabilityfield id CDATA #REQUIRED
  87                    disp1 CDATA ""
  88                    disp2 CDATA ""
  89                    since CDATA "1.0">
  90 
  91    <!ELEMENT description ANY>
  92 
  93    <!ELEMENT capabilities (required*, capability*)>
  94 
  95    <!ELEMENT eventcapabilities EMPTY>
  96 
  97    <!ELEMENT required ANY>
  98    <!ATTLIST required id CDATA #REQUIRED>
  99 
 100    <!ELEMENT capability ANY>
 101    <!ATTLIST capability id CDATA #REQUIRED>
 102 
 103    <!ELEMENT parameters (param*)>
 104 
 105    <!ELEMENT param ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
 106                      jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct|ptrtype|
 107                      outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf),
 108                     description)>
 109    <!ATTLIST param id CDATA #REQUIRED>
 110 
 111    <!ELEMENT jmethodID EMPTY>
 112    <!ATTLIST jmethodID class  CDATA #IMPLIED
 113                        native CDATA #IMPLIED>
 114 
 115    <!ELEMENT jfieldID EMPTY>
 116    <!ATTLIST jfieldID class CDATA #IMPLIED>
 117 
 118    <!ELEMENT jclass EMPTY>
 119    <!ATTLIST jclass method CDATA #IMPLIED
 120                     field  CDATA #IMPLIED>
 121 
 122    <!ELEMENT jframeID EMPTY>
 123    <!ATTLIST jframeID thread CDATA #IMPLIED
 124                       fiber  CDATA #IMPLIED>
 125 
 126    <!ELEMENT jrawMonitorID EMPTY>
 127 
 128    <!ELEMENT jthread EMPTY>
 129    <!ATTLIST jthread started CDATA #IMPLIED
 130                      null CDATA #IMPLIED
 131                      frame CDATA #IMPLIED
 132                      impl CDATA #IMPLIED>
 133 
 134    <!ELEMENT varargs EMPTY>
 135 
 136    <!ELEMENT jthreadGroup EMPTY>
 137    <!ELEMENT jobject EMPTY>
 138    <!ATTLIST jobject frame CDATA #IMPLIED>
 139 
 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 blockquote ANY>
 337 
 338    <!ELEMENT dl  (dt|dd)+>
 339 
 340    <!ELEMENT dd  ANY>
 341 
 342    <!ELEMENT dt  (#PCDATA|jvmti|code|i|b)*>
 343 
 344    <!ELEMENT table  (tr)+>
 345 
 346    <!ELEMENT tr  (td|th)*>
 347 
 348    <!ELEMENT td  ANY>
 349    <!ATTLIST td class CDATA #IMPLIED>
 350 
 351    <!ELEMENT th  ANY>
 352    <!ATTLIST th class CDATA #IMPLIED>
 353 
 354    <!ELEMENT ul  (li)+>
 355    <!ATTLIST ul type (disc|circle|square) "disc">
 356 
 357    <!ELEMENT li  ANY>
 358  ]>
 359 
 360 <specification label="JVM(TM) Tool Interface">
 361   <title subtitle="Version">
 362     <tm>JVM</tm> Tool Interface
 363   </title>
 364 
 365   <intro id="whatIs" label="What is the JVM Tool Interface?">
 366     The <tm>JVM</tm> Tool Interface (<jvmti/>)
 367     is a programming interface used by development and monitoring tools.
 368     It provides both a way to inspect the state and
 369     to control the execution of applications running in the
 370     <tm>Java</tm> virtual machine (VM).
 371     <p/>
 372     <jvmti/> is intended to provide a VM interface for the full breadth of tools
 373     that need access to VM state, including but not limited to: profiling,
 374     debugging, monitoring, thread analysis, and coverage analysis tools.
 375     <p/>
 376     <jvmti/> may not be available in all implementations of the <tm>Java</tm> virtual
 377     machine.
 378     <p/>
 379     <jvmti/> is a two-way interface.
 380     A client of <jvmti/>, hereafter called an <i>agent</i>,
 381     can be notified of
 382     interesting occurrences through <internallink id="EventSection">events</internallink>.
 383     <jvmti/>
 384     can query and control the application through many
 385     <internallink id="FunctionSection">functions</internallink>,
 386     either in response to events or
 387     independent of them.
 388     <p/>
 389     Agents run in the same process with and communicate directly with
 390     the virtual machine executing
 391     the application being examined.  This communication is
 392     through a native interface (<jvmti/>). The native in-process interface allows
 393     maximal control with minimal intrusion on the part of a tool.
 394     Typically, agents are relatively compact. They can be controlled
 395     by a separate process which implements the bulk of a tool's
 396     function without interfering with the target application's normal execution.
 397   </intro>
 398 
 399   <intro id="architecture" label="Architecture">
 400     Tools can be written directly to <jvmti/> or indirectly
 401     through higher level interfaces.
 402     The Java Platform Debugger Architecture includes <jvmti/>, but also
 403     contains higher-level, out-of-process debugger interfaces. The higher-level
 404     interfaces are more appropriate than <jvmti/> for many tools.
 405     For more information on the Java Platform Debugger Architecture,
 406     see the
 407     <externallink id="jpda/architecture.html">Java
 408       Platform Debugger Architecture website</externallink>.
 409   </intro>
 410 
 411   <intro id="writingAgents" label="Writing Agents">
 412     Agents can be written in any native language that supports C
 413     language calling conventions and C or C++
 414     definitions.
 415     <p/>
 416     The function, event, data type, and constant definitions needed for
 417     using <jvmti/> are defined in the include file <code>jvmti.h</code>.
 418     To use these definitions add the <tm>J2SE</tm> include directory
 419     to your include path and add
 420     <example>
 421 #include &lt;jvmti.h&gt;
 422     </example>
 423     to your source code.
 424   </intro>
 425 
 426   <intro id="deployingAgents" label="Deploying Agents">
 427     An agent is deployed in a platform specific manner but is typically the
 428     platform equivalent of a dynamic library. On the <tm>Windows</tm> operating
 429     system, for example, an agent library is a "Dynamic Linked Library" (DLL).
 430     On the <tm>Solaris</tm> Operating Environment, an agent library is a shared
 431     object (<code>.so</code> file).
 432     <p/>
 433 
 434     An agent may be started at VM startup by specifying the agent library
 435     name using a <internallink id="starting">command line option</internallink>.
 436     Some implementations may support a mechanism to <internallink id="onattach">
 437     start agents</internallink> in the live <functionlink id="GetPhase">phase</functionlink>.
 438     The details of how this is initiated are implementation specific.
 439   </intro>
 440 
 441     <intro id="entryPoint" label="Statically Linked Agents (since version 1.2.3)">
 442 
 443       A native JVMTI Agent may be <i>statically linked</i> with the VM.
 444       The manner in which the library and VM image are combined is
 445       implementation-dependent.
 446       An agent L whose image has been combined with the VM is defined as
 447       <i>statically linked</i> if and only if the agent exports a function
 448       called Agent_OnLoad_L.
 449 <p/>
 450       If a <i>statically linked</i> agent L exports a function called
 451       Agent_OnLoad_L and a function called Agent_OnLoad, the Agent_OnLoad
 452       function will be ignored.
 453       If an agent L is <i>statically linked</i>, an Agent_OnLoad_L
 454       function will be invoked with the same arguments and expected return
 455       value as specified for the Agent_OnLoad function.
 456       An agent L that is <i>statically linked</i> will prohibit an agent of
 457       the same name from being loaded dynamically.
 458 <p/>
 459       The VM will invoke the Agent_OnUnload_L function of the agent, if such
 460       a function is exported, at the same point during VM execution as it would
 461       have called the dynamic entry point Agent_OnUnLoad. A statically loaded
 462       agent cannot be unloaded. The Agent_OnUnload_L function will still be
 463       called to do any other agent shutdown related tasks.
 464       If a <i>statically linked</i> agent L exports a function called
 465       Agent_OnUnLoad_L and a function called Agent_OnUnLoad, the Agent_OnUnLoad
 466       function will be ignored.
 467 <p/>
 468       If an agent L is <i>statically linked</i>, an Agent_OnAttach_L function
 469       will be invoked with the same arguments and expected return value as
 470       specified for the Agent_OnAttach function.
 471       If a <i>statically linked</i> agent L exports a function called
 472       Agent_OnAttach_L and a function called Agent_OnAttach, the Agent_OnAttach
 473       function will be ignored.
 474 </intro>
 475 
 476   <intro id="starting" label="Agent Command Line Options">
 477     The term "command-line option" is used below to
 478     mean options supplied in the <code>JavaVMInitArgs</code> argument
 479     to the <code>JNI_CreateJavaVM</code> function of the JNI
 480     Invocation API.
 481     <p/>
 482     One of the two following
 483     command-line options is used on VM startup to
 484     properly load and run agents.
 485     These arguments identify the library containing
 486     the agent as well as an options
 487     string to be passed in at startup.
 488     <dl>
 489       <dt><code>-agentlib:</code><i>&lt;agent-lib-name&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
 490       <dd>
 491         The name following <code>-agentlib:</code> is the name of the
 492         library to load.  Lookup of the library, both its full name and location,
 493         proceeds in a platform-specific manner.
 494         Typically, the <i>&lt;agent-lib-name&gt;</i> is expanded to an
 495         operating system specific file name.
 496         The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
 497         For example, if the option
 498         <code>-agentlib:foo=opt1,opt2</code> is specified, the VM will attempt to
 499         load the shared library <code>foo.dll</code> from the system <code>PATH</code>
 500         under <tm>Windows</tm> or <code>libfoo.so</code> from the
 501         <code>LD_LIBRARY_PATH</code> under the <tm>Solaris</tm> operating
 502         environment.
 503         If the agent library is statically linked into the executable
 504         then no actual loading takes place.
 505     <p/>
 506       </dd>
 507       <dt><code>-agentpath:</code><i>&lt;path-to-agent&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
 508       <dd>
 509         The path following <code>-agentpath:</code> is the absolute path from which
 510         to load the library.
 511         No library name expansion will occur.
 512         The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
 513         For example, if the option
 514         <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code> is specified, the VM will attempt to
 515         load the shared library <code>c:\myLibs\foo.dll</code>. If the agent
 516         library is statically linked into the executable
 517         then no actual loading takes place.
 518     <p/>
 519       </dd>
 520     </dl>
 521     For a dynamic shared library agent, the start-up routine
 522     <internallink id="onload"><code>Agent_OnLoad</code></internallink>
 523     in the library will be invoked. If the agent library is statically linked
 524     into the executable then the system will attempt to invoke the
 525     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> entry point where
 526     &lt;agent-lib-name&gt; is the basename of the
 527     agent. In the above example <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code>,
 528     the system will attempt to find and call the <code>Agent_OnLoad_foo</code> start-up routine.
 529     <p/>
 530     Libraries loaded with <code>-agentlib:</code> or <code>-agentpath:</code>
 531     will be searched for JNI native method implementations to facilitate the
 532     use of Java programming language code in tools, as is needed for
 533     <internallink id="bci">bytecode instrumentation</internallink>.
 534     <p/>
 535     The agent libraries will be searched after all other libraries have been
 536     searched (agents wishing to override or intercept the native method
 537     implementations of non-agent methods can use the
 538     <eventlink id="NativeMethodBind">NativeMethodBind event</eventlink>).
 539     <p/>
 540     These switches do the above and nothing more - they do not change the
 541     state of the VM or <jvmti/>.  No command line options are needed
 542     to enable <jvmti/>
 543     or aspects of <jvmti/>, this is handled programmatically
 544     by the use of
 545     <internallink id="capability">capabilities</internallink>.
 546   </intro>
 547 
 548   <intro id="startup" label="Agent Start-Up">
 549     The VM starts each agent by invoking a start-up function.
 550     If the agent is started in the <code>OnLoad</code>
 551     <functionlink id="GetPhase">phase</functionlink> the function
 552     <internallink id="onload"><code>Agent_OnLoad</code></internallink>
 553     or <internallink id="onload"><code>Agent_OnLoad_L</code></internallink>
 554     for statically linked agents will be invoked.
 555     If the agent is started in the live
 556     <functionlink id="GetPhase">phase</functionlink> the function
 557     <internallink id="onattach"><code>Agent_OnAttach</code></internallink>
 558     or <internallink id="onattach"><code>Agent_OnAttach_L</code></internallink>
 559     for statically linked agents will be invoked.
 560     Exactly one call to a start-up function is made per agent.
 561   </intro>
 562 
 563   <intro id="onload" label="Agent Start-Up (OnLoad phase)">
 564     If an agent is started during the <code>OnLoad</code> phase then its
 565     agent library must export a start-up function with the following prototype:
 566     <example>
 567 JNIEXPORT jint JNICALL
 568 Agent_OnLoad(JavaVM *vm, char *options, void *reserved)</example>
 569     Or for a statically linked agent named 'L':
 570     <example>
 571 JNIEXPORT jint JNICALL
 572 Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved)</example>
 573 
 574     The VM will start the agent by calling this function.
 575     It will be called early enough in VM initialization that:
 576     <ul>
 577       <li><functionlink id="SetSystemProperty">system properties</functionlink>
 578         may be set before they have been used in the start-up of the VM</li>
 579       <li>the full set of
 580         <internallink id="capability">capabilities</internallink>
 581         is still available (note that capabilities that configure the VM
 582         may only be available at this time--see the
 583         <internallink id="capability">Capability function section</internallink>)</li>
 584       <li>no bytecodes have executed</li>
 585       <li>no classes have been loaded</li>
 586       <li>no objects have been created</li>
 587     </ul>
 588     <p/>
 589     The VM will call the <code>Agent_OnLoad</code> or
 590     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> function with
 591     <i>&lt;options&gt;</i> as the second argument -
 592     that is, using the command-line option examples,
 593     <code>"opt1,opt2"</code> will be passed to the <code>char *options</code>
 594     argument of <code>Agent_OnLoad</code>.
 595     The <code>options</code> argument is encoded as a
 596     <internallink id="mUTF">modified UTF-8</internallink> string.
 597     If <i>=&lt;options&gt;</i> is not specified,
 598     a zero length string is passed to <code>options</code>.
 599     The lifespan of the <code>options</code> string is the
 600     <code>Agent_OnLoad</code> or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code>
 601     call.  If needed beyond this time the string or parts of the string must
 602     be copied.
 603     The period between when <code>Agent_OnLoad</code> is called and when it
 604     returns is called the <i>OnLoad phase</i>.
 605     Since the VM is not initialized during the OnLoad
 606     <functionlink id="GetPhase">phase</functionlink>,
 607     the set of allowed operations
 608     inside <code>Agent_OnLoad</code> is restricted (see the function descriptions for the
 609     functionality available at this time).
 610     The agent can safely process the options and set
 611     event callbacks with <functionlink id="SetEventCallbacks"></functionlink>. Once
 612     the VM initialization event is received
 613     (that is, the <eventlink id="VMInit">VMInit</eventlink>
 614     callback is invoked), the agent
 615     can complete its initialization.
 616     <rationale>
 617       Early startup is required so that agents can set the desired capabilities,
 618       many of which must be set before the VM is initialized.
 619       In JVMDI, the -Xdebug command-line option provided
 620       very coarse-grain control of capabilities.
 621       JVMPI implementations use various tricks to provide a single "JVMPI on" switch.
 622       No reasonable command-line
 623       option could provide the fine-grain of control required to balance needed capabilities vs
 624       performance impact.
 625       Early startup is also needed so that agents can control the execution
 626       environment - modifying the file system and system properties to install
 627       their functionality.
 628     </rationale>
 629     <p/>
 630     The return value from <code>Agent_OnLoad</code> or
 631     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> is used to indicate an error.
 632     Any value other than zero indicates an error and causes termination of the VM.
 633   </intro>
 634 
 635   <intro id="onattach" label="Agent Start-Up (Live phase)">
 636     A VM may support a mechanism that allows agents to be started in the VM during the live
 637     <functionlink id="GetPhase">phase</functionlink>. The details of how this is supported,
 638     are implementation specific. For example, a tool may use some platform specific mechanism,
 639     or implementation specific API, to attach to the running VM, and request it start a given
 640     agent.
 641     <p/>
 642     If an agent is started during the live phase then its agent library
 643     must export a start-up function
 644     with the following prototype:
 645     <example>
 646 JNIEXPORT jint JNICALL
 647 Agent_OnAttach(JavaVM* vm, char *options, void *reserved)</example>
 648 Or for a statically linked agent named 'L':
 649     <example>
 650 JNIEXPORT jint JNICALL
 651 Agent_OnAttach_L(JavaVM* vm, char *options, void *reserved)</example>
 652 
 653     <p/>
 654     The VM will start the agent by calling this function.
 655     It will be called in the context of a thread
 656     that is attached to the VM. The first argument <i>&lt;vm&gt;</i> is the Java VM.
 657     The <i>&lt;options&gt;</i> argument is the startup options provided to the agent.
 658     <i>&lt;options&gt;</i> is encoded as a <internallink id="mUTF">modified UTF-8
 659     </internallink> string.
 660     If startup options were not provided, a zero length string is passed to
 661     <code>options</code>. The lifespan of the <code>options</code> string is the
 662     <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name&gt;</code> call.
 663     If needed beyond this time the string or parts of the string must be copied.
 664     <p/>
 665     Note that some <internallink id="capability">capabilities</internallink>
 666     may not be available in the live phase.
 667     <p/>
 668     The <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name
 669     &gt;</code> function initializes the agent and returns a value
 670     to the VM to indicate if an error occurred. Any value other than zero indicates an error.
 671     An error does not cause the VM to terminate. Instead the VM ignores the error, or takes
 672     some implementation specific action -- for example it might print an error to standard error,
 673     or record the error in a system log.
 674   </intro>
 675 
 676   <intro id="onunload" label="Agent Shutdown">
 677     The library may optionally export a
 678     shutdown function with the following prototype:
 679     <example>
 680 JNIEXPORT void JNICALL
 681 Agent_OnUnload(JavaVM *vm)</example>
 682     Or for a statically linked agent named 'L':
 683     <example>
 684 JNIEXPORT void JNICALL
 685 Agent_OnUnload_L(JavaVM *vm)</example>
 686 
 687     This function will be called by the VM when the library is about to be unloaded.
 688     The library will be unloaded (unless it is statically linked into the
 689     executable) and this function will be called if some platform specific
 690     mechanism causes the unload (an unload mechanism is not specified in this document)
 691     or the library is (in effect) unloaded by the termination of the VM whether through
 692     normal termination or VM failure, including start-up failure.
 693     Uncontrolled shutdown is, of course, an exception to this rule.
 694     Note the distinction between this function and the
 695     <eventlink id="VMDeath">VM Death event</eventlink>: for the VM Death event
 696     to be sent, the VM must have run at least to the point of initialization and a valid
 697     <jvmti/> environment must exist which has set a callback for VMDeath
 698     and enabled the event.
 699     None of these are required for <code>Agent_OnUnload</code> or
 700     <code>Agent_OnUnload_&lt;agent-lib-name&gt;</code> and this function
 701     is also called if the library is unloaded for other reasons.
 702     In the case that a VM Death event is sent, it will be sent before this
 703     function is called (assuming this function is called due to VM termination).
 704     This function can be used to clean-up resources allocated by the agent.
 705   </intro>
 706 
 707   <intro id="tooloptions" label="JAVA_TOOL_OPTIONS">
 708     Since the command-line cannot always be accessed or modified, for example in embedded VMs
 709     or simply VMs launched deep within scripts, a <code>JAVA_TOOL_OPTIONS</code> variable is
 710     provided so that agents may be launched in these cases.
 711     <p/>
 712     Platforms which support environment variables or other named strings, may support the
 713     <code>JAVA_TOOL_OPTIONS</code> variable.  This variable will be broken into options at white-space
 714     boundaries.  White-space characters include space, tab, carriage-return, new-line,
 715     vertical-tab, and form-feed.  Sequences of white-space characters are considered
 716     equivalent to a single white-space character.  No white-space is included in the options
 717     unless quoted.  Quoting is as follows:
 718     <ul>
 719         <li>All characters enclosed between a pair of single quote marks (''), except a single
 720         quote, are quoted.</li>
 721         <li>Double quote characters have no special meaning inside a pair of single quote marks.</li>
 722         <li>All characters enclosed between a pair of double quote marks (""), except a double
 723         quote, are quoted.</li>
 724         <li>Single quote characters have no special meaning inside a pair of double quote marks.</li>
 725         <li>A quoted part can start or end anywhere in the variable.</li>
 726         <li>White-space characters have no special meaning when quoted -- they are included in
 727         the option like any other character and do not mark white-space boundaries.</li>
 728         <li>The pair of quote marks is not included in the option.</li>
 729     </ul>
 730     <code>JNI_CreateJavaVM</code> (in the JNI Invocation API) will prepend these options to the options supplied
 731     in its <code>JavaVMInitArgs</code> argument. Platforms may disable this feature in cases where security is
 732     a concern; for example, the Reference Implementation disables this feature on Unix systems when
 733     the effective user or group ID differs from the real ID.
 734     This feature is intended to support the initialization of tools -- specifically including the
 735     launching of native or Java programming language agents.  Multiple tools may wish to use this
 736     feature, so the variable should not be overwritten, instead,  options should be appended to
 737     the variable.  Note that since the variable is processed at the time of the JNI Invocation
 738     API create VM call, options processed by a launcher (e.g., VM selection options) will not be handled.
 739   </intro>
 740 
 741   <intro id="environments" label="Environments">
 742     The <jvmti/> specification supports the use of multiple simultaneous
 743     <jvmti/> agents.
 744     Each agent has its own <jvmti/> environment.
 745     That is, the <jvmti/> state is
 746     separate for each agent - changes to one environment do not affect the
 747     others.  The state of a <jvmti/>
 748     environment includes:
 749     <ul>
 750       <li><functionlink id="SetEventCallbacks">the event callbacks</functionlink></li>
 751       <li><functionlink id="SetEventNotificationMode">the set of events which are enabled</functionlink></li>
 752       <li><internallink id="capability">the capabilities</internallink></li>
 753       <li><internallink id="memory">the memory allocation/deallocation hooks</internallink></li>
 754     </ul>
 755     Although their <jvmti/> state
 756     is separate, agents inspect and modify the shared state
 757     of the VM, they also share the native environment in which they execute.
 758     As such, an agent can perturb the results of other agents or cause them
 759     to fail.  It is the responsibility of the agent writer to specify the level
 760     of compatibility with other agents.  <jvmti/> implementations are not capable
 761     of preventing destructive interactions between agents. Techniques to reduce
 762     the likelihood of these occurrences are beyond the scope of this document.
 763     <p/>
 764     An agent creates a <jvmti/> environment
 765     by passing a <jvmti/> version
 766     as the interface ID to the JNI Invocation API function
 767     <externallink id="jni/invocation.html#getenv">
 768       <code>GetEnv</code></externallink>.
 769     See <internallink id="jvmtiEnvAccess">Accessing <jvmti/> Functions</internallink>
 770     for more details on the creation and use of
 771     <jvmti/> environments.
 772     Typically, <jvmti/> environments are created by calling <code>GetEnv</code> from
 773     <internallink id="onload"><code>Agent_OnLoad</code></internallink>.
 774   </intro>
 775 
 776   <intro id="bci" label="Bytecode Instrumentation">
 777     This interface does not include some events that one might expect in an interface with
 778     profiling support.  Some examples include full speed
 779     method enter and exit events.  The interface instead provides support for
 780     <i>bytecode instrumentation</i>, the ability to alter the Java virtual machine
 781     bytecode instructions which comprise the target program.  Typically, these alterations
 782     are to add "events" to the code of a method - for example, to add, at the beginning of a method,
 783     a call to <code>MyProfiler.methodEntered()</code>.
 784     Since the changes are purely additive, they do not modify application
 785     state or behavior.
 786     Because the inserted agent code is standard bytecodes, the VM can run at full speed,
 787     optimizing not only the target program but also the instrumentation.  If the
 788     instrumentation does not involve switching from bytecode execution, no expensive
 789     state transitions are needed.  The result is high performance events.
 790     This approach also provides complete control to the agent: instrumentation can be
 791     restricted to "interesting" portions of the code (e.g., the end user's code) and
 792     can be conditional.  Instrumentation can run entirely in Java programming language
 793     code or can call into the native agent.  Instrumentation can simply maintain
 794     counters or can statistically sample events.
 795     <p/>
 796     Instrumentation can be inserted in one of three ways:
 797     <ul>
 798       <li>
 799         Static Instrumentation: The class file is instrumented before it
 800         is loaded into the VM - for example, by creating a duplicate directory of
 801         <code>*.class</code> files which have been modified to add the instrumentation.
 802         This method is extremely awkward and, in general, an agent cannot know
 803         the origin of the class files which will be loaded.
 804       </li>
 805       <li>
 806         Load-Time Instrumentation: When a class file is loaded by the VM, the raw
 807         bytes of the class file are sent for instrumentation to the agent.
 808         The <eventlink id="ClassFileLoadHook"/>
 809         event, triggered by the class load,
 810         provides this functionality.  This mechanism provides efficient
 811         and complete access to one-time instrumentation.
 812       </li>
 813       <li>
 814         Dynamic Instrumentation: A class which is already loaded (and possibly
 815         even running) is modified.  This optional feature is provided by the
 816         <eventlink id="ClassFileLoadHook"/> event, triggered by calling the
 817         <functionlink id="RetransformClasses"/> function.
 818         Classes can be modified multiple times and can be returned to their
 819         original state.
 820         The mechanism allows instrumentation which changes during the
 821         course of execution.
 822       </li>
 823     </ul>
 824     <p/>
 825     The class modification functionality provided in this interface
 826     is intended to provide a mechanism for instrumentation
 827     (the <eventlink id="ClassFileLoadHook"/> event
 828     and the <functionlink id="RetransformClasses"/> function)
 829     and, during development, for fix-and-continue debugging
 830     (the <functionlink id="RedefineClasses"/> function).
 831     <p/>
 832     Care must be taken to avoid perturbing dependencies, especially when
 833     instrumenting core classes.  For example, an approach to getting notification
 834     of every object allocation is to instrument the constructor on
 835     <code>Object</code>.  Assuming that the constructor is initially
 836     empty, the constructor could be changed to:
 837     <example>
 838       public Object() {
 839         MyProfiler.allocationTracker(this);
 840       }
 841     </example>
 842     However, if this change was made using the
 843     <eventlink id="ClassFileLoadHook"/>
 844     event then this might impact a typical VM as follows:
 845     the first created object will call the constructor causing a class load of
 846     <code>MyProfiler</code>; which will then cause
 847     object creation, and since <code>MyProfiler</code> isn't loaded yet,
 848     infinite recursion; resulting in a stack overflow.  A refinement of this
 849     would be to delay invoking the tracking method until a safe time.  For
 850     example, <code>trackAllocations</code> could be set in the
 851     handler for the <code>VMInit</code> event.
 852     <example>
 853       static boolean trackAllocations = false;
 854 
 855       public Object() {
 856         if (trackAllocations) {
 857           MyProfiler.allocationTracker(this);
 858         }
 859       }
 860     </example>
 861     <p/>
 862     The <functionlink id="SetNativeMethodPrefix"/> allows native methods
 863     to be instrumented by the use of wrapper methods.
 864   </intro>
 865 
 866 <intro id="bcimodules" label="Bytecode Instrumentation of code in modules">
 867   Agents can use the functions <functionlink id="AddModuleReads"/>,
 868   <functionlink id="AddModuleExports"/>, <functionlink id="AddModuleOpens"/>,
 869   <functionlink id="AddModuleUses"/> and <functionlink id="AddModuleProvides"/>
 870   to update a module to expand the set of modules that it reads, the set of
 871   packages that it exports or opens to other modules, or the services that it
 872   uses and provides.
 873   <p/>
 874   As an aid to agents that deploy supporting classes on the search path of
 875   the bootstrap class loader, or the search path of the class loader that
 876   loads the main class, the Java virtual machine arranges for the module
 877   of classes transformed by the <eventlink id="ClassFileLoadHook"/> event to
 878   read the unnamed module of both class loaders.
 879 </intro>
 880 
 881   <intro id="mUTF" label="Modified UTF-8 String Encoding">
 882     <jvmti/> uses modified UTF-8 to encode character strings.
 883     This is the same encoding used by JNI.
 884     Modified UTF-8 differs
 885     from standard UTF-8 in the representation of supplementary characters
 886     and of the null character. See the
 887     <externallink id="jni/types.html#modified-utf-8-strings">
 888       Modified UTF-8 Strings</externallink>
 889     section of the JNI specification for details.
 890   </intro>
 891 
 892   <intro id="context" label="Specification Context">
 893     Since this interface provides access to the state of applications running in the
 894     Java virtual machine;
 895     terminology refers to the Java platform and not the native
 896     platform (unless stated otherwise).  For example:
 897     <ul>
 898       <li>"thread" means Java programming language thread.</li>
 899       <li>"stack frame" means Java virtual machine stack frame.</li>
 900       <li>"class" means Java programming language class.</li>
 901       <li>"heap" means Java virtual machine heap.</li>
 902       <li>"monitor" means Java programming language object monitor.</li>
 903     </ul>
 904     <p/>
 905     Sun, Sun Microsystems, the Sun logo, Java, and JVM
 906     are trademarks or registered trademarks of Oracle
 907     and/or its affiliates, in the U.S. and other countries.
 908   </intro>
 909 
 910 
 911 <functionsection label="Functions">
 912   <intro id="jvmtiEnvAccess" label="Accessing Functions">
 913     Native code accesses <jvmti/> features
 914     by calling <jvmti/> functions.
 915     Access to <jvmti/> functions is by use of an interface pointer
 916     in the same manner as
 917     <externallink id="jni/design.html">Java
 918       Native Interface (JNI) functions</externallink> are accessed.
 919     The <jvmti/> interface pointer is called the
 920     <i>environment pointer</i>.
 921     <p/>
 922     An environment pointer is a pointer to an environment and has
 923     the type <code>jvmtiEnv*</code>.
 924     An environment has information about its <jvmti/> connection.
 925     The first value in the environment is a pointer to the function table.
 926     The function table is an array of pointers to <jvmti/> functions.
 927     Every function pointer is at a predefined offset inside the
 928     array.
 929     <p/>
 930     When used from the C language:
 931     double indirection is used to access the functions;
 932     the environment pointer provides context and is the first
 933     parameter of each function call; for example:
 934     <example>
 935 jvmtiEnv *jvmti;
 936 ...
 937 jvmtiError err = (*jvmti)->GetLoadedClasses(jvmti, &amp;class_count, &amp;classes);
 938     </example>
 939     <p/>
 940     When used from the C++ language:
 941     functions are accessed as member functions of <code>jvmtiEnv</code>;
 942     the environment pointer is not passed to the function call; for example:
 943     <example>
 944 jvmtiEnv *jvmti;
 945 ...
 946 jvmtiError err = jvmti->GetLoadedClasses(&amp;class_count, &amp;classes);
 947     </example>
 948     Unless otherwise stated, all examples and declarations in this
 949     specification use the C language.
 950     <p/>
 951     A <jvmti/> environment can be obtained through the JNI Invocation API
 952     <code>GetEnv</code> function:
 953     <example>
 954 jvmtiEnv *jvmti;
 955 ...
 956 (*jvm)->GetEnv(jvm, &amp;jvmti, JVMTI_VERSION_1_0);
 957     </example>
 958     Each call to <code>GetEnv</code>
 959     creates a new <jvmti/> connection and thus
 960     a new <jvmti/> environment.
 961     The <code>version</code> argument of <code>GetEnv</code> must be
 962     a <jvmti/> version.
 963     The returned environment may have a different version than the
 964     requested version but the returned environment must be compatible.
 965     <code>GetEnv</code> will return <code>JNI_EVERSION</code> if a
 966     compatible version is not available, if <jvmti/> is not supported or
 967     <jvmti/> is not supported in the current VM configuration.
 968     Other interfaces may be added for creating <jvmti/> environments
 969     in specific contexts.
 970     Each environment has its own state (for example,
 971     <functionlink id="SetEventNotificationMode">desired events</functionlink>,
 972     <functionlink id="SetEventCallbacks">event handling functions</functionlink>, and
 973     <functionlink id="AddCapabilities">capabilities</functionlink>).
 974     An environment is released with
 975     <functionlink id="DisposeEnvironment"></functionlink>.
 976     Thus, unlike JNI which has one environment per thread, <jvmti/> environments work
 977     across threads and are created dynamically.
 978   </intro>
 979 
 980   <intro id="functionReturn" label="Function Return Values">
 981     <jvmti/> functions always return an
 982     <internallink id="ErrorSection">error code</internallink> via the
 983     <datalink id="jvmtiError"/> function return value.
 984     Some functions can return additional
 985     values through pointers provided by the calling function.
 986     In some cases, <jvmti/> functions allocate memory that your program must
 987     explicitly deallocate. This is indicated in the individual <jvmti/>
 988     function descriptions.  Empty lists, arrays, sequences, etc are
 989     returned as <code>NULL</code>.
 990     <p/>
 991     In the event that the <jvmti/> function encounters
 992     an error (any return value other than <code>JVMTI_ERROR_NONE</code>) the values
 993     of memory referenced by argument pointers is undefined, but no memory
 994     will have been allocated and no global references will have been allocated.
 995     If the error occurs because of invalid input, no action will have occurred.
 996   </intro>
 997 
 998 <intro id="refs" label="Managing JNI Object References">
 999     <jvmti/> functions identify objects with JNI references
1000     (<datalink id="jobject"/> and <datalink id="jclass"/>)
1001     and their derivatives
1002     (<datalink id="jthread"/> and <datalink id="jthreadGroup"/>).
1003     References passed to
1004     <jvmti/> functions can be either global or local, but they must be
1005     strong references. All references returned by <jvmti/> functions are
1006     local references--these local references are created
1007     during the <jvmti/> call.
1008     Local references are a resource that must be managed (see the
1009     <externallink id="jni/functions.html#local-references">
1010       JNI Documentation</externallink>).
1011     When threads return from native code all local references
1012     are freed.  Note that some threads, including typical
1013     agent threads, will never return from native code.
1014     A thread is ensured the ability to create sixteen local
1015     references without the need for any explicit management.
1016     For threads executing a limited number of <jvmti/> calls before
1017     returning from native code
1018     (for example, threads processing events),
1019     it may be determined that no explicit management
1020     is needed.
1021     However, long running agent threads will need explicit
1022     local reference management--usually with the JNI functions
1023     <code>PushLocalFrame</code> and <code>PopLocalFrame</code>.
1024     Conversely, to preserve references beyond the
1025     return from native code, they must be converted to global references.
1026     These rules do not apply to <datalink id="jmethodID"/> and <datalink id="jfieldID"/>
1027     as they are not <datalink id="jobject"/>s.
1028 </intro>
1029 
1030     <intro id="prereqState" label="Prerequisite State for Calling Functions">
1031       Unless the function explicitly states that the agent must bring
1032       a thread or the VM to a particular state (for example, suspended),
1033       the <jvmti/> implementation is responsible for bringing the VM to a
1034       safe and consistent state for performing the function.
1035     </intro>
1036 
1037     <intro id="functionsExceptions" label="Exceptions and Functions">
1038       <jvmti/> functions never throw exceptions; error conditions are
1039       communicated via the
1040       <internallink id="functionReturn">function return value</internallink>.
1041       Any existing exception state is preserved across a call to a
1042       <jvmti/> function.
1043       See the
1044       <externallink
1045         id="jni/design.html#java-exceptions"
1046              >Java Exceptions</externallink>
1047       section of the JNI specification for information on handling exceptions.
1048     </intro>
1049 
1050   <category id="memory" label="Memory Management">
1051     <intro>
1052       These functions provide for the allocation and deallocation of
1053       memory used by <jvmti/> functionality and can be used to provide
1054       working memory for agents.
1055       Memory managed by <jvmti/> is not compatible with other memory
1056       allocation libraries and mechanisms.
1057     </intro>
1058 
1059     <function id="Allocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="46">
1060       <synopsis>Allocate</synopsis>
1061       <description>
1062         Allocate an area of memory through the <jvmti/> allocator.
1063         The allocated
1064         memory should be freed with <functionlink id="Deallocate"></functionlink>.
1065       </description>
1066       <origin>jvmdi</origin>
1067       <capabilities>
1068       </capabilities>
1069       <parameters>
1070         <param id="size">
1071           <jlong/>
1072           <description>
1073             The number of bytes to allocate.
1074             <rationale>
1075               <code>jlong</code> is used for compatibility with JVMDI.
1076             </rationale>
1077           </description>
1078         </param>
1079         <param id="mem_ptr">
1080           <allocbuf incount="size"><uchar/></allocbuf>
1081           <description>
1082             On return, a pointer to the beginning of the allocated memory.
1083             If <code>size</code> is zero, <code>NULL</code> is returned.
1084           </description>
1085         </param>
1086       </parameters>
1087       <errors>
1088         <error id="JVMTI_ERROR_OUT_OF_MEMORY">
1089           Memory request cannot be honored.
1090         </error>
1091         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
1092           <paramlink id="size"></paramlink> is less than zero.
1093         </error>
1094       </errors>
1095     </function>
1096 
1097     <function id="Deallocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="47">
1098       <synopsis>Deallocate</synopsis>
1099       <description>
1100         Deallocate <code>mem</code>  using the <jvmti/> allocator.
1101         This function should
1102         be used to deallocate any memory allocated and returned
1103         by a <jvmti/> function
1104         (including memory allocated with <functionlink id="Allocate"></functionlink>).
1105         All allocated memory must be deallocated
1106         or the memory cannot be reclaimed.
1107       </description>
1108       <origin>jvmdi</origin>
1109       <capabilities>
1110       </capabilities>
1111       <parameters>
1112         <param id="mem">
1113           <outbuf>
1114             <uchar/>
1115             <nullok>the call is ignored</nullok>
1116           </outbuf>
1117           <description>
1118             A pointer to the beginning of the allocated memory.
1119             Please ignore "On return, the elements are set."
1120               <todo>keep it from generating "On return, the elements are set"</todo>
1121           </description>
1122         </param>
1123       </parameters>
1124       <errors>
1125       </errors>
1126     </function>
1127   </category>
1128 
1129   <category id="threadCategory" label="Thread">
1130     <intro>
1131     </intro>
1132 
1133     <function id="GetThreadState" num="17">
1134       <synopsis>Get Thread State</synopsis>
1135       <description>
1136         Get the state of a thread.  The state of the thread is represented by the
1137         answers to the hierarchical set of questions below:
1138           <ul type="circle">
1139             <li><i>Alive?</i>
1140               <ul>
1141                 <li>Not alive.
1142                   <ul type="circle">
1143                     <li><i>Why not alive?</i>
1144                       <ul>
1145                         <li>New.</li>
1146                         <li>Terminated (<datalink
1147                             id="JVMTI_THREAD_STATE_TERMINATED"><code>JVMTI_THREAD_STATE_TERMINATED</code></datalink>)</li>
1148                       </ul>
1149                     </li>
1150                   </ul>
1151                 </li>
1152                 <li>Alive (<datalink
1153                     id="JVMTI_THREAD_STATE_ALIVE"><code>JVMTI_THREAD_STATE_ALIVE</code></datalink>)
1154                   <ul type="circle">
1155                     <li><i>Suspended?</i>
1156                       <ul>
1157                         <li>Suspended (<datalink
1158                             id="JVMTI_THREAD_STATE_SUSPENDED"><code>JVMTI_THREAD_STATE_SUSPENDED</code></datalink>)</li>
1159                         <li>Not suspended</li>
1160                       </ul>
1161                     </li>
1162                     <li><i>Interrupted?</i>
1163                       <ul>
1164                         <li>Interrupted (<datalink
1165                             id="JVMTI_THREAD_STATE_INTERRUPTED"><code>JVMTI_THREAD_STATE_INTERRUPTED</code></datalink>)</li>
1166                         <li>Not interrupted.</li>
1167                       </ul>
1168                     </li>
1169                     <li><i>In native?</i>
1170                       <ul>
1171                         <li>In native code (<datalink
1172                             id="JVMTI_THREAD_STATE_IN_NATIVE"><code>JVMTI_THREAD_STATE_IN_NATIVE</code></datalink>)</li>
1173                         <li>In Java programming language code</li>
1174                       </ul>
1175                     </li>
1176                     <li><i>What alive state?</i>
1177                       <ul>
1178                         <li>Runnable (<datalink
1179                             id="JVMTI_THREAD_STATE_RUNNABLE"><code>JVMTI_THREAD_STATE_RUNNABLE</code></datalink>)</li>
1180                         <li>Blocked (<datalink
1181                             id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER"><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></datalink>)</li>
1182                         <li>Waiting (<datalink
1183                             id="JVMTI_THREAD_STATE_WAITING"><code>JVMTI_THREAD_STATE_WAITING</code></datalink>)
1184                           <ul type="circle">
1185                             <li><i>Timed wait?</i>
1186                               <ul>
1187                                 <li>Indefinite (<datalink
1188                                     id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY"><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></datalink></li>
1189                                 <li>Timed (<datalink
1190                                     id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT"><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></datalink>)</li>
1191                               </ul>
1192                             </li>
1193                             <li><i>Why waiting?</i>
1194                               <ul>
1195                                 <li>Object.wait (<datalink
1196                                     id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT"><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></datalink>)</li>
1197                                 <li>LockSupport.park (<datalink
1198                                     id="JVMTI_THREAD_STATE_PARKED"><code>JVMTI_THREAD_STATE_PARKED</code></datalink>)</li>
1199                                 <li>Sleeping (<datalink
1200                                     id="JVMTI_THREAD_STATE_SLEEPING"><code>JVMTI_THREAD_STATE_SLEEPING</code></datalink>)</li>
1201                               </ul>
1202                             </li>
1203                           </ul>
1204                         </li>
1205                       </ul>
1206                     </li>
1207                   </ul>
1208                 </li>
1209               </ul>
1210             </li>
1211           </ul>
1212         <p/>
1213         The answers are represented by the following bit vector.
1214         <constants id="jvmtiThreadState" label="Thread State Flags" kind="bits">
1215           <constant id="JVMTI_THREAD_STATE_ALIVE" num="0x0001">
1216             Thread is alive. Zero if thread is new (not started) or terminated.
1217           </constant>
1218           <constant id="JVMTI_THREAD_STATE_TERMINATED" num="0x0002">
1219             Thread has completed execution.
1220           </constant>
1221           <constant id="JVMTI_THREAD_STATE_RUNNABLE" num="0x0004">
1222             Thread is runnable.
1223           </constant>
1224           <constant id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER" num="0x0400">
1225             Thread is waiting to enter a synchronization block/method or,
1226             after an <code>Object.wait()</code>, waiting to re-enter a
1227             synchronization block/method.
1228           </constant>
1229           <constant id="JVMTI_THREAD_STATE_WAITING" num="0x0080">
1230             Thread is waiting.
1231           </constant>
1232           <constant id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY" num="0x0010">
1233             Thread is waiting without a timeout.
1234             For example, <code>Object.wait()</code>.
1235           </constant>
1236           <constant id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT" num="0x0020">
1237             Thread is waiting with a maximum time to wait specified.
1238             For example, <code>Object.wait(long)</code>.
1239           </constant>
1240           <constant id="JVMTI_THREAD_STATE_SLEEPING" num="0x0040">
1241             Thread is sleeping -- <code>Thread.sleep(long)</code>.
1242           </constant>
1243           <constant id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT" num="0x0100">
1244             Thread is waiting on an object monitor -- <code>Object.wait</code>.
1245           </constant>
1246           <constant id="JVMTI_THREAD_STATE_PARKED" num="0x0200">
1247             Thread is parked, for example: <code>LockSupport.park</code>,
1248             <code>LockSupport.parkUtil</code> and <code>LockSupport.parkNanos</code>.
1249           </constant>
1250           <constant id="JVMTI_THREAD_STATE_SUSPENDED" num="0x100000">
1251             Thread suspended.
1252             <code>java.lang.Thread.suspend()</code>
1253             or a <jvmti/> suspend function
1254             (such as <functionlink id="SuspendThread"></functionlink>)
1255             has been called on the thread. If this bit
1256             is set, the other bits refer to the thread state before suspension.
1257           </constant>
1258           <constant id="JVMTI_THREAD_STATE_INTERRUPTED" num="0x200000">
1259             Thread has been interrupted.
1260           </constant>
1261           <constant id="JVMTI_THREAD_STATE_IN_NATIVE" num="0x400000">
1262             Thread is in native code--that is, a native method is running
1263             which has not called back into the VM or Java programming
1264             language code.
1265             <p/>
1266             This flag is not set when running VM compiled Java programming
1267             language code nor is it set when running VM code or
1268             VM support code. Native VM interface functions, such as JNI and
1269             <jvmti/> functions, may be implemented as VM code.
1270           </constant>
1271           <constant id="JVMTI_THREAD_STATE_VENDOR_1" num="0x10000000">
1272             Defined by VM vendor.
1273           </constant>
1274           <constant id="JVMTI_THREAD_STATE_VENDOR_2" num="0x20000000">
1275             Defined by VM vendor.
1276           </constant>
1277           <constant id="JVMTI_THREAD_STATE_VENDOR_3" num="0x40000000">
1278             Defined by VM vendor.
1279           </constant>
1280         </constants>
1281         The following definitions are used to convert <jvmti/> thread state
1282         to <code>java.lang.Thread.State</code> style states.
1283         <constants id="jvmtiJavaLangThreadState" label="java.lang.Thread.State Conversion Masks" kind="bits">
1284           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_MASK"
1285                      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">
1286             Mask the state with this before comparison
1287           </constant>
1288           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_NEW"
1289                      num="0">
1290             <code>java.lang.Thread.State.NEW</code>
1291           </constant>
1292           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED"
1293                      num="JVMTI_THREAD_STATE_TERMINATED">
1294             <code>java.lang.Thread.State.TERMINATED</code>
1295           </constant>
1296           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE"
1297                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE">
1298             <code>java.lang.Thread.State.RUNNABLE</code>
1299           </constant>
1300           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED"
1301                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER">
1302             <code>java.lang.Thread.State.BLOCKED</code>
1303           </constant>
1304           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_WAITING"
1305                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY">
1306             <code>java.lang.Thread.State.WAITING</code>
1307           </constant>
1308           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING"
1309                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT">
1310             <code>java.lang.Thread.State.TIMED_WAITING</code>
1311           </constant>
1312         </constants>
1313         <b>Rules</b>
1314         <p/>
1315         There can be no more than one answer to a question, although there can be no
1316         answer (because the answer is unknown, does not apply, or none of the answers is
1317         correct).  An answer is set only when the enclosing answers match.
1318         That is, no more than one of
1319           <ul type="circle">
1320               <li><code>JVMTI_THREAD_STATE_RUNNABLE</code></li>
1321               <li><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></li>
1322               <li><code>JVMTI_THREAD_STATE_WAITING</code></li>
1323           </ul>
1324         can be set (a <tm>J2SE</tm> compliant implementation will always set
1325         one of these if <code>JVMTI_THREAD_STATE_ALIVE</code> is set).
1326         And if any of these are set, the enclosing answer
1327         <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1328         No more than one of
1329           <ul type="circle">
1330               <li><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></li>
1331               <li><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></li>
1332           </ul>
1333         can be set (a <tm>J2SE</tm> compliant implementation will always set
1334         one of these if <code>JVMTI_THREAD_STATE_WAITING</code> is set).
1335         And if either is set, the enclosing answers
1336         <code>JVMTI_THREAD_STATE_ALIVE</code> and
1337         <code>JVMTI_THREAD_STATE_WAITING</code> are set.
1338         No more than one of
1339           <ul type="circle">
1340               <li><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></li>
1341               <li><code>JVMTI_THREAD_STATE_PARKED</code></li>
1342               <li><code>JVMTI_THREAD_STATE_SLEEPING</code></li>
1343           </ul>
1344         can be set. And if any of these is set, the enclosing answers
1345         <code>JVMTI_THREAD_STATE_ALIVE</code> and
1346         <code>JVMTI_THREAD_STATE_WAITING</code> are set.
1347         Also, if <code>JVMTI_THREAD_STATE_SLEEPING</code> is set,
1348         then <code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code> is set.
1349         If a state <i>A</i> is implemented using the mechanism of
1350         state <i>B</i> then it is state <i>A</i> which
1351         is returned by this function.
1352         For example, if <code>Thread.sleep(long)</code>
1353         is implemented using <code>Object.wait(long)</code>
1354         then it is still <code>JVMTI_THREAD_STATE_SLEEPING</code>
1355         which is returned.
1356         More than one of
1357           <ul type="circle">
1358               <li><code>JVMTI_THREAD_STATE_SUSPENDED</code></li>
1359               <li><code>JVMTI_THREAD_STATE_INTERRUPTED</code></li>
1360               <li><code>JVMTI_THREAD_STATE_IN_NATIVE</code></li>
1361           </ul>
1362         can be set, but if any is set,
1363         <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1364         <p/>
1365         And finally,
1366         <code>JVMTI_THREAD_STATE_TERMINATED</code> cannot be set unless
1367         <code>JVMTI_THREAD_STATE_ALIVE</code> is not set.
1368         <p/>
1369         The thread state representation is designed for extension in future versions
1370         of the specification; thread state values should be used accordingly, that is
1371         they should not be used as ordinals.
1372         Most queries can be made by testing a single bit, if use in a switch statement is desired,
1373         the state bits should be masked with the interesting bits.
1374         All bits not defined above are reserved for future use.
1375         A VM, compliant to the current specification, must set reserved bits to zero.
1376         An agent should ignore reserved bits --
1377         they should not be assumed to be zero and thus should not be included in comparisons.
1378         <p/>
1379         <b>Examples</b>
1380         <p/>
1381         Note that the values below exclude reserved and vendor bits.
1382         <p/>
1383         The state of a thread blocked at a <code>synchronized</code>-statement would be:
1384         <example>
1385             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER
1386         </example>
1387         The state of a thread which hasn't started yet would be:
1388         <example>
1389             0
1390         </example>
1391         The state of a thread at a <code>Object.wait(3000)</code> would be:
1392         <example>
1393             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_WAITING +
1394                 JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
1395                 JVMTI_THREAD_STATE_MONITOR_WAITING
1396         </example>
1397         The state of a thread suspended while runnable would be:
1398         <example>
1399             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_RUNNABLE + JVMTI_THREAD_STATE_SUSPENDED
1400         </example>
1401         <p/>
1402         <b>Testing the State</b>
1403         <p/>
1404         In most cases, the thread state can be determined by testing the one bit corresponding
1405         to that question.  For example, the code to test if a thread is sleeping:
1406         <example>
1407         jint state;
1408         jvmtiError err;
1409 
1410         err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1411         if (err == JVMTI_ERROR_NONE) {
1412            if (state &amp; JVMTI_THREAD_STATE_SLEEPING) {  ...
1413         </example>
1414         <p/>
1415         For waiting (that is, in <code>Object.wait</code>, parked, or sleeping) it would be:
1416         <example>
1417            if (state &amp; JVMTI_THREAD_STATE_WAITING) {  ...
1418         </example>
1419         For some states, more than one bit will need to be tested as is the case
1420         when testing if a thread has not yet been started:
1421         <example>
1422            if ((state &amp; (JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_TERMINATED)) == 0)  {  ...
1423         </example>
1424         To distinguish timed from untimed <code>Object.wait</code>:
1425         <example>
1426            if (state &amp; JVMTI_THREAD_STATE_IN_OBJECT_WAIT)  {
1427              if (state &amp; JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)  {
1428                printf("in Object.wait(long timeout)\n");
1429              } else {
1430                printf("in Object.wait()\n");
1431              }
1432            }
1433         </example>
1434         <p/>
1435         <b>Relationship to <code>java.lang.Thread.State</code></b>
1436         <p/>
1437         The thread state represented by <code>java.lang.Thread.State</code>
1438         returned from <code>java.lang.Thread.getState()</code> is a subset of the
1439         information returned from this function.
1440         The corresponding <code>java.lang.Thread.State</code> can be determined
1441         by using the provided conversion masks.
1442         For example, this returns the name of the <code>java.lang.Thread.State</code> thread state:
1443         <example>
1444             err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1445             abortOnError(err);
1446             switch (state &amp; JVMTI_JAVA_LANG_THREAD_STATE_MASK) {
1447             case JVMTI_JAVA_LANG_THREAD_STATE_NEW:
1448               return "NEW";
1449             case JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED:
1450               return "TERMINATED";
1451             case JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE:
1452               return "RUNNABLE";
1453             case JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED:
1454               return "BLOCKED";
1455             case JVMTI_JAVA_LANG_THREAD_STATE_WAITING:
1456               return "WAITING";
1457             case JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING:
1458               return "TIMED_WAITING";
1459             }
1460         </example>
1461       </description>
1462       <origin>new</origin>
1463       <capabilities>
1464       </capabilities>
1465       <parameters>
1466         <param id="thread">
1467           <jthread null="current" started="maybe" impl="noconvert"/>
1468             <description>
1469               The thread to query.
1470             </description>
1471         </param>
1472         <param id="thread_state_ptr">
1473           <outptr><jint/></outptr>
1474           <description>
1475             On return, points to state flags,
1476             as defined by the <internallink id="jvmtiThreadState">Thread State Flags</internallink>.
1477           </description>
1478         </param>
1479       </parameters>
1480       <errors>
1481       </errors>
1482     </function>
1483 
1484     <function id="GetCurrentThread" phase="start" num="18" since="1.1">
1485       <synopsis>Get Current Thread</synopsis>
1486       <description>
1487         Get the current thread.
1488         The current thread is the Java programming language thread which has called the function.
1489         The function may return <code>NULL</code> in the start phase if the
1490         <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
1491         <code>can_generate_early_vmstart</code></internallink> capability is enabled
1492         and the <code>java.lang.Thread</code> class has not been initialized yet.
1493         <p/>
1494         Note that most <jvmti/> functions that take a thread
1495         as an argument will accept <code>NULL</code> to mean
1496         the current thread.
1497       </description>
1498       <origin>new</origin>
1499       <capabilities>
1500       </capabilities>
1501       <parameters>
1502         <param id="thread_ptr">
1503           <outptr><jthread/></outptr>
1504           <description>
1505              On return, points to the current thread, or <code>NULL</code>.
1506           </description>
1507         </param>
1508       </parameters>
1509       <errors>
1510       </errors>
1511     </function>
1512 
1513     <function id="GetAllThreads" num="4">
1514       <synopsis>Get All Threads</synopsis>
1515       <description>
1516         Get all live threads.
1517         The threads are Java programming language threads;
1518         that is, threads that are attached to the VM.
1519         A thread is live if <code>java.lang.Thread.isAlive()</code>
1520         would return <code>true</code>, that is, the thread has
1521         been started and has not yet died.
1522         The universe of threads is determined by the context of the <jvmti/>
1523         environment, which typically is all threads attached to the VM.
1524         Note that this includes <jvmti/> agent threads
1525         (see <functionlink id="RunAgentThread"/>).
1526       </description>
1527       <origin>jvmdi</origin>
1528       <capabilities>
1529       </capabilities>
1530       <parameters>
1531         <param id="threads_count_ptr">
1532           <outptr><jint/></outptr>
1533           <description>
1534             On return, points to the number of running threads.
1535           </description>
1536         </param>
1537         <param id="threads_ptr">
1538           <allocbuf outcount="threads_count_ptr"><jthread/></allocbuf>
1539             <description>
1540               On return, points to an array of references, one
1541               for each running thread.
1542             </description>
1543         </param>
1544       </parameters>
1545       <errors>
1546       </errors>
1547     </function>
1548 
1549     <function id="SuspendThread" num="5">
1550       <synopsis>Suspend Thread</synopsis>
1551       <description>
1552         Suspend the specified thread. If the calling thread is specified,
1553         this function will not return until some other thread calls
1554         <functionlink id="ResumeThread"></functionlink>.
1555         If the thread is currently suspended, this function
1556         does nothing and returns an error.
1557       </description>
1558       <origin>jvmdi</origin>
1559       <capabilities>
1560         <required id="can_suspend"></required>
1561       </capabilities>
1562       <parameters>
1563         <param id="thread">
1564           <jthread null="current"/>
1565             <description>
1566               The thread to suspend.
1567             </description>
1568         </param>
1569       </parameters>
1570       <errors>
1571         <error id="JVMTI_ERROR_THREAD_SUSPENDED">
1572           Thread already suspended.
1573         </error>
1574       </errors>
1575     </function>
1576 
1577     <elide>
1578     <function id="SuspendAllThreads" num="101">
1579       <synopsis>Suspend All Threads</synopsis>
1580       <description>
1581         <issue>
1582             There has been no explicit call for this function, and it will
1583             thus be removed if there is no interest.
1584         </issue>
1585         Suspend all live threads except:
1586         <ul>
1587           <li>already suspended threads</li>
1588           <li>those listed in <paramlink id="except_list"></paramlink></li>
1589           <li>certain system (non application) threads, as determined
1590             by the VM implementation</li>
1591         </ul>
1592         The threads are Java programming language threads;
1593         native threads which are not attached to the VM are not
1594         Java programming language threads.
1595         A thread is live if <code>java.lang.Thread.isAlive()</code>
1596         would return <code>true</code>, that is, the thread has
1597         been started and has not yet died.
1598         The universe of threads is determined
1599         by the context of the <jvmti/>
1600         environment, which, typically, is all threads attached to the VM,
1601         except critical VM internal threads and <jvmti/> agent threads
1602         (see <functionlink id="RunAgentThread"/>).
1603         <p/>
1604         If the calling thread is specified,
1605         all other threads are suspended first then the caller thread is suspended -
1606         this function will not return until some other thread calls
1607         <functionlink id="ResumeThread"></functionlink>.
1608         <p/>
1609         The list of actually
1610         suspended threads is returned in
1611         <paramlink id="suspended_list_ptr"></paramlink>.
1612         Suspension is as defined in <functionlink id="SuspendThread"></functionlink>.
1613         <functionlink id="ResumeThreadList"></functionlink>
1614         can be used to resume the suspended threads.
1615       </description>
1616       <origin>new</origin>
1617       <capabilities>
1618         <required id="can_suspend"></required>
1619       </capabilities>
1620       <parameters>
1621         <param id="except_count">
1622           <jint min="0"/>
1623           <description>
1624             The number of threads in the list of threads not to be suspended.
1625           </description>
1626         </param>
1627         <param id="except_list">
1628             <inbuf incount="except_count">
1629               <jthread/>
1630               <nullok>not an error if <code>except_count == 0</code></nullok>
1631             </inbuf>
1632             <description>
1633               The list of threads not to be suspended.
1634             </description>
1635         </param>
1636         <param id="suspended_count_ptr">
1637           <outptr><jint/></outptr>
1638           <description>
1639             On return, points to the number of threads suspended by this call.
1640           </description>
1641         </param>
1642         <param id="suspended_list_ptr">
1643           <allocbuf outcount="suspended_count_ptr"><jthread/></allocbuf>
1644             <description>
1645               On return, points to an array of references, one
1646               for each thread suspended.
1647             </description>
1648         </param>
1649       </parameters>
1650       <errors>
1651         <error id="JVMTI_ERROR_INVALID_THREAD">
1652           A thread in <paramlink id="except_list"></paramlink> was invalid.
1653         </error>
1654         <error id="JVMTI_ERROR_NULL_POINTER">
1655           Both <paramlink id="except_list"></paramlink> was <code>NULL</code>
1656           and <paramlink id="except_count"></paramlink> was non-zero.
1657         </error>
1658       </errors>
1659     </function>
1660     </elide>
1661 
1662     <function id="SuspendThreadList" num="92">
1663       <synopsis>Suspend Thread List</synopsis>
1664       <description>
1665         Suspend the <paramlink id="request_count"></paramlink>
1666         threads specified in the
1667         <paramlink id="request_list"></paramlink> array.
1668         Threads may be resumed with
1669         <functionlink id="ResumeThreadList"></functionlink> or
1670         <functionlink id="ResumeThread"></functionlink>.
1671         If the calling thread is specified in the
1672         <paramlink id="request_list"></paramlink> array, this function will
1673         not return until some other thread resumes it.
1674         Errors encountered in the suspension of a thread
1675         are returned in the <paramlink id="results"></paramlink>
1676         array, <b>not</b> in the return value of this function.
1677         Threads that are currently suspended do not change state.
1678       </description>
1679       <origin>jvmdi</origin>
1680       <capabilities>
1681         <required id="can_suspend"></required>
1682       </capabilities>
1683       <parameters>
1684         <param id="request_count">
1685           <jint min="0"/>
1686           <description>
1687             The number of threads to suspend.
1688           </description>
1689         </param>
1690         <param id="request_list">
1691           <inbuf incount="request_count"><jthread/></inbuf>
1692             <description>
1693               The list of threads to suspend.
1694             </description>
1695         </param>
1696         <param id="results">
1697           <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1698           <description>
1699             An agent supplied array of
1700             <paramlink id="request_count"></paramlink> elements.
1701             On return, filled with the error code for
1702             the suspend of the corresponding thread.
1703             The error code will be
1704             <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1705             if the thread was suspended by this call.
1706             Possible error codes are those specified
1707             for <functionlink id="SuspendThread"></functionlink>.
1708           </description>
1709         </param>
1710       </parameters>
1711       <errors>
1712       </errors>
1713     </function>
1714 
1715     <function id="ResumeThread" num="6">
1716       <synopsis>Resume Thread</synopsis>
1717       <description>
1718         Resume a suspended thread.
1719         Any threads currently suspended through
1720         a <jvmti/> suspend function (eg.
1721         <functionlink id="SuspendThread"></functionlink>)
1722         or <code>java.lang.Thread.suspend()</code>
1723         will resume execution;
1724         all other threads are unaffected.
1725       </description>
1726       <origin>jvmdi</origin>
1727       <capabilities>
1728         <required id="can_suspend"></required>
1729       </capabilities>
1730       <parameters>
1731         <param id="thread">
1732           <jthread/>
1733             <description>
1734               The thread to resume.
1735             </description>
1736         </param>
1737       </parameters>
1738       <errors>
1739         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
1740           Thread was not suspended.
1741         </error>
1742         <error id="JVMTI_ERROR_INVALID_TYPESTATE">
1743           The state of the thread has been modified, and is now inconsistent.
1744         </error>
1745       </errors>
1746     </function>
1747 
1748     <function id="ResumeThreadList" num="93">
1749       <synopsis>Resume Thread List</synopsis>
1750       <description>
1751         Resume the <paramlink id="request_count"></paramlink>
1752         threads specified in the
1753         <paramlink id="request_list"></paramlink> array.
1754         Any thread suspended through
1755         a <jvmti/> suspend function (eg.
1756         <functionlink id="SuspendThreadList"></functionlink>)
1757         or <code>java.lang.Thread.suspend()</code>
1758         will resume execution.
1759       </description>
1760       <origin>jvmdi</origin>
1761       <capabilities>
1762         <required id="can_suspend"></required>
1763       </capabilities>
1764       <parameters>
1765         <param id="request_count">
1766           <jint min="0"/>
1767           <description>
1768             The number of threads to resume.
1769           </description>
1770         </param>
1771         <param id="request_list">
1772           <inbuf incount="request_count"><jthread/></inbuf>
1773             <description>
1774               The threads to resume.
1775             </description>
1776         </param>
1777         <param id="results">
1778           <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1779           <description>
1780             An agent supplied array of
1781             <paramlink id="request_count"></paramlink> elements.
1782             On return, filled with the error code for
1783             the resume of the corresponding thread.
1784             The error code will be
1785             <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1786             if the thread was suspended by this call.
1787             Possible error codes are those specified
1788             for <functionlink id="ResumeThread"></functionlink>.
1789           </description>
1790         </param>
1791       </parameters>
1792       <errors>
1793       </errors>
1794     </function>
1795 
1796     <function id="StopThread" num="7">
1797       <synopsis>Stop Thread</synopsis>
1798       <description>
1799         Send the specified asynchronous exception to the specified thread.
1800         Normally, this function is used to kill the specified thread with an
1801         instance of the exception <code>ThreadDeath</code>, similar to
1802         <code>java.lang.Thread.stop</code>.
1803       </description>
1804       <origin>jvmdi</origin>
1805       <capabilities>
1806         <required id="can_signal_thread"></required>
1807       </capabilities>
1808       <parameters>
1809         <param id="thread">
1810           <jthread/>
1811             <description>
1812               The thread to stop.
1813             </description>
1814         </param>
1815         <param id="exception">
1816           <jobject/>
1817             <description>
1818               The asynchronous exception object.
1819             </description>
1820         </param>
1821       </parameters>
1822       <errors>
1823       </errors>
1824     </function>
1825 
1826     <function id="InterruptThread" num="8">
1827       <synopsis>Interrupt Thread</synopsis>
1828       <description>
1829         Interrupt the specified thread
1830         (similar to <code>java.lang.Thread.interrupt</code>).
1831       </description>
1832       <origin>jvmdi</origin>
1833       <capabilities>
1834         <required id="can_signal_thread"></required>
1835       </capabilities>
1836       <parameters>
1837         <param id="thread">
1838           <jthread impl="noconvert"/>
1839             <description>
1840               The thread to interrupt.
1841             </description>
1842         </param>
1843       </parameters>
1844       <errors>
1845       </errors>
1846     </function>
1847 
1848     <function id="GetThreadInfo" num="9">
1849       <synopsis>Get Thread Info</synopsis>
1850       <typedef id="jvmtiThreadInfo" label="Thread information structure">
1851         <field id="name">
1852           <allocfieldbuf><char/></allocfieldbuf>
1853           <description>
1854             The thread name, encoded as a
1855             <internallink id="mUTF">modified UTF-8</internallink> string.
1856           </description>
1857         </field>
1858         <field id="priority">
1859           <jint/>
1860           <description>
1861             The thread priority.  See the thread priority constants:
1862             <datalink id="jvmtiThreadPriority"></datalink>.
1863           </description>
1864         </field>
1865         <field id="is_daemon">
1866           <jboolean/>
1867           <description>
1868             Is this a daemon thread?
1869           </description>
1870         </field>
1871         <field id="thread_group">
1872           <jthreadGroup/>
1873           <description>
1874             The thread group to which this thread belongs.
1875             <code>NULL</code> if the thread has died.
1876           </description>
1877         </field>
1878         <field id="context_class_loader">
1879           <jobject/>
1880             <description>
1881               The context class loader associated with this thread.
1882             </description>
1883         </field>
1884       </typedef>
1885       <description>
1886         Get thread information. The fields of the <datalink id="jvmtiThreadInfo"/> structure
1887         are filled in with details of the specified thread.
1888       </description>
1889       <origin>jvmdi</origin>
1890       <capabilities>
1891       </capabilities>
1892       <parameters>
1893         <param id="thread">
1894           <jthread null="current" impl="noconvert" started="maybe"/>
1895             <description>
1896               The thread to query.
1897             </description>
1898         </param>
1899         <param id="info_ptr">
1900           <outptr><struct>jvmtiThreadInfo</struct></outptr>
1901           <description>
1902             On return, filled with information describing the specified thread.
1903           </description>
1904         </param>
1905       </parameters>
1906       <errors>
1907       </errors>
1908     </function>
1909 
1910     <function id="GetOwnedMonitorInfo" num="10">
1911       <synopsis>Get Owned Monitor Info</synopsis>
1912       <description>
1913         Get information about the monitors owned by the
1914         specified thread.
1915       </description>
1916       <origin>jvmdiClone</origin>
1917       <capabilities>
1918         <required id="can_get_owned_monitor_info"></required>
1919       </capabilities>
1920       <parameters>
1921         <param id="thread">
1922           <jthread null="current"/>
1923             <description>
1924               The thread to query.
1925             </description>
1926         </param>
1927         <param id="owned_monitor_count_ptr">
1928           <outptr><jint/></outptr>
1929           <description>
1930             The number of monitors returned.
1931           </description>
1932         </param>
1933         <param id="owned_monitors_ptr">
1934           <allocbuf outcount="owned_monitor_count_ptr"><jobject/></allocbuf>
1935             <description>
1936               The array of owned monitors.
1937             </description>
1938         </param>
1939       </parameters>
1940       <errors>
1941       </errors>
1942     </function>
1943 
1944     <function id="GetOwnedMonitorStackDepthInfo" num="153" since="1.1">
1945       <synopsis>Get Owned Monitor Stack Depth Info</synopsis>
1946       <typedef id="jvmtiMonitorStackDepthInfo"
1947                label="Monitor stack depth information structure">
1948         <field id="monitor">
1949           <jobject/>
1950             <description>
1951               The owned monitor.
1952             </description>
1953         </field>
1954         <field id="stack_depth">
1955           <jint/>
1956           <description>
1957             The stack depth.  Corresponds to the stack depth used in the
1958             <internallink id="stack">Stack Frame functions</internallink>.
1959             That is, zero is the current frame, one is the frame which
1960             called the current frame. And it is negative one if the
1961             implementation cannot determine the stack depth (e.g., for
1962             monitors acquired by JNI <code>MonitorEnter</code>).
1963           </description>
1964         </field>
1965       </typedef>
1966       <description>
1967         Get information about the monitors owned by the
1968         specified thread and the depth of the stack frame which locked them.
1969       </description>
1970       <origin>new</origin>
1971       <capabilities>
1972         <required id="can_get_owned_monitor_stack_depth_info"></required>
1973       </capabilities>
1974       <parameters>
1975         <param id="thread">
1976           <jthread null="current"/>
1977             <description>
1978               The thread to query.
1979             </description>
1980         </param>
1981         <param id="monitor_info_count_ptr">
1982           <outptr><jint/></outptr>
1983           <description>
1984             The number of monitors returned.
1985           </description>
1986         </param>
1987         <param id="monitor_info_ptr">
1988           <allocbuf outcount="monitor_info_count_ptr">
1989             <struct>jvmtiMonitorStackDepthInfo</struct>
1990           </allocbuf>
1991           <description>
1992             The array of owned monitor depth information.
1993           </description>
1994         </param>
1995       </parameters>
1996       <errors>
1997       </errors>
1998     </function>
1999 
2000     <function id="GetCurrentContendedMonitor" num="11">
2001       <synopsis>Get Current Contended Monitor</synopsis>
2002       <description>
2003         Get the object, if any, whose monitor the specified thread is waiting to
2004         enter or waiting to regain through <code>java.lang.Object.wait</code>.
2005       </description>
2006       <origin>jvmdi</origin>
2007       <capabilities>
2008         <required id="can_get_current_contended_monitor"></required>
2009       </capabilities>
2010       <parameters>
2011         <param id="thread">
2012           <jthread null="current"/>
2013             <description>
2014               The thread to query.
2015             </description>
2016         </param>
2017         <param id="monitor_ptr">
2018           <outptr><jobject/></outptr>
2019             <description>
2020               On return, filled with the current contended monitor, or
2021               NULL if there is none.
2022             </description>
2023         </param>
2024       </parameters>
2025       <errors>
2026       </errors>
2027     </function>
2028 
2029     <callback id="jvmtiStartFunction">
2030       <void/>
2031       <synopsis>Agent Start Function</synopsis>
2032       <description>
2033         Agent supplied callback function.
2034         This function is the entry point for an agent thread
2035         started with
2036         <functionlink id="RunAgentThread"></functionlink>.
2037       </description>
2038       <parameters>
2039           <param id="jvmti_env">
2040             <outptr>
2041               <struct>jvmtiEnv</struct>
2042             </outptr>
2043             <description>
2044               The <jvmti/> environment.
2045             </description>
2046           </param>
2047           <param id="jni_env">
2048             <outptr>
2049               <struct>JNIEnv</struct>
2050             </outptr>
2051             <description>
2052               The JNI environment.
2053             </description>
2054           </param>
2055           <param id="arg">
2056             <outptr>
2057               <void/>
2058             </outptr>
2059               <description>
2060                 The <code>arg</code> parameter passed to
2061                 <functionlink id="RunAgentThread"></functionlink>.
2062               </description>
2063           </param>
2064       </parameters>
2065     </callback>
2066 
2067     <function id="RunAgentThread" num="12">
2068       <synopsis>Run Agent Thread</synopsis>
2069       <description>
2070         Starts the execution of an agent thread. with the specified native function.
2071         The parameter <paramlink id="arg"></paramlink> is forwarded on to the
2072         <functionlink id="jvmtiStartFunction">start function</functionlink>
2073         (specified with <paramlink id="proc"></paramlink>) as its single argument.
2074         This function allows the creation of agent threads
2075         for handling communication with another process or for handling events
2076         without the need to load a special subclass of <code>java.lang.Thread</code> or
2077         implementer of <code>java.lang.Runnable</code>.
2078         Instead, the created thread can run entirely in native code.
2079         However, the created thread does require a newly created instance
2080         of <code>java.lang.Thread</code> (referenced by the argument <code>thread</code>) to
2081         which it will be associated.
2082         The thread object can be created with JNI calls.
2083         <p/>
2084         The following common thread priorities are provided for your convenience:
2085         <constants id="jvmtiThreadPriority" label="Thread Priority Constants" kind="const">
2086           <constant id="JVMTI_THREAD_MIN_PRIORITY" num="1">
2087             Minimum possible thread priority
2088           </constant>
2089           <constant id="JVMTI_THREAD_NORM_PRIORITY" num="5">
2090             Normal thread priority
2091           </constant>
2092           <constant id="JVMTI_THREAD_MAX_PRIORITY" num="10">
2093             Maximum possible thread priority
2094           </constant>
2095         </constants>
2096         <p/>
2097         The new thread is started as a daemon thread with the specified
2098         <paramlink id="priority"></paramlink>.
2099         If enabled, a <eventlink id="ThreadStart"/> event will be sent.
2100         <p/>
2101         Since the thread has been started, the thread will be live when this function
2102         returns, unless the thread has died immediately.
2103         <p/>
2104         The thread group of the thread is ignored -- specifically, the thread is not
2105         added to the thread group and the thread is not seen on queries of the thread
2106         group at either the Java programming language or <jvmti/> levels.
2107         <p/>
2108         The thread is not visible to Java programming language queries but is
2109         included in <jvmti/> queries (for example,
2110         <functionlink id="GetAllThreads"/> and
2111         <functionlink id="GetAllStackTraces"/>).
2112         <p/>
2113         Upon execution of <code>proc</code>, the new thread will be attached to the
2114         VM -- see the JNI documentation on
2115         <externallink id="jni/invocation.html#attaching-to-the-vm"
2116                       >Attaching to the VM</externallink>.
2117       </description>
2118       <origin>jvmdiClone</origin>
2119       <capabilities>
2120       </capabilities>
2121       <parameters>
2122         <param id="thread">
2123           <jthread impl="noconvert" started="no"/>
2124             <description>
2125               The thread to run.
2126             </description>
2127         </param>
2128         <param id="proc">
2129           <ptrtype>
2130             <struct>jvmtiStartFunction</struct>
2131           </ptrtype>
2132           <description>
2133             The start function.
2134           </description>
2135         </param>
2136         <param id="arg">
2137           <inbuf>
2138             <void/>
2139             <nullok><code>NULL</code> is passed to the start function</nullok>
2140           </inbuf>
2141           <description>
2142             The argument to the start function.
2143           </description>
2144         </param>
2145         <param id="priority">
2146           <jint/>
2147           <description>
2148             The priority of the started thread. Any thread
2149             priority allowed by <code>java.lang.Thread.setPriority</code> can be used including
2150             those in <datalink id="jvmtiThreadPriority"></datalink>.
2151           </description>
2152         </param>
2153       </parameters>
2154       <errors>
2155         <error id="JVMTI_ERROR_INVALID_PRIORITY">
2156             <paramlink id="priority"/> is less than
2157             <datalink id="JVMTI_THREAD_MIN_PRIORITY"/>
2158               or greater than
2159             <datalink id="JVMTI_THREAD_MAX_PRIORITY"/>
2160         </error>
2161       </errors>
2162     </function>
2163 
2164     <function id="SetThreadLocalStorage" jkernel="yes" impl="notrace" phase="start" num="103">
2165       <synopsis>Set Thread Local Storage</synopsis>
2166       <description>
2167         The VM stores a pointer value associated with each environment-thread
2168         pair. This pointer value is called <i>thread-local storage</i>.
2169         This value is <code>NULL</code> unless set with this function.
2170         Agents can allocate memory in which they store thread specific
2171         information. By setting thread-local storage it can then be
2172         accessed with
2173         <functionlink id="GetThreadLocalStorage"></functionlink>.
2174         <p/>
2175         This function is called by the agent to set the value of the <jvmti/>
2176         thread-local storage. <jvmti/> supplies to the agent a pointer-size
2177         thread-local storage that can be used to record per-thread
2178         information.
2179       </description>
2180       <origin>jvmpi</origin>
2181       <capabilities>
2182       </capabilities>
2183       <parameters>
2184         <param id="thread">
2185           <jthread null="current"/>
2186             <description>
2187               Store to this thread.
2188             </description>
2189         </param>
2190         <param id="data">
2191           <inbuf>
2192             <void/>
2193             <nullok>value is set to <code>NULL</code></nullok>
2194           </inbuf>
2195           <description>
2196             The value to be entered into the thread-local storage.
2197           </description>
2198         </param>
2199       </parameters>
2200       <errors>
2201       </errors>
2202     </function>
2203 
2204     <function id="GetThreadLocalStorage" jkernel="yes" impl="innative notrace" phase="start" num="102">
2205       <synopsis>Get Thread Local Storage</synopsis>
2206       <description>
2207         Called by the agent to get the value of the <jvmti/> thread-local
2208         storage.
2209       </description>
2210       <origin>jvmpi</origin>
2211       <capabilities>
2212       </capabilities>
2213       <parameters>
2214         <param id="thread">
2215           <jthread null="current" impl="noconvert"/>
2216             <description>
2217               Retrieve from this thread.
2218             </description>
2219         </param>
2220         <param id="data_ptr">
2221           <agentbuf><void/></agentbuf>
2222           <description>
2223             Pointer through which the value of the thread local
2224             storage is returned.
2225             If thread-local storage has not been set with
2226             <functionlink id="SetThreadLocalStorage"></functionlink> the returned
2227             pointer is <code>NULL</code>.
2228           </description>
2229         </param>
2230       </parameters>
2231       <errors>
2232       </errors>
2233     </function>
2234 
2235   </category>
2236 
2237   <category id="fiberCategory" label="Fiber">
2238     <intro>
2239     </intro>
2240 
2241     <function id="IsFiber" num="105" since="14">
2242       <synopsis>Is Fiber</synopsis>
2243       <description>
2244         Determines whether a thread object reference represents a fiber.
2245         The <code>jboolean</code> result is
2246         <code>JNI_TRUE</code> if the "thread" is actually a fiber,
2247         <code>JNI_FALSE</code> otherwise.
2248       </description>
2249       <origin>new</origin>
2250       <capabilities>
2251         <required id="can_support_fibers">
2252           Can support fibers.
2253         </required>
2254       </capabilities>
2255       <parameters>
2256         <param id="object">
2257           <jobject/>
2258             <description>
2259               The object reference.
2260             </description>
2261         </param>
2262         <param id="is_fiber_ptr">
2263           <outptr><jboolean/></outptr>
2264           <description>
2265             On return, points to the boolean result of this function.
2266           </description>
2267         </param>
2268       </parameters>
2269       <errors>
2270       </errors>
2271     </function>
2272 
2273     <function id="GetThreadFiber" num="113" since="14">
2274       <synopsis>Get Thread Fiber</synopsis>
2275       <description>
2276         Get the fiber mounted to the specified thread.
2277         If no fiber is mounted, <code>NULL</code> is returned.
2278       </description>
2279       <origin>new</origin>
2280       <capabilities>
2281         <required id="can_support_fibers">
2282             Can support fibers.
2283         </required>
2284       </capabilities>
2285       <parameters>
2286         <param id="thread">
2287           <jthread null="current"/>
2288             <description>
2289               The thread to query.
2290             </description>
2291         </param>
2292         <param id="fiber_ptr">
2293           <outptr><jobject/></outptr>
2294           <description>
2295             On return, points to the fiber mounted to the specified thread, or <code>NULL</code>.
2296           </description>
2297         </param>
2298       </parameters>
2299       <errors>
2300       </errors>
2301     </function>
2302 
2303     <function id="GetFiberThread" num="117" since="14">
2304       <synopsis>Get Fiber Thread</synopsis>
2305       <description>
2306         Get the thread the specified fiber is mounted to.
2307         If the fiber is unmounted, <code>NULL</code> is returned.
2308       </description>
2309       <origin>new</origin>
2310       <capabilities>
2311         <required id="can_support_fibers">
2312             Can support fibers.
2313         </required>
2314       </capabilities>
2315       <parameters>
2316         <param id="fiber">
2317           <jobject />
2318             <description>
2319               The fiber to query.
2320             </description>
2321         </param>
2322         <param id="thread_ptr">
2323           <outptr><jthread/></outptr>
2324           <description>
2325             On return, points to the thread the fiber is mounted to, or <code>NULL</code>.
2326             The result is transient if not all carrier threads are suspended.
2327           </description>
2328         </param>
2329       </parameters>
2330       <errors>
2331         <error id="JVMTI_ERROR_INVALID_FIBER">
2332           <paramlink id="fiber"></paramlink> is not a fiber.
2333         </error>
2334       </errors>
2335     </function>
2336 
2337     <function id="GetFiberStackTrace" num="118" since="14">
2338       <synopsis>Get Fiber Stack Trace</synopsis>
2339       <description>
2340         Get information about the stack of a fiber.
2341         If <paramlink id="max_frame_count"></paramlink> is less than the depth of the stack,
2342         the <paramlink id="max_frame_count"></paramlink> topmost frames are returned,
2343         otherwise the entire stack is returned.
2344         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2345         <p/>
2346         The <paramlink id="fiber"></paramlink> need not be suspended to call this function.
2347         <p/>
2348         The <functionlink id="GetLineNumberTable"></functionlink>
2349         function can be used to map locations to line numbers. Note that
2350         this mapping can be done lazily.
2351       </description>
2352       <origin>new</origin>
2353       <capabilities>
2354         <required id="can_support_fibers">Can support fibers.</required>
2355       </capabilities>
2356       <parameters>
2357         <param id="fiber">
2358           <jobject />
2359             <description>
2360               Fetch the stack trace of this fiber.
2361             </description>
2362         </param>
2363         <param id="start_depth">
2364           <jint/>
2365           <description>
2366             Begin retrieving frames at this depth.
2367             If non-negative, count from the current frame,
2368             the first frame retrieved is at depth <code>start_depth</code>.
2369             For example, if zero, start from the current frame; if one, start from the
2370             caller of the current frame; if two, start from the caller of the
2371             caller of the current frame; and so on.
2372             If negative, count from below the oldest frame,
2373             the first frame retrieved is at depth <i>stackDepth</i><code> + start_depth</code>,
2374             where <i>stackDepth</i> is the count of frames on the stack.
2375             For example, if negative one, only the oldest frame is retrieved;
2376             if negative two, start from the frame called by the oldest frame.
2377           </description>
2378         </param>
2379         <param id="max_frame_count">
2380           <jint min="0"/>
2381           <description>
2382             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2383           </description>
2384         </param>
2385         <param id="frame_buffer">
2386           <outbuf incount="max_frame_count" outcount="count_ptr">
2387             <struct>jvmtiFrameInfo</struct>
2388           </outbuf>
2389             <description>
2390               On return, this agent allocated buffer is filled
2391               with stack frame information.
2392             </description>
2393         </param>
2394         <param id="count_ptr">
2395           <outptr><jint/></outptr>
2396           <description>
2397             On return, points to the number of records filled in.
2398             For non-negative <code>start_depth</code>, this will be
2399             min(<code>max_frame_count</code>, <i>stackDepth</i><code> - start_depth</code>).
2400             For negative <code>start_depth</code>, this will be
2401             min(<code>max_frame_count</code>, <code>-start_depth</code>).
2402           </description>
2403         </param>
2404       </parameters>
2405       <errors>
2406         <error id="JVMTI_ERROR_INVALID_FIBER">
2407           <paramlink id="fiber"></paramlink> is not a fiber.
2408         </error>
2409         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
2410           <paramlink id="start_depth"/> is positive and greater than or equal to <i>stackDepth</i>.
2411           Or <paramlink id="start_depth"/> is negative and less than <i>-stackDepth</i>.
2412         </error>
2413       </errors>
2414     </function>
2415 
2416     <function id="GetFiberFrameCount" num="119" since="14">
2417       <synopsis>Get Fiber Frame Count</synopsis>
2418       <description>
2419         Get the number of frames currently in the specified fiber's call stack.
2420         <p/>
2421         If this function is called for a fiber actively executing bytecodes (for example,
2422         not on the current or suspended thread), the information returned is transient.
2423       </description>
2424       <origin>new</origin>
2425       <capabilities>
2426         <required id="can_support_fibers">Can support fibers.</required>
2427       </capabilities>
2428       <parameters>
2429         <param id="fiber">
2430           <jobject />
2431             <description>
2432               The fiber to query.
2433             </description>
2434         </param>
2435         <param id="count_ptr">
2436           <outptr><jint/></outptr>
2437           <description>
2438             On return, points to the number of frames in the call stack.
2439           </description>
2440         </param>
2441       </parameters>
2442       <errors>
2443         <error id="JVMTI_ERROR_INVALID_FIBER">
2444           <paramlink id="fiber"></paramlink> is not a fiber.
2445         </error>
2446       </errors>
2447     </function>
2448 
2449     <function id="GetFiberFrameLocation" num="141" since="14">
2450       <synopsis>Get Fiber Frame Location</synopsis>
2451       <description>
2452         <p/>
2453         For a Java programming language frame, return the location of the instruction
2454         currently executing.
2455       </description>
2456       <origin>new</origin>
2457       <capabilities>
2458         <required id="can_support_fibers">Can support fibers.</required>
2459       </capabilities>
2460       <parameters>
2461         <param id="fiber">
2462           <jobject frame="frame"/>
2463           <description>
2464             The fiber of the frame to query.
2465           </description>
2466         </param>
2467         <param id="depth">
2468           <jframeID fiber="fiber"/>
2469           <description>
2470             The depth of the frame to query.
2471           </description>
2472         </param>
2473         <param id="method_ptr">
2474           <outptr><jmethodID/></outptr>
2475             <description>
2476               On return, points to the method for the current location.
2477             </description>
2478         </param>
2479         <param id="location_ptr">
2480           <outptr><jlocation/></outptr>
2481           <description>
2482             On return, points to the index of the currently
2483             executing instruction.
2484             Is set to <code>-1</code> if the frame is executing
2485             a native method.
2486           </description>
2487         </param>
2488       </parameters>
2489       <errors>
2490         <error id="JVMTI_ERROR_INVALID_FIBER">
2491           <paramlink id="fiber"></paramlink> is not a fiber.
2492         </error>
2493       </errors>
2494     </function>
2495 
2496   </category>
2497 
2498   <category id="thread_groups" label="Thread Group">
2499     <intro>
2500     </intro>
2501 
2502     <function id="GetTopThreadGroups" num="13">
2503       <synopsis>Get Top Thread Groups</synopsis>
2504       <description>
2505         Return all top-level (parentless) thread groups in the VM.
2506       </description>
2507       <origin>jvmdi</origin>
2508       <capabilities>
2509       </capabilities>
2510       <parameters>
2511         <param id="group_count_ptr">
2512           <outptr><jint/></outptr>
2513           <description>
2514             On return, points to the number of top-level thread groups.
2515           </description>
2516         </param>
2517         <param id="groups_ptr">
2518           <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2519             <description>
2520               On return, refers to a pointer to the top-level thread group array.
2521             </description>
2522         </param>
2523       </parameters>
2524       <errors>
2525       </errors>
2526     </function>
2527 
2528     <function id="GetThreadGroupInfo" num="14">
2529       <synopsis>Get Thread Group Info</synopsis>
2530       <typedef id="jvmtiThreadGroupInfo" label="Thread group information structure">
2531         <field id="parent">
2532           <jthreadGroup/>
2533           <description>
2534             The parent thread group.
2535           </description>
2536         </field>
2537         <field id="name">
2538           <allocfieldbuf><char/></allocfieldbuf>
2539           <description>
2540             The thread group's name, encoded as a
2541             <internallink id="mUTF">modified UTF-8</internallink> string.
2542           </description>
2543         </field>
2544         <field id="max_priority">
2545           <jint/>
2546           <description>
2547             The maximum priority for this thread group.
2548           </description>
2549         </field>
2550         <field id="is_daemon">
2551           <jboolean/>
2552           <description>
2553             Is this a daemon thread group?
2554           </description>
2555         </field>
2556       </typedef>
2557       <description>
2558         Get information about the thread group. The fields of the
2559         <functionlink id="jvmtiThreadGroupInfo"></functionlink> structure
2560         are filled in with details of the specified thread group.
2561       </description>
2562       <origin>jvmdi</origin>
2563       <capabilities>
2564       </capabilities>
2565       <parameters>
2566         <param id="group">
2567           <jthreadGroup/>
2568           <description>
2569             The thread group to query.
2570           </description>
2571         </param>
2572         <param id="info_ptr">
2573           <outptr><struct>jvmtiThreadGroupInfo</struct></outptr>
2574           <description>
2575             On return, filled with information describing the specified
2576             thread group.
2577           </description>
2578         </param>
2579       </parameters>
2580       <errors>
2581       </errors>
2582     </function>
2583 
2584     <function id="GetThreadGroupChildren" num="15">
2585       <synopsis>Get Thread Group Children</synopsis>
2586       <description>
2587         Get the live threads and active subgroups in this thread group.
2588       </description>
2589       <origin>jvmdi</origin>
2590       <capabilities>
2591       </capabilities>
2592       <parameters>
2593         <param id="group">
2594           <jthreadGroup/>
2595           <description>
2596             The group to query.
2597           </description>
2598         </param>
2599         <param id="thread_count_ptr">
2600           <outptr><jint/></outptr>
2601           <description>
2602             On return, points to the number of live threads in this thread group.
2603           </description>
2604         </param>
2605         <param id="threads_ptr">
2606           <allocbuf outcount="thread_count_ptr"><jthread/></allocbuf>
2607             <description>
2608               On return, points to an array of the live threads in this thread group.
2609             </description>
2610         </param>
2611         <param id="group_count_ptr">
2612           <outptr><jint/></outptr>
2613           <description>
2614             On return, points to the number of active child thread groups
2615           </description>
2616         </param>
2617         <param id="groups_ptr">
2618           <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2619             <description>
2620               On return, points to an array of the active child thread groups.
2621             </description>
2622         </param>
2623       </parameters>
2624       <errors>
2625       </errors>
2626     </function>
2627   </category>
2628 
2629   <category id="stack" label="Stack Frame">
2630     <intro>
2631         These functions provide information about the stack of a thread.
2632         Stack frames are referenced by depth.
2633         The frame at depth zero is the current frame.
2634         <p/>
2635         Stack frames are as described in
2636         <vmspec chapter="3.6"/>,
2637         That is, they correspond to method
2638         invocations (including native methods) but do not correspond to platform native or
2639         VM internal frames.
2640         <p/>
2641         A <jvmti/> implementation may use method invocations to launch a thread and
2642         the corresponding frames may be included in the stack as presented by these functions --
2643         that is, there may be frames shown
2644         deeper than <code>main()</code> and <code>run()</code>.
2645         However this presentation must be consistent across all <jvmti/> functionality which
2646         uses stack frames or stack depth.
2647     </intro>
2648 
2649       <typedef id="jvmtiFrameInfo" label="Stack frame information structure">
2650         <description>
2651           Information about a stack frame is returned in this structure.
2652         </description>
2653         <field id="method">
2654           <jmethodID/>
2655             <description>
2656               The method executing in this frame.
2657             </description>
2658         </field>
2659         <field id="location">
2660           <jlocation/>
2661           <description>
2662             The index of the instruction executing in this frame.
2663             <code>-1</code> if the frame is executing a native method.
2664           </description>
2665         </field>
2666       </typedef>
2667 
2668       <typedef id="jvmtiStackInfo" label="Stack information structure">
2669         <description>
2670           Information about a set of stack frames is returned in this structure.
2671         </description>
2672         <field id="thread">
2673           <jthread/>
2674           <description>
2675             On return, the thread traced.
2676           </description>
2677         </field>
2678         <field id="state">
2679           <jint/>
2680           <description>
2681             On return, the thread state. See <functionlink id="GetThreadState"></functionlink>.
2682           </description>
2683         </field>
2684         <field id="frame_buffer">
2685           <outbuf incount="max_frame_count">
2686             <struct>jvmtiFrameInfo</struct>
2687           </outbuf>
2688             <description>
2689               On return, this agent allocated buffer is filled
2690               with stack frame information.
2691             </description>
2692         </field>
2693         <field id="frame_count">
2694           <jint/>
2695           <description>
2696             On return, the number of records filled into
2697             <code>frame_buffer</code>.
2698             This will be
2699             min(<code>max_frame_count</code>, <i>stackDepth</i>).
2700           </description>
2701         </field>
2702       </typedef>
2703 
2704     <function id="GetStackTrace" num="104">
2705       <synopsis>Get Stack Trace</synopsis>
2706       <description>
2707         Get information about the stack of a thread.
2708         If <paramlink id="max_frame_count"></paramlink> is less than the depth of the stack,
2709         the <paramlink id="max_frame_count"></paramlink> topmost frames are returned,
2710         otherwise the entire stack is returned.
2711         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2712         <p/>
2713         The following example causes up to five of the topmost frames
2714         to be returned and (if there are any frames) the currently
2715         executing method name to be printed.
2716         <example>
2717 jvmtiFrameInfo frames[5];
2718 jint count;
2719 jvmtiError err;
2720 
2721 err = (*jvmti)-&gt;GetStackTrace(jvmti, aThread, 0, 5,
2722                                frames, &amp;count);
2723 if (err == JVMTI_ERROR_NONE &amp;&amp; count &gt;= 1) {
2724    char *methodName;
2725    err = (*jvmti)-&gt;GetMethodName(jvmti, frames[0].method,
2726                        &amp;methodName, NULL, NULL);
2727    if (err == JVMTI_ERROR_NONE) {
2728       printf("Executing method: %s", methodName);
2729    }
2730 }
2731         </example>
2732         <todo>
2733           check example code.
2734         </todo>
2735         <p/>
2736         The <paramlink id="thread"></paramlink> need not be suspended
2737         to call this function.
2738         <p/>
2739         The <functionlink id="GetLineNumberTable"></functionlink>
2740         function can be used to map locations to line numbers. Note that
2741         this mapping can be done lazily.
2742       </description>
2743       <origin>jvmpi</origin>
2744       <capabilities>
2745       </capabilities>
2746       <parameters>
2747         <param id="thread">
2748           <jthread null="current"/>
2749             <description>
2750               Fetch the stack trace of this thread.
2751             </description>
2752         </param>
2753         <param id="start_depth">
2754           <jint/>
2755           <description>
2756             Begin retrieving frames at this depth.
2757             If non-negative, count from the current frame,
2758             the first frame retrieved is at depth <code>start_depth</code>.
2759             For example, if zero, start from the current frame; if one, start from the
2760             caller of the current frame; if two, start from the caller of the
2761             caller of the current frame; and so on.
2762             If negative, count from below the oldest frame,
2763             the first frame retrieved is at depth <i>stackDepth</i><code> + start_depth</code>,
2764             where <i>stackDepth</i> is the count of frames on the stack.
2765             For example, if negative one, only the oldest frame is retrieved;
2766             if negative two, start from the frame called by the oldest frame.
2767           </description>
2768         </param>
2769         <param id="max_frame_count">
2770           <jint min="0"/>
2771           <description>
2772             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2773           </description>
2774         </param>
2775         <param id="frame_buffer">
2776           <outbuf incount="max_frame_count" outcount="count_ptr">
2777             <struct>jvmtiFrameInfo</struct>
2778           </outbuf>
2779             <description>
2780               On return, this agent allocated buffer is filled
2781               with stack frame information.
2782             </description>
2783         </param>
2784         <param id="count_ptr">
2785           <outptr><jint/></outptr>
2786           <description>
2787             On return, points to the number of records filled in.
2788             For non-negative <code>start_depth</code>, this will be
2789             min(<code>max_frame_count</code>, <i>stackDepth</i><code> - start_depth</code>).
2790             For negative <code>start_depth</code>, this will be
2791             min(<code>max_frame_count</code>, <code>-start_depth</code>).
2792           </description>
2793         </param>
2794       </parameters>
2795       <errors>
2796         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
2797           <paramlink id="start_depth"/> is positive and greater than or equal to <i>stackDepth</i>.
2798           Or <paramlink id="start_depth"/> is negative and less than <i>-stackDepth</i>.
2799         </error>
2800       </errors>
2801     </function>
2802 
2803 
2804     <function id="GetAllStackTraces" num="100">
2805       <synopsis>Get All Stack Traces</synopsis>
2806       <description>
2807         Get information about the stacks of all live threads
2808         (including <internallink id="RunAgentThread">agent threads</internallink>).
2809         If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2810         the <paramlink id="max_frame_count"/> topmost frames are returned for that thread,
2811         otherwise the entire stack is returned.
2812         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2813         <p/>
2814         All stacks are collected simultaneously, that is, no changes will occur to the
2815         thread state or stacks between the sampling of one thread and the next.
2816         The threads need not be suspended.
2817 
2818         <example>
2819 jvmtiStackInfo *stack_info;
2820 jint thread_count;
2821 int ti;
2822 jvmtiError err;
2823 
2824 err = (*jvmti)-&gt;GetAllStackTraces(jvmti, MAX_FRAMES, &amp;stack_info, &amp;thread_count);
2825 if (err != JVMTI_ERROR_NONE) {
2826    ...
2827 }
2828 for (ti = 0; ti &lt; thread_count; ++ti) {
2829    jvmtiStackInfo *infop = &amp;stack_info[ti];
2830    jthread thread = infop-&gt;thread;
2831    jint state = infop-&gt;state;
2832    jvmtiFrameInfo *frames = infop-&gt;frame_buffer;
2833    int fi;
2834 
2835    myThreadAndStatePrinter(thread, state);
2836    for (fi = 0; fi &lt; infop-&gt;frame_count; fi++) {
2837       myFramePrinter(frames[fi].method, frames[fi].location);
2838    }
2839 }
2840 /* this one Deallocate call frees all data allocated by GetAllStackTraces */
2841 err = (*jvmti)-&gt;Deallocate(jvmti, stack_info);
2842         </example>
2843         <todo>
2844           check example code.
2845         </todo>
2846 
2847       </description>
2848       <origin>new</origin>
2849       <capabilities>
2850       </capabilities>
2851       <parameters>
2852         <param id="max_frame_count">
2853           <jint min="0"/>
2854           <description>
2855             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2856           </description>
2857         </param>
2858         <param id="stack_info_ptr">
2859           <allocbuf>
2860             <struct>jvmtiStackInfo</struct>
2861           </allocbuf>
2862             <description>
2863               On return, this buffer is filled
2864               with stack information for each thread.
2865               The number of <datalink id="jvmtiStackInfo"/> records is determined
2866               by <paramlink id="thread_count_ptr"/>.
2867               <p/>
2868               Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/>
2869               buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2870               These buffers must not be separately deallocated.
2871             </description>
2872         </param>
2873         <param id="thread_count_ptr">
2874           <outptr><jint/></outptr>
2875           <description>
2876             The number of threads traced.
2877           </description>
2878         </param>
2879       </parameters>
2880       <errors>
2881       </errors>
2882     </function>
2883 
2884     <function id="GetThreadListStackTraces" num="101">
2885       <synopsis>Get Thread List Stack Traces</synopsis>
2886       <description>
2887         Get information about the stacks of the supplied threads.
2888         If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2889         the <paramlink id="max_frame_count"/> topmost frames are returned for that thread,
2890         otherwise the entire stack is returned.
2891         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2892         <p/>
2893         All stacks are collected simultaneously, that is, no changes will occur to the
2894         thread state or stacks between the sampling one thread and the next.
2895         The threads need not be suspended.
2896         <p/>
2897         If a thread has not yet started or terminates before the stack information is collected,
2898         a zero length stack (<datalink id="jvmtiStackInfo.frame_count"/> will be zero)
2899         will be returned and the thread <datalink id="jvmtiStackInfo.state"/> can be checked.
2900         <p/>
2901         See the example for the similar function
2902         <functionlink id="GetAllStackTraces"/>.
2903       </description>
2904       <origin>new</origin>
2905       <capabilities>
2906       </capabilities>
2907       <parameters>
2908         <param id="thread_count">
2909           <jint min="0"/>
2910           <description>
2911             The number of threads to trace.
2912           </description>
2913         </param>
2914         <param id="thread_list">
2915           <inbuf incount="thread_count"><jthread/></inbuf>
2916             <description>
2917               The list of threads to trace.
2918             </description>
2919         </param>
2920         <param id="max_frame_count">
2921           <jint min="0"/>
2922           <description>
2923             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2924           </description>
2925         </param>
2926         <param id="stack_info_ptr">
2927           <allocbuf outcount="thread_count">
2928             <struct>jvmtiStackInfo</struct>
2929           </allocbuf>
2930             <description>
2931               On return, this buffer is filled
2932               with stack information for each thread.
2933               The number of <datalink id="jvmtiStackInfo"/> records is determined
2934               by <paramlink id="thread_count"/>.
2935               <p/>
2936               Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/>
2937               buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2938               These buffers must not be separately deallocated.
2939             </description>
2940         </param>
2941       </parameters>
2942       <errors>
2943         <error id="JVMTI_ERROR_INVALID_THREAD">
2944           An element in <paramlink id="thread_list"/> is not a thread object.
2945         </error>
2946       </errors>
2947     </function>
2948 
2949     <elide>
2950     <function id="AsyncGetStackTrace" num="1000">
2951       <synopsis>Get Stack Trace--Asynchronous</synopsis>
2952       <description>
2953         Get information about the entire stack of a thread (or a sub-section of it).
2954         This is the asynchronous version of <functionlink id="GetStackTrace"></functionlink>
2955         and is reentrant and safe to call
2956         from asynchronous signal handlers.
2957         The stack trace is returned only for the calling thread.
2958         <p/>
2959         The <functionlink id="GetLineNumberTable"></functionlink>
2960         function can be used to map locations to line numbers. Note that
2961         this mapping can be done lazily.
2962       </description>
2963       <origin>jvmpi</origin>
2964       <capabilities>
2965         <required id="can_get_async_stack_trace"></required>
2966         <capability id="can_show_JVM_spec_async_frames">
2967           If <code>false</code>,
2968           <paramlink id="use_java_stack"></paramlink>
2969           must be <code>false</code>.
2970         </capability>
2971       </capabilities>
2972       <parameters>
2973         <param id="use_java_stack">
2974           <jboolean/>
2975           <description>
2976             Return the stack showing <vmspec/>
2977             model of the stack;
2978             otherwise, show the internal representation of the stack with
2979             inlined and optimized methods missing.  If the virtual machine
2980             is using the <i>Java Virtual Machine Specification</i> stack model
2981             internally, this flag is ignored.
2982           </description>
2983         </param>
2984         <param id="max_count">
2985           <jint min="0"/>
2986           <description>
2987             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2988             Retrieve this many unless the stack depth is less than <code>max_count</code>.
2989           </description>
2990         </param>
2991         <param id="frame_buffer">
2992           <outbuf incount="max_count" outcount="count_ptr">
2993             <struct>jvmtiFrameInfo</struct>
2994             <nullok>this information is not returned</nullok>
2995           </outbuf>
2996             <description>
2997               The agent passes in a buffer
2998               large enough to hold <code>max_count</code> records of
2999               <datalink id="jvmtiFrameInfo"></datalink>.  This buffer must be
3000               pre-allocated by the agent.
3001             </description>
3002         </param>
3003         <param id="count_ptr">
3004           <outptr><jint/></outptr>
3005           <description>
3006             On return, points to the number of records filled in..
3007           </description>
3008         </param>
3009       </parameters>
3010       <errors>
3011         <error id="JVMTI_ERROR_UNATTACHED_THREAD">
3012           The thread being used to call this function is not attached
3013           to the virtual machine.  Calls must be made from attached threads.
3014         </error>
3015       </errors>
3016     </function>
3017     </elide>
3018 
3019     <function id="GetFrameCount" num="16">
3020       <synopsis>Get Frame Count</synopsis>
3021       <description>
3022         Get the number of frames currently in the specified thread's call stack.
3023         <p/>
3024         If this function is called for a thread actively executing bytecodes (for example,
3025         not the current thread and not suspended), the information returned is transient.
3026       </description>
3027       <origin>jvmdi</origin>
3028       <capabilities>
3029       </capabilities>
3030       <parameters>
3031         <param id="thread">
3032           <jthread null="current"/>
3033             <description>
3034               The thread to query.
3035             </description>
3036         </param>
3037         <param id="count_ptr">
3038           <outptr><jint/></outptr>
3039           <description>
3040             On return, points to the number of frames in the call stack.
3041           </description>
3042         </param>
3043       </parameters>
3044       <errors>
3045       </errors>
3046     </function>
3047 
3048     <function id="PopFrame" num="80">
3049       <synopsis>Pop Frame</synopsis>
3050       <description>
3051         Pop the current frame of <code>thread</code>'s stack.
3052         Popping a frame takes you to the previous frame.
3053         When the thread is resumed, the execution
3054         state of the thread is reset to the state
3055         immediately before the called method was invoked.
3056         That is (using <vmspec/> terminology):
3057           <ul>
3058             <li>the current frame is discarded as the previous frame becomes the current one</li>
3059             <li>the operand stack is restored--the argument values are added back
3060               and if the invoke was not <code>invokestatic</code>,
3061               <code>objectref</code> is added back as well</li>
3062             <li>the Java virtual machine PC is restored to the opcode
3063               of the invoke instruction</li>
3064           </ul>
3065         Note however, that any changes to the arguments, which
3066         occurred in the called method, remain;
3067         when execution continues, the first instruction to
3068         execute will be the invoke.
3069         <p/>
3070         Between calling <code>PopFrame</code> and resuming the
3071         thread the state of the stack is undefined.
3072         To pop frames beyond the first,
3073         these three steps must be repeated:
3074         <ul>
3075           <li>suspend the thread via an event (step, breakpoint, ...)</li>
3076           <li>call <code>PopFrame</code></li>
3077           <li>resume the thread</li>
3078         </ul>
3079         <p/>
3080         A lock acquired by calling the called method
3081         (if it is a <code>synchronized</code>  method)
3082         and locks acquired by entering <code>synchronized</code>
3083         blocks within the called method are released.
3084         Note: this does not apply to native locks or
3085         <code>java.util.concurrent.locks</code> locks.
3086         <p/>
3087         Finally blocks are not executed.
3088         <p/>
3089         Changes to global state are not addressed and thus remain changed.
3090         <p/>
3091         The specified thread must be suspended or must be the current thread.
3092         <p/>
3093         Both the called method and calling method must be non-native Java programming
3094         language methods.
3095         <p/>
3096         No <jvmti/> events are generated by this function.
3097       </description>
3098       <origin>jvmdi</origin>
3099       <capabilities>
3100         <required id="can_pop_frame"></required>
3101       </capabilities>
3102       <parameters>
3103         <param id="thread">
3104           <jthread/>
3105             <description>
3106               The thread whose current frame is to be popped.
3107             </description>
3108         </param>
3109       </parameters>
3110       <errors>
3111         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3112           Called or calling method is a native method.
3113           The implementation is unable to pop this frame.
3114         </error>
3115         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3116           Thread was not suspended and was not the current thread.
3117         </error>
3118         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3119           There are less than two stack frames on the call stack.
3120         </error>
3121       </errors>
3122     </function>
3123 
3124     <function id="GetFrameLocation" num="19">
3125       <synopsis>Get Frame Location</synopsis>
3126       <description>
3127         <p/>
3128         For a Java programming language frame, return the location of the instruction
3129         currently executing.
3130       </description>
3131       <origin>jvmdiClone</origin>
3132       <capabilities>
3133       </capabilities>
3134       <parameters>
3135         <param id="thread">
3136           <jthread null="current" frame="frame"/>
3137           <description>
3138             The thread of the frame to query.
3139           </description>
3140         </param>
3141         <param id="depth">
3142           <jframeID thread="thread"/>
3143           <description>
3144             The depth of the frame to query.
3145           </description>
3146         </param>
3147         <param id="method_ptr">
3148           <outptr><jmethodID/></outptr>
3149             <description>
3150               On return, points to the method for the current location.
3151             </description>
3152         </param>
3153         <param id="location_ptr">
3154           <outptr><jlocation/></outptr>
3155           <description>
3156             On return, points to the index of the currently
3157             executing instruction.
3158             Is set to <code>-1</code> if the frame is executing
3159             a native method.
3160           </description>
3161         </param>
3162       </parameters>
3163       <errors>
3164       </errors>
3165     </function>
3166 
3167     <function id="NotifyFramePop" num="20">
3168       <synopsis>Notify Frame Pop</synopsis>
3169       <description>
3170         When the frame that is currently at <paramlink id="depth"></paramlink>
3171         is popped from the stack, generate a
3172         <eventlink id="FramePop"></eventlink> event.  See the
3173         <eventlink id="FramePop"></eventlink> event for details.
3174         Only frames corresponding to non-native Java programming language
3175         methods can receive notification.
3176         <p/>
3177         The specified thread must be suspended or must be the current thread.
3178       </description>
3179       <origin>jvmdi</origin>
3180       <capabilities>
3181         <required id="can_generate_frame_pop_events"></required>
3182       </capabilities>
3183       <parameters>
3184         <param id="thread">
3185           <jthread null="current" frame="depth"/>
3186           <description>
3187             The thread of the frame for which the frame pop event will be generated.
3188           </description>
3189         </param>
3190         <param id="depth">
3191           <jframeID thread="thread"/>
3192           <description>
3193             The depth of the frame for which the frame pop event will be generated.
3194           </description>
3195         </param>
3196       </parameters>
3197       <errors>
3198         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3199           The frame at <code>depth</code> is executing a
3200           native method.
3201         </error>
3202         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3203           Thread was not suspended and was not the current thread.
3204         </error>
3205       </errors>
3206     </function>
3207 
3208   </category>
3209 
3210   <category id="ForceEarlyReturn" label="Force Early Return">
3211     <intro>
3212       These functions allow an agent to force a method
3213       to return at any point during its execution.
3214       The method which will return early is referred to as the <i>called method</i>.
3215       The called method is the current method
3216       (as defined by
3217       <vmspec chapter="3.6"/>)
3218       for the specified thread at
3219       the time the function is called.
3220       <p/>
3221       The specified thread must be suspended or must be the current thread.
3222       The return occurs when execution of Java programming
3223       language code is resumed on this thread.
3224       Between calling one of these functions and resumption
3225       of thread execution, the state of the stack is undefined.
3226       <p/>
3227       No further instructions are executed in the called method.
3228       Specifically, finally blocks are not executed.
3229       Note: this can cause inconsistent states in the application.
3230       <p/>
3231       A lock acquired by calling the called method
3232       (if it is a <code>synchronized</code>  method)
3233       and locks acquired by entering <code>synchronized</code>
3234       blocks within the called method are released.
3235       Note: this does not apply to native locks or
3236       <code>java.util.concurrent.locks</code> locks.
3237       <p/>
3238       Events, such as <eventlink id="MethodExit"></eventlink>,
3239       are generated as they would be in a normal return.
3240       <p/>
3241       The called method must be a non-native Java programming
3242       language method.
3243       Forcing return on a thread with only one frame on the
3244       stack causes the thread to exit when resumed.
3245     </intro>
3246 
3247     <function id="ForceEarlyReturnObject" num="81" since="1.1">
3248       <synopsis>Force Early Return - Object</synopsis>
3249       <description>
3250         This function can be used to return from a method whose
3251         result type is <code>Object</code>
3252         or a subclass of <code>Object</code>.
3253       </description>
3254       <origin>new</origin>
3255       <capabilities>
3256         <required id="can_force_early_return"></required>
3257       </capabilities>
3258       <parameters>
3259         <param id="thread">
3260           <jthread null="current"/>
3261           <description>
3262             The thread whose current frame is to return early.
3263           </description>
3264         </param>
3265         <param id="value">
3266           <jobject/>
3267           <description>
3268             The return value for the called frame.
3269             An object or <code>NULL</code>.
3270           </description>
3271         </param>
3272       </parameters>
3273       <errors>
3274         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3275           Attempted to return early from a frame
3276           corresponding to a native method.
3277           Or the implementation is unable to provide
3278           this functionality on this frame.
3279         </error>
3280         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3281           The result type of the called method is not
3282           <code>Object</code> or a subclass of <code>Object</code>.
3283         </error>
3284         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3285           The supplied <paramlink id="value"/> is not compatible with the
3286           result type of the called method.
3287         </error>
3288         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3289           Thread was not suspended and was not the current thread.
3290         </error>
3291         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3292           There are no more frames on the call stack.
3293         </error>
3294       </errors>
3295     </function>
3296 
3297     <function id="ForceEarlyReturnInt" num="82" since="1.1">
3298       <synopsis>Force Early Return - Int</synopsis>
3299       <description>
3300         This function can be used to return from a method whose
3301         result type is <code>int</code>, <code>short</code>,
3302         <code>char</code>, <code>byte</code>, or
3303         <code>boolean</code>.
3304       </description>
3305       <origin>new</origin>
3306       <capabilities>
3307         <required id="can_force_early_return"></required>
3308       </capabilities>
3309       <parameters>
3310         <param id="thread">
3311           <jthread null="current"/>
3312           <description>
3313             The thread whose current frame is to return early.
3314           </description>
3315         </param>
3316         <param id="value">
3317           <jint/>
3318           <description>
3319             The return value for the called frame.
3320           </description>
3321         </param>
3322       </parameters>
3323       <errors>
3324         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3325           Attempted to return early from a frame
3326           corresponding to a native method.
3327           Or the implementation is unable to provide
3328           this functionality on this frame.
3329         </error>
3330         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3331           The result type of the called method is not
3332           <code>int</code>, <code>short</code>,
3333           <code>char</code>, <code>byte</code>, or
3334           <code>boolean</code>.
3335         </error>
3336         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3337           Thread was not suspended and was not the current thread.
3338         </error>
3339         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3340           There are no frames on the call stack.
3341         </error>
3342       </errors>
3343     </function>
3344 
3345     <function id="ForceEarlyReturnLong" num="83" since="1.1">
3346       <synopsis>Force Early Return - Long</synopsis>
3347       <description>
3348         This function can be used to return from a method whose
3349         result type is <code>long</code>.
3350       </description>
3351       <origin>new</origin>
3352       <capabilities>
3353         <required id="can_force_early_return"></required>
3354       </capabilities>
3355       <parameters>
3356         <param id="thread">
3357           <jthread null="current"/>
3358           <description>
3359             The thread whose current frame is to return early.
3360           </description>
3361         </param>
3362         <param id="value">
3363           <jlong/>
3364           <description>
3365             The return value for the called frame.
3366           </description>
3367         </param>
3368       </parameters>
3369       <errors>
3370         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3371           Attempted to return early from a frame
3372           corresponding to a native method.
3373           Or the implementation is unable to provide
3374           this functionality on this frame.
3375         </error>
3376         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3377           The result type of the called method is not <code>long</code>.
3378         </error>
3379         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3380           Thread was not suspended and was not the current thread.
3381         </error>
3382         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3383           There are no frames on the call stack.
3384         </error>
3385       </errors>
3386     </function>
3387 
3388     <function id="ForceEarlyReturnFloat" num="84" since="1.1">
3389       <synopsis>Force Early Return - Float</synopsis>
3390       <description>
3391         This function can be used to return from a method whose
3392         result type is <code>float</code>.
3393       </description>
3394       <origin>new</origin>
3395       <capabilities>
3396         <required id="can_force_early_return"></required>
3397       </capabilities>
3398       <parameters>
3399         <param id="thread">
3400           <jthread null="current"/>
3401           <description>
3402             The thread whose current frame is to return early.
3403           </description>
3404         </param>
3405         <param id="value">
3406           <jfloat/>
3407           <description>
3408             The return value for the called frame.
3409           </description>
3410         </param>
3411       </parameters>
3412       <errors>
3413         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3414           Attempted to return early from a frame
3415           corresponding to a native method.
3416           Or the implementation is unable to provide
3417           this functionality on this frame.
3418         </error>
3419         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3420           The result type of the called method is not <code>float</code>.
3421         </error>
3422         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3423           Thread was not suspended and was not the current thread.
3424         </error>
3425         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3426           There are no frames on the call stack.
3427         </error>
3428       </errors>
3429     </function>
3430 
3431     <function id="ForceEarlyReturnDouble" num="85" since="1.1">
3432       <synopsis>Force Early Return - Double</synopsis>
3433       <description>
3434         This function can be used to return from a method whose
3435         result type is <code>double</code>.
3436       </description>
3437       <origin>new</origin>
3438       <capabilities>
3439         <required id="can_force_early_return"></required>
3440       </capabilities>
3441       <parameters>
3442         <param id="thread">
3443           <jthread null="current"/>
3444           <description>
3445             The thread whose current frame is to return early.
3446           </description>
3447         </param>
3448         <param id="value">
3449           <jdouble/>
3450           <description>
3451             The return value for the called frame.
3452           </description>
3453         </param>
3454       </parameters>
3455       <errors>
3456         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3457           Attempted to return early from a frame corresponding to a native method.
3458           Or the implementation is unable to provide this functionality on this frame.
3459         </error>
3460         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3461           The result type of the called method is not <code>double</code>.
3462         </error>
3463         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3464           Thread was not suspended and was not the current thread.
3465         </error>
3466         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3467           There are no frames on the call stack.
3468         </error>
3469       </errors>
3470     </function>
3471 
3472     <function id="ForceEarlyReturnVoid" num="86" since="1.1">
3473       <synopsis>Force Early Return - Void</synopsis>
3474       <description>
3475         This function can be used to return from a method with no result type.
3476         That is, the called method must be declared <code>void</code>.
3477       </description>
3478       <origin>new</origin>
3479       <capabilities>
3480         <required id="can_force_early_return"></required>
3481       </capabilities>
3482       <parameters>
3483         <param id="thread">
3484           <jthread null="current"/>
3485           <description>
3486             The thread whose current frame is to return early.
3487           </description>
3488         </param>
3489       </parameters>
3490       <errors>
3491         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3492           Attempted to return early from a frame
3493           corresponding to a native method.
3494           Or the implementation is unable to provide
3495           this functionality on this frame.
3496         </error>
3497         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3498           The called method has a result type.
3499         </error>
3500         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3501           Thread was not suspended and was not the current thread.
3502         </error>
3503         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3504           There are no frames on the call stack.
3505         </error>
3506       </errors>
3507     </function>
3508 
3509   </category>
3510 
3511   <category id="Heap" label="Heap">
3512     <intro>
3513       These functions are used to analyze the heap.
3514       Functionality includes the ability to view the objects in the
3515       heap and to tag these objects.
3516     </intro>
3517 
3518     <intro id="objectTags" label="Object Tags">
3519       A <i>tag</i> is a value associated with an object.
3520       Tags are explicitly set by the agent using the
3521       <functionlink id="SetTag"></functionlink> function or by
3522       callback functions such as <functionlink id="jvmtiHeapIterationCallback"/>.
3523       <p/>
3524       Tags are local to the environment; that is, the tags of one
3525       environment are not visible in another.
3526       <p/>
3527       Tags are <code>jlong</code> values which can be used
3528       simply to mark an object or to store a pointer to more detailed
3529       information.  Objects which have not been tagged have a
3530       tag of zero.
3531       Setting a tag to zero makes the object untagged.
3532     </intro>
3533 
3534     <intro id="heapCallbacks" label="Heap Callback Functions">
3535         Heap functions which iterate through the heap and recursively
3536         follow object references use agent supplied callback functions
3537         to deliver the information.
3538         <p/>
3539         These heap callback functions must adhere to the following restrictions --
3540         These callbacks must not use JNI functions.
3541         These callbacks must not use <jvmti/> functions except
3542         <i>callback safe</i> functions which
3543         specifically allow such use (see the raw monitor, memory management,
3544         and environment local storage functions).
3545         <p/>
3546         An implementation may invoke a callback on an internal thread or
3547         the thread which called the iteration function.
3548         Heap callbacks are single threaded -- no more than one callback will
3549         be invoked at a time.
3550         <p/>
3551         The Heap Filter Flags can be used to prevent reporting
3552         based on the tag status of an object or its class.
3553         If no flags are set (the <code>jint</code> is zero), objects
3554         will not be filtered out.
3555 
3556         <constants id="jvmtiHeapFilter" label="Heap Filter Flags" kind="bits">
3557           <constant id="JVMTI_HEAP_FILTER_TAGGED" num="0x4">
3558             Filter out tagged objects. Objects which are tagged are not included.
3559           </constant>
3560           <constant id="JVMTI_HEAP_FILTER_UNTAGGED" num="0x8">
3561             Filter out untagged objects. Objects which are not tagged are not included.
3562           </constant>
3563           <constant id="JVMTI_HEAP_FILTER_CLASS_TAGGED" num="0x10">
3564             Filter out objects with tagged classes. Objects whose class is tagged are not included.
3565           </constant>
3566           <constant id="JVMTI_HEAP_FILTER_CLASS_UNTAGGED" num="0x20">
3567             Filter out objects with untagged classes. Objects whose class is not tagged are not included.
3568           </constant>
3569         </constants>
3570 
3571         <p/>
3572         The Heap Visit Control Flags are returned by the heap callbacks
3573         and can be used to abort the iteration.  For the
3574         <functionlink id="jvmtiHeapReferenceCallback">Heap
3575         Reference Callback</functionlink>, it can also be used
3576         to prune the graph of traversed references
3577         (<code>JVMTI_VISIT_OBJECTS</code> is not set).
3578 
3579         <constants id="jvmtiHeapVisitControl"
3580                    label="Heap Visit Control Flags"
3581                    kind="bits"
3582                    since="1.1">
3583           <constant id="JVMTI_VISIT_OBJECTS" num="0x100">
3584             If we are visiting an object and if this callback
3585             was initiated by <functionlink id="FollowReferences"/>,
3586             traverse the references of this object.
3587             Otherwise ignored.
3588           </constant>
3589           <constant id="JVMTI_VISIT_ABORT" num="0x8000">
3590             Abort the iteration.  Ignore all other bits.
3591           </constant>
3592         </constants>
3593 
3594         <p/>
3595         The Heap Reference Enumeration is provided by the
3596         <functionlink id="jvmtiHeapReferenceCallback">Heap
3597         Reference Callback</functionlink> and
3598         <functionlink id="jvmtiPrimitiveFieldCallback">Primitive Field
3599         Callback</functionlink> to
3600         describe the kind of reference
3601         being reported.
3602 
3603         <constants id="jvmtiHeapReferenceKind"
3604                    label="Heap Reference Enumeration"
3605                    kind="enum"
3606                    since="1.1">
3607           <constant id="JVMTI_HEAP_REFERENCE_CLASS" num="1">
3608             Reference from an object to its class.
3609           </constant>
3610           <constant id="JVMTI_HEAP_REFERENCE_FIELD" num="2">
3611             Reference from an object to the value of one of its instance fields.
3612           </constant>
3613           <constant id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT" num="3">
3614             Reference from an array to one of its elements.
3615           </constant>
3616           <constant id="JVMTI_HEAP_REFERENCE_CLASS_LOADER" num="4">
3617             Reference from a class to its class loader.
3618           </constant>
3619           <constant id="JVMTI_HEAP_REFERENCE_SIGNERS" num="5">
3620             Reference from a class to its signers array.
3621           </constant>
3622           <constant id="JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN" num="6">
3623             Reference from a class to its protection domain.
3624           </constant>
3625           <constant id="JVMTI_HEAP_REFERENCE_INTERFACE" num="7">
3626             Reference from a class to one of its interfaces.
3627             Note: interfaces are defined via a constant pool reference,
3628             so the referenced interfaces may also be reported with a
3629             <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3630           </constant>
3631           <constant id="JVMTI_HEAP_REFERENCE_STATIC_FIELD" num="8">
3632             Reference from a class to the value of one of its static fields.
3633           </constant>
3634           <constant id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL" num="9">
3635             Reference from a class to a resolved entry in the constant pool.
3636           </constant>
3637           <constant id="JVMTI_HEAP_REFERENCE_SUPERCLASS" num="10">
3638             Reference from a class to its superclass.
3639             A callback is not sent if the superclass is <code>java.lang.Object</code>.
3640             Note: loaded classes define superclasses via a constant pool
3641             reference, so the referenced superclass may also be reported with
3642             a <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3643           </constant>
3644           <constant id="JVMTI_HEAP_REFERENCE_JNI_GLOBAL" num="21">
3645             Heap root reference: JNI global reference.
3646           </constant>
3647           <constant id="JVMTI_HEAP_REFERENCE_SYSTEM_CLASS" num="22">
3648             Heap root reference: System class.
3649           </constant>
3650           <constant id="JVMTI_HEAP_REFERENCE_MONITOR" num="23">
3651             Heap root reference: monitor.
3652           </constant>
3653           <constant id="JVMTI_HEAP_REFERENCE_STACK_LOCAL" num="24">
3654             Heap root reference: local variable on the stack.
3655           </constant>
3656           <constant id="JVMTI_HEAP_REFERENCE_JNI_LOCAL" num="25">
3657             Heap root reference: JNI local reference.
3658           </constant>
3659           <constant id="JVMTI_HEAP_REFERENCE_THREAD" num="26">
3660             Heap root reference: Thread.
3661           </constant>
3662           <constant id="JVMTI_HEAP_REFERENCE_OTHER" num="27">
3663             Heap root reference: other heap root reference.
3664           </constant>
3665         </constants>
3666 
3667         <p/>
3668         Definitions for the single character type descriptors of
3669         primitive types.
3670 
3671         <constants id="jvmtiPrimitiveType"
3672                    label="Primitive Type Enumeration"
3673                    kind="enum"
3674                    since="1.1">
3675           <constant id="JVMTI_PRIMITIVE_TYPE_BOOLEAN" num="90">
3676             'Z' - Java programming language <code>boolean</code> - JNI <code>jboolean</code>
3677           </constant>
3678           <constant id="JVMTI_PRIMITIVE_TYPE_BYTE" num="66">
3679             'B' - Java programming language <code>byte</code> - JNI <code>jbyte</code>
3680           </constant>
3681           <constant id="JVMTI_PRIMITIVE_TYPE_CHAR" num="67">
3682             'C' - Java programming language <code>char</code> - JNI <code>jchar</code>
3683           </constant>
3684           <constant id="JVMTI_PRIMITIVE_TYPE_SHORT" num="83">
3685             'S' - Java programming language <code>short</code> - JNI <code>jshort</code>
3686           </constant>
3687           <constant id="JVMTI_PRIMITIVE_TYPE_INT" num="73">
3688             'I' - Java programming language <code>int</code> - JNI <code>jint</code>
3689           </constant>
3690           <constant id="JVMTI_PRIMITIVE_TYPE_LONG" num="74">
3691             'J' - Java programming language <code>long</code> - JNI <code>jlong</code>
3692           </constant>
3693           <constant id="JVMTI_PRIMITIVE_TYPE_FLOAT" num="70">
3694             'F' - Java programming language <code>float</code> - JNI <code>jfloat</code>
3695           </constant>
3696           <constant id="JVMTI_PRIMITIVE_TYPE_DOUBLE" num="68">
3697             'D' - Java programming language <code>double</code> - JNI <code>jdouble</code>
3698           </constant>
3699         </constants>
3700     </intro>
3701 
3702       <typedef id="jvmtiHeapReferenceInfoField"
3703                label="Reference information structure for Field references"
3704                since="1.1">
3705         <description>
3706           Reference information returned for
3707           <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> and
3708           <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3709         </description>
3710         <field id="index">
3711           <jint/>
3712           <description>
3713             For <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>, the
3714             referrer object is not a class or an interface.
3715             In this case, <code>index</code> is the index of the field
3716             in the class of the referrer object.
3717             This class is referred to below as <i>C</i>.
3718             <p/>
3719             For <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
3720             the referrer object is a class (referred to below as <i>C</i>)
3721             or an interface (referred to below as <i>I</i>).
3722             In this case, <code>index</code> is the index of the field in
3723             that class or interface.
3724             <p/>
3725             If the referrer object is not an interface, then the field
3726             indices are determined as follows:
3727             <ul>
3728               <li>make a list of all the fields in <i>C</i> and its
3729                   superclasses, starting with all the fields in
3730                   <code>java.lang.Object</code> and ending with all the
3731                   fields in <i>C</i>.</li>
3732               <li>Within this list, put
3733                   the fields for a given class in the order returned by
3734                   <functionlink id="GetClassFields"/>.</li>
3735               <li>Assign the fields in this list indices
3736                   <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i>
3737                   is the count of the fields in all the interfaces
3738                   implemented by <i>C</i>.
3739                   Note that <i>C</i> implements all interfaces
3740                   directly implemented by its superclasses; as well
3741                   as all superinterfaces of these interfaces.</li>
3742             </ul>
3743             If the referrer object is an interface, then the field
3744             indices are determined as follows:
3745             <ul>
3746               <li>make a list of the fields directly declared in
3747                   <i>I</i>.</li>
3748               <li>Within this list, put
3749                   the fields in the order returned by
3750                   <functionlink id="GetClassFields"/>.</li>
3751               <li>Assign the fields in this list indices
3752                   <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i>
3753                   is the count of the fields in all the superinterfaces
3754                   of <i>I</i>.</li>
3755             </ul>
3756             All fields are included in this computation, regardless of
3757             field modifier (static, public, private, etc).
3758             <p/>
3759             For example, given the following classes and interfaces:
3760             <example>
3761 interface I0 {
3762     int p = 0;
3763 }
3764 
3765 interface I1 extends I0 {
3766     int x = 1;
3767 }
3768 
3769 interface I2 extends I0 {
3770     int y = 2;
3771 }
3772 
3773 class C1 implements I1 {
3774     public static int a = 3;
3775     private int b = 4;
3776 }
3777 
3778 class C2 extends C1 implements I2 {
3779     static int q = 5;
3780     final int r = 6;
3781 }
3782             </example>
3783             Assume that <functionlink id="GetClassFields"/> called on
3784             <code>C1</code> returns the fields of <code>C1</code> in the
3785             order: a, b; and that the fields of <code>C2</code> are
3786             returned in the order: q, r.
3787             An instance of class <code>C1</code> will have the
3788             following field indices:
3789             <blockquote><table>
3790               <tr>
3791                 <td class="centered">
3792                   a
3793                 </td>
3794                 <td class="centered">
3795                   2
3796                 </td>
3797                 <td>
3798                   The count of the fields in the interfaces
3799                   implemented by <code>C1</code> is two (<i>n</i>=2):
3800                   <code>p</code> of <code>I0</code>
3801                   and <code>x</code> of <code>I1</code>.
3802                 </td>
3803               </tr>
3804               <tr>
3805                 <td class="centered">
3806                   b
3807                 </td>
3808                 <td class="centered">
3809                   3
3810                 </td>
3811                 <td>
3812                   the subsequent index.
3813                 </td>
3814               </tr>
3815             </table></blockquote>
3816             The class <code>C1</code> will have the same field indices.
3817             <p/>
3818             An instance of class <code>C2</code> will have the
3819             following field indices:
3820             <blockquote><table>
3821               <tr>
3822                 <td class="centered">
3823                   a
3824                 </td>
3825                 <td class="centered">
3826                   3
3827                 </td>
3828                 <td>
3829                   The count of the fields in the interfaces
3830                   implemented by <code>C2</code> is three (<i>n</i>=3):
3831                   <code>p</code> of <code>I0</code>,
3832                   <code>x</code> of <code>I1</code> and <code>y</code> of <code>I2</code>
3833                   (an interface of <code>C2</code>).  Note that the field <code>p</code>
3834                   of <code>I0</code> is only included once.
3835                 </td>
3836               </tr>
3837               <tr>
3838                 <td class="centered">
3839                   b
3840                 </td>
3841                 <td class="centered">
3842                   4
3843                 </td>
3844                 <td>
3845                   the subsequent index to "a".
3846                 </td>
3847               </tr>
3848               <tr>
3849                 <td class="centered">
3850                   q
3851                 </td>
3852                 <td class="centered">
3853                   5
3854                 </td>
3855                 <td>
3856                   the subsequent index to "b".
3857                 </td>
3858               </tr>
3859               <tr>
3860                 <td class="centered">
3861                   r
3862                 </td>
3863                 <td class="centered">
3864                   6
3865                 </td>
3866                 <td>
3867                   the subsequent index to "q".
3868                 </td>
3869               </tr>
3870             </table></blockquote>
3871             The class <code>C2</code> will have the same field indices.
3872             Note that a field may have a different index depending on the
3873             object that is viewing it -- for example field "a" above.
3874             Note also: not all field indices may be visible from the
3875             callbacks, but all indices are shown for illustrative purposes.
3876             <p/>
3877             The interface <code>I1</code> will have the
3878             following field indices:
3879             <blockquote><table>
3880               <tr>
3881                 <td class="centered">
3882                   x
3883                 </td>
3884                 <td class="centered">
3885                   1
3886                 </td>
3887                 <td>
3888                   The count of the fields in the superinterfaces
3889                   of <code>I1</code> is one (<i>n</i>=1):
3890                   <code>p</code> of <code>I0</code>.
3891                 </td>
3892               </tr>
3893             </table></blockquote>
3894           </description>
3895         </field>
3896       </typedef>
3897 
3898       <typedef id="jvmtiHeapReferenceInfoArray"
3899                label="Reference information structure for Array references"
3900                since="1.1">
3901         <description>
3902           Reference information returned for
3903          <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3904         </description>
3905         <field id="index">
3906           <jint/>
3907           <description>
3908             The array index.
3909           </description>
3910         </field>
3911       </typedef>
3912 
3913       <typedef id="jvmtiHeapReferenceInfoConstantPool"
3914                label="Reference information structure for Constant Pool references"
3915                since="1.1">
3916         <description>
3917           Reference information returned for
3918           <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3919         </description>
3920         <field id="index">
3921           <jint/>
3922           <description>
3923             The index into the constant pool of the class. See the description in
3924       <vmspec chapter="4.4"/>.
3925           </description>
3926         </field>
3927       </typedef>
3928 
3929       <typedef id="jvmtiHeapReferenceInfoStackLocal"
3930                label="Reference information structure for Local Variable references"
3931                since="1.1">
3932         <description>
3933           Reference information returned for
3934           <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3935         </description>
3936         <field id="thread_tag">
3937           <jlong/>
3938           <description>
3939             The tag of the thread corresponding to this stack, zero if not tagged.
3940           </description>
3941         </field>
3942         <field id="thread_id">
3943           <jlong/>
3944           <description>
3945             The unique thread ID of the thread corresponding to this stack.
3946           </description>
3947         </field>
3948         <field id="depth">
3949           <jint/>
3950           <description>
3951             The depth of the frame.
3952           </description>
3953         </field>
3954         <field id="method">
3955           <jmethodID/>
3956           <description>
3957             The method executing in this frame.
3958           </description>
3959         </field>
3960         <field id="location">
3961           <jlocation/>
3962           <description>
3963             The currently executing location in this frame.
3964           </description>
3965         </field>
3966         <field id="slot">
3967           <jint/>
3968           <description>
3969             The slot number of the local variable.
3970           </description>
3971         </field>
3972       </typedef>
3973 
3974       <typedef id="jvmtiHeapReferenceInfoJniLocal"
3975                label="Reference information structure for JNI local references"
3976                since="1.1">
3977         <description>
3978           Reference information returned for
3979           <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3980         </description>
3981         <field id="thread_tag">
3982           <jlong/>
3983           <description>
3984             The tag of the thread corresponding to this stack, zero if not tagged.
3985           </description>
3986         </field>
3987         <field id="thread_id">
3988           <jlong/>
3989           <description>
3990             The unique thread ID of the thread corresponding to this stack.
3991           </description>
3992         </field>
3993         <field id="depth">
3994           <jint/>
3995           <description>
3996             The depth of the frame.
3997           </description>
3998         </field>
3999         <field id="method">
4000           <jmethodID/>
4001           <description>
4002             The method executing in this frame.
4003           </description>
4004         </field>
4005       </typedef>
4006 
4007       <typedef id="jvmtiHeapReferenceInfoReserved"
4008                label="Reference information structure for Other references"
4009                since="1.1">
4010         <description>
4011           Reference information returned for other references.
4012         </description>
4013         <field id="reserved1">
4014           <jlong/>
4015           <description>
4016             reserved for future use.
4017           </description>
4018         </field>
4019         <field id="reserved2">
4020           <jlong/>
4021           <description>
4022             reserved for future use.
4023           </description>
4024         </field>
4025         <field id="reserved3">
4026           <jlong/>
4027           <description>
4028             reserved for future use.
4029           </description>
4030         </field>
4031         <field id="reserved4">
4032           <jlong/>
4033           <description>
4034             reserved for future use.
4035           </description>
4036         </field>
4037         <field id="reserved5">
4038           <jlong/>
4039           <description>
4040             reserved for future use.
4041           </description>
4042         </field>
4043         <field id="reserved6">
4044           <jlong/>
4045           <description>
4046             reserved for future use.
4047           </description>
4048         </field>
4049         <field id="reserved7">
4050           <jlong/>
4051           <description>
4052             reserved for future use.
4053           </description>
4054         </field>
4055         <field id="reserved8">
4056           <jlong/>
4057           <description>
4058             reserved for future use.
4059           </description>
4060         </field>
4061       </typedef>
4062 
4063       <uniontypedef id="jvmtiHeapReferenceInfo"
4064                label="Reference information structure"
4065                since="1.1">
4066         <description>
4067           The information returned about referrers.
4068           Represented as a union of the various kinds of reference information.
4069         </description>
4070         <field id="field">
4071           <struct>jvmtiHeapReferenceInfoField</struct>
4072           <description>
4073             The referrer information for
4074             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>
4075             and <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
4076           </description>
4077         </field>
4078         <field id="array">
4079           <struct>jvmtiHeapReferenceInfoArray</struct>
4080           <description>
4081             The referrer information for
4082             For <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
4083           </description>
4084         </field>
4085         <field id="constant_pool">
4086           <struct>jvmtiHeapReferenceInfoConstantPool</struct>
4087           <description>
4088             The referrer information for
4089             For <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
4090           </description>
4091         </field>
4092         <field id="stack_local">
4093           <struct>jvmtiHeapReferenceInfoStackLocal</struct>
4094           <description>
4095             The referrer information for
4096             For <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
4097           </description>
4098         </field>
4099         <field id="jni_local">
4100           <struct>jvmtiHeapReferenceInfoJniLocal</struct>
4101           <description>
4102             The referrer information for
4103             For <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
4104           </description>
4105         </field>
4106         <field id="other">
4107           <struct>jvmtiHeapReferenceInfoReserved</struct>
4108           <description>
4109             reserved for future use.
4110           </description>
4111         </field>
4112       </uniontypedef>
4113 
4114       <typedef id="jvmtiHeapCallbacks"
4115                label="Heap callback function structure"
4116                since="1.1">
4117         <field id="heap_iteration_callback">
4118           <ptrtype>
4119             <struct>jvmtiHeapIterationCallback</struct>
4120           </ptrtype>
4121           <description>
4122             The callback to be called to describe an
4123             object in the heap. Used by the
4124             <functionlink id="IterateThroughHeap"/> function, ignored by the
4125             <functionlink id="FollowReferences"/> function.
4126           </description>
4127         </field>
4128         <field id="heap_reference_callback">
4129           <ptrtype>
4130             <struct>jvmtiHeapReferenceCallback</struct>
4131           </ptrtype>
4132           <description>
4133             The callback to be called to describe an
4134             object reference.  Used by the
4135             <functionlink id="FollowReferences"/> function, ignored by the
4136             <functionlink id="IterateThroughHeap"/> function.
4137           </description>
4138         </field>
4139         <field id="primitive_field_callback">
4140           <ptrtype>
4141             <struct>jvmtiPrimitiveFieldCallback</struct>
4142           </ptrtype>
4143           <description>
4144             The callback to be called to describe a
4145             primitive field.
4146           </description>
4147         </field>
4148         <field id="array_primitive_value_callback">
4149           <ptrtype>
4150             <struct>jvmtiArrayPrimitiveValueCallback</struct>
4151           </ptrtype>
4152           <description>
4153             The callback to be called to describe an
4154             array of primitive values.
4155           </description>
4156         </field>
4157         <field id="string_primitive_value_callback">
4158           <ptrtype>
4159             <struct>jvmtiStringPrimitiveValueCallback</struct>
4160           </ptrtype>
4161           <description>
4162             The callback to be called to describe a String value.
4163           </description>
4164         </field>
4165         <field id="reserved5">
4166           <ptrtype>
4167             <struct>jvmtiReservedCallback</struct>
4168           </ptrtype>
4169           <description>
4170             Reserved for future use..
4171           </description>
4172         </field>
4173         <field id="reserved6">
4174           <ptrtype>
4175             <struct>jvmtiReservedCallback</struct>
4176           </ptrtype>
4177           <description>
4178             Reserved for future use..
4179           </description>
4180         </field>
4181         <field id="reserved7">
4182           <ptrtype>
4183             <struct>jvmtiReservedCallback</struct>
4184           </ptrtype>
4185           <description>
4186             Reserved for future use..
4187           </description>
4188         </field>
4189         <field id="reserved8">
4190           <ptrtype>
4191             <struct>jvmtiReservedCallback</struct>
4192           </ptrtype>
4193           <description>
4194             Reserved for future use..
4195           </description>
4196         </field>
4197         <field id="reserved9">
4198           <ptrtype>
4199             <struct>jvmtiReservedCallback</struct>
4200           </ptrtype>
4201           <description>
4202             Reserved for future use..
4203           </description>
4204         </field>
4205         <field id="reserved10">
4206           <ptrtype>
4207             <struct>jvmtiReservedCallback</struct>
4208           </ptrtype>
4209           <description>
4210             Reserved for future use..
4211           </description>
4212         </field>
4213         <field id="reserved11">
4214           <ptrtype>
4215             <struct>jvmtiReservedCallback</struct>
4216           </ptrtype>
4217           <description>
4218             Reserved for future use..
4219           </description>
4220         </field>
4221         <field id="reserved12">
4222           <ptrtype>
4223             <struct>jvmtiReservedCallback</struct>
4224           </ptrtype>
4225           <description>
4226             Reserved for future use..
4227           </description>
4228         </field>
4229         <field id="reserved13">
4230           <ptrtype>
4231             <struct>jvmtiReservedCallback</struct>
4232           </ptrtype>
4233           <description>
4234             Reserved for future use..
4235           </description>
4236         </field>
4237         <field id="reserved14">
4238           <ptrtype>
4239             <struct>jvmtiReservedCallback</struct>
4240           </ptrtype>
4241           <description>
4242             Reserved for future use..
4243           </description>
4244         </field>
4245         <field id="reserved15">
4246           <ptrtype>
4247             <struct>jvmtiReservedCallback</struct>
4248           </ptrtype>
4249           <description>
4250             Reserved for future use..
4251           </description>
4252         </field>
4253       </typedef>
4254 
4255 
4256     <intro>
4257       <rationale>
4258         The heap dumping functionality (below) uses a callback
4259         for each object.  While it would seem that a buffered approach
4260         would provide better throughput, tests do
4261         not show this to be the case--possibly due to locality of
4262         memory reference or array access overhead.
4263       </rationale>
4264 
4265       <issue>
4266         Still under investigation as to if java.lang.ref references
4267         are reported as a different type of reference.
4268       </issue>
4269 
4270       <issue>
4271         Should or can an indication of the cost or relative cost of
4272         these operations be included?
4273       </issue>
4274 
4275     </intro>
4276 
4277     <callback id="jvmtiHeapIterationCallback" since="1.1">
4278       <jint/>
4279       <synopsis>Heap Iteration Callback</synopsis>
4280       <description>
4281         Agent supplied callback function.
4282         Describes (but does not pass in) an object in the heap.
4283         <p/>
4284         This function should return a bit vector of the desired
4285         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4286         This will determine if the entire iteration should be aborted
4287         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4288         <p/>
4289         See the <internallink id="heapCallbacks">heap callback
4290         function restrictions</internallink>.
4291       </description>
4292       <parameters>
4293         <param id="class_tag">
4294           <jlong/>
4295           <description>
4296             The tag of the class of object (zero if the class is not tagged).
4297             If the object represents a runtime class,
4298             the <code>class_tag</code> is the tag
4299             associated with <code>java.lang.Class</code>
4300             (zero if <code>java.lang.Class</code> is not tagged).
4301           </description>
4302         </param>
4303         <param id="size">
4304           <jlong/>
4305           <description>
4306             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
4307           </description>
4308         </param>
4309         <param id="tag_ptr">
4310           <outptr><jlong/></outptr>
4311           <description>
4312             The object tag value, or zero if the object is not tagged.
4313             To set the tag value to be associated with the object
4314             the agent sets the <code>jlong</code> pointed to by the parameter.
4315           </description>
4316         </param>
4317         <param id="length">
4318           <jint/>
4319           <description>
4320             If this object is an array, the length of the array. Otherwise negative one (-1).
4321           </description>
4322         </param>
4323         <param id="user_data">
4324           <outptr><void/></outptr>
4325           <description>
4326             The user supplied data that was passed into the iteration function.
4327           </description>
4328         </param>
4329       </parameters>
4330     </callback>
4331 
4332     <callback id="jvmtiHeapReferenceCallback" since="1.1">
4333       <jint/>
4334       <synopsis>Heap Reference Callback</synopsis>
4335       <description>
4336         Agent supplied callback function.
4337         Describes a reference from an object or the VM (the referrer) to another object
4338         (the referree) or a heap root to a referree.
4339         <p/>
4340         This function should return a bit vector of the desired
4341         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4342         This will determine if the objects referenced by the referree
4343         should be visited or if the entire iteration should be aborted.
4344         <p/>
4345         See the <internallink id="heapCallbacks">heap callback
4346         function restrictions</internallink>.
4347       </description>
4348       <parameters>
4349         <param id="reference_kind">
4350           <enum>jvmtiHeapReferenceKind</enum>
4351           <description>
4352             The kind of reference.
4353           </description>
4354         </param>
4355         <param id="reference_info">
4356           <inptr>
4357             <struct>jvmtiHeapReferenceInfo</struct>
4358           </inptr>
4359           <description>
4360             Details about the reference.
4361             Set when the <datalink id="jvmtiHeapReferenceCallback.reference_kind">reference_kind</datalink> is
4362             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>,
4363             <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
4364             <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/>,
4365             <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/>,
4366             <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/>,
4367             or <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/>.
4368             Otherwise <code>NULL</code>.
4369           </description>
4370         </param>
4371         <param id="class_tag">
4372           <jlong/>
4373           <description>
4374             The tag of the class of referree object (zero if the class is not tagged).
4375             If the referree object represents a runtime class,
4376             the <code>class_tag</code> is the tag
4377             associated with <code>java.lang.Class</code>
4378             (zero if <code>java.lang.Class</code> is not tagged).
4379           </description>
4380         </param>
4381         <param id="referrer_class_tag">
4382           <jlong/>
4383           <description>
4384             The tag of the class of the referrer object (zero if the class is not tagged
4385             or the referree is a heap root). If the referrer object represents a runtime
4386             class, the <code>referrer_class_tag</code> is the tag associated with
4387             the <code>java.lang.Class</code>
4388             (zero if <code>java.lang.Class</code> is not tagged).
4389           </description>
4390         </param>
4391         <param id="size">
4392           <jlong/>
4393           <description>
4394             Size of the referree object (in bytes).
4395             See <functionlink id="GetObjectSize"/>.
4396           </description>
4397         </param>
4398         <param id="tag_ptr">
4399           <outptr><jlong/></outptr>
4400           <description>
4401             Points to the referree object tag value, or zero if the object is not
4402             tagged.
4403             To set the tag value to be associated with the object
4404             the agent sets the <code>jlong</code> pointed to by the parameter.
4405           </description>
4406         </param>
4407         <param id="referrer_tag_ptr">
4408           <outptr><jlong/></outptr>
4409           <description>
4410             Points to the tag of the referrer object, or
4411             points to the zero if the referrer
4412             object is not tagged.
4413             <code>NULL</code> if the referrer in not an object (that is,
4414             this callback is reporting a heap root).
4415             To set the tag value to be associated with the referrer object
4416             the agent sets the <code>jlong</code> pointed to by the parameter.
4417             If this callback is reporting a reference from an object to itself,
4418             <code>referrer_tag_ptr == tag_ptr</code>.
4419           </description>
4420         </param>
4421         <param id="length">
4422           <jint/>
4423           <description>
4424             If this object is an array, the length of the array. Otherwise negative one (-1).
4425           </description>
4426         </param>
4427         <param id="user_data">
4428           <outptr><void/></outptr>
4429           <description>
4430             The user supplied data that was passed into the iteration function.
4431           </description>
4432         </param>
4433       </parameters>
4434     </callback>
4435 
4436     <callback id="jvmtiPrimitiveFieldCallback" since="1.1">
4437       <jint/>
4438       <synopsis>Primitive Field Callback</synopsis>
4439       <description>
4440         Agent supplied callback function which
4441         describes a primitive field of an object (<i>the object</i>).
4442         A primitive field is a field whose type is a primitive type.
4443         This callback will describe a static field if the object is a class,
4444         and otherwise will describe an instance field.
4445         <p/>
4446         This function should return a bit vector of the desired
4447         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4448         This will determine if the entire iteration should be aborted
4449         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4450         <p/>
4451         See the <internallink id="heapCallbacks">heap callback
4452         function restrictions</internallink>.
4453       </description>
4454       <parameters>
4455         <param id="kind">
4456           <enum>jvmtiHeapReferenceKind</enum>
4457           <description>
4458             The kind of field -- instance or static (<datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> or
4459             <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>).
4460           </description>
4461         </param>
4462         <param id="info">
4463           <inptr>
4464             <struct>jvmtiHeapReferenceInfo</struct>
4465           </inptr>
4466           <description>
4467             Which field (the field index).
4468           </description>
4469         </param>
4470         <param id="object_class_tag">
4471           <jlong/>
4472           <description>
4473             The tag of the class of the object (zero if the class is not tagged).
4474             If the object represents a runtime class, the
4475             <code>object_class_tag</code> is the tag
4476             associated with <code>java.lang.Class</code>
4477             (zero if <code>java.lang.Class</code> is not tagged).
4478           </description>
4479         </param>
4480         <param id="object_tag_ptr">
4481           <outptr><jlong/></outptr>
4482           <description>
4483             Points to the tag of the object, or zero if the object is not
4484             tagged.
4485             To set the tag value to be associated with the object
4486             the agent sets the <code>jlong</code> pointed to by the parameter.
4487           </description>
4488         </param>
4489         <param id="value">
4490           <jvalue/>
4491           <description>
4492             The value of the field.
4493           </description>
4494         </param>
4495         <param id="value_type">
4496           <enum>jvmtiPrimitiveType</enum>
4497           <description>
4498             The type of the field.
4499           </description>
4500         </param>
4501         <param id="user_data">
4502           <outptr><void/></outptr>
4503           <description>
4504             The user supplied data that was passed into the iteration function.
4505           </description>
4506         </param>
4507       </parameters>
4508     </callback>
4509 
4510     <callback id="jvmtiArrayPrimitiveValueCallback" since="1.1">
4511       <jint/>
4512       <synopsis>Array Primitive Value Callback</synopsis>
4513       <description>
4514         Agent supplied callback function.
4515         Describes the values in an array of a primitive type.
4516         <p/>
4517         This function should return a bit vector of the desired
4518         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4519         This will determine if the entire iteration should be aborted
4520         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4521         <p/>
4522         See the <internallink id="heapCallbacks">heap callback
4523         function restrictions</internallink>.
4524       </description>
4525       <parameters>
4526         <param id="class_tag">
4527           <jlong/>
4528           <description>
4529             The tag of the class of the array object (zero if the class is not tagged).
4530           </description>
4531         </param>
4532         <param id="size">
4533           <jlong/>
4534           <description>
4535             Size of the array (in bytes).
4536             See <functionlink id="GetObjectSize"/>.
4537           </description>
4538         </param>
4539         <param id="tag_ptr">
4540           <outptr><jlong/></outptr>
4541           <description>
4542             Points to the tag of the array object, or zero if the object is not
4543             tagged.
4544             To set the tag value to be associated with the object
4545             the agent sets the <code>jlong</code> pointed to by the parameter.
4546           </description>
4547         </param>
4548         <param id="element_count">
4549           <jint/>
4550           <description>
4551             The length of the primitive array.
4552           </description>
4553         </param>
4554         <param id="element_type">
4555           <enum>jvmtiPrimitiveType</enum>
4556           <description>
4557             The type of the elements of the array.
4558           </description>
4559         </param>
4560         <param id="elements">
4561           <vmbuf><void/></vmbuf>
4562           <description>
4563             The elements of the array in a packed array of <code>element_count</code>
4564             items of <code>element_type</code> size each.
4565           </description>
4566         </param>
4567         <param id="user_data">
4568           <outptr><void/></outptr>
4569           <description>
4570             The user supplied data that was passed into the iteration function.
4571           </description>
4572         </param>
4573       </parameters>
4574     </callback>
4575 
4576     <callback id="jvmtiStringPrimitiveValueCallback" since="1.1">
4577       <jint/>
4578       <synopsis>String Primitive Value Callback</synopsis>
4579       <description>
4580         Agent supplied callback function.
4581         Describes the value of a java.lang.String.
4582         <p/>
4583         This function should return a bit vector of the desired
4584         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4585         This will determine if the entire iteration should be aborted
4586         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4587         <p/>
4588         See the <internallink id="heapCallbacks">heap callback
4589         function restrictions</internallink>.
4590       </description>
4591       <parameters>
4592         <param id="class_tag">
4593           <jlong/>
4594           <description>
4595             The tag of the class of the String class (zero if the class is not tagged).
4596             <issue>Is this needed?</issue>
4597           </description>
4598         </param>
4599         <param id="size">
4600           <jlong/>
4601           <description>
4602             Size of the string (in bytes).
4603             See <functionlink id="GetObjectSize"/>.
4604           </description>
4605         </param>
4606         <param id="tag_ptr">
4607           <outptr><jlong/></outptr>
4608           <description>
4609             Points to the tag of the String object, or zero if the object is not
4610             tagged.
4611             To set the tag value to be associated with the object
4612             the agent sets the <code>jlong</code> pointed to by the parameter.
4613           </description>
4614         </param>
4615         <param id="value">
4616           <vmbuf><jchar/></vmbuf>
4617           <description>
4618             The value of the String, encoded as a Unicode string.
4619           </description>
4620         </param>
4621         <param id="value_length">
4622           <jint/>
4623           <description>
4624             The length of the string.
4625             The length is equal to the number of 16-bit Unicode
4626             characters in the string.
4627           </description>
4628         </param>
4629         <param id="user_data">
4630           <outptr><void/></outptr>
4631           <description>
4632             The user supplied data that was passed into the iteration function.
4633           </description>
4634         </param>
4635       </parameters>
4636     </callback>
4637 
4638 
4639     <callback id="jvmtiReservedCallback" since="1.1">
4640       <jint/>
4641       <synopsis>reserved for future use Callback</synopsis>
4642       <description>
4643         Placeholder -- reserved for future use.
4644       </description>
4645       <parameters>
4646       </parameters>
4647     </callback>
4648 
4649     <function id="FollowReferences" num="115" since="1.1">
4650       <synopsis>Follow References</synopsis>
4651       <description>
4652         This function initiates a traversal over the objects that are
4653         directly and indirectly reachable from the specified object or,
4654         if <code>initial_object</code> is not specified, all objects
4655         reachable from the heap roots.
4656         The heap root are the set of system classes,
4657         JNI globals, references from thread stacks, and other objects used as roots
4658         for the purposes of garbage collection.
4659         <p/>
4660         This function operates by traversing the reference graph.
4661         Let <i>A</i>, <i>B</i>, ... represent objects.
4662         When a reference from <i>A</i> to <i>B</i> is traversed,
4663         when a reference from a heap root to <i>B</i> is traversed,
4664         or when <i>B</i> is specified as the <paramlink id="initial_object"/>,
4665         then <i>B</i> is said to be <i>visited</i>.
4666         A reference from <i>A</i> to <i>B</i> is not traversed until <i>A</i>
4667         is visited.
4668         References are reported in the same order that the references are traversed.
4669         Object references are reported by invoking the agent supplied
4670         callback function <functionlink id="jvmtiHeapReferenceCallback"/>.
4671         In a reference from <i>A</i> to <i>B</i>, <i>A</i> is known
4672         as the <i>referrer</i> and <i>B</i> as the <i>referree</i>.
4673         The callback is invoked exactly once for each reference from a referrer;
4674         this is true even if there are reference cycles or multiple paths to
4675         the referrer.
4676         There may be more than one reference between a referrer and a referree,
4677         each reference is reported.
4678         These references may be distinguished by examining the
4679         <datalink
4680          id="jvmtiHeapReferenceCallback.reference_kind"><code>reference_kind</code></datalink>
4681          and
4682         <datalink
4683          id="jvmtiHeapReferenceCallback.reference_info"><code>reference_info</code></datalink>
4684         parameters of the <functionlink id="jvmtiHeapReferenceCallback"/> callback.
4685         <p/>
4686         This function reports a Java programming language view of object references,
4687         not a virtual machine implementation view. The following object references
4688         are reported when they are non-null:
4689         <ul>
4690           <li>Instance objects report references to each non-primitive instance fields
4691               (including inherited fields).</li>
4692           <li>Instance objects report a reference to the object type (class).</li>
4693           <li>Classes report a reference to the superclass and directly
4694               implemented/extended interfaces.</li>
4695           <li>Classes report a reference to the class loader, protection domain,
4696               signers, and resolved entries in the constant pool.</li>
4697           <li>Classes report a reference to each directly declared non-primitive
4698               static field.</li>
4699           <li>Arrays report a reference to the array type (class) and each
4700               array element.</li>
4701           <li>Primitive arrays report a reference to the array type.</li>
4702         </ul>
4703         <p/>
4704         This function can also be used to examine primitive (non-object) values.
4705         The primitive value of an array or String
4706         is reported after the object has been visited;
4707         it is reported by invoking the agent supplied callback function
4708         <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4709         <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4710         A primitive field
4711         is reported after the object with that field is visited;
4712         it is reported by invoking the agent supplied callback function
4713         <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4714         <p/>
4715         Whether a callback is provided or is <code>NULL</code> only determines
4716         whether the callback will be invoked, it does not influence
4717         which objects are visited nor does it influence whether other callbacks
4718         will be invoked.
4719         However, the
4720         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>
4721         returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4722         do determine if the objects referenced by the
4723         current object as visited.
4724         The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4725         and <paramlink id="klass"/> provided as parameters to this function
4726         do not control which objects are visited but they do control which
4727         objects and primitive values are reported by the callbacks.
4728         For example, if the only callback that was set is
4729         <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4730         is set to the array of bytes class, then only arrays of byte will be
4731         reported.
4732         The table below summarizes this:
4733         <p/>
4734         <table>
4735           <tr>
4736             <th/>
4737             <th>
4738               Controls objects visited
4739             </th>
4740             <th>
4741               Controls objects reported
4742             </th>
4743             <th>
4744               Controls primitives reported
4745             </th>
4746           </tr>
4747           <tr>
4748             <th class="leftAligned">
4749               the
4750               <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4751               returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4752             </th>
4753             <td class="centered">
4754               <b>Yes</b>
4755             </td>
4756             <td class="centered">
4757               <b>Yes</b>, since visits are controlled
4758             </td>
4759             <td class="centered">
4760               <b>Yes</b>, since visits are controlled
4761             </td>
4762           </tr>
4763           <tr>
4764             <th class="leftAligned">
4765               <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4766               in <paramlink id="callbacks"/> set
4767             </th>
4768             <td class="centered">
4769               No
4770             </td>
4771             <td class="centered">
4772               <b>Yes</b>
4773             </td>
4774             <td class="centered">
4775               No
4776             </td>
4777           </tr>
4778           <tr>
4779             <th class="leftAligned">
4780               <paramlink id="heap_filter"/>
4781             </th>
4782             <td class="centered">
4783               No
4784             </td>
4785             <td class="centered">
4786               <b>Yes</b>
4787             </td>
4788             <td class="centered">
4789               <b>Yes</b>
4790             </td>
4791           </tr>
4792           <tr>
4793             <th class="leftAligned">
4794               <paramlink id="klass"/>
4795             </th>
4796             <td class="centered">
4797               No
4798             </td>
4799             <td class="centered">
4800               <b>Yes</b>
4801             </td>
4802             <td class="centered">
4803               <b>Yes</b>
4804             </td>
4805           </tr>
4806         </table>
4807         <p/>
4808         During the execution of this function the state of the heap
4809         does not change: no objects are allocated, no objects are
4810         garbage collected, and the state of objects (including
4811         held values) does not change.
4812         As a result, threads executing Java
4813         programming language code, threads attempting to resume the
4814         execution of Java programming language code, and threads
4815         attempting to execute JNI functions are typically stalled.
4816       </description>
4817       <origin>new</origin>
4818       <capabilities>
4819         <required id="can_tag_objects"></required>
4820       </capabilities>
4821       <parameters>
4822         <param id="heap_filter">
4823           <jint/>
4824           <description>
4825             This bit vector of
4826             <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4827             restricts the objects for which the callback function is called.
4828             This applies to both the object and primitive callbacks.
4829           </description>
4830         </param>
4831         <param id="klass">
4832           <ptrtype>
4833             <jclass/>
4834             <nullok>callbacks are not limited to instances of a particular
4835                     class</nullok>
4836           </ptrtype>
4837           <description>
4838             Callbacks are only reported when the object is an instance of
4839             this class.
4840             Objects which are instances of a subclass of <code>klass</code>
4841             are not reported.
4842             If <code>klass</code> is an interface, no objects are reported.
4843             This applies to both the object and primitive callbacks.
4844           </description>
4845         </param>
4846         <param id="initial_object">
4847           <ptrtype>
4848             <jobject/>
4849             <nullok>references are followed from the heap roots</nullok>
4850           </ptrtype>
4851           <description>
4852             The object to follow
4853           </description>
4854         </param>
4855         <param id="callbacks">
4856           <inptr>
4857             <struct>jvmtiHeapCallbacks</struct>
4858           </inptr>
4859           <description>
4860             Structure defining the set of callback functions.
4861           </description>
4862         </param>
4863         <param id="user_data">
4864           <inbuf>
4865             <void/>
4866             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4867           </inbuf>
4868           <description>
4869             User supplied data to be passed to the callback.
4870           </description>
4871         </param>
4872       </parameters>
4873       <errors>
4874         <error id="JVMTI_ERROR_INVALID_CLASS">
4875           <paramlink id="klass"/> is not a valid class.
4876         </error>
4877         <error id="JVMTI_ERROR_INVALID_OBJECT">
4878           <paramlink id="initial_object"/> is not a valid object.
4879         </error>
4880       </errors>
4881     </function>
4882 
4883 
4884     <function id="IterateThroughHeap" num="116" since="1.1">
4885       <synopsis>Iterate Through Heap</synopsis>
4886       <description>
4887         Initiate an iteration over all objects in the heap.
4888         This includes both reachable and
4889         unreachable objects. Objects are visited in no particular order.
4890         <p/>
4891         Heap objects are reported by invoking the agent supplied
4892         callback function <functionlink id="jvmtiHeapIterationCallback"/>.
4893         References between objects are not reported.
4894         If only reachable objects are desired, or if object reference information
4895         is needed, use <functionlink id="FollowReferences"/>.
4896         <p/>
4897         This function can also be used to examine primitive (non-object) values.
4898         The primitive value of an array or String
4899         is reported after the object has been visited;
4900         it is reported by invoking the agent supplied callback function
4901         <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4902         <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4903         A primitive field
4904         is reported after the object with that field is visited;
4905         it is reported by invoking the agent supplied
4906         callback function
4907         <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4908         <p/>
4909         Unless the iteration is aborted by the
4910         <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4911         returned by a callback, all objects in the heap are visited.
4912         Whether a callback is provided or is <code>NULL</code> only determines
4913         whether the callback will be invoked, it does not influence
4914         which objects are visited nor does it influence whether other callbacks
4915         will be invoked.
4916         The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4917         and <paramlink id="klass"/> provided as parameters to this function
4918         do not control which objects are visited but they do control which
4919         objects and primitive values are reported by the callbacks.
4920         For example, if the only callback that was set is
4921         <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4922         is set to the array of bytes class, then only arrays of byte will be
4923         reported. The table below summarizes this (contrast this with
4924         <functionlink id="FollowReferences"/>):
4925         <p/>
4926         <table>
4927           <tr>
4928             <th/>
4929             <th>
4930               Controls objects visited
4931             </th>
4932             <th>
4933               Controls objects reported
4934             </th>
4935             <th>
4936               Controls primitives reported
4937             </th>
4938           </tr>
4939           <tr>
4940             <th class="leftAligned">
4941               the
4942               <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4943               returned by <functionlink id="jvmtiHeapIterationCallback"/>
4944             </th>
4945             <td class="centered">
4946               No<br/>(unless they abort the iteration)
4947             </td>
4948             <td class="centered">
4949               No<br/>(unless they abort the iteration)
4950             </td>
4951             <td class="centered">
4952               No<br/>(unless they abort the iteration)
4953             </td>
4954           </tr>
4955           <tr>
4956             <th class="leftAligned">
4957               <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4958               in <paramlink id="callbacks"/> set
4959             </th>
4960             <td class="centered">
4961               No
4962             </td>
4963             <td class="centered">
4964               <b>Yes</b>
4965             </td>
4966             <td class="centered">
4967               No
4968             </td>
4969           </tr>
4970           <tr>
4971             <th class="leftAligned">
4972               <paramlink id="heap_filter"/>
4973             </th>
4974             <td class="centered">
4975               No
4976             </td>
4977             <td class="centered">
4978               <b>Yes</b>
4979             </td>
4980             <td class="centered">
4981               <b>Yes</b>
4982             </td>
4983           </tr>
4984           <tr>
4985             <th class="leftAligned">
4986               <paramlink id="klass"/>
4987             </th>
4988             <td class="centered">
4989               No
4990             </td>
4991             <td class="centered">
4992               <b>Yes</b>
4993             </td>
4994             <td class="centered">
4995               <b>Yes</b>
4996             </td>
4997           </tr>
4998         </table>
4999         <p/>
5000         During the execution of this function the state of the heap
5001         does not change: no objects are allocated, no objects are
5002         garbage collected, and the state of objects (including
5003         held values) does not change.
5004         As a result, threads executing Java
5005         programming language code, threads attempting to resume the
5006         execution of Java programming language code, and threads
5007         attempting to execute JNI functions are typically stalled.
5008       </description>
5009       <origin>new</origin>
5010       <capabilities>
5011         <required id="can_tag_objects"></required>
5012       </capabilities>
5013       <parameters>
5014         <param id="heap_filter">
5015           <jint/>
5016           <description>
5017             This bit vector of
5018             <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
5019             restricts the objects for which the callback function is called.
5020             This applies to both the object and primitive callbacks.
5021           </description>
5022         </param>
5023         <param id="klass">
5024           <ptrtype>
5025             <jclass/>
5026             <nullok>callbacks are not limited to instances of a particular class</nullok>
5027           </ptrtype>
5028           <description>
5029             Callbacks are only reported when the object is an instance of
5030             this class.
5031             Objects which are instances of a subclass of <code>klass</code>
5032             are not reported.
5033             If <code>klass</code> is an interface, no objects are reported.
5034             This applies to both the object and primitive callbacks.
5035           </description>
5036         </param>
5037         <param id="callbacks">
5038           <inptr>
5039             <struct>jvmtiHeapCallbacks</struct>
5040           </inptr>
5041           <description>
5042             Structure defining the set callback functions.
5043           </description>
5044         </param>
5045         <param id="user_data">
5046           <inbuf>
5047             <void/>
5048             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5049           </inbuf>
5050           <description>
5051             User supplied data to be passed to the callback.
5052           </description>
5053         </param>
5054       </parameters>
5055       <errors>
5056         <error id="JVMTI_ERROR_INVALID_CLASS">
5057           <paramlink id="klass"/> is not a valid class.
5058         </error>
5059       </errors>
5060     </function>
5061 
5062     <function id="GetTag" phase="start" num="106">
5063       <synopsis>Get Tag</synopsis>
5064       <description>
5065         Retrieve the tag associated with an object.
5066         The tag is a long value typically used to store a
5067         unique identifier or pointer to object information.
5068         The tag is set with
5069         <functionlink id="SetTag"></functionlink>.
5070         Objects for which no tags have been set return a
5071         tag value of zero.
5072       </description>
5073       <origin>new</origin>
5074       <capabilities>
5075         <required id="can_tag_objects"></required>
5076       </capabilities>
5077       <parameters>
5078         <param id="object">
5079           <jobject/>
5080             <description>
5081               The object whose tag is to be retrieved.
5082             </description>
5083         </param>
5084         <param id="tag_ptr">
5085           <outptr><jlong/></outptr>
5086           <description>
5087             On return, the referenced long is set to the value
5088             of the tag.
5089           </description>
5090         </param>
5091       </parameters>
5092       <errors>
5093       </errors>
5094     </function>
5095 
5096     <function id="SetTag" phase="start" num="107">
5097       <synopsis>Set Tag</synopsis>
5098       <description>
5099         Set the tag associated with an object.
5100         The tag is a long value typically used to store a
5101         unique identifier or pointer to object information.
5102         The tag is visible with
5103         <functionlink id="GetTag"></functionlink>.
5104       </description>
5105       <origin>new</origin>
5106       <capabilities>
5107         <required id="can_tag_objects"></required>
5108       </capabilities>
5109       <parameters>
5110         <param id="object">
5111           <jobject/>
5112             <description>
5113               The object whose tag is to be set.
5114             </description>
5115         </param>
5116         <param id="tag">
5117           <jlong/>
5118           <description>
5119             The new value of the tag.
5120           </description>
5121         </param>
5122       </parameters>
5123       <errors>
5124       </errors>
5125     </function>
5126 
5127     <function id="GetObjectsWithTags" num="114">
5128       <synopsis>Get Objects With Tags</synopsis>
5129       <description>
5130         Return objects in the heap with the specified tags.
5131         The format is parallel arrays of objects and tags.
5132       </description>
5133       <origin>new</origin>
5134       <capabilities>
5135         <required id="can_tag_objects"></required>
5136       </capabilities>
5137       <parameters>
5138         <param id="tag_count">
5139           <jint min="0"/>
5140             <description>
5141               Number of tags to scan for.
5142             </description>
5143         </param>
5144         <param id="tags">
5145           <inbuf incount="tag_count">
5146             <jlong/>
5147           </inbuf>
5148             <description>
5149               Scan for objects with these tags.
5150               Zero is not permitted in this array.
5151             </description>
5152         </param>
5153         <param id="count_ptr">
5154           <outptr>
5155             <jint/>
5156           </outptr>
5157             <description>
5158               Return the number of objects with any of the tags
5159               in <paramlink id="tags"/>.
5160             </description>
5161         </param>
5162         <param id="object_result_ptr">
5163           <allocbuf outcount="count_ptr">
5164             <jobject/>
5165             <nullok>this information is not returned</nullok>
5166           </allocbuf>
5167             <description>
5168               Returns the array of objects with any of the tags
5169               in <paramlink id="tags"/>.
5170             </description>
5171         </param>
5172         <param id="tag_result_ptr">
5173           <allocbuf outcount="count_ptr">
5174             <jlong/>
5175             <nullok>this information is not returned</nullok>
5176           </allocbuf>
5177             <description>
5178               For each object in <paramlink id="object_result_ptr"/>,
5179               return the tag at the corresponding index.
5180             </description>
5181         </param>
5182       </parameters>
5183       <errors>
5184         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
5185           Zero is present in <paramlink id="tags"></paramlink>.
5186         </error>
5187       </errors>
5188     </function>
5189 
5190     <function id="ForceGarbageCollection" num="108">
5191       <synopsis>Force Garbage Collection</synopsis>
5192       <description>
5193         Force the VM to perform a garbage collection.
5194         The garbage collection is as complete as possible.
5195         This function does not cause finalizers to be run.
5196         This function does not return until the garbage collection
5197         is finished.
5198         <p/>
5199         Although garbage collection is as complete
5200         as possible there is no guarantee that all
5201         <eventlink id="ObjectFree"/>
5202         events will have been
5203         sent by the time that this function
5204         returns. In particular, an object may be
5205         prevented from being freed because it
5206         is awaiting finalization.
5207       </description>
5208       <origin>new</origin>
5209       <capabilities>
5210       </capabilities>
5211       <parameters>
5212       </parameters>
5213       <errors>
5214       </errors>
5215     </function>
5216 
5217 
5218   </category>
5219 
5220   <category id="Heap_1_0" label="Heap (1.0)">
5221     <intro>
5222       <b>
5223         These functions and data types were introduced in the original
5224         <jvmti/> version 1.0 and have been superseded by more
5225       </b>
5226       <internallink id="Heap"><b>powerful and flexible versions</b></internallink>
5227       <b>
5228         which:
5229       </b>
5230       <ul>
5231         <li>
5232           <b>
5233             Allow access to primitive values (the value of Strings, arrays,
5234             and primitive fields)
5235           </b>
5236         </li>
5237         <li>
5238           <b>
5239             Allow the tag of the referrer to be set, thus enabling more
5240             efficient localized reference graph building
5241           </b>
5242         </li>
5243         <li>
5244           <b>
5245             Provide more extensive filtering abilities
5246           </b>
5247         </li>
5248         <li>
5249           <b>
5250             Are extensible, allowing their abilities to grow in future versions of <jvmti/>
5251           </b>
5252         </li>
5253       </ul>
5254       <p/>
5255       <b>Please use the </b>
5256       <internallink id="Heap"><b>current Heap functions</b></internallink>.
5257         <p/>
5258         <constants id="jvmtiHeapObjectFilter" label="Heap Object Filter Enumeration" kind="enum">
5259           <constant id="JVMTI_HEAP_OBJECT_TAGGED" num="1">
5260             Tagged objects only.
5261           </constant>
5262           <constant id="JVMTI_HEAP_OBJECT_UNTAGGED" num="2">
5263             Untagged objects only.
5264           </constant>
5265           <constant id="JVMTI_HEAP_OBJECT_EITHER" num="3">
5266             Either tagged or untagged objects.
5267           </constant>
5268         </constants>
5269 
5270         <constants id="jvmtiHeapRootKind" label="Heap Root Kind Enumeration" kind="enum">
5271           <constant id="JVMTI_HEAP_ROOT_JNI_GLOBAL" num="1">
5272             JNI global reference.
5273           </constant>
5274           <constant id="JVMTI_HEAP_ROOT_SYSTEM_CLASS" num="2">
5275             System class.
5276           </constant>
5277           <constant id="JVMTI_HEAP_ROOT_MONITOR" num="3">
5278             Monitor.
5279           </constant>
5280           <constant id="JVMTI_HEAP_ROOT_STACK_LOCAL" num="4">
5281             Stack local.
5282           </constant>
5283           <constant id="JVMTI_HEAP_ROOT_JNI_LOCAL" num="5">
5284             JNI local reference.
5285           </constant>
5286           <constant id="JVMTI_HEAP_ROOT_THREAD" num="6">
5287             Thread.
5288           </constant>
5289           <constant id="JVMTI_HEAP_ROOT_OTHER" num="7">
5290             Other.
5291           </constant>
5292         </constants>
5293 
5294         <constants id="jvmtiObjectReferenceKind" label="Object Reference Enumeration" kind="enum">
5295           <constant id="JVMTI_REFERENCE_CLASS" num="1">
5296             Reference from an object to its class.
5297           </constant>
5298           <constant id="JVMTI_REFERENCE_FIELD" num="2">
5299             Reference from an object to the value of one of its instance fields.
5300             For references of this kind the <code>referrer_index</code>
5301             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5302             jvmtiObjectReferenceCallback</internallink> is the index of the
5303             the instance field. The index is based on the order of all the
5304             object's fields. This includes all fields of the directly declared
5305             static and instance fields in the class, and includes all fields (both
5306             public and private) fields declared in superclasses and superinterfaces.
5307             The index is thus calculated by summing the index of the field in the directly
5308             declared class (see <functionlink id="GetClassFields"/>), with the total
5309             number of fields (both public and private) declared in all superclasses
5310             and superinterfaces. The index starts at zero.
5311           </constant>
5312           <constant id="JVMTI_REFERENCE_ARRAY_ELEMENT" num="3">
5313             Reference from an array to one of its elements.
5314             For references of this kind the <code>referrer_index</code>
5315             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5316             jvmtiObjectReferenceCallback</internallink> is the array index.
5317           </constant>
5318           <constant id="JVMTI_REFERENCE_CLASS_LOADER" num="4">
5319             Reference from a class to its class loader.
5320           </constant>
5321           <constant id="JVMTI_REFERENCE_SIGNERS" num="5">
5322             Reference from a class to its signers array.
5323           </constant>
5324           <constant id="JVMTI_REFERENCE_PROTECTION_DOMAIN" num="6">
5325             Reference from a class to its protection domain.
5326           </constant>
5327           <constant id="JVMTI_REFERENCE_INTERFACE" num="7">
5328             Reference from a class to one of its interfaces.
5329           </constant>
5330           <constant id="JVMTI_REFERENCE_STATIC_FIELD" num="8">
5331             Reference from a class to the value of one of its static fields.
5332             For references of this kind the <code>referrer_index</code>
5333             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5334             jvmtiObjectReferenceCallback</internallink> is the index of the
5335             the static field. The index is based on the order of all the
5336             object's fields. This includes all fields of the directly declared
5337             static and instance fields in the class, and includes all fields (both
5338             public and private) fields declared in superclasses and superinterfaces.
5339             The index is thus calculated by summing the index of the field in the directly
5340             declared class (see <functionlink id="GetClassFields"/>), with the total
5341             number of fields (both public and private) declared in all superclasses
5342             and superinterfaces. The index starts at zero.
5343             Note: this definition differs from that in the <jvmti/> 1.0 Specification.
5344             <rationale>No known implementations used the 1.0 definition.</rationale>
5345           </constant>
5346           <constant id="JVMTI_REFERENCE_CONSTANT_POOL" num="9">
5347             Reference from a class to a resolved entry in the constant pool.
5348             For references of this kind the <code>referrer_index</code>
5349             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5350             jvmtiObjectReferenceCallback</internallink> is the index into
5351             constant pool table of the class, starting at 1. See
5352             <vmspec chapter="4.4"/>.
5353           </constant>
5354         </constants>
5355 
5356         <constants id="jvmtiIterationControl" label="Iteration Control Enumeration" kind="enum">
5357           <constant id="JVMTI_ITERATION_CONTINUE" num="1">
5358             Continue the iteration.
5359             If this is a reference iteration, follow the references of this object.
5360           </constant>
5361           <constant id="JVMTI_ITERATION_IGNORE" num="2">
5362             Continue the iteration.
5363             If this is a reference iteration, ignore the references of this object.
5364           </constant>
5365           <constant id="JVMTI_ITERATION_ABORT" num="0">
5366             Abort the iteration.
5367           </constant>
5368         </constants>
5369     </intro>
5370 
5371     <callback id="jvmtiHeapObjectCallback">
5372       <enum>jvmtiIterationControl</enum>
5373       <synopsis>Heap Object Callback</synopsis>
5374       <description>
5375         Agent supplied callback function.
5376         Describes (but does not pass in) an object in the heap.
5377         <p/>
5378         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5379         or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5380         <p/>
5381         See the <internallink id="heapCallbacks">heap callback
5382         function restrictions</internallink>.
5383       </description>
5384       <parameters>
5385         <param id="class_tag">
5386           <jlong/>
5387           <description>
5388             The tag of the class of object (zero if the class is not tagged).
5389             If the object represents a runtime class,
5390             the <code>class_tag</code> is the tag
5391             associated with <code>java.lang.Class</code>
5392             (zero if <code>java.lang.Class</code> is not tagged).
5393           </description>
5394         </param>
5395         <param id="size">
5396           <jlong/>
5397           <description>
5398             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5399           </description>
5400         </param>
5401         <param id="tag_ptr">
5402           <outptr><jlong/></outptr>
5403           <description>
5404             The object tag value, or zero if the object is not tagged.
5405             To set the tag value to be associated with the object
5406             the agent sets the <code>jlong</code> pointed to by the parameter.
5407           </description>
5408         </param>
5409         <param id="user_data">
5410           <outptr><void/></outptr>
5411           <description>
5412             The user supplied data that was passed into the iteration function.
5413           </description>
5414         </param>
5415       </parameters>
5416     </callback>
5417 
5418     <callback id="jvmtiHeapRootCallback">
5419       <enum>jvmtiIterationControl</enum>
5420       <synopsis>Heap Root Object Callback</synopsis>
5421       <description>
5422         Agent supplied callback function.
5423         Describes (but does not pass in) an object that is a root for the purposes
5424         of garbage collection.
5425         <p/>
5426         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5427         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5428         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5429         <p/>
5430         See the <internallink id="heapCallbacks">heap callback
5431         function restrictions</internallink>.
5432       </description>
5433       <parameters>
5434         <param id="root_kind">
5435           <enum>jvmtiHeapRootKind</enum>
5436           <description>
5437             The kind of heap root.
5438           </description>
5439         </param>
5440         <param id="class_tag">
5441           <jlong/>
5442           <description>
5443             The tag of the class of object (zero if the class is not tagged).
5444             If the object represents a runtime class, the <code>class_tag</code> is the tag
5445             associated with <code>java.lang.Class</code>
5446             (zero if <code>java.lang.Class</code> is not tagged).
5447           </description>
5448         </param>
5449         <param id="size">
5450           <jlong/>
5451           <description>
5452             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5453           </description>
5454         </param>
5455         <param id="tag_ptr">
5456           <outptr><jlong/></outptr>
5457           <description>
5458             The object tag value, or zero if the object is not tagged.
5459             To set the tag value to be associated with the object
5460             the agent sets the <code>jlong</code> pointed to by the parameter.
5461           </description>
5462         </param>
5463         <param id="user_data">
5464           <outptr><void/></outptr>
5465           <description>
5466             The user supplied data that was passed into the iteration function.
5467           </description>
5468         </param>
5469       </parameters>
5470     </callback>
5471 
5472     <callback id="jvmtiStackReferenceCallback">
5473       <enum>jvmtiIterationControl</enum>
5474       <synopsis>Stack Reference Object Callback</synopsis>
5475       <description>
5476         Agent supplied callback function.
5477         Describes (but does not pass in) an object on the stack that is a root for
5478         the purposes of garbage collection.
5479         <p/>
5480         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5481         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5482         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5483         <p/>
5484         See the <internallink id="heapCallbacks">heap callback
5485         function restrictions</internallink>.
5486       </description>
5487       <parameters>
5488         <param id="root_kind">
5489           <enum>jvmtiHeapRootKind</enum>
5490           <description>
5491             The kind of root (either <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5492             <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>).
5493           </description>
5494         </param>
5495         <param id="class_tag">
5496           <jlong/>
5497           <description>
5498            The tag of the class of object (zero if the class is not tagged).
5499            If the object represents a runtime class, the  <code>class_tag</code> is the tag
5500            associated with <code>java.lang.Class</code>
5501            (zero if <code>java.lang.Class</code> is not tagged).
5502           </description>
5503         </param>
5504         <param id="size">
5505           <jlong/>
5506           <description>
5507             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5508           </description>
5509         </param>
5510         <param id="tag_ptr">
5511           <outptr><jlong/></outptr>
5512           <description>
5513             The object tag value, or zero if the object is not tagged.
5514             To set the tag value to be associated with the object
5515             the agent sets the <code>jlong</code> pointed to by the parameter.
5516           </description>
5517         </param>
5518         <param id="thread_tag">
5519           <jlong/>
5520           <description>
5521             The tag of the thread corresponding to this stack, zero if not tagged.
5522           </description>
5523         </param>
5524         <param id="depth">
5525           <jint/>
5526           <description>
5527             The depth of the frame.
5528           </description>
5529         </param>
5530         <param id="method">
5531           <jmethodID/>
5532           <description>
5533             The method executing in this frame.
5534           </description>
5535         </param>
5536         <param id="slot">
5537           <jint/>
5538           <description>
5539             The slot number.
5540           </description>
5541         </param>
5542         <param id="user_data">
5543           <outptr><void/></outptr>
5544           <description>
5545             The user supplied data that was passed into the iteration function.
5546           </description>
5547         </param>
5548       </parameters>
5549     </callback>
5550 
5551     <callback id="jvmtiObjectReferenceCallback">
5552       <enum>jvmtiIterationControl</enum>
5553       <synopsis>Object Reference Callback</synopsis>
5554       <description>
5555         Agent supplied callback function.
5556         Describes a reference from an object (the referrer) to another object
5557         (the referree).
5558         <p/>
5559         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5560         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5561         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5562         <p/>
5563         See the <internallink id="heapCallbacks">heap callback
5564         function restrictions</internallink>.
5565       </description>
5566       <parameters>
5567         <param id="reference_kind">
5568           <enum>jvmtiObjectReferenceKind</enum>
5569           <description>
5570             The type of reference.
5571           </description>
5572         </param>
5573         <param id="class_tag">
5574           <jlong/>
5575           <description>
5576             The tag of the class of referree object (zero if the class is not tagged).
5577             If the referree object represents a runtime class,
5578             the  <code>class_tag</code> is the tag
5579             associated with <code>java.lang.Class</code>
5580             (zero if <code>java.lang.Class</code> is not tagged).
5581           </description>
5582         </param>
5583         <param id="size">
5584           <jlong/>
5585           <description>
5586             Size of the referree object (in bytes).
5587             See <functionlink id="GetObjectSize"/>.
5588           </description>
5589         </param>
5590         <param id="tag_ptr">
5591           <outptr><jlong/></outptr>
5592           <description>
5593             The referree object tag value, or zero if the object is not
5594             tagged.
5595             To set the tag value to be associated with the object
5596             the agent sets the <code>jlong</code> pointed to by the parameter.
5597           </description>
5598         </param>
5599         <param id="referrer_tag">
5600           <jlong/>
5601           <description>
5602             The tag of the referrer object, or zero if the referrer
5603             object is not tagged.
5604           </description>
5605         </param>
5606         <param id="referrer_index">
5607           <jint/>
5608           <description>
5609             For references of type <code>JVMTI_REFERENCE_FIELD</code> or
5610             <code>JVMTI_REFERENCE_STATIC_FIELD</code> the index
5611             of the field in the referrer object. The index is based on the
5612             order of all the object's fields - see <internallink
5613             id="JVMTI_REFERENCE_FIELD">JVMTI_REFERENCE_FIELD</internallink>
5614             or <internallink
5615             id="JVMTI_REFERENCE_STATIC_FIELD">JVMTI_REFERENCE_STATIC_FIELD
5616             </internallink> for further description.
5617             <p/>
5618             For references of type <code>JVMTI_REFERENCE_ARRAY_ELEMENT</code>
5619             the array index - see <internallink id="JVMTI_REFERENCE_ARRAY_ELEMENT">
5620             JVMTI_REFERENCE_ARRAY_ELEMENT</internallink> for further description.
5621             <p/>
5622             For references of type <code>JVMTI_REFERENCE_CONSTANT_POOL</code>
5623             the index into the constant pool of the class - see
5624             <internallink id="JVMTI_REFERENCE_CONSTANT_POOL">
5625             JVMTI_REFERENCE_CONSTANT_POOL</internallink> for further
5626             description.
5627             <p/>
5628             For references of other kinds the <code>referrer_index</code> is
5629             <code>-1</code>.
5630           </description>
5631         </param>
5632         <param id="user_data">
5633           <outptr><void/></outptr>
5634           <description>
5635             The user supplied data that was passed into the iteration function.
5636           </description>
5637         </param>
5638       </parameters>
5639     </callback>
5640 
5641     <function id="IterateOverObjectsReachableFromObject" num="109">
5642       <synopsis>Iterate Over Objects Reachable From Object</synopsis>
5643       <description>
5644         This function iterates over all objects that are directly
5645         and indirectly reachable from the specified object.
5646         For each object <i>A</i> (known
5647         as the referrer) with a reference to object <i>B</i> the specified
5648         callback function is called to describe the object reference.
5649         The callback is called exactly once for each reference from a referrer;
5650         this is true even if there are reference cycles or multiple paths to
5651         the referrer.
5652         There may be more than one reference between a referrer and a referree,
5653         These may be distinguished by the
5654         <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5655         <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5656         The callback for an object will always occur after the callback for
5657         its referrer.
5658         <p/>
5659         See <functionlink id="FollowReferences"/> for the object
5660         references which are reported.
5661         <p/>
5662         During the execution of this function the state of the heap
5663         does not change: no objects are allocated, no objects are
5664         garbage collected, and the state of objects (including
5665         held values) does not change.
5666         As a result, threads executing Java
5667         programming language code, threads attempting to resume the
5668         execution of Java programming language code, and threads
5669         attempting to execute JNI functions are typically stalled.
5670       </description>
5671       <origin>new</origin>
5672       <capabilities>
5673         <required id="can_tag_objects"></required>
5674       </capabilities>
5675       <parameters>
5676         <param id="object">
5677           <jobject/>
5678             <description>
5679               The object
5680             </description>
5681         </param>
5682         <param id="object_reference_callback">
5683           <ptrtype>
5684             <struct>jvmtiObjectReferenceCallback</struct>
5685           </ptrtype>
5686             <description>
5687               The callback to be called to describe each
5688               object reference.
5689             </description>
5690         </param>
5691         <param id="user_data">
5692           <inbuf>
5693             <void/>
5694             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5695           </inbuf>
5696           <description>
5697             User supplied data to be passed to the callback.
5698           </description>
5699         </param>
5700       </parameters>
5701       <errors>
5702       </errors>
5703     </function>
5704 
5705     <function id="IterateOverReachableObjects" num="110">
5706       <synopsis>Iterate Over Reachable Objects</synopsis>
5707       <description>
5708         This function iterates over the root objects and all objects that
5709         are directly and indirectly reachable from the root objects.
5710         The root objects comprise the set of system classes,
5711         JNI globals, references from thread stacks, and other objects used as roots
5712         for the purposes of garbage collection.
5713         <p/>
5714         For each root the <paramlink id="heap_root_callback"></paramlink>
5715         or <paramlink id="stack_ref_callback"></paramlink> callback is called.
5716         An object can be a root object for more than one reason and in that case
5717         the appropriate callback is called for each reason.
5718         <p/>
5719         For each object reference the <paramlink id="object_ref_callback"></paramlink>
5720         callback function is called to describe the object reference.
5721         The callback is called exactly once for each reference from a referrer;
5722         this is true even if there are reference cycles or multiple paths to
5723         the referrer.
5724         There may be more than one reference between a referrer and a referree,
5725         These may be distinguished by the
5726         <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5727         <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5728         The callback for an object will always occur after the callback for
5729         its referrer.
5730         <p/>
5731         See <functionlink id="FollowReferences"/> for the object
5732         references which are reported.
5733         <p/>
5734         Roots are always reported to the profiler before any object references
5735         are reported. In other words, the <paramlink id="object_ref_callback"></paramlink>
5736         callback will not be called until the appropriate callback has been called
5737         for all roots. If the <paramlink id="object_ref_callback"></paramlink> callback is
5738         specified as <code>NULL</code> then this function returns after
5739         reporting the root objects to the profiler.
5740         <p/>
5741         During the execution of this function the state of the heap
5742         does not change: no objects are allocated, no objects are
5743         garbage collected, and the state of objects (including
5744         held values) does not change.
5745         As a result, threads executing Java
5746         programming language code, threads attempting to resume the
5747         execution of Java programming language code, and threads
5748         attempting to execute JNI functions are typically stalled.
5749       </description>
5750       <origin>new</origin>
5751       <capabilities>
5752         <required id="can_tag_objects"></required>
5753       </capabilities>
5754       <parameters>
5755         <param id="heap_root_callback">
5756           <ptrtype>
5757             <struct>jvmtiHeapRootCallback</struct>
5758             <nullok>do not report heap roots</nullok>
5759           </ptrtype>
5760             <description>
5761               The callback function to be called for each heap root of type
5762               <code>JVMTI_HEAP_ROOT_JNI_GLOBAL</code>,
5763               <code>JVMTI_HEAP_ROOT_SYSTEM_CLASS</code>,
5764               <code>JVMTI_HEAP_ROOT_MONITOR</code>,
5765               <code>JVMTI_HEAP_ROOT_THREAD</code>, or
5766               <code>JVMTI_HEAP_ROOT_OTHER</code>.
5767             </description>
5768         </param>
5769         <param id="stack_ref_callback">
5770           <ptrtype>
5771             <struct>jvmtiStackReferenceCallback</struct>
5772             <nullok>do not report stack references</nullok>
5773           </ptrtype>
5774             <description>
5775               The callback function to be called for each heap root of
5776               <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5777               <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>.
5778             </description>
5779         </param>
5780         <param id="object_ref_callback">
5781           <ptrtype>
5782             <struct>jvmtiObjectReferenceCallback</struct>
5783             <nullok>do not follow references from the root objects</nullok>
5784           </ptrtype>
5785             <description>
5786               The callback function to be called for each object reference.
5787             </description>
5788         </param>
5789         <param id="user_data">
5790           <inbuf>
5791             <void/>
5792             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5793           </inbuf>
5794           <description>
5795             User supplied data to be passed to the callback.
5796           </description>
5797         </param>
5798       </parameters>
5799       <errors>
5800       </errors>
5801     </function>
5802 
5803     <function id="IterateOverHeap" num="111">
5804       <synopsis>Iterate Over Heap</synopsis>
5805       <description>
5806         Iterate over all objects in the heap. This includes both reachable and
5807         unreachable objects.
5808         <p/>
5809         The <paramlink id="object_filter"></paramlink> parameter indicates the
5810         objects for which the callback function is called. If this parameter
5811         is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be
5812         called for every object that is tagged. If the parameter is
5813         <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5814         for objects that are not tagged. If the parameter
5815         is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5816         called for every object in the heap, irrespective of whether it is
5817         tagged or not.
5818         <p/>
5819         During the execution of this function the state of the heap
5820         does not change: no objects are allocated, no objects are
5821         garbage collected, and the state of objects (including
5822         held values) does not change.
5823         As a result, threads executing Java
5824         programming language code, threads attempting to resume the
5825         execution of Java programming language code, and threads
5826         attempting to execute JNI functions are typically stalled.
5827       </description>
5828       <origin>new</origin>
5829       <capabilities>
5830         <required id="can_tag_objects"></required>
5831       </capabilities>
5832       <parameters>
5833         <param id="object_filter">
5834           <enum>jvmtiHeapObjectFilter</enum>
5835           <description>
5836             Indicates the objects for which the callback function is called.
5837           </description>
5838         </param>
5839         <param id="heap_object_callback">
5840           <ptrtype>
5841             <struct>jvmtiHeapObjectCallback</struct>
5842           </ptrtype>
5843             <description>
5844               The iterator function to be called for each
5845               object matching the <paramlink id="object_filter"/>.
5846             </description>
5847         </param>
5848         <param id="user_data">
5849           <inbuf>
5850             <void/>
5851             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5852           </inbuf>
5853           <description>
5854             User supplied data to be passed to the callback.
5855           </description>
5856         </param>
5857       </parameters>
5858       <errors>
5859       </errors>
5860     </function>
5861 
5862     <function id="IterateOverInstancesOfClass" num="112">
5863       <synopsis>Iterate Over Instances Of Class</synopsis>
5864       <description>
5865         Iterate over all objects in the heap that are instances of the specified class.
5866         This includes direct instances of the specified class and
5867         instances of all subclasses of the specified class.
5868         This includes both reachable and unreachable objects.
5869         <p/>
5870         The <paramlink id="object_filter"></paramlink> parameter indicates the
5871         objects for which the callback function is called. If this parameter
5872         is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be
5873         called for every object that is tagged. If the parameter is
5874         <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5875         called for objects that are not tagged. If the parameter
5876         is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5877         called for every object in the heap, irrespective of whether it is
5878         tagged or not.
5879         <p/>
5880         During the execution of this function the state of the heap
5881         does not change: no objects are allocated, no objects are
5882         garbage collected, and the state of objects (including
5883         held values) does not change.
5884         As a result, threads executing Java
5885         programming language code, threads attempting to resume the
5886         execution of Java programming language code, and threads
5887         attempting to execute JNI functions are typically stalled.
5888       </description>
5889       <origin>new</origin>
5890       <capabilities>
5891         <required id="can_tag_objects"></required>
5892       </capabilities>
5893       <parameters>
5894         <param id="klass">
5895           <jclass/>
5896             <description>
5897               Iterate over objects of this class only.
5898             </description>
5899         </param>
5900         <param id="object_filter">
5901           <enum>jvmtiHeapObjectFilter</enum>
5902           <description>
5903             Indicates the objects for which the callback function is called.
5904           </description>
5905         </param>
5906         <param id="heap_object_callback">
5907           <ptrtype>
5908             <struct>jvmtiHeapObjectCallback</struct>
5909           </ptrtype>
5910             <description>
5911               The iterator function to be called for each
5912               <paramlink id="klass"/> instance matching
5913               the <paramlink id="object_filter"/>.
5914             </description>
5915         </param>
5916         <param id="user_data">
5917           <inbuf>
5918             <void/>
5919             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5920           </inbuf>
5921           <description>
5922             User supplied data to be passed to the callback.
5923           </description>
5924         </param>
5925       </parameters>
5926       <errors>
5927       </errors>
5928     </function>
5929 
5930   </category>
5931 
5932   <category id="local" label="Local Variable">
5933 
5934     <intro>
5935       These functions are used to retrieve or set the value of a local variable.
5936       The variable is identified by the depth of the frame containing its
5937       value and the variable's slot number within that frame.
5938       The mapping of variables to
5939       slot numbers can be obtained with the function
5940       <functionlink id="GetLocalVariableTable"></functionlink>.
5941     </intro>
5942 
5943     <function id="GetLocalObject" num="21">
5944       <synopsis>Get Local Variable - Object</synopsis>
5945       <description>
5946         This function can be used to retrieve the value of a local
5947         variable whose type is <code>Object</code> or a subclass of <code>Object</code>.
5948       </description>
5949       <origin>jvmdi</origin>
5950       <capabilities>
5951         <required id="can_access_local_variables"></required>
5952       </capabilities>
5953       <parameters>
5954         <param id="thread">
5955           <jthread null="current" frame="frame"/>
5956           <description>
5957             The thread of the frame containing the variable's value.
5958           </description>
5959         </param>
5960         <param id="depth">
5961           <jframeID thread="thread"/>
5962           <description>
5963             The depth of the frame containing the variable's value.
5964           </description>
5965         </param>
5966         <param id="slot">
5967           <jint/>
5968           <description>
5969             The variable's slot number.
5970           </description>
5971         </param>
5972         <param id="value_ptr">
5973           <outptr><jobject/></outptr>
5974             <description>
5975               On return, points to the variable's value.
5976             </description>
5977         </param>
5978       </parameters>
5979       <errors>
5980         <error id="JVMTI_ERROR_INVALID_SLOT">
5981           Invalid <code>slot</code>.
5982         </error>
5983         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5984           The variable type is not
5985           <code>Object</code> or a subclass of <code>Object</code>.
5986         </error>
5987         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5988           Not a visible frame
5989         </error>
5990       </errors>
5991     </function>
5992 
5993     <function id="GetLocalInstance" num="155" since="1.2">
5994       <synopsis>Get Local Instance</synopsis>
5995       <description>
5996         This function can be used to retrieve the value of the local object
5997         variable at slot 0 (the "<code>this</code>" object) from non-static
5998         frames.  This function can retrieve the "<code>this</code>" object from
5999         native method frames, whereas <code>GetLocalObject()</code> would
6000         return <code>JVMTI_ERROR_OPAQUE_FRAME</code> in those cases.
6001       </description>
6002       <origin>new</origin>
6003       <capabilities>
6004         <required id="can_access_local_variables"></required>
6005       </capabilities>
6006       <parameters>
6007         <param id="thread">
6008           <jthread null="current" frame="frame"/>
6009           <description>
6010             The thread of the frame containing the variable's value.
6011           </description>
6012         </param>
6013         <param id="depth">
6014           <jframeID thread="thread"/>
6015           <description>
6016             The depth of the frame containing the variable's value.
6017           </description>
6018         </param>
6019         <param id="value_ptr">
6020           <outptr><jobject/></outptr>
6021             <description>
6022               On return, points to the variable's value.
6023             </description>
6024         </param>
6025       </parameters>
6026       <errors>
6027         <error id="JVMTI_ERROR_INVALID_SLOT">
6028           If the specified frame is a static method frame.
6029         </error>
6030       </errors>
6031     </function>
6032     <function id="GetLocalInt" num="22">
6033       <synopsis>Get Local Variable - Int</synopsis>
6034       <description>
6035         This function can be used to retrieve the value of a local
6036         variable whose type is <code>int</code>,
6037         <code>short</code>, <code>char</code>, <code>byte</code>, or
6038         <code>boolean</code>.
6039       </description>
6040       <origin>jvmdi</origin>
6041       <capabilities>
6042         <required id="can_access_local_variables"></required>
6043       </capabilities>
6044       <parameters>
6045         <param id="thread">
6046           <jthread null="current" frame="frame"/>
6047           <description>
6048             The thread of the frame containing the variable's value.
6049           </description>
6050         </param>
6051         <param id="depth">
6052           <jframeID thread="thread"/>
6053           <description>
6054             The depth of the frame containing the variable's value.
6055           </description>
6056         </param>
6057         <param id="slot">
6058           <jint/>
6059           <description>
6060             The variable's slot number.
6061           </description>
6062         </param>
6063         <param id="value_ptr">
6064           <outptr><jint/></outptr>
6065           <description>
6066             On return, points to the variable's value.
6067           </description>
6068         </param>
6069       </parameters>
6070       <errors>
6071         <error id="JVMTI_ERROR_INVALID_SLOT">
6072           Invalid <code>slot</code>.
6073         </error>
6074         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6075           The variable type is not
6076           <code>int</code>, <code>short</code>,
6077           <code>char</code>, <code>byte</code>, or
6078           <code>boolean</code>.
6079         </error>
6080         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6081           Not a visible frame
6082         </error>
6083       </errors>
6084     </function>
6085 
6086     <function id="GetLocalLong" num="23">
6087       <synopsis>Get Local Variable - Long</synopsis>
6088       <description>
6089         This function can be used to retrieve the value of a local
6090         variable whose type is <code>long</code>.
6091       </description>
6092       <origin>jvmdi</origin>
6093       <capabilities>
6094         <required id="can_access_local_variables"></required>
6095       </capabilities>
6096       <parameters>
6097         <param id="thread">
6098           <jthread null="current" frame="frame"/>
6099           <description>
6100             The thread of the frame containing the variable's value.
6101           </description>
6102         </param>
6103         <param id="depth">
6104           <jframeID thread="thread"/>
6105           <description>
6106             The depth of the frame containing the variable's value.
6107           </description>
6108         </param>
6109         <param id="slot">
6110           <jint/>
6111           <description>
6112             The variable's slot number.
6113           </description>
6114         </param>
6115         <param id="value_ptr">
6116           <outptr><jlong/></outptr>
6117           <description>
6118             On return, points to the variable's value.
6119           </description>
6120         </param>
6121       </parameters>
6122       <errors>
6123         <error id="JVMTI_ERROR_INVALID_SLOT">
6124           Invalid <code>slot</code>.
6125         </error>
6126         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6127           The variable type is not <code>long</code>.
6128         </error>
6129         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6130           Not a visible frame
6131         </error>
6132       </errors>
6133     </function>
6134 
6135     <function id="GetLocalFloat" num="24">
6136       <synopsis>Get Local Variable - Float</synopsis>
6137       <description>
6138         This function can be used to retrieve the value of a local
6139         variable whose type is <code>float</code>.
6140       </description>
6141       <origin>jvmdi</origin>
6142       <capabilities>
6143         <required id="can_access_local_variables"></required>
6144       </capabilities>
6145       <parameters>
6146         <param id="thread">
6147           <jthread null="current" frame="frame"/>
6148           <description>
6149             The thread of the frame containing the variable's value.
6150           </description>
6151         </param>
6152         <param id="depth">
6153           <jframeID thread="thread"/>
6154           <description>
6155             The depth of the frame containing the variable's value.
6156           </description>
6157         </param>
6158         <param id="slot">
6159           <jint/>
6160           <description>
6161             The variable's slot number.
6162           </description>
6163         </param>
6164         <param id="value_ptr">
6165           <outptr><jfloat/></outptr>
6166           <description>
6167             On return, points to the variable's value.
6168           </description>
6169         </param>
6170       </parameters>
6171       <errors>
6172         <error id="JVMTI_ERROR_INVALID_SLOT">
6173           Invalid <code>slot</code>.
6174         </error>
6175         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6176           The variable type is not <code>float</code>.
6177         </error>
6178         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6179           Not a visible frame
6180         </error>
6181       </errors>
6182     </function>
6183 
6184     <function id="GetLocalDouble" num="25">
6185       <synopsis>Get Local Variable - Double</synopsis>
6186       <description>
6187         This function can be used to retrieve the value of a local
6188         variable whose type is <code>long</code>.
6189       </description>
6190       <origin>jvmdi</origin>
6191       <capabilities>
6192         <required id="can_access_local_variables"></required>
6193       </capabilities>
6194       <parameters>
6195         <param id="thread">
6196           <jthread null="current" frame="frame"/>
6197           <description>
6198             The thread of the frame containing the variable's value.
6199           </description>
6200         </param>
6201         <param id="depth">
6202           <jframeID thread="thread"/>
6203           <description>
6204             The depth of the frame containing the variable's value.
6205           </description>
6206         </param>
6207         <param id="slot">
6208           <jint/>
6209           <description>
6210             The variable's slot number.
6211           </description>
6212         </param>
6213         <param id="value_ptr">
6214           <outptr><jdouble/></outptr>
6215           <description>
6216             On return, points to the variable's value.
6217           </description>
6218         </param>
6219       </parameters>
6220       <errors>
6221         <error id="JVMTI_ERROR_INVALID_SLOT">
6222           Invalid <code>slot</code>.
6223         </error>
6224         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6225           The variable type is not <code>double</code>.
6226         </error>
6227         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6228           Not a visible frame
6229         </error>
6230       </errors>
6231     </function>
6232 
6233     <function id="SetLocalObject" num="26">
6234       <synopsis>Set Local Variable - Object</synopsis>
6235       <description>
6236         This function can be used to set the value of a local
6237         variable whose type is <code>Object</code> or a subclass of <code>Object</code>.
6238       </description>
6239       <origin>jvmdi</origin>
6240       <capabilities>
6241         <required id="can_access_local_variables"></required>
6242       </capabilities>
6243       <parameters>
6244         <param id="thread">
6245           <jthread null="current" frame="frame"/>
6246           <description>
6247             The thread of the frame containing the variable's value.
6248           </description>
6249         </param>
6250         <param id="depth">
6251           <jframeID thread="thread"/>
6252           <description>
6253             The depth of the frame containing the variable's value.
6254           </description>
6255         </param>
6256         <param id="slot">
6257           <jint/>
6258           <description>
6259             The variable's slot number.
6260           </description>
6261         </param>
6262         <param id="value">
6263           <jobject/>
6264             <description>
6265               The new value for the variable.
6266             </description>
6267         </param>
6268       </parameters>
6269       <errors>
6270         <error id="JVMTI_ERROR_INVALID_SLOT">
6271           Invalid <code>slot</code>.
6272         </error>
6273         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6274           The variable type is not
6275           <code>Object</code> or a subclass of <code>Object</code>.
6276         </error>
6277         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6278           The supplied <paramlink id="value"/> is not compatible
6279           with the variable type.
6280         </error>
6281         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6282           Not a visible frame
6283         </error>
6284       </errors>
6285     </function>
6286 
6287     <function id="SetLocalInt" num="27">
6288       <synopsis>Set Local Variable - Int</synopsis>
6289       <description>
6290         This function can be used to set the value of a local
6291         variable whose type is <code>int</code>,
6292         <code>short</code>, <code>char</code>, <code>byte</code>, or
6293         <code>boolean</code>.
6294       </description>
6295       <origin>jvmdi</origin>
6296       <capabilities>
6297         <required id="can_access_local_variables"></required>
6298       </capabilities>
6299       <parameters>
6300         <param id="thread">
6301           <jthread null="current" frame="frame"/>
6302           <description>
6303             The thread of the frame containing the variable's value.
6304           </description>
6305         </param>
6306         <param id="depth">
6307           <jframeID thread="thread"/>
6308           <description>
6309             The depth of the frame containing the variable's value.
6310           </description>
6311         </param>
6312         <param id="slot">
6313           <jint/>
6314           <description>
6315             The variable's slot number.
6316           </description>
6317         </param>
6318         <param id="value">
6319           <jint/>
6320           <description>
6321             The new value for the variable.
6322           </description>
6323         </param>
6324       </parameters>
6325       <errors>
6326         <error id="JVMTI_ERROR_INVALID_SLOT">
6327           Invalid <code>slot</code>.
6328         </error>
6329         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6330           The variable type is not
6331           <code>int</code>, <code>short</code>,
6332           <code>char</code>, <code>byte</code>, or
6333           <code>boolean</code>.
6334         </error>
6335         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6336           Not a visible frame
6337         </error>
6338       </errors>
6339     </function>
6340 
6341     <function id="SetLocalLong" num="28">
6342       <synopsis>Set Local Variable - Long</synopsis>
6343       <description>
6344         This function can be used to set the value of a local
6345         variable whose type is <code>long</code>.
6346       </description>
6347       <origin>jvmdi</origin>
6348       <capabilities>
6349         <required id="can_access_local_variables"></required>
6350       </capabilities>
6351       <parameters>
6352         <param id="thread">
6353           <jthread null="current" frame="frame"/>
6354           <description>
6355             The thread of the frame containing the variable's value.
6356           </description>
6357         </param>
6358         <param id="depth">
6359           <jframeID thread="thread"/>
6360           <description>
6361             The depth of the frame containing the variable's value.
6362           </description>
6363         </param>
6364         <param id="slot">
6365           <jint/>
6366           <description>
6367             The variable's slot number.
6368           </description>
6369         </param>
6370         <param id="value">
6371           <jlong/>
6372           <description>
6373             The new value for the variable.
6374           </description>
6375         </param>
6376       </parameters>
6377       <errors>
6378         <error id="JVMTI_ERROR_INVALID_SLOT">
6379           Invalid <code>slot</code>.
6380         </error>
6381         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6382           The variable type is not <code>long</code>.
6383         </error>
6384         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6385           Not a visible frame
6386         </error>
6387       </errors>
6388     </function>
6389 
6390     <function id="SetLocalFloat" num="29">
6391       <synopsis>Set Local Variable - Float</synopsis>
6392       <description>
6393         This function can be used to set the value of a local
6394         variable whose type is <code>float</code>.
6395       </description>
6396       <origin>jvmdi</origin>
6397       <capabilities>
6398         <required id="can_access_local_variables"></required>
6399       </capabilities>
6400       <parameters>
6401         <param id="thread">
6402           <jthread null="current" frame="frame"/>
6403           <description>
6404             The thread of the frame containing the variable's value.
6405           </description>
6406         </param>
6407         <param id="depth">
6408           <jframeID thread="thread"/>
6409           <description>
6410             The depth of the frame containing the variable's value.
6411           </description>
6412         </param>
6413         <param id="slot">
6414           <jint/>
6415           <description>
6416             The variable's slot number.
6417           </description>
6418         </param>
6419         <param id="value">
6420           <jfloat/>
6421           <description>
6422             The new value for the variable.
6423           </description>
6424         </param>
6425       </parameters>
6426       <errors>
6427         <error id="JVMTI_ERROR_INVALID_SLOT">
6428           Invalid <code>slot</code>.
6429         </error>
6430         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6431           The variable type is not <code>float</code>.
6432         </error>
6433         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6434           Not a visible frame
6435         </error>
6436       </errors>
6437     </function>
6438 
6439     <function id="SetLocalDouble" num="30">
6440       <synopsis>Set Local Variable - Double</synopsis>
6441       <description>
6442         This function can be used to set the value of a local
6443         variable whose type is <code>double</code>.
6444       </description>
6445       <origin>jvmdi</origin>
6446       <capabilities>
6447         <required id="can_access_local_variables"></required>
6448       </capabilities>
6449       <parameters>
6450         <param id="thread">
6451           <jthread null="current" frame="frame"/>
6452           <description>
6453             The thread of the frame containing the variable's value.
6454           </description>
6455         </param>
6456         <param id="depth">
6457           <jframeID thread="thread"/>
6458           <description>
6459             The depth of the frame containing the variable's value.
6460           </description>
6461         </param>
6462         <param id="slot">
6463           <jint/>
6464           <description>
6465             The variable's slot number.
6466           </description>
6467         </param>
6468         <param id="value">
6469           <jdouble/>
6470           <description>
6471             The new value for the variable.
6472           </description>
6473         </param>
6474       </parameters>
6475       <errors>
6476         <error id="JVMTI_ERROR_INVALID_SLOT">
6477           Invalid <code>slot</code>.
6478         </error>
6479         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6480           The variable type is not <code>double</code>.
6481         </error>
6482         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6483           Not a visible frame
6484         </error>
6485       </errors>
6486     </function>
6487   </category>
6488 
6489   <category id="breakpointCategory" label="Breakpoint">
6490 
6491     <intro>
6492     </intro>
6493 
6494     <function id="SetBreakpoint" num="38">
6495       <synopsis>Set Breakpoint</synopsis>
6496       <description>
6497         Set a breakpoint at the instruction indicated by
6498         <code>method</code> and <code>location</code>.
6499         An instruction can only have one breakpoint.
6500         <p/>
6501         Whenever the designated instruction is about to be executed, a
6502         <eventlink id="Breakpoint"></eventlink> event is generated.
6503       </description>
6504       <origin>jvmdi</origin>
6505       <capabilities>
6506         <required id="can_generate_breakpoint_events"></required>
6507       </capabilities>
6508       <parameters>
6509         <param id="klass">
6510           <jclass method="method"/>
6511             <description>
6512               The class in which to set the breakpoint
6513             </description>
6514         </param>
6515         <param id="method">
6516           <jmethodID class="klass"/>
6517             <description>
6518               The method in which to set the breakpoint
6519             </description>
6520         </param>
6521         <param id="location">
6522           <jlocation/>
6523           <description>
6524             the index of the instruction at which to set the breakpoint
6525 
6526           </description>
6527         </param>
6528       </parameters>
6529       <errors>
6530         <error id="JVMTI_ERROR_DUPLICATE">
6531           The designated bytecode already has a breakpoint.
6532         </error>
6533       </errors>
6534     </function>
6535 
6536     <function id="ClearBreakpoint" num="39">
6537       <synopsis>Clear Breakpoint</synopsis>
6538       <description>
6539         Clear the breakpoint at the bytecode indicated by
6540         <code>method</code> and <code>location</code>.
6541       </description>
6542       <origin>jvmdi</origin>
6543       <capabilities>
6544         <required id="can_generate_breakpoint_events"></required>
6545       </capabilities>
6546       <parameters>
6547         <param id="klass">
6548           <jclass method="method"/>
6549             <description>
6550               The class in which to clear the breakpoint
6551             </description>
6552         </param>
6553         <param id="method">
6554           <jmethodID class="klass"/>
6555             <description>
6556               The method in which to clear the breakpoint
6557             </description>
6558         </param>
6559         <param id="location">
6560           <jlocation/>
6561           <description>
6562             the index of the instruction at which to clear the breakpoint
6563           </description>
6564         </param>
6565       </parameters>
6566       <errors>
6567         <error id="JVMTI_ERROR_NOT_FOUND">
6568           There's no breakpoint at the designated bytecode.
6569         </error>
6570       </errors>
6571     </function>
6572 
6573   </category>
6574 
6575   <category id="fieldWatch" label="Watched Field">
6576 
6577     <intro>
6578     </intro>
6579 
6580     <function id="SetFieldAccessWatch" num="41">
6581       <synopsis>Set Field Access Watch</synopsis>
6582       <description>
6583         Generate a <eventlink id="FieldAccess"></eventlink> event
6584         when the field specified
6585         by <code>klass</code> and
6586         <code>field</code> is about to be accessed.
6587         An event will be generated for each access of the field
6588         until it is canceled with
6589         <functionlink id="ClearFieldAccessWatch"></functionlink>.
6590         Field accesses from Java programming language code or from JNI code are watched,
6591         fields modified by other means are not watched.
6592         Note that <jvmti/> users should be aware that their own field accesses
6593         will trigger the watch.
6594         A field can only have one field access watch set.
6595         Modification of a field is not considered an access--use
6596         <functionlink id="SetFieldModificationWatch"></functionlink>
6597         to monitor modifications.
6598       </description>
6599       <origin>jvmdi</origin>
6600       <capabilities>
6601         <required id="can_generate_field_access_events"></required>
6602       </capabilities>
6603       <parameters>
6604         <param id="klass">
6605           <jclass field="field"/>
6606             <description>
6607               The class containing the field to watch
6608             </description>
6609         </param>
6610         <param id="field">
6611           <jfieldID class="klass"/>
6612             <description>
6613               The field to watch
6614 
6615             </description>
6616         </param>
6617       </parameters>
6618       <errors>
6619         <error id="JVMTI_ERROR_DUPLICATE">
6620           The designated field is already being watched for accesses.
6621         </error>
6622       </errors>
6623     </function>
6624 
6625     <function id="ClearFieldAccessWatch" num="42">
6626       <synopsis>Clear Field Access Watch</synopsis>
6627       <description>
6628         Cancel a field access watch previously set by
6629         <functionlink id="SetFieldAccessWatch"></functionlink>, on the
6630         field specified
6631         by <code>klass</code> and
6632         <code>field</code>.
6633       </description>
6634       <origin>jvmdi</origin>
6635       <capabilities>
6636         <required id="can_generate_field_access_events"></required>
6637       </capabilities>
6638       <parameters>
6639         <param id="klass">
6640           <jclass field="field"/>
6641             <description>
6642               The class containing the field to watch
6643             </description>
6644         </param>
6645         <param id="field">
6646           <jfieldID class="klass"/>
6647             <description>
6648               The field to watch
6649 
6650             </description>
6651         </param>
6652       </parameters>
6653       <errors>
6654         <error id="JVMTI_ERROR_NOT_FOUND">
6655           The designated field is not being watched for accesses.
6656         </error>
6657       </errors>
6658     </function>
6659 
6660     <function id="SetFieldModificationWatch" num="43">
6661       <synopsis>Set Field Modification Watch</synopsis>
6662       <description>
6663         Generate a <eventlink id="FieldModification"></eventlink> event
6664         when the field specified
6665         by <code>klass</code> and
6666         <code>field</code> is about to be modified.
6667         An event will be generated for each modification of the field
6668         until it is canceled with
6669         <functionlink id="ClearFieldModificationWatch"></functionlink>.
6670         Field modifications from Java programming language code or from JNI code are watched,
6671         fields modified by other means are not watched.
6672         Note that <jvmti/> users should be aware that their own field modifications
6673         will trigger the watch.
6674         A field can only have one field modification watch set.
6675       </description>
6676       <origin>jvmdi</origin>
6677       <capabilities>
6678         <required id="can_generate_field_modification_events"></required>
6679       </capabilities>
6680       <parameters>
6681         <param id="klass">
6682           <jclass field="field"/>
6683             <description>
6684               The class containing the field to watch
6685             </description>
6686         </param>
6687         <param id="field">
6688           <jfieldID class="klass"/>
6689             <description>
6690               The field to watch
6691 
6692             </description>
6693         </param>
6694       </parameters>
6695       <errors>
6696         <error id="JVMTI_ERROR_DUPLICATE">
6697           The designated field is already being watched for modifications.
6698         </error>
6699       </errors>
6700     </function>
6701 
6702     <function id="ClearFieldModificationWatch" num="44">
6703       <synopsis>Clear Field Modification Watch</synopsis>
6704       <description>
6705 
6706         Cancel a field modification watch previously set by
6707         <functionlink id="SetFieldModificationWatch"></functionlink>, on the
6708         field specified
6709         by <code>klass</code> and
6710         <code>field</code>.
6711       </description>
6712       <origin>jvmdi</origin>
6713       <capabilities>
6714         <required id="can_generate_field_modification_events"></required>
6715       </capabilities>
6716       <parameters>
6717         <param id="klass">
6718           <jclass field="field"/>
6719             <description>
6720               The class containing the field to watch
6721             </description>
6722         </param>
6723         <param id="field">
6724           <jfieldID class="klass"/>
6725             <description>
6726               The field to watch
6727 
6728             </description>
6729         </param>
6730       </parameters>
6731       <errors>
6732         <error id="JVMTI_ERROR_NOT_FOUND">
6733           The designated field is not being watched for modifications.
6734         </error>
6735       </errors>
6736     </function>
6737   </category>
6738 
6739   <category id="module" label="Module">
6740 
6741     <intro>
6742     </intro>
6743 
6744     <function id="GetAllModules" num="3" since="9">
6745       <synopsis>Get All Modules</synopsis>
6746       <description>
6747         Return an array of all modules loaded in the virtual machine.
6748         The array includes the unnamed module for each class loader.
6749         The number of modules in the array is returned via
6750         <code>module_count_ptr</code>, and the array itself via
6751         <code>modules_ptr</code>.
6752         <p/>
6753       </description>
6754       <origin>new</origin>
6755       <capabilities>
6756       </capabilities>
6757       <parameters>
6758         <param id="module_count_ptr">
6759           <outptr><jint/></outptr>
6760           <description>
6761             On return, points to the number of returned modules.
6762           </description>
6763         </param>
6764         <param id="modules_ptr">
6765           <allocbuf outcount="module_count_ptr"><jobject/></allocbuf>
6766             <description>
6767               On return, points to an array of references, one
6768               for each module.
6769             </description>
6770         </param>
6771       </parameters>
6772       <errors>
6773       </errors>
6774     </function>
6775 
6776     <function id="GetNamedModule" num="40" since="9">
6777       <synopsis>Get Named Module</synopsis>
6778       <description>
6779         Return the <code>java.lang.Module</code> object for a named
6780         module defined to a class loader that contains a given package.
6781         The module is returned via <code>module_ptr</code>.
6782         <p/>
6783         If a named module is defined to the class loader and it
6784         contains the package then that named module is returned,
6785         otherwise <code>NULL</code> is returned.
6786         <p/>
6787       </description>
6788       <origin>new</origin>
6789       <capabilities>
6790       </capabilities>
6791       <parameters>
6792         <param id="class_loader">
6793           <ptrtype>
6794             <jobject/>
6795             <nullok>the bootstrap loader is assumed</nullok>
6796           </ptrtype>
6797           <description>
6798             A class loader.
6799             If the <code>class_loader</code> is not <code>NULL</code>
6800             or a subclass of <code>java.lang.ClassLoader</code>
6801             this function returns
6802             <errorlink id="JVMTI_ERROR_ILLEGAL_ARGUMENT"></errorlink>.
6803           </description>
6804         </param>
6805         <param id="package_name">
6806           <inbuf><char/></inbuf>
6807           <description>
6808             The name of the package, encoded as a
6809             <internallink id="mUTF">modified UTF-8</internallink> string.
6810             The package name is in internal form (JVMS 4.2.1);
6811             identifiers are separated by forward slashes rather than periods.
6812           </description>
6813         </param>
6814         <param id="module_ptr">
6815           <outptr><jobject/></outptr>
6816           <description>
6817             On return, points to a <code>java.lang.Module</code> object
6818             or points to <code>NULL</code>.
6819           </description>
6820         </param>
6821       </parameters>
6822       <errors>
6823         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6824           If class loader is not <code>NULL</code> and is not a class loader object.
6825         </error>
6826       </errors>
6827     </function>
6828 
6829     <function id="AddModuleReads" num="94" since="9">
6830       <synopsis>Add Module Reads</synopsis>
6831       <description>
6832          Update a module to read another module. This function is a no-op
6833          when <paramlink id="module"></paramlink> is an unnamed module.
6834          This function facilitates the instrumentation of code
6835          in named modules where that instrumentation requires
6836          expanding the set of modules that a module reads.
6837       </description>
6838       <origin>new</origin>
6839       <capabilities>
6840       </capabilities>
6841       <parameters>
6842         <param id="module">
6843           <ptrtype><jobject/></ptrtype>
6844           <description>
6845             The module to update.
6846           </description>
6847         </param>
6848         <param id="to_module">
6849           <ptrtype><jobject/></ptrtype>
6850           <description>
6851             The additional module to read.
6852           </description>
6853         </param>
6854       </parameters>
6855       <errors>
6856         <error id="JVMTI_ERROR_INVALID_MODULE">
6857           If <paramlink id="module"></paramlink> is not a module object.
6858         </error>
6859         <error id="JVMTI_ERROR_INVALID_MODULE">
6860           If <paramlink id="to_module"></paramlink> is not a module object.
6861         </error>
6862         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6863           if the module cannot be modified.
6864           See <functionlink id="IsModifiableModule"/>.
6865         </error>
6866       </errors>
6867     </function>
6868 
6869     <function id="AddModuleExports" num="95" since="9">
6870       <synopsis>Add Module Exports</synopsis>
6871       <description>
6872          Update a module to export a package to another module.
6873          This function is a no-op when <paramlink id="module"></paramlink>
6874          is an unnamed module or an open module.
6875          This function facilitates the instrumentation of code
6876          in named modules where that instrumentation requires
6877          expanding the set of packages that a module exports.
6878       </description>
6879       <origin>new</origin>
6880       <capabilities>
6881       </capabilities>
6882       <parameters>
6883         <param id="module">
6884           <ptrtype><jobject/></ptrtype>
6885           <description>
6886             The module to update.
6887           </description>
6888         </param>
6889         <param id="pkg_name">
6890           <inbuf><char/></inbuf>
6891           <description>
6892             The exported package name.
6893           </description>
6894         </param>
6895         <param id="to_module">
6896           <ptrtype><jobject/></ptrtype>
6897           <description>
6898             The module the package is exported to.
6899             If the <code>to_module</code> is not a subclass of
6900             <code>java.lang.Module</code> this function returns
6901             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6902           </description>
6903         </param>
6904       </parameters>
6905       <errors>
6906         <error id="JVMTI_ERROR_INVALID_MODULE">
6907           If <paramlink id="module"></paramlink> is not a module object.
6908         </error>
6909         <error id="JVMTI_ERROR_INVALID_MODULE">
6910           If <paramlink id="to_module"></paramlink> is not a module object.
6911         </error>
6912         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6913           If the package <paramlink id="pkg_name"></paramlink>
6914           does not belong to the module.
6915         </error>
6916         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6917           if the module cannot be modified.
6918           See <functionlink id="IsModifiableModule"/>.
6919         </error>
6920       </errors>
6921     </function>
6922 
6923     <function id="AddModuleOpens" num="96" since="9">
6924       <synopsis>Add Module Opens</synopsis>
6925       <description>
6926          Update a module to open a package to another module.
6927          This function is a no-op when <paramlink id="module"></paramlink>
6928          is an unnamed module or an open module.
6929          This function facilitates the instrumentation of code
6930          in modules where that instrumentation requires
6931          expanding the set of packages that a module opens to
6932          other modules.
6933       </description>
6934       <origin>new</origin>
6935       <capabilities>
6936       </capabilities>
6937       <parameters>
6938         <param id="module">
6939           <ptrtype><jobject/></ptrtype>
6940           <description>
6941             The module to update.
6942           </description>
6943         </param>
6944         <param id="pkg_name">
6945           <inbuf><char/></inbuf>
6946           <description>
6947             The package name of the package to open.
6948           </description>
6949         </param>
6950         <param id="to_module">
6951           <ptrtype><jobject/></ptrtype>
6952           <description>
6953             The module with the package to open.
6954             If the <code>to_module</code> is not a subclass of
6955             <code>java.lang.Module</code> this function returns
6956             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6957           </description>
6958         </param>
6959       </parameters>
6960       <errors>
6961         <error id="JVMTI_ERROR_INVALID_MODULE">
6962           If <paramlink id="module"></paramlink> is not a module object.
6963         </error>
6964         <error id="JVMTI_ERROR_INVALID_MODULE">
6965           If <paramlink id="to_module"></paramlink> is not a module object.
6966         </error>
6967         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6968           If the package <paramlink id="pkg_name"></paramlink>
6969           does not belong to the module.
6970         </error>
6971         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6972           if the module cannot be modified.
6973           See <functionlink id="IsModifiableModule"/>.
6974         </error>
6975       </errors>
6976     </function>
6977 
6978     <function id="AddModuleUses" num="97" since="9">
6979       <synopsis>Add Module Uses</synopsis>
6980       <description>
6981          Updates a module to add a service to the set of services that
6982          a module uses. This function is a no-op when the module
6983          is an unnamed module.
6984          This function facilitates the instrumentation of code
6985          in named modules where that instrumentation requires
6986          expanding the set of services that a module is using.
6987       </description>
6988       <origin>new</origin>
6989       <capabilities>
6990       </capabilities>
6991       <parameters>
6992         <param id="module">
6993           <ptrtype><jobject/></ptrtype>
6994           <description>
6995             The module to update.
6996           </description>
6997         </param>
6998         <param id="service">
6999           <ptrtype><jclass/></ptrtype>
7000           <description>
7001             The service to use.
7002           </description>
7003         </param>
7004       </parameters>
7005       <errors>
7006         <error id="JVMTI_ERROR_INVALID_MODULE">
7007           If <paramlink id="module"></paramlink> is not a module object.
7008         </error>
7009         <error id="JVMTI_ERROR_INVALID_CLASS">
7010           If <paramlink id="service"></paramlink> is not a class object.
7011         </error>
7012         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
7013           if the module cannot be modified.
7014           See <functionlink id="IsModifiableModule"/>.
7015         </error>
7016       </errors>
7017     </function>
7018 
7019     <function id="AddModuleProvides" num="98" since="9">
7020       <synopsis>Add Module Provides</synopsis>
7021       <description>
7022          Updates a module to add a service to the set of services that
7023          a module provides. This function is a no-op when the module
7024          is an unnamed module.
7025          This function facilitates the instrumentation of code
7026          in named modules where that instrumentation requires
7027          changes to the services that are provided.
7028       </description>
7029       <origin>new</origin>
7030       <capabilities>
7031       </capabilities>
7032       <parameters>
7033         <param id="module">
7034           <ptrtype><jobject/></ptrtype>
7035           <description>
7036             The module to update.
7037           </description>
7038         </param>
7039         <param id="service">
7040           <ptrtype><jclass/></ptrtype>
7041           <description>
7042             The service to provide.
7043           </description>
7044         </param>
7045         <param id="impl_class">
7046           <ptrtype><jclass/></ptrtype>
7047           <description>
7048             The implementation class for the provided service.
7049           </description>
7050         </param>
7051       </parameters>
7052       <errors>
7053         <error id="JVMTI_ERROR_INVALID_MODULE">
7054           If <paramlink id="module"></paramlink> is not a module object.
7055         </error>
7056         <error id="JVMTI_ERROR_INVALID_CLASS">
7057           If <paramlink id="service"></paramlink> is not a class object.
7058         </error>
7059         <error id="JVMTI_ERROR_INVALID_CLASS">
7060           If <paramlink id="impl_class"></paramlink> is not a class object.
7061         </error>
7062         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
7063           if the module cannot be modified.
7064           See <functionlink id="IsModifiableModule"/>.
7065         </error>
7066       </errors>
7067     </function>
7068 
7069     <function id="IsModifiableModule" num="99" since="9">
7070       <synopsis>Is Modifiable Module</synopsis>
7071       <description>
7072         Determines whether a module is modifiable.
7073         If a module is modifiable then this module can be updated with
7074         <functionlink id="AddModuleReads"/>, <functionlink id="AddModuleExports"/>,
7075         <functionlink id="AddModuleOpens"/>, <functionlink id="AddModuleUses"/>,
7076         and <functionlink id="AddModuleProvides"/>. If a module is not modifiable
7077         then the module can not be updated with these functions. The result of
7078         this function is always <code>JNI_TRUE</code> when called to determine
7079         if an unnamed module is modifiable.
7080       </description>
7081       <origin>new</origin>
7082       <capabilities>
7083       </capabilities>
7084       <parameters>
7085         <param id="module">
7086           <ptrtype><jobject/></ptrtype>
7087           <description>
7088             The module to query.
7089           </description>
7090         </param>
7091         <param id="is_modifiable_module_ptr">
7092           <outptr><jboolean/></outptr>
7093           <description>
7094             On return, points to the boolean result of this function.
7095           </description>
7096         </param>
7097       </parameters>
7098       <errors>
7099         <error id="JVMTI_ERROR_INVALID_MODULE">
7100           If <paramlink id="module"></paramlink> is not a module object.
7101         </error>
7102       </errors>
7103     </function>
7104 
7105   </category>
7106 
7107   <category id="class" label="Class">
7108 
7109     <intro>
7110     </intro>
7111 
7112     <function id="GetLoadedClasses" jkernel="yes" num="78">
7113       <synopsis>Get Loaded Classes</synopsis>
7114       <description>
7115         Return an array of all classes loaded in the virtual machine.
7116         The number of classes in the array is returned via
7117         <code>class_count_ptr</code>, and the array itself via
7118         <code>classes_ptr</code>.
7119         <p/>
7120         Array classes of all types (including arrays of primitive types) are
7121         included in the returned list. Primitive classes (for example,
7122         <code>java.lang.Integer.TYPE</code>) are <i>not</i> included in this list.
7123       </description>
7124       <origin>jvmdi</origin>
7125       <capabilities>
7126       </capabilities>
7127       <parameters>
7128         <param id="class_count_ptr">
7129           <outptr><jint/></outptr>
7130           <description>
7131             On return, points to the number of classes.
7132           </description>
7133         </param>
7134         <param id="classes_ptr">
7135           <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
7136             <description>
7137               On return, points to an array of references, one
7138               for each class.
7139             </description>
7140         </param>
7141       </parameters>
7142       <errors>
7143       </errors>
7144     </function>
7145 
7146     <function id="GetClassLoaderClasses" jkernel="yes" num="79">
7147       <synopsis>Get Classloader Classes</synopsis>
7148       <description>
7149         Returns an array of those classes for which this class loader has
7150         been recorded as an initiating loader. Each
7151         class in the returned array was created by this class loader,
7152         either by defining it directly or by delegation to another class loader.
7153         See <vmspec chapter="5.3"/>.
7154         <p/>
7155         The number of classes in the array is returned via
7156         <code>class_count_ptr</code>, and the array itself via
7157         <code>classes_ptr</code>.
7158       </description>
7159       <origin>jvmdi</origin>
7160       <capabilities>
7161       </capabilities>
7162       <parameters>
7163         <param id="initiating_loader">
7164           <ptrtype>
7165             <jobject/>
7166             <nullok>the classes initiated by the bootstrap loader will be returned</nullok>
7167           </ptrtype>
7168             <description>
7169               An initiating class loader.
7170             </description>
7171         </param>
7172         <param id="class_count_ptr">
7173           <outptr><jint/></outptr>
7174           <description>
7175             On return, points to the number of classes.
7176           </description>
7177         </param>
7178         <param id="classes_ptr">
7179           <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
7180             <description>
7181               On return, points to an array of references, one
7182               for each class.
7183             </description>
7184         </param>
7185       </parameters>
7186       <errors>
7187       </errors>
7188     </function>
7189 
7190     <function id="GetClassSignature" phase="start" num="48">
7191       <synopsis>Get Class Signature</synopsis>
7192       <description>
7193         For the class indicated by <code>klass</code>, return the
7194         <externallink id="jni/types.html#type-signatures">JNI
7195             type signature</externallink>
7196         and the generic signature of the class.
7197         For example, <code>java.util.List</code> is <code>"Ljava/util/List;"</code>
7198         and <code>int[]</code> is <code>"[I"</code>
7199         The returned name for primitive classes
7200         is the type signature character of the corresponding primitive type.
7201         For example, <code>java.lang.Integer.TYPE</code> is <code>"I"</code>.
7202       </description>
7203       <origin>jvmdiClone</origin>
7204       <capabilities>
7205       </capabilities>
7206       <parameters>
7207         <param id="klass">
7208           <jclass/>
7209             <description>
7210               The class to query.
7211             </description>
7212         </param>
7213         <param id="signature_ptr">
7214           <allocbuf>
7215             <char/>
7216             <nullok>the signature is not returned</nullok>
7217           </allocbuf>
7218           <description>
7219             On return, points to the JNI type signature of the class, encoded as a
7220             <internallink id="mUTF">modified UTF-8</internallink> string.
7221           </description>
7222         </param>
7223         <param id="generic_ptr">
7224           <allocbuf>
7225             <char/>
7226             <nullok>the generic signature is not returned</nullok>
7227           </allocbuf>
7228           <description>
7229             On return, points to the generic signature of the class, encoded as a
7230             <internallink id="mUTF">modified UTF-8</internallink> string.
7231             If there is no generic signature attribute for the class, then,
7232             on return, points to <code>NULL</code>.
7233           </description>
7234         </param>
7235       </parameters>
7236       <errors>
7237       </errors>
7238     </function>
7239 
7240     <function id="GetClassStatus" phase="start" num="49">
7241       <synopsis>Get Class Status</synopsis>
7242       <description>
7243         Get the status of the class. Zero or more of the following bits can be
7244         set.
7245         <constants id="jvmtiClassStatus" label="Class Status Flags" kind="bits">
7246           <constant id="JVMTI_CLASS_STATUS_VERIFIED" num="1">
7247             Class bytecodes have been verified
7248           </constant>
7249           <constant id="JVMTI_CLASS_STATUS_PREPARED" num="2">
7250             Class preparation is complete
7251           </constant>
7252           <constant id="JVMTI_CLASS_STATUS_INITIALIZED" num="4">
7253             Class initialization is complete. Static initializer has been run.
7254           </constant>
7255           <constant id="JVMTI_CLASS_STATUS_ERROR" num="8">
7256             Error during initialization makes class unusable
7257           </constant>
7258           <constant id="JVMTI_CLASS_STATUS_ARRAY" num="16">
7259             Class is an array.  If set, all other bits are zero.
7260           </constant>
7261           <constant id="JVMTI_CLASS_STATUS_PRIMITIVE" num="32">
7262             Class is a primitive class (for example, <code>java.lang.Integer.TYPE</code>).
7263             If set, all other bits are zero.
7264           </constant>
7265         </constants>
7266       </description>
7267       <origin>jvmdi</origin>
7268       <capabilities>
7269       </capabilities>
7270       <parameters>
7271         <param id="klass">
7272           <jclass/>
7273             <description>
7274               The class to query.
7275             </description>
7276         </param>
7277         <param id="status_ptr">
7278           <outptr><jint/></outptr>
7279           <description>
7280             On return, points to the current state of this class as one or
7281             more of the <internallink id="jvmtiClassStatus">class status flags</internallink>.
7282           </description>
7283         </param>
7284       </parameters>
7285       <errors>
7286       </errors>
7287     </function>
7288 
7289     <function id="GetSourceFileName" phase="start" num="50">
7290       <synopsis>Get Source File Name</synopsis>
7291       <description>
7292         For the class indicated by <code>klass</code>, return the source file
7293         name via <code>source_name_ptr</code>. The returned string
7294         is a file name only and never contains a directory name.
7295         <p/>
7296         For primitive classes (for example, <code>java.lang.Integer.TYPE</code>)
7297         and for arrays this function returns
7298         <errorlink id="JVMTI_ERROR_ABSENT_INFORMATION"></errorlink>.
7299       </description>
7300       <origin>jvmdi</origin>
7301       <capabilities>
7302         <required id="can_get_source_file_name"></required>
7303       </capabilities>
7304       <parameters>
7305         <param id="klass">
7306           <jclass/>
7307             <description>
7308               The class to query.
7309             </description>
7310         </param>
7311         <param id="source_name_ptr">
7312           <allocbuf><char/></allocbuf>
7313           <description>
7314             On return, points to the class's source file name, encoded as a
7315             <internallink id="mUTF">modified UTF-8</internallink> string.
7316           </description>
7317         </param>
7318       </parameters>
7319       <errors>
7320         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7321           Class information does not include a source file name. This includes
7322           cases where the class is an array class or primitive class.
7323         </error>
7324       </errors>
7325     </function>
7326 
7327     <function id="GetClassModifiers" phase="start" num="51">
7328       <synopsis>Get Class Modifiers</synopsis>
7329       <description>
7330         For the class indicated by <code>klass</code>, return the access
7331         flags
7332         via <code>modifiers_ptr</code>.
7333         Access flags are defined in <vmspec chapter="4"/>.
7334         <p/>
7335         If the class is an array class, then its public, private, and protected
7336         modifiers are the same as those of its component type. For arrays of
7337         primitives, this component type is represented by one of the primitive
7338         classes (for example, <code>java.lang.Integer.TYPE</code>).
7339         <p/>
7340         If the class is a primitive class, its public modifier is always true,
7341         and its protected and private modifiers are always false.
7342         <p/>
7343         If the class is an array class or a primitive class then its final
7344         modifier is always true and its interface modifier is always false.
7345         The values of its other modifiers are not determined by this specification.
7346 
7347       </description>
7348       <origin>jvmdi</origin>
7349       <capabilities>
7350       </capabilities>
7351       <parameters>
7352         <param id="klass">
7353           <jclass/>
7354             <description>
7355               The class to query.
7356             </description>
7357         </param>
7358         <param id="modifiers_ptr">
7359           <outptr><jint/></outptr>
7360           <description>
7361             On return, points to the current access flags of this class.
7362 
7363           </description>
7364         </param>
7365       </parameters>
7366       <errors>
7367       </errors>
7368     </function>
7369 
7370     <function id="GetClassMethods" phase="start" num="52">
7371       <synopsis>Get Class Methods</synopsis>
7372       <description>
7373         For the class indicated by <code>klass</code>, return a count of
7374         methods via <code>method_count_ptr</code> and a list of
7375         method IDs via <code>methods_ptr</code>. The method list contains
7376         constructors and static initializers as well as true methods.
7377         Only directly declared methods are returned (not inherited methods).
7378         An empty method list is returned for array classes and primitive classes
7379         (for example, <code>java.lang.Integer.TYPE</code>).
7380       </description>
7381       <origin>jvmdi</origin>
7382       <capabilities>
7383         <capability id="can_maintain_original_method_order"/>
7384       </capabilities>
7385       <parameters>
7386         <param id="klass">
7387           <jclass/>
7388             <description>
7389               The class to query.
7390             </description>
7391         </param>
7392         <param id="method_count_ptr">
7393           <outptr><jint/></outptr>
7394           <description>
7395             On return, points to the number of methods declared in this class.
7396           </description>
7397         </param>
7398         <param id="methods_ptr">
7399           <allocbuf outcount="method_count_ptr"><jmethodID class="klass"/></allocbuf>
7400             <description>
7401               On return, points to the method ID array.
7402             </description>
7403         </param>
7404       </parameters>
7405       <errors>
7406         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7407           <paramlink id="klass"></paramlink> is not prepared.
7408         </error>
7409       </errors>
7410     </function>
7411 
7412     <function id="GetClassFields" phase="start" num="53">
7413       <synopsis>Get Class Fields</synopsis>
7414       <description>
7415         For the class indicated by <code>klass</code>, return a count of fields
7416         via <code>field_count_ptr</code> and a list of field IDs via
7417         <code>fields_ptr</code>.
7418         Only directly declared fields are returned (not inherited fields).
7419         Fields are returned in the order they occur in the class file.
7420         An empty field list is returned for array classes and primitive classes
7421         (for example, <code>java.lang.Integer.TYPE</code>).
7422         Use JNI to determine the length of an array.
7423       </description>
7424       <origin>jvmdi</origin>
7425       <capabilities>
7426       </capabilities>
7427       <parameters>
7428         <param id="klass">
7429           <jclass/>
7430             <description>
7431               The class to query.
7432             </description>
7433         </param>
7434         <param id="field_count_ptr">
7435           <outptr><jint/></outptr>
7436           <description>
7437             On return, points to the number of fields declared in this class.
7438           </description>
7439         </param>
7440         <param id="fields_ptr">
7441           <allocbuf outcount="field_count_ptr"><jfieldID/></allocbuf>
7442             <description>
7443               On return, points to the field ID array.
7444             </description>
7445         </param>
7446       </parameters>
7447       <errors>
7448         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7449           <paramlink id="klass"></paramlink> is not prepared.
7450         </error>
7451       </errors>
7452     </function>
7453 
7454     <function id="GetImplementedInterfaces" phase="start" num="54">
7455       <synopsis>Get Implemented Interfaces</synopsis>
7456       <description>
7457         Return the direct super-interfaces of this class. For a class, this
7458         function returns the interfaces declared in its <code>implements</code>
7459         clause. For an interface, this function returns the interfaces declared in
7460         its <code>extends</code> clause.
7461         An empty interface list is returned for array classes and primitive classes
7462         (for example, <code>java.lang.Integer.TYPE</code>).
7463       </description>
7464       <origin>jvmdi</origin>
7465       <capabilities>
7466       </capabilities>
7467       <parameters>
7468         <param id="klass">
7469           <jclass/>
7470             <description>
7471               The class to query.
7472             </description>
7473         </param>
7474         <param id="interface_count_ptr">
7475           <outptr><jint/></outptr>
7476           <description>
7477             On return, points to the number of interfaces.
7478           </description>
7479         </param>
7480         <param id="interfaces_ptr">
7481           <allocbuf outcount="interface_count_ptr"><jclass/></allocbuf>
7482             <description>
7483               On return, points to the interface array.
7484             </description>
7485         </param>
7486       </parameters>
7487       <errors>
7488         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7489           <paramlink id="klass"></paramlink> is not prepared.
7490         </error>
7491       </errors>
7492     </function>
7493 
7494     <function id="GetClassVersionNumbers" phase="start" num="145" since="1.1">
7495       <synopsis>Get Class Version Numbers</synopsis>
7496       <description>
7497         For the class indicated by <code>klass</code>,
7498         return the minor and major version numbers,
7499         as defined in
7500         <vmspec chapter="4"/>.
7501       </description>
7502       <origin>new</origin>
7503       <capabilities>
7504       </capabilities>
7505       <parameters>
7506         <param id="klass">
7507           <jclass/>
7508             <description>
7509               The class to query.
7510             </description>
7511         </param>
7512         <param id="minor_version_ptr">
7513           <outptr><jint/></outptr>
7514           <description>
7515             On return, points to the value of the
7516             <code>minor_version</code> item of the
7517             Class File Format.
7518             Note: to be consistent with the Class File Format,
7519             the minor version number is the first parameter.
7520           </description>
7521         </param>
7522         <param id="major_version_ptr">
7523           <outptr><jint/></outptr>
7524           <description>
7525             On return, points to the value of the
7526             <code>major_version</code> item of the
7527             Class File Format.
7528           </description>
7529         </param>
7530       </parameters>
7531       <errors>
7532         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7533           The class is a primitive or array class.
7534         </error>
7535       </errors>
7536     </function>
7537 
7538     <function id="GetConstantPool" phase="start" num="146" since="1.1">
7539       <synopsis>Get Constant Pool</synopsis>
7540       <description>
7541         For the class indicated by <code>klass</code>,
7542         return the raw bytes of the constant pool in the format of the
7543         <code>constant_pool</code> item of
7544         <vmspec chapter="4"/>.
7545         The format of the constant pool may differ between versions
7546         of the Class File Format, so, the
7547         <functionlink id="GetClassVersionNumbers">minor and major
7548         class version numbers</functionlink> should be checked for
7549         compatibility.
7550         <p/>
7551         The returned constant pool might not have the same layout or
7552         contents as the constant pool in the defining class file.
7553         The constant pool returned by GetConstantPool() may have
7554         more or fewer entries than the defining constant pool.
7555         Entries may be in a different order.
7556         The constant pool returned by GetConstantPool() will match the
7557         constant pool used by
7558         <functionlink id="GetBytecodes">GetBytecodes()</functionlink>.
7559         That is, the bytecodes returned by GetBytecodes() will have
7560         constant pool indices which refer to constant pool entries returned
7561         by GetConstantPool().
7562         Note that since <functionlink id="RetransformClasses"/>
7563         and <functionlink id="RedefineClasses"/> can change
7564         the constant pool, the constant pool returned by this function
7565         can change accordingly.  Thus, the correspondence between
7566         GetConstantPool() and GetBytecodes() does not hold if there
7567         is an intervening class retransformation or redefinition.
7568         The value of a constant pool entry used by a given bytecode will
7569         match that of the defining class file (even if the indices don't match).
7570         Constant pool entries which are not used directly or indirectly by
7571         bytecodes (for example,  UTF-8 strings associated with annotations) are
7572         not  required to exist in the returned constant pool.
7573       </description>
7574       <origin>new</origin>
7575       <capabilities>
7576         <required id="can_get_constant_pool"></required>
7577       </capabilities>
7578       <parameters>
7579         <param id="klass">
7580           <jclass/>
7581             <description>
7582               The class to query.
7583             </description>
7584         </param>
7585         <param id="constant_pool_count_ptr">
7586           <outptr><jint/></outptr>
7587           <description>
7588             On return, points to the number of entries
7589             in the constant pool table plus one.
7590             This corresponds to the <code>constant_pool_count</code>
7591             item of the Class File Format.
7592           </description>
7593         </param>
7594         <param id="constant_pool_byte_count_ptr">
7595           <outptr><jint/></outptr>
7596           <description>
7597             On return, points to the number of bytes
7598             in the returned raw constant pool.
7599           </description>
7600         </param>
7601         <param id="constant_pool_bytes_ptr">
7602           <allocbuf outcount="constant_pool_byte_count_ptr"><uchar/></allocbuf>
7603             <description>
7604               On return, points to the raw constant pool, that is the bytes
7605               defined by the <code>constant_pool</code> item of the
7606               Class File Format
7607             </description>
7608         </param>
7609       </parameters>
7610       <errors>
7611         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7612           The class is a primitive or array class.
7613         </error>
7614       </errors>
7615     </function>
7616 
7617     <function id="IsInterface" phase="start" num="55">
7618       <synopsis>Is Interface</synopsis>
7619       <description>
7620         Determines whether a class object reference represents an interface.
7621         The <code>jboolean</code> result is
7622         <code>JNI_TRUE</code> if the "class" is actually an interface,
7623         <code>JNI_FALSE</code> otherwise.
7624       </description>
7625       <origin>jvmdi</origin>
7626       <capabilities>
7627       </capabilities>
7628       <parameters>
7629         <param id="klass">
7630           <jclass/>
7631             <description>
7632               The class to query.
7633             </description>
7634         </param>
7635         <param id="is_interface_ptr">
7636           <outptr><jboolean/></outptr>
7637           <description>
7638             On return, points to the boolean result of this function.
7639 
7640           </description>
7641         </param>
7642       </parameters>
7643       <errors>
7644       </errors>
7645     </function>
7646 
7647     <function id="IsArrayClass" phase="start" num="56">
7648       <synopsis>Is Array Class</synopsis>
7649       <description>
7650         Determines whether a class object reference represents an array.
7651         The <code>jboolean</code> result is
7652         <code>JNI_TRUE</code> if the class is an array,
7653         <code>JNI_FALSE</code> otherwise.
7654       </description>
7655       <origin>jvmdi</origin>
7656       <capabilities>
7657       </capabilities>
7658       <parameters>
7659         <param id="klass">
7660           <jclass/>
7661             <description>
7662               The class to query.
7663             </description>
7664         </param>
7665         <param id="is_array_class_ptr">
7666           <outptr><jboolean/></outptr>
7667           <description>
7668             On return, points to the boolean result of this function.
7669 
7670           </description>
7671         </param>
7672       </parameters>
7673       <errors>
7674       </errors>
7675     </function>
7676 
7677     <function id="IsModifiableClass" jkernel="yes" phase="start" num="45" since="1.1">
7678       <synopsis>Is Modifiable Class</synopsis>
7679       <description>
7680         Determines whether a class is modifiable.
7681         If a class is modifiable (<paramlink id="is_modifiable_class_ptr"/>
7682         returns <code>JNI_TRUE</code>) the class can be
7683         redefined with <functionlink id="RedefineClasses"/> (assuming
7684         the agent possesses the
7685         <fieldlink id="can_redefine_classes" struct="jvmtiCapabilities"/>
7686         capability) or
7687         retransformed with <functionlink id="RetransformClasses"/> (assuming
7688         the agent possesses the
7689         <fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
7690         capability).
7691         If a class is not modifiable (<paramlink id="is_modifiable_class_ptr"/>
7692         returns <code>JNI_FALSE</code>) the class can be neither
7693         redefined nor retransformed.
7694         <p/>
7695         Primitive classes (for example, <code>java.lang.Integer.TYPE</code>),
7696         array classes, and some implementation defined classes are never modifiable.
7697         <p/>
7698       </description>
7699       <origin>new</origin>
7700       <capabilities>
7701         <capability id="can_redefine_any_class">
7702           If possessed then all classes (except primitive, array, and some implementation defined
7703           classes) are modifiable with <functionlink id="RedefineClasses"/>.
7704         </capability>
7705         <capability id="can_retransform_any_class">
7706           If possessed then all classes (except primitive, array, and some implementation defined
7707           classes) are modifiable with <functionlink id="RetransformClasses"/>.
7708         </capability>
7709         <capability id="can_redefine_classes">
7710           No effect on the result of the function.
7711           But must additionally be possessed to modify the class with
7712           <functionlink id="RedefineClasses"/>.
7713         </capability>
7714         <capability id="can_retransform_classes">
7715           No effect on the result of the function.
7716           But must additionally be possessed to modify the class with
7717           <functionlink id="RetransformClasses"/>.
7718         </capability>
7719       </capabilities>
7720       <parameters>
7721         <param id="klass">
7722           <jclass/>
7723             <description>
7724               The class to query.
7725             </description>
7726         </param>
7727         <param id="is_modifiable_class_ptr">
7728           <outptr><jboolean/></outptr>
7729           <description>
7730             On return, points to the boolean result of this function.
7731           </description>
7732         </param>
7733       </parameters>
7734       <errors>
7735       </errors>
7736     </function>
7737 
7738     <function id="GetClassLoader" phase="start" num="57">
7739       <synopsis>Get Class Loader</synopsis>
7740       <description>
7741         For the class indicated by <code>klass</code>, return via
7742         <code>classloader_ptr</code> a reference to the class loader for the
7743         class.
7744       </description>
7745       <origin>jvmdi</origin>
7746       <capabilities>
7747       </capabilities>
7748       <parameters>
7749         <param id="klass">
7750           <jclass/>
7751             <description>
7752               The class to query.
7753             </description>
7754         </param>
7755         <param id="classloader_ptr">
7756           <outptr><jobject/></outptr>
7757             <description>
7758               On return, points to the class loader that loaded
7759               this class.
7760               If the class was not created by a class loader
7761               or if the class loader is the bootstrap class loader,
7762               points to <code>NULL</code>.
7763             </description>
7764         </param>
7765       </parameters>
7766       <errors>
7767       </errors>
7768 
7769     </function>
7770 
7771     <function id="GetSourceDebugExtension" phase="start" num="90">
7772       <synopsis>Get Source Debug Extension</synopsis>
7773       <description>
7774         For the class indicated by <code>klass</code>, return the debug
7775         extension via <code>source_debug_extension_ptr</code>.
7776         The returned string
7777         contains exactly the debug extension information present in the
7778         class file of <code>klass</code>.
7779       </description>
7780       <origin>jvmdi</origin>
7781       <capabilities>
7782         <required id="can_get_source_debug_extension"></required>
7783       </capabilities>
7784       <parameters>
7785         <param id="klass">
7786           <jclass/>
7787             <description>
7788               The class to query.
7789             </description>
7790         </param>
7791         <param id="source_debug_extension_ptr">
7792           <allocbuf><char/></allocbuf>
7793           <description>
7794             On return, points to the class's debug extension, encoded as a
7795             <internallink id="mUTF">modified UTF-8</internallink> string.
7796           </description>
7797         </param>
7798       </parameters>
7799       <errors>
7800         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7801           Class information does not include a debug extension.
7802         </error>
7803       </errors>
7804     </function>
7805 
7806     <function id="RetransformClasses" jkernel="yes" num="152" since="1.1">
7807       <synopsis>Retransform Classes</synopsis>
7808       <description>
7809         This function facilitates the
7810         <internallink id="bci">bytecode instrumentation</internallink>
7811         of already loaded classes.
7812         To replace the class definition without reference to the existing
7813         bytecodes, as one might do when recompiling from source for
7814         fix-and-continue debugging, <functionlink id="RedefineClasses"/>
7815         function should be used instead.
7816         <p/>
7817         When classes are initially loaded or when they are
7818         <functionlink id="RedefineClasses">redefined</functionlink>,
7819         the initial class file bytes can be transformed with the
7820         <eventlink id="ClassFileLoadHook"/> event.
7821         This function reruns the transformation process
7822         (whether or not a transformation has previously occurred).
7823         This retransformation follows these steps:
7824         <ul>
7825           <li>starting from the initial class file bytes
7826           </li>
7827           <li>for each <fieldlink id="can_retransform_classes"
7828                      struct="jvmtiCapabilities">retransformation
7829                                                 incapable</fieldlink>
7830             agent which received a
7831             <code>ClassFileLoadHook</code> event during the previous
7832             load or redefine, the bytes it returned
7833             (via the <code>new_class_data</code> parameter)
7834             are reused as the output of the transformation;
7835             note that this is equivalent to reapplying
7836             the previous transformation, unaltered. except that
7837             the <code>ClassFileLoadHook</code> event
7838             is <b>not</b> sent to these agents
7839           </li>
7840           <li>for each <fieldlink id="can_retransform_classes"
7841                      struct="jvmtiCapabilities">retransformation
7842                                                 capable</fieldlink>
7843             agent, the <code>ClassFileLoadHook</code> event is sent,
7844             allowing a new transformation to be applied
7845           </li>
7846           <li>the transformed class file bytes are installed as the new
7847             definition of the class
7848           </li>
7849         </ul>
7850         See the <eventlink id="ClassFileLoadHook"/> event for more details.
7851         <p/>
7852         The initial class file bytes represent the bytes passed to
7853         <code>ClassLoader.defineClass</code>
7854         or <code>RedefineClasses</code> (before any transformations
7855         were applied), however they may not exactly match them.
7856         The constant pool may differ in ways described in
7857         <functionlink id="GetConstantPool"/>.
7858         Constant pool indices in the bytecodes of methods will correspond.
7859         Some attributes may not be present.
7860         Where order is not meaningful, for example the order of methods,
7861         order may not be preserved.
7862         <p/>
7863         Retransformation can cause new versions of methods to be installed.
7864         Old method versions may become
7865         <internallink id="obsoleteMethods">obsolete</internallink>
7866         The new method version will be used on new invokes.
7867         If a method has active stack frames, those active frames continue to
7868         run the bytecodes of the original method version.
7869         <p/>
7870         This function does not cause any initialization except that which
7871         would occur under the customary JVM semantics.
7872         In other words, retransforming a class does not cause its initializers to be
7873         run. The values of static fields will remain as they were
7874         prior to the call.
7875         <p/>
7876         Threads need not be suspended.
7877         <p/>
7878         All breakpoints in the class are cleared.
7879         <p/>
7880         All attributes are updated.
7881         <p/>
7882         Instances of the retransformed class are not affected -- fields retain their
7883         previous values.
7884         <functionlink id="GetTag">Tags</functionlink> on the instances are
7885         also unaffected.
7886         <p/>
7887         In response to this call, no events other than the
7888         <eventlink id="ClassFileLoadHook"/> event
7889         will be sent.
7890         <p/>
7891         The retransformation may change method bodies, the constant pool and attributes
7892         (unless explicitly prohibited).
7893         The retransformation must not add, remove or rename fields or methods, change the
7894         signatures of methods, change modifiers, or change inheritance.
7895         The retransformation must not change the <code>NestHost</code> or
7896         <code>NestMembers</code> attributes.
7897         These restrictions may be lifted in future versions.
7898         See the error return description below for information on error codes
7899         returned if an unsupported retransformation is attempted.
7900         The class file bytes are not verified or installed until they have passed
7901         through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7902         returned error code reflects the result of the transformations.
7903         If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7904         none of the classes to be retransformed will have a new definition installed.
7905         When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7906         all of the classes to be retransformed will have their new definitions installed.
7907       </description>
7908       <origin>new</origin>
7909       <capabilities>
7910         <required id="can_retransform_classes"></required>
7911         <capability id="can_retransform_any_class"></capability>
7912       </capabilities>
7913       <parameters>
7914         <param id="class_count">
7915           <jint min="0"/>
7916           <description>
7917             The number of classes to be retransformed.
7918           </description>
7919         </param>
7920         <param id="classes">
7921           <inbuf incount="class_count"><jclass/></inbuf>
7922           <description>
7923             The array of classes to be retransformed.
7924           </description>
7925         </param>
7926       </parameters>
7927       <errors>
7928         <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7929           One of the <paramlink id="classes"/> cannot be modified.
7930           See <functionlink id="IsModifiableClass"/>.
7931         </error>
7932         <error id="JVMTI_ERROR_INVALID_CLASS">
7933           One of the <paramlink id="classes"/> is not a valid class.
7934         </error>
7935         <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7936           A retransformed class file has a version number not supported by this VM.
7937         </error>
7938         <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7939           A retransformed class file is malformed (The VM would return a <code>ClassFormatError</code>).
7940         </error>
7941         <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7942           The retransformed class file definitions would lead to a circular definition
7943           (the VM would return a <code>ClassCircularityError</code>).
7944         </error>
7945         <error id="JVMTI_ERROR_FAILS_VERIFICATION">
7946           The retransformed class file bytes fail verification.
7947         </error>
7948         <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7949           The class name defined in a retransformed class file is
7950           different from the name in the old class object.
7951         </error>
7952         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7953           A retransformed class file would require adding a method.
7954         </error>
7955         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7956           A retransformed class file changes a field.
7957         </error>
7958         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7959           A direct superclass is different for a retransformed class file,
7960           or the set of directly implemented
7961           interfaces is different.
7962         </error>
7963         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7964           A retransformed class file does not declare a method
7965           declared in the old class version.
7966         </error>
7967         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED">
7968           A retransformed class file has unsupported differences in class attributes.
7969         </error>
7970         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7971           A retransformed class file has different class modifiers.
7972         </error>
7973         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7974           A method in the retransformed class file has different modifiers
7975           than its counterpart in the old class version.
7976         </error>
7977       </errors>
7978     </function>
7979 
7980     <function id="RedefineClasses" jkernel="yes" num="87">
7981       <synopsis>Redefine Classes</synopsis>
7982       <typedef id="jvmtiClassDefinition" label="Class redefinition description">
7983         <field id="klass">
7984           <jclass/>
7985             <description>
7986               Class object for this class
7987             </description>
7988         </field>
7989         <field id="class_byte_count">
7990           <jint/>
7991           <description>
7992             Number of bytes defining class (below)
7993           </description>
7994         </field>
7995         <field id="class_bytes">
7996           <inbuf incount="class_byte_count"><uchar/></inbuf>
7997           <description>
7998             Bytes defining class (in <vmspec chapter="4"/>)
7999           </description>
8000         </field>
8001       </typedef>
8002       <description>
8003         All classes given are redefined according to the definitions
8004         supplied.
8005         This function is used to replace the definition of a class
8006         with a new definition, as might be needed in fix-and-continue
8007         debugging.
8008         Where the existing class file bytes are to be transformed, for
8009         example in
8010         <internallink id="bci">bytecode instrumentation</internallink>,
8011         <functionlink id="RetransformClasses"/> should be used.
8012         <p/>
8013         Redefinition can cause new versions of methods to be installed.
8014         Old method versions may become
8015         <internallink id="obsoleteMethods">obsolete</internallink>
8016         The new method version will be used on new invokes.
8017         If a method has active stack frames, those active frames continue to
8018         run the bytecodes of the original method version.
8019         If resetting of stack frames is desired, use
8020         <functionlink id="PopFrame"></functionlink>
8021         to pop frames with obsolete method versions.
8022         <p/>
8023         This function does not cause any initialization except that which
8024         would occur under the customary JVM semantics.
8025         In other words, redefining a class does not cause its initializers to be
8026         run. The values of static fields will remain as they were
8027         prior to the call.
8028         <p/>
8029         Threads need not be suspended.
8030         <p/>
8031         All breakpoints in the class are cleared.
8032         <p/>
8033         All attributes are updated.
8034         <p/>
8035         Instances of the redefined class are not affected -- fields retain their
8036         previous values.
8037         <functionlink id="GetTag">Tags</functionlink> on the instances are
8038         also unaffected.
8039         <p/>
8040         In response to this call, the <jvmti/> event
8041         <eventlink id="ClassFileLoadHook">Class File Load Hook</eventlink>
8042         will be sent (if enabled), but no other <jvmti/> events will be sent.
8043         <p/>
8044         The redefinition may change method bodies, the constant pool and attributes
8045         (unless explicitly prohibited).
8046         The redefinition must not add, remove or rename fields or methods, change the
8047         signatures of methods, change modifiers, or change inheritance.
8048         The retransformation must not change the <code>NestHost</code> or
8049         <code>NestMembers</code> attributes.
8050         These restrictions may be lifted in future versions.
8051         See the error return description below for information on error codes
8052         returned if an unsupported redefinition is attempted.
8053         The class file bytes are not verified or installed until they have passed
8054         through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
8055         returned error code reflects the result of the transformations applied
8056         to the bytes passed into <paramlink id="class_definitions"/>.
8057         If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
8058         none of the classes to be redefined will have a new definition installed.
8059         When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
8060         all of the classes to be redefined will have their new definitions installed.
8061       </description>
8062       <origin>jvmdi</origin>
8063       <capabilities>
8064         <required id="can_redefine_classes"></required>
8065         <capability id="can_redefine_any_class"></capability>
8066       </capabilities>
8067       <parameters>
8068         <param id="class_count">
8069           <jint min="0"/>
8070           <description>
8071             The number of classes specified in <code>class_definitions</code>
8072           </description>
8073         </param>
8074         <param id="class_definitions">
8075           <inbuf incount="class_count"><struct>jvmtiClassDefinition</struct></inbuf>
8076           <description>
8077             The array of new class definitions
8078           </description>
8079         </param>
8080       </parameters>
8081       <errors>
8082         <error id="JVMTI_ERROR_NULL_POINTER">
8083           One of <code>class_bytes</code> is <code>NULL</code>.
8084         </error>
8085         <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
8086           An element of <code>class_definitions</code> cannot be modified.
8087           See <functionlink id="IsModifiableClass"/>.
8088         </error>
8089         <error id="JVMTI_ERROR_INVALID_CLASS">
8090           An element of <code>class_definitions</code> is not a valid class.
8091         </error>
8092         <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
8093           A new class file has a version number not supported by this VM.
8094         </error>
8095         <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
8096           A new class file is malformed (The VM would return a <code>ClassFormatError</code>).
8097         </error>
8098         <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
8099           The new class file definitions would lead to a circular definition
8100           (the VM would return a <code>ClassCircularityError</code>).
8101         </error>
8102         <error id="JVMTI_ERROR_FAILS_VERIFICATION">
8103           The class bytes fail verification.
8104         </error>
8105         <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
8106           The class name defined in a new class file is
8107           different from the name in the old class object.
8108         </error>
8109         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
8110           A new class file would require adding a method.
8111         </error>
8112         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
8113           A new class version changes a field.
8114         </error>
8115         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
8116           A direct superclass is different for a new class
8117           version, or the set of directly implemented
8118           interfaces is different.
8119         </error>
8120         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
8121           A new class version does not declare a method
8122           declared in the old class version.
8123         </error>
8124         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED">
8125           A new class version has unsupported differences in class attributes.
8126         </error>
8127         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
8128           A new class version has different modifiers.
8129         </error>
8130         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
8131           A method in the new class version has different modifiers
8132           than its counterpart in the old class version.
8133         </error>
8134         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
8135           A module cannot be modified.
8136           See <functionlink id="IsModifiableModule"/>.
8137         </error>
8138       </errors>
8139     </function>
8140 
8141   </category>
8142 
8143   <category id="object" label="Object">
8144 
8145     <function id="GetObjectSize" jkernel="yes" phase="start" num="154">
8146       <synopsis>Get Object Size</synopsis>
8147       <description>
8148         For the object indicated by <code>object</code>,
8149         return via <code>size_ptr</code> the size of the object.
8150         This size is an implementation-specific approximation of
8151         the amount of storage consumed by this object.
8152         It may include some or all of the object's overhead, and thus
8153         is useful for comparison within an implementation but not
8154         between implementations.
8155         The estimate may change during a single invocation of the JVM.
8156       </description>
8157       <origin>new</origin>
8158       <capabilities>
8159       </capabilities>
8160       <parameters>
8161         <param id="object">
8162           <jobject/>
8163             <description>
8164               The object to query.
8165             </description>
8166         </param>
8167         <param id="size_ptr">
8168           <outptr><jlong/></outptr>
8169           <description>
8170             On return, points to the object's size in bytes.
8171           </description>
8172         </param>
8173       </parameters>
8174       <errors>
8175       </errors>
8176     </function>
8177 
8178     <function id="GetObjectHashCode" phase="start" num="58">
8179       <synopsis>Get Object Hash Code</synopsis>
8180       <description>
8181         For the object indicated by <code>object</code>,
8182         return via <code>hash_code_ptr</code> a hash code.
8183         This hash code could be used to maintain a hash table of object references,
8184         however, on some implementations this can cause significant performance
8185         impacts--in most cases
8186         <internallink id="Heap">tags</internallink>
8187         will be a more efficient means of associating information with objects.
8188         This function guarantees
8189         the same hash code value for a particular object throughout its life
8190       </description>
8191       <origin>jvmdi</origin>
8192       <capabilities>
8193       </capabilities>
8194       <parameters>
8195         <param id="object">
8196           <jobject/>
8197             <description>
8198               The object to query.
8199             </description>
8200         </param>
8201         <param id="hash_code_ptr">
8202           <outptr><jint/></outptr>
8203           <description>
8204             On return, points to the object's hash code.
8205           </description>
8206         </param>
8207       </parameters>
8208       <errors>
8209       </errors>
8210     </function>
8211 
8212     <function id="GetObjectMonitorUsage" num="59">
8213       <synopsis>Get Object Monitor Usage</synopsis>
8214       <typedef id="jvmtiMonitorUsage" label="Object monitor usage information">
8215         <field id="owner">
8216           <jthread/>
8217             <description>
8218               The thread owning this monitor, or <code>NULL</code> if unused
8219             </description>
8220         </field>
8221         <field id="entry_count">
8222           <jint/>
8223           <description>
8224             The number of times the owning thread has entered the monitor
8225           </description>
8226         </field>
8227         <field id="waiter_count">
8228           <jint/>
8229           <description>
8230             The number of threads waiting to own this monitor
8231           </description>
8232         </field>
8233         <field id="waiters">
8234           <allocfieldbuf><jthread/></allocfieldbuf>
8235             <description>
8236               The <code>waiter_count</code> waiting threads
8237             </description>
8238         </field>
8239         <field id="notify_waiter_count">
8240           <jint/>
8241           <description>
8242             The number of threads waiting to be notified by this monitor
8243           </description>
8244         </field>
8245         <field id="notify_waiters">
8246           <allocfieldbuf><jthread/></allocfieldbuf>
8247             <description>
8248               The <code>notify_waiter_count</code> threads waiting to be notified
8249             </description>
8250         </field>
8251       </typedef>
8252       <description>
8253         Get information about the object's monitor.
8254         The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure
8255         are filled in with information about usage of the monitor.
8256           <todo>
8257             Decide and then clarify suspend requirements.
8258           </todo>
8259       </description>
8260       <origin>jvmdi</origin>
8261       <capabilities>
8262         <required id="can_get_monitor_info"></required>
8263       </capabilities>
8264       <parameters>
8265         <param id="object">
8266           <jobject/>
8267             <description>
8268               The object to query.
8269             </description>
8270         </param>
8271         <param id="info_ptr">
8272           <outptr><struct>jvmtiMonitorUsage</struct></outptr>
8273           <description>
8274             On return, filled with monitor information for the
8275             specified object.
8276           </description>
8277         </param>
8278       </parameters>
8279       <errors>
8280       </errors>
8281     </function>
8282 
8283     <elide>
8284     <function id="GetObjectMonitors" num="116">
8285       <synopsis>Get Object Monitors</synopsis>
8286       <description>
8287         Return the list of object monitors.
8288         <p/>
8289         Note: details about each monitor can be examined with
8290         <functionlink id="GetObjectMonitorUsage"></functionlink>.
8291       </description>
8292       <origin>new</origin>
8293       <capabilities>
8294         <required id="can_get_monitor_info"></required>
8295       </capabilities>
8296       <parameters>
8297         <param id="monitorCnt">
8298           <outptr><jint/></outptr>
8299           <description>
8300             On return, pointer to the number
8301             of monitors returned in <code>monitors_ptr</code>.
8302           </description>
8303         </param>
8304         <param id="monitors_ptr">
8305           <allocbuf outcount="monitorCnt"><jobject/></allocbuf>
8306             <description>
8307               On return, pointer to the monitor list.
8308             </description>
8309         </param>
8310       </parameters>
8311       <errors>
8312       </errors>
8313     </function>
8314     </elide>
8315 
8316   </category>
8317 
8318   <category id="fieldCategory" label="Field">
8319 
8320     <intro>
8321     </intro>
8322 
8323     <function id="GetFieldName" phase="start" num="60">
8324       <synopsis>Get Field Name (and Signature)</synopsis>
8325       <description>
8326         For the field indicated by <paramlink id="klass"/> and <paramlink id="field"/>,
8327         return the field name via <paramlink id="name_ptr"/> and field signature via
8328         <paramlink id="signature_ptr"/>.
8329         <p/>
8330         Field signatures are defined in the
8331         <externallink id="jni/index.html">JNI Specification</externallink>
8332         and are referred to as <code>field descriptors</code> in
8333         <vmspec chapter="4.3.2"/>.
8334       </description>
8335       <origin>jvmdiClone</origin>
8336       <capabilities>
8337       </capabilities>
8338       <parameters>
8339         <param id="klass">
8340           <jclass field="field"/>
8341             <description>
8342               The class of the field to query.
8343             </description>
8344         </param>
8345         <param id="field">
8346           <jfieldID class="klass"/>
8347             <description>
8348               The field to query.
8349             </description>
8350         </param>
8351         <param id="name_ptr">
8352           <allocbuf>
8353             <char/>
8354             <nullok>the name is not returned</nullok>
8355           </allocbuf>
8356           <description>
8357             On return, points to the field name, encoded as a
8358             <internallink id="mUTF">modified UTF-8</internallink> string.
8359           </description>
8360         </param>
8361         <param id="signature_ptr">
8362           <allocbuf>
8363             <char/>
8364             <nullok>the signature is not returned</nullok>
8365           </allocbuf>
8366           <description>
8367             On return, points to the field signature, encoded as a
8368             <internallink id="mUTF">modified UTF-8</internallink> string.
8369           </description>
8370         </param>
8371         <param id="generic_ptr">
8372           <allocbuf>
8373             <char/>
8374             <nullok>the generic signature is not returned</nullok>
8375           </allocbuf>
8376           <description>
8377             On return, points to the generic signature of the field, encoded as a
8378             <internallink id="mUTF">modified UTF-8</internallink> string.
8379             If there is no generic signature attribute for the field, then,
8380             on return, points to <code>NULL</code>.
8381           </description>
8382         </param>
8383       </parameters>
8384       <errors>
8385       </errors>
8386     </function>
8387 
8388     <function id="GetFieldDeclaringClass" phase="start" num="61">
8389       <synopsis>Get Field Declaring Class</synopsis>
8390       <description>
8391         For the field indicated by <code>klass</code> and <code>field</code>
8392         return the class that defined it via <code>declaring_class_ptr</code>.
8393         The declaring class will either be <code>klass</code>, a superclass, or
8394         an implemented interface.
8395       </description>
8396       <origin>jvmdi</origin>
8397       <capabilities>
8398       </capabilities>
8399       <parameters>
8400         <param id="klass">
8401           <jclass field="field"/>
8402             <description>
8403               The class to query.
8404             </description>
8405         </param>
8406         <param id="field">
8407           <jfieldID class="klass"/>
8408             <description>
8409               The field to query.
8410             </description>
8411         </param>
8412         <param id="declaring_class_ptr">
8413           <outptr><jclass/></outptr>
8414             <description>
8415               On return, points to the declaring class
8416             </description>
8417         </param>
8418       </parameters>
8419       <errors>
8420       </errors>
8421     </function>
8422 
8423     <function id="GetFieldModifiers" phase="start" num="62">
8424       <synopsis>Get Field Modifiers</synopsis>
8425       <description>
8426         For the field indicated by <code>klass</code> and <code>field</code>
8427         return the access flags via <code>modifiers_ptr</code>.
8428         Access flags are defined in <vmspec chapter="4"/>.
8429       </description>
8430       <origin>jvmdi</origin>
8431       <capabilities>
8432       </capabilities>
8433       <parameters>
8434         <param id="klass">
8435           <jclass field="field"/>
8436             <description>
8437               The class to query.
8438             </description>
8439         </param>
8440         <param id="field">
8441           <jfieldID class="klass"/>
8442             <description>
8443               The field to query.
8444             </description>
8445         </param>
8446         <param id="modifiers_ptr">
8447           <outptr><jint/></outptr>
8448           <description>
8449             On return, points to the access flags.
8450           </description>
8451         </param>
8452       </parameters>
8453       <errors>
8454       </errors>
8455     </function>
8456 
8457     <function id="IsFieldSynthetic" phase="start" num="63">
8458       <synopsis>Is Field Synthetic</synopsis>
8459       <description>
8460         For the field indicated by <code>klass</code> and <code>field</code>, return a
8461         value indicating whether the field is synthetic via <code>is_synthetic_ptr</code>.
8462         Synthetic fields are generated by the compiler but not present in the
8463         original source code.
8464       </description>
8465       <origin>jvmdi</origin>
8466       <capabilities>
8467         <required id="can_get_synthetic_attribute"></required>
8468       </capabilities>
8469       <parameters>
8470         <param id="klass">
8471           <jclass field="field"/>
8472             <description>
8473               The class of the field to query.
8474             </description>
8475         </param>
8476         <param id="field">
8477           <jfieldID class="klass"/>
8478             <description>
8479               The field to query.
8480             </description>
8481         </param>
8482         <param id="is_synthetic_ptr">
8483           <outptr><jboolean/></outptr>
8484           <description>
8485             On return, points to the boolean result of this function.
8486           </description>
8487         </param>
8488       </parameters>
8489       <errors>
8490       </errors>
8491     </function>
8492 
8493   </category>
8494 
8495   <category id="method" label="Method">
8496 
8497     <intro>
8498       These functions provide information about a method (represented as a
8499       <typelink id="jmethodID"/>) and set how methods are processed.
8500     </intro>
8501 
8502     <intro id="obsoleteMethods" label="Obsolete Methods">
8503       The functions <functionlink id="RetransformClasses"/> and
8504       <functionlink id="RedefineClasses"/> can cause new versions
8505       of methods to be installed.
8506       An original version of a method is considered equivalent
8507       to the new version if:
8508       <ul>
8509         <li>their bytecodes are the same except for indices into the
8510           constant pool and </li>
8511         <li>the referenced constants are equal.</li>
8512       </ul>
8513       An original method version which is not equivalent to the
8514       new method version is called obsolete and is assigned a new method ID;
8515       the original method ID now refers to the new method version.
8516       A method ID can be tested for obsolescence with
8517       <functionlink id="IsMethodObsolete"/>.
8518     </intro>
8519 
8520     <function id="GetMethodName" phase="start" num="64">
8521       <synopsis>Get Method Name (and Signature)</synopsis>
8522       <description>
8523         For the method indicated by <code>method</code>,
8524         return the method name via <code>name_ptr</code> and method signature via
8525         <code>signature_ptr</code>.
8526         <p/>
8527         Method signatures are defined in the
8528         <externallink id="jni/index.html">JNI Specification</externallink>
8529         and are referred to as <code>method descriptors</code> in
8530         <vmspec chapter="4.3.3"/>.
8531         Note this is different
8532         than method signatures as defined in the <i>Java Language Specification</i>.
8533       </description>
8534       <origin>jvmdiClone</origin>
8535       <capabilities>
8536       </capabilities>
8537       <parameters>
8538         <param id="method">
8539           <jmethodID/>
8540             <description>
8541               The method to query.
8542             </description>
8543         </param>
8544         <param id="name_ptr">
8545           <allocbuf>
8546             <char/>
8547             <nullok>the name is not returned</nullok>
8548           </allocbuf>
8549           <description>
8550             On return, points to the method name, encoded as a
8551             <internallink id="mUTF">modified UTF-8</internallink> string.
8552           </description>
8553         </param>
8554         <param id="signature_ptr">
8555           <allocbuf>
8556             <char/>
8557             <nullok>the signature is not returned</nullok>
8558           </allocbuf>
8559           <description>
8560             On return, points to the method signature, encoded as a
8561             <internallink id="mUTF">modified UTF-8</internallink> string.
8562           </description>
8563         </param>
8564         <param id="generic_ptr">
8565           <allocbuf>
8566             <char/>
8567             <nullok>the generic signature is not returned</nullok>
8568           </allocbuf>
8569           <description>
8570             On return, points to the generic signature of the method, encoded as a
8571             <internallink id="mUTF">modified UTF-8</internallink> string.
8572             If there is no generic signature attribute for the method, then,
8573             on return, points to <code>NULL</code>.
8574           </description>
8575         </param>
8576       </parameters>
8577       <errors>
8578       </errors>
8579     </function>
8580 
8581     <function id="GetMethodDeclaringClass" phase="start" num="65">
8582       <synopsis>Get Method Declaring Class</synopsis>
8583       <description>
8584         For the method indicated by <code>method</code>,
8585         return the class that defined it via <code>declaring_class_ptr</code>.
8586       </description>
8587       <origin>jvmdi</origin>
8588       <capabilities>
8589       </capabilities>
8590       <parameters>
8591         <param id="klass">
8592           <jclass method="method"/>
8593             <description>
8594               The class to query.
8595             </description>
8596         </param>
8597         <param id="method">
8598           <jmethodID class="klass"/>
8599             <description>
8600               The method to query.
8601             </description>
8602         </param>
8603         <param id="declaring_class_ptr">
8604           <outptr><jclass/></outptr>
8605             <description>
8606               On return, points to the declaring class
8607             </description>
8608         </param>
8609       </parameters>
8610       <errors>
8611       </errors>
8612     </function>
8613 
8614     <function id="GetMethodModifiers" phase="start" num="66">
8615       <synopsis>Get Method Modifiers</synopsis>
8616       <description>
8617         For the method indicated by <code>method</code>,
8618         return the access flags via <code>modifiers_ptr</code>.
8619         Access flags are defined in <vmspec chapter="4"/>.
8620       </description>
8621       <origin>jvmdi</origin>
8622       <capabilities>
8623       </capabilities>
8624       <parameters>
8625         <param id="klass">
8626           <jclass method="method"/>
8627             <description>
8628               The class to query.
8629             </description>
8630         </param>
8631         <param id="method">
8632           <jmethodID class="klass"/>
8633             <description>
8634               The method to query.
8635             </description>
8636         </param>
8637         <param id="modifiers_ptr">
8638           <outptr><jint/></outptr>
8639           <description>
8640             On return, points to the access flags.
8641           </description>
8642         </param>
8643       </parameters>
8644       <errors>
8645       </errors>
8646     </function>
8647 
8648     <function id="GetMaxLocals" phase="start" num="68">
8649       <synopsis>Get Max Locals</synopsis>
8650       <description>
8651           For the method indicated by <code>method</code>,
8652           return the number of local variable slots used by the method,
8653           including the local variables used to pass parameters to the
8654           method on its invocation.
8655           <p/>
8656           See <code>max_locals</code> in <vmspec chapter="4.7.3"/>.
8657       </description>
8658       <origin>jvmdi</origin>
8659       <capabilities>
8660       </capabilities>
8661       <parameters>
8662         <param id="klass">
8663           <jclass method="method"/>
8664             <description>
8665               The class to query.
8666             </description>
8667         </param>
8668         <param id="method">
8669           <jmethodID class="klass" native="error"/>
8670             <description>
8671               The method to query.
8672             </description>
8673         </param>
8674         <param id="max_ptr">
8675           <outptr><jint/></outptr>
8676           <description>
8677             On return, points to the maximum number of local slots
8678           </description>
8679         </param>
8680       </parameters>
8681       <errors>
8682       </errors>
8683     </function>
8684 
8685     <function id="GetArgumentsSize" phase="start" num="69">
8686       <synopsis>Get Arguments Size</synopsis>
8687       <description>
8688         For the method indicated by <code>method</code>,
8689         return via <code>max_ptr</code> the number of local variable slots used
8690         by the method's arguments.
8691         Note that two-word arguments use two slots.
8692       </description>
8693       <origin>jvmdi</origin>
8694       <capabilities>
8695       </capabilities>
8696       <parameters>
8697         <param id="klass">
8698           <jclass method="method"/>
8699             <description>
8700               The class to query.
8701             </description>
8702         </param>
8703         <param id="method">
8704           <jmethodID class="klass" native="error"/>
8705             <description>
8706               The method to query.
8707             </description>
8708         </param>
8709         <param id="size_ptr">
8710           <outptr><jint/></outptr>
8711           <description>
8712             On return, points to the number of argument slots
8713           </description>
8714         </param>
8715       </parameters>
8716       <errors>
8717       </errors>
8718     </function>
8719 
8720     <function id="GetLineNumberTable" phase="start" num="70">
8721       <synopsis>Get Line Number Table</synopsis>
8722       <typedef id="jvmtiLineNumberEntry" label="Line number table entry">
8723         <field id="start_location">
8724           <jlocation/>
8725           <description>
8726             the <datalink id="jlocation"></datalink> where the line begins
8727           </description>
8728         </field>
8729         <field id="line_number">
8730           <jint/>
8731           <description>
8732             the line number
8733           </description>
8734         </field>
8735       </typedef>
8736       <description>
8737         For the method indicated by <code>method</code>,
8738         return a table of source line number entries. The size of the table is
8739         returned via <code>entry_count_ptr</code> and the table itself is
8740         returned via <code>table_ptr</code>.
8741       </description>
8742       <origin>jvmdi</origin>
8743       <capabilities>
8744         <required id="can_get_line_numbers"></required>
8745       </capabilities>
8746       <parameters>
8747         <param id="klass">
8748           <jclass method="method"/>
8749             <description>
8750               The class to query.
8751             </description>
8752         </param>
8753         <param id="method">
8754           <jmethodID class="klass" native="error"/>
8755             <description>
8756               The method to query.
8757             </description>
8758         </param>
8759         <param id="entry_count_ptr">
8760           <outptr><jint/></outptr>
8761           <description>
8762             On return, points to the number of entries in the table
8763           </description>
8764         </param>
8765         <param id="table_ptr">
8766           <allocbuf outcount="entry_count_ptr"><struct>jvmtiLineNumberEntry</struct></allocbuf>
8767           <description>
8768             On return, points to the line number table pointer.
8769           </description>
8770         </param>
8771       </parameters>
8772       <errors>
8773         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8774           Class information does not include line numbers.
8775         </error>
8776       </errors>
8777     </function>
8778 
8779     <function id="GetMethodLocation" phase="start" num="71">
8780       <synopsis>Get Method Location</synopsis>
8781       <description>
8782         For the method indicated by <code>method</code>,
8783         return the beginning and ending addresses through
8784         <code>start_location_ptr</code> and <code>end_location_ptr</code>. In a
8785         conventional bytecode indexing scheme,
8786         <code>start_location_ptr</code> will always point to zero
8787         and <code>end_location_ptr</code>
8788         will always point to the bytecode count minus one.
8789       </description>
8790       <origin>jvmdi</origin>
8791       <capabilities>
8792       </capabilities>
8793       <parameters>
8794         <param id="klass">
8795           <jclass method="method"/>
8796             <description>
8797               The class to query.
8798             </description>
8799         </param>
8800         <param id="method">
8801           <jmethodID class="klass" native="error"/>
8802             <description>
8803               The method to query.
8804             </description>
8805         </param>
8806         <param id="start_location_ptr">
8807           <outptr><jlocation/></outptr>
8808           <description>
8809             On return, points to the first location, or
8810             <code>-1</code> if location information is not available.
8811             If the information is available and
8812             <functionlink id="GetJLocationFormat"></functionlink>
8813             returns <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>
8814             then this will always be zero.
8815           </description>
8816         </param>
8817         <param id="end_location_ptr">
8818           <outptr><jlocation/></outptr>
8819           <description>
8820             On return, points to the last location,
8821             or <code>-1</code> if location information is not available.
8822           </description>
8823         </param>
8824       </parameters>
8825       <errors>
8826         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8827           Class information does not include method sizes.
8828         </error>
8829       </errors>
8830     </function>
8831 
8832     <function id="GetLocalVariableTable" num="72">
8833       <synopsis>Get Local Variable Table</synopsis>
8834       <typedef id="jvmtiLocalVariableEntry" label="Local variable table entry">
8835         <field id="start_location">
8836           <jlocation/>
8837           <description>
8838             The code array index where the local variable is first valid
8839             (that is, where it must have a value).
8840           </description>
8841         </field>
8842         <field id="length">
8843           <jint/>
8844           <description>
8845             The length of the valid section for this local variable.
8846             The last code array index where the local variable is valid
8847             is <code>start_location + length</code>.
8848           </description>
8849         </field>
8850         <field id="name">
8851           <allocfieldbuf><char/></allocfieldbuf>
8852           <description>
8853             The local variable name, encoded as a
8854             <internallink id="mUTF">modified UTF-8</internallink> string.
8855           </description>
8856         </field>
8857         <field id="signature">
8858           <allocfieldbuf><char/></allocfieldbuf>
8859           <description>
8860             The local variable's type signature, encoded as a
8861             <internallink id="mUTF">modified UTF-8</internallink> string.
8862             The signature format is the same as that defined in
8863             <vmspec chapter="4.3.2"/>.
8864           </description>
8865         </field>
8866         <field id="generic_signature">
8867           <allocfieldbuf><char/></allocfieldbuf>
8868           <description>
8869             The local variable's generic signature, encoded as a
8870             <internallink id="mUTF">modified UTF-8</internallink> string.
8871             The value of this field will be <code>NULL</code> for any local
8872             variable which does not have a generic type.
8873           </description>
8874         </field>
8875         <field id="slot">
8876           <jint/>
8877           <description>
8878             The local variable's slot.  See <internallink id="local">Local Variables</internallink>.
8879           </description>
8880         </field>
8881       </typedef>
8882       <description>
8883         Return local variable information.
8884       </description>
8885       <origin>jvmdiClone</origin>
8886       <capabilities>
8887         <required id="can_access_local_variables"></required>
8888       </capabilities>
8889       <parameters>
8890         <param id="method">
8891           <jmethodID native="error"/>
8892             <description>
8893               The method to query.
8894             </description>
8895         </param>
8896         <param id="entry_count_ptr">
8897           <outptr><jint/></outptr>
8898           <description>
8899             On return, points to the number of entries in the table
8900           </description>
8901         </param>
8902         <param id="table_ptr">
8903           <allocbuf outcount="entry_count_ptr"><struct>jvmtiLocalVariableEntry</struct></allocbuf>
8904           <description>
8905             On return, points to an array of local variable table entries.
8906           </description>
8907         </param>
8908       </parameters>
8909       <errors>
8910         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8911           Class information does not include local variable
8912           information.
8913         </error>
8914       </errors>
8915     </function>
8916 
8917     <function id="GetBytecodes" phase="start" num="75">
8918       <synopsis>Get Bytecodes</synopsis>
8919       <description>
8920         For the method indicated by <code>method</code>,
8921         return the bytecodes that implement the method. The number of
8922         bytecodes is returned via <code>bytecode_count_ptr</code>. The bytecodes
8923         themselves are returned via <code>bytecodes_ptr</code>.
8924       </description>
8925       <origin>jvmdi</origin>
8926       <capabilities>
8927         <required id="can_get_bytecodes"></required>
8928       </capabilities>
8929       <parameters>
8930         <param id="klass">
8931           <jclass method="method"/>
8932             <description>
8933               The class to query.
8934             </description>
8935         </param>
8936         <param id="method">
8937           <jmethodID class="klass" native="error"/>
8938             <description>
8939               The method to query.
8940             </description>
8941         </param>
8942         <param id="bytecode_count_ptr">
8943           <outptr><jint/></outptr>
8944           <description>
8945             On return, points to the length of the bytecode array
8946           </description>
8947         </param>
8948         <param id="bytecodes_ptr">
8949           <allocbuf outcount="bytecode_count_ptr"><uchar/></allocbuf>
8950           <description>
8951             On return, points to the pointer to the bytecode array
8952           </description>
8953         </param>
8954       </parameters>
8955       <errors>
8956       </errors>
8957     </function>
8958 
8959     <function id="IsMethodNative" phase="start" num="76">
8960       <synopsis>Is Method Native</synopsis>
8961       <description>
8962         For the method indicated by <code>method</code>, return a
8963         value indicating whether the method is native via <code>is_native_ptr</code>
8964       </description>
8965       <origin>jvmdi</origin>
8966       <capabilities>
8967       </capabilities>
8968       <parameters>
8969         <param id="klass">
8970           <jclass method="method"/>
8971             <description>
8972               The class to query.
8973             </description>
8974         </param>
8975         <param id="method">
8976           <jmethodID class="klass"/>
8977             <description>
8978               The method to query.
8979             </description>
8980         </param>
8981         <param id="is_native_ptr">
8982           <outptr><jboolean/></outptr>
8983           <description>
8984             On return, points to the boolean result of this function.
8985           </description>
8986         </param>
8987       </parameters>
8988       <errors>
8989       </errors>
8990     </function>
8991 
8992     <function id="IsMethodSynthetic" phase="start" num="77">
8993       <synopsis>Is Method Synthetic</synopsis>
8994       <description>
8995         For the method indicated by <code>method</code>, return a
8996         value indicating whether the method is synthetic via <code>is_synthetic_ptr</code>.
8997         Synthetic methods are generated by the compiler but not present in the
8998         original source code.
8999       </description>
9000       <origin>jvmdi</origin>
9001       <capabilities>
9002         <required id="can_get_synthetic_attribute"></required>
9003       </capabilities>
9004       <parameters>
9005         <param id="klass">
9006           <jclass method="method"/>
9007             <description>
9008               The class to query.
9009             </description>
9010         </param>
9011         <param id="method">
9012           <jmethodID class="klass"/>
9013             <description>
9014               The method to query.
9015             </description>
9016         </param>
9017         <param id="is_synthetic_ptr">
9018           <outptr><jboolean/></outptr>
9019           <description>
9020             On return, points to the boolean result of this function.
9021           </description>
9022         </param>
9023       </parameters>
9024       <errors>
9025       </errors>
9026     </function>
9027 
9028     <function id="IsMethodObsolete" phase="start" num="91">
9029       <synopsis>Is Method Obsolete</synopsis>
9030       <description>
9031         Determine if a method ID refers to an
9032         <internallink id="obsoleteMethods">obsolete</internallink>
9033         method version.
9034       </description>
9035       <origin>jvmdi</origin>
9036       <capabilities>
9037       </capabilities>
9038       <parameters>
9039         <param id="klass">
9040           <jclass method="method"/>
9041             <description>
9042               The class to query.
9043             </description>
9044         </param>
9045         <param id="method">
9046           <jmethodID class="klass"/>
9047             <description>
9048               The method ID to query.
9049             </description>
9050         </param>
9051         <param id="is_obsolete_ptr">
9052           <outptr><jboolean/></outptr>
9053           <description>
9054             On return, points to the boolean result of this function.
9055           </description>
9056         </param>
9057       </parameters>
9058       <errors>
9059       </errors>
9060     </function>
9061 
9062     <function id="SetNativeMethodPrefix" jkernel="yes" phase="any" num="73" since="1.1">
9063       <synopsis>Set Native Method Prefix</synopsis>
9064       <description>
9065         This function modifies the failure handling of
9066         native method resolution by allowing retry
9067         with a prefix applied to the name.
9068         When used with the
9069         <eventlink id="ClassFileLoadHook">ClassFileLoadHook
9070         event</eventlink>, it enables native methods to be
9071         <internallink id="bci">instrumented</internallink>.
9072         <p/>
9073         Since native methods cannot be directly instrumented
9074         (they have no bytecodes), they must be wrapped with
9075         a non-native method which can be instrumented.
9076         For example, if we had:
9077         <example>
9078 native boolean foo(int x);</example>
9079         <p/>
9080         We could transform the class file (with the
9081         ClassFileLoadHook event) so that this becomes:
9082         <example>
9083 boolean foo(int x) {
9084   <i>... record entry to foo ...</i>
9085   return wrapped_foo(x);
9086 }
9087 
9088 native boolean wrapped_foo(int x);</example>
9089         <p/>
9090         Where foo becomes a wrapper for the actual native method
9091         with the appended prefix "wrapped_".  Note that
9092         "wrapped_" would be a poor choice of prefix since it
9093         might conceivably form the name of an existing method
9094         thus something like "$$$MyAgentWrapped$$$_" would be
9095         better but would make these examples less readable.
9096         <p/>
9097         The wrapper will allow data to be collected on the native
9098         method call, but now the problem becomes linking up the
9099         wrapped method with the native implementation.
9100         That is, the method <code>wrapped_foo</code> needs to be
9101         resolved to the native implementation of <code>foo</code>,
9102         which might be:
9103         <example>
9104 Java_somePackage_someClass_foo(JNIEnv* env, jint x)</example>
9105         <p/>
9106         This function allows the prefix to be specified and the
9107         proper resolution to occur.
9108         Specifically, when the standard resolution fails, the
9109         resolution is retried taking the prefix into consideration.
9110         There are two ways that resolution occurs, explicit
9111         resolution with the JNI function <code>RegisterNatives</code>
9112         and the normal automatic resolution.  For
9113         <code>RegisterNatives</code>, the VM will attempt this
9114         association:
9115         <example>
9116 method(foo) -> nativeImplementation(foo)</example>
9117         <p/>
9118         When this fails, the resolution will be retried with
9119         the specified prefix prepended to the method name,
9120         yielding the correct resolution:
9121         <example>
9122 method(wrapped_foo) -> nativeImplementation(foo)</example>
9123         <p/>
9124         For automatic resolution, the VM will attempt:
9125         <example>
9126 method(wrapped_foo) -> nativeImplementation(wrapped_foo)</example>
9127         <p/>
9128         When this fails, the resolution will be retried with
9129         the specified prefix deleted from the implementation name,
9130         yielding the correct resolution:
9131         <example>
9132 method(wrapped_foo) -> nativeImplementation(foo)</example>
9133         <p/>
9134         Note that since the prefix is only used when standard
9135         resolution fails, native methods can be wrapped selectively.
9136         <p/>
9137         Since each <jvmti/> environment is independent and
9138         can do its own transformation of the bytecodes, more
9139         than one layer of wrappers may be applied. Thus each
9140         environment needs its own prefix.  Since transformations
9141         are applied in order, the prefixes, if applied, will
9142         be applied in the same order.
9143         The order of transformation application is described in
9144         the <eventlink id="ClassFileLoadHook"/> event.
9145         Thus if three environments applied
9146         wrappers, <code>foo</code> might become
9147         <code>$env3_$env2_$env1_foo</code>.  But if, say,
9148         the second environment did not apply a wrapper to
9149         <code>foo</code> it would be just
9150         <code>$env3_$env1_foo</code>.  To be able to
9151         efficiently determine the sequence of prefixes,
9152         an intermediate prefix is only applied if its non-native
9153         wrapper exists.  Thus, in the last example, even though
9154         <code>$env1_foo</code> is not a native method, the
9155         <code>$env1_</code> prefix is applied since
9156         <code>$env1_foo</code> exists.
9157         <p/>
9158         Since the prefixes are used at resolution time
9159         and since resolution may be arbitrarily delayed, a
9160         native method prefix must remain set as long as there
9161         are corresponding prefixed native methods.
9162       </description>
9163       <origin>new</origin>
9164       <capabilities>
9165         <required id="can_set_native_method_prefix"></required>
9166       </capabilities>
9167       <parameters>
9168         <param id="prefix">
9169           <inbuf>
9170             <char/>
9171             <nullok>
9172               any existing prefix in this environment is cancelled
9173             </nullok>
9174           </inbuf>
9175           <description>
9176             The prefix to apply, encoded as a
9177             <internallink id="mUTF">modified UTF-8</internallink> string.
9178           </description>
9179         </param>
9180       </parameters>
9181       <errors>
9182       </errors>
9183     </function>
9184 
9185     <function id="SetNativeMethodPrefixes" jkernel="yes" phase="any" num="74" since="1.1">
9186       <synopsis>Set Native Method Prefixes</synopsis>
9187       <description>
9188          For a normal agent, <functionlink id="SetNativeMethodPrefix"/>
9189          will provide all needed native method prefixing.
9190          For a meta-agent that performs multiple independent class
9191          file transformations (for example as a proxy for another
9192          layer of agents) this function allows each transformation
9193          to have its own prefix.
9194          The prefixes are applied in the order supplied and are
9195          processed in the same manner as described for the
9196          application of prefixes from multiple <jvmti/> environments
9197          in <functionlink id="SetNativeMethodPrefix"/>.
9198          <p/>
9199          Any previous prefixes are replaced.  Thus, calling this
9200          function with a <paramlink id="prefix_count"/> of <code>0</code>
9201          disables prefixing in this environment.
9202          <p/>
9203          <functionlink id="SetNativeMethodPrefix"/> and this function
9204          are the two ways to set the prefixes.
9205          Calling <code>SetNativeMethodPrefix</code> with
9206          a prefix is the same as calling this function with
9207          <paramlink id="prefix_count"/> of <code>1</code>.
9208          Calling <code>SetNativeMethodPrefix</code> with
9209          <code>NULL</code> is the same as calling this function with
9210          <paramlink id="prefix_count"/> of <code>0</code>.
9211       </description>
9212       <origin>new</origin>
9213       <capabilities>
9214         <required id="can_set_native_method_prefix"></required>
9215       </capabilities>
9216       <parameters>
9217         <param id="prefix_count">
9218           <jint min="0"/>
9219             <description>
9220               The number of prefixes to apply.
9221             </description>
9222         </param>
9223         <param id="prefixes">
9224           <agentbuf>
9225             <char/>
9226           </agentbuf>
9227           <description>
9228             The prefixes to apply for this environment, each encoded as a
9229             <internallink id="mUTF">modified UTF-8</internallink> string.
9230           </description>
9231         </param>
9232       </parameters>
9233       <errors>
9234       </errors>
9235     </function>
9236 
9237   </category>
9238 
9239   <category id="RawMonitors" label="Raw Monitor">
9240 
9241     <function id="CreateRawMonitor" phase="onload" callbacksafe="safe" num="31">
9242       <synopsis>Create Raw Monitor</synopsis>
9243       <description>
9244         Create a raw monitor.
9245       </description>
9246       <origin>jvmdi</origin>
9247       <capabilities>
9248       </capabilities>
9249       <parameters>
9250         <param id="name">
9251           <inbuf><char/></inbuf>
9252           <description>
9253             A name to identify the monitor, encoded as a
9254             <internallink id="mUTF">modified UTF-8</internallink> string.
9255           </description>
9256         </param>
9257         <param id="monitor_ptr">
9258           <outptr><jrawMonitorID/></outptr>
9259           <description>
9260             On return, points to the created monitor.
9261           </description>
9262         </param>
9263       </parameters>
9264       <errors>
9265       </errors>
9266     </function>
9267 
9268     <function id="DestroyRawMonitor" phase="onload" callbacksafe="safe" num="32">
9269       <synopsis>Destroy Raw Monitor</synopsis>
9270       <description>
9271         Destroy the raw monitor.
9272         If the monitor being destroyed has been entered by this thread, it will be
9273         exited before it is destroyed.
9274         If the monitor being destroyed has been entered by another thread,
9275         an error will be returned and the monitor will not be destroyed.
9276       </description>
9277       <origin>jvmdi</origin>
9278       <capabilities>
9279       </capabilities>
9280       <parameters>
9281         <param id="monitor">
9282           <jrawMonitorID/>
9283           <description>
9284             The monitor
9285           </description>
9286         </param>
9287       </parameters>
9288       <errors>
9289         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9290           Not monitor owner
9291         </error>
9292       </errors>
9293     </function>
9294 
9295     <function id="RawMonitorEnter" phase="any" callbacksafe="safe" impl="innative notrace" num="33">
9296       <synopsis>Raw Monitor Enter</synopsis>
9297       <description>
9298         Gain exclusive ownership of a raw monitor.
9299         The same thread may enter a monitor more then once.
9300         The thread must
9301         <functionlink id="RawMonitorExit">exit</functionlink>
9302         the monitor the same number of times as it is entered.
9303         If a monitor is entered during <code>OnLoad</code> (before attached threads exist)
9304         and has not exited when attached threads come into existence, the enter
9305         is considered to have occurred on the main thread.
9306       </description>
9307       <origin>jvmdi</origin>
9308       <capabilities>
9309       </capabilities>
9310       <parameters>
9311         <param id="monitor">
9312           <jrawMonitorID/>
9313           <description>
9314             The monitor
9315           </description>
9316         </param>
9317       </parameters>
9318       <errors>
9319       </errors>
9320     </function>
9321 
9322     <function id="RawMonitorExit" phase="any" callbacksafe="safe" impl="innative notrace" num="34">
9323       <synopsis>Raw Monitor Exit</synopsis>
9324       <description>
9325         Release exclusive ownership of a raw monitor.
9326       </description>
9327       <origin>jvmdi</origin>
9328       <capabilities>
9329       </capabilities>
9330       <parameters>
9331         <param id="monitor">
9332           <jrawMonitorID/>
9333           <description>
9334             The monitor
9335           </description>
9336         </param>
9337       </parameters>
9338       <errors>
9339         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9340           Not monitor owner
9341         </error>
9342       </errors>
9343     </function>
9344 
9345     <function id="RawMonitorWait" phase="any" callbacksafe="safe" impl="innative notrace" num="35">
9346       <synopsis>Raw Monitor Wait</synopsis>
9347       <description>
9348         Wait for notification of the raw monitor.
9349         <p/>
9350         Causes the current thread to wait until either another thread calls
9351         <functionlink id="RawMonitorNotify"/> or
9352         <functionlink id="RawMonitorNotifyAll"/>
9353         for the specified raw monitor, or the specified
9354         <paramlink id="millis">timeout</paramlink>
9355         has elapsed.
9356       </description>
9357       <origin>jvmdi</origin>
9358       <capabilities>
9359       </capabilities>
9360       <parameters>
9361         <param id="monitor">
9362           <jrawMonitorID/>
9363           <description>
9364             The monitor
9365           </description>
9366         </param>
9367         <param id="millis">
9368           <jlong/>
9369           <description>
9370             The timeout, in milliseconds.  If the timeout is
9371             zero, then real time is not taken into consideration
9372             and the thread simply waits until notified.
9373           </description>
9374         </param>
9375       </parameters>
9376       <errors>
9377         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9378           Not monitor owner
9379         </error>
9380         <error id="JVMTI_ERROR_INTERRUPT">
9381           Wait was interrupted, try again
9382         </error>
9383       </errors>
9384     </function>
9385 
9386     <function id="RawMonitorNotify" phase="any" callbacksafe="safe" impl="notrace" num="36">
9387       <synopsis>Raw Monitor Notify</synopsis>
9388       <description>
9389         Notify a single thread waiting on the raw monitor.
9390       </description>
9391       <origin>jvmdi</origin>
9392       <capabilities>
9393       </capabilities>
9394       <parameters>
9395         <param id="monitor">
9396           <jrawMonitorID/>
9397           <description>
9398             The monitor
9399           </description>
9400         </param>
9401       </parameters>
9402       <errors>
9403         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9404           Not monitor owner
9405         </error>
9406       </errors>
9407     </function>
9408 
9409     <function id="RawMonitorNotifyAll" phase="any" callbacksafe="safe" impl="notrace" num="37">
9410       <synopsis>Raw Monitor Notify All</synopsis>
9411       <description>
9412         Notify all threads waiting on the raw monitor.
9413       </description>
9414       <origin>jvmdi</origin>
9415       <capabilities>
9416       </capabilities>
9417       <parameters>
9418         <param id="monitor">
9419           <jrawMonitorID/>
9420           <description>
9421             The monitor
9422           </description>
9423         </param>
9424       </parameters>
9425       <errors>
9426         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9427           Not monitor owner
9428         </error>
9429       </errors>
9430     </function>
9431 
9432    <elide>
9433     <function id="GetRawMonitorUse" num="118">
9434       <synopsis>Get Raw Monitor Use</synopsis>
9435       <description>
9436         The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure
9437         are filled in with information about usage of the raw monitor.
9438       </description>
9439       <origin>new</origin>
9440       <capabilities>
9441         <required id="can_get_raw_monitor_usage"></required>
9442       </capabilities>
9443       <parameters>
9444         <param id="monitor">
9445           <jrawMonitorID/>
9446           <description>
9447             the raw monitor to query.
9448           </description>
9449         </param>
9450         <param id="info_ptr">
9451           <outptr><struct>jvmtiMonitorUsage</struct></outptr>
9452           <description>
9453             On return, filled with monitor information for the
9454             specified raw monitor.
9455           </description>
9456         </param>
9457       </parameters>
9458       <errors>
9459       </errors>
9460     </function>
9461 
9462     <function id="GetRawMonitors" num="119">
9463       <synopsis>Get Raw Monitors</synopsis>
9464       <description>
9465         Return the list of raw monitors.
9466         <p/>
9467         Note: details about each monitor can be examined with
9468         <functionlink id="GetRawMonitorUse"></functionlink>.
9469       </description>
9470       <origin>new</origin>
9471       <capabilities>
9472         <required id="can_get_raw_monitor_usage"></required>
9473       </capabilities>
9474       <parameters>
9475         <param id="monitorCnt">
9476           <outptr><jint/></outptr>
9477           <description>
9478             On return, pointer to the number
9479             of monitors returned in <code>monitors_ptr</code>.
9480           </description>
9481         </param>
9482         <param id="monitors_ptr">
9483           <allocbuf outcount="monitorCnt"><jrawMonitorID/></allocbuf>
9484           <description>
9485             On return, pointer to the monitor list.
9486           </description>
9487         </param>
9488       </parameters>
9489       <errors>
9490       </errors>
9491     </function>
9492     </elide>
9493   </category>
9494 
9495   <category id="jniIntercept" label="JNI Function Interception">
9496 
9497     <intro>
9498       Provides the ability to intercept and resend
9499       Java Native Interface (JNI) function calls
9500       by manipulating the JNI function table.
9501       See <externallink id="jni/functions.html">JNI
9502         Functions</externallink> in the <i>Java Native Interface Specification</i>.
9503       <p/>
9504       The following example illustrates intercepting the
9505       <code>NewGlobalRef</code> JNI call in order to count reference
9506       creation.
9507       <example>
9508 JNIEnv original_jni_Functions;
9509 JNIEnv redirected_jni_Functions;
9510 int my_global_ref_count = 0;
9511 
9512 jobject
9513 MyNewGlobalRef(JNIEnv *jni_env, jobject lobj) {
9514    ++my_global_ref_count;
9515    return originalJNIFunctions-&gt;NewGlobalRef(env, lobj);
9516 }
9517 
9518 void
9519 myInit() {
9520    jvmtiError err;
9521 
9522    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;original_jni_Functions);
9523    if (err != JVMTI_ERROR_NONE) {
9524       die();
9525    }
9526    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;redirected_jni_Functions);
9527    if (err != JVMTI_ERROR_NONE) {
9528       die();
9529    }
9530    redirectedJNIFunctions-&gt;NewGlobalRef = MyNewGlobalRef;
9531       err = (*jvmti_env)-&gt;SetJNIFunctionTable(jvmti_env, redirected_jni_Functions);
9532    if (err != JVMTI_ERROR_NONE) {
9533       die();
9534    }
9535 }
9536       </example>
9537       Sometime after <code>myInit</code> is called the user's JNI
9538       code is executed which makes the call to create a new global
9539       reference.  Instead of going to the normal JNI implementation
9540       the call goes to <code>myNewGlobalRef</code>.  Note that a
9541       copy of the original function table is kept so that the normal
9542       JNI function can be called after the data is collected.
9543       Note also that any JNI functions which are not overwritten
9544       will behave normally.
9545       <todo>
9546         check that the example compiles and executes.
9547       </todo>
9548     </intro>
9549 
9550     <function id="SetJNIFunctionTable" phase="start" num="120">
9551       <synopsis>Set JNI Function Table</synopsis>
9552       <description>
9553         Set the JNI function table
9554         in all current and future JNI environments.
9555         As a result, all future JNI calls are directed to the specified functions.
9556         Use <functionlink id="GetJNIFunctionTable"></functionlink> to get the
9557         function table to pass to this function.
9558         For this function to take effect the the updated table entries must be
9559         used by the JNI clients.
9560         Since the table is defined <code>const</code> some compilers may optimize
9561         away the access to the table, thus preventing this function from taking
9562         effect.
9563         The table is copied--changes to the local copy of the
9564         table have no effect.
9565         This function affects only the function table, all other aspects of the environment are
9566         unaffected.
9567         See the examples <internallink id="jniIntercept">above</internallink>.
9568       </description>
9569       <origin>new</origin>
9570       <capabilities>
9571       </capabilities>
9572       <parameters>
9573         <param id="function_table">
9574           <inptr>
9575             <struct>jniNativeInterface</struct>
9576           </inptr>
9577           <description>
9578             Points to the new JNI function table.
9579           </description>
9580         </param>
9581       </parameters>
9582       <errors>
9583       </errors>
9584     </function>
9585 
9586     <function id="GetJNIFunctionTable" phase="start" num="121">
9587       <synopsis>Get JNI Function Table</synopsis>
9588       <description>
9589         Get the JNI function table.
9590         The JNI function table is copied into allocated memory.
9591         If <functionlink id="SetJNIFunctionTable"></functionlink>
9592         has been called, the modified (not the original) function
9593         table is returned.
9594         Only the function table is copied, no other aspects of the environment
9595         are copied.
9596         See the examples <internallink id="jniIntercept">above</internallink>.
9597       </description>
9598       <origin>new</origin>
9599       <capabilities>
9600       </capabilities>
9601       <parameters>
9602         <param id="function_table">
9603           <allocbuf>
9604             <struct>jniNativeInterface</struct>
9605           </allocbuf>
9606           <description>
9607             On return, <code>*function_table</code>
9608             points a newly allocated copy of the JNI function table.
9609           </description>
9610         </param>
9611       </parameters>
9612       <errors>
9613       </errors>
9614     </function>
9615 
9616   </category>
9617 
9618   <category id="eventManagement" label="Event Management">
9619 
9620     <function id="SetEventCallbacks" jkernel="yes" phase="onload" num="122">
9621       <synopsis>Set Event Callbacks</synopsis>
9622       <description>
9623         Set the functions to be called for each event.
9624         The callbacks are specified by supplying a replacement function table.
9625         The function table is copied--changes to the local copy of the
9626         table have no effect.
9627         This is an atomic action, all callbacks are set at once.
9628         No events are sent before this function is called.
9629         When an entry is <code>NULL</code> or when the event is beyond
9630         <paramlink id="size_of_callbacks"></paramlink> no event is sent.
9631         Details on events are
9632         described <internallink id="EventSection">later</internallink> in this document.
9633         An event must be enabled and have a callback in order to be
9634         sent--the order in which this function and
9635         <functionlink id="SetEventNotificationMode"></functionlink>
9636         are called does not affect the result.
9637       </description>
9638       <origin>new</origin>
9639       <capabilities>
9640       </capabilities>
9641       <parameters>
9642         <param id="callbacks">
9643           <inptr>
9644             <struct>jvmtiEventCallbacks</struct>
9645             <nullok>remove the existing callbacks</nullok>
9646           </inptr>
9647           <description>
9648             The new event callbacks.
9649           </description>
9650         </param>
9651         <param id="size_of_callbacks">
9652           <jint min="0"/>
9653           <description>
9654             <code>sizeof(jvmtiEventCallbacks)</code>--for version
9655             compatibility.
9656           </description>
9657         </param>
9658       </parameters>
9659       <errors>
9660       </errors>
9661     </function>
9662 
9663     <function id="SetEventNotificationMode" jkernel="yes" phase="onload" num="2">
9664       <synopsis>Set Event Notification Mode</synopsis>
9665       <description>
9666         Control the generation of events.
9667         <constants id="jvmtiEventMode" label="Event Enable/Disable" kind="enum">
9668           <constant id="JVMTI_ENABLE" num="1">
9669             If <paramlink id="mode"></paramlink> is <code>JVMTI_ENABLE</code>,
9670             the event <paramlink id="event_type"></paramlink> will be enabled
9671           </constant>
9672           <constant id="JVMTI_DISABLE" num="0">
9673             If <paramlink id="mode"></paramlink> is <code>JVMTI_DISABLE</code>,
9674             the event <paramlink id="event_type"></paramlink> will be disabled
9675           </constant>
9676         </constants>
9677         If <code>event_thread</code> is <code>NULL</code>,
9678         the event is enabled or disabled globally; otherwise, it is
9679         enabled or disabled for a particular thread.
9680         An event is generated for
9681         a particular thread if it is enabled either at the thread or global
9682         levels.
9683         <p/>
9684         See <internallink id="EventIndex">below</internallink> for information on specific events.
9685         <p/>
9686         The following events cannot be controlled at the thread
9687         level through this function.
9688         <ul>
9689           <li><eventlink id="VMInit"></eventlink></li>
9690           <li><eventlink id="VMStart"></eventlink></li>
9691           <li><eventlink id="VMDeath"></eventlink></li>
9692           <li><eventlink id="ThreadStart"></eventlink></li>
9693           <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9694           <li><eventlink id="CompiledMethodUnload"></eventlink></li>
9695           <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9696           <li><eventlink id="DataDumpRequest"></eventlink></li>
9697         </ul>
9698         <p/>
9699         Initially, no events are enabled at either the thread level
9700         or the global level.
9701         <p/>
9702         Any needed capabilities (see Event Enabling Capabilities below) must be possessed
9703         before calling this function.
9704         <p/>
9705         Details on events are
9706         described <internallink id="EventSection">below</internallink>.
9707       </description>
9708       <origin>jvmdiClone</origin>
9709       <eventcapabilities></eventcapabilities>
9710       <parameters>
9711         <param id="mode">
9712           <enum>jvmtiEventMode</enum>
9713           <description>
9714             <code>JVMTI_ENABLE</code> or <code>JVMTI_DISABLE</code>
9715           </description>
9716         </param>
9717         <param id="event_type">
9718           <enum>jvmtiEvent</enum>
9719           <description>
9720             the event to control
9721           </description>
9722         </param>
9723         <param id="event_thread">
9724           <ptrtype>
9725             <jthread impl="noconvert"/>
9726             <nullok>event is controlled at the global level</nullok>
9727           </ptrtype>
9728             <description>
9729               The thread to control
9730             </description>
9731         </param>
9732         <param id="...">
9733           <varargs/>
9734             <description>
9735               for future expansion
9736             </description>
9737         </param>
9738       </parameters>
9739       <errors>
9740         <error id="JVMTI_ERROR_INVALID_THREAD">
9741           <paramlink id="event_thread"/> is non-<code>NULL</code> and is not a valid thread.
9742         </error>
9743         <error id="JVMTI_ERROR_THREAD_NOT_ALIVE">
9744           <paramlink id="event_thread"/> is non-<code>NULL</code> and is not live (has not been started or is now dead).
9745         </error>
9746         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9747           thread level control was attempted on events which do not
9748           permit thread level control.
9749         </error>
9750         <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
9751           The Required Event Enabling Capability is not possessed.
9752         </error>
9753       </errors>
9754     </function>
9755 
9756     <function id="GenerateEvents" num="123">
9757       <synopsis>Generate Events</synopsis>
9758       <description>
9759         Generate events to represent the current state of the VM.
9760         For example, if <paramlink id="event_type"/> is
9761         <code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code>,
9762         a <eventlink id="CompiledMethodLoad"></eventlink> event will be
9763         sent for each currently compiled method.
9764         Methods that were loaded and now have been unloaded are not sent.
9765         The history of what events have previously been sent does not
9766         effect what events are sent by this function--for example,
9767         all currently compiled methods
9768         will be sent each time this function is called.
9769         <p/>
9770         This function is useful when
9771         events may have been missed due to the agent attaching after program
9772         execution begins; this function generates the missed events.
9773         <p/>
9774         Attempts to execute Java programming language code or
9775         JNI functions may be paused until this function returns -
9776         so neither should be called from the thread sending the event.
9777         This function returns only after the missed events have been
9778         sent, processed and have returned.
9779         The event may be sent on a different thread than the thread
9780         on which the event occurred.
9781         The callback for the event must be set with
9782         <functionlink id="SetEventCallbacks"></functionlink>
9783         and the event must be enabled with
9784         <functionlink id="SetEventNotificationMode"></functionlink>
9785         or the events will not occur.
9786         If the VM no longer has the information to generate some or
9787         all of the requested events, the events are simply not sent -
9788         no error is returned.
9789         <p/>
9790         Only the following events are supported:
9791         <ul>
9792           <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9793           <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9794         </ul>
9795       </description>
9796       <origin>new</origin>
9797       <capabilities>
9798         <capability id="can_generate_compiled_method_load_events"></capability>
9799       </capabilities>
9800       <parameters>
9801         <param id="event_type">
9802           <enum>jvmtiEvent</enum>
9803           <description>
9804             The type of event to generate.  Must be one of these:
9805             <ul>
9806               <li><eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink></li>
9807               <li><eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink></li>
9808             </ul>
9809           </description>
9810         </param>
9811       </parameters>
9812       <errors>
9813         <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
9814           <paramlink id="event_type"/> is
9815           <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9816           and <fieldlink id="can_generate_compiled_method_load_events" struct="jvmtiCapabilities"></fieldlink>
9817           is <code>false</code>.
9818         </error>
9819         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9820           <paramlink id="event_type"/> is other than
9821           <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9822           or <eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink>.
9823         </error>
9824       </errors>
9825     </function>
9826 
9827   </category>
9828 
9829     <category id="extension" label="Extension Mechanism">
9830 
9831       <intro>
9832         These functions
9833         allow a <jvmti/> implementation to provide functions and events
9834         beyond those defined in this specification.
9835         <p/>
9836         Both extension functions and extension events have parameters
9837         each of which has a 'type' and 'kind' chosen from the following tables:
9838 
9839         <constants id="jvmtiParamTypes" label="Extension Function/Event Parameter Types" kind="enum">
9840           <constant id="JVMTI_TYPE_JBYTE" num="101">
9841             Java programming language primitive type - <code>byte</code>.
9842             JNI type <code>jbyte</code>.
9843           </constant>
9844           <constant id="JVMTI_TYPE_JCHAR" num="102">
9845             Java programming language primitive type - <code>char</code>.
9846             JNI type <code>jchar</code>.
9847           </constant>
9848           <constant id="JVMTI_TYPE_JSHORT" num="103">
9849             Java programming language primitive type - <code>short</code>.
9850             JNI type <code>jshort</code>.
9851           </constant>
9852           <constant id="JVMTI_TYPE_JINT" num="104">
9853             Java programming language primitive type - <code>int</code>.
9854             JNI type <datalink id="jint"></datalink>.
9855           </constant>
9856           <constant id="JVMTI_TYPE_JLONG" num="105">
9857             Java programming language primitive type - <code>long</code>.
9858             JNI type <datalink id="jlong"></datalink>.
9859           </constant>
9860           <constant id="JVMTI_TYPE_JFLOAT" num="106">
9861             Java programming language primitive type - <code>float</code>.
9862             JNI type <datalink id="jfloat"></datalink>.
9863           </constant>
9864           <constant id="JVMTI_TYPE_JDOUBLE" num="107">
9865             Java programming language primitive type - <code>double</code>.
9866             JNI type <datalink id="jdouble"></datalink>.
9867           </constant>
9868           <constant id="JVMTI_TYPE_JBOOLEAN" num="108">
9869             Java programming language primitive type - <code>boolean</code>.
9870             JNI type <datalink id="jboolean"></datalink>.
9871           </constant>
9872           <constant id="JVMTI_TYPE_JOBJECT" num="109">
9873             Java programming language object type - <code>java.lang.Object</code>.
9874             JNI type <datalink id="jobject"></datalink>.
9875             Returned values are JNI local references and must be managed.
9876           </constant>
9877           <constant id="JVMTI_TYPE_JTHREAD" num="110">
9878             Java programming language object type - <code>java.lang.Thread</code>.
9879             <jvmti/> type <datalink id="jthread"></datalink>.
9880             Returned values are JNI local references and must be managed.
9881           </constant>
9882           <constant id="JVMTI_TYPE_JCLASS" num="111">
9883             Java programming language object type - <code>java.lang.Class</code>.
9884             JNI type <datalink id="jclass"></datalink>.
9885             Returned values are JNI local references and must be managed.
9886           </constant>
9887           <constant id="JVMTI_TYPE_JVALUE" num="112">
9888             Union of all Java programming language primitive and object types -
9889             JNI type <datalink id="jvalue"></datalink>.
9890             Returned values which represent object types are JNI local references and must be managed.
9891           </constant>
9892           <constant id="JVMTI_TYPE_JFIELDID" num="113">
9893             Java programming language field identifier -
9894             JNI type <datalink id="jfieldID"></datalink>.
9895           </constant>
9896           <constant id="JVMTI_TYPE_JMETHODID" num="114">
9897             Java programming language method identifier -
9898             JNI type <datalink id="jmethodID"></datalink>.
9899           </constant>
9900           <constant id="JVMTI_TYPE_CCHAR" num="115">
9901             C programming language type - <code>char</code>.
9902           </constant>
9903           <constant id="JVMTI_TYPE_CVOID" num="116">
9904             C programming language type - <code>void</code>.
9905           </constant>
9906           <constant id="JVMTI_TYPE_JNIENV" num="117">
9907             JNI environment - <code>JNIEnv</code>.
9908             Should be used with the correct <datalink id="jvmtiParamKind"/> to make it a pointer type.
9909           </constant>
9910         </constants>
9911 
9912         <constants id="jvmtiParamKind" label="Extension Function/Event Parameter Kinds" kind="enum">
9913           <constant id="JVMTI_KIND_IN" num="91">
9914             Ingoing argument - <code>foo</code>.
9915           </constant>
9916           <constant id="JVMTI_KIND_IN_PTR" num="92">
9917             Ingoing pointer argument - <code>const foo*</code>.
9918           </constant>
9919           <constant id="JVMTI_KIND_IN_BUF" num="93">
9920             Ingoing array argument - <code>const foo*</code>.
9921           </constant>
9922           <constant id="JVMTI_KIND_ALLOC_BUF" num="94">
9923             Outgoing allocated array argument -  <code>foo**</code>.
9924             Free with <code>Deallocate</code>.
9925           </constant>
9926           <constant id="JVMTI_KIND_ALLOC_ALLOC_BUF" num="95">
9927             Outgoing allocated array of allocated arrays argument - <code>foo***</code>.
9928             Free with <code>Deallocate</code>.
9929           </constant>
9930           <constant id="JVMTI_KIND_OUT" num="96">
9931             Outgoing argument - <code>foo*</code>.
9932           </constant>
9933           <constant id="JVMTI_KIND_OUT_BUF" num="97">
9934             Outgoing array argument (pre-allocated by agent) - <code>foo*</code>.
9935             Do not <code>Deallocate</code>.
9936           </constant>
9937         </constants>
9938 
9939       </intro>
9940 
9941       <typedef id="jvmtiParamInfo" label="Extension Function/Event Parameter Info">
9942         <field id="name">
9943           <allocfieldbuf><char/></allocfieldbuf>
9944             <description>
9945               The parameter name, encoded as a
9946               <internallink id="mUTF">modified UTF-8</internallink> string
9947             </description>
9948         </field>
9949         <field id="kind">
9950           <enum>jvmtiParamKind</enum>
9951           <description>
9952             The kind of the parameter - type modifiers
9953           </description>
9954         </field>
9955         <field id="base_type">
9956           <enum>jvmtiParamTypes</enum>
9957           <description>
9958             The base type of the parameter -  modified by <code>kind</code>
9959           </description>
9960         </field>
9961         <field id="null_ok">
9962           <jboolean/>
9963             <description>
9964               Is a <code>NULL</code> argument permitted? Applies only to pointer and object types.
9965             </description>
9966         </field>
9967       </typedef>
9968 
9969       <callback id="jvmtiExtensionFunction">
9970         <enum>jvmtiError</enum>
9971           <synopsis>Extension Function</synopsis>
9972         <description>
9973           This is the implementation-specific extension function.
9974         </description>
9975         <parameters>
9976           <param id="jvmti_env">
9977             <outptr>
9978               <struct>jvmtiEnv</struct>
9979             </outptr>
9980             <description>
9981               The <jvmti/> environment is the only fixed parameter for extension functions.
9982             </description>
9983           </param>
9984           <param id="...">
9985             <varargs/>
9986               <description>
9987                 The extension function-specific parameters
9988               </description>
9989           </param>
9990         </parameters>
9991       </callback>
9992 
9993       <function id="GetExtensionFunctions" phase="onload" num="124">
9994         <synopsis>Get Extension Functions</synopsis>
9995 
9996         <typedef id="jvmtiExtensionFunctionInfo" label="Extension Function Info">
9997           <field id="func">
9998             <ptrtype>
9999               <struct>jvmtiExtensionFunction</struct>
10000             </ptrtype>
10001             <description>
10002               The actual function to call
10003             </description>
10004           </field>
10005           <field id="id">
10006             <allocfieldbuf><char/></allocfieldbuf>
10007               <description>
10008                 The identifier for the extension function, encoded as a
10009                 <internallink id="mUTF">modified UTF-8</internallink> string.
10010                 Uses package name conventions.
10011                 For example, <code>com.sun.hotspot.bar</code>
10012               </description>
10013           </field>
10014           <field id="short_description">
10015             <allocfieldbuf><char/></allocfieldbuf>
10016               <description>
10017                 A one sentence description of the function, encoded as a
10018                 <internallink id="mUTF">modified UTF-8</internallink> string.
10019               </description>
10020           </field>
10021           <field id="param_count">
10022             <jint/>
10023               <description>
10024                 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
10025               </description>
10026           </field>
10027           <field id="params">
10028             <allocfieldbuf outcount="param_count">
10029               <struct>jvmtiParamInfo</struct>
10030             </allocfieldbuf>
10031             <description>
10032               Array of
10033               <fieldlink id="param_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
10034               parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
10035             </description>
10036           </field>
10037           <field id="error_count">
10038             <jint/>
10039               <description>
10040                 The number of possible error returns (excluding universal errors)
10041               </description>
10042           </field>
10043           <field id="errors">
10044             <allocfieldbuf outcount="error_count">
10045               <enum>jvmtiError</enum>
10046             </allocfieldbuf>
10047             <description>
10048               Array of <fieldlink id="error_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
10049               possible errors
10050             </description>
10051           </field>
10052         </typedef>
10053 
10054         <description>
10055           Returns the set of extension functions.
10056         </description>
10057         <origin>new</origin>
10058         <capabilities>
10059         </capabilities>
10060         <parameters>
10061           <param id="extension_count_ptr">
10062             <outptr><jint/></outptr>
10063               <description>
10064                 On return, points to the number of extension functions
10065               </description>
10066           </param>
10067           <param id="extensions">
10068             <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionFunctionInfo</struct></allocbuf>
10069             <description>
10070               Returns an array of extension function info, one per function
10071             </description>
10072           </param>
10073         </parameters>
10074         <errors>
10075         </errors>
10076       </function>
10077 
10078       <function id="GetExtensionEvents" phase="onload" num="125">
10079         <synopsis>Get Extension Events</synopsis>
10080 
10081         <typedef id="jvmtiExtensionEventInfo" label="Extension Event Info">
10082           <field id="extension_event_index">
10083             <jint/>
10084             <description>
10085               The identifying index of the event
10086             </description>
10087           </field>
10088           <field id="id">
10089             <allocfieldbuf><char/></allocfieldbuf>
10090               <description>
10091                 The identifier for the extension event, encoded as a
10092                 <internallink id="mUTF">modified UTF-8</internallink> string.
10093                 Uses package name conventions.
10094                 For example, <code>com.sun.hotspot.bar</code>
10095               </description>
10096           </field>
10097           <field id="short_description">
10098             <allocfieldbuf><char/></allocfieldbuf>
10099               <description>
10100                 A one sentence description of the event, encoded as a
10101                 <internallink id="mUTF">modified UTF-8</internallink> string.
10102               </description>
10103           </field>
10104           <field id="param_count">
10105             <jint/>
10106               <description>
10107                 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
10108               </description>
10109           </field>
10110           <field id="params">
10111             <allocfieldbuf outcount="param_count">
10112               <struct>jvmtiParamInfo</struct>
10113             </allocfieldbuf>
10114             <description>
10115               Array of
10116               <fieldlink id="param_count" struct="jvmtiExtensionEventInfo"></fieldlink>
10117               parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
10118             </description>
10119           </field>
10120         </typedef>
10121 
10122         <description>
10123           Returns the set of extension events.
10124         </description>
10125         <origin>new</origin>
10126         <capabilities>
10127         </capabilities>
10128         <parameters>
10129           <param id="extension_count_ptr">
10130             <outptr><jint/></outptr>
10131               <description>
10132                 On return, points to the number of extension events
10133               </description>
10134           </param>
10135           <param id="extensions">
10136             <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionEventInfo</struct></allocbuf>
10137             <description>
10138               Returns an array of extension event info, one per event
10139             </description>
10140           </param>
10141         </parameters>
10142         <errors>
10143         </errors>
10144       </function>
10145 
10146       <callback id="jvmtiExtensionEvent">
10147         <void/>
10148           <synopsis>Extension Event</synopsis>
10149         <description>
10150           This is the implementation-specific event.
10151           The event handler is set with
10152           <functionlink id="SetExtensionEventCallback"/>.
10153           <p/>
10154           Event handlers for extension events must be declared varargs to match this definition.
10155           Failure to do so could result in calling convention mismatch and undefined behavior
10156           on some platforms.
10157           <p/>
10158           For example, if the <code>jvmtiParamInfo</code>
10159           returned by <functionlink id="GetExtensionEvents"/> indicates that
10160           there is a <code>jint</code> parameter, the event handler should be
10161           declared:
10162 <example>
10163     void JNICALL myHandler(jvmtiEnv* jvmti_env, jint myInt, ...)
10164 </example>
10165           Note the terminal "<code>...</code>" which indicates varargs.
10166         </description>
10167         <parameters>
10168           <param id="jvmti_env">
10169             <outptr>
10170               <struct>jvmtiEnv</struct>
10171             </outptr>
10172             <description>
10173               The <jvmti/> environment is the only fixed parameter for extension events.
10174             </description>
10175           </param>
10176           <param id="...">
10177             <varargs/>
10178               <description>
10179                 The extension event-specific parameters
10180               </description>
10181           </param>
10182         </parameters>
10183       </callback>
10184 
10185       <function id="SetExtensionEventCallback" phase="onload" num="126">
10186         <synopsis>Set Extension Event Callback</synopsis>
10187 
10188         <description>
10189           Sets the callback function for an extension event and
10190           enables the event. Or, if the callback is <code>NULL</code>, disables
10191           the event.  Note that unlike standard events, setting
10192           the callback and enabling the event are a single operation.
10193         </description>
10194         <origin>new</origin>
10195         <capabilities>
10196         </capabilities>
10197         <parameters>
10198           <param id="extension_event_index">
10199             <jint/>
10200               <description>
10201                 Identifies which callback to set.
10202                 This index is the
10203                 <fieldlink id="extension_event_index" struct="jvmtiExtensionEventInfo"></fieldlink>
10204                 field of
10205                 <datalink id="jvmtiExtensionEventInfo"/>.
10206               </description>
10207           </param>
10208           <param id="callback">
10209             <ptrtype>
10210               <struct>jvmtiExtensionEvent</struct>
10211               <nullok>disable the event</nullok>
10212             </ptrtype>
10213             <description>
10214               If <code>callback</code> is non-<code>NULL</code>,
10215               set <code>callback</code> to be the event callback function
10216               and enable the event.
10217             </description>
10218           </param>
10219         </parameters>
10220         <errors>
10221         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
10222             <paramlink id="extension_event_index"/> is not an
10223             <fieldlink id="extension_event_index"
10224                        struct="jvmtiExtensionEventInfo"/>
10225             returned by
10226             <functionlink id="GetExtensionEvents"/>
10227         </error>
10228         </errors>
10229       </function>
10230 
10231     </category>
10232 
10233   <category id="capability" label="Capability">
10234 
10235     <intro>
10236       The capabilities functions allow you to change the
10237       functionality available to <jvmti/>--that is,
10238       which <jvmti/>
10239       functions can be called, what events can be generated,
10240       and what functionality these events and functions can
10241       provide.
10242       <p/>
10243         The "Capabilities" section of each function and event describe which
10244         capabilities, if any, they are associated with. "Required Functionality"
10245         means it is available for use and no capabilities must be added to use it.
10246         "Optional Functionality" means the agent must possess the capability
10247         before it can be used.
10248         To possess a capability, the agent must
10249         <functionlink id="AddCapabilities">add the capability</functionlink>.
10250         "Optional Features" describe capabilities which,
10251         if added, extend the feature set.
10252         <p/>
10253         The potentially available capabilities of each <jvmti/> implementation are different.
10254         Depending on the implementation, a capability:
10255         <ul>
10256           <li>may never be added</li>
10257           <li>may be added in either the <code>OnLoad</code> or live phase in any environment</li>
10258           <li>may be added only during the <code>OnLoad</code> phase</li>
10259           <li>may be possessed by only one environment at a time</li>
10260           <li>may be possessed by only one environment at a time,
10261               and only during the <code>OnLoad</code> phase</li>
10262           <li>and so on ...</li>
10263         </ul>
10264       Frequently, the addition of a capability may incur a cost in execution speed, start up
10265       time, and/or memory footprint.  Note that the overhead of using a capability
10266       is completely different than the overhead of possessing a capability.
10267       Take single stepping as an example. When single stepping is on (that
10268       is, when the event is enabled and thus actively sending events)
10269       the overhead of sending and processing an event
10270       on each instruction is huge in any implementation.
10271       However, the overhead of possessing the capability may be small or large,
10272       depending on the implementation.  Also, when and if a capability is potentially
10273       available depends on the implementation.  Some examples:
10274       <ul>
10275         <li>One VM might perform all execution by compiling bytecodes into
10276           native code and be unable to generate single step instructions.
10277           In this implementation the capability can not be added.</li>
10278         <li>Another VM may be able to switch execution to a single stepping
10279           interpreter at any time.  In this implementation, having the capability has no
10280           overhead and could be added at any time.</li>
10281         <li>Yet another VM might be able to choose a bytecode compiling or single stepping capable interpreted
10282           execution engine at start up, but be unable to switch between them.
10283           In this implementation the capability would need to be added
10284           during the <code>OnLoad</code> phase (before bytecode
10285           execution begins) and would have a large impact on execution speed
10286           even if single stepping was never used.</li>
10287         <li>Still another VM might be able to add an "is single stepping on" check
10288           into compiled bytecodes or a generated interpreter.  Again in this implementation
10289           the capability would need to be added during the <code>OnLoad</code> phase but the overhead (a test
10290           and branch on each instruction) would be considerably less.</li>
10291       </ul>
10292       <p/>
10293       Each <jvmti/> <internallink id="environments">environment</internallink>
10294       has its own set of capabilities.
10295       Initially, that set is empty.
10296       Any desired capability must be added.
10297       If possible, capabilities should be added during the <code>OnLoad</code> phase.  For most
10298       virtual machines certain capabilities require special set up for
10299       the virtual machine and this set up must happen
10300       during the <code>OnLoad</code> phase, before the virtual machine begins execution.
10301       Once a capability is added, it can
10302       only be removed if explicitly relinquished by the environment.
10303       <p/>
10304       The agent can,
10305       <functionlink id="GetPotentialCapabilities">determine what
10306         capabilities this VM can potentially provide</functionlink>,
10307       <functionlink id="AddCapabilities">add the capabilities
10308         to be used</functionlink>,
10309       <functionlink id="RelinquishCapabilities">release capabilities
10310         which are no longer needed</functionlink>, and
10311       <functionlink id="GetCapabilities">examine the currently available
10312         capabilities</functionlink>.
10313     </intro>
10314 
10315     <intro id="capabilityExamples" label="Capability Examples">
10316       For example, a freshly started agent (in the <code>OnLoad</code> function)
10317       wants to enable all possible capabilities.
10318       Note that, in general, this is not advisable as the agent may suffer
10319       a performance penalty for functionality it is not using.
10320       The code might look like this in C:
10321       <example>
10322         jvmtiCapabilities capa;
10323         jvmtiError err;
10324 
10325         err = (*jvmti)-&gt;GetPotentialCapabilities(jvmti, &amp;capa);
10326         if (err == JVMTI_ERROR_NONE) {
10327            err = (*jvmti)-&gt;AddCapabilities(jvmti, &amp;capa);
10328       </example>
10329       For example, if an  agent wants to check if it can get
10330       the bytecodes of a method (that is, it wants to check
10331       if it previously added this capability and has not
10332       relinquished it), the code might
10333       look like this in C:
10334       <example>
10335         jvmtiCapabilities capa;
10336         jvmtiError err;
10337 
10338         err = (*jvmti)-&gt;GetCapabilities(jvmti, &amp;capa);
10339         if (err == JVMTI_ERROR_NONE) {
10340            if (capa.can_get_bytecodes) { ... } }
10341       </example>
10342     </intro>
10343 
10344     <capabilitiestypedef id="jvmtiCapabilities" label="The Capabilities Structure">
10345       <description>
10346         The functions in this category use this capabilities structure
10347         which contains boolean flags corresponding to each capability:
10348       </description>
10349       <capabilityfield id="can_tag_objects">
10350         <description>
10351           Can set and get tags, as described in the
10352           <internallink id="Heap">Heap category</internallink>.
10353         </description>
10354       </capabilityfield>
10355       <capabilityfield id="can_generate_field_modification_events">
10356         <description>
10357           Can set watchpoints on field modification -
10358           <functionlink id="SetFieldModificationWatch"></functionlink>
10359         </description>
10360       </capabilityfield>
10361       <capabilityfield id="can_generate_field_access_events">
10362         <description>
10363           Can set watchpoints on field access -
10364           <functionlink id="SetFieldAccessWatch"></functionlink>
10365         </description>
10366       </capabilityfield>
10367       <capabilityfield id="can_get_bytecodes">
10368         <description>
10369           Can get bytecodes of a method <functionlink id="GetBytecodes"></functionlink>
10370         </description>
10371       </capabilityfield>
10372       <capabilityfield id="can_get_synthetic_attribute">
10373         <description>
10374           Can test if a field or method is synthetic -
10375           <functionlink id="IsFieldSynthetic"></functionlink> and
10376           <functionlink id="IsMethodSynthetic"></functionlink>
10377         </description>
10378       </capabilityfield>
10379       <capabilityfield id="can_get_owned_monitor_info">
10380         <description>
10381           Can get information about ownership of monitors -
10382           <functionlink id="GetOwnedMonitorInfo"></functionlink>
10383         </description>
10384       </capabilityfield>
10385       <capabilityfield id="can_get_current_contended_monitor">
10386         <description>
10387           Can <functionlink id="GetCurrentContendedMonitor"></functionlink>
10388         </description>
10389       </capabilityfield>
10390       <capabilityfield id="can_get_monitor_info">
10391       <description>
10392         Can <functionlink id="GetObjectMonitorUsage"></functionlink>
10393       </description>
10394       </capabilityfield>
10395       <capabilityfield id="can_pop_frame">
10396         <description>
10397           Can pop frames off the stack - <functionlink id="PopFrame"></functionlink>
10398         </description>
10399       </capabilityfield>
10400       <capabilityfield id="can_redefine_classes">
10401         <description>
10402           Can redefine classes with <functionlink id="RedefineClasses"/>.
10403         </description>
10404       </capabilityfield>
10405       <capabilityfield id="can_signal_thread">
10406         <description>
10407           Can send stop or interrupt to threads
10408         </description>
10409       </capabilityfield>
10410       <capabilityfield id="can_get_source_file_name">
10411         <description>
10412           Can get the source file name of a class
10413         </description>
10414       </capabilityfield>
10415       <capabilityfield id="can_get_line_numbers">
10416         <description>
10417           Can get the line number table of a method
10418         </description>
10419       </capabilityfield>
10420       <capabilityfield id="can_get_source_debug_extension">
10421         <description>
10422           Can get the source debug extension of a class
10423         </description>
10424       </capabilityfield>
10425       <capabilityfield id="can_access_local_variables">
10426         <description>
10427           Can set and get local variables
10428         </description>
10429       </capabilityfield>
10430       <capabilityfield id="can_maintain_original_method_order">
10431         <description>
10432           Can return methods in the order they occur in the class file
10433         </description>
10434       </capabilityfield>
10435       <capabilityfield id="can_generate_single_step_events">
10436         <description>
10437           Can get <eventlink id="SingleStep">single step</eventlink> events
10438         </description>
10439       </capabilityfield>
10440       <capabilityfield id="can_generate_exception_events">
10441         <description>
10442           Can get <eventlink id="Exception">exception thrown</eventlink> and
10443             <eventlink id="ExceptionCatch">exception catch</eventlink> events
10444         </description>
10445       </capabilityfield>
10446       <capabilityfield id="can_generate_frame_pop_events">
10447         <description>
10448           Can <functionlink id="NotifyFramePop">set</functionlink> and thus get
10449             <eventlink id="FramePop"></eventlink> events
10450         </description>
10451       </capabilityfield>
10452       <capabilityfield id="can_generate_breakpoint_events">
10453         <description>
10454           Can <functionlink id="SetBreakpoint">set</functionlink> and thus get
10455             <eventlink id="Breakpoint"></eventlink> events
10456         </description>
10457       </capabilityfield>
10458       <capabilityfield id="can_suspend">
10459         <description>
10460           Can suspend and resume threads
10461         </description>
10462       </capabilityfield>
10463       <capabilityfield id="can_redefine_any_class">
10464         <description>
10465           <functionlink id="RedefineClasses"/> can be called on any modifiable class.
10466           See <functionlink id="IsModifiableClass"/>.
10467           (<fieldlink id="can_redefine_classes" struct="jvmtiCapabilities"/>
10468           must also be set)
10469         </description>
10470       </capabilityfield>
10471       <capabilityfield id="can_get_current_thread_cpu_time">
10472         <description>
10473           Can <functionlink id="GetCurrentThreadCpuTime">get</functionlink>
10474           current thread CPU time
10475         </description>
10476       </capabilityfield>
10477       <capabilityfield id="can_get_thread_cpu_time">
10478         <description>
10479           Can <functionlink id="GetThreadCpuTime">get</functionlink>
10480           thread CPU time
10481         </description>
10482       </capabilityfield>
10483       <capabilityfield id="can_generate_method_entry_events"
10484                        disp1="can_generate" disp2="_method_entry_events"
10485                        >
10486         <description>
10487           Can generate method entry events on entering a method
10488         </description>
10489       </capabilityfield>
10490       <capabilityfield id="can_generate_method_exit_events"
10491                        disp1="can_generate" disp2="_method_exit_events"
10492                        >
10493         <description>
10494           Can generate method exit events on leaving a method
10495         </description>
10496       </capabilityfield>
10497       <capabilityfield id="can_generate_all_class_hook_events"
10498                        disp1="can_generate" disp2="_all_class_hook_events"
10499                        >
10500         <description>
10501           Can generate ClassFileLoadHook events for every loaded class.
10502         </description>
10503       </capabilityfield>
10504       <capabilityfield id="can_generate_compiled_method_load_events"
10505                        disp1="can_generate" disp2="_compiled_method_load_events"
10506                        >
10507         <description>
10508           Can generate events when a method is compiled or unloaded
10509         </description>
10510       </capabilityfield>
10511       <capabilityfield id="can_generate_monitor_events"
10512                        disp1="can_generate" disp2="_monitor_events"
10513                        >
10514         <description>
10515           Can generate events on monitor activity
10516         </description>
10517       </capabilityfield>
10518       <capabilityfield id="can_generate_vm_object_alloc_events"
10519                        disp1="can_generate" disp2="_vm_object_alloc_events"
10520                        >
10521         <description>
10522           Can generate events on VM allocation of an object
10523         </description>
10524       </capabilityfield>
10525       <capabilityfield id="can_generate_native_method_bind_events"
10526                        disp1="can_generate" disp2="_native_method_bind_events"
10527                        >
10528         <description>
10529           Can generate events when a native method is bound to its
10530           implementation
10531         </description>
10532       </capabilityfield>
10533       <capabilityfield id="can_generate_garbage_collection_events"
10534                        disp1="can_generate" disp2="_garbage_collection_events"
10535                        >
10536         <description>
10537           Can generate events when garbage collection begins or ends
10538         </description>
10539       </capabilityfield>
10540       <capabilityfield id="can_generate_object_free_events"
10541                        disp1="can_generate" disp2="_object_free_events"
10542                        >
10543         <description>
10544           Can generate events when the garbage collector frees an object
10545         </description>
10546       </capabilityfield>
10547       <capabilityfield id="can_force_early_return" since="1.1">
10548         <description>
10549           Can return early from a method, as described in the
10550           <internallink id="ForceEarlyReturn">Force Early Return category</internallink>.
10551         </description>
10552       </capabilityfield>
10553       <capabilityfield id="can_get_owned_monitor_stack_depth_info" since="1.1">
10554         <description>
10555           Can get information about owned monitors with stack depth -
10556           <functionlink id="GetOwnedMonitorStackDepthInfo"></functionlink>
10557         </description>
10558       </capabilityfield>
10559       <capabilityfield id="can_get_constant_pool" since="1.1">
10560         <description>
10561           Can get the constant pool of a class -
10562           <functionlink id="GetConstantPool"></functionlink>
10563         </description>
10564       </capabilityfield>
10565       <capabilityfield id="can_set_native_method_prefix" since="1.1">
10566         <description>
10567           Can set prefix to be applied when native method cannot be resolved -
10568           <functionlink id="SetNativeMethodPrefix"/> and
10569           <functionlink id="SetNativeMethodPrefixes"/>
10570         </description>
10571       </capabilityfield>
10572       <capabilityfield id="can_retransform_classes" since="1.1">
10573         <description>
10574           Can retransform classes with <functionlink id="RetransformClasses"/>.
10575           In addition to the restrictions imposed by the specific
10576           implementation on this capability (see the
10577           <internallink id="capability">Capability</internallink> section),
10578           this capability must be set before the
10579           <eventlink id="ClassFileLoadHook"/> event is enabled for the
10580           first time in this environment.
10581           An environment that possesses this capability at the time that
10582           <code>ClassFileLoadHook</code> is enabled for the first time is
10583           said to be <i>retransformation capable</i>.
10584           An environment that does not possess this capability at the time that
10585           <code>ClassFileLoadHook</code> is enabled for the first time is
10586           said to be <i>retransformation incapable</i>.
10587         </description>
10588       </capabilityfield>
10589       <capabilityfield id="can_retransform_any_class" since="1.1">
10590         <description>
10591           <functionlink id="RetransformClasses"/> can be called on any modifiable class.
10592           See <functionlink id="IsModifiableClass"/>.
10593           (<fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
10594           must also be set)
10595         </description>
10596       </capabilityfield>
10597       <capabilityfield id="can_generate_resource_exhaustion_heap_events" since="1.1">
10598         <description>
10599           Can generate events when the VM is unable to allocate memory from
10600           the <tm>Java</tm> platform heap.
10601           See <eventlink id="ResourceExhausted"/>.
10602         </description>
10603       </capabilityfield>
10604       <capabilityfield id="can_generate_resource_exhaustion_threads_events" since="1.1">
10605         <description>
10606           Can generate events when the VM is unable to create a thread.
10607           See <eventlink id="ResourceExhausted"/>.
10608         </description>
10609       </capabilityfield>
10610       <capabilityfield id="can_generate_early_vmstart" since="9">
10611         <description>
10612           Can generate the <code>VMStart</code> event early.
10613           See <eventlink id="VMStart"/>.
10614         </description>
10615       </capabilityfield>
10616       <capabilityfield id="can_generate_early_class_hook_events" since="9">
10617         <description>
10618           Can generate the <eventlink id="ClassFileLoadHook"/> events
10619           in the primordial phase. If this capability and
10620           <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
10621           <code>can_generate_all_class_hook_events</code></internallink>
10622           are enabled then the <eventlink id="ClassFileLoadHook"/> events
10623           can be posted for classes loaded in the primordial phase.
10624           See <eventlink id="ClassFileLoadHook"/>.
10625         </description>
10626       </capabilityfield>
10627       <capabilityfield id="can_generate_sampled_object_alloc_events" since="11">
10628         <description>
10629           Can generate sampled allocation events.
10630           If this capability is enabled then the heap sampling method
10631           <functionlink id="SetHeapSamplingInterval"></functionlink> can be
10632           called and <eventlink id="SampledObjectAlloc"></eventlink> events can be generated.
10633         </description>
10634       </capabilityfield>
10635       <capabilityfield id="can_support_fibers" since="14">
10636         <description>
10637           Can support Fibers.
10638           If this capability is enabled then the following fiber aware functions can be called:
10639           <functionlink id="IsFiber"></functionlink>, 
10640           <functionlink id="GetThreadFiber"></functionlink>, 
10641           <functionlink id="GetFiberThread"></functionlink>
10642           and the following fiber aware events can be enabled:
10643           <eventlink id="FiberScheduled"></eventlink>,
10644           <eventlink id="FiberTerminated"></eventlink>,
10645           <eventlink id="FiberMount"></eventlink>,
10646           <eventlink id="FiberUnmount"></eventlink>.
10647         </description>
10648       </capabilityfield>
10649       <capabilityfield id="can_support_continuations" since="14">
10650         <description>
10651           Can support Continuations.
10652           and the following continuation aware events can be enabled:
10653           <eventlink id="ContinuationRun"></eventlink>.
10654           <eventlink id="ContinuationYield"></eventlink>.
10655         </description>
10656       </capabilityfield>
10657     </capabilitiestypedef>
10658 
10659     <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140">
10660       <synopsis>Get Potential Capabilities</synopsis>
10661       <description>
10662         Returns via <paramlink id="capabilities_ptr"></paramlink> the <jvmti/>
10663         features that can potentially be possessed by this environment
10664         at this time.
10665         The returned capabilities differ from the complete set of capabilities
10666         implemented by the VM in two cases: another environment possesses
10667         capabilities that can only be possessed by one environment, or the
10668         current <functionlink id="GetPhase">phase</functionlink> is live,
10669         and certain capabilities can only be added during the <code>OnLoad</code> phase.
10670         The <functionlink id="AddCapabilities"></functionlink> function
10671         may be used to set any or all or these capabilities.
10672         Currently possessed capabilities are included.
10673         <p/>
10674         Typically this function is used in the <code>OnLoad</code> function.
10675         Some virtual machines may allow a limited set of capabilities to be
10676         added in the live phase.
10677         In this case, the set of potentially available capabilities
10678         will likely differ from the <code>OnLoad</code> phase set.
10679         <p/>
10680         See the
10681         <internallink id="capabilityExamples">Capability Examples</internallink>.
10682       </description>
10683       <origin>new</origin>
10684       <capabilities>
10685       </capabilities>
10686       <parameters>
10687         <param id="capabilities_ptr">
10688           <outptr><struct>jvmtiCapabilities</struct></outptr>
10689           <description>
10690             On return, points to the <jvmti/> capabilities that may be added.
10691           </description>
10692         </param>
10693       </parameters>
10694       <errors>
10695       </errors>
10696     </function>
10697 
10698     <elide>
10699     <function id="EstimateCostOfCapabilities" phase="onload" num="141">
10700       <synopsis>Estimate Cost Of Capabilities</synopsis>
10701       <description>
10702         <issue>There is strong opposition to this function.  The concern is
10703           that it would be difficult or impossible to provide meaningful
10704           numbers, as the amount of impact is conditional on many factors
10705           that a single number could not represent.  There is doubt that
10706           conditional implementations would be used or are even a good idea.
10707           The thought is that release documentation for the implementation
10708           would be the best means of exposing this information.
10709           Unless new arguments are presented, I intend to remove this
10710           function in the next revision.
10711         </issue>
10712         <p/>
10713         Return via the <paramlink id="time_impact_ptr"></paramlink> and
10714         <paramlink id="space_impact_ptr"></paramlink> an estimate of the impact
10715         of adding the capabilities pointed to by
10716         <paramlink id="capabilities_ptr"></paramlink>.
10717         The returned estimates are in percentage of additional overhead, thus
10718         a time impact of 100 mean the application might run
10719         at half the speed.
10720         The estimates are very rough approximations and are not guaranteed.
10721         Note also, that the estimates are of the impact of having the
10722         capability available--when and if it is used the impact may be
10723         much greater.
10724         Estimates can be for a single capability or for a set of
10725         capabilities.  Note that the costs are not necessarily additive,
10726         adding support for one capability might make another available
10727         for free or conversely having two capabilities at once may
10728         have multiplicative impact.
10729         Estimates are relative to the current set of capabilities -
10730         that is, how much more impact given the currently possessed capabilities.
10731         <p/>
10732         Typically this function is used in the OnLoad function,
10733         some virtual machines may allow a limited set of capabilities to be
10734         added in the live phase.
10735         In this case, the set of potentially available capabilities
10736         will likely differ from the OnLoad phase set.
10737         <p/>
10738         See the
10739         <internallink id="capabilityExamples">Capability Examples</internallink>.
10740       </description>
10741       <origin>new</origin>
10742       <capabilities>
10743       </capabilities>
10744       <parameters>
10745         <param id="capabilities_ptr">
10746           <inptr><struct>jvmtiCapabilities</struct></inptr>
10747           <description>
10748             points to the <jvmti/> capabilities to evaluate.
10749           </description>
10750         </param>
10751         <param id="time_impact_ptr">
10752           <outptr><jint/></outptr>
10753           <description>
10754             On return, points to the estimated percentage increase in
10755             run time if this capability was added.
10756           </description>
10757         </param>
10758         <param id="space_impact_ptr">
10759           <outptr><jint/></outptr>
10760           <description>
10761             On return, points to the estimated percentage increase in
10762             memory space used if this capability was added.
10763           </description>
10764         </param>
10765       </parameters>
10766       <errors>
10767         <error id="JVMTI_ERROR_NOT_AVAILABLE">
10768           The desired capabilities are not even potentially available.
10769         </error>
10770       </errors>
10771     </function>
10772     </elide>
10773 
10774     <function id="AddCapabilities" jkernel="yes" phase="onload" num="142">
10775       <synopsis>Add Capabilities</synopsis>
10776       <description>
10777         Set new capabilities by adding the capabilities
10778         whose values are set to one (<code>1</code>) in
10779         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10780         All previous capabilities are retained.
10781         Typically this function is used in the <code>OnLoad</code> function.
10782         Some virtual machines may allow a limited set of capabilities to be
10783         added in the live phase.
10784         <p/>
10785         See the
10786         <internallink id="capabilityExamples">Capability Examples</internallink>.
10787       </description>
10788       <origin>new</origin>
10789       <capabilities>
10790       </capabilities>
10791       <parameters>
10792         <param id="capabilities_ptr">
10793           <inptr><struct>jvmtiCapabilities</struct></inptr>
10794           <description>
10795             Points to the <jvmti/> capabilities to add.
10796           </description>
10797         </param>
10798       </parameters>
10799       <errors>
10800         <error id="JVMTI_ERROR_NOT_AVAILABLE">
10801           The desired capabilities are not even potentially available.
10802         </error>
10803       </errors>
10804     </function>
10805 
10806 
10807     <function id="RelinquishCapabilities" phase="onload" num="143">
10808       <synopsis>Relinquish Capabilities</synopsis>
10809       <description>
10810         Relinquish the capabilities
10811         whose values are set to one (<code>1</code>) in
10812         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10813         Some implementations may allow only one environment to have a capability
10814         (see the <internallink id="capability">capability introduction</internallink>).
10815         This function releases capabilities
10816         so that they may be used by other agents.
10817         All other capabilities are retained.
10818         The capability will no longer be present in <functionlink id="GetCapabilities"></functionlink>.
10819         Attempting to relinquish a capability that the agent does not possess is not an error.
10820           <issue>
10821             It is possible for the agent to be actively using capabilities
10822             which are being relinquished.  For example, a thread is currently
10823             suspended and can_suspend is being relinquished or an event is currently
10824             enabled and can_generate_whatever is being relinquished.
10825             There are three possible ways we could spec this:
10826             <ul>
10827               <li>relinquish automatically releases them</li>
10828               <li>relinquish checks and returns some error code if held</li>
10829               <li>it is the agent's responsibility and it is not checked</li>
10830             </ul>
10831             One of these should be chosen.
10832           </issue>
10833       </description>
10834       <origin>new</origin>
10835       <capabilities>
10836       </capabilities>
10837       <parameters>
10838         <param id="capabilities_ptr">
10839           <inptr><struct>jvmtiCapabilities</struct></inptr>
10840           <description>
10841             Points to the <jvmti/> capabilities to relinquish.
10842           </description>
10843         </param>
10844       </parameters>
10845       <errors>
10846       </errors>
10847     </function>
10848 
10849 
10850 
10851     <function id="GetCapabilities" jkernel="yes" phase="any" num="89">
10852       <synopsis>Get Capabilities</synopsis>
10853         <description>
10854           Returns via <paramlink id="capabilities_ptr"></paramlink> the optional <jvmti/>
10855           features which this environment currently possesses.
10856           Each possessed capability is indicated by a one (<code>1</code>) in the
10857           corresponding field of the <internallink id="jvmtiCapabilities">capabilities
10858           structure</internallink>.
10859           An environment does not possess a capability unless it has been successfully added with
10860           <functionlink id="AddCapabilities"/>.
10861           An environment only loses possession of a capability if it has been relinquished with
10862           <functionlink id="RelinquishCapabilities"/>. Thus, this function returns the net result
10863           of the <code>AddCapabilities</code> and <code>RelinquishCapabilities</code> calls which
10864           have been made.
10865           <p/>
10866           See the
10867           <internallink id="capabilityExamples">Capability Examples</internallink>.
10868         </description>
10869       <origin>jvmdiClone</origin>
10870       <capabilities>
10871       </capabilities>
10872       <parameters>
10873         <param id="capabilities_ptr">
10874           <outptr><struct>jvmtiCapabilities</struct></outptr>
10875           <description>
10876             On return, points to the <jvmti/> capabilities.
10877           </description>
10878         </param>
10879       </parameters>
10880       <errors>
10881       </errors>
10882     </function>
10883 
10884   </category>
10885 
10886 
10887   <category id="timers" label="Timers">
10888 
10889       <intro>
10890         These functions provide timing information.
10891         The resolution at which the time is updated is not specified.
10892         They provides nanosecond precision, but not necessarily nanosecond accuracy.
10893         Details about the timers, such as their maximum values, can be accessed with
10894         the timer information functions.
10895       </intro>
10896 
10897       <typedef id="jvmtiTimerInfo" label="Timer Info">
10898         <description>
10899           The information function for each timer returns this data structure.
10900         </description>
10901         <field id="max_value">
10902           <jlong/>
10903             <description>
10904               The maximum value the timer can reach.
10905               After this value is reached the timer wraps back to zero.
10906               This is an unsigned value.  If tested or printed as a jlong (signed value)
10907               it may appear to be a negative number.
10908             </description>
10909         </field>
10910         <field id="may_skip_forward">
10911           <jboolean/>
10912           <description>
10913             If true, the timer can be externally adjusted and as a result skip forward.
10914             If false, the timer value will never increase faster than real time.
10915           </description>
10916         </field>
10917         <field id="may_skip_backward">
10918           <jboolean/>
10919           <description>
10920             If true, the timer can be externally adjusted and as a result skip backward.
10921             If false, the timer value will be monotonically increasing.
10922           </description>
10923         </field>
10924         <field id="kind">
10925           <enum>jvmtiTimerKind</enum>
10926           <description>
10927             The kind of timer.
10928             On a platform that does not distinguish between user and system time, <datalink
10929                  id="JVMTI_TIMER_TOTAL_CPU"><code>JVMTI_TIMER_TOTAL_CPU</code></datalink>
10930             is returned.
10931           </description>
10932         </field>
10933         <field id="reserved1">
10934           <jlong/>
10935             <description>
10936               Reserved for future use.
10937             </description>
10938         </field>
10939         <field id="reserved2">
10940           <jlong/>
10941             <description>
10942               Reserved for future use.
10943             </description>
10944         </field>
10945       </typedef>
10946 
10947       <intro>
10948         Where the timer kind is --
10949 
10950         <constants id="jvmtiTimerKind" label="Timer Kinds" kind="enum">
10951           <constant id="JVMTI_TIMER_USER_CPU" num="30">
10952             CPU time that a thread is in user mode.
10953           </constant>
10954           <constant id="JVMTI_TIMER_TOTAL_CPU" num="31">
10955             CPU time that a thread is in user or system mode.
10956           </constant>
10957           <constant id="JVMTI_TIMER_ELAPSED" num="32">
10958             Elapsed time.
10959           </constant>
10960         </constants>
10961       </intro>
10962 
10963     <function id="GetCurrentThreadCpuTimerInfo" callbacksafe="safe"  impl="innative notrace" phase="start" num="134">
10964       <synopsis>Get Current Thread CPU Timer Information</synopsis>
10965       <description>
10966         Get information about the
10967         <functionlink id="GetCurrentThreadCpuTime"/> timer.
10968         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10969         are filled in with details about the timer.
10970         This information is specific to the platform and the implementation of
10971         <functionlink id="GetCurrentThreadCpuTime"/> and thus
10972         does not vary by thread nor does it vary
10973         during a particular invocation of the VM.
10974         <p/>
10975         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10976         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10977         returned by <code>GetCurrentThreadCpuTimerInfo</code>
10978         and <functionlink id="GetThreadCpuTimerInfo"/>
10979         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10980       </description>
10981       <origin>new</origin>
10982       <capabilities>
10983         <required id="can_get_current_thread_cpu_time">
10984             Can get current thread CPU time.
10985         </required>
10986       </capabilities>
10987       <parameters>
10988         <param id="info_ptr">
10989           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10990           <description>
10991             On return, filled with information describing the time
10992             returned by <functionlink id="GetCurrentThreadCpuTime"/>.
10993           </description>
10994         </param>
10995       </parameters>
10996       <errors>
10997       </errors>
10998     </function>
10999 
11000     <function id="GetCurrentThreadCpuTime" callbacksafe="safe" impl="innative notrace" phase="start" num="135">
11001       <synopsis>Get Current Thread CPU Time</synopsis>
11002       <description>
11003             Return the CPU time utilized by the current thread.
11004             <p/>
11005             Note that the <functionlink id="GetThreadCpuTime"/>
11006             function provides CPU time for any thread, including
11007             the current thread. <code>GetCurrentThreadCpuTime</code>
11008             exists to support platforms which cannot
11009             supply CPU time for threads other than the current
11010             thread or which have more accurate information for
11011             the current thread (see
11012             <functionlink id="GetCurrentThreadCpuTimerInfo"/> vs
11013             <functionlink id="GetThreadCpuTimerInfo"/>).
11014             On many platforms this call will be equivalent to:
11015 <example>
11016   GetThreadCpuTime(env, NULL, nanos_ptr)
11017 </example>
11018       </description>
11019       <origin>new</origin>
11020       <capabilities>
11021         <required id="can_get_current_thread_cpu_time">
11022             Can get current thread CPU time.
11023             <p/>
11024             If this capability is enabled after threads have started,
11025             the implementation may choose any time up
11026             to and including the time that the capability is enabled
11027             as the point where CPU time collection starts.
11028             <p/>
11029             This capability must be potentially available on any
11030             platform where
11031             <internallink id="jvmtiCapabilities.can_get_thread_cpu_time"><code>can_get_thread_cpu_time</code></internallink>
11032             is potentially available.
11033         </required>
11034       </capabilities>
11035       <parameters>
11036         <param id="nanos_ptr">
11037           <outptr><jlong/></outptr>
11038           <description>
11039             On return, points to the CPU time used by this thread
11040             in nanoseconds.
11041             This is an unsigned value.  If tested or printed as a jlong (signed value)
11042             it may appear to be a negative number.
11043           </description>
11044         </param>
11045       </parameters>
11046       <errors>
11047       </errors>
11048     </function>
11049 
11050     <function id="GetThreadCpuTimerInfo" num="136">
11051       <synopsis>Get Thread CPU Timer Information</synopsis>
11052       <description>
11053         Get information about the
11054         <functionlink id="GetThreadCpuTime"/> timer.
11055         The fields of the <datalink id="jvmtiTimerInfo"/> structure
11056         are filled in with details about the timer.
11057         This information is specific to the platform and the implementation of
11058         <functionlink id="GetThreadCpuTime"/> and thus
11059         does not vary by thread nor does it vary
11060         during a particular invocation of the VM.
11061         <p/>
11062         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
11063         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
11064         returned by <functionlink id="GetCurrentThreadCpuTimerInfo"/>
11065         and <code>GetThreadCpuTimerInfo</code>
11066         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
11067       </description>
11068       <origin>new</origin>
11069       <capabilities>
11070         <required id="can_get_thread_cpu_time">
11071             Can get thread CPU time.
11072         </required>
11073       </capabilities>
11074       <parameters>
11075         <param id="info_ptr">
11076           <outptr><struct>jvmtiTimerInfo</struct></outptr>
11077           <description>
11078             On return, filled with information describing the time
11079             returned by <functionlink id="GetThreadCpuTime"/>.
11080           </description>
11081         </param>
11082       </parameters>
11083       <errors>
11084       </errors>
11085     </function>
11086 
11087     <function id="GetThreadCpuTime" num="137">
11088       <synopsis>Get Thread CPU Time</synopsis>
11089       <description>
11090           Return the CPU time utilized by the specified thread.
11091           <p/>
11092           Get information about this timer with
11093           <functionlink id="GetThreadCpuTimerInfo"/>.
11094       </description>
11095       <origin>new</origin>
11096       <capabilities>
11097         <required id="can_get_thread_cpu_time">
11098             Can get thread CPU time.
11099             <p/>
11100             If this capability is enabled after threads have started,
11101             the implementation may choose any time up
11102             to and including the time that the capability is enabled
11103             as the point where CPU time collection starts.
11104         </required>
11105       </capabilities>
11106       <parameters>
11107         <param id="thread">
11108           <jthread null="current"/>
11109             <description>
11110               The thread to query.
11111             </description>
11112         </param>
11113         <param id="nanos_ptr">
11114           <outptr><jlong/></outptr>
11115           <description>
11116             On return, points to the CPU time used by the specified thread
11117             in nanoseconds.
11118             This is an unsigned value.  If tested or printed as a jlong (signed value)
11119             it may appear to be a negative number.
11120           </description>
11121         </param>
11122       </parameters>
11123       <errors>
11124       </errors>
11125     </function>
11126 
11127     <function id="GetTimerInfo" phase="any" callbacksafe="safe" num="138">
11128       <synopsis>Get Timer Information</synopsis>
11129       <description>
11130         Get information about the
11131         <functionlink id="GetTime"/> timer.
11132         The fields of the <datalink id="jvmtiTimerInfo"/> structure
11133         are filled in with details about the timer.
11134         This information will not change during a particular invocation of the VM.
11135       </description>
11136       <origin>new</origin>
11137       <capabilities>
11138       </capabilities>
11139       <parameters>
11140         <param id="info_ptr">
11141           <outptr><struct>jvmtiTimerInfo</struct></outptr>
11142           <description>
11143             On return, filled with information describing the time
11144             returned by <functionlink id="GetTime"/>.
11145           </description>
11146         </param>
11147       </parameters>
11148       <errors>
11149       </errors>
11150     </function>
11151 
11152     <function id="GetTime" phase="any" callbacksafe="safe" num="139">
11153       <synopsis>Get Time</synopsis>
11154       <description>
11155           Return the current value of the system timer, in nanoseconds.
11156           <p/>
11157           The value returned represents nanoseconds since some fixed but
11158           arbitrary time (perhaps in the future, so values may be
11159           negative).  This function provides nanosecond precision, but not
11160           necessarily nanosecond accuracy. No guarantees are made about
11161           how frequently values change.
11162           <p/>
11163           Get information about this timer with
11164           <functionlink id="GetTimerInfo"/>.
11165       </description>
11166       <origin>new</origin>
11167       <capabilities>
11168       </capabilities>
11169       <parameters>
11170         <param id="nanos_ptr">
11171           <outptr><jlong/></outptr>
11172           <description>
11173             On return, points to the time in nanoseconds.
11174             This is an unsigned value.  If tested or printed as a jlong (signed value)
11175             it may appear to be a negative number.
11176           </description>
11177         </param>
11178       </parameters>
11179       <errors>
11180       </errors>
11181     </function>
11182 
11183     <function id="GetAvailableProcessors" phase="any" num="144">
11184       <synopsis>Get Available Processors</synopsis>
11185       <description>
11186           Returns the number of processors available to the Java virtual machine.
11187           <p/>
11188           This value may change during a particular invocation of the virtual machine.
11189           Applications that are sensitive to the number of available processors should
11190           therefore occasionally poll this property.
11191       </description>
11192       <origin>new</origin>
11193       <capabilities>
11194       </capabilities>
11195       <parameters>
11196         <param id="processor_count_ptr">
11197           <outptr><jint/></outptr>
11198           <description>
11199             On return, points to the maximum number of processors available to the
11200             virtual machine; never smaller than one.
11201           </description>
11202         </param>
11203       </parameters>
11204       <errors>
11205       </errors>
11206     </function>
11207 
11208   </category>
11209 
11210 
11211   <category id="classLoaderSearch" label="Class Loader Search">
11212 
11213     <intro>
11214       These functions allow the agent to add to the locations that a class loader searches for a class.
11215       This is useful for installing instrumentation under the correct class loader.
11216     </intro>
11217 
11218     <function id="AddToBootstrapClassLoaderSearch" jkernel="yes" phase="onload" num="149">
11219       <synopsis>Add To Bootstrap Class Loader Search</synopsis>
11220       <description>
11221           This function can be used to cause instrumentation classes to be defined by the
11222           bootstrap class loader. See <vmspec chapter="5.3.1"/>.
11223           After the bootstrap
11224           class loader unsuccessfully searches for a class, the specified platform-dependent
11225           search path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in
11226           the <paramlink id="segment"/>. This function may be called multiple times to add multiple segments,
11227           the segments will be searched in the order that this function was called.
11228           <p/>
11229           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
11230           search path segment to be searched after the bootstrap class loader unsuccessfully searches
11231           for a class. The segment is typically a directory or JAR file.
11232           <p/>
11233           In the live phase the <paramlink id="segment"/> may be used to specify any platform-dependent
11234           path to a <externallink id="jar/jar.html">
11235           JAR file</externallink>. The agent should take care that the JAR file does not
11236           contain any classes or resources other than those to be defined by the bootstrap
11237           class loader for the purposes of instrumentation.
11238           <p/>
11239           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
11240           reference that the Java virtual machine has previously unsuccessfully attempted
11241           to resolve always fails with the same error that was thrown as a result of the
11242           initial resolution attempt. Consequently, if the JAR file contains an entry
11243           that corresponds to a class for which the Java virtual machine has
11244           unsuccessfully attempted to resolve a reference, then subsequent attempts to
11245           resolve that reference will fail with the same error as the initial attempt.
11246       </description>
11247       <origin>new</origin>
11248       <capabilities>
11249       </capabilities>
11250       <parameters>
11251         <param id="segment">
11252           <inbuf><char/></inbuf>
11253           <description>
11254             The platform-dependent search path segment, encoded as a
11255             <internallink id="mUTF">modified UTF-8</internallink> string.
11256           </description>
11257         </param>
11258       </parameters>
11259       <errors>
11260         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11261           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
11262            existing JAR file is an invalid path.
11263         </error>
11264       </errors>
11265     </function>
11266 
11267     <function id="AddToSystemClassLoaderSearch" jkernel="yes" phase="onload" num="151" since="1.1">
11268       <synopsis>Add To System Class Loader Search</synopsis>
11269       <description>
11270           This function can be used to cause instrumentation classes to be
11271           defined by the system class loader. See <vmspec chapter="5.3.2"/>.
11272           After the class loader unsuccessfully searches for a class, the specified platform-dependent search
11273           path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in the
11274           <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, the
11275           segments will be searched in the order that this function was called.
11276           <p/>
11277           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
11278           search path segment to be searched after the system class loader unsuccessfully searches
11279           for a class. The segment is typically a directory or JAR file.
11280           <p/>
11281           In the live phase the <paramlink id="segment"/> is a platform-dependent path to a
11282           <externallink id="jar/jar.html">JAR file</externallink> to be
11283           searched after the system class loader unsuccessfully searches for a class. The agent should
11284           take care that the JAR file does not contain any classes or resources other than those to be
11285           defined by the system class loader for the purposes of instrumentation.
11286           <p/>
11287           In the live phase the system class loader supports adding a JAR file to be searched if
11288           the system class loader implements a method name <code>appendToClassPathForInstrumentation</code>
11289           which takes a single parameter of type <code>java.lang.String</code>. The method is not required
11290           to have <code>public</code> access.
11291           <p/>
11292           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
11293           reference that the Java virtual machine has previously unsuccessfully attempted
11294           to resolve always fails with the same error that was thrown as a result of the
11295           initial resolution attempt. Consequently, if the JAR file contains an entry
11296           that corresponds to a class for which the Java virtual machine has
11297           unsuccessfully attempted to resolve a reference, then subsequent attempts to
11298           resolve that reference will fail with the same error as the initial attempt.
11299       </description>
11300       <origin>new</origin>
11301       <capabilities>
11302       </capabilities>
11303       <parameters>
11304         <param id="segment">
11305           <inbuf><char/></inbuf>
11306           <description>
11307             The platform-dependent search path segment, encoded as a
11308             <internallink id="mUTF">modified UTF-8</internallink> string.
11309           </description>
11310         </param>
11311       </parameters>
11312       <errors>
11313         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11314           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
11315            existing JAR file is an invalid path.
11316         </error>
11317         <error id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED">
11318           Operation not supported by the system class loader.
11319         </error>
11320       </errors>
11321     </function>
11322 
11323   </category>
11324 
11325 
11326   <category id="props" label="System Properties">
11327 
11328     <intro>
11329       These functions get and set system properties.
11330     </intro>
11331 
11332     <function id="GetSystemProperties" phase="onload" num="130">
11333       <synopsis>Get System Properties</synopsis>
11334       <description>
11335         The list of VM system property keys which may be used with
11336         <functionlink id="GetSystemProperty"/> is returned.
11337         It is strongly recommended that virtual machines provide the
11338         following property keys:
11339         <ul>
11340           <li><code>java.vm.vendor</code></li>
11341           <li><code>java.vm.version</code></li>
11342           <li><code>java.vm.name</code></li>
11343           <li><code>java.vm.info</code></li>
11344           <li><code>java.library.path</code></li>
11345           <li><code>java.class.path</code></li>
11346         </ul>
11347         Provides access to system properties defined by and used
11348         by the VM.
11349         Properties set on the command-line are included.
11350         This allows getting and setting of these properties
11351         before the VM even begins executing bytecodes.
11352         Since this is a VM view of system properties, the set of available
11353         properties will usually be different than that
11354         in <code>java.lang.System.getProperties</code>.
11355         JNI method invocation may be used to access
11356         <code>java.lang.System.getProperties</code>.
11357         <p/>
11358         The set of properties may grow during execution.
11359       </description>
11360       <origin>new</origin>
11361       <capabilities>
11362       </capabilities>
11363       <parameters>
11364         <param id="count_ptr">
11365           <outptr><jint/></outptr>
11366           <description>
11367             On return, points to the number of property keys returned.
11368           </description>
11369         </param>
11370         <param id="property_ptr">
11371           <allocallocbuf outcount="count_ptr"><char/></allocallocbuf>
11372           <description>
11373             On return, points to an array of property keys, encoded as
11374             <internallink id="mUTF">modified UTF-8</internallink> strings.
11375           </description>
11376         </param>
11377       </parameters>
11378       <errors>
11379       </errors>
11380     </function>
11381 
11382     <function id="GetSystemProperty" phase="onload" num="131">
11383       <synopsis>Get System Property</synopsis>
11384       <description>
11385         Return a VM system property value given the property key.
11386         <p/>
11387         The function <functionlink id="GetSystemProperties"/>
11388         returns the set of property keys which may be used.
11389         The properties which can be retrieved may grow during
11390         execution.
11391         <p/>
11392         Since this is a VM view of system properties, the values
11393         of properties may differ from that returned by
11394         <code>java.lang.System.getProperty(String)</code>.
11395         A typical VM might copy the values of the VM system
11396         properties into the <code>Properties</code> held by
11397         <code>java.lang.System</code> during the initialization
11398         of that class. Thereafter any changes to the VM system
11399         properties (with <functionlink id="SetSystemProperty"/>)
11400         or the <code>java.lang.System</code> system properties
11401         (with <code>java.lang.System.setProperty(String,String)</code>)
11402         would cause the values to diverge.
11403         JNI method invocation may be used to access
11404         <code>java.lang.System.getProperty(String)</code>.
11405       </description>
11406       <origin>new</origin>
11407       <capabilities>
11408       </capabilities>
11409       <parameters>
11410         <param id="property">
11411           <inbuf><char/></inbuf>
11412           <description>
11413             The key of the property to retrieve, encoded as a
11414             <internallink id="mUTF">modified UTF-8</internallink> string.
11415           </description>
11416         </param>
11417         <param id="value_ptr">
11418           <allocbuf><char/></allocbuf>
11419           <description>
11420             On return, points to the property value, encoded as a
11421             <internallink id="mUTF">modified UTF-8</internallink> string.
11422           </description>
11423         </param>
11424       </parameters>
11425       <errors>
11426         <error id="JVMTI_ERROR_NOT_AVAILABLE">
11427           This property is not available.
11428           Use <functionlink id="GetSystemProperties"/> to find available properties.
11429         </error>
11430       </errors>
11431     </function>
11432 
11433     <function id="SetSystemProperty" phase="onloadOnly" num="132">
11434       <synopsis>Set System Property</synopsis>
11435       <description>
11436         Set a VM system property value.
11437         <p/>
11438         The function <functionlink id="GetSystemProperties"/>
11439         returns the set of property keys, some of these may be settable.
11440         See <functionlink id="GetSystemProperty"/>.
11441       </description>
11442       <origin>new</origin>
11443       <capabilities>
11444       </capabilities>
11445       <parameters>
11446         <param id="property">
11447           <inbuf><char/></inbuf>
11448           <description>
11449             The key of the property, encoded as a
11450             <internallink id="mUTF">modified UTF-8</internallink> string.
11451           </description>
11452         </param>
11453         <param id="value_ptr">
11454           <inbuf>
11455             <char/>
11456             <nullok>
11457               do not set the value, but return <errorlink id="JVMTI_ERROR_NOT_AVAILABLE"/>
11458               if the property is not writeable
11459             </nullok>
11460           </inbuf>
11461           <description>
11462             The property value to set, encoded as a
11463             <internallink id="mUTF">modified UTF-8</internallink> string.
11464           </description>
11465         </param>
11466       </parameters>
11467       <errors>
11468         <error id="JVMTI_ERROR_NOT_AVAILABLE">
11469           This property is not available or is not writeable.
11470         </error>
11471       </errors>
11472     </function>
11473 
11474   </category>
11475 
11476   <category id="general" label="General">
11477 
11478     <intro>
11479     </intro>
11480 
11481     <function id="GetPhase" jkernel="yes" phase="any" num="133">
11482       <synopsis>Get Phase</synopsis>
11483       <description>
11484           Return the current phase of VM execution.
11485           The phases proceed in sequence:
11486           <constants id="jvmtiPhase" label="Phases of execution" kind="enum">
11487             <constant id="JVMTI_PHASE_ONLOAD" num="1">
11488               <code>OnLoad</code> phase: while in the
11489               <internallink id="onload"><code>Agent_OnLoad</code></internallink>
11490               or, for statically linked agents, the <internallink id="onload">
11491               <code>Agent_OnLoad_&lt;agent-lib-name&gt;
11492               </code></internallink> function.
11493             </constant>
11494             <constant id="JVMTI_PHASE_PRIMORDIAL" num="2">
11495               Primordial phase: between return from <code>Agent_OnLoad</code>
11496               or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> and the
11497               <code>VMStart</code> event.
11498             </constant>
11499             <constant id="JVMTI_PHASE_START" num="6">
11500               Start phase: when the <eventlink id="VMStart"><code>VMStart</code></eventlink> event
11501               is sent and until the <code>VMInit</code> event is sent.
11502             </constant>
11503             <constant id="JVMTI_PHASE_LIVE" num="4">
11504               Live phase: when the <eventlink id="VMInit"><code>VMInit</code></eventlink> event is sent
11505               and until the <eventlink id="VMDeath"></eventlink> event returns.
11506             </constant>
11507             <constant id="JVMTI_PHASE_DEAD" num="8">
11508               Dead phase: after the <eventlink id="VMDeath"></eventlink> event returns or after
11509               start-up failure.
11510             </constant>
11511           </constants>
11512           In the case of start-up failure the VM will proceed directly to the dead
11513           phase skipping intermediate phases and neither a <code>VMInit</code> nor
11514           <code>VMDeath</code> event will be sent.
11515           <p/>
11516           Most <jvmti/> functions operate only in the live phase.
11517           The following functions operate in either the <code>OnLoad</code> or live phases:
11518           <functionphaselist phase="onload"/>
11519           The following functions operate in only the <code>OnLoad</code> phase:
11520           <functionphaselist phase="onloadOnly"/>
11521           The following functions operate in the start or live phases:
11522           <functionphaselist phase="start"/>
11523           The following functions operate in any phase:
11524           <functionphaselist phase="any"/>
11525           JNI functions (except the Invocation API) must only be used in the start or live phases.
11526           <p/>
11527           Most <jvmti/> events are sent only in the live phase.
11528           The following events operate in others phases:
11529           <eventphaselist phase="start"/>
11530           <eventphaselist phase="any"/>
11531       </description>
11532       <origin>new</origin>
11533       <capabilities>
11534       </capabilities>
11535       <parameters>
11536         <param id="phase_ptr">
11537           <outptr><enum>jvmtiPhase</enum></outptr>
11538           <description>
11539             On return, points to the phase.
11540           </description>
11541         </param>
11542       </parameters>
11543       <errors>
11544       </errors>
11545     </function>
11546 
11547     <function id="DisposeEnvironment" jkernel="yes" phase="any" num="127">
11548       <synopsis>Dispose Environment</synopsis>
11549       <description>
11550         Shutdown a <jvmti/> connection created with JNI <code>GetEnv</code>
11551         (see <internallink id="environments"><jvmti/> Environments</internallink>).
11552         Dispose of any resources held by the environment.
11553         <issue>
11554             What resources are reclaimed? What is undone?
11555             Breakpoints,watchpoints removed?
11556         </issue>
11557         Threads suspended by this environment are not resumed by this call,
11558         this must be done explicitly by the agent.
11559         Memory allocated by this environment via calls to <jvmti/> functions
11560         is not released, this can be done explicitly by the agent
11561         by calling <functionlink id="Deallocate"/>.
11562         Raw monitors created by this environment are not destroyed,
11563         this can be done explicitly by the agent
11564         by calling <functionlink id="DestroyRawMonitor"/>.
11565         The state of threads waiting on raw monitors created by this environment
11566         are not affected.
11567         <p/>
11568         Any <functionlink id="SetNativeMethodPrefix">native method
11569         prefixes</functionlink> for this environment will be unset;
11570         the agent must remove any prefixed native methods before
11571         dispose is called.
11572         <p/>
11573         Any <internallink id="capability">capabilities</internallink>
11574         held by this environment are relinquished.
11575         <p/>
11576         Events enabled by this environment will no longer be sent, however
11577         event handlers currently running will continue to run.  Caution must
11578         be exercised in the design of event handlers whose environment may
11579         be disposed and thus become invalid during their execution.
11580         <p/>
11581         This environment may not be used after this call.
11582         This call returns to the caller.
11583       </description>
11584       <origin>new</origin>
11585       <capabilities>
11586       </capabilities>
11587       <parameters>
11588       </parameters>
11589       <errors>
11590       </errors>
11591     </function>
11592 
11593     <function id="SetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="148">
11594       <synopsis>Set Environment Local Storage</synopsis>
11595       <description>
11596         The VM stores a pointer value associated with each environment.
11597         This pointer value is called <i>environment-local storage</i>.
11598         This value is <code>NULL</code> unless set with this function.
11599         Agents can allocate memory in which they store environment specific
11600         information. By setting environment-local storage it can then be
11601         accessed with
11602         <functionlink id="GetEnvironmentLocalStorage"></functionlink>.
11603         <p/>
11604         Called by the agent to set the value of the <jvmti/>
11605         environment-local storage. <jvmti/> supplies to the agent a pointer-size
11606         environment-local storage that can be used to record per-environment
11607         information.
11608       </description>
11609       <origin>new</origin>
11610       <capabilities>
11611       </capabilities>
11612       <parameters>
11613         <param id="data">
11614           <inbuf>
11615             <void/>
11616             <nullok>value is set to <code>NULL</code></nullok>
11617           </inbuf>
11618           <description>
11619             The value to be entered into the environment-local storage.
11620           </description>
11621         </param>
11622       </parameters>
11623       <errors>
11624       </errors>
11625     </function>
11626 
11627     <function id="GetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="147">
11628       <synopsis>Get Environment Local Storage</synopsis>
11629       <description>
11630         Called by the agent to get the value of the <jvmti/> environment-local
11631         storage.
11632       </description>
11633       <origin>new</origin>
11634       <capabilities>
11635       </capabilities>
11636       <parameters>
11637         <param id="data_ptr">
11638           <agentbuf><void/></agentbuf>
11639           <description>
11640             Pointer through which the value of the environment local
11641             storage is returned.
11642             If environment-local storage has not been set with
11643             <functionlink id="SetEnvironmentLocalStorage"></functionlink> returned
11644             pointer is <code>NULL</code>.
11645           </description>
11646         </param>
11647       </parameters>
11648       <errors>
11649       </errors>
11650     </function>
11651 
11652     <function id="GetVersionNumber" jkernel="yes" phase="any" num="88">
11653       <synopsis>Get Version Number</synopsis>
11654       <description>
11655         Return the <jvmti/> version via <code>version_ptr</code>.
11656         The return value is the version identifier.
11657         The version identifier includes major, minor and micro
11658         version as well as the interface type.
11659         <constants id="jvmtiVersionInterfaceTypes" label="Version Interface Types" kind="bits">
11660           <constant id="JVMTI_VERSION_INTERFACE_JNI" num="0x00000000">
11661             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for JNI.
11662           </constant>
11663           <constant id="JVMTI_VERSION_INTERFACE_JVMTI" num="0x30000000">
11664             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for <jvmti/>.
11665           </constant>
11666         </constants>
11667         <constants id="jvmtiVersionMasks" label="Version Masks" kind="bits">
11668           <constant id="JVMTI_VERSION_MASK_INTERFACE_TYPE" num="0x70000000">
11669             Mask to extract interface type.
11670             The value of the version returned by this function masked with
11671             <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> is always
11672             <code>JVMTI_VERSION_INTERFACE_JVMTI</code>
11673             since this is a <jvmti/> function.
11674           </constant>
11675           <constant id="JVMTI_VERSION_MASK_MAJOR" num="0x0FFF0000">
11676             Mask to extract major version number.
11677           </constant>
11678           <constant id="JVMTI_VERSION_MASK_MINOR" num="0x0000FF00">
11679             Mask to extract minor version number.
11680           </constant>
11681           <constant id="JVMTI_VERSION_MASK_MICRO" num="0x000000FF">
11682             Mask to extract micro version number.
11683           </constant>
11684         </constants>
11685         <constants id="jvmtiVersionShifts" label="Version Shifts" kind="bits">
11686           <constant id="JVMTI_VERSION_SHIFT_MAJOR" num="16">
11687             Shift to extract major version number.
11688           </constant>
11689           <constant id="JVMTI_VERSION_SHIFT_MINOR" num="8">
11690             Shift to extract minor version number.
11691           </constant>
11692           <constant id="JVMTI_VERSION_SHIFT_MICRO" num="0">
11693             Shift to extract micro version number.
11694           </constant>
11695         </constants>
11696       </description>
11697       <origin>jvmdi</origin>
11698       <capabilities>
11699       </capabilities>
11700       <parameters>
11701         <param id="version_ptr">
11702           <outptr><jint/></outptr>
11703           <description>
11704             On return, points to the <jvmti/> version.
11705           </description>
11706         </param>
11707       </parameters>
11708       <errors>
11709       </errors>
11710     </function>
11711 
11712 
11713     <function id="GetErrorName" phase="any" num="128">
11714       <synopsis>Get Error Name</synopsis>
11715       <description>
11716         Return the symbolic name for an
11717           <internallink id="ErrorSection">error code</internallink>.
11718         <p/>
11719         For example
11720         <code>GetErrorName(env, JVMTI_ERROR_NONE, &amp;err_name)</code>
11721         would return in <code>err_name</code> the string
11722         <code>"JVMTI_ERROR_NONE"</code>.
11723       </description>
11724       <origin>new</origin>
11725       <capabilities>
11726       </capabilities>
11727       <parameters>
11728         <param id="error">
11729           <enum>jvmtiError</enum>
11730           <description>
11731             The error code.
11732           </description>
11733         </param>
11734         <param id="name_ptr">
11735           <allocbuf><char/></allocbuf>
11736           <description>
11737             On return, points to the error name.
11738             The name is encoded as a
11739             <internallink id="mUTF">modified UTF-8</internallink> string,
11740             but is restricted to the ASCII subset.
11741           </description>
11742         </param>
11743       </parameters>
11744       <errors>
11745       </errors>
11746     </function>
11747 
11748     <function id="SetVerboseFlag" phase="any" num="150">
11749       <synopsis>Set Verbose Flag</synopsis>
11750       <description>
11751         <constants id="jvmtiVerboseFlag" label="Verbose Flag Enumeration" kind="enum">
11752           <constant id="JVMTI_VERBOSE_OTHER" num="0">
11753             Verbose output other than the below.
11754           </constant>
11755           <constant id="JVMTI_VERBOSE_GC" num="1">
11756             Verbose garbage collector output, like that specified with <code>-verbose:gc</code>.
11757           </constant>
11758           <constant id="JVMTI_VERBOSE_CLASS" num="2">
11759             Verbose class loading output, like that specified with <code>-verbose:class</code>.
11760           </constant>
11761           <constant id="JVMTI_VERBOSE_JNI" num="4">
11762             Verbose JNI output, like that specified with <code>-verbose:jni</code>.
11763           </constant>
11764         </constants>
11765         Control verbose output.
11766         This is the output which typically is sent to <code>stderr</code>.
11767       </description>
11768       <origin>new</origin>
11769       <capabilities>
11770       </capabilities>
11771       <parameters>
11772         <param id="flag">
11773           <enum>jvmtiVerboseFlag</enum>
11774           <description>
11775             Which verbose flag to set.
11776           </description>
11777         </param>
11778         <param id="value">
11779           <jboolean/>
11780           <description>
11781             New value of the flag.
11782           </description>
11783         </param>
11784       </parameters>
11785       <errors>
11786       </errors>
11787     </function>
11788 
11789 
11790     <function id="GetJLocationFormat" phase="any" num="129">
11791       <synopsis>Get JLocation Format</synopsis>
11792       <description>
11793         Although the greatest functionality is achieved with location information
11794         referencing the virtual machine bytecode index, the definition of
11795         <code>jlocation</code> has intentionally been left unconstrained to allow VM
11796         implementations that do not have this information.
11797         <p/>
11798         This function describes the representation of <code>jlocation</code> used in this VM.
11799         If the returned format is <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>,
11800         <code>jlocation</code>s can
11801         be used as in indices into the array returned by
11802         <functionlink id="GetBytecodes"></functionlink>.
11803         <constants id="jvmtiJlocationFormat" label="JLocation Format Enumeration" kind="enum">
11804           <constant id="JVMTI_JLOCATION_JVMBCI" num="1">
11805             <code>jlocation</code> values represent virtual machine
11806             bytecode indices--that is, offsets into the
11807             virtual machine code for a method.
11808           </constant>
11809           <constant id="JVMTI_JLOCATION_MACHINEPC" num="2">
11810             <code>jlocation</code> values represent native machine
11811             program counter values.
11812           </constant>
11813           <constant id="JVMTI_JLOCATION_OTHER" num="0">
11814             <code>jlocation</code> values have some other representation.
11815           </constant>
11816         </constants>
11817       </description>
11818       <origin>new</origin>
11819       <capabilities>
11820       </capabilities>
11821       <parameters>
11822         <param id="format_ptr">
11823           <outptr><enum>jvmtiJlocationFormat</enum></outptr>
11824           <description>
11825             On return, points to the format identifier for <code>jlocation</code> values.
11826           </description>
11827         </param>
11828       </parameters>
11829       <errors>
11830       </errors>
11831     </function>
11832 
11833   </category>
11834 
11835   <category id="heap_monitoring" label="Heap Monitoring">
11836     <function id="SetHeapSamplingInterval" phase="onload" num="156" since="11">
11837       <synopsis>Set Heap Sampling Interval</synopsis>
11838       <description>
11839         Generate a <eventlink id="SampledObjectAlloc"/> event when objects are allocated.
11840         Each thread keeps a counter of bytes allocated. The event will only be generated
11841         when that counter exceeds an average of <paramlink id="sampling_interval"></paramlink>
11842         since the last sample.
11843         <p/>
11844         Setting <paramlink id="sampling_interval"></paramlink> to 0 will cause an event to be
11845         generated by each allocation supported by the system once the new interval is taken into account.
11846         <p/>
11847         Note that updating the new sampling interval might take various number of allocations
11848         to provoke internal data structure updates.  Therefore it is important to
11849         consider the sampling interval as an average. This includes the interval 0, where events
11850         might not be generated straight away for each allocation.
11851       </description>
11852       <origin>new</origin>
11853       <capabilities>
11854         <required id="can_generate_sampled_object_alloc_events"></required>
11855       </capabilities>
11856       <parameters>
11857         <param id="sampling_interval">
11858           <jint/>
11859           <description>
11860             The sampling interval in bytes. The sampler uses a statistical approach to
11861             generate an event, on average, once for every <paramlink id="sampling_interval"/> bytes of
11862             memory allocated by a given thread.
11863             <p/>
11864             Once the new sampling interval is taken into account, 0 as a sampling interval will generate
11865             a sample for every allocation.
11866             <p/>
11867             Note: The overhead of this feature is directly correlated with the sampling interval.
11868             A high sampling interval, such as 1024 bytes, will incur a high overhead.
11869             A lower interval, such as 1024KB, will have a much lower overhead.  Sampling should only
11870             be used with an understanding that it may impact performance.
11871           </description>
11872         </param>
11873       </parameters>
11874       <errors>
11875         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11876           <paramlink id="sampling_interval"></paramlink> is less than zero.
11877         </error>
11878       </errors>
11879     </function>
11880   </category>
11881 
11882 </functionsection>
11883 
11884 <errorsection label="Error Reference">
11885   <intro>
11886     Every <jvmti/> function returns a <b><code>jvmtiError</code></b> error code.
11887     <p/>
11888     It is the responsibility of the agent to call <jvmti/> functions with
11889     valid parameters and in the proper context (calling thread is attached,
11890     phase is correct, etc.).
11891     Detecting some error conditions may be difficult, inefficient, or
11892     impossible for an implementation.
11893     The errors listed in
11894     <internallink id="reqerrors">Function Specific Required Errors</internallink>
11895     must be detected by the implementation.
11896     All other errors represent the recommended response to the error
11897     condition.
11898   </intro>
11899 
11900   <errorcategory id="universal-error" label="Universal Errors">
11901     <intro>
11902       The following errors may be returned by any function
11903     </intro>
11904 
11905     <errorid id="JVMTI_ERROR_NONE" num="0">
11906       No error has occurred.  This is the error code that is returned
11907       on successful completion of the function.
11908     </errorid>
11909     <errorid id="JVMTI_ERROR_NULL_POINTER" num="100">
11910       Pointer is unexpectedly <code>NULL</code>.
11911     </errorid>
11912     <errorid id="JVMTI_ERROR_OUT_OF_MEMORY" num="110">
11913       The function attempted to allocate memory and no more memory was
11914       available for allocation.
11915     </errorid>
11916     <errorid id="JVMTI_ERROR_ACCESS_DENIED" num="111">
11917       The desired functionality has not been enabled in this virtual machine.
11918     </errorid>
11919     <errorid id="JVMTI_ERROR_UNATTACHED_THREAD" num="115">
11920       The thread being used to call this function is not attached
11921       to the virtual machine.  Calls must be made from attached threads.
11922       See <code>AttachCurrentThread</code> in the JNI invocation API.
11923     </errorid>
11924     <errorid id="JVMTI_ERROR_INVALID_ENVIRONMENT" num="116">
11925       The <jvmti/> environment provided is no longer connected or is
11926       not an environment.
11927     </errorid>
11928     <errorid id="JVMTI_ERROR_WRONG_PHASE" num="112">
11929       The desired functionality is not available in the current
11930         <functionlink id="GetPhase">phase</functionlink>.
11931       Always returned if the virtual machine has completed running.
11932     </errorid>
11933     <errorid id="JVMTI_ERROR_INTERNAL" num="113">
11934       An unexpected internal error has occurred.
11935     </errorid>
11936   </errorcategory>
11937 
11938   <errorcategory id="reqerrors" label="Function Specific Required Errors">
11939     <intro>
11940       The following errors are returned by some <jvmti/> functions and must
11941       be returned by the implementation when the condition occurs.
11942     </intro>
11943 
11944     <errorid id="JVMTI_ERROR_INVALID_PRIORITY" num="12">
11945       Invalid priority.
11946     </errorid>
11947     <errorid id="JVMTI_ERROR_THREAD_NOT_SUSPENDED" num="13">
11948       Thread was not suspended.
11949     </errorid>
11950     <errorid id="JVMTI_ERROR_THREAD_SUSPENDED" num="14">
11951       Thread already suspended.
11952     </errorid>
11953     <errorid id="JVMTI_ERROR_THREAD_NOT_ALIVE" num="15">
11954       This operation requires the thread to be alive--that is,
11955       it must be started and not yet have died.
11956     </errorid>
11957     <errorid id="JVMTI_ERROR_CLASS_NOT_PREPARED" num="22">
11958       The class has been loaded but not yet prepared.
11959     </errorid>
11960     <errorid id="JVMTI_ERROR_NO_MORE_FRAMES" num="31">
11961       There are no Java programming language or JNI stack frames at the specified depth.
11962     </errorid>
11963     <errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32">
11964       Information about the frame is not available (e.g. for native frames).
11965     </errorid>
11966     <errorid id="JVMTI_ERROR_DUPLICATE" num="40">
11967       Item already set.
11968     </errorid>
11969     <errorid id="JVMTI_ERROR_NOT_FOUND" num="41">
11970       Desired element (e.g. field or breakpoint) not found
11971     </errorid>
11972     <errorid id="JVMTI_ERROR_NOT_MONITOR_OWNER" num="51">
11973       This thread doesn't own the raw monitor.
11974     </errorid>
11975     <errorid id="JVMTI_ERROR_INTERRUPT" num="52">
11976       The call has been interrupted before completion.
11977     </errorid>
11978     <errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79">
11979       The class cannot be modified.
11980     </errorid>
11981     <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80">
11982       The module cannot be modified.
11983     </errorid>
11984     <errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98">
11985       The functionality is not available in this virtual machine.
11986     </errorid>
11987     <errorid id="JVMTI_ERROR_ABSENT_INFORMATION" num="101">
11988       The requested information is not available.
11989     </errorid>
11990     <errorid id="JVMTI_ERROR_INVALID_EVENT_TYPE" num="102">
11991       The specified event type ID is not recognized.
11992     </errorid>
11993     <errorid id="JVMTI_ERROR_NATIVE_METHOD" num="104">
11994       The requested information is not available for native method.
11995     </errorid>
11996     <errorid id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED" num="106">
11997       The class loader does not support this operation.
11998     </errorid>
11999   </errorcategory>
12000 
12001   <errorcategory id="function-specific-errors" label="Function Specific Agent Errors">
12002     <intro>
12003       The following errors are returned by some <jvmti/> functions.
12004       They are returned in the event of invalid parameters passed by the
12005       agent or usage in an invalid context.
12006       An implementation is not required to detect these errors.
12007     </intro>
12008 
12009     <errorid id="JVMTI_ERROR_INVALID_FIBER" num="9">
12010       The passed fiber is not a valid fiber.
12011     </errorid>
12012     <errorid id="JVMTI_ERROR_INVALID_THREAD" num="10">
12013       The passed thread is not a valid thread.
12014     </errorid>
12015     <errorid id="JVMTI_ERROR_INVALID_FIELDID" num="25">
12016       Invalid field.
12017     </errorid>
12018     <errorid id="JVMTI_ERROR_INVALID_MODULE" num="26">
12019       Invalid module.
12020     </errorid>
12021     <errorid id="JVMTI_ERROR_INVALID_METHODID" num="23">
12022       Invalid method.
12023     </errorid>
12024     <errorid id="JVMTI_ERROR_INVALID_LOCATION" num="24">
12025       Invalid location.
12026     </errorid>
12027     <errorid id="JVMTI_ERROR_INVALID_OBJECT" num="20">
12028       Invalid object.
12029     </errorid>
12030     <errorid id="JVMTI_ERROR_INVALID_CLASS" num="21">
12031       Invalid class.
12032     </errorid>
12033     <errorid id="JVMTI_ERROR_TYPE_MISMATCH" num="34">
12034       The variable is not an appropriate type for the function used.
12035     </errorid>
12036     <errorid id="JVMTI_ERROR_INVALID_SLOT" num="35">
12037       Invalid slot.
12038     </errorid>
12039     <errorid id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY" num="99">
12040       The capability being used is false in this environment.
12041     </errorid>
12042     <errorid id="JVMTI_ERROR_INVALID_THREAD_GROUP" num="11">
12043       Thread group invalid.
12044     </errorid>
12045     <errorid id="JVMTI_ERROR_INVALID_MONITOR" num="50">
12046       Invalid raw monitor.
12047     </errorid>
12048     <errorid id="JVMTI_ERROR_ILLEGAL_ARGUMENT" num="103">
12049       Illegal argument.
12050     </errorid>
12051     <errorid id="JVMTI_ERROR_INVALID_TYPESTATE" num="65">
12052       The state of the thread has been modified, and is now inconsistent.
12053     </errorid>
12054     <errorid id="JVMTI_ERROR_UNSUPPORTED_VERSION" num="68">
12055       A new class file has a version number not supported by this VM.
12056     </errorid>
12057     <errorid id="JVMTI_ERROR_INVALID_CLASS_FORMAT" num="60">
12058       A new class file is malformed (the VM would return a <code>ClassFormatError</code>).
12059     </errorid>
12060     <errorid id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION" num="61">
12061       The new class file definitions would lead to a circular
12062       definition (the VM would return a <code>ClassCircularityError</code>).
12063     </errorid>
12064     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED" num="63">
12065       A new class file would require adding a method.
12066     </errorid>
12067     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED" num="64">
12068       A new class version changes a field.
12069     </errorid>
12070     <errorid id="JVMTI_ERROR_FAILS_VERIFICATION" num="62">
12071       The class bytes fail verification.
12072     </errorid>
12073     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED" num="66">
12074       A direct superclass is different for the new class
12075       version, or the set of directly implemented
12076       interfaces is different.
12077     </errorid>
12078     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED" num="67">
12079       A new class version does not declare a method
12080       declared in the old class version.
12081     </errorid>
12082     <errorid id="JVMTI_ERROR_NAMES_DONT_MATCH" num="69">
12083       The class name defined in the new class file is
12084       different from the name in the old class object.
12085     </errorid>
12086     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED" num="70">
12087       A new class version has different modifiers.
12088     </errorid>
12089     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED" num="71">
12090       A method in the new class version has different modifiers
12091       than its counterpart in the old class version.
12092     </errorid>
12093     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED" num="72">
12094       A new class version has unsupported differences in class attributes.
12095     </errorid>
12096   </errorcategory>
12097 </errorsection>
12098 
12099 <eventsection label="Events">
12100   <intro label="Handling Events" id="eventIntro">
12101     Agents can be informed of many events that occur in application
12102     programs.
12103     <p/>
12104     To handle events, designate a set of callback functions with
12105     <functionlink id="SetEventCallbacks"></functionlink>.
12106     For each event the corresponding callback function will be
12107     called.
12108     Arguments to the callback function provide additional
12109     information about the event.
12110     <p/>
12111     The callback function is usually called from within an application
12112     thread. The <jvmti/> implementation does not
12113     queue events in any way. This means
12114     that event callback functions must be written
12115     carefully. Here are some general guidelines. See
12116     the individual event descriptions for further
12117     suggestions.
12118     <p/>
12119     <ul>
12120       <li>Any exception thrown during the execution of an event callback can
12121         overwrite any current pending exception in the current application thread.
12122         Care must be taken to preserve a pending exception
12123         when an event callback makes a JNI call that might generate an exception.
12124       </li>
12125       <li>Event callback functions must be re-entrant. The <jvmti/> implementation does
12126         not queue events. If an agent needs to process events one at a time, it
12127         can use a raw monitor inside the
12128         event callback functions to serialize event processing.
12129       </li>
12130       <li>Event callback functions that execute JNI's FindClass function to load
12131         classes need to note that FindClass locates the class loader associated
12132         with the current native method. For the purposes of class loading, an
12133         event callback that includes a JNI environment as a parameter to the
12134         callback will treated as if it is a native call, where the native method
12135         is in the class of the event thread's current frame.
12136       </li>
12137     </ul>
12138     <p/>
12139     Some <jvmti/> events identify objects with JNI references.
12140     All references
12141     in <jvmti/> events are JNI local references and will become invalid
12142     after the event callback returns.
12143     Unless stated otherwise, memory referenced by pointers sent in event
12144     callbacks may not be referenced after the event callback returns.
12145     <p/>
12146     Except where stated otherwise, events are delivered on the thread
12147     that caused the event.
12148     Events are sent at the time they occur.
12149     The specification for each event includes the set of
12150     <functionlink id="GetPhase">phases</functionlink> in which it can be sent;
12151     if an event triggering activity occurs during another phase, no event
12152     is sent.
12153     <p/>
12154     A thread that generates an event does not change its execution status
12155     (for example, the event does not cause the thread to be suspended).
12156     If an agent wishes the event to result in suspension, then the agent
12157     is responsible for explicitly suspending the thread with
12158     <functionlink id="SuspendThread"></functionlink>.
12159     <p/>
12160     If an event is enabled in multiple environments, the event will be sent
12161     to each agent in the order that the environments were created.
12162   </intro>
12163 
12164   <intro label="Enabling Events" id="enablingevents">
12165     All events are initially disabled.  In order to receive any
12166     event:
12167       <ul>
12168         <li>
12169           If the event requires a capability, that capability must
12170           be added with
12171           <functionlink id="AddCapabilities"></functionlink>.
12172         </li>
12173         <li>
12174           A callback for the event must be set with
12175           <functionlink id="SetEventCallbacks"></functionlink>.
12176         </li>
12177         <li>
12178           The event must be enabled with
12179           <functionlink id="SetEventNotificationMode"></functionlink>.
12180         </li>
12181       </ul>
12182   </intro>
12183 
12184   <intro label="Multiple Co-located Events" id="eventorder">
12185     In many situations it is possible for multiple events to occur
12186     at the same location in one thread. When this happens, all the events
12187     are reported through the event callbacks in the order specified in this section.
12188     <p/>
12189     If the current location is at the entry point of a method, the
12190     <eventlink id="MethodEntry"></eventlink> event is reported before
12191     any other event at the current location in the same thread.
12192     <p/>
12193     If an exception catch has been detected at the current location,
12194     either because it is the beginning of a catch clause or a native method
12195     that cleared a pending exception has returned, the
12196     <code>exceptionCatch</code> event is reported before
12197     any other event at the current location in the same thread.
12198     <p/>
12199     If a <code>singleStep</code> event or
12200     <code>breakpoint</code> event is triggered at the
12201     current location, the event is defined to occur
12202     immediately before the code at the current location is executed.
12203     These events are reported before any events which are triggered
12204     by the execution of code at the current location in the same
12205     thread (specifically:
12206     <code>exception</code>,
12207     <code>fieldAccess</code>, and
12208     <code>fieldModification</code>).
12209     If both a step and breakpoint event are triggered for the same thread and
12210     location, the step event is reported before the breakpoint event.
12211     <p/>
12212     If the current location is the exit point of a method (that is, the last
12213     location before returning to the caller), the
12214     <eventlink id="MethodExit"></eventlink> event and
12215     the <eventlink id="FramePop"></eventlink> event (if requested)
12216     are reported after all other events at the current location in the same
12217     thread. There is no specified ordering of these two events
12218     with respect to each other.
12219     <p/>
12220     Co-located events can be triggered during the processing of some other
12221     event by the agent at the same location in the same thread.
12222     If such an event, of type <i>y</i>, is triggered during the processing of
12223     an event of type <i>x</i>, and if <i>x</i>
12224     precedes <i>y</i> in the ordering specified above, the co-located event
12225     <i>y</i> is reported for the current thread and location. If <i>x</i> does not precede
12226     <i>y</i>, <i>y</i> is not reported for the current thread and location.
12227     For example, if a breakpoint is set at the current location
12228     during the processing of <eventlink id="SingleStep"></eventlink>,
12229     that breakpoint will be reported before the thread moves off the current
12230     location.
12231     <p/>The following events are never considered to be co-located with
12232     other events.
12233     <ul>
12234       <li><eventlink id="VMStart"></eventlink></li>
12235       <li><eventlink id="VMInit"></eventlink></li>
12236       <li><eventlink id="VMDeath"></eventlink></li>
12237       <li><eventlink id="ThreadStart"></eventlink></li>
12238       <li><eventlink id="ThreadEnd"></eventlink></li>
12239       <li><eventlink id="ClassLoad"></eventlink></li>
12240       <li><eventlink id="ClassPrepare"></eventlink></li>
12241     </ul>
12242   </intro>
12243 
12244   <intro label="Event Callbacks" id="jvmtiEventCallbacks">
12245       The event callback structure below is used to specify the handler function
12246       for events.  It is set with the
12247       <functionlink id="SetEventCallbacks"></functionlink> function.
12248   </intro>
12249 
12250   <event label="Single Step"
12251          id="SingleStep" const="JVMTI_EVENT_SINGLE_STEP" filtered="thread" num="60">
12252     <description>
12253       Single step events allow the agent to trace thread execution
12254       at the finest granularity allowed by the VM. A single step event is
12255       generated whenever a thread reaches a new location.
12256       Typically, single step events represent the completion of one VM
12257       instruction as defined in <vmspec/>. However, some implementations
12258       may define locations differently. In any case the
12259       <code>method</code> and <code>location</code>
12260       parameters  uniquely identify the current location and allow
12261       the mapping to source file and line number when that information is
12262       available.
12263       <p/>
12264       No single step events are generated from within native methods.
12265     </description>
12266     <origin>jvmdi</origin>
12267     <capabilities>
12268       <required id="can_generate_single_step_events"></required>
12269     </capabilities>
12270     <parameters>
12271       <param id="jni_env">
12272         <outptr>
12273           <struct>JNIEnv</struct>
12274         </outptr>
12275           <description>
12276             The JNI environment of the event (current) thread
12277           </description>
12278       </param>
12279       <param id="thread">
12280         <jthread/>
12281           <description>
12282             Thread about to execution a new instruction
12283           </description>
12284       </param>
12285       <param id="klass">
12286         <jclass method="method"/>
12287           <description>
12288             Class of the method about to execute a new instruction
12289           </description>
12290       </param>
12291       <param id="method">
12292         <jmethodID class="klass"/>
12293           <description>
12294             Method about to execute a new instruction
12295           </description>
12296       </param>
12297       <param id="location">
12298         <jlocation/>
12299         <description>
12300           Location of the new instruction
12301         </description>
12302       </param>
12303     </parameters>
12304   </event>
12305 
12306   <event label="Breakpoint"
12307          id="Breakpoint" const="JVMTI_EVENT_BREAKPOINT" filtered="thread" num="62">
12308     <description>
12309       Breakpoint events are generated whenever a thread reaches a location
12310       designated as a breakpoint with <functionlink id="SetBreakpoint"></functionlink>.
12311       The <code>method</code> and <code>location</code>
12312       parameters uniquely identify the current location and allow
12313       the mapping to source file and line number when that information is
12314       available.
12315     </description>
12316     <origin>jvmdi</origin>
12317     <capabilities>
12318       <required id="can_generate_breakpoint_events"></required>
12319     </capabilities>
12320     <parameters>
12321       <param id="jni_env">
12322         <outptr>
12323           <struct>JNIEnv</struct>
12324         </outptr>
12325           <description>
12326             The JNI environment of the event (current) thread.
12327           </description>
12328       </param>
12329       <param id="thread">
12330         <jthread/>
12331           <description>
12332             Thread that hit the breakpoint
12333           </description>
12334       </param>
12335       <param id="klass">
12336         <jclass method="method"/>
12337           <description>
12338             Class of the method that hit the breakpoint
12339           </description>
12340       </param>
12341       <param id="method">
12342         <jmethodID class="klass"/>
12343           <description>
12344             Method that hit the breakpoint
12345           </description>
12346       </param>
12347       <param id="location">
12348         <jlocation/>
12349         <description>
12350           location of the breakpoint
12351         </description>
12352       </param>
12353     </parameters>
12354   </event>
12355 
12356   <event label="Field Access"
12357          id="FieldAccess" const="JVMTI_EVENT_FIELD_ACCESS" filtered="thread" num="63">
12358     <description>
12359       Field access events are generated whenever a thread accesses
12360       a field that was designated as a watchpoint
12361       with <functionlink id="SetFieldAccessWatch"></functionlink>.
12362       The <code>method</code> and <code>location</code>
12363       parameters uniquely identify the current location and allow
12364       the mapping to source file and line number when that information is
12365       available.
12366     </description>
12367     <origin>jvmdi</origin>
12368     <capabilities>
12369       <required id="can_generate_field_access_events"></required>
12370     </capabilities>
12371     <parameters>
12372       <param id="jni_env">
12373         <outptr>
12374           <struct>JNIEnv</struct>
12375         </outptr>
12376           <description>
12377             The JNI environment of the event (current) thread
12378           </description>
12379       </param>
12380       <param id="thread">
12381         <jthread/>
12382           <description>
12383             Thread accessing the field
12384           </description>
12385       </param>
12386       <param id="klass">
12387         <jclass method="method"/>
12388           <description>
12389             Class of the method where the access is occurring
12390           </description>
12391       </param>
12392       <param id="method">
12393         <jmethodID class="klass"/>
12394           <description>
12395             Method where the access is occurring
12396           </description>
12397       </param>
12398       <param id="location">
12399         <jlocation/>
12400         <description>
12401           Location where the access is occurring
12402         </description>
12403       </param>
12404       <param id="field_klass">
12405         <jclass field="field"/>
12406           <description>
12407             Class of the field being accessed
12408           </description>
12409       </param>
12410       <param id="object">
12411         <jobject/>
12412           <description>
12413             Object with the field being accessed if the field is an
12414             instance field; <code>NULL</code> otherwise
12415           </description>
12416       </param>
12417       <param id="field">
12418         <jfieldID class="field_klass"/>
12419           <description>
12420             Field being accessed
12421           </description>
12422       </param>
12423     </parameters>
12424   </event>
12425 
12426   <event label="Field Modification"
12427          id="FieldModification" const="JVMTI_EVENT_FIELD_MODIFICATION" filtered="thread" num="64">
12428     <description>
12429       Field modification events are generated whenever a thread modifies
12430       a field that was designated as a watchpoint
12431       with <functionlink id="SetFieldModificationWatch"></functionlink>.
12432       The <code>method</code> and <code>location</code>
12433       parameters uniquely identify the current location and allow
12434       the mapping to source file and line number when that information is
12435       available.
12436     </description>
12437     <origin>jvmdi</origin>
12438     <capabilities>
12439       <required id="can_generate_field_modification_events"></required>
12440     </capabilities>
12441     <parameters>
12442       <param id="jni_env">
12443         <outptr>
12444           <struct>JNIEnv</struct>
12445         </outptr>
12446           <description>
12447             The JNI environment of the event (current) thread
12448           </description>
12449       </param>
12450       <param id="thread">
12451         <jthread/>
12452           <description>
12453             Thread modifying the field
12454           </description>
12455       </param>
12456       <param id="klass">
12457         <jclass method="method"/>
12458           <description>
12459             Class of the method where the modification is occurring
12460           </description>
12461       </param>
12462       <param id="method">
12463         <jmethodID class="klass"/>
12464           <description>
12465             Method where the modification is occurring
12466           </description>
12467       </param>
12468       <param id="location">
12469         <jlocation/>
12470         <description>
12471           Location where the modification is occurring
12472         </description>
12473       </param>
12474       <param id="field_klass">
12475         <jclass field="field"/>
12476           <description>
12477             Class of the field being modified
12478           </description>
12479       </param>
12480       <param id="object">
12481         <jobject/>
12482           <description>
12483             Object with the field being modified if the field is an
12484             instance field; <code>NULL</code> otherwise
12485           </description>
12486       </param>
12487       <param id="field">
12488         <jfieldID class="field_klass"/>
12489           <description>
12490             Field being modified
12491           </description>
12492       </param>
12493       <param id="signature_type">
12494         <char/>
12495         <description>
12496           Signature type of the new value
12497         </description>
12498       </param>
12499       <param id="new_value">
12500         <jvalue/>
12501         <description>
12502           The new value
12503         </description>
12504       </param>
12505     </parameters>
12506   </event>
12507 
12508   <event label="Frame Pop"
12509          id="FramePop" const="JVMTI_EVENT_FRAME_POP" filtered="thread" num="61">
12510     <description>
12511       Frame pop events are generated upon exit from a single method
12512       in a single frame as specified
12513       in a call to <functionlink id="NotifyFramePop"></functionlink>.
12514       This is true whether termination is caused by
12515       executing its return instruction
12516       or by throwing an exception to its caller
12517       (see <paramlink id="was_popped_by_exception"></paramlink>).
12518       However, frame pops caused by the <functionlink id="PopFrame"/>
12519       function are not reported.
12520       <p/>
12521       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12522       identifies the executable location in the returning method,
12523       immediately prior to the return.
12524     </description>
12525     <origin>jvmdi</origin>
12526     <capabilities>
12527       <required id="can_generate_frame_pop_events"></required>
12528     </capabilities>
12529     <parameters>
12530       <param id="jni_env">
12531         <outptr>
12532           <struct>JNIEnv</struct>
12533         </outptr>
12534           <description>
12535             The JNI environment of the event (current) thread
12536           </description>
12537       </param>
12538       <param id="thread">
12539         <jthread/>
12540           <description>
12541             Thread that is popping the frame
12542           </description>
12543       </param>
12544       <param id="klass">
12545         <jclass method="method"/>
12546           <description>
12547             Class of the method being popped
12548           </description>
12549       </param>
12550       <param id="method">
12551         <jmethodID class="klass"/>
12552           <description>
12553             Method being popped
12554           </description>
12555       </param>
12556       <param id="was_popped_by_exception">
12557         <jboolean/>
12558         <description>
12559           True if frame was popped by a thrown exception.
12560           False if method exited through its return instruction.
12561         </description>
12562       </param>
12563     </parameters>
12564   </event>
12565 
12566   <event label="Method Entry"
12567          id="MethodEntry" const="JVMTI_EVENT_METHOD_ENTRY" filtered="thread" num="65">
12568     <description>
12569       Method entry events are generated upon entry of Java
12570       programming language methods (including native methods).
12571       <p/>
12572       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12573       identifies the initial executable location in
12574       the method.
12575       <p/>
12576       Enabling method
12577       entry or exit events will significantly degrade performance on many platforms and is thus
12578       not advised for performance critical usage (such as profiling).
12579       <internallink id="bci">Bytecode instrumentation</internallink> should be
12580       used in these cases.
12581     </description>
12582     <origin>jvmdi</origin>
12583     <capabilities>
12584       <required id="can_generate_method_entry_events"></required>
12585     </capabilities>
12586     <parameters>
12587       <param id="jni_env">
12588         <outptr>
12589           <struct>JNIEnv</struct>
12590         </outptr>
12591           <description>
12592             The JNI environment of the event (current) thread
12593           </description>
12594       </param>
12595       <param id="thread">
12596         <jthread/>
12597           <description>
12598             Thread entering the method
12599           </description>
12600       </param>
12601       <param id="klass">
12602         <jclass method="method"/>
12603           <description>
12604             Class of the method being entered
12605           </description>
12606       </param>
12607       <param id="method">
12608         <jmethodID class="klass"/>
12609           <description>
12610             Method being entered
12611           </description>
12612       </param>
12613     </parameters>
12614   </event>
12615 
12616   <event label="Method Exit"
12617          id="MethodExit" const="JVMTI_EVENT_METHOD_EXIT" filtered="thread" num="66">
12618     <description>
12619       Method exit events are generated upon exit from Java
12620       programming language methods (including native methods).
12621       This is true whether termination is caused by
12622       executing its return instruction
12623       or by throwing an exception to its caller
12624       (see <paramlink id="was_popped_by_exception"></paramlink>).
12625       <p/>
12626       The <code>method</code> field uniquely identifies the
12627       method being entered or exited. The <code>frame</code> field provides
12628       access to the stack frame for the method.
12629       <p/>
12630       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12631       identifies the executable location in the returning method
12632       immediately prior to the return.
12633       <p/>
12634         Enabling method
12635         entry or exit events will significantly degrade performance on many platforms and is thus
12636         not advised for performance critical usage (such as profiling).
12637         <internallink id="bci">Bytecode instrumentation</internallink> should be
12638         used in these cases.
12639     </description>
12640     <origin>jvmdi</origin>
12641     <capabilities>
12642       <required id="can_generate_method_exit_events"></required>
12643     </capabilities>
12644     <parameters>
12645       <param id="jni_env">
12646         <outptr>
12647           <struct>JNIEnv</struct>
12648         </outptr>
12649           <description>
12650             The JNI environment of the event (current) thread
12651           </description>
12652       </param>
12653       <param id="thread">
12654         <jthread/>
12655           <description>
12656             Thread exiting the method
12657           </description>
12658       </param>
12659       <param id="klass">
12660         <jclass method="method"/>
12661           <description>
12662             Class of the method being exited
12663           </description>
12664       </param>
12665       <param id="method">
12666         <jmethodID class="klass"/>
12667           <description>
12668             Method being exited
12669           </description>
12670       </param>
12671       <param id="was_popped_by_exception">
12672         <jboolean/>
12673         <description>
12674           True if frame was popped by a thrown exception.
12675           False if method exited through its return instruction.
12676         </description>
12677       </param>
12678       <param id="return_value">
12679         <jvalue/>
12680         <description>
12681           The return value of the method being exited.
12682           Undefined and should not be used if
12683           <paramlink id="was_popped_by_exception"></paramlink>
12684           is true.
12685         </description>
12686       </param>
12687     </parameters>
12688   </event>
12689 
12690   <event label="Native Method Bind" phase="any"
12691          id="NativeMethodBind" const="JVMTI_EVENT_NATIVE_METHOD_BIND" num="67">
12692     <description>
12693       A Native Method Bind event is sent when a VM binds a
12694       Java programming language native method
12695       to the address of a function that implements the native method.
12696       This will occur when the native method is called for the first time
12697       and also occurs when the JNI function <code>RegisterNatives</code> is called.
12698       This event allows the bind to be redirected to an agent-specified
12699       proxy function.
12700       This event is not sent when the native method is unbound.
12701       Typically, this proxy function will need to be specific to a
12702       particular method or, to handle the general case, automatically
12703       generated assembly code, since after instrumentation code is
12704       executed the function at the original binding
12705       address will usually be invoked.
12706       The original binding can be restored or the redirection changed
12707       by use of the JNI function <code>RegisterNatives</code>.
12708       Some events may be sent during the primordial phase, JNI and
12709       most of <jvmti/> cannot be used at this time but the method and
12710       address can be saved for use later.
12711     </description>
12712     <origin>new</origin>
12713     <capabilities>
12714       <required id="can_generate_native_method_bind_events"></required>
12715     </capabilities>
12716     <parameters>
12717       <param id="jni_env">
12718         <outptr>
12719           <struct>JNIEnv</struct>
12720         </outptr>
12721           <description>
12722             The JNI environment of the event (current) thread
12723             Will be <code>NULL</code> if sent during the primordial
12724             <functionlink id="GetPhase">phase</functionlink>.
12725           </description>
12726       </param>
12727       <param id="thread">
12728         <jthread/>
12729           <description>
12730             Thread requesting the bind
12731           </description>
12732       </param>
12733       <param id="klass">
12734         <jclass method="method"/>
12735           <description>
12736             Class of the method being bound
12737           </description>
12738       </param>
12739       <param id="method">
12740         <jmethodID class="klass"/>
12741           <description>
12742             Native method being bound
12743           </description>
12744       </param>
12745       <param id="address">
12746         <outptr><void/></outptr>
12747         <description>
12748           The address the VM is about to bind to--that is, the
12749           address of the implementation of the native method
12750         </description>
12751       </param>
12752       <param id="new_address_ptr">
12753         <agentbuf><void/></agentbuf>
12754         <description>
12755           if the referenced address is changed (that is, if
12756           <code>*new_address_ptr</code> is set), the binding
12757           will instead be made to the supplied address.
12758         </description>
12759       </param>
12760     </parameters>
12761   </event>
12762 
12763   <event label="Exception"
12764          id="Exception" const="JVMTI_EVENT_EXCEPTION" filtered="thread" num="58">
12765     <description>
12766       Exception events are generated whenever an exception is first detected
12767       in a Java programming language method.
12768       Where "exception" means any <code>java.lang.Throwable</code>.
12769       The exception may have been thrown by a Java programming language or native
12770       method, but in the case of native methods, the event is not generated
12771       until the exception is first seen by a Java programming language method. If an exception is
12772       set and cleared in a native method (and thus is never visible to Java programming language code),
12773       no exception event is generated.
12774       <p/>
12775       The <code>method</code> and <code>location</code>
12776       parameters  uniquely identify the current location
12777       (where the exception was detected) and allow
12778       the mapping to source file and line number when that information is
12779       available. The <code>exception</code> field identifies the thrown
12780       exception object. The <code>catch_method</code>
12781       and <code>catch_location</code> identify the location of the catch clause,
12782       if any, that handles the thrown exception. If there is no such catch clause,
12783       each field is set to 0. There is no guarantee that the thread will ever
12784       reach this catch clause. If there are native methods on the call stack
12785       between the throw location and the catch clause, the exception may
12786       be reset by one of those native methods.
12787       Similarly, exceptions that are reported as uncaught (<code>catch_klass</code>
12788       et al. set to 0) may in fact be caught by native code.
12789       Agents can check for these occurrences by monitoring
12790       <eventlink id="ExceptionCatch"></eventlink> events.
12791       Note that finally clauses are implemented as catch and re-throw. Therefore they
12792       will be reported in the catch location.
12793     </description>
12794     <origin>jvmdi</origin>
12795     <capabilities>
12796       <required id="can_generate_exception_events"></required>
12797     </capabilities>
12798     <parameters>
12799       <param id="jni_env">
12800         <outptr>
12801           <struct>JNIEnv</struct>
12802         </outptr>
12803           <description>
12804             The JNI environment of the event (current) thread
12805           </description>
12806       </param>
12807       <param id="thread">
12808         <jthread/>
12809           <description>
12810             Thread generating the exception
12811           </description>
12812       </param>
12813       <param id="klass">
12814         <jclass method="method"/>
12815           <description>
12816             Class generating the exception
12817           </description>
12818       </param>
12819       <param id="method">
12820         <jmethodID class="klass"/>
12821           <description>
12822             Method generating the exception
12823           </description>
12824       </param>
12825       <param id="location">
12826         <jlocation/>
12827         <description>
12828           Location where exception occurred
12829         </description>
12830       </param>
12831       <param id="exception">
12832         <jobject/>
12833           <description>
12834             The exception being thrown
12835           </description>
12836       </param>
12837       <param id="catch_klass">
12838         <jclass method="catch_method"/>
12839           <description>
12840             Class that will catch the exception, or <code>NULL</code> if no known catch
12841           </description>
12842       </param>
12843       <param id="catch_method">
12844         <jmethodID class="catch_klass"/>
12845           <description>
12846             Method that will catch the exception, or <code>NULL</code> if no known catch
12847           </description>
12848       </param>
12849       <param id="catch_location">
12850         <jlocation/>
12851         <description>
12852           location which will catch the exception or zero if no known catch
12853         </description>
12854       </param>
12855     </parameters>
12856   </event>
12857 
12858   <event label="Exception Catch"
12859          id="ExceptionCatch" const="JVMTI_EVENT_EXCEPTION_CATCH" filtered="thread" num="59">
12860     <description>
12861       Exception catch events are generated whenever a thrown exception is caught.
12862       Where "exception" means any <code>java.lang.Throwable</code>.
12863       If the exception is caught in a Java programming language method, the event is generated
12864       when the catch clause is reached. If the exception is caught in a native
12865       method, the event is generated as soon as control is returned to a Java programming language
12866       method. Exception catch events are generated for any exception for which
12867       a throw was detected in a Java programming language method.
12868       Note that finally clauses are implemented as catch and re-throw. Therefore they
12869       will generate exception catch events.
12870       <p/>
12871       The <code>method</code> and <code>location</code>
12872       parameters uniquely identify the current location
12873       and allow the mapping to source file and line number when that information is
12874       available. For exceptions caught in a Java programming language method, the
12875       <code>exception</code> object identifies the exception object. Exceptions
12876       caught in native methods are not necessarily available by the time the
12877       exception catch is reported, so the <code>exception</code> field is set
12878       to <code>NULL</code>.
12879     </description>
12880     <origin>jvmdi</origin>
12881     <capabilities>
12882       <required id="can_generate_exception_events"></required>
12883     </capabilities>
12884     <parameters>
12885       <param id="jni_env">
12886         <outptr>
12887           <struct>JNIEnv</struct>
12888         </outptr>
12889           <description>
12890             The JNI environment of the event (current) thread
12891           </description>
12892       </param>
12893       <param id="thread">
12894         <jthread/>
12895           <description>
12896             Thread catching the exception
12897           </description>
12898       </param>
12899       <param id="klass">
12900         <jclass method="method"/>
12901           <description>
12902             Class catching the exception
12903           </description>
12904       </param>
12905       <param id="method">
12906         <jmethodID class="klass"/>
12907           <description>
12908             Method catching the exception
12909           </description>
12910       </param>
12911       <param id="location">
12912         <jlocation/>
12913         <description>
12914           Location where exception is being caught
12915         </description>
12916       </param>
12917       <param id="exception">
12918         <jobject/>
12919           <description>
12920             Exception being caught
12921           </description>
12922       </param>
12923     </parameters>
12924   </event>
12925 
12926   <event label="Thread Start"
12927          id="ThreadStart" const="JVMTI_EVENT_THREAD_START" num="52" phase="start">
12928     <description>
12929       Thread start events are generated by a new thread before its initial
12930       method executes.
12931       <p/>
12932       A thread may be listed in the array returned by
12933       <functionlink id="GetAllThreads"></functionlink>
12934       before its thread start event is generated.
12935       It is possible for other events to be generated
12936       on a thread before its thread start event.
12937       <p/>
12938       The event is sent on the newly started <paramlink id="thread"></paramlink>.
12939     </description>
12940     <origin>jvmdi</origin>
12941     <capabilities>
12942     </capabilities>
12943     <parameters>
12944       <param id="jni_env">
12945         <outptr>
12946           <struct>JNIEnv</struct>
12947         </outptr>
12948           <description>
12949             The JNI environment of the event (current) thread.
12950           </description>
12951       </param>
12952       <param id="thread">
12953         <jthread/>
12954           <description>
12955             Thread starting
12956           </description>
12957       </param>
12958     </parameters>
12959   </event>
12960 
12961   <event label="Thread End"
12962          id="ThreadEnd" const="JVMTI_EVENT_THREAD_END" filtered="thread" num="53" phase="start">
12963     <description>
12964       Thread end events are generated by a terminating thread
12965       after its initial method has finished execution.
12966       <p/>
12967       A thread may be listed in the array returned by
12968       <functionlink id="GetAllThreads"></functionlink>
12969       after its thread end event is generated.
12970       No events are generated on a thread
12971       after its thread end event.
12972       <p/>
12973       The event is sent on the dying <paramlink id="thread"></paramlink>.
12974     </description>
12975     <origin>jvmdi</origin>
12976     <capabilities>
12977     </capabilities>
12978     <parameters>
12979       <param id="jni_env">
12980         <outptr>
12981           <struct>JNIEnv</struct>
12982         </outptr>
12983           <description>
12984             The JNI environment of the event (current) thread.
12985           </description>
12986       </param>
12987       <param id="thread">
12988         <jthread/>
12989           <description>
12990             Thread ending
12991           </description>
12992       </param>
12993     </parameters>
12994   </event>
12995 
12996  <event label="Fiber Scheduled"
12997          id="FiberScheduled" const="JVMTI_EVENT_FIBER_SCHEDULED" filtered="thread" num="87" phase="start" since="14">
12998     <description>
12999       Fiber scheduled events are generated before its initial method executes.
13000       <p/>
13001       The event is sent on the <paramlink id="thread"></paramlink>.
13002     </description>
13003     <origin>new</origin>
13004     <capabilities>
13005       <required id="can_support_fibers">
13006         Can support fibers.
13007       </required>
13008     </capabilities>
13009     <parameters>
13010       <param id="jni_env">
13011         <outptr>
13012           <struct>JNIEnv</struct>
13013         </outptr>
13014           <description>
13015             The JNI environment of the event (current) thread.
13016           </description>
13017       </param>
13018       <param id="thread">
13019         <jthread/>
13020           <description>
13021             Thread scheduling this fiber.
13022           </description>
13023       </param>
13024       <param id="fiber">
13025         <jobject/>
13026           <description>
13027             Fiber scheduled for execution.
13028           </description>
13029       </param>
13030     </parameters>
13031   </event>
13032 
13033   <event label="Fiber Terminated"
13034          id="FiberTerminated" const="JVMTI_EVENT_FIBER_TERMINATED" filtered="thread" num="88" phase="start" since="14">
13035     <description>
13036       Fiber terminated events are generated after its initial method has finished execution.
13037       <p/>
13038       The event is sent on the <paramlink id="thread"></paramlink>.
13039     </description>
13040     <origin>new</origin>
13041     <capabilities>
13042       <required id="can_support_fibers">
13043         Can support fibers.
13044       </required>
13045     </capabilities>
13046     <parameters>
13047       <param id="jni_env">
13048         <outptr>
13049           <struct>JNIEnv</struct>
13050         </outptr>
13051           <description>
13052             The JNI environment of the event (current) thread.
13053           </description>
13054       </param>
13055       <param id="thread">
13056         <jthread/>
13057           <description>
13058             Thread terminating this fiber.
13059           </description>
13060       </param>
13061       <param id="fiber">
13062         <jobject/>
13063           <description>
13064             Fiber being terminated.
13065           </description>
13066       </param>
13067     </parameters>
13068   </event>
13069 
13070   <event label="Fiber Mount"
13071          id="FiberMount" const="JVMTI_EVENT_FIBER_MOUNT" filtered="thread" num="89" phase="start" since="14">
13072     <description>
13073       Fiber mount events are generated before its method continue to execute on the mounted thread.
13074       <p/>
13075       The event is sent on the <paramlink id="thread"></paramlink> the fiber is mounted to.
13076     </description>
13077     <origin>new</origin>
13078     <capabilities>
13079       <required id="can_support_fibers">
13080         Can support fibers.
13081       </required>
13082     </capabilities>
13083     <parameters>
13084       <param id="jni_env">
13085         <outptr>
13086           <struct>JNIEnv</struct>
13087         </outptr>
13088           <description>
13089             The JNI environment of the event (current) thread.
13090           </description>
13091       </param>
13092       <param id="thread">
13093         <jthread/>
13094           <description>
13095             Thread the fiber is mounted to.
13096           </description>
13097       </param>
13098       <param id="fiber">
13099         <jobject/>
13100           <description>
13101             Fiber that is mounted.
13102           </description>
13103       </param>
13104     </parameters>
13105   </event>
13106 
13107   <event label="Fiber Unmount"
13108          id="FiberUnmount" const="JVMTI_EVENT_FIBER_UNMOUNT" filtered="thread" num="90" phase="start" since="14">
13109     <description>
13110       Fiber unmount events are generated when the fiber is about to be unmounted from the carrier thread.
13111       <p/>
13112       The event is sent on the <paramlink id="thread"></paramlink> the fiber is unmounted from.
13113     </description>
13114     <origin>new</origin>
13115     <capabilities>
13116       <required id="can_support_fibers">
13117         Can support fibers.
13118       </required>
13119     </capabilities>
13120     <parameters>
13121       <param id="jni_env">
13122         <outptr>
13123           <struct>JNIEnv</struct>
13124         </outptr>
13125           <description>
13126             The JNI environment of the event (current) thread.
13127           </description>
13128       </param>
13129       <param id="thread">
13130         <jthread/>
13131           <description>
13132             Thread the fiber is unmounted from.
13133           </description>
13134       </param>
13135       <param id="fiber">
13136         <jobject/>
13137           <description>
13138             Fiber that is unmounted.
13139           </description>
13140       </param>
13141     </parameters>
13142   </event>
13143 
13144   <event label="Continuation Run"
13145          id="ContinuationRun" const="JVMTI_EVENT_CONTINUATION_RUN" filtered="thread" num="91" phase="start" since="14">
13146     <description>
13147       Continuation run events are generated before the continuation is continued execution on current thread.
13148       <p/>
13149       The event is sent on the <paramlink id="thread"></paramlink> the continuation is about to leave.
13150     </description>
13151     <origin>new</origin>
13152     <capabilities>
13153       <required id="can_support_continuations">
13154         Can support continuations.
13155       </required>
13156     </capabilities>
13157     <parameters>
13158       <param id="jni_env">
13159         <outptr>
13160           <struct>JNIEnv</struct>
13161         </outptr>
13162           <description>
13163             The JNI environment of the event (current) thread.
13164           </description>
13165       </param>
13166       <param id="thread">
13167         <jthread/>
13168           <description>
13169             Thread the continuation is executed on.
13170           </description>
13171       </param>
13172       <param id="continuation_frame_count">
13173         <jint min="1"/>
13174           <description>
13175             Number of frames the continuation is executing.
13176           </description>
13177       </param>
13178     </parameters>
13179   </event>
13180 
13181   <event label="Continuation Yield"
13182          id="ContinuationYield" const="JVMTI_EVENT_CONTINUATION_YIELD" filtered="thread" num="92" phase="start" since="14">
13183     <description>
13184       Continuation yield events are generated before the continuation actually yields on current thread.
13185       <p/>
13186       The event is sent on the <paramlink id="thread"></paramlink> the continuation is about to leave.
13187     </description>
13188     <origin>new</origin>
13189     <capabilities>
13190       <required id="can_support_continuations">
13191         Can support continuations.
13192       </required>
13193     </capabilities>
13194     <parameters>
13195       <param id="jni_env">
13196         <outptr>
13197           <struct>JNIEnv</struct>
13198         </outptr>
13199           <description>
13200             The JNI environment of the event (current) thread.
13201           </description>
13202       </param>
13203       <param id="thread">
13204         <jthread/>
13205           <description>
13206             Thread the continuation is executed on.
13207           </description>
13208       </param>
13209       <param id="continuation_frame_count">
13210         <jint min="1"/>
13211           <description>
13212             Number of frames the continuation is executing.
13213           </description>
13214       </param>
13215     </parameters>
13216   </event>
13217 
13218 
13219   <event label="Class Load"
13220          id="ClassLoad" const="JVMTI_EVENT_CLASS_LOAD" filtered="thread" phase="start" num="55">
13221     <description>
13222       A class load event is generated when a class is first loaded. The order
13223       of class load events generated by a particular thread are guaranteed
13224       to match the order of class loading within that thread.
13225       Array class creation does not generate a class load event.
13226       The creation of a primitive class (for example, java.lang.Integer.TYPE)
13227       does not generate a class load event.
13228       <p/>
13229       This event is sent at an early stage in loading the class. As
13230       a result the class should be used carefully.  Note, for example,
13231       that methods and fields are not yet loaded, so queries for methods,
13232       fields, subclasses, and so on will not give correct results.
13233       See "Loading of Classes and Interfaces" in the <i>Java Language
13234       Specification</i>.  For most
13235       purposes the <eventlink id="ClassPrepare"></eventlink> event will
13236       be more useful.
13237     </description>
13238     <origin>jvmdi</origin>
13239     <capabilities>
13240     </capabilities>
13241     <parameters>
13242       <param id="jni_env">
13243         <outptr>
13244           <struct>JNIEnv</struct>
13245         </outptr>
13246           <description>
13247             The JNI environment of the event (current) thread
13248           </description>
13249       </param>
13250       <param id="thread">
13251         <jthread/>
13252           <description>
13253             Thread loading the class
13254           </description>
13255       </param>
13256       <param id="klass">
13257         <jclass/>
13258           <description>
13259             Class being loaded
13260           </description>
13261       </param>
13262     </parameters>
13263   </event>
13264 
13265   <elide>
13266   <event label="Class Unload"
13267          id="ClassUnload" const="JVMTI_EVENT_CLASS_UNLOAD" num="57">
13268     <description>
13269       A class unload event is generated when the class is about to be unloaded.
13270       Class unload events take place during garbage collection and must be
13271       handled extremely carefully. The garbage collector holds many locks
13272       and has suspended all other threads, so the event handler cannot depend
13273       on the ability to acquire any locks. The class unload event handler should
13274       do as little as possible, perhaps by queuing information to be processed
13275       later.  In particular, the <code>jclass</code> should be used only in
13276       the JNI function <code>isSameObject</code> or in the following <jvmti/> functions:
13277       <ul>
13278         <li><functionlink id="GetClassSignature"></functionlink></li>
13279         <li><functionlink id="GetSourceFileName"></functionlink></li>
13280         <li><functionlink id="IsInterface"></functionlink></li>
13281         <li><functionlink id="IsArrayClass"></functionlink></li>
13282       </ul>
13283     </description>
13284     <origin>jvmdi</origin>
13285     <capabilities>
13286     </capabilities>
13287     <parameters>
13288       <param id="jni_env">
13289         <outptr>
13290           <struct>JNIEnv</struct>
13291         </outptr>
13292           <description>
13293             The JNI environment of the event (current) thread
13294           </description>
13295       </param>
13296       <param id="thread">
13297         <jthread/>
13298           <description>
13299             Thread generating the class unload
13300           </description>
13301       </param>
13302       <param id="klass">
13303         <jclass/>
13304           <description>
13305             Class being unloaded
13306           </description>
13307       </param>
13308     </parameters>
13309   </event>
13310   </elide>
13311 
13312   <event label="Class Prepare"
13313          id="ClassPrepare" const="JVMTI_EVENT_CLASS_PREPARE" filtered="thread" phase="start" num="56">
13314     <description>
13315       A class prepare event is generated when class preparation is complete.
13316       At this point, class fields, methods, and implemented interfaces are
13317       available, and no code from the class has been executed. Since array
13318       classes never have fields or methods, class prepare events are not
13319       generated for them. Class prepare events are not generated for
13320       primitive classes (for example, <code>java.lang.Integer.TYPE</code>).
13321     </description>
13322     <origin>jvmdi</origin>
13323     <capabilities>
13324     </capabilities>
13325     <parameters>
13326       <param id="jni_env">
13327         <outptr>
13328           <struct>JNIEnv</struct>
13329         </outptr>
13330           <description>
13331             The JNI environment of the event (current) thread
13332           </description>
13333       </param>
13334       <param id="thread">
13335         <jthread/>
13336           <description>
13337             Thread generating the class prepare
13338           </description>
13339       </param>
13340       <param id="klass">
13341         <jclass/>
13342           <description>
13343             Class being prepared
13344           </description>
13345       </param>
13346     </parameters>
13347   </event>
13348 
13349   <event label="Class File Load Hook" phase="any"
13350          id="ClassFileLoadHook" const="JVMTI_EVENT_CLASS_FILE_LOAD_HOOK" num="54">
13351     <description>
13352       This event is sent when the VM obtains class file data,
13353       but before it constructs
13354       the in-memory representation for that class.
13355       This event is also sent when the class is being modified by the
13356       <functionlink id="RetransformClasses"/> function or
13357       the <functionlink id="RedefineClasses"/> function,
13358       called in any <jvmti/> environment.
13359       The agent can instrument
13360       the existing class file data sent by the VM to include profiling/debugging hooks.
13361       See the description of
13362       <internallink id="bci">bytecode instrumentation</internallink>
13363       for usage information.
13364       <p/>
13365     When the capabilities
13366     <internallink id="jvmtiCapabilities.can_generate_early_class_hook_events">
13367     <code>can_generate_early_class_hook_events</code></internallink> and
13368     <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
13369     <code>can_generate_all_class_hook_events</code></internallink>
13370     are enabled then this event may be sent in the primordial phase.
13371     Otherwise, this event may be sent before the VM is initialized (the start
13372     <functionlink id="GetPhase">phase</functionlink>).
13373     Some classes might not be compatible
13374     with the function (eg. ROMized classes or implementation defined classes) and this event will
13375     not be generated for these classes.
13376     <p/>
13377     The agent must allocate the space for the modified
13378     class file data buffer
13379     using the memory allocation function
13380     <functionlink id="Allocate"></functionlink> because the
13381     VM is responsible for freeing the new class file data buffer
13382     using <functionlink id="Deallocate"></functionlink>.
13383     <p/>
13384     If the agent wishes to modify the class file, it must set
13385     <code>new_class_data</code> to point
13386     to the newly instrumented class file data buffer and set
13387     <code>new_class_data_len</code> to the length of that
13388     buffer before returning
13389     from this call.  If no modification is desired, the agent simply
13390     does not set <code>new_class_data</code>.  If multiple agents
13391     have enabled this event the results are chained. That is, if
13392     <code>new_class_data</code> has been set, it becomes the
13393     <code>class_data</code> for the next agent.
13394     <p/>
13395     When handling a class load in the live phase, then the
13396     <functionlink id="GetNamedModule"></functionlink>
13397     function can be used to map class loader and a package name to a module.
13398     When a class is being redefined or retransformed then
13399     <code>class_being_redefined</code> is non <code>NULL</code> and so
13400     the JNI <code>GetModule</code> function can also be used
13401     to obtain the Module.
13402     <p/>
13403     The order that this event is sent to each environment differs
13404     from other events.
13405     This event is sent to environments in the following order:
13406     <ul>
13407       <li><fieldlink id="can_retransform_classes"
13408                      struct="jvmtiCapabilities">retransformation
13409                                                 incapable</fieldlink>
13410           environments, in the
13411           order in which they were created
13412       </li>
13413       <li><fieldlink id="can_retransform_classes"
13414                      struct="jvmtiCapabilities">retransformation
13415                                                 capable</fieldlink>
13416           environments, in the
13417           order in which they were created
13418       </li>
13419     </ul>
13420     When triggered by <functionlink id="RetransformClasses"/>,
13421     this event is sent only to <fieldlink id="can_retransform_classes"
13422                      struct="jvmtiCapabilities">retransformation
13423                                                 capable</fieldlink>
13424     environments.
13425   </description>
13426   <origin>jvmpi</origin>
13427     <capabilities>
13428       <capability id="can_generate_all_class_hook_events"></capability>
13429       <capability id="can_generate_early_class_hook_events"></capability>
13430     </capabilities>
13431     <parameters>
13432       <param id="jni_env">
13433         <outptr>
13434           <struct>JNIEnv</struct>
13435         </outptr>
13436           <description>
13437             The JNI environment of the event (current) thread.
13438           </description>
13439       </param>
13440       <param id="class_being_redefined">
13441         <jclass/>
13442         <description>
13443           The class being
13444           <functionlink id="RedefineClasses">redefined</functionlink> or
13445           <functionlink id="RetransformClasses">retransformed</functionlink>.
13446           <code>NULL</code> if sent by class load.
13447         </description>
13448       </param>
13449       <param id="loader">
13450         <jobject/>
13451           <description>
13452             The class loader loading the class.
13453             <code>NULL</code> if the bootstrap class loader.
13454           </description>
13455       </param>
13456       <param id="name">
13457         <vmbuf><char/></vmbuf>
13458         <description>
13459             Name of class being loaded as a VM internal qualified name
13460             (for example, "java/util/List"), encoded as a
13461             <internallink id="mUTF">modified UTF-8</internallink> string.
13462             Note: if the class is defined with a <code>NULL</code> name or
13463             without a name specified, <code>name</code> will be <code>NULL</code>.
13464         </description>
13465       </param>
13466       <param id="protection_domain">
13467         <jobject/>
13468         <description>
13469           The <code>ProtectionDomain</code> of the class.
13470         </description>
13471       </param>
13472       <param id="class_data_len">
13473         <jint/>
13474         <description>
13475           Length of current class file data buffer.
13476         </description>
13477       </param>
13478       <param id="class_data">
13479         <vmbuf><uchar/></vmbuf>
13480         <description>
13481           Pointer to the current class file data buffer.
13482         </description>
13483       </param>
13484       <param id="new_class_data_len">
13485         <outptr><jint/></outptr>
13486         <description>
13487           Pointer to the length of the new class file data buffer.
13488         </description>
13489       </param>
13490       <param id="new_class_data">
13491         <agentbuf incount="new_class_data_len"><uchar/></agentbuf>
13492         <description>
13493           Pointer to the pointer to the instrumented class file data buffer.
13494         </description>
13495       </param>
13496     </parameters>
13497   </event>
13498 
13499   <event label="VM Start Event"
13500          id="VMStart" const="JVMTI_EVENT_VM_START" num="57" phase="start">
13501     <description>
13502       The VM start event signals the start of the VM.
13503       At this time JNI is live but the VM is not yet fully initialized.
13504       Once this event is generated, the agent is free to call any JNI function.
13505       This event signals the beginning of the start phase,
13506       <jvmti/> functions permitted in the start phase may be called.
13507       <p/>
13508       The timing of this event may depend on whether the agent has added the
13509       <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
13510       <code>can_generate_early_vmstart</code></internallink> capability or not.
13511       If the capability has been added then the VM posts the event as early
13512       as possible. The VM is capable of executing bytecode but it may not have
13513       initialized to the point where it can load classes in modules other than
13514       <code>java.base</code>, or even arbitrary classes in <code>java.base</code>.
13515       Agents that do load-time instrumentation in this
13516       phase must take great care when instrumenting code that potentially
13517       executes in this phase. Extreme care should also be taken with JNI
13518       <code>FindClass</code> as it may not be possible to load classes and attempts
13519       to do so may result in unpredictable behavior, maybe even stability issues
13520       on some VM implementations.
13521       If the capability has not been added then the VM delays posting this
13522       event until it is capable of loading classes in modules other than
13523       <code>java.base</code> or the VM has completed its initialization.
13524       Agents that create more than one JVM TI environment, where the
13525       capability is added to some but not all environments, may observe the
13526       start phase beginning earlier in the JVM TI environments that possess
13527       the capability.
13528       <p/>
13529       In the case of VM start-up failure, this event will not be sent.
13530     </description>
13531     <origin>jvmdi</origin>
13532     <capabilities>
13533     </capabilities>
13534     <parameters>
13535       <param id="jni_env">
13536         <outptr>
13537           <struct>JNIEnv</struct>
13538         </outptr>
13539           <description>
13540             The JNI environment of the event (current) thread.
13541           </description>
13542       </param>
13543     </parameters>
13544   </event>
13545 
13546   <event label="VM Initialization Event"
13547          id="VMInit" const="JVMTI_EVENT_VM_INIT" num="50">
13548     <description>
13549       The VM initialization event signals the completion of VM initialization. Once
13550       this event is generated, the agent is free to call any JNI or <jvmti/>
13551       function. The VM initialization event can be preceded by or can be concurrent
13552       with other events, but
13553       the preceding events should be handled carefully, if at all, because the
13554       VM has not completed its initialization. The thread start event for the
13555       main application thread is guaranteed not to occur until after the
13556       handler for the VM initialization event returns.
13557       <p/>
13558       In the case of VM start-up failure, this event will not be sent.
13559     </description>
13560     <origin>jvmdi</origin>
13561     <capabilities>
13562     </capabilities>
13563     <parameters>
13564       <param id="jni_env">
13565         <outptr>
13566           <struct>JNIEnv</struct>
13567         </outptr>
13568           <description>
13569             The JNI environment of the event (current) thread.
13570           </description>
13571       </param>
13572       <param id="thread">
13573         <jthread/>
13574           <description>
13575             The initial thread
13576           </description>
13577       </param>
13578     </parameters>
13579   </event>
13580 
13581   <event label="VM Death Event"
13582          id="VMDeath" const="JVMTI_EVENT_VM_DEATH" num="51">
13583     <description>
13584       The VM death event notifies the agent of the termination of the VM.
13585       No events will occur after the VMDeath event.
13586       <p/>
13587       In the case of VM start-up failure, this event will not be sent.
13588       Note that <internallink id="onunload">Agent_OnUnload</internallink>
13589       will still be called in these cases.
13590     </description>
13591     <origin>jvmdi</origin>
13592     <capabilities>
13593     </capabilities>
13594     <parameters>
13595       <param id="jni_env">
13596         <outptr>
13597           <struct>JNIEnv</struct>
13598         </outptr>
13599           <description>
13600             The JNI environment of the event (current) thread
13601           </description>
13602       </param>
13603     </parameters>
13604   </event>
13605 
13606   <event label="Compiled Method Load" phase="start"
13607          id="CompiledMethodLoad" const="JVMTI_EVENT_COMPILED_METHOD_LOAD" num="68">
13608     <description>
13609       Sent when a method is compiled and loaded into memory by the VM.
13610       If it is unloaded, the <eventlink id="CompiledMethodUnload"/> event is sent.
13611       If it is moved, the <eventlink id="CompiledMethodUnload"/> event is sent,
13612       followed by a new <code>CompiledMethodLoad</code> event.
13613       Note that a single method may have multiple compiled forms, and that
13614       this event will be sent for each form.
13615       Note also that several methods may be inlined into a single
13616       address range, and that this event will be sent for each method.
13617       <p/>
13618       These events can be sent after their initial occurrence with
13619       <functionlink id="GenerateEvents"></functionlink>.
13620     </description>
13621     <origin>jvmpi</origin>
13622     <typedef id="jvmtiAddrLocationMap" label="Native address to location entry">
13623       <field id="start_address">
13624         <vmbuf><void/></vmbuf>
13625         <description>
13626           Starting native address of code corresponding to a location
13627         </description>
13628       </field>
13629       <field id="location">
13630         <jlocation/>
13631         <description>
13632           Corresponding location. See
13633           <functionlink id="GetJLocationFormat"></functionlink>
13634           for the meaning of location.
13635         </description>
13636       </field>
13637     </typedef>
13638     <capabilities>
13639       <required id="can_generate_compiled_method_load_events"></required>
13640     </capabilities>
13641     <parameters>
13642       <param id="klass">
13643         <jclass method="method"/>
13644           <description>
13645             Class of the method being compiled and loaded
13646           </description>
13647       </param>
13648       <param id="method">
13649         <jmethodID class="klass"/>
13650           <description>
13651             Method being compiled and loaded
13652           </description>
13653       </param>
13654       <param id="code_size">
13655         <jint/>
13656         <description>
13657           Size of compiled code
13658         </description>
13659       </param>
13660       <param id="code_addr">
13661         <vmbuf><void/></vmbuf>
13662         <description>
13663           Address where compiled method code is loaded
13664         </description>
13665       </param>
13666       <param id="map_length">
13667         <jint/>
13668         <description>
13669           Number of <typelink id="jvmtiAddrLocationMap"></typelink>
13670           entries in the address map.
13671           Zero if mapping information cannot be supplied.
13672         </description>
13673       </param>
13674       <param id="map">
13675         <vmbuf><struct>jvmtiAddrLocationMap</struct></vmbuf>
13676         <description>
13677           Map from native addresses to location.
13678           The native address range of each entry is from
13679           <fieldlink id="start_address" struct="jvmtiAddrLocationMap"></fieldlink>
13680           to <code>start_address-1</code> of the next entry.
13681           <code>NULL</code> if mapping information cannot be supplied.
13682         </description>
13683       </param>
13684       <param id="compile_info">
13685         <vmbuf><void/></vmbuf>
13686         <description>
13687           VM-specific compilation information.
13688           The referenced compile information is managed by the VM
13689           and must not depend on the agent for collection.
13690           A VM implementation defines the content and lifetime
13691           of the information.
13692         </description>
13693       </param>
13694     </parameters>
13695   </event>
13696 
13697   <event label="Compiled Method Unload" phase="start"
13698          id="CompiledMethodUnload" const="JVMTI_EVENT_COMPILED_METHOD_UNLOAD" num="69">
13699     <description>
13700       Sent when a compiled method is unloaded from memory.
13701       This event might not be sent on the thread which performed the unload.
13702       This event may be sent sometime after the unload occurs, but
13703       will be sent before the memory is reused
13704       by a newly generated compiled method. This event may be sent after
13705       the class is unloaded.
13706     </description>
13707     <origin>jvmpi</origin>
13708     <capabilities>
13709       <required id="can_generate_compiled_method_load_events"></required>
13710     </capabilities>
13711     <parameters>
13712       <param id="klass">
13713         <jclass method="method"/>
13714           <description>
13715             Class of the compiled method being unloaded.
13716           </description>
13717       </param>
13718       <param id="method">
13719         <jmethodID class="klass"/>
13720           <description>
13721             Compiled method being unloaded.
13722             For identification of the compiled method only -- the class
13723             may be unloaded and therefore the method should not be used
13724             as an argument to further JNI or <jvmti/> functions.
13725           </description>
13726       </param>
13727       <param id="code_addr">
13728         <vmbuf><void/></vmbuf>
13729         <description>
13730           Address where compiled method code was loaded.
13731           For identification of the compiled method only --
13732           the space may have been reclaimed.
13733         </description>
13734       </param>
13735     </parameters>
13736   </event>
13737 
13738   <event label="Dynamic Code Generated" phase="any"
13739          id="DynamicCodeGenerated" const="JVMTI_EVENT_DYNAMIC_CODE_GENERATED" num="70">
13740     <description>
13741       Sent when a component of the virtual machine is generated dynamically.
13742       This does not correspond to Java programming language code that is
13743       compiled--see <eventlink id="CompiledMethodLoad"></eventlink>.
13744       This is for native code--for example, an interpreter that is generated
13745       differently depending on command-line options.
13746       <p/>
13747       Note that this event has no controlling capability.
13748       If a VM cannot generate these events, it simply does not send any.
13749       <p/>
13750       These events can be sent after their initial occurrence with
13751       <functionlink id="GenerateEvents"></functionlink>.
13752     </description>
13753     <origin>jvmpi</origin>
13754     <capabilities>
13755     </capabilities>
13756     <parameters>
13757       <param id="name">
13758         <vmbuf><char/></vmbuf>
13759         <description>
13760           Name of the code, encoded as a
13761           <internallink id="mUTF">modified UTF-8</internallink> string.
13762           Intended for display to an end-user.
13763           The name might not be unique.
13764         </description>
13765       </param>
13766       <param id="address">
13767         <vmbuf><void/></vmbuf>
13768         <description>
13769           Native address of the code
13770         </description>
13771       </param>
13772       <param id="length">
13773         <jint/>
13774         <description>
13775           Length in bytes of the code
13776         </description>
13777       </param>
13778     </parameters>
13779   </event>
13780 
13781   <event label="Data Dump Request"
13782          id="DataDumpRequest" const="JVMTI_EVENT_DATA_DUMP_REQUEST" num="71">
13783     <description>
13784       Sent by the VM to request the agent to dump its data.  This
13785       is just a hint and the agent need not react to this event.
13786       This is useful for processing command-line signals from users.  For
13787       example, in the Java 2 SDK a CTRL-Break on Win32 and a CTRL-\ on Solaris
13788       causes the VM to send this event to the agent.
13789     </description>
13790     <origin>jvmpi</origin>
13791     <capabilities>
13792     </capabilities>
13793     <parameters>
13794     </parameters>
13795   </event>
13796 
13797   <event label="Monitor Contended Enter"
13798          id="MonitorContendedEnter" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTER" filtered="thread" num="75">
13799     <description>
13800       Sent when a thread is attempting to enter a Java programming language
13801       monitor already acquired by another thread.
13802     </description>
13803     <origin>jvmpi</origin>
13804     <capabilities>
13805       <required id="can_generate_monitor_events"></required>
13806     </capabilities>
13807     <parameters>
13808       <param id="jni_env">
13809         <outptr>
13810           <struct>JNIEnv</struct>
13811         </outptr>
13812           <description>
13813             The JNI environment of the event (current) thread
13814           </description>
13815       </param>
13816       <param id="thread">
13817         <jthread/>
13818           <description>
13819             JNI local reference to the thread
13820             attempting to enter the monitor
13821           </description>
13822       </param>
13823       <param id="object">
13824         <jobject/>
13825           <description>
13826             JNI local reference to the monitor
13827           </description>
13828       </param>
13829     </parameters>
13830   </event>
13831 
13832   <event label="Monitor Contended Entered"
13833          id="MonitorContendedEntered" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTERED" filtered="thread" num="76">
13834     <description>
13835       Sent when a thread enters a Java programming language
13836       monitor after waiting for it to be released by another thread.
13837     </description>
13838     <origin>jvmpi</origin>
13839     <capabilities>
13840       <required id="can_generate_monitor_events"></required>
13841     </capabilities>
13842     <parameters>
13843       <param id="jni_env">
13844         <outptr>
13845           <struct>JNIEnv</struct>
13846         </outptr>
13847           <description>
13848             The JNI environment of the event (current) thread
13849           </description>
13850       </param>
13851       <param id="thread">
13852         <jthread/>
13853           <description>
13854             JNI local reference to the thread entering
13855             the monitor
13856           </description>
13857       </param>
13858       <param id="object">
13859         <jobject/>
13860           <description>
13861             JNI local reference to the monitor
13862           </description>
13863       </param>
13864     </parameters>
13865   </event>
13866 
13867   <event label="Monitor Wait"
13868          id="MonitorWait" const="JVMTI_EVENT_MONITOR_WAIT" filtered="thread" num="73">
13869     <description>
13870       Sent when a thread is about to wait on an object.
13871     </description>
13872     <origin>jvmpi</origin>
13873     <capabilities>
13874       <required id="can_generate_monitor_events"></required>
13875     </capabilities>
13876     <parameters>
13877       <param id="jni_env">
13878         <outptr>
13879           <struct>JNIEnv</struct>
13880         </outptr>
13881           <description>
13882             The JNI environment of the event (current) thread
13883           </description>
13884       </param>
13885       <param id="thread">
13886         <jthread/>
13887           <description>
13888             JNI local reference to the thread about to wait
13889           </description>
13890       </param>
13891       <param id="object">
13892         <jobject/>
13893           <description>
13894             JNI local reference to the monitor
13895           </description>
13896       </param>
13897       <param id="timeout">
13898         <jlong/>
13899         <description>
13900           The number of milliseconds the thread will wait
13901         </description>
13902       </param>
13903     </parameters>
13904   </event>
13905 
13906   <event label="Monitor Waited"
13907          id="MonitorWaited" const="JVMTI_EVENT_MONITOR_WAITED" filtered="thread" num="74">
13908     <description>
13909       Sent when a thread finishes waiting on an object.
13910     </description>
13911     <origin>jvmpi</origin>
13912     <capabilities>
13913       <required id="can_generate_monitor_events"></required>
13914     </capabilities>
13915     <parameters>
13916       <param id="jni_env">
13917         <outptr>
13918           <struct>JNIEnv</struct>
13919         </outptr>
13920           <description>
13921             The JNI environment of the event (current) thread
13922           </description>
13923       </param>
13924       <param id="thread">
13925         <jthread/>
13926           <description>
13927             JNI local reference to the thread that was finished waiting
13928           </description>
13929       </param>
13930       <param id="object">
13931         <jobject/>
13932           <description>
13933             JNI local reference to the monitor.
13934           </description>
13935       </param>
13936       <param id="timed_out">
13937         <jboolean/>
13938         <description>
13939           True if the monitor timed out
13940         </description>
13941       </param>
13942     </parameters>
13943   </event>
13944 
13945   <event label="Resource Exhausted"
13946          id="ResourceExhausted" const="JVMTI_EVENT_RESOURCE_EXHAUSTED" num="80"
13947          since="1.1">
13948     <description>
13949       Sent when a VM resource needed by a running application has been exhausted.
13950       Except as required by the optional capabilities, the set of resources
13951       which report exhaustion is implementation dependent.
13952       <p/>
13953       The following bit flags define the properties of the resource exhaustion:
13954       <constants id="jvmtiResourceExhaustionFlags"
13955                  label="Resource Exhaustion Flags"
13956                  kind="bits"
13957                  since="1.1">
13958         <constant id="JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR" num="0x0001">
13959           After this event returns, the VM will throw a
13960           <code>java.lang.OutOfMemoryError</code>.
13961         </constant>
13962         <constant id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP" num="0x0002">
13963           The VM was unable to allocate memory from the <tm>Java</tm>
13964           platform <i>heap</i>.
13965           The <i>heap</i> is the runtime
13966           data area from which memory for all class instances and
13967           arrays are allocated.
13968         </constant>
13969         <constant id="JVMTI_RESOURCE_EXHAUSTED_THREADS" num="0x0004">
13970           The VM was unable to create a thread.
13971         </constant>
13972       </constants>
13973     </description>
13974     <origin>new</origin>
13975     <capabilities>
13976       <capability id="can_generate_resource_exhaustion_heap_events">
13977         Can generate events when the VM is unable to allocate memory from the
13978         <internallink id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP">heap</internallink>.
13979       </capability>
13980       <capability id="can_generate_resource_exhaustion_threads_events">
13981         Can generate events when the VM is unable to
13982         <internallink id="JVMTI_RESOURCE_EXHAUSTED_THREADS">create
13983         a thread</internallink>.
13984       </capability>
13985     </capabilities>
13986     <parameters>
13987       <param id="jni_env">
13988         <outptr>
13989           <struct>JNIEnv</struct>
13990         </outptr>
13991           <description>
13992             The JNI environment of the event (current) thread
13993           </description>
13994       </param>
13995       <param id="flags">
13996         <jint/>
13997         <description>
13998           Flags defining the properties of the of resource exhaustion
13999           as specified by the
14000           <internallink id="jvmtiResourceExhaustionFlags">Resource
14001           Exhaustion Flags</internallink>.
14002           </description>
14003         </param>
14004       <param id="reserved">
14005         <vmbuf><void/></vmbuf>
14006         <description>
14007           Reserved.
14008         </description>
14009       </param>
14010       <param id="description">
14011         <vmbuf><char/></vmbuf>
14012         <description>
14013           Description of the resource exhaustion, encoded as a
14014           <internallink id="mUTF">modified UTF-8</internallink> string.
14015         </description>
14016       </param>
14017     </parameters>
14018   </event>
14019 
14020   <event label="VM Object Allocation"
14021          id="VMObjectAlloc" const="JVMTI_EVENT_VM_OBJECT_ALLOC" num="84">
14022     <description>
14023       Sent when a method causes the virtual machine to directly allocate an
14024       Object visible to Java programming language code.
14025       Generally object allocation should be detected by instrumenting
14026       the bytecodes of allocating methods.
14027       Object allocation generated in native code by JNI function
14028       calls should be detected using
14029       <internallink id="jniIntercept">JNI function interception</internallink>.
14030       Some methods might not have associated bytecodes and are not
14031       native methods, they instead are executed directly by the
14032       VM. These methods should send this event.
14033       Virtual machines which are incapable of bytecode instrumentation
14034       for some or all of their methods can send this event.
14035 
14036       Note that the <internallink
14037       id="SampledObjectAlloc">SampledObjectAlloc</internallink>
14038       event is triggered on all Java object allocations, including those
14039       caused by bytecode method execution, JNI method execution, and
14040       directly by VM methods.
14041       <p/>
14042       Typical examples where this event might be sent:
14043       <ul>
14044         <li>Reflection -- for example, <code>java.lang.Class.newInstance()</code></li>
14045         <li>Methods not represented by bytecodes -- for example, VM intrinsics and
14046             J2ME preloaded classes</li>
14047       </ul>
14048       Cases where this event would not be generated:
14049       <ul>
14050         <li>Allocation due to bytecodes -- for example, the <code>new</code>
14051             and <code>newarray</code> VM instructions</li>
14052         <li>Allocation due to JNI function calls -- for example,
14053             <code>AllocObject</code></li>
14054         <li>Allocations during VM initialization</li>
14055         <li>VM internal objects</li>
14056       </ul>
14057     </description>
14058     <origin>new</origin>
14059     <capabilities>
14060       <required id="can_generate_vm_object_alloc_events"></required>
14061     </capabilities>
14062     <parameters>
14063       <param id="jni_env">
14064         <outptr>
14065           <struct>JNIEnv</struct>
14066         </outptr>
14067           <description>
14068             The JNI environment of the event (current) thread
14069           </description>
14070       </param>
14071       <param id="thread">
14072         <jthread/>
14073           <description>
14074             Thread allocating the object.
14075           </description>
14076       </param>
14077       <param id="object">
14078         <jobject/>
14079           <description>
14080             JNI local reference to the object that was allocated.
14081           </description>
14082       </param>
14083       <param id="object_klass">
14084         <jclass/>
14085           <description>
14086             JNI local reference to the class of the object.
14087           </description>
14088       </param>
14089       <param id="size">
14090         <jlong/>
14091         <description>
14092             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
14093         </description>
14094       </param>
14095     </parameters>
14096   </event>
14097 
14098   <event label="Sampled Object Allocation"
14099     id="SampledObjectAlloc" const="JVMTI_EVENT_SAMPLED_OBJECT_ALLOC" filtered="thread" num="86" since="11">
14100     <description>
14101       Sent when an allocated object is sampled.
14102       By default, the sampling interval is set to 512KB. The sampling is semi-random to avoid
14103       pattern-based bias and provides an approximate overall average interval over long periods of
14104       sampling.
14105       <p/>
14106       Each thread tracks how many bytes it has allocated since it sent the last event.
14107       When the number of bytes exceeds the sampling interval, it will send another event.
14108       This implies that, on average, one object will be sampled every time a thread has
14109       allocated 512KB bytes since the last sample.
14110       <p/>
14111       Note that the sampler is pseudo-random: it will not sample every 512KB precisely.
14112       The goal of this is to ensure high quality sampling even if allocation is
14113       happening in a fixed pattern (i.e., the same set of objects are being allocated
14114       every 512KB).
14115       <p/>
14116       If another sampling interval is required, the user can call
14117       <functionlink id="SetHeapSamplingInterval"></functionlink> with a strictly positive integer value,
14118       representing the new sampling interval.
14119       <p/>
14120       This event is sent once the sampled allocation has been performed.  It provides the object, stack trace
14121       of the allocation, the thread allocating, the size of allocation, and the object's class.
14122       <p/>
14123       A typical use case of this system is to determine where heap allocations originate.
14124       In conjunction with weak references and the function
14125       <functionlink id="GetStackTrace"></functionlink>, a user can track which objects were allocated from which
14126       stack trace, and which are still live during the execution of the program.
14127     </description>
14128     <origin>new</origin>
14129     <capabilities>
14130       <required id="can_generate_sampled_object_alloc_events"></required>
14131     </capabilities>
14132     <parameters>
14133       <param id="jni_env">
14134         <outptr>
14135           <struct>JNIEnv</struct>
14136         </outptr>
14137         <description>
14138           The JNI environment of the event (current) thread.
14139         </description>
14140       </param>
14141       <param id="thread">
14142         <jthread/>
14143         <description>
14144           Thread allocating the object.
14145         </description>
14146       </param>
14147       <param id="object">
14148         <jobject/>
14149         <description>
14150           JNI local reference to the object that was allocated.
14151         </description>
14152       </param>
14153       <param id="object_klass">
14154         <jclass/>
14155         <description>
14156           JNI local reference to the class of the object
14157         </description>
14158       </param>
14159       <param id="size">
14160         <jlong/>
14161         <description>
14162           Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
14163         </description>
14164       </param>
14165     </parameters>
14166   </event>
14167 
14168   <event label="Object Free"
14169         id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83">
14170     <description>
14171       An Object Free event is sent when the garbage collector frees an object.
14172       Events are only sent for tagged objects--see
14173       <internallink id="Heap">heap functions</internallink>.
14174       <p/>
14175       The event handler must not use JNI functions and
14176       must not use <jvmti/> functions except those which
14177       specifically allow such use (see the raw monitor, memory management,
14178       and environment local storage functions).
14179     </description>
14180     <origin>new</origin>
14181     <capabilities>
14182       <required id="can_generate_object_free_events"></required>
14183     </capabilities>
14184     <parameters>
14185       <param id="tag">
14186         <jlong/>
14187         <description>
14188           The freed object's tag
14189         </description>        
14190       </param>
14191     </parameters>
14192   </event>
14193 
14194   <event label="Garbage Collection Start"
14195          id="GarbageCollectionStart" const="JVMTI_EVENT_GARBAGE_COLLECTION_START" num="81">
14196     <description>
14197       A Garbage Collection Start event is sent when a
14198       garbage collection pause begins.
14199       Only stop-the-world collections are reported--that is, collections during
14200       which all threads cease to modify the state of the Java virtual machine.
14201       This means that some collectors will never generate these events.
14202       This event is sent while the VM is still stopped, thus
14203       the event handler must not use JNI functions and
14204       must not use <jvmti/> functions except those which
14205       specifically allow such use (see the raw monitor, memory management,
14206       and environment local storage functions).
14207       <p/>
14208       This event is always sent as a matched pair with
14209       <eventlink id="GarbageCollectionFinish"/>
14210       (assuming both events are enabled) and no garbage collection
14211       events will occur between them.
14212     </description>
14213     <origin>new</origin>
14214     <capabilities>
14215       <required id="can_generate_garbage_collection_events"></required>
14216     </capabilities>
14217     <parameters>
14218     </parameters>
14219   </event>
14220 
14221   <event label="Garbage Collection Finish"
14222          id="GarbageCollectionFinish" const="JVMTI_EVENT_GARBAGE_COLLECTION_FINISH" num="82">
14223     <description>
14224       A Garbage Collection Finish event is sent when a
14225       garbage collection pause ends.
14226       This event is sent while the VM is still stopped, thus
14227       the event handler must not use JNI functions and
14228       must not use <jvmti/> functions except those which
14229       specifically allow such use (see the raw monitor, memory management,
14230       and environment local storage functions).
14231       <p/>
14232       Some agents may need to do post garbage collection operations that
14233       require the use of the disallowed <jvmti/> or JNI functions. For these
14234       cases an agent thread can be created which waits on a raw monitor,
14235       and the handler for the Garbage Collection Finish event simply
14236       notifies the raw monitor
14237       <p/>
14238       This event is always sent as a matched pair with
14239       <eventlink id="GarbageCollectionStart"/> (assuming both events are enabled).
14240       <issue>
14241         The most important use of this event is to provide timing information,
14242         and thus additional information is not required.  However,
14243         information about the collection which is "free" should be included -
14244         what that information is needs to be determined.
14245       </issue>
14246     </description>
14247     <origin>new</origin>
14248     <capabilities>
14249       <required id="can_generate_garbage_collection_events"></required>
14250     </capabilities>
14251     <parameters>
14252     </parameters>
14253   </event>
14254 
14255   <elide>
14256   <event label="Verbose Output" phase="any"
14257          id="VerboseOutput" const="JVMTI_EVENT_VERBOSE_OUTPUT" num="85">
14258     <description>
14259       Send verbose messages as strings.
14260         <issue>
14261           This format is extremely fragile, as it can change with each
14262           platform, collector and version.  Alternatives include:
14263           <ul>
14264             <li>building off Java programming language M and M APIs</li>
14265             <li>XML</li>
14266             <li>key/value pairs</li>
14267             <li>removing it</li>
14268           </ul>
14269         </issue>
14270         <issue>
14271           Though this seemed trivial to implement.
14272           In the RI it appears this will be quite complex.
14273         </issue>
14274     </description>
14275     <origin>new</origin>
14276     <capabilities>
14277     </capabilities>
14278     <parameters>
14279       <param id="flag">
14280         <enum>jvmtiVerboseFlag</enum>
14281         <description>
14282           Which verbose output is being sent.
14283         </description>
14284       </param>
14285       <param id="message">
14286         <vmbuf><char/></vmbuf>
14287         <description>
14288           Message text, encoded as a
14289           <internallink id="mUTF">modified UTF-8</internallink> string.
14290         </description>
14291       </param>
14292     </parameters>
14293   </event>
14294   </elide>
14295 
14296 </eventsection>
14297 
14298 <datasection>
14299   <intro>
14300     <jvmti/> extends the data types defined by JNI.
14301   </intro>
14302   <basetypes id="jniTypes" label="JNI Types Used in the JVM Tool Interface">
14303     <basetype id="jboolean">
14304       <description>
14305         Holds a Java programming language <code>boolean</code>.
14306         Unsigned 8 bits.
14307       </description>
14308     </basetype>
14309     <basetype id="jchar">
14310       <description>
14311         Holds a Java programming language <code>char</code>.
14312         Unsigned 16 bits.
14313       </description>
14314     </basetype>
14315     <basetype id="jint">
14316       <description>
14317         Holds a Java programming language <code>int</code>.
14318         Signed 32 bits.
14319       </description>
14320     </basetype>
14321     <basetype id="jlong">
14322       <description>
14323         Holds a Java programming language <code>long</code>.
14324         Signed 64 bits.
14325       </description>
14326     </basetype>
14327     <basetype id="jfloat">
14328       <description>
14329         Holds a Java programming language <code>float</code>.
14330         32 bits.
14331       </description>
14332     </basetype>
14333     <basetype id="jdouble">
14334       <description>
14335         Holds a Java programming language <code>double</code>.
14336         64 bits.
14337       </description>
14338     </basetype>
14339     <basetype id="jobject">
14340       <description>
14341         Holds a Java programming language object.
14342       </description>
14343     </basetype>
14344     <basetype id="jclass">
14345       <description>
14346         Holds a Java programming language class.
14347       </description>
14348     </basetype>
14349     <basetype id="jvalue">
14350       <description>
14351         Is a union of all primitive types and <code>jobject</code>.  Thus, holds any Java
14352         programming language value.
14353       </description>
14354     </basetype>
14355     <basetype id="jfieldID">
14356       <description>
14357         Identifies a Java programming language field.
14358         <code>jfieldID</code>s returned by <jvmti/> functions and events may be
14359         safely stored.
14360       </description>
14361     </basetype>
14362     <basetype id="jmethodID">
14363       <description>
14364         Identifies a Java programming language method, initializer, or constructor.
14365         <code>jmethodID</code>s returned by <jvmti/> functions and events may be
14366         safely stored.  However, if the class is unloaded, they become invalid
14367         and must not be used.
14368       </description>
14369     </basetype>
14370     <basetype id="JNIEnv">
14371       <description>
14372         Pointer to the JNI function table.  Pointer to this (<code>JNIEnv *</code>)
14373         is a JNI environment.
14374       </description>
14375     </basetype>
14376   </basetypes>
14377 
14378   <basetypes id="jvmtiTypes" label="JVM Tool Interface Base Types">
14379     <basetype id="jvmtiEnv">
14380       <description>
14381         The <jvmti/> <internallink id="environments">environment</internallink> pointer.
14382         See the <internallink id="FunctionSection">Function Section</internallink>.
14383         <code>jvmtiEnv</code> points to the
14384         <internallink id="FunctionTable">function table</internallink> pointer.
14385       </description>
14386     </basetype>
14387     <basetype id="jthread">
14388       <definition>typedef jobject jthread;</definition>
14389       <description>
14390         Subtype of <datalink id="jobject"></datalink> that holds a thread.
14391       </description>
14392     </basetype>
14393     <basetype id="jthreadGroup">
14394       <definition>typedef jobject jthreadGroup;</definition>
14395       <description>
14396         Subtype of <datalink id="jobject"></datalink> that holds a thread group.
14397       </description>
14398     </basetype>
14399     <basetype id="jlocation">
14400       <definition>typedef jlong jlocation;</definition>
14401       <description>
14402         A 64 bit value, representing a monotonically increasing
14403         executable position within a method.
14404         <code>-1</code> indicates a native method.
14405         See <functionlink id="GetJLocationFormat"></functionlink> for the format on a
14406         given VM.
14407       </description>
14408     </basetype>
14409     <basetype id="jrawMonitorID">
14410       <definition>struct _jrawMonitorID;
14411 typedef struct _jrawMonitorID *jrawMonitorID;</definition>
14412       <description>
14413         A raw monitor.
14414       </description>
14415     </basetype>
14416     <basetype id="jvmtiError">
14417       <description>
14418         Holds an error return code.
14419         See the <internallink id="ErrorSection">Error section</internallink> for possible values.
14420         <example>
14421 typedef enum {
14422     JVMTI_ERROR_NONE = 0,
14423     JVMTI_ERROR_INVALID_THREAD = 10,
14424       ...
14425 } jvmtiError;
14426 </example>
14427       </description>
14428     </basetype>
14429     <basetype id="jvmtiEvent">
14430       <description>
14431         An identifier for an event type.
14432         See the <internallink id="EventSection">Event section</internallink> for possible values.
14433         It is guaranteed that future versions of this specification will
14434         never assign zero as an event type identifier.
14435 <example>
14436 typedef enum {
14437     JVMTI_EVENT_SINGLE_STEP = 1,
14438     JVMTI_EVENT_BREAKPOINT = 2,
14439       ...
14440 } jvmtiEvent;
14441 </example>
14442       </description>
14443     </basetype>
14444     <basetype id="jvmtiEventCallbacks" name="eventCallbacks">
14445       <description>
14446         The callbacks used for events.
14447 <example>
14448 typedef struct {
14449     jvmtiEventVMInit VMInit;
14450     jvmtiEventVMDeath VMDeath;
14451       ...
14452 } jvmtiEventCallbacks;
14453 </example>
14454         See <internallink id="jvmtiEventCallbacks">event callbacks</internallink>
14455         for the complete structure.
14456         <p/>
14457         Where, for example, the VM initialization callback is defined:
14458 <example>
14459 typedef void (JNICALL *jvmtiEventVMInit)
14460     (jvmtiEnv *jvmti_env,
14461      JNIEnv* jni_env,
14462      jthread thread);
14463 </example>
14464         See the individual events for the callback function definition.
14465       </description>
14466     </basetype>
14467     <basetype id="jniNativeInterface">
14468       <definition>typedef struct JNINativeInterface_ jniNativeInterface;</definition>
14469       <description>
14470         Typedef for the JNI function table <code>JNINativeInterface</code>
14471         defined in the
14472         <externallink id="jni/functions.html#interface-function-table">
14473           JNI Specification</externallink>.
14474         The JNI reference implementation defines this with an underscore.
14475       </description>
14476     </basetype>
14477   </basetypes>
14478 
14479 </datasection>
14480 
14481 <issuessection label="Issues">
14482   <intro id="suspendRequired" label="Resolved Issue: Suspend - Required or Automatic">
14483     JVMDI requires that the agent suspend threads before calling
14484     certain sensitive functions.  JVMPI requires garbage collection to be
14485     disabled before calling certain sensitive functions.
14486     It was suggested that rather than have this requirement, that
14487     VM place itself in a suitable state before performing an
14488     operation.  This makes considerable sense since each VM
14489     knows its requirements and can most easily arrange a
14490     safe state.
14491     <p/>
14492     The ability to externally suspend/resume threads will, of
14493     course, remain.  The ability to enable/disable garbage collection will not.
14494     <p/>
14495     This issue is resolved--suspend will not
14496     be required.  The spec has been updated to reflect this.
14497   </intro>
14498 
14499   <intro id="stackSampling" label="Resolved Issue: Call Stack Sampling">
14500     There are a variety of approaches to sampling call stacks.
14501     The biggest bifurcation is between VM controlled and agent
14502     controlled.
14503     <p/>
14504     This issue is resolved--agent controlled
14505     sampling will be the approach.
14506   </intro>
14507 
14508   <intro id="threadRepresentation" label="Resolved Issue: Thread Representation">
14509     JVMDI represents threads as jthread.  JVMPI primarily
14510     uses JNIEnv* to represent threads.
14511     <p/>
14512     The Expert Group has chosen jthread as the representation
14513     for threads in <jvmti/>.
14514     JNIEnv* is sent by
14515     events since it is needed to JNI functions.  JNIEnv, per the
14516     JNI spec, are not supposed to be used outside their thread.
14517   </intro>
14518 
14519   <intro id="design" label="Resolved Issue: Method Representation">
14520     The JNI spec allows an implementation to depend on jclass/jmethodID
14521     pairs, rather than simply a jmethodID, to reference a method.
14522     JVMDI, for consistency, choose the same representation.
14523     JVMPI, however, specifies that a jmethodID alone maps to a
14524     method.  Both of the Sun <tm>J2SE</tm> virtual machines (Classic and <tm>HotSpot</tm>) store
14525     pointers in jmethodIDs, and as a result, a jmethodID is sufficient.
14526     In fact, any JVM implementation that supports JVMPI must have
14527     such a representation.
14528     <jvmti/> will use jmethodID as a unique representation of a method
14529     (no jclass is used).
14530     There should be efficiency gains, particularly in
14531     functionality like stack dumping, to this representation.
14532     <p/>
14533     Note that fields were not used in JVMPI and that the access profile
14534     of fields differs from methods--for implementation efficiency
14535     reasons, a jclass/jfieldID pair will still be needed for field
14536     reference.
14537   </intro>
14538 
14539   <intro id="localReferenceIssue" label="Resolved Issue: Local References">
14540     Functions return local references.
14541   </intro>
14542 
14543   <intro id="frameRep" label="Resolved Issue: Representation of frames">
14544     In JVMDI, a frame ID is used to represent a frame.  Problem with this
14545     is that a VM must track when a frame becomes invalid, a far better
14546     approach, and the one used in <jvmti/>, is to reference frames by depth.
14547   </intro>
14548 
14549   <intro id="requiredCapabilities" label="Issue: Required Capabilities">
14550     Currently, having a required capabilities means that the functionality
14551     is optional.   Capabilities are useful even for required functionality
14552     since they can inform the VM is needed set-up.  Thus, there should be
14553     a set of capabilities that a conformant implementation must provide
14554     (if requested during Agent_OnLoad).
14555   </intro>
14556 
14557   <intro id="taghint" label="Proposal: add tag hint function">
14558     A hint of the percentage of objects that will be tagged would
14559     help the VM pick a good implementation.
14560   </intro>
14561 
14562   <intro id="moreMonitorQueries" label="Request: More Monitor Quires">
14563   How difficult or easy would be to extend the monitor_info category to include
14564     <pre>
14565   - current number of monitors
14566   - enumeration of monitors
14567   - enumeration of threads waiting on a given monitor
14568     </pre>
14569   The reason for my question is the fact that current get_monitor_info support
14570   requires the agent to specify a given thread to get the info which is probably
14571   OK in the profiling/debugging space, while in the monitoring space the agent
14572   could be watching the monitor list and then decide which thread to ask for
14573   the info. You might ask why is this important for monitoring .... I think it
14574   can aid in the detection/prediction of application contention caused by hot-locks.
14575   </intro>
14576 </issuessection>
14577 
14578 <changehistory id="ChangeHistory" update="09/05/07">
14579   <intro>
14580     The <jvmti/> specification is an evolving document with major, minor,
14581     and micro version numbers.
14582     A released version of the specification is uniquely identified
14583     by its major and minor version.
14584     The functions, events, and capabilities in this specification
14585     indicate a "Since" value which is the major and minor version in
14586     which it was introduced.
14587     The version of the specification implemented by the VM can
14588     be retrieved at runtime with the <functionlink id="GetVersionNumber"/>
14589     function.
14590   </intro>
14591   <change date="14 Nov 2002">
14592     Converted to XML document.
14593   </change>
14594   <change date="14 Nov 2002">
14595     Elided heap dump functions (for now) since what was there
14596     was wrong.
14597   </change>
14598   <change date="18 Nov 2002">
14599     Added detail throughout.
14600   </change>
14601   <change date="18 Nov 2002">
14602     Changed JVMTI_THREAD_STATUS_RUNNING to JVMTI_THREAD_STATUS_RUNNABLE.
14603   </change>
14604   <change date="19 Nov 2002">
14605     Added AsyncGetStackTrace.
14606   </change>
14607   <change date="19 Nov 2002">
14608     Added jframeID return to GetStackTrace.
14609   </change>
14610   <change date="19 Nov 2002">
14611     Elided GetCurrentFrame and GetCallingFrame functions (for now) since what was there
14612     since they are redundant with GetStackTrace.
14613   </change>
14614   <change date="19 Nov 2002">
14615     Elided ClearAllBreakpoints since it has always been redundant.
14616   </change>
14617   <change date="19 Nov 2002">
14618     Added GetSystemProperties.
14619   </change>
14620   <change date="19 Nov 2002">
14621     Changed the thread local storage functions to use jthread.
14622   </change>
14623   <change date="20 Nov 2002">
14624     Added GetJLocationFormat.
14625   </change>
14626   <change date="22 Nov 2002">
14627     Added events and introductory text.
14628   </change>
14629   <change date="22 Nov 2002">
14630     Cross reference type and constant definitions.
14631   </change>
14632   <change date="24 Nov 2002">
14633     Added DTD.
14634   </change>
14635   <change date="24 Nov 2002">
14636     Added capabilities function section.
14637   </change>
14638   <change date="29 Nov 2002">
14639     Assign capabilities to each function and event.
14640   </change>
14641   <change date="29 Nov 2002">
14642     Add <internallink id="jniIntercept">JNI interception functions</internallink>.
14643   </change>
14644   <change date="30 Nov 2002">
14645     Auto generate SetEventNotificationMode capabilities.
14646   </change>
14647   <change date="30 Nov 2002">
14648     Add <eventlink id="VMObjectAlloc"></eventlink> event.
14649   </change>
14650   <change date="30 Nov 2002">
14651     Add <eventlink id="DynamicCodeGenerated"></eventlink> event.
14652   </change>
14653   <change date="30 Nov 2002">
14654     Add const to declarations.
14655   </change>
14656   <change date="30 Nov 2002">
14657     Change method exit and frame pop to send on exception.
14658   </change>
14659   <change date="1 Dec 2002">
14660     Add ForceGarbageCollection.
14661   </change>
14662   <change date="2 Dec 2002">
14663     Redo Xrun section; clarify GetStackTrace and add example;
14664     Fix width problems; use "agent" consistently.
14665   </change>
14666   <change date="8 Dec 2002">
14667     Remove previous start-up intro.
14668     Add <internallink id="environments"><jvmti/> Environments</internallink>
14669     section.
14670   </change>
14671   <change date="8 Dec 2002">
14672     Add <functionlink id="DisposeEnvironment"></functionlink>.
14673   </change>
14674   <change date="9 Dec 2002">
14675     Numerous minor updates.
14676   </change>
14677   <change date="15 Dec 2002">
14678     Add heap profiling functions added:
14679     get/set annotation, iterate live objects/heap.
14680     Add heap profiling functions place holder added:
14681     heap roots.
14682     Heap profiling event added: object free.
14683     Heap profiling event redesigned: vm object allocation.
14684     Heap profiling event placeholders added: garbage collection start/finish.
14685     Native method bind event added.
14686   </change>
14687   <change date="19 Dec 2002">
14688     Revamp suspend/resume functions.
14689     Add origin information with jvmdi tag.
14690     Misc fixes.
14691   </change>
14692   <change date="24 Dec 2002">
14693     Add semantics to types.
14694   </change>
14695   <change date="27 Dec 2002">
14696     Add local reference section.
14697     Autogenerate parameter descriptions from types.
14698   </change>
14699   <change date="28 Dec 2002">
14700     Document that RunAgentThread sends threadStart.
14701   </change>
14702   <change date="29 Dec 2002">
14703     Remove redundant local ref and dealloc warning.
14704     Convert GetRawMonitorName to allocated buffer.
14705     Add GenerateEvents.
14706   </change>
14707   <change date="30 Dec 2002">
14708     Make raw monitors a type and rename to "jrawMonitorID".
14709   </change>
14710   <change date="1 Jan 2003">
14711     Include origin information.
14712     Clean-up JVMDI issue references.
14713     Remove Deallocate warnings which are now automatically generated.
14714   </change>
14715   <change date="2 Jan 2003">
14716     Fix representation issues for jthread.
14717   </change>
14718   <change date="3 Jan 2003">
14719     Make capabilities buffered out to 64 bits - and do it automatically.
14720   </change>
14721   <change date="4 Jan 2003">
14722     Make constants which are enumeration into enum types.
14723     Parameters now of enum type.
14724     Clean-up and index type section.
14725     Replace remaining datadef entities with callback.
14726   </change>
14727   <change date="7 Jan 2003">
14728     Correct GenerateEvents description.
14729     More internal semantics work.
14730   </change>
14731   <change date="9 Jan 2003">
14732     Replace previous GetSystemProperties with two functions
14733     which use allocated information instead fixed.
14734     Add SetSystemProperty.
14735     More internal semantics work.
14736   </change>
14737   <change date="12 Jan 2003">
14738     Add varargs to end of SetEventNotificationMode.
14739   </change>
14740   <change date="20 Jan 2003">
14741     Finish fixing spec to reflect that alloc sizes are jlong.
14742   </change>
14743   <change date="22 Jan 2003">
14744     Allow NULL as RunAgentThread arg.
14745   </change>
14746   <change date="22 Jan 2003">
14747     Fixed names to standardized naming convention
14748     Removed AsyncGetStackTrace.
14749   </change>
14750   <change date="29 Jan 2003">
14751     Since we are using jthread, removed GetThread.
14752   </change>
14753   <change date="31 Jan 2003">
14754     Change GetFieldName to allow NULLs like GetMethodName.
14755   </change>
14756   <change date="29 Feb 2003" version="v40">
14757       Rewrite the introductory text, adding sections on
14758       start-up, environments and bytecode instrumentation.
14759       Change the command line arguments per EG discussions.
14760       Add an introduction to the capabilities section.
14761       Add the extension mechanism category and functions.
14762       Mark for deletion, but clarified anyhow, SuspendAllThreads.
14763       Rename IterateOverLiveObjects to IterateOverReachableObjects and
14764       change the text accordingly.
14765       Clarify IterateOverHeap.
14766       Clarify CompiledMethodLoad.
14767       Discuss prerequisite state for Calling Functions.
14768       Clarify SetAllocationHooks.
14769       Added issues ("To be resolved:") through-out.
14770       And so on...
14771   </change>
14772   <change date="6 Mar 2003" version="v41">
14773       Remove struct from the call to GetOwnedMonitorInfo.
14774       Automatically generate most error documentation, remove
14775       (rather broken) hand written error doc.
14776       Better describe capability use (empty initial set).
14777       Add min value to jint params.
14778       Remove the capability can_access_thread_local_storage.
14779       Rename error JVMTI_ERROR_NOT_IMPLEMENTED to JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
14780       same for *NOT_IMPLEMENTED.
14781       Description fixes.
14782   </change>
14783   <change date="8 Mar 2003" version="v42">
14784       Rename GetClassSignature to GetClassName.
14785       Rename IterateOverClassObjects to IterateOverInstancesOfClass.
14786       Remove GetMaxStack (operand stack isn't used in <jvmti/>).
14787       Description fixes: define launch-time, remove native frame pop
14788       from PopFrame, and assorted clarifications.
14789   </change>
14790   <change date="8 Mar 2003" version="v43">
14791       Fix minor editing problem.
14792   </change>
14793   <change date="10 Mar 2003" version="v44">
14794       Add phase information.
14795       Remap (compact) event numbers.
14796   </change>
14797   <change date="11 Mar 2003" version="v45">
14798       More phase information - allow "any".
14799       Elide raw monitor queries and events.
14800       Minor description fixes.
14801   </change>
14802   <change date="12 Mar 2003" version="v46">
14803       Add GetPhase.
14804       Use "phase" through document.
14805       Elide GetRawMonitorName.
14806       Elide GetObjectMonitors.
14807   </change>
14808   <change date="12 Mar 2003" version="v47">
14809       Fixes from link, XML, and spell checking.
14810       Auto-generate the callback structure.
14811   </change>
14812   <change date="13 Mar 2003" version="v48">
14813       One character XML fix.
14814   </change>
14815   <change date="13 Mar 2003" version="v49">
14816       Change function parameter names to be consistent with
14817       event parameters (fooBarBaz becomes foo_bar_baz).
14818   </change>
14819   <change date="14 Mar 2003" version="v50">
14820       Fix broken link.  Fix thread markers.
14821   </change>
14822   <change date="14 Mar 2003" version="v51">
14823       Change constants so they are under 128 to workaround
14824       compiler problems.
14825   </change>
14826   <change date="23 Mar 2003" version="v52">
14827       Overhaul capabilities.  Separate GetStackTrace into
14828       GetStackTrace and GetStackFrames.
14829   </change>
14830   <change date="8 Apr 2003" version="v54">
14831       Use depth instead of jframeID to reference frames.
14832       Remove the now irrelevant GetCurrentFrame, GetCallerFrame and GetStackFrames.
14833       Remove frame arg from events.
14834   </change>
14835   <change date="9 Apr 2003" version="v55">
14836       Remove GetObjectWithAnnotation since tests show bufferred approach more efficient.
14837       Add missing annotation_count to GetObjectsWithAnnotations
14838   </change>
14839   <change date="10 Apr 2003" version="v56">
14840       Remove confusing parenthetical statement in GetObjectsWithAnnotations
14841   </change>
14842   <change date="13 Apr 2003" version="v58">
14843       Replace jclass/jmethodID representation of method with simply jmethodID;
14844       Pass JvmtiEnv* as first arg of every event; remove JNIEnv* where inappropriate.
14845       Replace can_access_frames with can_access_local_variables; remove from purely stack access.
14846       Use can_get_synthetic_attribute; fix description.
14847       Clarify that zero length arrays must be deallocated.
14848       Clarify RelinquishCapabilities.
14849       Generalize JVMTI_ERROR_VM_DEAD to JVMTI_ERROR_WRONG_PHASE.
14850   </change>
14851   <change date="27 Apr 2003" version="v59">
14852       Remove lingering indirect references to OBSOLETE_METHOD_ID.
14853   </change>
14854   <change date="4 May 2003" version="v60">
14855       Allow DestroyRawMonitor during OnLoad.
14856   </change>
14857   <change date="7 May 2003" version="v61">
14858       Added not monitor owner error return to DestroyRawMonitor.
14859   </change>
14860   <change date="13 May 2003" version="v62">
14861       Clarify semantics of raw monitors.
14862       Change flags on <code>GetThreadStatus</code>.
14863       <code>GetClassLoader</code> return NULL for the bootstrap class loader.
14864       Add <code>GetClassName</code> issue.
14865       Define local variable signature.
14866       Disallow zero in annotations array of <code>GetObjectsWithAnnotations</code>.
14867       Remove over specification in <code>GetObjectsWithAnnotations</code>.
14868       Elide <code>SetAllocationHooks</code>.
14869       Elide <code>SuspendAllThreads</code>.
14870   </change>
14871   <change date="14 May 2003" version="v63">
14872       Define the data type <code>jvmtiEventCallbacks</code>.
14873       Zero length allocations return NULL.
14874       Keep SetAllocationHooks in JVMDI, but remove from <jvmti/>.
14875       Add JVMTI_THREAD_STATUS_FLAG_INTERRUPTED.
14876   </change>
14877   <change date="15 May 2003" version="v64">
14878       Better wording, per review.
14879   </change>
14880   <change date="15 May 2003" version="v65">
14881       First Alpha.
14882       Make jmethodID and jfieldID unique, jclass not used.
14883   </change>
14884   <change date="27 May 2003" version="v66">
14885       Fix minor XSLT errors.
14886   </change>
14887   <change date="13 June 2003" version="v67">
14888       Undo making jfieldID unique (jmethodID still is).
14889   </change>
14890   <change date="17 June 2003" version="v68">
14891       Changes per June 11th Expert Group meeting --
14892       Overhaul Heap functionality: single callback,
14893       remove GetHeapRoots, add reachable iterators,
14894       and rename "annotation" to "tag".
14895       NULL thread parameter on most functions is current
14896       thread.
14897       Add timers.
14898       Remove ForceExit.
14899       Add GetEnvironmentLocalStorage.
14900       Add verbose flag and event.
14901       Add AddToBootstrapClassLoaderSearch.
14902       Update ClassFileLoadHook.
14903   </change>
14904   <change date="18 June 2003" version="v69">
14905       Clean up issues sections.
14906       Rename GetClassName back to GetClassSignature and
14907       fix description.
14908       Add generic signature to GetClassSignature,
14909       GetFieldSignature, GetMethodSignature, and
14910       GetLocalVariableTable.
14911       Elide EstimateCostOfCapabilities.
14912       Clarify that the system property functions operate
14913       on the VM view of system properties.
14914       Clarify Agent_OnLoad.
14915       Remove "const" from JNIEnv* in events.
14916       Add metadata accessors.
14917   </change>
14918   <change date="18 June 2003" version="v70">
14919       Add start_depth to GetStackTrace.
14920       Move system properties to a new category.
14921       Add GetObjectSize.
14922       Remove "X" from command line flags.
14923       XML, HTML, and spell check corrections.
14924   </change>
14925   <change date="19 June 2003" version="v71">
14926       Fix JVMTI_HEAP_ROOT_THREAD to be 6.
14927       Make each synopsis match the function name.
14928       Fix unclear wording.
14929   </change>
14930   <change date="26 June 2003" version="v72">
14931       SetThreadLocalStorage and SetEnvironmentLocalStorage should allow value
14932       to be set to NULL.
14933       NotifyFramePop, GetFrameLocationm and all the local variable operations
14934       needed to have their wording about frames fixed.
14935       Grammar and clarity need to be fixed throughout.
14936       Capitalization and puntuation need to be consistent.
14937       Need micro version number and masks for accessing major, minor, and micro.
14938       The error code lists should indicate which must be returned by
14939       an implementation.
14940       The command line properties should be visible in the properties functions.
14941       Disallow popping from the current thread.
14942       Allow implementations to return opaque frame error when they cannot pop.
14943       The NativeMethodBind event should be sent during any phase.
14944       The DynamicCodeGenerated event should be sent during any phase.
14945       The following functions should be allowed to operate before VMInit:
14946         Set/GetEnvironmentLocalStorage
14947         GetMethodDeclaringClass
14948         GetClassSignature
14949         GetClassModifiers
14950         IsInterface
14951         IsArrayClass
14952         GetMethodName
14953         GetMethodModifiers
14954         GetMaxLocals
14955         GetArgumentsSize
14956         GetLineNumberTable
14957         GetMethodLocation
14958         IsMethodNative
14959         IsMethodSynthetic.
14960       Other changes (to XSL):
14961       Argument description should show asterisk after not before pointers.
14962       NotifyFramePop, GetFrameLocationm and all the local variable operations
14963       should hsve the NO_MORE_FRAMES error added.
14964       Not alive threads should have a different error return than invalid thread.
14965   </change>
14966   <change date="7 July 2003" version="v73">
14967       VerboseOutput event was missing message parameter.
14968       Minor fix-ups.
14969   </change>
14970   <change date="14 July 2003" version="v74">
14971       Technical Publications Department corrections.
14972       Allow thread and environment local storage to be set to NULL.
14973   </change>
14974   <change date="23 July 2003" version="v75">
14975       Use new Agent_OnLoad rather than overloaded JVM_OnLoad.
14976       Add JNICALL to callbacks (XSL).
14977       Document JNICALL requirement for both events and callbacks (XSL).
14978       Restrict RedefineClasses to methods and attributes.
14979       Elide the VerboseOutput event.
14980       VMObjectAlloc: restrict when event is sent and remove method parameter.
14981       Finish loose ends from Tech Pubs edit.
14982   </change>
14983   <change date="24 July 2003" version="v76">
14984       Change ClassFileLoadHook event to send the class instead of a boolean of redefine.
14985   </change>
14986   <change date="24 July 2003" version="v77">
14987       XML fixes.
14988       Minor text clarifications and corrections.
14989   </change>
14990   <change date="24 July 2003" version="v78">
14991       Remove GetExceptionHandlerTable and GetThrownExceptions from <jvmti/>.
14992       Clarify that stack frames are JVM Spec frames.
14993       Split can_get_source_info into can_get_source_file_name, can_get_line_numbers,
14994       and can_get_source_debug_extension.
14995       PopFrame cannot have a native calling method.
14996       Removed incorrect statement in GetClassloaderClasses
14997       (see <vmspec chapter="4.4"/>).
14998   </change>
14999   <change date="24 July 2003" version="v79">
15000       XML and text fixes.
15001       Move stack frame description into Stack Frame category.
15002   </change>
15003   <change date="26 July 2003" version="v80">
15004       Allow NULL (means bootstrap loader) for GetClassloaderClasses.
15005       Add new heap reference kinds for references from classes.
15006       Add timer information struct and query functions.
15007       Add AvailableProcessors.
15008       Rename GetOtherThreadCpuTime to GetThreadCpuTime.
15009       Explicitly add JVMTI_ERROR_INVALID_THREAD and JVMTI_ERROR_THREAD_NOT_ALIVE
15010       to SetEventNotification mode.
15011       Add initial thread to the VM_INIT event.
15012       Remove platform assumptions from AddToBootstrapClassLoaderSearch.
15013   </change>
15014   <change date="26 July 2003" version="v81">
15015       Grammar and clarity changes per review.
15016   </change>
15017   <change date="27 July 2003" version="v82">
15018       More grammar and clarity changes per review.
15019       Add Agent_OnUnload.
15020   </change>
15021   <change date="28 July 2003" version="v83">
15022       Change return type of Agent_OnUnload to void.
15023   </change>
15024   <change date="28 July 2003" version="v84">
15025       Rename JVMTI_REFERENCE_ARRAY to JVMTI_REFERENCE_ARRAY_ELEMENT.
15026   </change>
15027   <change date="28 July 2003" version="v85">
15028       Steal java.lang.Runtime.availableProcessors() wording for
15029       AvailableProcessors().
15030       Guarantee that zero will never be an event ID.
15031       Remove some issues which are no longer issues.
15032       Per review, rename and more completely document the timer
15033       information functions.
15034   </change>
15035   <change date="29 July 2003" version="v86">
15036       Non-spec visible change to XML controlled implementation:
15037         SetThreadLocalStorage must run in VM mode.
15038   </change>
15039   <change date="5 August 2003" version="0.1.87">
15040       Add GetErrorName.
15041       Add varargs warning to jvmtiExtensionEvent.
15042       Remove "const" on the jvmtiEnv* of jvmtiExtensionEvent.
15043       Remove unused can_get_exception_info capability.
15044       Pass jvmtiEnv* and JNIEnv* to the jvmtiStartFunction.
15045       Fix jvmtiExtensionFunctionInfo.func declared type.
15046       Extension function returns error code.
15047       Use new version numbering.
15048   </change>
15049   <change date="5 August 2003" version="0.2.88">
15050       Remove the ClassUnload event.
15051   </change>
15052   <change date="8 August 2003" version="0.2.89">
15053       Heap reference iterator callbacks return an enum that
15054       allows outgoing object references to be ignored.
15055       Allow JNIEnv as a param type to extension events/functions.
15056   </change>
15057   <change date="15 August 2003" version="0.2.90">
15058       Fix a typo.
15059   </change>
15060   <change date="2 September 2003" version="0.2.91">
15061       Remove all metadata functions: GetClassMetadata,
15062       GetFieldMetadata, and GetMethodMetadata.
15063   </change>
15064   <change date="1 October 2003" version="0.2.92">
15065       Mark the functions Allocate. Deallocate, RawMonitor*,
15066       SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage
15067       as safe for use in heap callbacks and GC events.
15068   </change>
15069   <change date="24 November 2003" version="0.2.93">
15070       Add pass through opaque user data pointer to heap iterate
15071       functions and callbacks.
15072       In the CompiledMethodUnload event, send the code address.
15073       Add GarbageCollectionOccurred event.
15074       Add constant pool reference kind.
15075       Mark the functions CreateRawMonitor and DestroyRawMonitor
15076       as safe for use in heap callbacks and GC events.
15077       Clarify: VMDeath, GetCurrentThreadCpuTimerInfo,
15078       GetThreadCpuTimerInfo, IterateOverReachableObjects,
15079       IterateOverObjectsReachableFromObject, GetTime and
15080       JVMTI_ERROR_NULL_POINTER.
15081       Add missing errors to: GenerateEvents and
15082       AddToBootstrapClassLoaderSearch.
15083       Fix description of ClassFileLoadHook name parameter.
15084       In heap callbacks and GC/ObjectFree events, specify
15085       that only explicitly allowed functions can be called.
15086       Allow GetCurrentThreadCpuTimerInfo, GetCurrentThreadCpuTime,
15087       GetTimerInfo, and GetTime during callback.
15088       Allow calling SetTag/GetTag during the onload phase.
15089       SetEventNotificationMode, add: error attempted inappropriate
15090       thread level control.
15091       Remove jvmtiExceptionHandlerEntry.
15092       Fix handling of native methods on the stack --
15093       location_ptr param of GetFrameLocation, remove
15094       JVMTI_ERROR_OPAQUE_FRAME from GetFrameLocation,
15095       jvmtiFrameInfo.location, and jlocation.
15096       Remove typo (from JVMPI) implying that the MonitorWaited
15097       event is sent on sleep.
15098   </change>
15099   <change date="25 November 2003" version="0.2.94">
15100       Clarifications and typos.
15101   </change>
15102   <change date="3 December 2003" version="0.2.95">
15103       Allow NULL user_data in heap iterators.
15104   </change>
15105   <change date="28 January 2004" version="0.2.97">
15106       Add GetThreadState, deprecate GetThreadStatus.
15107   </change>
15108   <change date="29 January 2004" version="0.2.98">
15109       INVALID_SLOT and TYPE_MISMATCH errors should be optional.
15110   </change>
15111   <change date="12 February 2004" version="0.2.102">
15112       Remove MonitorContendedExit.
15113       Added JNIEnv parameter to VMObjectAlloc.
15114       Clarified definition of class_tag and referrer_index
15115       parameters to heap callbacks.
15116   </change>
15117   <change date="16 Febuary 2004" version="0.2.103">
15118       Document JAVA_TOOL_OPTIONS.
15119   </change>
15120   <change date="17 Febuary 2004" version="0.2.105">
15121       Divide start phase into primordial and start.
15122       Add VMStart event
15123       Change phase associations of functions and events.
15124   </change>
15125   <change date="18 Febuary 2004" version="0.3.6">
15126       Elide deprecated GetThreadStatus.
15127       Bump minor version, subtract 100 from micro version
15128   </change>
15129   <change date="18 Febuary 2004" version="0.3.7">
15130       Document that timer nanosecond values are unsigned.
15131       Clarify text having to do with native methods.
15132   </change>
15133   <change date="19 Febuary 2004" version="0.3.8">
15134       Fix typos.
15135       Remove elided deprecated GetThreadStatus.
15136   </change>
15137   <change date="23 Febuary 2004" version="0.3.9">
15138       Require NotifyFramePop to act on suspended threads.
15139   </change>
15140   <change date="24 Febuary 2004" version="0.3.10">
15141       Add capabilities
15142         (<internallink id="jvmtiCapabilities.can_redefine_any_class"
15143          ><code>can_redefine_any_class</code></internallink>
15144       and
15145          <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events"
15146          ><code>can_generate_all_class_hook_events</code></internallink>)
15147       and an error (<errorlink id="JVMTI_ERROR_UNMODIFIABLE_CLASS"></errorlink>)
15148       which allow some classes to be unmodifiable.
15149   </change>
15150   <change date="28 Febuary 2004" version="0.3.11">
15151       Add JVMTI_ERROR_MUST_POSSESS_CAPABILITY to SetEventNotificationMode.
15152   </change>
15153   <change date="8 March 2004" version="0.3.12">
15154       Clarified CompiledMethodUnload so that it is clear the event
15155       may be posted after the class has been unloaded.
15156   </change>
15157   <change date="5 March 2004" version="0.3.13">
15158       Change the size parameter of VMObjectAlloc to jlong to match GetObjectSize.
15159   </change>
15160   <change date="13 March 2004" version="0.3.14">
15161       Added guideline for the use of the JNI FindClass function in event
15162       callback functions.
15163   </change>
15164   <change date="15 March 2004" version="0.3.15">
15165       Add GetAllStackTraces and GetThreadListStackTraces.
15166   </change>
15167   <change date="19 March 2004" version="0.3.16">
15168       ClassLoad and ClassPrepare events can be posted during start phase.
15169   </change>
15170   <change date="25 March 2004" version="0.3.17">
15171       Add JVMTI_ERROR_NATIVE_METHOD to GetLineNumberTable, GetLocalVariableTable,
15172       GetMaxLocals, GetArgumentsSize, GetMethodLocation, GetBytecodes.
15173   </change>
15174   <change date="29 March 2004" version="0.3.18">
15175       Return the timer kind in the timer information structure.
15176   </change>
15177   <change date="31 March 2004" version="0.3.19">
15178       Spec clarifications:
15179       JVMTI_THREAD_STATE_IN_NATIVE might not include JNI or <jvmti/>.
15180       ForceGarbageCollection does not run finalizers.
15181       The context of the specification is the Java platform.
15182       Warn about early instrumentation.
15183   </change>
15184   <change date="1 April 2004" version="0.3.20">
15185       Refinements to the above clarifications and
15186       Clarify that an error returned by Agent_OnLoad terminates the VM.
15187   </change>
15188   <change date="1 April 2004" version="0.3.21">
15189       Array class creation does not generate a class load event.
15190   </change>
15191   <change date="7 April 2004" version="0.3.22">
15192       Align thread state hierarchy more closely with java.lang.Thread.State.
15193   </change>
15194   <change date="12 April 2004" version="0.3.23">
15195       Clarify the documentation of thread state.
15196   </change>
15197   <change date="19 April 2004" version="0.3.24">
15198       Remove GarbageCollectionOccurred event -- can be done by agent.
15199   </change>
15200   <change date="22 April 2004" version="0.3.25">
15201       Define "command-line option".
15202   </change>
15203   <change date="29 April 2004" version="0.3.26">
15204       Describe the intended use of bytecode instrumentation.
15205       Fix description of extension event first parameter.
15206   </change>
15207   <change date="30 April 2004" version="0.3.27">
15208       Clarification and typos.
15209   </change>
15210   <change date="18 May 2004" version="0.3.28">
15211       Remove DataDumpRequest event.
15212   </change>
15213   <change date="18 May 2004" version="0.3.29">
15214       Clarify RawMonitorWait with zero timeout.
15215       Clarify thread state after RunAgentThread.
15216   </change>
15217   <change date="24 May 2004" version="0.3.30">
15218       Clean-up: fix bad/old links, etc.
15219   </change>
15220   <change date="30 May 2004" version="0.3.31">
15221       Clarifications including:
15222       All character strings are modified UTF-8.
15223       Agent thread visibiity.
15224       Meaning of obsolete method version.
15225       Thread invoking heap callbacks,
15226   </change>
15227   <change date="1 June 2004" version="1.0.32">
15228       Bump major.minor version numbers to "1.0".
15229   </change>
15230   <change date="2 June 2004" version="1.0.33">
15231       Clarify interaction between ForceGarbageCollection
15232       and ObjectFree.
15233   </change>
15234   <change date="6 June 2004" version="1.0.34">
15235       Restrict AddToBootstrapClassLoaderSearch and
15236       SetSystemProperty to the OnLoad phase only.
15237   </change>
15238   <change date="11 June 2004" version="1.0.35">
15239       Fix typo in SetTag.
15240   </change>
15241   <change date="18 June 2004" version="1.0.36">
15242       Fix trademarks.
15243       Add missing parameter in example GetThreadState usage.
15244   </change>
15245   <change date="4 August 2004" version="1.0.37">
15246       Copyright updates.
15247   </change>
15248   <change date="5 November 2004" version="1.0.38">
15249       Add missing function table layout.
15250       Add missing description of C++ member function format of functions.
15251       Clarify that name in CFLH can be NULL.
15252       Released as part of <tm>J2SE</tm> 5.0.
15253   </change>
15254   <change date="24 April 2005" version="1.1.47">
15255       Bump major.minor version numbers to "1.1".
15256       Add ForceEarlyReturn* functions.
15257       Add GetOwnedMonitorStackDepthInfo function.
15258       Add GetCurrentThread function.
15259       Add "since" version marker.
15260       Add AddToSystemClassLoaderSearch.
15261       Allow AddToBootstrapClassLoaderSearch be used in live phase.
15262       Fix historic rubbish in the descriptions of the heap_object_callback
15263       parameter of IterateOverHeap and IterateOverInstancesOfClass functions;
15264       disallow NULL for this parameter.
15265       Clarify, correct and make consistent: wording about current thread,
15266       opaque frames and insufficient number of frames in PopFrame.
15267       Consistently use "current frame" rather than "topmost".
15268       Clarify the JVMTI_ERROR_TYPE_MISMATCH errors in GetLocal* and SetLocal*
15269       by making them compatible with those in ForceEarlyReturn*.
15270       Many other clarifications and wording clean ups.
15271   </change>
15272   <change date="25 April 2005" version="1.1.48">
15273       Add GetConstantPool.
15274       Switch references to the first edition of the VM Spec, to the seconds edition.
15275   </change>
15276   <change date="26 April 2005" version="1.1.49">
15277       Clarify minor/major version order in GetConstantPool.
15278   </change>
15279   <change date="26 April 2005" version="1.1.50">
15280       Add SetNativeMethodPrefix and SetNativeMethodPrefixes.
15281       Reassign GetOwnedMonitorStackDepthInfo to position 153.
15282       Break out Class Loader Search in its own documentation category.
15283       Deal with overly long lines in XML source.
15284   </change>
15285   <change date="29 April 2005" version="1.1.51">
15286       Allow agents be started in the live phase.
15287       Added paragraph about deploying agents.
15288   </change>
15289   <change date="30 April 2005" version="1.1.52">
15290       Add specification description to SetNativeMethodPrefix(es).
15291       Better define the conditions on GetConstantPool.
15292   </change>
15293   <change date="30 April 2005" version="1.1.53">
15294       Break out the GetClassVersionNumber function from GetConstantPool.
15295       Clean-up the references to the VM Spec.
15296   </change>
15297   <change date="1 May 2005" version="1.1.54">
15298       Allow SetNativeMethodPrefix(es) in any phase.
15299       Add clarifications about the impact of redefinition on GetConstantPool.
15300   </change>
15301   <change date="2 May 2005" version="1.1.56">
15302       Various clarifications to SetNativeMethodPrefix(es).
15303   </change>
15304   <change date="2 May 2005" version="1.1.57">
15305       Add missing performance warning to the method entry event.
15306   </change>
15307   <change date="5 May 2005" version="1.1.58">
15308       Remove internal JVMDI support.
15309   </change>
15310   <change date="8 May 2005" version="1.1.59">
15311       Add <functionlink id="RetransformClasses"/>.
15312       Revamp the bytecode instrumentation documentation.
15313       Change <functionlink id="IsMethodObsolete"/> to no longer
15314       require the can_redefine_classes capability.
15315   </change>
15316   <change date="11 May 2005" version="1.1.63">
15317       Clarifications for retransformation.
15318   </change>
15319   <change date="11 May 2005" version="1.1.64">
15320       Clarifications for retransformation, per review.
15321       Lock "retransformation (in)capable" at class load enable time.
15322   </change>
15323   <change date="4 June 2005" version="1.1.67">
15324       Add new heap functionity which supports reporting primitive values,
15325       allows setting the referrer tag, and has more powerful filtering:
15326       FollowReferences, IterateThroughHeap, and their associated
15327       callbacks, structs, enums, and constants.
15328   </change>
15329   <change date="4 June 2005" version="1.1.68">
15330       Clarification.
15331   </change>
15332   <change date="6 June 2005" version="1.1.69">
15333       FollowReferences, IterateThroughHeap: Put callbacks in a struct;
15334       Add missing error codes; reduce bits in the visit control flags.
15335   </change>
15336   <change date="14 June 2005" version="1.1.70">
15337       More on new heap functionity: spec clean-up per review.
15338   </change>
15339   <change date="15 June 2005" version="1.1.71">
15340       More on new heap functionity: Rename old heap section to Heap (1.0).
15341   </change>
15342   <change date="21 June 2005" version="1.1.72">
15343       Fix typos.
15344   </change>
15345   <change date="27 June 2005" version="1.1.73">
15346       Make referrer info structure a union.
15347   </change>
15348   <change date="9 September 2005" version="1.1.74">
15349       In new heap functions:
15350       Add missing superclass reference kind.
15351       Use a single scheme for computing field indexes.
15352       Remove outdated references to struct based referrer info.
15353   </change>
15354   <change date="12 September 2005" version="1.1.75">
15355       Don't callback during FollowReferences on frivolous java.lang.Object superclass.
15356   </change>
15357   <change date="13 September 2005" version="1.1.76">
15358       In string primitive callback, length now Unicode length.
15359       In array and string primitive callbacks, value now "const".
15360       Note possible compiler impacts on setting JNI function table.
15361   </change>
15362   <change date="13 September 2005" version="1.1.77">
15363       GetClassVersionNumbers() and GetConstantPool() should return
15364       error on array or primitive class.
15365   </change>
15366   <change date="14 September 2005" version="1.1.78">
15367       Grammar fixes.
15368   </change>
15369   <change date="26 September 2005" version="1.1.79">
15370       Add IsModifiableClass query.
15371   </change>
15372   <change date="9 February 2006" version="1.1.81">
15373       Add referrer_class_tag parameter to jvmtiHeapReferenceCallback.
15374   </change>
15375   <change date="13 February 2006" version="1.1.82">
15376       Doc fixes: update can_redefine_any_class to include retransform.
15377       Clarify that exception events cover all Throwables.
15378       In GetStackTrace, no test is done for start_depth too big if start_depth is zero,
15379       Clarify fields reported in Primitive Field Callback -- static vs instance.
15380       Repair confusing names of heap types, including callback names.
15381       Require consistent usage of stack depth in the face of thread launch methods.
15382       Note incompatibility of <jvmti/> memory management with other systems.
15383   </change>
15384   <change date="14 February 2006" version="1.1.85">
15385       Fix typos and missing renames.
15386   </change>
15387   <change date="13 March 2006" version="1.1.86">
15388       Clarify that jmethodIDs and jfieldIDs can be saved.
15389       Clarify that Iterate Over Instances Of Class includes subclasses.
15390   </change>
15391   <change date="14 March 2006" version="1.1.87">
15392       Better phrasing.
15393   </change>
15394   <change date="16 March 2006" version="1.1.88">
15395       Match the referrer_index for static fields in Object Reference Callback
15396       with the Reference Implementation (and all other known implementations);
15397       that is, make it match the definition for instance fields.
15398       In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover
15399       an invalid thread in the list; and specify that not started threads
15400       return empty stacks.
15401   </change>
15402   <change date="17 March 2006" version="1.1.89">
15403       Typo.
15404   </change>
15405   <change date="25 March 2006" version="1.1.90">
15406       Typo.
15407   </change>
15408   <change date="6 April 2006" version="1.1.91">
15409       Remove restrictions on AddToBootstrapClassLoaderSearch and
15410       AddToSystemClassLoaderSearch.
15411   </change>
15412   <change date="1 May 2006" version="1.1.93">
15413       Changed spec to return -1 for monitor stack depth for the
15414       implementation which can not determine stack depth.
15415   </change>
15416   <change date="3 May 2006" version="1.1.94">
15417       Corrections for readability and accuracy courtesy of Alan Pratt of IBM.
15418       List the object relationships reported in FollowReferences.
15419   </change>
15420   <change date="5 May 2006" version="1.1.95">
15421       Clarify the object relationships reported in FollowReferences.
15422   </change>
15423   <change date="28 June 2006" version="1.1.98">
15424       Clarify DisposeEnvironment; add warning.
15425       Fix typos in SetLocalXXX "retrieve" => "set".
15426       Clarify that native method prefixes must remain set while used.
15427       Clarify that exactly one Agent_OnXXX is called per agent.
15428       Clarify that library loading is independent from start-up.
15429       Remove ambiguous reference to Agent_OnLoad in the Agent_OnUnload spec.
15430   </change>
15431   <change date="31 July 2006" version="1.1.99">
15432       Clarify the interaction between functions and exceptions.
15433       Clarify and give examples of field indices.
15434       Remove confusing "That is" sentence from MonitorWait and MonitorWaited events.
15435       Update links to point to Java 6.
15436   </change>
15437   <change date="6 August 2006" version="1.1.102">
15438       Add ResourceExhaustedEvent.
15439   </change>
15440   <change date="11 October 2012" version="1.2.2">
15441       Fixed the "HTTP" and "Missing Anchor" errors reported by the LinkCheck tool.
15442   </change>
15443   <change date="19 June 2013" version="1.2.3">
15444       Added support for statically linked agents.
15445   </change>
15446   <change date="13 October 2016" version="9.0.0">
15447       Support for modules:
15448        - The majorversion is 9 now
15449        - The ClassFileLoadHook events are not sent during the primordial phase anymore.
15450        - Allow CompiledMethodLoad events at start phase
15451        - Add new capabilities:
15452           - can_generate_early_vmstart
15453           - can_generate_early_class_hook_events
15454        - Add new functions:
15455           - GetAllModules
15456           - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides
15457           - IsModifiableModule
15458       Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to
15459       disallow some implementation defined classes.
15460   </change>
15461   <change date="12 February 2017" version="9.0.0">
15462       Minor update for GetCurrentThread function:
15463        - The function may return NULL in the start phase if the
15464          can_generate_early_vmstart capability is enabled.
15465   </change>
15466   <change date="7 February 2018" version="11.0.0">
15467       Minor update for new class file NestHost and NestMembers attributes:
15468         - Specify that RedefineClasses and RetransformClasses are not allowed
15469           to change the class file NestHost and NestMembers attributes.
15470         - Add new error JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED
15471           that can be returned by RedefineClasses and RetransformClasses.
15472   </change>
15473   <change date="20 May 2019" version="13.0.0">
15474       Minor spec update for the capability "can_redefine_any_class".
15475       It now says:
15476        "RedefineClasses can be called on any modifiable class. See IsModifiableClass.
15477        (can_redefine_classes must also be set)"
15478   </change>
15479   <change date="5 June 2019" version="13.0.0">
15480       Minor PopFrame spec update:
15481         - The specified thread must be suspended or must be the current thread.
15482           (It was not allowed to be the current thread before.)
15483   </change>
15484 </changehistory>
15485 
15486 </specification>
15487 <!-- Keep this comment at the end of the file
15488 Local variables:
15489 mode: sgml
15490 sgml-omittag:t
15491 sgml-shorttag:t
15492 sgml-namecase-general:t
15493 sgml-general-insert-case:lower
15494 sgml-minimize-attributes:nil
15495 sgml-always-quote-attributes:t
15496 sgml-indent-step:2
15497 sgml-indent-data:t
15498 sgml-parent-document:nil
15499 sgml-exposed-tags:nil
15500 sgml-local-catalogs:nil
15501 sgml-local-ecat-files:nil
15502 End:
15503 -->