1 <?xml version="1.0" encoding="ISO-8859-1"?>
   2 <?xml-stylesheet type="text/xsl" href="jvmti.xsl"?>
   3 <!--
   4  Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
   5  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6 
   7  This code is free software; you can redistribute it and/or modify it
   8  under the terms of the GNU General Public License version 2 only, as
   9  published by the Free Software Foundation.
  10 
  11  This code is distributed in the hope that it will be useful, but WITHOUT
  12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  version 2 for more details (a copy is included in the LICENSE file that
  15  accompanied this code).
  16 
  17  You should have received a copy of the GNU General Public License version
  18  2 along with this work; if not, write to the Free Software Foundation,
  19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 
  21  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  or visit www.oracle.com if you need additional information or have any
  23  questions.
  24 -->
  25 
  26 <!DOCTYPE specification [
  27    <!ELEMENT specification (title, intro*, functionsection, errorsection,
  28                             eventsection, datasection, issuessection, changehistory)>
  29    <!ATTLIST specification label CDATA #REQUIRED
  30                            majorversion CDATA #REQUIRED
  31                            minorversion CDATA #REQUIRED
  32                            microversion CDATA #REQUIRED>
  33 
  34    <!ELEMENT title (#PCDATA|jvmti|tm)*>
  35    <!ATTLIST title subtitle CDATA #REQUIRED>
  36 
  37    <!ELEMENT intro ANY>
  38    <!ATTLIST intro id CDATA #IMPLIED
  39                    label CDATA "">
  40 
  41    <!ELEMENT functionsection (intro*, category*)>
  42    <!ATTLIST functionsection label CDATA #REQUIRED>
  43 
  44    <!ELEMENT category ((intro|typedef|uniontypedef|capabilitiestypedef)*,
  45                           (function|callback|elide)*)>
  46    <!ATTLIST category id CDATA #REQUIRED
  47                       label CDATA #REQUIRED>
  48 
  49    <!ELEMENT function (synopsis, typedef*, description?, origin,
  50                          (capabilities|eventcapabilities),
  51                          parameters, errors)>
  52    <!ATTLIST function id CDATA #REQUIRED
  53                       num CDATA #REQUIRED
  54                       phase (onload|onloadOnly|start|live|any) #IMPLIED
  55                       callbacksafe (safe|unsafe) #IMPLIED
  56                       impl CDATA #IMPLIED
  57                       hide CDATA #IMPLIED
  58                       jkernel (yes|no) #IMPLIED
  59                       since CDATA "1.0">
  60 
  61    <!ELEMENT callback ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
  62                         jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void),
  63                         synopsis, description?, parameters)>
  64    <!ATTLIST callback id CDATA #REQUIRED
  65                       since CDATA "1.0">
  66 
  67    <!ELEMENT synopsis (#PCDATA|jvmti)*>
  68 
  69    <!ELEMENT typedef (description?, field*)>
  70    <!ATTLIST typedef id CDATA #REQUIRED
  71                      label CDATA #REQUIRED
  72                      since CDATA "1.0">
  73 
  74    <!ELEMENT uniontypedef (description?, field*)>
  75    <!ATTLIST uniontypedef id CDATA #REQUIRED
  76                      label CDATA #REQUIRED
  77                      since CDATA "1.0">
  78 
  79    <!ELEMENT field ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
  80                      jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|allocfieldbuf|inptr|inbuf|outbuf|vmbuf|ptrtype|struct),
  81                     description)>
  82    <!ATTLIST field id CDATA #REQUIRED>
  83 
  84    <!ELEMENT capabilitiestypedef (description?, capabilityfield*)>
  85    <!ATTLIST capabilitiestypedef id CDATA #REQUIRED
  86                      label CDATA #REQUIRED>
  87 
  88    <!ELEMENT capabilityfield (description)>
  89    <!ATTLIST capabilityfield id CDATA #REQUIRED
  90                    disp1 CDATA ""
  91                    disp2 CDATA ""
  92                    since CDATA "1.0">
  93 
  94    <!ELEMENT description ANY>
  95 
  96    <!ELEMENT capabilities (required*, capability*)>
  97 
  98    <!ELEMENT eventcapabilities EMPTY>
  99 
 100    <!ELEMENT required ANY>
 101    <!ATTLIST required id CDATA #REQUIRED>
 102 
 103    <!ELEMENT capability ANY>
 104    <!ATTLIST capability id CDATA #REQUIRED>
 105 
 106    <!ELEMENT parameters (param*)>
 107 
 108    <!ELEMENT param ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
 109                      jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct|ptrtype|
 110                      outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf),
 111                     description)>
 112    <!ATTLIST param id CDATA #REQUIRED>
 113 
 114    <!ELEMENT jmethodID EMPTY>
 115    <!ATTLIST jmethodID class  CDATA #IMPLIED
 116                        native CDATA #IMPLIED>
 117 
 118    <!ELEMENT jfieldID EMPTY>
 119    <!ATTLIST jfieldID class CDATA #IMPLIED>
 120 
 121    <!ELEMENT jclass EMPTY>
 122    <!ATTLIST jclass method CDATA #IMPLIED
 123                     field  CDATA #IMPLIED>
 124 
 125    <!ELEMENT jframeID EMPTY>
 126    <!ATTLIST jframeID thread CDATA #IMPLIED>
 127 
 128    <!ELEMENT jrawMonitorID EMPTY>
 129 
 130    <!ELEMENT jthread EMPTY>
 131    <!ATTLIST jthread started CDATA #IMPLIED
 132                      null CDATA #IMPLIED
 133                      frame CDATA #IMPLIED
 134                      impl CDATA #IMPLIED>
 135 
 136    <!ELEMENT varargs EMPTY>
 137 
 138    <!ELEMENT jthreadGroup EMPTY>
 139    <!ELEMENT jobject EMPTY>
 140    <!ELEMENT jvalue EMPTY>
 141    <!ELEMENT jchar EMPTY>
 142    <!ELEMENT jint EMPTY>
 143    <!ATTLIST jint min CDATA #IMPLIED>
 144    <!ELEMENT jlong EMPTY>
 145    <!ELEMENT jfloat EMPTY>
 146    <!ELEMENT jdouble EMPTY>
 147    <!ELEMENT jlocation EMPTY>
 148    <!ELEMENT jboolean EMPTY>
 149    <!ELEMENT char EMPTY>
 150    <!ELEMENT uchar EMPTY>
 151    <!ELEMENT size_t EMPTY>
 152    <!ELEMENT void EMPTY>
 153    <!ELEMENT enum (#PCDATA)*>
 154    <!ELEMENT struct (#PCDATA)*>
 155 
 156    <!ELEMENT nullok ANY>
 157 
 158    <!ELEMENT ptrtype     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 159                                    jthreadGroup|jobject|jvalue), nullok?)>
 160 
 161    <!ELEMENT outptr     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 162                                    jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble|
 163                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 164 
 165    <!ELEMENT allocbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 166                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 167                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 168    <!ATTLIST allocbuf incount CDATA #IMPLIED
 169                       outcount CDATA #IMPLIED>
 170 
 171    <!ELEMENT allocallocbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 172                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 173                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 174    <!ATTLIST allocallocbuf incount CDATA #IMPLIED
 175                       outcount CDATA #IMPLIED>
 176 
 177    <!ELEMENT inptr      (struct, nullok?)>
 178 
 179    <!ELEMENT inbuf      ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 180                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 181                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 182    <!ATTLIST inbuf    incount CDATA #IMPLIED>
 183 
 184    <!ELEMENT outbuf     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 185                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 186                                    jlocation|jboolean|char|uchar|size_t|void|outbuf), nullok?)>
 187    <!ATTLIST outbuf   incount CDATA #IMPLIED
 188                       outcount CDATA #IMPLIED>
 189 
 190    <!ELEMENT vmbuf      ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 191                                    jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble|
 192                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 193    <!ATTLIST vmbuf    incount CDATA #IMPLIED
 194                       outcount CDATA #IMPLIED>
 195 
 196    <!ELEMENT agentbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 197                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 198                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 199    <!ATTLIST agentbuf incount CDATA #IMPLIED
 200                       outcount CDATA #IMPLIED>
 201 
 202    <!ELEMENT allocfieldbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 203                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 204                                    jlocation|jboolean|char|uchar|size_t|void))>
 205    <!ATTLIST allocfieldbuf outcount CDATA #IMPLIED>
 206 
 207    <!ELEMENT errors (error*)>
 208 
 209    <!ELEMENT error ANY>
 210    <!ATTLIST error id CDATA #REQUIRED>
 211 
 212    <!ELEMENT errorsection (intro*, errorcategory*)>
 213    <!ATTLIST errorsection label CDATA #REQUIRED>
 214 
 215    <!ELEMENT errorcategory (intro*, errorid*)>
 216    <!ATTLIST errorcategory id CDATA #REQUIRED
 217                            label CDATA #REQUIRED>
 218 
 219    <!ELEMENT errorid ANY>
 220    <!ATTLIST errorid id CDATA #REQUIRED
 221                      num CDATA #REQUIRED>
 222 
 223    <!ELEMENT datasection (intro*, basetypes*)>
 224 
 225    <!ELEMENT basetypes (intro*, basetype*)>
 226    <!ATTLIST basetypes id CDATA #REQUIRED
 227                        label CDATA #REQUIRED>
 228 
 229    <!ELEMENT basetype (definition?,description)>
 230    <!ATTLIST basetype id CDATA #REQUIRED
 231                       name CDATA #IMPLIED>
 232 
 233    <!ELEMENT definition (#PCDATA|jvmti)*>
 234 
 235    <!ELEMENT eventsection (intro*, (event|elide)*)>
 236    <!ATTLIST eventsection label CDATA #REQUIRED>
 237 
 238    <!ELEMENT event (description, origin, typedef*, capabilities, parameters)>
 239    <!ATTLIST event id CDATA #REQUIRED
 240                    label CDATA #REQUIRED
 241                    const CDATA #REQUIRED
 242                    num CDATA #REQUIRED
 243                    phase (onload|start|live|any) #IMPLIED
 244                    filtered (thread|global) #IMPLIED
 245                    since CDATA "1.0">
 246 
 247    <!ELEMENT issuessection (intro*)>
 248    <!ATTLIST issuessection label CDATA #REQUIRED>
 249 
 250    <!ELEMENT changehistory (intro*, change*)>
 251    <!ATTLIST changehistory update CDATA #REQUIRED
 252                            id CDATA #REQUIRED>
 253 
 254    <!ELEMENT change ANY>
 255    <!ATTLIST change date CDATA #REQUIRED
 256                     version CDATA #IMPLIED>
 257 
 258    <!ELEMENT functionlink (#PCDATA|jvmti|code|i|b)*>
 259    <!ATTLIST functionlink id CDATA #REQUIRED>
 260 
 261    <!ELEMENT datalink (#PCDATA|jvmti|code|i|b)*>
 262    <!ATTLIST datalink id CDATA #REQUIRED>
 263 
 264    <!ELEMENT typelink (#PCDATA|jvmti|code|i|b)*>
 265    <!ATTLIST typelink id CDATA #REQUIRED>
 266 
 267    <!ELEMENT fieldlink (#PCDATA|jvmti|code|i|b)*>
 268    <!ATTLIST fieldlink id CDATA #REQUIRED
 269                        struct CDATA #REQUIRED>
 270 
 271    <!ELEMENT paramlink (#PCDATA|jvmti|code|i|b)*>
 272    <!ATTLIST paramlink id CDATA #REQUIRED>
 273 
 274    <!ELEMENT eventlink (#PCDATA|jvmti|code|i|b)*>
 275    <!ATTLIST eventlink id CDATA #REQUIRED>
 276 
 277    <!ELEMENT errorlink (#PCDATA|jvmti|code|i|b|tm)*>
 278    <!ATTLIST errorlink id CDATA #REQUIRED>
 279 
 280    <!ELEMENT externallink (#PCDATA|jvmti|code|i|b|tm)*>
 281    <!ATTLIST externallink id CDATA #REQUIRED>
 282 
 283    <!ELEMENT vmspec EMPTY>
 284    <!ATTLIST vmspec chapter CDATA #IMPLIED>
 285 
 286    <!ELEMENT internallink (#PCDATA|jvmti|code|i|b)*>
 287    <!ATTLIST internallink id CDATA #REQUIRED>
 288 
 289    <!ELEMENT functionphaselist EMPTY>
 290    <!ATTLIST functionphaselist phase (onload|onloadOnly|start|live|any) #REQUIRED>
 291 
 292    <!ELEMENT eventphaselist EMPTY>
 293    <!ATTLIST eventphaselist phase (onload|start|live|any) #REQUIRED>
 294 
 295    <!ELEMENT issue ANY>
 296 
 297    <!ELEMENT rationale ANY>
 298 
 299    <!ELEMENT todo ANY>
 300 
 301    <!ELEMENT origin (#PCDATA)*>
 302 
 303    <!ELEMENT elide (intro|function|callback|event)*>
 304    <!ATTLIST elide why CDATA #IMPLIED>
 305 
 306    <!ELEMENT constants (constant*)>
 307    <!ATTLIST constants id CDATA #REQUIRED
 308                        label CDATA #REQUIRED
 309                        kind (enum|bits|const) #REQUIRED
 310                        since CDATA "1.0">
 311 
 312    <!ELEMENT constant ANY>
 313    <!ATTLIST constant id CDATA #REQUIRED
 314                       num CDATA #REQUIRED>
 315 
 316    <!ELEMENT tm (#PCDATA)>
 317 
 318    <!ELEMENT i (#PCDATA|jvmti|tm)*>
 319 
 320    <!ELEMENT b (#PCDATA|jvmti|code)*>
 321 
 322    <!ELEMENT code (#PCDATA|space)*>
 323 
 324    <!ELEMENT pre ANY>
 325 
 326    <!ELEMENT space EMPTY>
 327 
 328    <!ELEMENT jvmti EMPTY>
 329 
 330    <!ELEMENT example (#PCDATA|i)*>
 331 
 332    <!ELEMENT br EMPTY>
 333 
 334    <!ELEMENT p EMPTY>
 335 
 336    <!ELEMENT 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         majorversion="9"
 362         minorversion="0"
 363         microversion="0">
 364   <title subtitle="Version">
 365     <tm>JVM</tm> Tool Interface
 366   </title>
 367 
 368   <intro id="whatIs" label="What is the JVM Tool Interface?">
 369     The <tm>JVM</tm> Tool Interface (<jvmti/>)
 370     is a programming interface used by development and monitoring tools.
 371     It provides both a way to inspect the state and
 372     to control the execution of applications running in the
 373     <tm>Java</tm> virtual machine (VM).
 374     <p/>
 375     <jvmti/> is intended to provide a VM interface for the full breadth of tools
 376     that need access to VM state, including but not limited to: profiling,
 377     debugging, monitoring, thread analysis, and coverage analysis tools.
 378     <p/>
 379     <jvmti/> may not be available in all implementations of the <tm>Java</tm> virtual
 380     machine.
 381     <p/>
 382     <jvmti/> is a two-way interface.
 383     A client of <jvmti/>, hereafter called an <i>agent</i>,
 384     can be notified of
 385     interesting occurrences through <internallink id="EventSection">events</internallink>.
 386     <jvmti/>
 387     can query and control the application through many
 388     <internallink id="FunctionSection">functions</internallink>,
 389     either in response to events or
 390     independent of them.
 391     <p/>
 392     Agents run in the same process with and communicate directly with
 393     the virtual machine executing
 394     the application being examined.  This communication is
 395     through a native interface (<jvmti/>). The native in-process interface allows
 396     maximal control with minimal intrusion on the part of a tool.
 397     Typically, agents are relatively compact. They can be controlled
 398     by a separate process which implements the bulk of a tool's
 399     function without interfering with the target application's normal execution.
 400   </intro>
 401 
 402   <intro id="architecture" label="Architecture">
 403     Tools can be written directly to <jvmti/> or indirectly
 404     through higher level interfaces.
 405     The Java Platform Debugger Architecture includes <jvmti/>, but also
 406     contains higher-level, out-of-process debugger interfaces. The higher-level
 407     interfaces are more appropriate than <jvmti/> for many tools.
 408     For more information on the Java Platform Debugger Architecture,
 409     see the
 410     <externallink id="jpda/architecture.html">Java
 411       Platform Debugger Architecture website</externallink>.
 412   </intro>
 413 
 414   <intro id="writingAgents" label="Writing Agents">
 415     Agents can be written in any native language that supports C
 416     language calling conventions and C or C++
 417     definitions.
 418     <p/>
 419     The function, event, data type, and constant definitions needed for
 420     using <jvmti/> are defined in the include file <code>jvmti.h</code>.
 421     To use these definitions add the <tm>J2SE</tm> include directory
 422     to your include path and add
 423     <example>
 424 #include &lt;jvmti.h&gt;
 425     </example>
 426     to your source code.
 427   </intro>
 428 
 429   <intro id="deployingAgents" label="Deploying Agents">
 430     An agent is deployed in a platform specific manner but is typically the
 431     platform equivalent of a dynamic library. On the <tm>Windows</tm> operating
 432     system, for example, an agent library is a "Dynamic Linked Library" (DLL).
 433     On the <tm>Solaris</tm> Operating Environment, an agent library is a shared
 434     object (<code>.so</code> file).
 435     <p/>
 436 
 437     An agent may be started at VM startup by specifying the agent library
 438     name using a <internallink id="starting">command line option</internallink>.
 439     Some implementations may support a mechanism to <internallink id="onattach">
 440     start agents</internallink> in the live <functionlink id="GetPhase">phase</functionlink>.
 441     The details of how this is initiated are implementation specific.
 442   </intro>
 443 
 444     <intro id="entryPoint" label="Statically Linked Agents (since version 1.2.3)">
 445 
 446       A native JVMTI Agent may be <i>statically linked</i> with the VM.
 447       The manner in which the library and VM image are combined is
 448       implementation-dependent.
 449       An agent L whose image has been combined with the VM is defined as
 450       <i>statically linked</i> if and only if the agent exports a function
 451       called Agent_OnLoad_L.
 452 <p/>
 453       If a <i>statically linked</i> agent L exports a function called
 454       Agent_OnLoad_L and a function called Agent_OnLoad, the Agent_OnLoad
 455       function will be ignored.
 456       If an agent L is <i>statically linked</i>, an Agent_OnLoad_L
 457       function will be invoked with the same arguments and expected return
 458       value as specified for the Agent_OnLoad function.
 459       An agent L that is <i>statically linked</i> will prohibit an agent of
 460       the same name from being loaded dynamically.
 461 <p/>
 462       The VM will invoke the Agent_OnUnload_L function of the agent, if such
 463       a function is exported, at the same point during VM execution as it would
 464       have called the dynamic entry point Agent_OnUnLoad. A statically loaded
 465       agent cannot be unloaded. The Agent_OnUnload_L function will still be
 466       called to do any other agent shutdown related tasks.
 467       If a <i>statically linked</i> agent L exports a function called
 468       Agent_OnUnLoad_L and a function called Agent_OnUnLoad, the Agent_OnUnLoad
 469       function will be ignored.
 470 <p/>
 471       If an agent L is <i>statically linked</i>, an Agent_OnAttach_L function
 472       will be invoked with the same arguments and expected return value as
 473       specified for the Agent_OnAttach function.
 474       If a <i>statically linked</i> agent L exports a function called
 475       Agent_OnAttach_L and a function called Agent_OnAttach, the Agent_OnAttach
 476       function will be ignored.
 477 </intro>
 478 
 479   <intro id="starting" label="Agent Command Line Options">
 480     The term "command-line option" is used below to
 481     mean options supplied in the <code>JavaVMInitArgs</code> argument
 482     to the <code>JNI_CreateJavaVM</code> function of the JNI
 483     Invocation API.
 484     <p/>
 485     One of the two following
 486     command-line options is used on VM startup to
 487     properly load and run agents.
 488     These arguments identify the library containing
 489     the agent as well as an options
 490     string to be passed in at startup.
 491     <dl>
 492       <dt><code>-agentlib:</code><i>&lt;agent-lib-name&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
 493       <dd>
 494         The name following <code>-agentlib:</code> is the name of the
 495         library to load.  Lookup of the library, both its full name and location,
 496         proceeds in a platform-specific manner.
 497         Typically, the <i>&lt;agent-lib-name&gt;</i> is expanded to an
 498         operating system specific file name.
 499         The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
 500         For example, if the option
 501         <code>-agentlib:foo=opt1,opt2</code> is specified, the VM will attempt to
 502         load the shared library <code>foo.dll</code> from the system <code>PATH</code>
 503         under <tm>Windows</tm> or <code>libfoo.so</code> from the
 504         <code>LD_LIBRARY_PATH</code> under the <tm>Solaris</tm> operating
 505         environment.
 506         If the agent library is statically linked into the executable
 507         then no actual loading takes place.
 508     <p/>
 509       </dd>
 510       <dt><code>-agentpath:</code><i>&lt;path-to-agent&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
 511       <dd>
 512         The path following <code>-agentpath:</code> is the absolute path from which
 513         to load the library.
 514         No library name expansion will occur.
 515         The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
 516         For example, if the option
 517         <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code> is specified, the VM will attempt to
 518         load the shared library <code>c:\myLibs\foo.dll</code>. If the agent
 519         library is statically linked into the executable
 520         then no actual loading takes place.
 521     <p/>
 522       </dd>
 523     </dl>
 524     For a dynamic shared library agent, the start-up routine
 525     <internallink id="onload"><code>Agent_OnLoad</code></internallink>
 526     in the library will be invoked. If the agent library is statically linked
 527     into the executable then the system will attempt to invoke the
 528     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> entry point where
 529     &lt;agent-lib-name&gt; is the basename of the
 530     agent. In the above example <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code>,
 531     the system will attempt to find and call the <code>Agent_OnLoad_foo</code> start-up routine.
 532     <p/>
 533     Libraries loaded with <code>-agentlib:</code> or <code>-agentpath:</code>
 534     will be searched for JNI native method implementations to facilitate the
 535     use of Java programming language code in tools, as is needed for
 536     <internallink id="bci">bytecode instrumentation</internallink>.
 537     <p/>
 538     The agent libraries will be searched after all other libraries have been
 539     searched (agents wishing to override or intercept the native method
 540     implementations of non-agent methods can use the
 541     <eventlink id="NativeMethodBind">NativeMethodBind event</eventlink>).
 542     <p/>
 543     These switches do the above and nothing more - they do not change the
 544     state of the VM or <jvmti/>.  No command line options are needed
 545     to enable <jvmti/>
 546     or aspects of <jvmti/>, this is handled programmatically
 547     by the use of
 548     <internallink id="capability">capabilities</internallink>.
 549   </intro>
 550 
 551   <intro id="startup" label="Agent Start-Up">
 552     The VM starts each agent by invoking a start-up function.
 553     If the agent is started in the <code>OnLoad</code>
 554     <functionlink id="GetPhase">phase</functionlink> the function
 555     <internallink id="onload"><code>Agent_OnLoad</code></internallink>
 556     or <internallink id="onload"><code>Agent_OnLoad_L</code></internallink>
 557     for statically linked agents will be invoked.
 558     If the agent is started in the live
 559     <functionlink id="GetPhase">phase</functionlink> the function
 560     <internallink id="onattach"><code>Agent_OnAttach</code></internallink>
 561     or <internallink id="onattach"><code>Agent_OnAttach_L</code></internallink>
 562     for statically linked agents will be invoked.
 563     Exactly one call to a start-up function is made per agent.
 564   </intro>
 565 
 566   <intro id="onload" label="Agent Start-Up (OnLoad phase)">
 567     If an agent is started during the <code>OnLoad</code> phase then its
 568     agent library must export a start-up function with the following prototype:
 569     <example>
 570 JNIEXPORT jint JNICALL
 571 Agent_OnLoad(JavaVM *vm, char *options, void *reserved)</example>
 572     Or for a statically linked agent named 'L':
 573     <example>
 574 JNIEXPORT jint JNICALL
 575 Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved)</example>
 576 
 577     The VM will start the agent by calling this function.
 578     It will be called early enough in VM initialization that:
 579     <ul>
 580       <li><functionlink id="SetSystemProperty">system properties</functionlink>
 581         may be set before they have been used in the start-up of the VM</li>
 582       <li>the full set of
 583         <internallink id="capability">capabilities</internallink>
 584         is still available (note that capabilities that configure the VM
 585         may only be available at this time--see the
 586         <internallink id="capability">Capability function section</internallink>)</li>
 587       <li>no bytecodes have executed</li>
 588       <li>no classes have been loaded</li>
 589       <li>no objects have been created</li>
 590     </ul>
 591     <p/>
 592     The VM will call the <code>Agent_OnLoad</code> or
 593     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> function with
 594     <i>&lt;options&gt;</i> as the second argument -
 595     that is, using the command-line option examples,
 596     <code>"opt1,opt2"</code> will be passed to the <code>char *options</code>
 597     argument of <code>Agent_OnLoad</code>.
 598     The <code>options</code> argument is encoded as a
 599     <internallink id="mUTF">modified UTF-8</internallink> string.
 600     If <i>=&lt;options&gt;</i> is not specified,
 601     a zero length string is passed to <code>options</code>.
 602     The lifespan of the <code>options</code> string is the
 603     <code>Agent_OnLoad</code> or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code>
 604     call.  If needed beyond this time the string or parts of the string must
 605     be copied.
 606     The period between when <code>Agent_OnLoad</code> is called and when it
 607     returns is called the <i>OnLoad phase</i>.
 608     Since the VM is not initialized during the OnLoad
 609     <functionlink id="GetPhase">phase</functionlink>,
 610     the set of allowed operations
 611     inside <code>Agent_OnLoad</code> is restricted (see the function descriptions for the
 612     functionality available at this time).
 613     The agent can safely process the options and set
 614     event callbacks with <functionlink id="SetEventCallbacks"></functionlink>. Once
 615     the VM initialization event is received
 616     (that is, the <eventlink id="VMInit">VMInit</eventlink>
 617     callback is invoked), the agent
 618     can complete its initialization.
 619     <rationale>
 620       Early startup is required so that agents can set the desired capabilities,
 621       many of which must be set before the VM is initialized.
 622       In JVMDI, the -Xdebug command-line option provided
 623       very coarse-grain control of capabilities.
 624       JVMPI implementations use various tricks to provide a single "JVMPI on" switch.
 625       No reasonable command-line
 626       option could provide the fine-grain of control required to balance needed capabilities vs
 627       performance impact.
 628       Early startup is also needed so that agents can control the execution
 629       environment - modifying the file system and system properties to install
 630       their functionality.
 631     </rationale>
 632     <p/>
 633     The return value from <code>Agent_OnLoad</code> or
 634     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> is used to indicate an error.
 635     Any value other than zero indicates an error and causes termination of the VM.
 636   </intro>
 637 
 638   <intro id="onattach" label="Agent Start-Up (Live phase)">
 639     A VM may support a mechanism that allows agents to be started in the VM during the live
 640     <functionlink id="GetPhase">phase</functionlink>. The details of how this is supported,
 641     are implementation specific. For example, a tool may use some platform specific mechanism,
 642     or implementation specific API, to attach to the running VM, and request it start a given
 643     agent.
 644     <p/>
 645     If an agent is started during the live phase then its agent library
 646     must export a start-up function
 647     with the following prototype:
 648     <example>
 649 JNIEXPORT jint JNICALL
 650 Agent_OnAttach(JavaVM* vm, char *options, void *reserved)</example>
 651 Or for a statically linked agent named 'L':
 652     <example>
 653 JNIEXPORT jint JNICALL
 654 Agent_OnAttach_L(JavaVM* vm, char *options, void *reserved)</example>
 655 
 656     <p/>
 657     The VM will start the agent by calling this function.
 658     It will be called in the context of a thread
 659     that is attached to the VM. The first argument <i>&lt;vm&gt;</i> is the Java VM.
 660     The <i>&lt;options&gt;</i> argument is the startup options provided to the agent.
 661     <i>&lt;options&gt;</i> is encoded as a <internallink id="mUTF">modified UTF-8
 662     </internallink> string.
 663     If startup options were not provided, a zero length string is passed to
 664     <code>options</code>. The lifespan of the <code>options</code> string is the
 665     <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name&gt;</code> call.
 666     If needed beyond this time the string or parts of the string must be copied.
 667     <p/>
 668     Note that some <internallink id="capability">capabilities</internallink>
 669     may not be available in the live phase.
 670     <p/>
 671     The <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name
 672     &gt;</code> function initializes the agent and returns a value
 673     to the VM to indicate if an error occurred. Any value other than zero indicates an error.
 674     An error does not cause the VM to terminate. Instead the VM ignores the error, or takes
 675     some implementation specific action -- for example it might print an error to standard error,
 676     or record the error in a system log.
 677   </intro>
 678 
 679   <intro id="onunload" label="Agent Shutdown">
 680     The library may optionally export a
 681     shutdown function with the following prototype:
 682     <example>
 683 JNIEXPORT void JNICALL
 684 Agent_OnUnload(JavaVM *vm)</example>
 685     Or for a statically linked agent named 'L':
 686     <example>
 687 JNIEXPORT void JNICALL
 688 Agent_OnUnload_L(JavaVM *vm)</example>
 689 
 690     This function will be called by the VM when the library is about to be unloaded.
 691     The library will be unloaded (unless it is statically linked into the
 692     executable) and this function will be called if some platform specific
 693     mechanism causes the unload (an unload mechanism is not specified in this document)
 694     or the library is (in effect) unloaded by the termination of the VM whether through
 695     normal termination or VM failure, including start-up failure.
 696     Uncontrolled shutdown is, of course, an exception to this rule.
 697     Note the distinction between this function and the
 698     <eventlink id="VMDeath">VM Death event</eventlink>: for the VM Death event
 699     to be sent, the VM must have run at least to the point of initialization and a valid
 700     <jvmti/> environment must exist which has set a callback for VMDeath
 701     and enabled the event.
 702     None of these are required for <code>Agent_OnUnload</code> or
 703     <code>Agent_OnUnload_&lt;agent-lib-name&gt;</code> and this function
 704     is also called if the library is unloaded for other reasons.
 705     In the case that a VM Death event is sent, it will be sent before this
 706     function is called (assuming this function is called due to VM termination).
 707     This function can be used to clean-up resources allocated by the agent.
 708   </intro>
 709 
 710   <intro id="tooloptions" label="JAVA_TOOL_OPTIONS">
 711     Since the command-line cannot always be accessed or modified, for example in embedded VMs
 712     or simply VMs launched deep within scripts, a <code>JAVA_TOOL_OPTIONS</code> variable is
 713     provided so that agents may be launched in these cases.
 714     <p/>
 715     Platforms which support environment variables or other named strings, may support the
 716     <code>JAVA_TOOL_OPTIONS</code> variable.  This variable will be broken into options at white-space
 717     boundaries.  White-space characters include space, tab, carriage-return, new-line,
 718     vertical-tab, and form-feed.  Sequences of white-space characters are considered
 719     equivalent to a single white-space character.  No white-space is included in the options
 720     unless quoted.  Quoting is as follows:
 721     <ul>
 722         <li>All characters enclosed between a pair of single quote marks (''), except a single
 723         quote, are quoted.</li>
 724         <li>Double quote characters have no special meaning inside a pair of single quote marks.</li>
 725         <li>All characters enclosed between a pair of double quote marks (""), except a double
 726         quote, are quoted.</li>
 727         <li>Single quote characters have no special meaning inside a pair of double quote marks.</li>
 728         <li>A quoted part can start or end anywhere in the variable.</li>
 729         <li>White-space characters have no special meaning when quoted -- they are included in
 730         the option like any other character and do not mark white-space boundaries.</li>
 731         <li>The pair of quote marks is not included in the option.</li>
 732     </ul>
 733     <code>JNI_CreateJavaVM</code> (in the JNI Invocation API) will prepend these options to the options supplied
 734     in its <code>JavaVMInitArgs</code> argument. Platforms may disable this feature in cases where security is
 735     a concern; for example, the Reference Implementation disables this feature on Unix systems when
 736     the effective user or group ID differs from the real ID.
 737     This feature is intended to support the initialization of tools -- specifically including the
 738     launching of native or Java programming language agents.  Multiple tools may wish to use this
 739     feature, so the variable should not be overwritten, instead,  options should be appended to
 740     the variable.  Note that since the variable is processed at the time of the JNI Invocation
 741     API create VM call, options processed by a launcher (e.g., VM selection options) will not be handled.
 742   </intro>
 743 
 744   <intro id="environments" label="Environments">
 745     The <jvmti/> specification supports the use of multiple simultaneous
 746     <jvmti/> agents.
 747     Each agent has its own <jvmti/> environment.
 748     That is, the <jvmti/> state is
 749     separate for each agent - changes to one environment do not affect the
 750     others.  The state of a <jvmti/>
 751     environment includes:
 752     <ul>
 753       <li><functionlink id="SetEventCallbacks">the event callbacks</functionlink></li>
 754       <li><functionlink id="SetEventNotificationMode">the set of events which are enabled</functionlink></li>
 755       <li><internallink id="capability">the capabilities</internallink></li>
 756       <li><internallink id="memory">the memory allocation/deallocation hooks</internallink></li>
 757     </ul>
 758     Although their <jvmti/> state
 759     is separate, agents inspect and modify the shared state
 760     of the VM, they also share the native environment in which they execute.
 761     As such, an agent can perturb the results of other agents or cause them
 762     to fail.  It is the responsibility of the agent writer to specify the level
 763     of compatibility with other agents.  <jvmti/> implementations are not capable
 764     of preventing destructive interactions between agents. Techniques to reduce
 765     the likelihood of these occurrences are beyond the scope of this document.
 766     <p/>
 767     An agent creates a <jvmti/> environment
 768     by passing a <jvmti/> version
 769     as the interface ID to the JNI Invocation API function
 770     <externallink id="jni/invocation.html#getenv">
 771       <code>GetEnv</code></externallink>.
 772     See <internallink id="jvmtiEnvAccess">Accessing <jvmti/> Functions</internallink>
 773     for more details on the creation and use of
 774     <jvmti/> environments.
 775     Typically, <jvmti/> environments are created by calling <code>GetEnv</code> from
 776     <internallink id="onload"><code>Agent_OnLoad</code></internallink>.
 777   </intro>
 778 
 779   <intro id="bci" label="Bytecode Instrumentation">
 780     This interface does not include some events that one might expect in an interface with
 781     profiling support.  Some examples include object allocation events and full speed
 782     method enter and exit events.  The interface instead provides support for
 783     <i>bytecode instrumentation</i>, the ability to alter the Java virtual machine
 784     bytecode instructions which comprise the target program.  Typically, these alterations
 785     are to add "events" to the code of a method - for example, to add, at the beginning of a method,
 786     a call to <code>MyProfiler.methodEntered()</code>.
 787     Since the changes are purely additive, they do not modify application
 788     state or behavior.
 789     Because the inserted agent code is standard bytecodes, the VM can run at full speed,
 790     optimizing not only the target program but also the instrumentation.  If the
 791     instrumentation does not involve switching from bytecode execution, no expensive
 792     state transitions are needed.  The result is high performance events.
 793     This approach also provides complete control to the agent: instrumentation can be
 794     restricted to "interesting" portions of the code (e.g., the end user's code) and
 795     can be conditional.  Instrumentation can run entirely in Java programming language
 796     code or can call into the native agent.  Instrumentation can simply maintain
 797     counters or can statistically sample events.
 798     <p/>
 799     Instrumentation can be inserted in one of three ways:
 800     <ul>
 801       <li>
 802         Static Instrumentation: The class file is instrumented before it
 803         is loaded into the VM - for example, by creating a duplicate directory of
 804         <code>*.class</code> files which have been modified to add the instrumentation.
 805         This method is extremely awkward and, in general, an agent cannot know
 806         the origin of the class files which will be loaded.
 807       </li>
 808       <li>
 809         Load-Time Instrumentation: When a class file is loaded by the VM, the raw
 810         bytes of the class file are sent for instrumentation to the agent.
 811         The <eventlink id="ClassFileLoadHook"/>
 812         event, triggered by the class load,
 813         provides this functionality.  This mechanism provides efficient
 814         and complete access to one-time instrumentation.
 815       </li>
 816       <li>
 817         Dynamic Instrumentation: A class which is already loaded (and possibly
 818         even running) is modified.  This optional feature is provided by the
 819         <eventlink id="ClassFileLoadHook"/> event, triggered by calling the
 820         <functionlink id="RetransformClasses"/> function.
 821         Classes can be modified multiple times and can be returned to their
 822         original state.
 823         The mechanism allows instrumentation which changes during the
 824         course of execution.
 825       </li>
 826     </ul>
 827     <p/>
 828     The class modification functionality provided in this interface
 829     is intended to provide a mechanism for instrumentation
 830     (the <eventlink id="ClassFileLoadHook"/> event
 831     and the <functionlink id="RetransformClasses"/> function)
 832     and, during development, for fix-and-continue debugging
 833     (the <functionlink id="RedefineClasses"/> function).
 834     <p/>
 835     Care must be taken to avoid perturbing dependencies, especially when
 836     instrumenting core classes.  For example, an approach to getting notification
 837     of every object allocation is to instrument the constructor on
 838     <code>Object</code>.  Assuming that the constructor is initially
 839     empty, the constructor could be changed to:
 840     <example>
 841       public Object() {
 842         MyProfiler.allocationTracker(this);
 843       }
 844     </example>
 845     However, if this change was made using the
 846     <eventlink id="ClassFileLoadHook"/>
 847     event then this might impact a typical VM as follows:
 848     the first created object will call the constructor causing a class load of
 849     <code>MyProfiler</code>; which will then cause
 850     object creation, and since <code>MyProfiler</code> isn't loaded yet,
 851     infinite recursion; resulting in a stack overflow.  A refinement of this
 852     would be to delay invoking the tracking method until a safe time.  For
 853     example, <code>trackAllocations</code> could be set in the
 854     handler for the <code>VMInit</code> event.
 855     <example>
 856       static boolean trackAllocations = false;
 857 
 858       public Object() {
 859         if (trackAllocations) {
 860           MyProfiler.allocationTracker(this);
 861         }
 862       }
 863     </example>
 864     <p/>
 865     The <functionlink id="SetNativeMethodPrefix"/> allows native methods
 866     to be instrumented by the use of wrapper methods.
 867   </intro>
 868 
 869 <intro id="bcimodules" label="Bytecode Instrumentation of code in modules">
 870   Agents can use the functions <functionlink id="AddModuleReads"/>,
 871   <functionlink id="AddModuleExports"/>, <functionlink id="AddModuleOpens"/>,
 872   <functionlink id="AddModuleUses"/> and <functionlink id="AddModuleProvides"/>
 873   to update a module to expand the set of modules that it reads, the set of
 874   packages that it exports or opens to other modules, or the services that it
 875   uses and provides.
 876   <p/>
 877   As an aid to agents that deploy supporting classes on the search path of
 878   the bootstrap class loader, or the search path of the class loader that
 879   loads the main class, the Java virtual machine arranges for the module
 880   of classes transformed by the <eventlink id="ClassFileLoadHook"/> event to
 881   read the unnamed module of both class loaders.
 882 </intro>
 883 
 884   <intro id="mUTF" label="Modified UTF-8 String Encoding">
 885     <jvmti/> uses modified UTF-8 to encode character strings.
 886     This is the same encoding used by JNI.
 887     Modified UTF-8 differs
 888     from standard UTF-8 in the representation of supplementary characters
 889     and of the null character. See the
 890     <externallink id="jni/types.html#modified-utf-8-strings">
 891       Modified UTF-8 Strings</externallink>
 892     section of the JNI specification for details.
 893   </intro>
 894 
 895   <intro id="context" label="Specification Context">
 896     Since this interface provides access to the state of applications running in the
 897     Java virtual machine;
 898     terminology refers to the Java platform and not the native
 899     platform (unless stated otherwise).  For example:
 900     <ul>
 901       <li>"thread" means Java programming language thread.</li>
 902       <li>"stack frame" means Java virtual machine stack frame.</li>
 903       <li>"class" means Java programming language class.</li>
 904       <li>"heap" means Java virtual machine heap.</li>
 905       <li>"monitor" means Java programming language object monitor.</li>
 906     </ul>
 907     <p/>
 908     Sun, Sun Microsystems, the Sun logo, Java, and JVM
 909     are trademarks or registered trademarks of Oracle
 910     and/or its affiliates, in the U.S. and other countries.
 911   </intro>
 912 
 913 
 914 <functionsection label="Functions">
 915   <intro id="jvmtiEnvAccess" label="Accessing Functions">
 916     Native code accesses <jvmti/> features
 917     by calling <jvmti/> functions.
 918     Access to <jvmti/> functions is by use of an interface pointer
 919     in the same manner as
 920     <externallink id="jni/design.html">Java
 921       Native Interface (JNI) functions</externallink> are accessed.
 922     The <jvmti/> interface pointer is called the
 923     <i>environment pointer</i>.
 924     <p/>
 925     An environment pointer is a pointer to an environment and has
 926     the type <code>jvmtiEnv*</code>.
 927     An environment has information about its <jvmti/> connection.
 928     The first value in the environment is a pointer to the function table.
 929     The function table is an array of pointers to <jvmti/> functions.
 930     Every function pointer is at a predefined offset inside the
 931     array.
 932     <p/>
 933     When used from the C language:
 934     double indirection is used to access the functions;
 935     the environment pointer provides context and is the first
 936     parameter of each function call; for example:
 937     <example>
 938 jvmtiEnv *jvmti;
 939 ...
 940 jvmtiError err = (*jvmti)->GetLoadedClasses(jvmti, &amp;class_count, &amp;classes);
 941     </example>
 942     <p/>
 943     When used from the C++ language:
 944     functions are accessed as member functions of <code>jvmtiEnv</code>;
 945     the environment pointer is not passed to the function call; for example:
 946     <example>
 947 jvmtiEnv *jvmti;
 948 ...
 949 jvmtiError err = jvmti->GetLoadedClasses(&amp;class_count, &amp;classes);
 950     </example>
 951     Unless otherwise stated, all examples and declarations in this
 952     specification use the C language.
 953     <p/>
 954     A <jvmti/> environment can be obtained through the JNI Invocation API
 955     <code>GetEnv</code> function:
 956     <example>
 957 jvmtiEnv *jvmti;
 958 ...
 959 (*jvm)->GetEnv(jvm, &amp;jvmti, JVMTI_VERSION_1_0);
 960     </example>
 961     Each call to <code>GetEnv</code>
 962     creates a new <jvmti/> connection and thus
 963     a new <jvmti/> environment.
 964     The <code>version</code> argument of <code>GetEnv</code> must be
 965     a <jvmti/> version.
 966     The returned environment may have a different version than the
 967     requested version but the returned environment must be compatible.
 968     <code>GetEnv</code> will return <code>JNI_EVERSION</code> if a
 969     compatible version is not available, if <jvmti/> is not supported or
 970     <jvmti/> is not supported in the current VM configuration.
 971     Other interfaces may be added for creating <jvmti/> environments
 972     in specific contexts.
 973     Each environment has its own state (for example,
 974     <functionlink id="SetEventNotificationMode">desired events</functionlink>,
 975     <functionlink id="SetEventCallbacks">event handling functions</functionlink>, and
 976     <functionlink id="AddCapabilities">capabilities</functionlink>).
 977     An environment is released with
 978     <functionlink id="DisposeEnvironment"></functionlink>.
 979     Thus, unlike JNI which has one environment per thread, <jvmti/> environments work
 980     across threads and are created dynamically.
 981   </intro>
 982 
 983   <intro id="functionReturn" label="Function Return Values">
 984     <jvmti/> functions always return an
 985     <internallink id="ErrorSection">error code</internallink> via the
 986     <datalink id="jvmtiError"/> function return value.
 987     Some functions can return additional
 988     values through pointers provided by the calling function.
 989     In some cases, <jvmti/> functions allocate memory that your program must
 990     explicitly deallocate. This is indicated in the individual <jvmti/>
 991     function descriptions.  Empty lists, arrays, sequences, etc are
 992     returned as <code>NULL</code>.
 993     <p/>
 994     In the event that the <jvmti/> function encounters
 995     an error (any return value other than <code>JVMTI_ERROR_NONE</code>) the values
 996     of memory referenced by argument pointers is undefined, but no memory
 997     will have been allocated and no global references will have been allocated.
 998     If the error occurs because of invalid input, no action will have occurred.
 999   </intro>
1000 
1001 <intro id="refs" label="Managing JNI Object References">
1002     <jvmti/> functions identify objects with JNI references
1003     (<datalink id="jobject"/> and <datalink id="jclass"/>)
1004     and their derivatives
1005     (<datalink id="jthread"/> and <datalink id="jthreadGroup"/>).
1006     References passed to
1007     <jvmti/> functions can be either global or local, but they must be
1008     strong references. All references returned by <jvmti/> functions are
1009     local references--these local references are created
1010     during the <jvmti/> call.
1011     Local references are a resource that must be managed (see the
1012     <externallink id="jni/functions.html#local-references">
1013       JNI Documentation</externallink>).
1014     When threads return from native code all local references
1015     are freed.  Note that some threads, including typical
1016     agent threads, will never return from native code.
1017     A thread is ensured the ability to create sixteen local
1018     references without the need for any explicit management.
1019     For threads executing a limited number of <jvmti/> calls before
1020     returning from native code
1021     (for example, threads processing events),
1022     it may be determined that no explicit management
1023     is needed.
1024     However, long running agent threads will need explicit
1025     local reference management--usually with the JNI functions
1026     <code>PushLocalFrame</code> and <code>PopLocalFrame</code>.
1027     Conversely, to preserve references beyond the
1028     return from native code, they must be converted to global references.
1029     These rules do not apply to <datalink id="jmethodID"/> and <datalink id="jfieldID"/>
1030     as they are not <datalink id="jobject"/>s.
1031 </intro>
1032 
1033     <intro id="prereqState" label="Prerequisite State for Calling Functions">
1034       Unless the function explicitly states that the agent must bring
1035       a thread or the VM to a particular state (for example, suspended),
1036       the <jvmti/> implementation is responsible for bringing the VM to a
1037       safe and consistent state for performing the function.
1038     </intro>
1039 
1040     <intro id="functionsExceptions" label="Exceptions and Functions">
1041       <jvmti/> functions never throw exceptions; error conditions are
1042       communicated via the
1043       <internallink id="functionReturn">function return value</internallink>.
1044       Any existing exception state is preserved across a call to a
1045       <jvmti/> function.
1046       See the
1047       <externallink
1048         id="jni/design.html#java-exceptions"
1049              >Java Exceptions</externallink>
1050       section of the JNI specification for information on handling exceptions.
1051     </intro>
1052 
1053   <category id="memory" label="Memory Management">
1054     <intro>
1055       These functions provide for the allocation and deallocation of
1056       memory used by <jvmti/> functionality and can be used to provide
1057       working memory for agents.
1058       Memory managed by <jvmti/> is not compatible with other memory
1059       allocation libraries and mechanisms.
1060     </intro>
1061 
1062     <function id="Allocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="46">
1063       <synopsis>Allocate</synopsis>
1064       <description>
1065         Allocate an area of memory through the <jvmti/> allocator.
1066         The allocated
1067         memory should be freed with <functionlink id="Deallocate"></functionlink>.
1068       </description>
1069       <origin>jvmdi</origin>
1070       <capabilities>
1071       </capabilities>
1072       <parameters>
1073         <param id="size">
1074           <jlong/>
1075           <description>
1076             The number of bytes to allocate.
1077             <rationale>
1078               <code>jlong</code> is used for compatibility with JVMDI.
1079             </rationale>
1080           </description>
1081         </param>
1082         <param id="mem_ptr">
1083           <allocbuf incount="size"><uchar/></allocbuf>
1084           <description>
1085             On return, a pointer to the beginning of the allocated memory.
1086             If <code>size</code> is zero, <code>NULL</code> is returned.
1087           </description>
1088         </param>
1089       </parameters>
1090       <errors>
1091         <error id="JVMTI_ERROR_OUT_OF_MEMORY">
1092           Memory request cannot be honored.
1093         </error>
1094         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
1095           <paramlink id="size"></paramlink> is less than zero.
1096         </error>
1097       </errors>
1098     </function>
1099 
1100     <function id="Deallocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="47">
1101       <synopsis>Deallocate</synopsis>
1102       <description>
1103         Deallocate <code>mem</code>  using the <jvmti/> allocator.
1104         This function should
1105         be used to deallocate any memory allocated and returned
1106         by a <jvmti/> function
1107         (including memory allocated with <functionlink id="Allocate"></functionlink>).
1108         All allocated memory must be deallocated
1109         or the memory cannot be reclaimed.
1110       </description>
1111       <origin>jvmdi</origin>
1112       <capabilities>
1113       </capabilities>
1114       <parameters>
1115         <param id="mem">
1116           <outbuf>
1117             <uchar/>
1118             <nullok>the call is ignored</nullok>
1119           </outbuf>
1120           <description>
1121             A pointer to the beginning of the allocated memory.
1122             Please ignore "On return, the elements are set."
1123               <todo>keep it from generating "On return, the elements are set"</todo>
1124           </description>
1125         </param>
1126       </parameters>
1127       <errors>
1128       </errors>
1129     </function>
1130   </category>
1131 
1132   <category id="threadCategory" label="Thread">
1133     <intro>
1134     </intro>
1135 
1136     <function id="GetThreadState" num="17">
1137       <synopsis>Get Thread State</synopsis>
1138       <description>
1139         Get the state of a thread.  The state of the thread is represented by the
1140         answers to the hierarchical set of questions below:
1141           <ul type="circle">
1142             <li><i>Alive?</i>
1143               <ul>
1144                 <li>Not alive.
1145                   <ul type="circle">
1146                     <li><i>Why not alive?</i>
1147                       <ul>
1148                         <li>New.</li>
1149                         <li>Terminated (<datalink
1150                             id="JVMTI_THREAD_STATE_TERMINATED"><code>JVMTI_THREAD_STATE_TERMINATED</code></datalink>)</li>
1151                       </ul>
1152                     </li>
1153                   </ul>
1154                 </li>
1155                 <li>Alive (<datalink
1156                     id="JVMTI_THREAD_STATE_ALIVE"><code>JVMTI_THREAD_STATE_ALIVE</code></datalink>)
1157                   <ul type="circle">
1158                     <li><i>Suspended?</i>
1159                       <ul>
1160                         <li>Suspended (<datalink
1161                             id="JVMTI_THREAD_STATE_SUSPENDED"><code>JVMTI_THREAD_STATE_SUSPENDED</code></datalink>)</li>
1162                         <li>Not suspended</li>
1163                       </ul>
1164                     </li>
1165                     <li><i>Interrupted?</i>
1166                       <ul>
1167                         <li>Interrupted (<datalink
1168                             id="JVMTI_THREAD_STATE_INTERRUPTED"><code>JVMTI_THREAD_STATE_INTERRUPTED</code></datalink>)</li>
1169                         <li>Not interrupted.</li>
1170                       </ul>
1171                     </li>
1172                     <li><i>In native?</i>
1173                       <ul>
1174                         <li>In native code (<datalink
1175                             id="JVMTI_THREAD_STATE_IN_NATIVE"><code>JVMTI_THREAD_STATE_IN_NATIVE</code></datalink>)</li>
1176                         <li>In Java programming language code</li>
1177                       </ul>
1178                     </li>
1179                     <li><i>What alive state?</i>
1180                       <ul>
1181                         <li>Runnable (<datalink
1182                             id="JVMTI_THREAD_STATE_RUNNABLE"><code>JVMTI_THREAD_STATE_RUNNABLE</code></datalink>)</li>
1183                         <li>Blocked (<datalink
1184                             id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER"><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></datalink>)</li>
1185                         <li>Waiting (<datalink
1186                             id="JVMTI_THREAD_STATE_WAITING"><code>JVMTI_THREAD_STATE_WAITING</code></datalink>)
1187                           <ul type="circle">
1188                             <li><i>Timed wait?</i>
1189                               <ul>
1190                                 <li>Indefinite (<datalink
1191                                     id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY"><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></datalink></li>
1192                                 <li>Timed (<datalink
1193                                     id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT"><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></datalink>)</li>
1194                               </ul>
1195                             </li>
1196                             <li><i>Why waiting?</i>
1197                               <ul>
1198                                 <li>Object.wait (<datalink
1199                                     id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT"><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></datalink>)</li>
1200                                 <li>LockSupport.park (<datalink
1201                                     id="JVMTI_THREAD_STATE_PARKED"><code>JVMTI_THREAD_STATE_PARKED</code></datalink>)</li>
1202                                 <li>Sleeping (<datalink
1203                                     id="JVMTI_THREAD_STATE_SLEEPING"><code>JVMTI_THREAD_STATE_SLEEPING</code></datalink>)</li>
1204                               </ul>
1205                             </li>
1206                           </ul>
1207                         </li>
1208                       </ul>
1209                     </li>
1210                   </ul>
1211                 </li>
1212               </ul>
1213             </li>
1214           </ul>
1215         <p/>
1216         The answers are represented by the following bit vector.
1217         <constants id="jvmtiThreadState" label="Thread State Flags" kind="bits">
1218           <constant id="JVMTI_THREAD_STATE_ALIVE" num="0x0001">
1219             Thread is alive. Zero if thread is new (not started) or terminated.
1220           </constant>
1221           <constant id="JVMTI_THREAD_STATE_TERMINATED" num="0x0002">
1222             Thread has completed execution.
1223           </constant>
1224           <constant id="JVMTI_THREAD_STATE_RUNNABLE" num="0x0004">
1225             Thread is runnable.
1226           </constant>
1227           <constant id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER" num="0x0400">
1228             Thread is waiting to enter a synchronization block/method or,
1229             after an <code>Object.wait()</code>, waiting to re-enter a
1230             synchronization block/method.
1231           </constant>
1232           <constant id="JVMTI_THREAD_STATE_WAITING" num="0x0080">
1233             Thread is waiting.
1234           </constant>
1235           <constant id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY" num="0x0010">
1236             Thread is waiting without a timeout.
1237             For example, <code>Object.wait()</code>.
1238           </constant>
1239           <constant id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT" num="0x0020">
1240             Thread is waiting with a maximum time to wait specified.
1241             For example, <code>Object.wait(long)</code>.
1242           </constant>
1243           <constant id="JVMTI_THREAD_STATE_SLEEPING" num="0x0040">
1244             Thread is sleeping -- <code>Thread.sleep(long)</code>.
1245           </constant>
1246           <constant id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT" num="0x0100">
1247             Thread is waiting on an object monitor -- <code>Object.wait</code>.
1248           </constant>
1249           <constant id="JVMTI_THREAD_STATE_PARKED" num="0x0200">
1250             Thread is parked, for example: <code>LockSupport.park</code>,
1251             <code>LockSupport.parkUtil</code> and <code>LockSupport.parkNanos</code>.
1252           </constant>
1253           <constant id="JVMTI_THREAD_STATE_SUSPENDED" num="0x100000">
1254             Thread suspended.
1255             <code>java.lang.Thread.suspend()</code>
1256             or a <jvmti/> suspend function
1257             (such as <functionlink id="SuspendThread"></functionlink>)
1258             has been called on the thread. If this bit
1259             is set, the other bits refer to the thread state before suspension.
1260           </constant>
1261           <constant id="JVMTI_THREAD_STATE_INTERRUPTED" num="0x200000">
1262             Thread has been interrupted.
1263           </constant>
1264           <constant id="JVMTI_THREAD_STATE_IN_NATIVE" num="0x400000">
1265             Thread is in native code--that is, a native method is running
1266             which has not called back into the VM or Java programming
1267             language code.
1268             <p/>
1269             This flag is not set when running VM compiled Java programming
1270             language code nor is it set when running VM code or
1271             VM support code. Native VM interface functions, such as JNI and
1272             <jvmti/> functions, may be implemented as VM code.
1273           </constant>
1274           <constant id="JVMTI_THREAD_STATE_VENDOR_1" num="0x10000000">
1275             Defined by VM vendor.
1276           </constant>
1277           <constant id="JVMTI_THREAD_STATE_VENDOR_2" num="0x20000000">
1278             Defined by VM vendor.
1279           </constant>
1280           <constant id="JVMTI_THREAD_STATE_VENDOR_3" num="0x40000000">
1281             Defined by VM vendor.
1282           </constant>
1283         </constants>
1284         The following definitions are used to convert <jvmti/> thread state
1285         to <code>java.lang.Thread.State</code> style states.
1286         <constants id="jvmtiJavaLangThreadState" label="java.lang.Thread.State Conversion Masks" kind="bits">
1287           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_MASK"
1288                      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">
1289             Mask the state with this before comparison
1290           </constant>
1291           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_NEW"
1292                      num="0">
1293             <code>java.lang.Thread.State.NEW</code>
1294           </constant>
1295           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED"
1296                      num="JVMTI_THREAD_STATE_TERMINATED">
1297             <code>java.lang.Thread.State.TERMINATED</code>
1298           </constant>
1299           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE"
1300                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE">
1301             <code>java.lang.Thread.State.RUNNABLE</code>
1302           </constant>
1303           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED"
1304                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER">
1305             <code>java.lang.Thread.State.BLOCKED</code>
1306           </constant>
1307           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_WAITING"
1308                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY">
1309             <code>java.lang.Thread.State.WAITING</code>
1310           </constant>
1311           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING"
1312                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT">
1313             <code>java.lang.Thread.State.TIMED_WAITING</code>
1314           </constant>
1315         </constants>
1316         <b>Rules</b>
1317         <p/>
1318         There can be no more than one answer to a question, although there can be no
1319         answer (because the answer is unknown, does not apply, or none of the answers is
1320         correct).  An answer is set only when the enclosing answers match.
1321         That is, no more than one of
1322           <ul type="circle">
1323               <li><code>JVMTI_THREAD_STATE_RUNNABLE</code></li>
1324               <li><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></li>
1325               <li><code>JVMTI_THREAD_STATE_WAITING</code></li>
1326           </ul>
1327         can be set (a <tm>J2SE</tm> compliant implementation will always set
1328         one of these if <code>JVMTI_THREAD_STATE_ALIVE</code> is set).
1329         And if any of these are set, the enclosing answer
1330         <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1331         No more than one of
1332           <ul type="circle">
1333               <li><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></li>
1334               <li><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></li>
1335           </ul>
1336         can be set (a <tm>J2SE</tm> compliant implementation will always set
1337         one of these if <code>JVMTI_THREAD_STATE_WAITING</code> is set).
1338         And if either is set, the enclosing answers
1339         <code>JVMTI_THREAD_STATE_ALIVE</code> and
1340         <code>JVMTI_THREAD_STATE_WAITING</code> are set.
1341         No more than one of
1342           <ul type="circle">
1343               <li><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></li>
1344               <li><code>JVMTI_THREAD_STATE_PARKED</code></li>
1345               <li><code>JVMTI_THREAD_STATE_SLEEPING</code></li>
1346           </ul>
1347         can be set. And if any of these is set, the enclosing answers
1348         <code>JVMTI_THREAD_STATE_ALIVE</code> and
1349         <code>JVMTI_THREAD_STATE_WAITING</code> are set.
1350         Also, if <code>JVMTI_THREAD_STATE_SLEEPING</code> is set,
1351         then <code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code> is set.
1352         If a state <i>A</i> is implemented using the mechanism of
1353         state <i>B</i> then it is state <i>A</i> which
1354         is returned by this function.
1355         For example, if <code>Thread.sleep(long)</code>
1356         is implemented using <code>Object.wait(long)</code>
1357         then it is still <code>JVMTI_THREAD_STATE_SLEEPING</code>
1358         which is returned.
1359         More than one of
1360           <ul type="circle">
1361               <li><code>JVMTI_THREAD_STATE_SUSPENDED</code></li>
1362               <li><code>JVMTI_THREAD_STATE_INTERRUPTED</code></li>
1363               <li><code>JVMTI_THREAD_STATE_IN_NATIVE</code></li>
1364           </ul>
1365         can be set, but if any is set,
1366         <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1367         <p/>
1368         And finally,
1369         <code>JVMTI_THREAD_STATE_TERMINATED</code> cannot be set unless
1370         <code>JVMTI_THREAD_STATE_ALIVE</code> is not set.
1371         <p/>
1372         The thread state representation is designed for extension in future versions
1373         of the specification; thread state values should be used accordingly, that is
1374         they should not be used as ordinals.
1375         Most queries can be made by testing a single bit, if use in a switch statement is desired,
1376         the state bits should be masked with the interesting bits.
1377         All bits not defined above are reserved for future use.
1378         A VM, compliant to the current specification, must set reserved bits to zero.
1379         An agent should ignore reserved bits --
1380         they should not be assumed to be zero and thus should not be included in comparisons.
1381         <p/>
1382         <b>Examples</b>
1383         <p/>
1384         Note that the values below exclude reserved and vendor bits.
1385         <p/>
1386         The state of a thread blocked at a <code>synchronized</code>-statement would be:
1387         <example>
1388             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER
1389         </example>
1390         The state of a thread which hasn't started yet would be:
1391         <example>
1392             0
1393         </example>
1394         The state of a thread at a <code>Object.wait(3000)</code> would be:
1395         <example>
1396             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_WAITING +
1397                 JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
1398                 JVMTI_THREAD_STATE_MONITOR_WAITING
1399         </example>
1400         The state of a thread suspended while runnable would be:
1401         <example>
1402             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_RUNNABLE + JVMTI_THREAD_STATE_SUSPENDED
1403         </example>
1404         <p/>
1405         <b>Testing the State</b>
1406         <p/>
1407         In most cases, the thread state can be determined by testing the one bit corresponding
1408         to that question.  For example, the code to test if a thread is sleeping:
1409         <example>
1410         jint state;
1411         jvmtiError err;
1412 
1413         err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1414         if (err == JVMTI_ERROR_NONE) {
1415            if (state &amp; JVMTI_THREAD_STATE_SLEEPING) {  ...
1416         </example>
1417         <p/>
1418         For waiting (that is, in <code>Object.wait</code>, parked, or sleeping) it would be:
1419         <example>
1420            if (state &amp; JVMTI_THREAD_STATE_WAITING) {  ...
1421         </example>
1422         For some states, more than one bit will need to be tested as is the case
1423         when testing if a thread has not yet been started:
1424         <example>
1425            if ((state &amp; (JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_TERMINATED)) == 0)  {  ...
1426         </example>
1427         To distinguish timed from untimed <code>Object.wait</code>:
1428         <example>
1429            if (state &amp; JVMTI_THREAD_STATE_IN_OBJECT_WAIT)  {
1430              if (state &amp; JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)  {
1431                printf("in Object.wait(long timeout)\n");
1432              } else {
1433                printf("in Object.wait()\n");
1434              }
1435            }
1436         </example>
1437         <p/>
1438         <b>Relationship to <code>java.lang.Thread.State</code></b>
1439         <p/>
1440         The thread state represented by <code>java.lang.Thread.State</code>
1441         returned from <code>java.lang.Thread.getState()</code> is a subset of the
1442         information returned from this function.
1443         The corresponding <code>java.lang.Thread.State</code> can be determined
1444         by using the provided conversion masks.
1445         For example, this returns the name of the <code>java.lang.Thread.State</code> thread state:
1446         <example>
1447             err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1448             abortOnError(err);
1449             switch (state &amp; JVMTI_JAVA_LANG_THREAD_STATE_MASK) {
1450             case JVMTI_JAVA_LANG_THREAD_STATE_NEW:
1451               return "NEW";
1452             case JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED:
1453               return "TERMINATED";
1454             case JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE:
1455               return "RUNNABLE";
1456             case JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED:
1457               return "BLOCKED";
1458             case JVMTI_JAVA_LANG_THREAD_STATE_WAITING:
1459               return "WAITING";
1460             case JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING:
1461               return "TIMED_WAITING";
1462             }
1463         </example>
1464       </description>
1465       <origin>new</origin>
1466       <capabilities>
1467       </capabilities>
1468       <parameters>
1469         <param id="thread">
1470           <jthread null="current" started="maybe" impl="noconvert"/>
1471             <description>
1472               The thread to query.
1473             </description>
1474         </param>
1475         <param id="thread_state_ptr">
1476           <outptr><jint/></outptr>
1477           <description>
1478             On return, points to state flags,
1479             as defined by the <internallink id="jvmtiThreadState">Thread State Flags</internallink>.
1480           </description>
1481         </param>
1482       </parameters>
1483       <errors>
1484       </errors>
1485     </function>
1486 
1487     <function id="GetCurrentThread" phase="start" num="18" since="1.1">
1488       <synopsis>Get Current Thread</synopsis>
1489       <description>
1490         Get the current thread.
1491         The current thread is the Java programming language thread which has called the function.
1492         The function may return <code>NULL</code> in the start phase if the
1493         <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
1494         <code>can_generate_early_vmstart</code></internallink> capability is enabled
1495         and the <code>java.lang.Thread</code> class has not been initialized yet.
1496         <p/>
1497         Note that most <jvmti/> functions that take a thread
1498         as an argument will accept <code>NULL</code> to mean
1499         the current thread.
1500       </description>
1501       <origin>new</origin>
1502       <capabilities>
1503       </capabilities>
1504       <parameters>
1505         <param id="thread_ptr">
1506           <outptr><jthread/></outptr>
1507           <description>
1508              On return, points to the current thread, or <code>NULL</code>.
1509           </description>
1510         </param>
1511       </parameters>
1512       <errors>
1513       </errors>
1514     </function>
1515 
1516     <function id="GetAllThreads" num="4">
1517       <synopsis>Get All Threads</synopsis>
1518       <description>
1519         Get all live threads.
1520         The threads are Java programming language threads;
1521         that is, threads that are attached to the VM.
1522         A thread is live if <code>java.lang.Thread.isAlive()</code>
1523         would return <code>true</code>, that is, the thread has
1524         been started and has not yet died.
1525         The universe of threads is determined by the context of the <jvmti/>
1526         environment, which typically is all threads attached to the VM.
1527         Note that this includes <jvmti/> agent threads
1528         (see <functionlink id="RunAgentThread"/>).
1529       </description>
1530       <origin>jvmdi</origin>
1531       <capabilities>
1532       </capabilities>
1533       <parameters>
1534         <param id="threads_count_ptr">
1535           <outptr><jint/></outptr>
1536           <description>
1537             On return, points to the number of running threads.
1538           </description>
1539         </param>
1540         <param id="threads_ptr">
1541           <allocbuf outcount="threads_count_ptr"><jthread/></allocbuf>
1542             <description>
1543               On return, points to an array of references, one
1544               for each running thread.
1545             </description>
1546         </param>
1547       </parameters>
1548       <errors>
1549       </errors>
1550     </function>
1551 
1552     <function id="SuspendThread" num="5">
1553       <synopsis>Suspend Thread</synopsis>
1554       <description>
1555         Suspend the specified thread. If the calling thread is specified,
1556         this function will not return until some other thread calls
1557         <functionlink id="ResumeThread"></functionlink>.
1558         If the thread is currently suspended, this function
1559         does nothing and returns an error.
1560       </description>
1561       <origin>jvmdi</origin>
1562       <capabilities>
1563         <required id="can_suspend"></required>
1564       </capabilities>
1565       <parameters>
1566         <param id="thread">
1567           <jthread null="current"/>
1568             <description>
1569               The thread to suspend.
1570             </description>
1571         </param>
1572       </parameters>
1573       <errors>
1574         <error id="JVMTI_ERROR_THREAD_SUSPENDED">
1575           Thread already suspended.
1576         </error>
1577       </errors>
1578     </function>
1579 
1580     <elide>
1581     <function id="SuspendAllThreads" num="101">
1582       <synopsis>Suspend All Threads</synopsis>
1583       <description>
1584         <issue>
1585             There has been no explicit call for this function, and it will
1586             thus be removed if there is no interest.
1587         </issue>
1588         Suspend all live threads except:
1589         <ul>
1590           <li>already suspended threads</li>
1591           <li>those listed in <paramlink id="except_list"></paramlink></li>
1592           <li>certain system (non application) threads, as determined
1593             by the VM implementation</li>
1594         </ul>
1595         The threads are Java programming language threads;
1596         native threads which are not attached to the VM are not
1597         Java programming language threads.
1598         A thread is live if <code>java.lang.Thread.isAlive()</code>
1599         would return <code>true</code>, that is, the thread has
1600         been started and has not yet died.
1601         The universe of threads is determined
1602         by the context of the <jvmti/>
1603         environment, which, typically, is all threads attached to the VM,
1604         except critical VM internal threads and <jvmti/> agent threads
1605         (see <functionlink id="RunAgentThread"/>).
1606         <p/>
1607         If the calling thread is specified,
1608         all other threads are suspended first then the caller thread is suspended -
1609         this function will not return until some other thread calls
1610         <functionlink id="ResumeThread"></functionlink>.
1611         <p/>
1612         The list of actually
1613         suspended threads is returned in
1614         <paramlink id="suspended_list_ptr"></paramlink>.
1615         Suspension is as defined in <functionlink id="SuspendThread"></functionlink>.
1616         <functionlink id="ResumeThreadList"></functionlink>
1617         can be used to resume the suspended threads.
1618       </description>
1619       <origin>new</origin>
1620       <capabilities>
1621         <required id="can_suspend"></required>
1622       </capabilities>
1623       <parameters>
1624         <param id="except_count">
1625           <jint min="0"/>
1626           <description>
1627             The number of threads in the list of threads not to be suspended.
1628           </description>
1629         </param>
1630         <param id="except_list">
1631             <inbuf incount="except_count">
1632               <jthread/>
1633               <nullok>not an error if <code>except_count == 0</code></nullok>
1634             </inbuf>
1635             <description>
1636               The list of threads not to be suspended.
1637             </description>
1638         </param>
1639         <param id="suspended_count_ptr">
1640           <outptr><jint/></outptr>
1641           <description>
1642             On return, points to the number of threads suspended by this call.
1643           </description>
1644         </param>
1645         <param id="suspended_list_ptr">
1646           <allocbuf outcount="suspended_count_ptr"><jthread/></allocbuf>
1647             <description>
1648               On return, points to an array of references, one
1649               for each thread suspended.
1650             </description>
1651         </param>
1652       </parameters>
1653       <errors>
1654         <error id="JVMTI_ERROR_INVALID_THREAD">
1655           A thread in <paramlink id="except_list"></paramlink> was invalid.
1656         </error>
1657         <error id="JVMTI_ERROR_NULL_POINTER">
1658           Both <paramlink id="except_list"></paramlink> was <code>NULL</code>
1659           and <paramlink id="except_count"></paramlink> was non-zero.
1660         </error>
1661       </errors>
1662     </function>
1663     </elide>
1664 
1665     <function id="SuspendThreadList" num="92">
1666       <synopsis>Suspend Thread List</synopsis>
1667       <description>
1668         Suspend the <paramlink id="request_count"></paramlink>
1669         threads specified in the
1670         <paramlink id="request_list"></paramlink> array.
1671         Threads may be resumed with
1672         <functionlink id="ResumeThreadList"></functionlink> or
1673         <functionlink id="ResumeThread"></functionlink>.
1674         If the calling thread is specified in the
1675         <paramlink id="request_list"></paramlink> array, this function will
1676         not return until some other thread resumes it.
1677         Errors encountered in the suspension of a thread
1678         are returned in the <paramlink id="results"></paramlink>
1679         array, <b>not</b> in the return value of this function.
1680         Threads that are currently suspended do not change state.
1681       </description>
1682       <origin>jvmdi</origin>
1683       <capabilities>
1684         <required id="can_suspend"></required>
1685       </capabilities>
1686       <parameters>
1687         <param id="request_count">
1688           <jint min="0"/>
1689           <description>
1690             The number of threads to suspend.
1691           </description>
1692         </param>
1693         <param id="request_list">
1694           <inbuf incount="request_count"><jthread/></inbuf>
1695             <description>
1696               The list of threads to suspend.
1697             </description>
1698         </param>
1699         <param id="results">
1700           <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1701           <description>
1702             An agent supplied array of
1703             <paramlink id="request_count"></paramlink> elements.
1704             On return, filled with the error code for
1705             the suspend of the corresponding thread.
1706             The error code will be
1707             <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1708             if the thread was suspended by this call.
1709             Possible error codes are those specified
1710             for <functionlink id="SuspendThread"></functionlink>.
1711           </description>
1712         </param>
1713       </parameters>
1714       <errors>
1715       </errors>
1716     </function>
1717 
1718     <function id="ResumeThread" num="6">
1719       <synopsis>Resume Thread</synopsis>
1720       <description>
1721         Resume a suspended thread.
1722         Any threads currently suspended through
1723         a <jvmti/> suspend function (eg.
1724         <functionlink id="SuspendThread"></functionlink>)
1725         or <code>java.lang.Thread.suspend()</code>
1726         will resume execution;
1727         all other threads are unaffected.
1728       </description>
1729       <origin>jvmdi</origin>
1730       <capabilities>
1731         <required id="can_suspend"></required>
1732       </capabilities>
1733       <parameters>
1734         <param id="thread">
1735           <jthread/>
1736             <description>
1737               The thread to resume.
1738             </description>
1739         </param>
1740       </parameters>
1741       <errors>
1742         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
1743           Thread was not suspended.
1744         </error>
1745         <error id="JVMTI_ERROR_INVALID_TYPESTATE">
1746           The state of the thread has been modified, and is now inconsistent.
1747         </error>
1748       </errors>
1749     </function>
1750 
1751     <function id="ResumeThreadList" num="93">
1752       <synopsis>Resume Thread List</synopsis>
1753       <description>
1754         Resume the <paramlink id="request_count"></paramlink>
1755         threads specified in the
1756         <paramlink id="request_list"></paramlink> array.
1757         Any thread suspended through
1758         a <jvmti/> suspend function (eg.
1759         <functionlink id="SuspendThreadList"></functionlink>)
1760         or <code>java.lang.Thread.suspend()</code>
1761         will resume execution.
1762       </description>
1763       <origin>jvmdi</origin>
1764       <capabilities>
1765         <required id="can_suspend"></required>
1766       </capabilities>
1767       <parameters>
1768         <param id="request_count">
1769           <jint min="0"/>
1770           <description>
1771             The number of threads to resume.
1772           </description>
1773         </param>
1774         <param id="request_list">
1775           <inbuf incount="request_count"><jthread/></inbuf>
1776             <description>
1777               The threads to resume.
1778             </description>
1779         </param>
1780         <param id="results">
1781           <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1782           <description>
1783             An agent supplied array of
1784             <paramlink id="request_count"></paramlink> elements.
1785             On return, filled with the error code for
1786             the resume of the corresponding thread.
1787             The error code will be
1788             <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1789             if the thread was suspended by this call.
1790             Possible error codes are those specified
1791             for <functionlink id="ResumeThread"></functionlink>.
1792           </description>
1793         </param>
1794       </parameters>
1795       <errors>
1796       </errors>
1797     </function>
1798 
1799     <function id="StopThread" num="7">
1800       <synopsis>Stop Thread</synopsis>
1801       <description>
1802         Send the specified asynchronous exception to the specified thread
1803         (similar to <code>java.lang.Thread.stop</code>).
1804         Normally, this function is used to kill the specified thread with an
1805         instance of the exception <code>ThreadDeath</code>.
1806       </description>
1807       <origin>jvmdi</origin>
1808       <capabilities>
1809         <required id="can_signal_thread"></required>
1810       </capabilities>
1811       <parameters>
1812         <param id="thread">
1813           <jthread/>
1814             <description>
1815               The thread to stop.
1816             </description>
1817         </param>
1818         <param id="exception">
1819           <jobject/>
1820             <description>
1821               The asynchronous exception object.
1822             </description>
1823         </param>
1824       </parameters>
1825       <errors>
1826       </errors>
1827     </function>
1828 
1829     <function id="InterruptThread" num="8">
1830       <synopsis>Interrupt Thread</synopsis>
1831       <description>
1832         Interrupt the specified thread
1833         (similar to <code>java.lang.Thread.interrupt</code>).
1834       </description>
1835       <origin>jvmdi</origin>
1836       <capabilities>
1837         <required id="can_signal_thread"></required>
1838       </capabilities>
1839       <parameters>
1840         <param id="thread">
1841           <jthread impl="noconvert"/>
1842             <description>
1843               The thread to interrupt.
1844             </description>
1845         </param>
1846       </parameters>
1847       <errors>
1848       </errors>
1849     </function>
1850 
1851     <function id="GetThreadInfo" num="9">
1852       <synopsis>Get Thread Info</synopsis>
1853       <typedef id="jvmtiThreadInfo" label="Thread information structure">
1854         <field id="name">
1855           <allocfieldbuf><char/></allocfieldbuf>
1856           <description>
1857             The thread name, encoded as a
1858             <internallink id="mUTF">modified UTF-8</internallink> string.
1859           </description>
1860         </field>
1861         <field id="priority">
1862           <jint/>
1863           <description>
1864             The thread priority.  See the thread priority constants:
1865             <datalink id="jvmtiThreadPriority"></datalink>.
1866           </description>
1867         </field>
1868         <field id="is_daemon">
1869           <jboolean/>
1870           <description>
1871             Is this a daemon thread?
1872           </description>
1873         </field>
1874         <field id="thread_group">
1875           <jthreadGroup/>
1876           <description>
1877             The thread group to which this thread belongs.
1878             <code>NULL</code> if the thread has died.
1879           </description>
1880         </field>
1881         <field id="context_class_loader">
1882           <jobject/>
1883             <description>
1884               The context class loader associated with this thread.
1885             </description>
1886         </field>
1887       </typedef>
1888       <description>
1889         Get thread information. The fields of the <datalink id="jvmtiThreadInfo"/> structure
1890         are filled in with details of the specified thread.
1891       </description>
1892       <origin>jvmdi</origin>
1893       <capabilities>
1894       </capabilities>
1895       <parameters>
1896         <param id="thread">
1897           <jthread null="current" impl="noconvert" started="maybe"/>
1898             <description>
1899               The thread to query.
1900             </description>
1901         </param>
1902         <param id="info_ptr">
1903           <outptr><struct>jvmtiThreadInfo</struct></outptr>
1904           <description>
1905             On return, filled with information describing the specified thread.
1906           </description>
1907         </param>
1908       </parameters>
1909       <errors>
1910       </errors>
1911     </function>
1912 
1913     <function id="GetOwnedMonitorInfo" num="10">
1914       <synopsis>Get Owned Monitor Info</synopsis>
1915       <description>
1916         Get information about the monitors owned by the
1917         specified thread.
1918       </description>
1919       <origin>jvmdiClone</origin>
1920       <capabilities>
1921         <required id="can_get_owned_monitor_info"></required>
1922       </capabilities>
1923       <parameters>
1924         <param id="thread">
1925           <jthread null="current"/>
1926             <description>
1927               The thread to query.
1928             </description>
1929         </param>
1930         <param id="owned_monitor_count_ptr">
1931           <outptr><jint/></outptr>
1932           <description>
1933             The number of monitors returned.
1934           </description>
1935         </param>
1936         <param id="owned_monitors_ptr">
1937           <allocbuf outcount="owned_monitor_count_ptr"><jobject/></allocbuf>
1938             <description>
1939               The array of owned monitors.
1940             </description>
1941         </param>
1942       </parameters>
1943       <errors>
1944       </errors>
1945     </function>
1946 
1947     <function id="GetOwnedMonitorStackDepthInfo" num="153" since="1.1">
1948       <synopsis>Get Owned Monitor Stack Depth Info</synopsis>
1949       <typedef id="jvmtiMonitorStackDepthInfo"
1950                label="Monitor stack depth information structure">
1951         <field id="monitor">
1952           <jobject/>
1953             <description>
1954               The owned monitor.
1955             </description>
1956         </field>
1957         <field id="stack_depth">
1958           <jint/>
1959           <description>
1960             The stack depth.  Corresponds to the stack depth used in the
1961             <internallink id="stack">Stack Frame functions</internallink>.
1962             That is, zero is the current frame, one is the frame which
1963             called the current frame. And it is negative one if the
1964             implementation cannot determine the stack depth (e.g., for
1965             monitors acquired by JNI <code>MonitorEnter</code>).
1966           </description>
1967         </field>
1968       </typedef>
1969       <description>
1970         Get information about the monitors owned by the
1971         specified thread and the depth of the stack frame which locked them.
1972       </description>
1973       <origin>new</origin>
1974       <capabilities>
1975         <required id="can_get_owned_monitor_stack_depth_info"></required>
1976       </capabilities>
1977       <parameters>
1978         <param id="thread">
1979           <jthread null="current"/>
1980             <description>
1981               The thread to query.
1982             </description>
1983         </param>
1984         <param id="monitor_info_count_ptr">
1985           <outptr><jint/></outptr>
1986           <description>
1987             The number of monitors returned.
1988           </description>
1989         </param>
1990         <param id="monitor_info_ptr">
1991           <allocbuf outcount="monitor_info_count_ptr">
1992             <struct>jvmtiMonitorStackDepthInfo</struct>
1993           </allocbuf>
1994           <description>
1995             The array of owned monitor depth information.
1996           </description>
1997         </param>
1998       </parameters>
1999       <errors>
2000       </errors>
2001     </function>
2002 
2003     <function id="GetCurrentContendedMonitor" num="11">
2004       <synopsis>Get Current Contended Monitor</synopsis>
2005       <description>
2006         Get the object, if any, whose monitor the specified thread is waiting to
2007         enter or waiting to regain through <code>java.lang.Object.wait</code>.
2008       </description>
2009       <origin>jvmdi</origin>
2010       <capabilities>
2011         <required id="can_get_current_contended_monitor"></required>
2012       </capabilities>
2013       <parameters>
2014         <param id="thread">
2015           <jthread null="current"/>
2016             <description>
2017               The thread to query.
2018             </description>
2019         </param>
2020         <param id="monitor_ptr">
2021           <outptr><jobject/></outptr>
2022             <description>
2023               On return, filled with the current contended monitor, or
2024               NULL if there is none.
2025             </description>
2026         </param>
2027       </parameters>
2028       <errors>
2029       </errors>
2030     </function>
2031 
2032     <callback id="jvmtiStartFunction">
2033       <void/>
2034       <synopsis>Agent Start Function</synopsis>
2035       <description>
2036         Agent supplied callback function.
2037         This function is the entry point for an agent thread
2038         started with
2039         <functionlink id="RunAgentThread"></functionlink>.
2040       </description>
2041       <parameters>
2042           <param id="jvmti_env">
2043             <outptr>
2044               <struct>jvmtiEnv</struct>
2045             </outptr>
2046             <description>
2047               The <jvmti/> environment.
2048             </description>
2049           </param>
2050           <param id="jni_env">
2051             <outptr>
2052               <struct>JNIEnv</struct>
2053             </outptr>
2054             <description>
2055               The JNI environment.
2056             </description>
2057           </param>
2058           <param id="arg">
2059             <outptr>
2060               <void/>
2061             </outptr>
2062               <description>
2063                 The <code>arg</code> parameter passed to
2064                 <functionlink id="RunAgentThread"></functionlink>.
2065               </description>
2066           </param>
2067       </parameters>
2068     </callback>
2069 
2070     <function id="RunAgentThread" num="12">
2071       <synopsis>Run Agent Thread</synopsis>
2072       <description>
2073         Starts the execution of an agent thread. with the specified native function.
2074         The parameter <paramlink id="arg"></paramlink> is forwarded on to the
2075         <functionlink id="jvmtiStartFunction">start function</functionlink>
2076         (specified with <paramlink id="proc"></paramlink>) as its single argument.
2077         This function allows the creation of agent threads
2078         for handling communication with another process or for handling events
2079         without the need to load a special subclass of <code>java.lang.Thread</code> or
2080         implementer of <code>java.lang.Runnable</code>.
2081         Instead, the created thread can run entirely in native code.
2082         However, the created thread does require a newly created instance
2083         of <code>java.lang.Thread</code> (referenced by the argument <code>thread</code>) to
2084         which it will be associated.
2085         The thread object can be created with JNI calls.
2086         <p/>
2087         The following common thread priorities are provided for your convenience:
2088         <constants id="jvmtiThreadPriority" label="Thread Priority Constants" kind="const">
2089           <constant id="JVMTI_THREAD_MIN_PRIORITY" num="1">
2090             Minimum possible thread priority
2091           </constant>
2092           <constant id="JVMTI_THREAD_NORM_PRIORITY" num="5">
2093             Normal thread priority
2094           </constant>
2095           <constant id="JVMTI_THREAD_MAX_PRIORITY" num="10">
2096             Maximum possible thread priority
2097           </constant>
2098         </constants>
2099         <p/>
2100         The new thread is started as a daemon thread with the specified
2101         <paramlink id="priority"></paramlink>.
2102         If enabled, a <eventlink id="ThreadStart"/> event will be sent.
2103         <p/>
2104         Since the thread has been started, the thread will be live when this function
2105         returns, unless the thread has died immediately.
2106         <p/>
2107         The thread group of the thread is ignored -- specifically, the thread is not
2108         added to the thread group and the thread is not seen on queries of the thread
2109         group at either the Java programming language or <jvmti/> levels.
2110         <p/>
2111         The thread is not visible to Java programming language queries but is
2112         included in <jvmti/> queries (for example,
2113         <functionlink id="GetAllThreads"/> and
2114         <functionlink id="GetAllStackTraces"/>).
2115         <p/>
2116         Upon execution of <code>proc</code>, the new thread will be attached to the
2117         VM -- see the JNI documentation on
2118         <externallink id="jni/invocation.html#attaching-to-the-vm"
2119                       >Attaching to the VM</externallink>.
2120       </description>
2121       <origin>jvmdiClone</origin>
2122       <capabilities>
2123       </capabilities>
2124       <parameters>
2125         <param id="thread">
2126           <jthread impl="noconvert" started="no"/>
2127             <description>
2128               The thread to run.
2129             </description>
2130         </param>
2131         <param id="proc">
2132           <ptrtype>
2133             <struct>jvmtiStartFunction</struct>
2134           </ptrtype>
2135           <description>
2136             The start function.
2137           </description>
2138         </param>
2139         <param id="arg">
2140           <inbuf>
2141             <void/>
2142             <nullok><code>NULL</code> is passed to the start function</nullok>
2143           </inbuf>
2144           <description>
2145             The argument to the start function.
2146           </description>
2147         </param>
2148         <param id="priority">
2149           <jint/>
2150           <description>
2151             The priority of the started thread. Any thread
2152             priority allowed by <code>java.lang.Thread.setPriority</code> can be used including
2153             those in <datalink id="jvmtiThreadPriority"></datalink>.
2154           </description>
2155         </param>
2156       </parameters>
2157       <errors>
2158         <error id="JVMTI_ERROR_INVALID_PRIORITY">
2159             <paramlink id="priority"/> is less than
2160             <datalink id="JVMTI_THREAD_MIN_PRIORITY"/>
2161               or greater than
2162             <datalink id="JVMTI_THREAD_MAX_PRIORITY"/>
2163         </error>
2164       </errors>
2165     </function>
2166 
2167     <function id="SetThreadLocalStorage" jkernel="yes" impl="notrace" phase="start" num="103">
2168       <synopsis>Set Thread Local Storage</synopsis>
2169       <description>
2170         The VM stores a pointer value associated with each environment-thread
2171         pair. This pointer value is called <i>thread-local storage</i>.
2172         This value is <code>NULL</code> unless set with this function.
2173         Agents can allocate memory in which they store thread specific
2174         information. By setting thread-local storage it can then be
2175         accessed with
2176         <functionlink id="GetThreadLocalStorage"></functionlink>.
2177         <p/>
2178         This function is called by the agent to set the value of the <jvmti/>
2179         thread-local storage. <jvmti/> supplies to the agent a pointer-size
2180         thread-local storage that can be used to record per-thread
2181         information.
2182       </description>
2183       <origin>jvmpi</origin>
2184       <capabilities>
2185       </capabilities>
2186       <parameters>
2187         <param id="thread">
2188           <jthread null="current"/>
2189             <description>
2190               Store to this thread.
2191             </description>
2192         </param>
2193         <param id="data">
2194           <inbuf>
2195             <void/>
2196             <nullok>value is set to <code>NULL</code></nullok>
2197           </inbuf>
2198           <description>
2199             The value to be entered into the thread-local storage.
2200           </description>
2201         </param>
2202       </parameters>
2203       <errors>
2204       </errors>
2205     </function>
2206 
2207     <function id="GetThreadLocalStorage" jkernel="yes" impl="innative notrace" phase="start" num="102">
2208       <synopsis>Get Thread Local Storage</synopsis>
2209       <description>
2210         Called by the agent to get the value of the <jvmti/> thread-local
2211         storage.
2212       </description>
2213       <origin>jvmpi</origin>
2214       <capabilities>
2215       </capabilities>
2216       <parameters>
2217         <param id="thread">
2218           <jthread null="current" impl="noconvert"/>
2219             <description>
2220               Retrieve from this thread.
2221             </description>
2222         </param>
2223         <param id="data_ptr">
2224           <agentbuf><void/></agentbuf>
2225           <description>
2226             Pointer through which the value of the thread local
2227             storage is returned.
2228             If thread-local storage has not been set with
2229             <functionlink id="SetThreadLocalStorage"></functionlink> the returned
2230             pointer is <code>NULL</code>.
2231           </description>
2232         </param>
2233       </parameters>
2234       <errors>
2235       </errors>
2236     </function>
2237 
2238   </category>
2239 
2240   <category id="thread_groups" label="Thread Group">
2241     <intro>
2242     </intro>
2243 
2244     <function id="GetTopThreadGroups" num="13">
2245       <synopsis>Get Top Thread Groups</synopsis>
2246       <description>
2247         Return all top-level (parentless) thread groups in the VM.
2248       </description>
2249       <origin>jvmdi</origin>
2250       <capabilities>
2251       </capabilities>
2252       <parameters>
2253         <param id="group_count_ptr">
2254           <outptr><jint/></outptr>
2255           <description>
2256             On return, points to the number of top-level thread groups.
2257           </description>
2258         </param>
2259         <param id="groups_ptr">
2260           <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2261             <description>
2262               On return, refers to a pointer to the top-level thread group array.
2263             </description>
2264         </param>
2265       </parameters>
2266       <errors>
2267       </errors>
2268     </function>
2269 
2270     <function id="GetThreadGroupInfo" num="14">
2271       <synopsis>Get Thread Group Info</synopsis>
2272       <typedef id="jvmtiThreadGroupInfo" label="Thread group information structure">
2273         <field id="parent">
2274           <jthreadGroup/>
2275           <description>
2276             The parent thread group.
2277           </description>
2278         </field>
2279         <field id="name">
2280           <allocfieldbuf><char/></allocfieldbuf>
2281           <description>
2282             The thread group's name, encoded as a
2283             <internallink id="mUTF">modified UTF-8</internallink> string.
2284           </description>
2285         </field>
2286         <field id="max_priority">
2287           <jint/>
2288           <description>
2289             The maximum priority for this thread group.
2290           </description>
2291         </field>
2292         <field id="is_daemon">
2293           <jboolean/>
2294           <description>
2295             Is this a daemon thread group?
2296           </description>
2297         </field>
2298       </typedef>
2299       <description>
2300         Get information about the thread group. The fields of the
2301         <functionlink id="jvmtiThreadGroupInfo"></functionlink> structure
2302         are filled in with details of the specified thread group.
2303       </description>
2304       <origin>jvmdi</origin>
2305       <capabilities>
2306       </capabilities>
2307       <parameters>
2308         <param id="group">
2309           <jthreadGroup/>
2310           <description>
2311             The thread group to query.
2312           </description>
2313         </param>
2314         <param id="info_ptr">
2315           <outptr><struct>jvmtiThreadGroupInfo</struct></outptr>
2316           <description>
2317             On return, filled with information describing the specified
2318             thread group.
2319           </description>
2320         </param>
2321       </parameters>
2322       <errors>
2323       </errors>
2324     </function>
2325 
2326     <function id="GetThreadGroupChildren" num="15">
2327       <synopsis>Get Thread Group Children</synopsis>
2328       <description>
2329         Get the live threads and active subgroups in this thread group.
2330       </description>
2331       <origin>jvmdi</origin>
2332       <capabilities>
2333       </capabilities>
2334       <parameters>
2335         <param id="group">
2336           <jthreadGroup/>
2337           <description>
2338             The group to query.
2339           </description>
2340         </param>
2341         <param id="thread_count_ptr">
2342           <outptr><jint/></outptr>
2343           <description>
2344             On return, points to the number of live threads in this thread group.
2345           </description>
2346         </param>
2347         <param id="threads_ptr">
2348           <allocbuf outcount="thread_count_ptr"><jthread/></allocbuf>
2349             <description>
2350               On return, points to an array of the live threads in this thread group.
2351             </description>
2352         </param>
2353         <param id="group_count_ptr">
2354           <outptr><jint/></outptr>
2355           <description>
2356             On return, points to the number of active child thread groups
2357           </description>
2358         </param>
2359         <param id="groups_ptr">
2360           <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2361             <description>
2362               On return, points to an array of the active child thread groups.
2363             </description>
2364         </param>
2365       </parameters>
2366       <errors>
2367       </errors>
2368     </function>
2369   </category>
2370 
2371   <category id="stack" label="Stack Frame">
2372     <intro>
2373         These functions provide information about the stack of a thread.
2374         Stack frames are referenced by depth.
2375         The frame at depth zero is the current frame.
2376         <p/>
2377         Stack frames are as described in
2378         <vmspec chapter="3.6"/>,
2379         That is, they correspond to method
2380         invocations (including native methods) but do not correspond to platform native or
2381         VM internal frames.
2382         <p/>
2383         A <jvmti/> implementation may use method invocations to launch a thread and
2384         the corresponding frames may be included in the stack as presented by these functions --
2385         that is, there may be frames shown
2386         deeper than <code>main()</code> and <code>run()</code>.
2387         However this presentation must be consistent across all <jvmti/> functionality which
2388         uses stack frames or stack depth.
2389     </intro>
2390 
2391       <typedef id="jvmtiFrameInfo" label="Stack frame information structure">
2392         <description>
2393           Information about a stack frame is returned in this structure.
2394         </description>
2395         <field id="method">
2396           <jmethodID/>
2397             <description>
2398               The method executing in this frame.
2399             </description>
2400         </field>
2401         <field id="location">
2402           <jlocation/>
2403           <description>
2404             The index of the instruction executing in this frame.
2405             <code>-1</code> if the frame is executing a native method.
2406           </description>
2407         </field>
2408       </typedef>
2409 
2410       <typedef id="jvmtiStackInfo" label="Stack information structure">
2411         <description>
2412           Information about a set of stack frames is returned in this structure.
2413         </description>
2414         <field id="thread">
2415           <jthread/>
2416           <description>
2417             On return, the thread traced.
2418           </description>
2419         </field>
2420         <field id="state">
2421           <jint/>
2422           <description>
2423             On return, the thread state. See <functionlink id="GetThreadState"></functionlink>.
2424           </description>
2425         </field>
2426         <field id="frame_buffer">
2427           <outbuf incount="max_frame_count">
2428             <struct>jvmtiFrameInfo</struct>
2429           </outbuf>
2430             <description>
2431               On return, this agent allocated buffer is filled
2432               with stack frame information.
2433             </description>
2434         </field>
2435         <field id="frame_count">
2436           <jint/>
2437           <description>
2438             On return, the number of records filled into
2439             <code>frame_buffer</code>.
2440             This will be
2441             min(<code>max_frame_count</code>, <i>stackDepth</i>).
2442           </description>
2443         </field>
2444       </typedef>
2445 
2446     <function id="GetStackTrace" num="104">
2447       <synopsis>Get Stack Trace</synopsis>
2448       <description>
2449         Get information about the stack of a thread.
2450         If <paramlink id="max_frame_count"></paramlink> is less than the depth of the stack,
2451         the <paramlink id="max_frame_count"></paramlink> topmost frames are returned,
2452         otherwise the entire stack is returned.
2453         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2454         <p/>
2455         The following example causes up to five of the topmost frames
2456         to be returned and (if there are any frames) the currently
2457         executing method name to be printed.
2458         <example>
2459 jvmtiFrameInfo frames[5];
2460 jint count;
2461 jvmtiError err;
2462 
2463 err = (*jvmti)-&gt;GetStackTrace(jvmti, aThread, 0, 5,
2464                                frames, &amp;count);
2465 if (err == JVMTI_ERROR_NONE &amp;&amp; count &gt;= 1) {
2466    char *methodName;
2467    err = (*jvmti)-&gt;GetMethodName(jvmti, frames[0].method,
2468                        &amp;methodName, NULL, NULL);
2469    if (err == JVMTI_ERROR_NONE) {
2470       printf("Executing method: %s", methodName);
2471    }
2472 }
2473         </example>
2474         <todo>
2475           check example code.
2476         </todo>
2477         <p/>
2478         The <paramlink id="thread"></paramlink> need not be suspended
2479         to call this function.
2480         <p/>
2481         The <functionlink id="GetLineNumberTable"></functionlink>
2482         function can be used to map locations to line numbers. Note that
2483         this mapping can be done lazily.
2484       </description>
2485       <origin>jvmpi</origin>
2486       <capabilities>
2487       </capabilities>
2488       <parameters>
2489         <param id="thread">
2490           <jthread null="current"/>
2491             <description>
2492               Fetch the stack trace of this thread.
2493             </description>
2494         </param>
2495         <param id="start_depth">
2496           <jint/>
2497           <description>
2498             Begin retrieving frames at this depth.
2499             If non-negative, count from the current frame,
2500             the first frame retrieved is at depth <code>start_depth</code>.
2501             For example, if zero, start from the current frame; if one, start from the
2502             caller of the current frame; if two, start from the caller of the
2503             caller of the current frame; and so on.
2504             If negative, count from below the oldest frame,
2505             the first frame retrieved is at depth <i>stackDepth</i><code> + start_depth</code>,
2506             where <i>stackDepth</i> is the count of frames on the stack.
2507             For example, if negative one, only the oldest frame is retrieved;
2508             if negative two, start from the frame called by the oldest frame.
2509           </description>
2510         </param>
2511         <param id="max_frame_count">
2512           <jint min="0"/>
2513           <description>
2514             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2515           </description>
2516         </param>
2517         <param id="frame_buffer">
2518           <outbuf incount="max_frame_count" outcount="count_ptr">
2519             <struct>jvmtiFrameInfo</struct>
2520           </outbuf>
2521             <description>
2522               On return, this agent allocated buffer is filled
2523               with stack frame information.
2524             </description>
2525         </param>
2526         <param id="count_ptr">
2527           <outptr><jint/></outptr>
2528           <description>
2529             On return, points to the number of records filled in.
2530             For non-negative <code>start_depth</code>, this will be
2531             min(<code>max_frame_count</code>, <i>stackDepth</i><code> - start_depth</code>).
2532             For negative <code>start_depth</code>, this will be
2533             min(<code>max_frame_count</code>, <code>-start_depth</code>).
2534           </description>
2535         </param>
2536       </parameters>
2537       <errors>
2538         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
2539           <paramlink id="start_depth"/> is positive and greater than or equal to <i>stackDepth</i>.
2540           Or <paramlink id="start_depth"/> is negative and less than <i>-stackDepth</i>.
2541         </error>
2542       </errors>
2543     </function>
2544 
2545 
2546     <function id="GetAllStackTraces" num="100">
2547       <synopsis>Get All Stack Traces</synopsis>
2548       <description>
2549         Get information about the stacks of all live threads
2550         (including <internallink id="RunAgentThread">agent threads</internallink>).
2551         If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2552         the <paramlink id="max_frame_count"/> topmost frames are returned for that thread,
2553         otherwise the entire stack is returned.
2554         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2555         <p/>
2556         All stacks are collected simultaneously, that is, no changes will occur to the
2557         thread state or stacks between the sampling of one thread and the next.
2558         The threads need not be suspended.
2559 
2560         <example>
2561 jvmtiStackInfo *stack_info;
2562 jint thread_count;
2563 int ti;
2564 jvmtiError err;
2565 
2566 err = (*jvmti)-&gt;GetAllStackTraces(jvmti, MAX_FRAMES, &amp;stack_info, &amp;thread_count);
2567 if (err != JVMTI_ERROR_NONE) {
2568    ...
2569 }
2570 for (ti = 0; ti &lt; thread_count; ++ti) {
2571    jvmtiStackInfo *infop = &amp;stack_info[ti];
2572    jthread thread = infop-&gt;thread;
2573    jint state = infop-&gt;state;
2574    jvmtiFrameInfo *frames = infop-&gt;frame_buffer;
2575    int fi;
2576 
2577    myThreadAndStatePrinter(thread, state);
2578    for (fi = 0; fi &lt; infop-&gt;frame_count; fi++) {
2579       myFramePrinter(frames[fi].method, frames[fi].location);
2580    }
2581 }
2582 /* this one Deallocate call frees all data allocated by GetAllStackTraces */
2583 err = (*jvmti)-&gt;Deallocate(jvmti, stack_info);
2584         </example>
2585         <todo>
2586           check example code.
2587         </todo>
2588 
2589       </description>
2590       <origin>new</origin>
2591       <capabilities>
2592       </capabilities>
2593       <parameters>
2594         <param id="max_frame_count">
2595           <jint min="0"/>
2596           <description>
2597             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2598           </description>
2599         </param>
2600         <param id="stack_info_ptr">
2601           <allocbuf>
2602             <struct>jvmtiStackInfo</struct>
2603           </allocbuf>
2604             <description>
2605               On return, this buffer is filled
2606               with stack information for each thread.
2607               The number of <datalink id="jvmtiStackInfo"/> records is determined
2608               by <paramlink id="thread_count_ptr"/>.
2609               <p/>
2610               Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/>
2611               buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2612               These buffers must not be separately deallocated.
2613             </description>
2614         </param>
2615         <param id="thread_count_ptr">
2616           <outptr><jint/></outptr>
2617           <description>
2618             The number of threads traced.
2619           </description>
2620         </param>
2621       </parameters>
2622       <errors>
2623       </errors>
2624     </function>
2625 
2626     <function id="GetThreadListStackTraces" num="101">
2627       <synopsis>Get Thread List Stack Traces</synopsis>
2628       <description>
2629         Get information about the stacks of the supplied threads.
2630         If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2631         the <paramlink id="max_frame_count"/> topmost frames are returned for that thread,
2632         otherwise the entire stack is returned.
2633         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2634         <p/>
2635         All stacks are collected simultaneously, that is, no changes will occur to the
2636         thread state or stacks between the sampling one thread and the next.
2637         The threads need not be suspended.
2638         <p/>
2639         If a thread has not yet started or terminates before the stack information is collected,
2640         a zero length stack (<datalink id="jvmtiStackInfo.frame_count"/> will be zero)
2641         will be returned and the thread <datalink id="jvmtiStackInfo.state"/> can be checked.
2642         <p/>
2643         See the example for the similar function
2644         <functionlink id="GetAllStackTraces"/>.
2645       </description>
2646       <origin>new</origin>
2647       <capabilities>
2648       </capabilities>
2649       <parameters>
2650         <param id="thread_count">
2651           <jint min="0"/>
2652           <description>
2653             The number of threads to trace.
2654           </description>
2655         </param>
2656         <param id="thread_list">
2657           <inbuf incount="thread_count"><jthread/></inbuf>
2658             <description>
2659               The list of threads to trace.
2660             </description>
2661         </param>
2662         <param id="max_frame_count">
2663           <jint min="0"/>
2664           <description>
2665             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2666           </description>
2667         </param>
2668         <param id="stack_info_ptr">
2669           <allocbuf outcount="thread_count">
2670             <struct>jvmtiStackInfo</struct>
2671           </allocbuf>
2672             <description>
2673               On return, this buffer is filled
2674               with stack information for each thread.
2675               The number of <datalink id="jvmtiStackInfo"/> records is determined
2676               by <paramlink id="thread_count"/>.
2677               <p/>
2678               Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/>
2679               buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2680               These buffers must not be separately deallocated.
2681             </description>
2682         </param>
2683       </parameters>
2684       <errors>
2685         <error id="JVMTI_ERROR_INVALID_THREAD">
2686           An element in <paramlink id="thread_list"/> is not a thread object.
2687         </error>
2688       </errors>
2689     </function>
2690 
2691     <elide>
2692     <function id="AsyncGetStackTrace" num="1000">
2693       <synopsis>Get Stack Trace--Asynchronous</synopsis>
2694       <description>
2695         Get information about the entire stack of a thread (or a sub-section of it).
2696         This is the asynchronous version of <functionlink id="GetStackTrace"></functionlink>
2697         and is reentrant and safe to call
2698         from asynchronous signal handlers.
2699         The stack trace is returned only for the calling thread.
2700         <p/>
2701         The <functionlink id="GetLineNumberTable"></functionlink>
2702         function can be used to map locations to line numbers. Note that
2703         this mapping can be done lazily.
2704       </description>
2705       <origin>jvmpi</origin>
2706       <capabilities>
2707         <required id="can_get_async_stack_trace"></required>
2708         <capability id="can_show_JVM_spec_async_frames">
2709           If <code>false</code>,
2710           <paramlink id="use_java_stack"></paramlink>
2711           must be <code>false</code>.
2712         </capability>
2713       </capabilities>
2714       <parameters>
2715         <param id="use_java_stack">
2716           <jboolean/>
2717           <description>
2718             Return the stack showing <vmspec/>
2719             model of the stack;
2720             otherwise, show the internal representation of the stack with
2721             inlined and optimized methods missing.  If the virtual machine
2722             is using the <i>Java Virtual Machine Specification</i> stack model
2723             internally, this flag is ignored.
2724           </description>
2725         </param>
2726         <param id="max_count">
2727           <jint min="0"/>
2728           <description>
2729             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2730             Retrieve this many unless the stack depth is less than <code>max_count</code>.
2731           </description>
2732         </param>
2733         <param id="frame_buffer">
2734           <outbuf incount="max_count" outcount="count_ptr">
2735             <struct>jvmtiFrameInfo</struct>
2736             <nullok>this information is not returned</nullok>
2737           </outbuf>
2738             <description>
2739               The agent passes in a buffer
2740               large enough to hold <code>max_count</code> records of
2741               <datalink id="jvmtiFrameInfo"></datalink>.  This buffer must be
2742               pre-allocated by the agent.
2743             </description>
2744         </param>
2745         <param id="count_ptr">
2746           <outptr><jint/></outptr>
2747           <description>
2748             On return, points to the number of records filled in..
2749           </description>
2750         </param>
2751       </parameters>
2752       <errors>
2753         <error id="JVMTI_ERROR_UNATTACHED_THREAD">
2754           The thread being used to call this function is not attached
2755           to the virtual machine.  Calls must be made from attached threads.
2756         </error>
2757       </errors>
2758     </function>
2759     </elide>
2760 
2761     <function id="GetFrameCount" num="16">
2762       <synopsis>Get Frame Count</synopsis>
2763       <description>
2764         Get the number of frames currently in the specified thread's call stack.
2765         <p/>
2766         If this function is called for a thread actively executing bytecodes (for example,
2767         not the current thread and not suspended), the information returned is transient.
2768       </description>
2769       <origin>jvmdi</origin>
2770       <capabilities>
2771       </capabilities>
2772       <parameters>
2773         <param id="thread">
2774           <jthread null="current"/>
2775             <description>
2776               The thread to query.
2777             </description>
2778         </param>
2779         <param id="count_ptr">
2780           <outptr><jint/></outptr>
2781           <description>
2782             On return, points to the number of frames in the call stack.
2783           </description>
2784         </param>
2785       </parameters>
2786       <errors>
2787       </errors>
2788     </function>
2789 
2790     <function id="PopFrame" num="80">
2791       <synopsis>Pop Frame</synopsis>
2792       <description>
2793         Pop the current frame of <code>thread</code>'s stack.
2794         Popping a frame takes you to the previous frame.
2795         When the thread is resumed, the execution
2796         state of the thread is reset to the state
2797         immediately before the called method was invoked.
2798         That is (using <vmspec/> terminology):
2799           <ul>
2800             <li>the current frame is discarded as the previous frame becomes the current one</li>
2801             <li>the operand stack is restored--the argument values are added back
2802               and if the invoke was not <code>invokestatic</code>,
2803               <code>objectref</code> is added back as well</li>
2804             <li>the Java virtual machine PC is restored to the opcode
2805               of the invoke instruction</li>
2806           </ul>
2807         Note however, that any changes to the arguments, which
2808         occurred in the called method, remain;
2809         when execution continues, the first instruction to
2810         execute will be the invoke.
2811         <p/>
2812         Between calling <code>PopFrame</code> and resuming the
2813         thread the state of the stack is undefined.
2814         To pop frames beyond the first,
2815         these three steps must be repeated:
2816         <ul>
2817           <li>suspend the thread via an event (step, breakpoint, ...)</li>
2818           <li>call <code>PopFrame</code></li>
2819           <li>resume the thread</li>
2820         </ul>
2821         <p/>
2822         A lock acquired by calling the called method
2823         (if it is a <code>synchronized</code>  method)
2824         and locks acquired by entering <code>synchronized</code>
2825         blocks within the called method are released.
2826         Note: this does not apply to native locks or
2827         <code>java.util.concurrent.locks</code> locks.
2828         <p/>
2829         Finally blocks are not executed.
2830         <p/>
2831         Changes to global state are not addressed and thus remain changed.
2832         <p/>
2833         The specified thread must be suspended (which implies it cannot be the current thread).
2834         <p/>
2835         Both the called method and calling method must be non-native Java programming
2836         language methods.
2837         <p/>
2838         No <jvmti/> events are generated by this function.
2839       </description>
2840       <origin>jvmdi</origin>
2841       <capabilities>
2842         <required id="can_pop_frame"></required>
2843       </capabilities>
2844       <parameters>
2845         <param id="thread">
2846           <jthread/>
2847             <description>
2848               The thread whose current frame is to be popped.
2849             </description>
2850         </param>
2851       </parameters>
2852       <errors>
2853         <error id="JVMTI_ERROR_OPAQUE_FRAME">
2854           Called or calling method is a native method.
2855           The implementation is unable to pop this frame.
2856         </error>
2857         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
2858           Thread was not suspended.
2859         </error>
2860         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
2861           There are less than two stack frames on the call stack.
2862         </error>
2863       </errors>
2864     </function>
2865 
2866     <function id="GetFrameLocation" num="19">
2867       <synopsis>Get Frame Location</synopsis>
2868       <description>
2869         <p/>
2870         For a Java programming language frame, return the location of the instruction
2871         currently executing.
2872       </description>
2873       <origin>jvmdiClone</origin>
2874       <capabilities>
2875       </capabilities>
2876       <parameters>
2877         <param id="thread">
2878           <jthread null="current" frame="frame"/>
2879           <description>
2880             The thread of the frame to query.
2881           </description>
2882         </param>
2883         <param id="depth">
2884           <jframeID thread="thread"/>
2885           <description>
2886             The depth of the frame to query.
2887           </description>
2888         </param>
2889         <param id="method_ptr">
2890           <outptr><jmethodID/></outptr>
2891             <description>
2892               On return, points to the method for the current location.
2893             </description>
2894         </param>
2895         <param id="location_ptr">
2896           <outptr><jlocation/></outptr>
2897           <description>
2898             On return, points to the index of the currently
2899             executing instruction.
2900             Is set to <code>-1</code> if the frame is executing
2901             a native method.
2902           </description>
2903         </param>
2904       </parameters>
2905       <errors>
2906       </errors>
2907     </function>
2908 
2909     <function id="NotifyFramePop" num="20">
2910       <synopsis>Notify Frame Pop</synopsis>
2911       <description>
2912         When the frame that is currently at <paramlink id="depth"></paramlink>
2913         is popped from the stack, generate a
2914         <eventlink id="FramePop"></eventlink> event.  See the
2915         <eventlink id="FramePop"></eventlink> event for details.
2916         Only frames corresponding to non-native Java programming language
2917         methods can receive notification.
2918         <p/>
2919         The specified thread must either be the current thread
2920         or the thread must be suspended.
2921       </description>
2922       <origin>jvmdi</origin>
2923       <capabilities>
2924         <required id="can_generate_frame_pop_events"></required>
2925       </capabilities>
2926       <parameters>
2927         <param id="thread">
2928           <jthread null="current" frame="depth"/>
2929           <description>
2930             The thread of the frame for which the frame pop event will be generated.
2931           </description>
2932         </param>
2933         <param id="depth">
2934           <jframeID thread="thread"/>
2935           <description>
2936             The depth of the frame for which the frame pop event will be generated.
2937           </description>
2938         </param>
2939       </parameters>
2940       <errors>
2941         <error id="JVMTI_ERROR_OPAQUE_FRAME">
2942           The frame at <code>depth</code> is executing a
2943           native method.
2944         </error>
2945         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
2946           Thread was not suspended and was not the current thread.
2947         </error>
2948       </errors>
2949     </function>
2950 
2951   </category>
2952 
2953   <category id="ForceEarlyReturn" label="Force Early Return">
2954     <intro>
2955       These functions allow an agent to force a method
2956       to return at any point during its execution.
2957       The method which will return early is referred to as the <i>called method</i>.
2958       The called method is the current method
2959       (as defined by
2960       <vmspec chapter="3.6"/>)
2961       for the specified thread at
2962       the time the function is called.
2963       <p/>
2964       The specified thread must be suspended or must be the current thread.
2965       The return occurs when execution of Java programming
2966       language code is resumed on this thread.
2967       Between calling one of these functions and resumption
2968       of thread execution, the state of the stack is undefined.
2969       <p/>
2970       No further instructions are executed in the called method.
2971       Specifically, finally blocks are not executed.
2972       Note: this can cause inconsistent states in the application.
2973       <p/>
2974       A lock acquired by calling the called method
2975       (if it is a <code>synchronized</code>  method)
2976       and locks acquired by entering <code>synchronized</code>
2977       blocks within the called method are released.
2978       Note: this does not apply to native locks or
2979       <code>java.util.concurrent.locks</code> locks.
2980       <p/>
2981       Events, such as <eventlink id="MethodExit"></eventlink>,
2982       are generated as they would be in a normal return.
2983       <p/>
2984       The called method must be a non-native Java programming
2985       language method.
2986       Forcing return on a thread with only one frame on the
2987       stack causes the thread to exit when resumed.
2988     </intro>
2989 
2990     <function id="ForceEarlyReturnObject" num="81" since="1.1">
2991       <synopsis>Force Early Return - Object</synopsis>
2992       <description>
2993         This function can be used to return from a method whose
2994         result type is <code>Object</code>
2995         or a subclass of <code>Object</code>.
2996       </description>
2997       <origin>new</origin>
2998       <capabilities>
2999         <required id="can_force_early_return"></required>
3000       </capabilities>
3001       <parameters>
3002         <param id="thread">
3003           <jthread null="current"/>
3004           <description>
3005             The thread whose current frame is to return early.
3006           </description>
3007         </param>
3008         <param id="value">
3009           <jobject/>
3010           <description>
3011             The return value for the called frame.
3012             An object or <code>NULL</code>.
3013           </description>
3014         </param>
3015       </parameters>
3016       <errors>
3017         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3018           Attempted to return early from a frame
3019           corresponding to a native method.
3020           Or the implementation is unable to provide
3021           this functionality on this frame.
3022         </error>
3023         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3024           The result type of the called method is not
3025           <code>Object</code> or a subclass of <code>Object</code>.
3026         </error>
3027         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3028           The supplied <paramlink id="value"/> is not compatible with the
3029           result type of the called method.
3030         </error>
3031         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3032           Thread was not the current thread and was not suspended.
3033         </error>
3034         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3035           There are no more frames on the call stack.
3036         </error>
3037       </errors>
3038     </function>
3039 
3040     <function id="ForceEarlyReturnInt" num="82" since="1.1">
3041       <synopsis>Force Early Return - Int</synopsis>
3042       <description>
3043         This function can be used to return from a method whose
3044         result type is <code>int</code>, <code>short</code>,
3045         <code>char</code>, <code>byte</code>, or
3046         <code>boolean</code>.
3047       </description>
3048       <origin>new</origin>
3049       <capabilities>
3050         <required id="can_force_early_return"></required>
3051       </capabilities>
3052       <parameters>
3053         <param id="thread">
3054           <jthread null="current"/>
3055           <description>
3056             The thread whose current frame is to return early.
3057           </description>
3058         </param>
3059         <param id="value">
3060           <jint/>
3061           <description>
3062             The return value for the called frame.
3063           </description>
3064         </param>
3065       </parameters>
3066       <errors>
3067         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3068           Attempted to return early from a frame
3069           corresponding to a native method.
3070           Or the implementation is unable to provide
3071           this functionality on this frame.
3072         </error>
3073         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3074           The result type of the called method is not
3075           <code>int</code>, <code>short</code>,
3076           <code>char</code>, <code>byte</code>, or
3077           <code>boolean</code>.
3078         </error>
3079         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3080           Thread was not the current thread and was not suspended.
3081         </error>
3082         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3083           There are no frames on the call stack.
3084         </error>
3085       </errors>
3086     </function>
3087 
3088     <function id="ForceEarlyReturnLong" num="83" since="1.1">
3089       <synopsis>Force Early Return - Long</synopsis>
3090       <description>
3091         This function can be used to return from a method whose
3092         result type is <code>long</code>.
3093       </description>
3094       <origin>new</origin>
3095       <capabilities>
3096         <required id="can_force_early_return"></required>
3097       </capabilities>
3098       <parameters>
3099         <param id="thread">
3100           <jthread null="current"/>
3101           <description>
3102             The thread whose current frame is to return early.
3103           </description>
3104         </param>
3105         <param id="value">
3106           <jlong/>
3107           <description>
3108             The return value for the called frame.
3109           </description>
3110         </param>
3111       </parameters>
3112       <errors>
3113         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3114           Attempted to return early from a frame
3115           corresponding to a native method.
3116           Or the implementation is unable to provide
3117           this functionality on this frame.
3118         </error>
3119         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3120           The result type of the called method is not <code>long</code>.
3121         </error>
3122         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3123           Thread was not the current thread and was not suspended.
3124         </error>
3125         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3126           There are no frames on the call stack.
3127         </error>
3128       </errors>
3129     </function>
3130 
3131     <function id="ForceEarlyReturnFloat" num="84" since="1.1">
3132       <synopsis>Force Early Return - Float</synopsis>
3133       <description>
3134         This function can be used to return from a method whose
3135         result type is <code>float</code>.
3136       </description>
3137       <origin>new</origin>
3138       <capabilities>
3139         <required id="can_force_early_return"></required>
3140       </capabilities>
3141       <parameters>
3142         <param id="thread">
3143           <jthread null="current"/>
3144           <description>
3145             The thread whose current frame is to return early.
3146           </description>
3147         </param>
3148         <param id="value">
3149           <jfloat/>
3150           <description>
3151             The return value for the called frame.
3152           </description>
3153         </param>
3154       </parameters>
3155       <errors>
3156         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3157           Attempted to return early from a frame
3158           corresponding to a native method.
3159           Or the implementation is unable to provide
3160           this functionality on this frame.
3161         </error>
3162         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3163           The result type of the called method is not <code>float</code>.
3164         </error>
3165         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3166           Thread was not the current thread and was not suspended.
3167         </error>
3168         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3169           There are no frames on the call stack.
3170         </error>
3171       </errors>
3172     </function>
3173 
3174     <function id="ForceEarlyReturnDouble" num="85" since="1.1">
3175       <synopsis>Force Early Return - Double</synopsis>
3176       <description>
3177         This function can be used to return from a method whose
3178         result type is <code>double</code>.
3179       </description>
3180       <origin>new</origin>
3181       <capabilities>
3182         <required id="can_force_early_return"></required>
3183       </capabilities>
3184       <parameters>
3185         <param id="thread">
3186           <jthread null="current"/>
3187           <description>
3188             The thread whose current frame is to return early.
3189           </description>
3190         </param>
3191         <param id="value">
3192           <jdouble/>
3193           <description>
3194             The return value for the called frame.
3195           </description>
3196         </param>
3197       </parameters>
3198       <errors>
3199         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3200           Attempted to return early from a frame corresponding to a native method.
3201           Or the implementation is unable to provide this functionality on this frame.
3202         </error>
3203         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3204           The result type of the called method is not <code>double</code>.
3205         </error>
3206         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3207           Thread was not the current thread and was not suspended.
3208         </error>
3209         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3210           There are no frames on the call stack.
3211         </error>
3212       </errors>
3213     </function>
3214 
3215     <function id="ForceEarlyReturnVoid" num="86" since="1.1">
3216       <synopsis>Force Early Return - Void</synopsis>
3217       <description>
3218         This function can be used to return from a method with no result type.
3219         That is, the called method must be declared <code>void</code>.
3220       </description>
3221       <origin>new</origin>
3222       <capabilities>
3223         <required id="can_force_early_return"></required>
3224       </capabilities>
3225       <parameters>
3226         <param id="thread">
3227           <jthread null="current"/>
3228           <description>
3229             The thread whose current frame is to return early.
3230           </description>
3231         </param>
3232       </parameters>
3233       <errors>
3234         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3235           Attempted to return early from a frame
3236           corresponding to a native method.
3237           Or the implementation is unable to provide
3238           this functionality on this frame.
3239         </error>
3240         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3241           The called method has a result type.
3242         </error>
3243         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3244           Thread was not the current thread and was not suspended.
3245         </error>
3246         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3247           There are no frames on the call stack.
3248         </error>
3249       </errors>
3250     </function>
3251 
3252   </category>
3253 
3254   <category id="Heap" label="Heap">
3255     <intro>
3256       These functions are used to analyze the heap.
3257       Functionality includes the ability to view the objects in the
3258       heap and to tag these objects.
3259     </intro>
3260 
3261     <intro id="objectTags" label="Object Tags">
3262       A <i>tag</i> is a value associated with an object.
3263       Tags are explicitly set by the agent using the
3264       <functionlink id="SetTag"></functionlink> function or by
3265       callback functions such as <functionlink id="jvmtiHeapIterationCallback"/>.
3266       <p/>
3267       Tags are local to the environment; that is, the tags of one
3268       environment are not visible in another.
3269       <p/>
3270       Tags are <code>jlong</code> values which can be used
3271       simply to mark an object or to store a pointer to more detailed
3272       information.  Objects which have not been tagged have a
3273       tag of zero.
3274       Setting a tag to zero makes the object untagged.
3275     </intro>
3276 
3277     <intro id="heapCallbacks" label="Heap Callback Functions">
3278         Heap functions which iterate through the heap and recursively
3279         follow object references use agent supplied callback functions
3280         to deliver the information.
3281         <p/>
3282         These heap callback functions must adhere to the following restrictions --
3283         These callbacks must not use JNI functions.
3284         These callbacks must not use <jvmti/> functions except
3285         <i>callback safe</i> functions which
3286         specifically allow such use (see the raw monitor, memory management,
3287         and environment local storage functions).
3288         <p/>
3289         An implementation may invoke a callback on an internal thread or
3290         the thread which called the iteration function.
3291         Heap callbacks are single threaded -- no more than one callback will
3292         be invoked at a time.
3293         <p/>
3294         The Heap Filter Flags can be used to prevent reporting
3295         based on the tag status of an object or its class.
3296         If no flags are set (the <code>jint</code> is zero), objects
3297         will not be filtered out.
3298 
3299         <constants id="jvmtiHeapFilter" label="Heap Filter Flags" kind="bits">
3300           <constant id="JVMTI_HEAP_FILTER_TAGGED" num="0x4">
3301             Filter out tagged objects. Objects which are tagged are not included.
3302           </constant>
3303           <constant id="JVMTI_HEAP_FILTER_UNTAGGED" num="0x8">
3304             Filter out untagged objects. Objects which are not tagged are not included.
3305           </constant>
3306           <constant id="JVMTI_HEAP_FILTER_CLASS_TAGGED" num="0x10">
3307             Filter out objects with tagged classes. Objects whose class is tagged are not included.
3308           </constant>
3309           <constant id="JVMTI_HEAP_FILTER_CLASS_UNTAGGED" num="0x20">
3310             Filter out objects with untagged classes. Objects whose class is not tagged are not included.
3311           </constant>
3312         </constants>
3313 
3314         <p/>
3315         The Heap Visit Control Flags are returned by the heap callbacks
3316         and can be used to abort the iteration.  For the
3317         <functionlink id="jvmtiHeapReferenceCallback">Heap
3318         Reference Callback</functionlink>, it can also be used
3319         to prune the graph of traversed references
3320         (<code>JVMTI_VISIT_OBJECTS</code> is not set).
3321 
3322         <constants id="jvmtiHeapVisitControl"
3323                    label="Heap Visit Control Flags"
3324                    kind="bits"
3325                    since="1.1">
3326           <constant id="JVMTI_VISIT_OBJECTS" num="0x100">
3327             If we are visiting an object and if this callback
3328             was initiated by <functionlink id="FollowReferences"/>,
3329             traverse the references of this object.
3330             Otherwise ignored.
3331           </constant>
3332           <constant id="JVMTI_VISIT_ABORT" num="0x8000">
3333             Abort the iteration.  Ignore all other bits.
3334           </constant>
3335         </constants>
3336 
3337         <p/>
3338         The Heap Reference Enumeration is provided by the
3339         <functionlink id="jvmtiHeapReferenceCallback">Heap
3340         Reference Callback</functionlink> and
3341         <functionlink id="jvmtiPrimitiveFieldCallback">Primitive Field
3342         Callback</functionlink> to
3343         describe the kind of reference
3344         being reported.
3345 
3346         <constants id="jvmtiHeapReferenceKind"
3347                    label="Heap Reference Enumeration"
3348                    kind="enum"
3349                    since="1.1">
3350           <constant id="JVMTI_HEAP_REFERENCE_CLASS" num="1">
3351             Reference from an object to its class.
3352           </constant>
3353           <constant id="JVMTI_HEAP_REFERENCE_FIELD" num="2">
3354             Reference from an object to the value of one of its instance fields.
3355           </constant>
3356           <constant id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT" num="3">
3357             Reference from an array to one of its elements.
3358           </constant>
3359           <constant id="JVMTI_HEAP_REFERENCE_CLASS_LOADER" num="4">
3360             Reference from a class to its class loader.
3361           </constant>
3362           <constant id="JVMTI_HEAP_REFERENCE_SIGNERS" num="5">
3363             Reference from a class to its signers array.
3364           </constant>
3365           <constant id="JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN" num="6">
3366             Reference from a class to its protection domain.
3367           </constant>
3368           <constant id="JVMTI_HEAP_REFERENCE_INTERFACE" num="7">
3369             Reference from a class to one of its interfaces.
3370             Note: interfaces are defined via a constant pool reference,
3371             so the referenced interfaces may also be reported with a
3372             <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3373           </constant>
3374           <constant id="JVMTI_HEAP_REFERENCE_STATIC_FIELD" num="8">
3375             Reference from a class to the value of one of its static fields.
3376           </constant>
3377           <constant id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL" num="9">
3378             Reference from a class to a resolved entry in the constant pool.
3379           </constant>
3380           <constant id="JVMTI_HEAP_REFERENCE_SUPERCLASS" num="10">
3381             Reference from a class to its superclass.
3382             A callback is not sent if the superclass is <code>java.lang.Object</code>.
3383             Note: loaded classes define superclasses via a constant pool
3384             reference, so the referenced superclass may also be reported with
3385             a <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3386           </constant>
3387           <constant id="JVMTI_HEAP_REFERENCE_JNI_GLOBAL" num="21">
3388             Heap root reference: JNI global reference.
3389           </constant>
3390           <constant id="JVMTI_HEAP_REFERENCE_SYSTEM_CLASS" num="22">
3391             Heap root reference: System class.
3392           </constant>
3393           <constant id="JVMTI_HEAP_REFERENCE_MONITOR" num="23">
3394             Heap root reference: monitor.
3395           </constant>
3396           <constant id="JVMTI_HEAP_REFERENCE_STACK_LOCAL" num="24">
3397             Heap root reference: local variable on the stack.
3398           </constant>
3399           <constant id="JVMTI_HEAP_REFERENCE_JNI_LOCAL" num="25">
3400             Heap root reference: JNI local reference.
3401           </constant>
3402           <constant id="JVMTI_HEAP_REFERENCE_THREAD" num="26">
3403             Heap root reference: Thread.
3404           </constant>
3405           <constant id="JVMTI_HEAP_REFERENCE_OTHER" num="27">
3406             Heap root reference: other heap root reference.
3407           </constant>
3408         </constants>
3409 
3410         <p/>
3411         Definitions for the single character type descriptors of
3412         primitive types.
3413 
3414         <constants id="jvmtiPrimitiveType"
3415                    label="Primitive Type Enumeration"
3416                    kind="enum"
3417                    since="1.1">
3418           <constant id="JVMTI_PRIMITIVE_TYPE_BOOLEAN" num="90">
3419             'Z' - Java programming language <code>boolean</code> - JNI <code>jboolean</code>
3420           </constant>
3421           <constant id="JVMTI_PRIMITIVE_TYPE_BYTE" num="66">
3422             'B' - Java programming language <code>byte</code> - JNI <code>jbyte</code>
3423           </constant>
3424           <constant id="JVMTI_PRIMITIVE_TYPE_CHAR" num="67">
3425             'C' - Java programming language <code>char</code> - JNI <code>jchar</code>
3426           </constant>
3427           <constant id="JVMTI_PRIMITIVE_TYPE_SHORT" num="83">
3428             'S' - Java programming language <code>short</code> - JNI <code>jshort</code>
3429           </constant>
3430           <constant id="JVMTI_PRIMITIVE_TYPE_INT" num="73">
3431             'I' - Java programming language <code>int</code> - JNI <code>jint</code>
3432           </constant>
3433           <constant id="JVMTI_PRIMITIVE_TYPE_LONG" num="74">
3434             'J' - Java programming language <code>long</code> - JNI <code>jlong</code>
3435           </constant>
3436           <constant id="JVMTI_PRIMITIVE_TYPE_FLOAT" num="70">
3437             'F' - Java programming language <code>float</code> - JNI <code>jfloat</code>
3438           </constant>
3439           <constant id="JVMTI_PRIMITIVE_TYPE_DOUBLE" num="68">
3440             'D' - Java programming language <code>double</code> - JNI <code>jdouble</code>
3441           </constant>
3442         </constants>
3443     </intro>
3444 
3445       <typedef id="jvmtiHeapReferenceInfoField"
3446                label="Reference information structure for Field references"
3447                since="1.1">
3448         <description>
3449           Reference information returned for
3450           <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> and
3451           <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3452         </description>
3453         <field id="index">
3454           <jint/>
3455           <description>
3456             For <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>, the
3457             referrer object is not a class or an inteface.
3458             In this case, <code>index</code> is the index of the field
3459             in the class of the referrer object.
3460             This class is referred to below as <i>C</i>.
3461             <p/>
3462             For <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
3463             the referrer object is a class (referred to below as <i>C</i>)
3464             or an interface (referred to below as <i>I</i>).
3465             In this case, <code>index</code> is the index of the field in
3466             that class or interface.
3467             <p/>
3468             If the referrer object is not an interface, then the field
3469             indices are determined as follows:
3470             <ul>
3471               <li>make a list of all the fields in <i>C</i> and its
3472                   superclasses, starting with all the fields in
3473                   <code>java.lang.Object</code> and ending with all the
3474                   fields in <i>C</i>.</li>
3475               <li>Within this list, put
3476                   the fields for a given class in the order returned by
3477                   <functionlink id="GetClassFields"/>.</li>
3478               <li>Assign the fields in this list indices
3479                   <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i>
3480                   is the count of the fields in all the interfaces
3481                   implemented by <i>C</i>.
3482                   Note that <i>C</i> implements all interfaces
3483                   directly implemented by its superclasses; as well
3484                   as all superinterfaces of these interfaces.</li>
3485             </ul>
3486             If the referrer object is an interface, then the field
3487             indices are determined as follows:
3488             <ul>
3489               <li>make a list of the fields directly declared in
3490                   <i>I</i>.</li>
3491               <li>Within this list, put
3492                   the fields in the order returned by
3493                   <functionlink id="GetClassFields"/>.</li>
3494               <li>Assign the fields in this list indices
3495                   <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i>
3496                   is the count of the fields in all the superinterfaces
3497                   of <i>I</i>.</li>
3498             </ul>
3499             All fields are included in this computation, regardless of
3500             field modifier (static, public, private, etc).
3501             <p/>
3502             For example, given the following classes and interfaces:
3503             <example>
3504 interface I0 {
3505     int p = 0;
3506 }
3507 
3508 interface I1 extends I0 {
3509     int x = 1;
3510 }
3511 
3512 interface I2 extends I0 {
3513     int y = 2;
3514 }
3515 
3516 class C1 implements I1 {
3517     public static int a = 3;
3518     private int b = 4;
3519 }
3520 
3521 class C2 extends C1 implements I2 {
3522     static int q = 5;
3523     final int r = 6;
3524 }
3525             </example>
3526             Assume that <functionlink id="GetClassFields"/> called on
3527             <code>C1</code> returns the fields of <code>C1</code> in the
3528             order: a, b; and that the fields of <code>C2</code> are
3529             returned in the order: q, r.
3530             An instance of class <code>C1</code> will have the
3531             following field indices:
3532             <blockquote><table>
3533               <tr>
3534                 <td class="centered">
3535                   a
3536                 </td>
3537                 <td class="centered">
3538                   2
3539                 </td>
3540                 <td>
3541                   The count of the fields in the interfaces
3542                   implemented by <code>C1</code> is two (<i>n</i>=2):
3543                   <code>p</code> of <code>I0</code>
3544                   and <code>x</code> of <code>I1</code>.
3545                 </td>
3546               </tr>
3547               <tr>
3548                 <td class="centered">
3549                   b
3550                 </td>
3551                 <td class="centered">
3552                   3
3553                 </td>
3554                 <td>
3555                   the subsequent index.
3556                 </td>
3557               </tr>
3558             </table></blockquote>
3559             The class <code>C1</code> will have the same field indices.
3560             <p/>
3561             An instance of class <code>C2</code> will have the
3562             following field indices:
3563             <blockquote><table>
3564               <tr>
3565                 <td class="centered">
3566                   a
3567                 </td>
3568                 <td class="centered">
3569                   3
3570                 </td>
3571                 <td>
3572                   The count of the fields in the interfaces
3573                   implemented by <code>C2</code> is three (<i>n</i>=3):
3574                   <code>p</code> of <code>I0</code>,
3575                   <code>x</code> of <code>I1</code> and <code>y</code> of <code>I2</code>
3576                   (an interface of <code>C2</code>).  Note that the field <code>p</code>
3577                   of <code>I0</code> is only included once.
3578                 </td>
3579               </tr>
3580               <tr>
3581                 <td class="centered">
3582                   b
3583                 </td>
3584                 <td class="centered">
3585                   4
3586                 </td>
3587                 <td>
3588                   the subsequent index to "a".
3589                 </td>
3590               </tr>
3591               <tr>
3592                 <td class="centered">
3593                   q
3594                 </td>
3595                 <td class="centered">
3596                   5
3597                 </td>
3598                 <td>
3599                   the subsequent index to "b".
3600                 </td>
3601               </tr>
3602               <tr>
3603                 <td class="centered">
3604                   r
3605                 </td>
3606                 <td class="centered">
3607                   6
3608                 </td>
3609                 <td>
3610                   the subsequent index to "q".
3611                 </td>
3612               </tr>
3613             </table></blockquote>
3614             The class <code>C2</code> will have the same field indices.
3615             Note that a field may have a different index depending on the
3616             object that is viewing it -- for example field "a" above.
3617             Note also: not all field indices may be visible from the
3618             callbacks, but all indices are shown for illustrative purposes.
3619             <p/>
3620             The interface <code>I1</code> will have the
3621             following field indices:
3622             <blockquote><table>
3623               <tr>
3624                 <td class="centered">
3625                   x
3626                 </td>
3627                 <td class="centered">
3628                   1
3629                 </td>
3630                 <td>
3631                   The count of the fields in the superinterfaces
3632                   of <code>I1</code> is one (<i>n</i>=1):
3633                   <code>p</code> of <code>I0</code>.
3634                 </td>
3635               </tr>
3636             </table></blockquote>
3637           </description>
3638         </field>
3639       </typedef>
3640 
3641       <typedef id="jvmtiHeapReferenceInfoArray"
3642                label="Reference information structure for Array references"
3643                since="1.1">
3644         <description>
3645           Reference information returned for
3646          <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3647         </description>
3648         <field id="index">
3649           <jint/>
3650           <description>
3651             The array index.
3652           </description>
3653         </field>
3654       </typedef>
3655 
3656       <typedef id="jvmtiHeapReferenceInfoConstantPool"
3657                label="Reference information structure for Constant Pool references"
3658                since="1.1">
3659         <description>
3660           Reference information returned for
3661           <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3662         </description>
3663         <field id="index">
3664           <jint/>
3665           <description>
3666             The index into the constant pool of the class. See the description in
3667       <vmspec chapter="4.4"/>.
3668           </description>
3669         </field>
3670       </typedef>
3671 
3672       <typedef id="jvmtiHeapReferenceInfoStackLocal"
3673                label="Reference information structure for Local Variable references"
3674                since="1.1">
3675         <description>
3676           Reference information returned for
3677           <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3678         </description>
3679         <field id="thread_tag">
3680           <jlong/>
3681           <description>
3682             The tag of the thread corresponding to this stack, zero if not tagged.
3683           </description>
3684         </field>
3685         <field id="thread_id">
3686           <jlong/>
3687           <description>
3688             The unique thread ID of the thread corresponding to this stack.
3689           </description>
3690         </field>
3691         <field id="depth">
3692           <jint/>
3693           <description>
3694             The depth of the frame.
3695           </description>
3696         </field>
3697         <field id="method">
3698           <jmethodID/>
3699           <description>
3700             The method executing in this frame.
3701           </description>
3702         </field>
3703         <field id="location">
3704           <jlocation/>
3705           <description>
3706             The currently executing location in this frame.
3707           </description>
3708         </field>
3709         <field id="slot">
3710           <jint/>
3711           <description>
3712             The slot number of the local variable.
3713           </description>
3714         </field>
3715       </typedef>
3716 
3717       <typedef id="jvmtiHeapReferenceInfoJniLocal"
3718                label="Reference information structure for JNI local references"
3719                since="1.1">
3720         <description>
3721           Reference information returned for
3722           <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3723         </description>
3724         <field id="thread_tag">
3725           <jlong/>
3726           <description>
3727             The tag of the thread corresponding to this stack, zero if not tagged.
3728           </description>
3729         </field>
3730         <field id="thread_id">
3731           <jlong/>
3732           <description>
3733             The unique thread ID of the thread corresponding to this stack.
3734           </description>
3735         </field>
3736         <field id="depth">
3737           <jint/>
3738           <description>
3739             The depth of the frame.
3740           </description>
3741         </field>
3742         <field id="method">
3743           <jmethodID/>
3744           <description>
3745             The method executing in this frame.
3746           </description>
3747         </field>
3748       </typedef>
3749 
3750       <typedef id="jvmtiHeapReferenceInfoReserved"
3751                label="Reference information structure for Other references"
3752                since="1.1">
3753         <description>
3754           Reference information returned for other references.
3755         </description>
3756         <field id="reserved1">
3757           <jlong/>
3758           <description>
3759             reserved for future use.
3760           </description>
3761         </field>
3762         <field id="reserved2">
3763           <jlong/>
3764           <description>
3765             reserved for future use.
3766           </description>
3767         </field>
3768         <field id="reserved3">
3769           <jlong/>
3770           <description>
3771             reserved for future use.
3772           </description>
3773         </field>
3774         <field id="reserved4">
3775           <jlong/>
3776           <description>
3777             reserved for future use.
3778           </description>
3779         </field>
3780         <field id="reserved5">
3781           <jlong/>
3782           <description>
3783             reserved for future use.
3784           </description>
3785         </field>
3786         <field id="reserved6">
3787           <jlong/>
3788           <description>
3789             reserved for future use.
3790           </description>
3791         </field>
3792         <field id="reserved7">
3793           <jlong/>
3794           <description>
3795             reserved for future use.
3796           </description>
3797         </field>
3798         <field id="reserved8">
3799           <jlong/>
3800           <description>
3801             reserved for future use.
3802           </description>
3803         </field>
3804       </typedef>
3805 
3806       <uniontypedef id="jvmtiHeapReferenceInfo"
3807                label="Reference information structure"
3808                since="1.1">
3809         <description>
3810           The information returned about referrers.
3811           Represented as a union of the various kinds of reference information.
3812         </description>
3813         <field id="field">
3814           <struct>jvmtiHeapReferenceInfoField</struct>
3815           <description>
3816             The referrer information for
3817             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>
3818             and <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3819           </description>
3820         </field>
3821         <field id="array">
3822           <struct>jvmtiHeapReferenceInfoArray</struct>
3823           <description>
3824             The referrer information for
3825             For <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3826           </description>
3827         </field>
3828         <field id="constant_pool">
3829           <struct>jvmtiHeapReferenceInfoConstantPool</struct>
3830           <description>
3831             The referrer information for
3832             For <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3833           </description>
3834         </field>
3835         <field id="stack_local">
3836           <struct>jvmtiHeapReferenceInfoStackLocal</struct>
3837           <description>
3838             The referrer information for
3839             For <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3840           </description>
3841         </field>
3842         <field id="jni_local">
3843           <struct>jvmtiHeapReferenceInfoJniLocal</struct>
3844           <description>
3845             The referrer information for
3846             For <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3847           </description>
3848         </field>
3849         <field id="other">
3850           <struct>jvmtiHeapReferenceInfoReserved</struct>
3851           <description>
3852             reserved for future use.
3853           </description>
3854         </field>
3855       </uniontypedef>
3856 
3857       <typedef id="jvmtiHeapCallbacks"
3858                label="Heap callback function structure"
3859                since="1.1">
3860         <field id="heap_iteration_callback">
3861           <ptrtype>
3862             <struct>jvmtiHeapIterationCallback</struct>
3863           </ptrtype>
3864           <description>
3865             The callback to be called to describe an
3866             object in the heap. Used by the
3867             <functionlink id="IterateThroughHeap"/> function, ignored by the
3868             <functionlink id="FollowReferences"/> function.
3869           </description>
3870         </field>
3871         <field id="heap_reference_callback">
3872           <ptrtype>
3873             <struct>jvmtiHeapReferenceCallback</struct>
3874           </ptrtype>
3875           <description>
3876             The callback to be called to describe an
3877             object reference.  Used by the
3878             <functionlink id="FollowReferences"/> function, ignored by the
3879             <functionlink id="IterateThroughHeap"/> function.
3880           </description>
3881         </field>
3882         <field id="primitive_field_callback">
3883           <ptrtype>
3884             <struct>jvmtiPrimitiveFieldCallback</struct>
3885           </ptrtype>
3886           <description>
3887             The callback to be called to describe a
3888             primitive field.
3889           </description>
3890         </field>
3891         <field id="array_primitive_value_callback">
3892           <ptrtype>
3893             <struct>jvmtiArrayPrimitiveValueCallback</struct>
3894           </ptrtype>
3895           <description>
3896             The callback to be called to describe an
3897             array of primitive values.
3898           </description>
3899         </field>
3900         <field id="string_primitive_value_callback">
3901           <ptrtype>
3902             <struct>jvmtiStringPrimitiveValueCallback</struct>
3903           </ptrtype>
3904           <description>
3905             The callback to be called to describe a String value.
3906           </description>
3907         </field>
3908         <field id="reserved5">
3909           <ptrtype>
3910             <struct>jvmtiReservedCallback</struct>
3911           </ptrtype>
3912           <description>
3913             Reserved for future use..
3914           </description>
3915         </field>
3916         <field id="reserved6">
3917           <ptrtype>
3918             <struct>jvmtiReservedCallback</struct>
3919           </ptrtype>
3920           <description>
3921             Reserved for future use..
3922           </description>
3923         </field>
3924         <field id="reserved7">
3925           <ptrtype>
3926             <struct>jvmtiReservedCallback</struct>
3927           </ptrtype>
3928           <description>
3929             Reserved for future use..
3930           </description>
3931         </field>
3932         <field id="reserved8">
3933           <ptrtype>
3934             <struct>jvmtiReservedCallback</struct>
3935           </ptrtype>
3936           <description>
3937             Reserved for future use..
3938           </description>
3939         </field>
3940         <field id="reserved9">
3941           <ptrtype>
3942             <struct>jvmtiReservedCallback</struct>
3943           </ptrtype>
3944           <description>
3945             Reserved for future use..
3946           </description>
3947         </field>
3948         <field id="reserved10">
3949           <ptrtype>
3950             <struct>jvmtiReservedCallback</struct>
3951           </ptrtype>
3952           <description>
3953             Reserved for future use..
3954           </description>
3955         </field>
3956         <field id="reserved11">
3957           <ptrtype>
3958             <struct>jvmtiReservedCallback</struct>
3959           </ptrtype>
3960           <description>
3961             Reserved for future use..
3962           </description>
3963         </field>
3964         <field id="reserved12">
3965           <ptrtype>
3966             <struct>jvmtiReservedCallback</struct>
3967           </ptrtype>
3968           <description>
3969             Reserved for future use..
3970           </description>
3971         </field>
3972         <field id="reserved13">
3973           <ptrtype>
3974             <struct>jvmtiReservedCallback</struct>
3975           </ptrtype>
3976           <description>
3977             Reserved for future use..
3978           </description>
3979         </field>
3980         <field id="reserved14">
3981           <ptrtype>
3982             <struct>jvmtiReservedCallback</struct>
3983           </ptrtype>
3984           <description>
3985             Reserved for future use..
3986           </description>
3987         </field>
3988         <field id="reserved15">
3989           <ptrtype>
3990             <struct>jvmtiReservedCallback</struct>
3991           </ptrtype>
3992           <description>
3993             Reserved for future use..
3994           </description>
3995         </field>
3996       </typedef>
3997 
3998 
3999     <intro>
4000       <rationale>
4001         The heap dumping functionality (below) uses a callback
4002         for each object.  While it would seem that a buffered approach
4003         would provide better throughput, tests do
4004         not show this to be the case--possibly due to locality of
4005         memory reference or array access overhead.
4006       </rationale>
4007 
4008       <issue>
4009         Still under investigation as to if java.lang.ref references
4010         are reported as a different type of reference.
4011       </issue>
4012 
4013       <issue>
4014         Should or can an indication of the cost or relative cost of
4015         these operations be included?
4016       </issue>
4017 
4018     </intro>
4019 
4020     <callback id="jvmtiHeapIterationCallback" since="1.1">
4021       <jint/>
4022       <synopsis>Heap Iteration Callback</synopsis>
4023       <description>
4024         Agent supplied callback function.
4025         Describes (but does not pass in) an object in the heap.
4026         <p/>
4027         This function should return a bit vector of the desired
4028         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4029         This will determine if the entire iteration should be aborted
4030         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4031         <p/>
4032         See the <internallink id="heapCallbacks">heap callback
4033         function restrictions</internallink>.
4034       </description>
4035       <parameters>
4036         <param id="class_tag">
4037           <jlong/>
4038           <description>
4039             The tag of the class of object (zero if the class is not tagged).
4040             If the object represents a runtime class,
4041             the <code>class_tag</code> is the tag
4042             associated with <code>java.lang.Class</code>
4043             (zero if <code>java.lang.Class</code> is not tagged).
4044           </description>
4045         </param>
4046         <param id="size">
4047           <jlong/>
4048           <description>
4049             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
4050           </description>
4051         </param>
4052         <param id="tag_ptr">
4053           <outptr><jlong/></outptr>
4054           <description>
4055             The object tag value, or zero if the object is not tagged.
4056             To set the tag value to be associated with the object
4057             the agent sets the <code>jlong</code> pointed to by the parameter.
4058           </description>
4059         </param>
4060         <param id="length">
4061           <jint/>
4062           <description>
4063             If this object is an array, the length of the array. Otherwise negative one (-1).
4064           </description>
4065         </param>
4066         <param id="user_data">
4067           <outptr><void/></outptr>
4068           <description>
4069             The user supplied data that was passed into the iteration function.
4070           </description>
4071         </param>
4072       </parameters>
4073     </callback>
4074 
4075     <callback id="jvmtiHeapReferenceCallback" since="1.1">
4076       <jint/>
4077       <synopsis>Heap Reference Callback</synopsis>
4078       <description>
4079         Agent supplied callback function.
4080         Describes a reference from an object or the VM (the referrer) to another object
4081         (the referree) or a heap root to a referree.
4082         <p/>
4083         This function should return a bit vector of the desired
4084         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4085         This will determine if the objects referenced by the referree
4086         should be visited or if the entire iteration should be aborted.
4087         <p/>
4088         See the <internallink id="heapCallbacks">heap callback
4089         function restrictions</internallink>.
4090       </description>
4091       <parameters>
4092         <param id="reference_kind">
4093           <enum>jvmtiHeapReferenceKind</enum>
4094           <description>
4095             The kind of reference.
4096           </description>
4097         </param>
4098         <param id="reference_info">
4099           <inptr>
4100             <struct>jvmtiHeapReferenceInfo</struct>
4101           </inptr>
4102           <description>
4103             Details about the reference.
4104             Set when the <datalink id="jvmtiHeapReferenceCallback.reference_kind">reference_kind</datalink> is
4105             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>,
4106             <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
4107             <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/>,
4108             <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/>,
4109             <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/>,
4110             or <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/>.
4111             Otherwise <code>NULL</code>.
4112           </description>
4113         </param>
4114         <param id="class_tag">
4115           <jlong/>
4116           <description>
4117             The tag of the class of referree object (zero if the class is not tagged).
4118             If the referree object represents a runtime class,
4119             the <code>class_tag</code> is the tag
4120             associated with <code>java.lang.Class</code>
4121             (zero if <code>java.lang.Class</code> is not tagged).
4122           </description>
4123         </param>
4124         <param id="referrer_class_tag">
4125           <jlong/>
4126           <description>
4127             The tag of the class of the referrer object (zero if the class is not tagged
4128             or the referree is a heap root). If the referrer object represents a runtime
4129             class, the <code>referrer_class_tag</code> is the tag associated with
4130             the <code>java.lang.Class</code>
4131             (zero if <code>java.lang.Class</code> is not tagged).
4132           </description>
4133         </param>
4134         <param id="size">
4135           <jlong/>
4136           <description>
4137             Size of the referree object (in bytes).
4138             See <functionlink id="GetObjectSize"/>.
4139           </description>
4140         </param>
4141         <param id="tag_ptr">
4142           <outptr><jlong/></outptr>
4143           <description>
4144             Points to the referree object tag value, or zero if the object is not
4145             tagged.
4146             To set the tag value to be associated with the object
4147             the agent sets the <code>jlong</code> pointed to by the parameter.
4148           </description>
4149         </param>
4150         <param id="referrer_tag_ptr">
4151           <outptr><jlong/></outptr>
4152           <description>
4153             Points to the tag of the referrer object, or
4154             points to the zero if the referrer
4155             object is not tagged.
4156             <code>NULL</code> if the referrer in not an object (that is,
4157             this callback is reporting a heap root).
4158             To set the tag value to be associated with the referrer object
4159             the agent sets the <code>jlong</code> pointed to by the parameter.
4160             If this callback is reporting a reference from an object to itself,
4161             <code>referrer_tag_ptr == tag_ptr</code>.
4162           </description>
4163         </param>
4164         <param id="length">
4165           <jint/>
4166           <description>
4167             If this object is an array, the length of the array. Otherwise negative one (-1).
4168           </description>
4169         </param>
4170         <param id="user_data">
4171           <outptr><void/></outptr>
4172           <description>
4173             The user supplied data that was passed into the iteration function.
4174           </description>
4175         </param>
4176       </parameters>
4177     </callback>
4178 
4179     <callback id="jvmtiPrimitiveFieldCallback" since="1.1">
4180       <jint/>
4181       <synopsis>Primitive Field Callback</synopsis>
4182       <description>
4183         Agent supplied callback function which
4184         describes a primitive field of an object (<i>the object</i>).
4185         A primitive field is a field whose type is a primitive type.
4186         This callback will describe a static field if the object is a class,
4187         and otherwise will describe an instance field.
4188         <p/>
4189         This function should return a bit vector of the desired
4190         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4191         This will determine if the entire iteration should be aborted
4192         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4193         <p/>
4194         See the <internallink id="heapCallbacks">heap callback
4195         function restrictions</internallink>.
4196       </description>
4197       <parameters>
4198         <param id="kind">
4199           <enum>jvmtiHeapReferenceKind</enum>
4200           <description>
4201             The kind of field -- instance or static (<datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> or
4202             <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>).
4203           </description>
4204         </param>
4205         <param id="info">
4206           <inptr>
4207             <struct>jvmtiHeapReferenceInfo</struct>
4208           </inptr>
4209           <description>
4210             Which field (the field index).
4211           </description>
4212         </param>
4213         <param id="object_class_tag">
4214           <jlong/>
4215           <description>
4216             The tag of the class of the object (zero if the class is not tagged).
4217             If the object represents a runtime class, the
4218             <code>object_class_tag</code> is the tag
4219             associated with <code>java.lang.Class</code>
4220             (zero if <code>java.lang.Class</code> is not tagged).
4221           </description>
4222         </param>
4223         <param id="object_tag_ptr">
4224           <outptr><jlong/></outptr>
4225           <description>
4226             Points to the tag of the object, or zero if the object is not
4227             tagged.
4228             To set the tag value to be associated with the object
4229             the agent sets the <code>jlong</code> pointed to by the parameter.
4230           </description>
4231         </param>
4232         <param id="value">
4233           <jvalue/>
4234           <description>
4235             The value of the field.
4236           </description>
4237         </param>
4238         <param id="value_type">
4239           <enum>jvmtiPrimitiveType</enum>
4240           <description>
4241             The type of the field.
4242           </description>
4243         </param>
4244         <param id="user_data">
4245           <outptr><void/></outptr>
4246           <description>
4247             The user supplied data that was passed into the iteration function.
4248           </description>
4249         </param>
4250       </parameters>
4251     </callback>
4252 
4253     <callback id="jvmtiArrayPrimitiveValueCallback" since="1.1">
4254       <jint/>
4255       <synopsis>Array Primitive Value Callback</synopsis>
4256       <description>
4257         Agent supplied callback function.
4258         Describes the values in an array of a primitive type.
4259         <p/>
4260         This function should return a bit vector of the desired
4261         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4262         This will determine if the entire iteration should be aborted
4263         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4264         <p/>
4265         See the <internallink id="heapCallbacks">heap callback
4266         function restrictions</internallink>.
4267       </description>
4268       <parameters>
4269         <param id="class_tag">
4270           <jlong/>
4271           <description>
4272             The tag of the class of the array object (zero if the class is not tagged).
4273           </description>
4274         </param>
4275         <param id="size">
4276           <jlong/>
4277           <description>
4278             Size of the array (in bytes).
4279             See <functionlink id="GetObjectSize"/>.
4280           </description>
4281         </param>
4282         <param id="tag_ptr">
4283           <outptr><jlong/></outptr>
4284           <description>
4285             Points to the tag of the array object, or zero if the object is not
4286             tagged.
4287             To set the tag value to be associated with the object
4288             the agent sets the <code>jlong</code> pointed to by the parameter.
4289           </description>
4290         </param>
4291         <param id="element_count">
4292           <jint/>
4293           <description>
4294             The length of the primitive array.
4295           </description>
4296         </param>
4297         <param id="element_type">
4298           <enum>jvmtiPrimitiveType</enum>
4299           <description>
4300             The type of the elements of the array.
4301           </description>
4302         </param>
4303         <param id="elements">
4304           <vmbuf><void/></vmbuf>
4305           <description>
4306             The elements of the array in a packed array of <code>element_count</code>
4307             items of <code>element_type</code> size each.
4308           </description>
4309         </param>
4310         <param id="user_data">
4311           <outptr><void/></outptr>
4312           <description>
4313             The user supplied data that was passed into the iteration function.
4314           </description>
4315         </param>
4316       </parameters>
4317     </callback>
4318 
4319     <callback id="jvmtiStringPrimitiveValueCallback" since="1.1">
4320       <jint/>
4321       <synopsis>String Primitive Value Callback</synopsis>
4322       <description>
4323         Agent supplied callback function.
4324         Describes the value of a java.lang.String.
4325         <p/>
4326         This function should return a bit vector of the desired
4327         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4328         This will determine if the entire iteration should be aborted
4329         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4330         <p/>
4331         See the <internallink id="heapCallbacks">heap callback
4332         function restrictions</internallink>.
4333       </description>
4334       <parameters>
4335         <param id="class_tag">
4336           <jlong/>
4337           <description>
4338             The tag of the class of the String class (zero if the class is not tagged).
4339             <issue>Is this needed?</issue>
4340           </description>
4341         </param>
4342         <param id="size">
4343           <jlong/>
4344           <description>
4345             Size of the string (in bytes).
4346             See <functionlink id="GetObjectSize"/>.
4347           </description>
4348         </param>
4349         <param id="tag_ptr">
4350           <outptr><jlong/></outptr>
4351           <description>
4352             Points to the tag of the String object, or zero if the object is not
4353             tagged.
4354             To set the tag value to be associated with the object
4355             the agent sets the <code>jlong</code> pointed to by the parameter.
4356           </description>
4357         </param>
4358         <param id="value">
4359           <vmbuf><jchar/></vmbuf>
4360           <description>
4361             The value of the String, encoded as a Unicode string.
4362           </description>
4363         </param>
4364         <param id="value_length">
4365           <jint/>
4366           <description>
4367             The length of the string.
4368             The length is equal to the number of 16-bit Unicode
4369             characters in the string.
4370           </description>
4371         </param>
4372         <param id="user_data">
4373           <outptr><void/></outptr>
4374           <description>
4375             The user supplied data that was passed into the iteration function.
4376           </description>
4377         </param>
4378       </parameters>
4379     </callback>
4380 
4381 
4382     <callback id="jvmtiReservedCallback" since="1.1">
4383       <jint/>
4384       <synopsis>reserved for future use Callback</synopsis>
4385       <description>
4386         Placeholder -- reserved for future use.
4387       </description>
4388       <parameters>
4389       </parameters>
4390     </callback>
4391 
4392     <function id="FollowReferences" num="115" since="1.1">
4393       <synopsis>Follow References</synopsis>
4394       <description>
4395         This function initiates a traversal over the objects that are
4396         directly and indirectly reachable from the specified object or,
4397         if <code>initial_object</code> is not specified, all objects
4398         reachable from the heap roots.
4399         The heap root are the set of system classes,
4400         JNI globals, references from thread stacks, and other objects used as roots
4401         for the purposes of garbage collection.
4402         <p/>
4403         This function operates by traversing the reference graph.
4404         Let <i>A</i>, <i>B</i>, ... represent objects.
4405         When a reference from <i>A</i> to <i>B</i> is traversed,
4406         when a reference from a heap root to <i>B</i> is traversed,
4407         or when <i>B</i> is specified as the <paramlink id="initial_object"/>,
4408         then <i>B</i> is said to be <i>visited</i>.
4409         A reference from <i>A</i> to <i>B</i> is not traversed until <i>A</i>
4410         is visited.
4411         References are reported in the same order that the references are traversed.
4412         Object references are reported by invoking the agent supplied
4413         callback function <functionlink id="jvmtiHeapReferenceCallback"/>.
4414         In a reference from <i>A</i> to <i>B</i>, <i>A</i> is known
4415         as the <i>referrer</i> and <i>B</i> as the <i>referree</i>.
4416         The callback is invoked exactly once for each reference from a referrer;
4417         this is true even if there are reference cycles or multiple paths to
4418         the referrer.
4419         There may be more than one reference between a referrer and a referree,
4420         each reference is reported.
4421         These references may be distinguished by examining the
4422         <datalink
4423          id="jvmtiHeapReferenceCallback.reference_kind"><code>reference_kind</code></datalink>
4424          and
4425         <datalink
4426          id="jvmtiHeapReferenceCallback.reference_info"><code>reference_info</code></datalink>
4427         parameters of the <functionlink id="jvmtiHeapReferenceCallback"/> callback.
4428         <p/>
4429         This function reports a Java programming language view of object references,
4430         not a virtual machine implementation view. The following object references
4431         are reported when they are non-null:
4432         <ul>
4433           <li>Instance objects report references to each non-primitive instance fields
4434               (including inherited fields).</li>
4435           <li>Instance objects report a reference to the object type (class).</li>
4436           <li>Classes report a reference to the superclass and directly
4437               implemented/extended interfaces.</li>
4438           <li>Classes report a reference to the class loader, protection domain,
4439               signers, and resolved entries in the constant pool.</li>
4440           <li>Classes report a reference to each directly declared non-primitive
4441               static field.</li>
4442           <li>Arrays report a reference to the array type (class) and each
4443               array element.</li>
4444           <li>Primitive arrays report a reference to the array type.</li>
4445         </ul>
4446         <p/>
4447         This function can also be used to examine primitive (non-object) values.
4448         The primitive value of an array or String
4449         is reported after the object has been visited;
4450         it is reported by invoking the agent supplied callback function
4451         <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4452         <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4453         A primitive field
4454         is reported after the object with that field is visited;
4455         it is reported by invoking the agent supplied callback function
4456         <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4457         <p/>
4458         Whether a callback is provided or is <code>NULL</code> only determines
4459         whether the callback will be invoked, it does not influence
4460         which objects are visited nor does it influence whether other callbacks
4461         will be invoked.
4462         However, the
4463         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>
4464         returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4465         do determine if the objects referenced by the
4466         current object as visited.
4467         The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4468         and <paramlink id="klass"/> provided as parameters to this function
4469         do not control which objects are visited but they do control which
4470         objects and primitive values are reported by the callbacks.
4471         For example, if the only callback that was set is
4472         <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4473         is set to the array of bytes class, then only arrays of byte will be
4474         reported.
4475         The table below summarizes this:
4476         <p/>
4477         <table>
4478           <tr>
4479             <th/>
4480             <th>
4481               Controls objects visited
4482             </th>
4483             <th>
4484               Controls objects reported
4485             </th>
4486             <th>
4487               Controls primitives reported
4488             </th>
4489           </tr>
4490           <tr>
4491             <th class="leftAligned">
4492               the
4493               <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4494               returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4495             </th>
4496             <td class="centered">
4497               <b>Yes</b>
4498             </td>
4499             <td class="centered">
4500               <b>Yes</b>, since visits are controlled
4501             </td>
4502             <td class="centered">
4503               <b>Yes</b>, since visits are controlled
4504             </td>
4505           </tr>
4506           <tr>
4507             <th class="leftAligned">
4508               <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4509               in <paramlink id="callbacks"/> set
4510             </th>
4511             <td class="centered">
4512               No
4513             </td>
4514             <td class="centered">
4515               <b>Yes</b>
4516             </td>
4517             <td class="centered">
4518               No
4519             </td>
4520           </tr>
4521           <tr>
4522             <th class="leftAligned">
4523               <paramlink id="heap_filter"/>
4524             </th>
4525             <td class="centered">
4526               No
4527             </td>
4528             <td class="centered">
4529               <b>Yes</b>
4530             </td>
4531             <td class="centered">
4532               <b>Yes</b>
4533             </td>
4534           </tr>
4535           <tr>
4536             <th class="leftAligned">
4537               <paramlink id="klass"/>
4538             </th>
4539             <td class="centered">
4540               No
4541             </td>
4542             <td class="centered">
4543               <b>Yes</b>
4544             </td>
4545             <td class="centered">
4546               <b>Yes</b>
4547             </td>
4548           </tr>
4549         </table>
4550         <p/>
4551         During the execution of this function the state of the heap
4552         does not change: no objects are allocated, no objects are
4553         garbage collected, and the state of objects (including
4554         held values) does not change.
4555         As a result, threads executing Java
4556         programming language code, threads attempting to resume the
4557         execution of Java programming language code, and threads
4558         attempting to execute JNI functions are typically stalled.
4559       </description>
4560       <origin>new</origin>
4561       <capabilities>
4562         <required id="can_tag_objects"></required>
4563       </capabilities>
4564       <parameters>
4565         <param id="heap_filter">
4566           <jint/>
4567           <description>
4568             This bit vector of
4569             <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4570             restricts the objects for which the callback function is called.
4571             This applies to both the object and primitive callbacks.
4572           </description>
4573         </param>
4574         <param id="klass">
4575           <ptrtype>
4576             <jclass/>
4577             <nullok>callbacks are not limited to instances of a particular
4578                     class</nullok>
4579           </ptrtype>
4580           <description>
4581             Callbacks are only reported when the object is an instance of
4582             this class.
4583             Objects which are instances of a subclass of <code>klass</code>
4584             are not reported.
4585             If <code>klass</code> is an interface, no objects are reported.
4586             This applies to both the object and primitive callbacks.
4587           </description>
4588         </param>
4589         <param id="initial_object">
4590           <ptrtype>
4591             <jobject/>
4592             <nullok>references are followed from the heap roots</nullok>
4593           </ptrtype>
4594           <description>
4595             The object to follow
4596           </description>
4597         </param>
4598         <param id="callbacks">
4599           <inptr>
4600             <struct>jvmtiHeapCallbacks</struct>
4601           </inptr>
4602           <description>
4603             Structure defining the set of callback functions.
4604           </description>
4605         </param>
4606         <param id="user_data">
4607           <inbuf>
4608             <void/>
4609             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4610           </inbuf>
4611           <description>
4612             User supplied data to be passed to the callback.
4613           </description>
4614         </param>
4615       </parameters>
4616       <errors>
4617         <error id="JVMTI_ERROR_INVALID_CLASS">
4618           <paramlink id="klass"/> is not a valid class.
4619         </error>
4620         <error id="JVMTI_ERROR_INVALID_OBJECT">
4621           <paramlink id="initial_object"/> is not a valid object.
4622         </error>
4623       </errors>
4624     </function>
4625 
4626 
4627     <function id="IterateThroughHeap" num="116" since="1.1">
4628       <synopsis>Iterate Through Heap</synopsis>
4629       <description>
4630         Initiate an iteration over all objects in the heap.
4631         This includes both reachable and
4632         unreachable objects. Objects are visited in no particular order.
4633         <p/>
4634         Heap objects are reported by invoking the agent supplied
4635         callback function <functionlink id="jvmtiHeapIterationCallback"/>.
4636         References between objects are not reported.
4637         If only reachable objects are desired, or if object reference information
4638         is needed, use <functionlink id="FollowReferences"/>.
4639         <p/>
4640         This function can also be used to examine primitive (non-object) values.
4641         The primitive value of an array or String
4642         is reported after the object has been visited;
4643         it is reported by invoking the agent supplied callback function
4644         <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4645         <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4646         A primitive field
4647         is reported after the object with that field is visited;
4648         it is reported by invoking the agent supplied
4649         callback function
4650         <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4651         <p/>
4652         Unless the iteration is aborted by the
4653         <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4654         returned by a callback, all objects in the heap are visited.
4655         Whether a callback is provided or is <code>NULL</code> only determines
4656         whether the callback will be invoked, it does not influence
4657         which objects are visited nor does it influence whether other callbacks
4658         will be invoked.
4659         The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4660         and <paramlink id="klass"/> provided as parameters to this function
4661         do not control which objects are visited but they do control which
4662         objects and primitive values are reported by the callbacks.
4663         For example, if the only callback that was set is
4664         <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4665         is set to the array of bytes class, then only arrays of byte will be
4666         reported. The table below summarizes this (contrast this with
4667         <functionlink id="FollowReferences"/>):
4668         <p/>
4669         <table>
4670           <tr>
4671             <th/>
4672             <th>
4673               Controls objects visited
4674             </th>
4675             <th>
4676               Controls objects reported
4677             </th>
4678             <th>
4679               Controls primitives reported
4680             </th>
4681           </tr>
4682           <tr>
4683             <th class="leftAligned">
4684               the
4685               <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4686               returned by <functionlink id="jvmtiHeapIterationCallback"/>
4687             </th>
4688             <td class="centered">
4689               No<br/>(unless they abort the iteration)
4690             </td>
4691             <td class="centered">
4692               No<br/>(unless they abort the iteration)
4693             </td>
4694             <td class="centered">
4695               No<br/>(unless they abort the iteration)
4696             </td>
4697           </tr>
4698           <tr>
4699             <th class="leftAligned">
4700               <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4701               in <paramlink id="callbacks"/> set
4702             </th>
4703             <td class="centered">
4704               No
4705             </td>
4706             <td class="centered">
4707               <b>Yes</b>
4708             </td>
4709             <td class="centered">
4710               No
4711             </td>
4712           </tr>
4713           <tr>
4714             <th class="leftAligned">
4715               <paramlink id="heap_filter"/>
4716             </th>
4717             <td class="centered">
4718               No
4719             </td>
4720             <td class="centered">
4721               <b>Yes</b>
4722             </td>
4723             <td class="centered">
4724               <b>Yes</b>
4725             </td>
4726           </tr>
4727           <tr>
4728             <th class="leftAligned">
4729               <paramlink id="klass"/>
4730             </th>
4731             <td class="centered">
4732               No
4733             </td>
4734             <td class="centered">
4735               <b>Yes</b>
4736             </td>
4737             <td class="centered">
4738               <b>Yes</b>
4739             </td>
4740           </tr>
4741         </table>
4742         <p/>
4743         During the execution of this function the state of the heap
4744         does not change: no objects are allocated, no objects are
4745         garbage collected, and the state of objects (including
4746         held values) does not change.
4747         As a result, threads executing Java
4748         programming language code, threads attempting to resume the
4749         execution of Java programming language code, and threads
4750         attempting to execute JNI functions are typically stalled.
4751       </description>
4752       <origin>new</origin>
4753       <capabilities>
4754         <required id="can_tag_objects"></required>
4755       </capabilities>
4756       <parameters>
4757         <param id="heap_filter">
4758           <jint/>
4759           <description>
4760             This bit vector of
4761             <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4762             restricts the objects for which the callback function is called.
4763             This applies to both the object and primitive callbacks.
4764           </description>
4765         </param>
4766         <param id="klass">
4767           <ptrtype>
4768             <jclass/>
4769             <nullok>callbacks are not limited to instances of a particular class</nullok>
4770           </ptrtype>
4771           <description>
4772             Callbacks are only reported when the object is an instance of
4773             this class.
4774             Objects which are instances of a subclass of <code>klass</code>
4775             are not reported.
4776             If <code>klass</code> is an interface, no objects are reported.
4777             This applies to both the object and primitive callbacks.
4778           </description>
4779         </param>
4780         <param id="callbacks">
4781           <inptr>
4782             <struct>jvmtiHeapCallbacks</struct>
4783           </inptr>
4784           <description>
4785             Structure defining the set callback functions.
4786           </description>
4787         </param>
4788         <param id="user_data">
4789           <inbuf>
4790             <void/>
4791             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4792           </inbuf>
4793           <description>
4794             User supplied data to be passed to the callback.
4795           </description>
4796         </param>
4797       </parameters>
4798       <errors>
4799         <error id="JVMTI_ERROR_INVALID_CLASS">
4800           <paramlink id="klass"/> is not a valid class.
4801         </error>
4802       </errors>
4803     </function>
4804 
4805     <function id="GetTag" phase="start" num="106">
4806       <synopsis>Get Tag</synopsis>
4807       <description>
4808         Retrieve the tag associated with an object.
4809         The tag is a long value typically used to store a
4810         unique identifier or pointer to object information.
4811         The tag is set with
4812         <functionlink id="SetTag"></functionlink>.
4813         Objects for which no tags have been set return a
4814         tag value of zero.
4815       </description>
4816       <origin>new</origin>
4817       <capabilities>
4818         <required id="can_tag_objects"></required>
4819       </capabilities>
4820       <parameters>
4821         <param id="object">
4822           <jobject/>
4823             <description>
4824               The object whose tag is to be retrieved.
4825             </description>
4826         </param>
4827         <param id="tag_ptr">
4828           <outptr><jlong/></outptr>
4829           <description>
4830             On return, the referenced long is set to the value
4831             of the tag.
4832           </description>
4833         </param>
4834       </parameters>
4835       <errors>
4836       </errors>
4837     </function>
4838 
4839     <function id="SetTag" phase="start" num="107">
4840       <synopsis>Set Tag</synopsis>
4841       <description>
4842         Set the tag associated with an object.
4843         The tag is a long value typically used to store a
4844         unique identifier or pointer to object information.
4845         The tag is visible with
4846         <functionlink id="GetTag"></functionlink>.
4847       </description>
4848       <origin>new</origin>
4849       <capabilities>
4850         <required id="can_tag_objects"></required>
4851       </capabilities>
4852       <parameters>
4853         <param id="object">
4854           <jobject/>
4855             <description>
4856               The object whose tag is to be set.
4857             </description>
4858         </param>
4859         <param id="tag">
4860           <jlong/>
4861           <description>
4862             The new value of the tag.
4863           </description>
4864         </param>
4865       </parameters>
4866       <errors>
4867       </errors>
4868     </function>
4869 
4870     <function id="GetObjectsWithTags" num="114">
4871       <synopsis>Get Objects With Tags</synopsis>
4872       <description>
4873         Return objects in the heap with the specified tags.
4874         The format is parallel arrays of objects and tags.
4875       </description>
4876       <origin>new</origin>
4877       <capabilities>
4878         <required id="can_tag_objects"></required>
4879       </capabilities>
4880       <parameters>
4881         <param id="tag_count">
4882           <jint min="0"/>
4883             <description>
4884               Number of tags to scan for.
4885             </description>
4886         </param>
4887         <param id="tags">
4888           <inbuf incount="tag_count">
4889             <jlong/>
4890           </inbuf>
4891             <description>
4892               Scan for objects with these tags.
4893               Zero is not permitted in this array.
4894             </description>
4895         </param>
4896         <param id="count_ptr">
4897           <outptr>
4898             <jint/>
4899           </outptr>
4900             <description>
4901               Return the number of objects with any of the tags
4902               in <paramlink id="tags"/>.
4903             </description>
4904         </param>
4905         <param id="object_result_ptr">
4906           <allocbuf outcount="count_ptr">
4907             <jobject/>
4908             <nullok>this information is not returned</nullok>
4909           </allocbuf>
4910             <description>
4911               Returns the array of objects with any of the tags
4912               in <paramlink id="tags"/>.
4913             </description>
4914         </param>
4915         <param id="tag_result_ptr">
4916           <allocbuf outcount="count_ptr">
4917             <jlong/>
4918             <nullok>this information is not returned</nullok>
4919           </allocbuf>
4920             <description>
4921               For each object in <paramlink id="object_result_ptr"/>,
4922               return the tag at the corresponding index.
4923             </description>
4924         </param>
4925       </parameters>
4926       <errors>
4927         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
4928           Zero is present in <paramlink id="tags"></paramlink>.
4929         </error>
4930       </errors>
4931     </function>
4932 
4933     <function id="ForceGarbageCollection" num="108">
4934       <synopsis>Force Garbage Collection</synopsis>
4935       <description>
4936         Force the VM to perform a garbage collection.
4937         The garbage collection is as complete as possible.
4938         This function does not cause finalizers to be run.
4939         This function does not return until the garbage collection
4940         is finished.
4941         <p/>
4942         Although garbage collection is as complete
4943         as possible there is no guarantee that all
4944         <eventlink id="ObjectFree"/>
4945         events will have been
4946         sent by the time that this function
4947         returns. In particular, an object may be
4948         prevented from being freed because it
4949         is awaiting finalization.
4950       </description>
4951       <origin>new</origin>
4952       <capabilities>
4953       </capabilities>
4954       <parameters>
4955       </parameters>
4956       <errors>
4957       </errors>
4958     </function>
4959 
4960 
4961   </category>
4962 
4963   <category id="Heap_1_0" label="Heap (1.0)">
4964     <intro>
4965       <b>
4966         These functions and data types were introduced in the original
4967         <jvmti/> version 1.0 and have been superseded by more
4968       </b>
4969       <internallink id="Heap"><b>powerful and flexible versions</b></internallink>
4970       <b>
4971         which:
4972       </b>
4973       <ul>
4974         <li>
4975           <b>
4976             Allow access to primitive values (the value of Strings, arrays,
4977             and primitive fields)
4978           </b>
4979         </li>
4980         <li>
4981           <b>
4982             Allow the tag of the referrer to be set, thus enabling more
4983             efficient localized reference graph building
4984           </b>
4985         </li>
4986         <li>
4987           <b>
4988             Provide more extensive filtering abilities
4989           </b>
4990         </li>
4991         <li>
4992           <b>
4993             Are extensible, allowing their abilities to grow in future versions of <jvmti/>
4994           </b>
4995         </li>
4996       </ul>
4997       <p/>
4998       <b>Please use the </b>
4999       <internallink id="Heap"><b>current Heap functions</b></internallink>.
5000         <p/>
5001         <constants id="jvmtiHeapObjectFilter" label="Heap Object Filter Enumeration" kind="enum">
5002           <constant id="JVMTI_HEAP_OBJECT_TAGGED" num="1">
5003             Tagged objects only.
5004           </constant>
5005           <constant id="JVMTI_HEAP_OBJECT_UNTAGGED" num="2">
5006             Untagged objects only.
5007           </constant>
5008           <constant id="JVMTI_HEAP_OBJECT_EITHER" num="3">
5009             Either tagged or untagged objects.
5010           </constant>
5011         </constants>
5012 
5013         <constants id="jvmtiHeapRootKind" label="Heap Root Kind Enumeration" kind="enum">
5014           <constant id="JVMTI_HEAP_ROOT_JNI_GLOBAL" num="1">
5015             JNI global reference.
5016           </constant>
5017           <constant id="JVMTI_HEAP_ROOT_SYSTEM_CLASS" num="2">
5018             System class.
5019           </constant>
5020           <constant id="JVMTI_HEAP_ROOT_MONITOR" num="3">
5021             Monitor.
5022           </constant>
5023           <constant id="JVMTI_HEAP_ROOT_STACK_LOCAL" num="4">
5024             Stack local.
5025           </constant>
5026           <constant id="JVMTI_HEAP_ROOT_JNI_LOCAL" num="5">
5027             JNI local reference.
5028           </constant>
5029           <constant id="JVMTI_HEAP_ROOT_THREAD" num="6">
5030             Thread.
5031           </constant>
5032           <constant id="JVMTI_HEAP_ROOT_OTHER" num="7">
5033             Other.
5034           </constant>
5035         </constants>
5036 
5037         <constants id="jvmtiObjectReferenceKind" label="Object Reference Enumeration" kind="enum">
5038           <constant id="JVMTI_REFERENCE_CLASS" num="1">
5039             Reference from an object to its class.
5040           </constant>
5041           <constant id="JVMTI_REFERENCE_FIELD" num="2">
5042             Reference from an object to the value of one of its instance fields.
5043             For references of this kind the <code>referrer_index</code>
5044             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5045             jvmtiObjectReferenceCallback</internallink> is the index of the
5046             the instance field. The index is based on the order of all the
5047             object's fields. This includes all fields of the directly declared
5048             static and instance fields in the class, and includes all fields (both
5049             public and private) fields declared in superclasses and superinterfaces.
5050             The index is thus calculated by summing the index of the field in the directly
5051             declared class (see <functionlink id="GetClassFields"/>), with the total
5052             number of fields (both public and private) declared in all superclasses
5053             and superinterfaces. The index starts at zero.
5054           </constant>
5055           <constant id="JVMTI_REFERENCE_ARRAY_ELEMENT" num="3">
5056             Reference from an array to one of its elements.
5057             For references of this kind the <code>referrer_index</code>
5058             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5059             jvmtiObjectReferenceCallback</internallink> is the array index.
5060           </constant>
5061           <constant id="JVMTI_REFERENCE_CLASS_LOADER" num="4">
5062             Reference from a class to its class loader.
5063           </constant>
5064           <constant id="JVMTI_REFERENCE_SIGNERS" num="5">
5065             Reference from a class to its signers array.
5066           </constant>
5067           <constant id="JVMTI_REFERENCE_PROTECTION_DOMAIN" num="6">
5068             Reference from a class to its protection domain.
5069           </constant>
5070           <constant id="JVMTI_REFERENCE_INTERFACE" num="7">
5071             Reference from a class to one of its interfaces.
5072           </constant>
5073           <constant id="JVMTI_REFERENCE_STATIC_FIELD" num="8">
5074             Reference from a class to the value of one of its static fields.
5075             For references of this kind the <code>referrer_index</code>
5076             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5077             jvmtiObjectReferenceCallback</internallink> is the index of the
5078             the static field. The index is based on the order of all the
5079             object's fields. This includes all fields of the directly declared
5080             static and instance fields in the class, and includes all fields (both
5081             public and private) fields declared in superclasses and superinterfaces.
5082             The index is thus calculated by summing the index of the field in the directly
5083             declared class (see <functionlink id="GetClassFields"/>), with the total
5084             number of fields (both public and private) declared in all superclasses
5085             and superinterfaces. The index starts at zero.
5086             Note: this definition differs from that in the <jvmti/> 1.0 Specification.
5087             <rationale>No known implementations used the 1.0 definition.</rationale>
5088           </constant>
5089           <constant id="JVMTI_REFERENCE_CONSTANT_POOL" num="9">
5090             Reference from a class to a resolved entry in the constant pool.
5091             For references of this kind the <code>referrer_index</code>
5092             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5093             jvmtiObjectReferenceCallback</internallink> is the index into
5094             constant pool table of the class, starting at 1. See
5095             <vmspec chapter="4.4"/>.
5096           </constant>
5097         </constants>
5098 
5099         <constants id="jvmtiIterationControl" label="Iteration Control Enumeration" kind="enum">
5100           <constant id="JVMTI_ITERATION_CONTINUE" num="1">
5101             Continue the iteration.
5102             If this is a reference iteration, follow the references of this object.
5103           </constant>
5104           <constant id="JVMTI_ITERATION_IGNORE" num="2">
5105             Continue the iteration.
5106             If this is a reference iteration, ignore the references of this object.
5107           </constant>
5108           <constant id="JVMTI_ITERATION_ABORT" num="0">
5109             Abort the iteration.
5110           </constant>
5111         </constants>
5112     </intro>
5113 
5114     <callback id="jvmtiHeapObjectCallback">
5115       <enum>jvmtiIterationControl</enum>
5116       <synopsis>Heap Object Callback</synopsis>
5117       <description>
5118         Agent supplied callback function.
5119         Describes (but does not pass in) an object in the heap.
5120         <p/>
5121         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5122         or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5123         <p/>
5124         See the <internallink id="heapCallbacks">heap callback
5125         function restrictions</internallink>.
5126       </description>
5127       <parameters>
5128         <param id="class_tag">
5129           <jlong/>
5130           <description>
5131             The tag of the class of object (zero if the class is not tagged).
5132             If the object represents a runtime class,
5133             the <code>class_tag</code> is the tag
5134             associated with <code>java.lang.Class</code>
5135             (zero if <code>java.lang.Class</code> is not tagged).
5136           </description>
5137         </param>
5138         <param id="size">
5139           <jlong/>
5140           <description>
5141             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5142           </description>
5143         </param>
5144         <param id="tag_ptr">
5145           <outptr><jlong/></outptr>
5146           <description>
5147             The object tag value, or zero if the object is not tagged.
5148             To set the tag value to be associated with the object
5149             the agent sets the <code>jlong</code> pointed to by the parameter.
5150           </description>
5151         </param>
5152         <param id="user_data">
5153           <outptr><void/></outptr>
5154           <description>
5155             The user supplied data that was passed into the iteration function.
5156           </description>
5157         </param>
5158       </parameters>
5159     </callback>
5160 
5161     <callback id="jvmtiHeapRootCallback">
5162       <enum>jvmtiIterationControl</enum>
5163       <synopsis>Heap Root Object Callback</synopsis>
5164       <description>
5165         Agent supplied callback function.
5166         Describes (but does not pass in) an object that is a root for the purposes
5167         of garbage collection.
5168         <p/>
5169         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5170         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5171         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5172         <p/>
5173         See the <internallink id="heapCallbacks">heap callback
5174         function restrictions</internallink>.
5175       </description>
5176       <parameters>
5177         <param id="root_kind">
5178           <enum>jvmtiHeapRootKind</enum>
5179           <description>
5180             The kind of heap root.
5181           </description>
5182         </param>
5183         <param id="class_tag">
5184           <jlong/>
5185           <description>
5186             The tag of the class of object (zero if the class is not tagged).
5187             If the object represents a runtime class, the <code>class_tag</code> is the tag
5188             associated with <code>java.lang.Class</code>
5189             (zero if <code>java.lang.Class</code> is not tagged).
5190           </description>
5191         </param>
5192         <param id="size">
5193           <jlong/>
5194           <description>
5195             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5196           </description>
5197         </param>
5198         <param id="tag_ptr">
5199           <outptr><jlong/></outptr>
5200           <description>
5201             The object tag value, or zero if the object is not tagged.
5202             To set the tag value to be associated with the object
5203             the agent sets the <code>jlong</code> pointed to by the parameter.
5204           </description>
5205         </param>
5206         <param id="user_data">
5207           <outptr><void/></outptr>
5208           <description>
5209             The user supplied data that was passed into the iteration function.
5210           </description>
5211         </param>
5212       </parameters>
5213     </callback>
5214 
5215     <callback id="jvmtiStackReferenceCallback">
5216       <enum>jvmtiIterationControl</enum>
5217       <synopsis>Stack Reference Object Callback</synopsis>
5218       <description>
5219         Agent supplied callback function.
5220         Describes (but does not pass in) an object on the stack that is a root for
5221         the purposes of garbage collection.
5222         <p/>
5223         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5224         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5225         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5226         <p/>
5227         See the <internallink id="heapCallbacks">heap callback
5228         function restrictions</internallink>.
5229       </description>
5230       <parameters>
5231         <param id="root_kind">
5232           <enum>jvmtiHeapRootKind</enum>
5233           <description>
5234             The kind of root (either <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5235             <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>).
5236           </description>
5237         </param>
5238         <param id="class_tag">
5239           <jlong/>
5240           <description>
5241            The tag of the class of object (zero if the class is not tagged).
5242            If the object represents a runtime class, the  <code>class_tag</code> is the tag
5243            associated with <code>java.lang.Class</code>
5244            (zero if <code>java.lang.Class</code> is not tagged).
5245           </description>
5246         </param>
5247         <param id="size">
5248           <jlong/>
5249           <description>
5250             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5251           </description>
5252         </param>
5253         <param id="tag_ptr">
5254           <outptr><jlong/></outptr>
5255           <description>
5256             The object tag value, or zero if the object is not tagged.
5257             To set the tag value to be associated with the object
5258             the agent sets the <code>jlong</code> pointed to by the parameter.
5259           </description>
5260         </param>
5261         <param id="thread_tag">
5262           <jlong/>
5263           <description>
5264             The tag of the thread corresponding to this stack, zero if not tagged.
5265           </description>
5266         </param>
5267         <param id="depth">
5268           <jint/>
5269           <description>
5270             The depth of the frame.
5271           </description>
5272         </param>
5273         <param id="method">
5274           <jmethodID/>
5275           <description>
5276             The method executing in this frame.
5277           </description>
5278         </param>
5279         <param id="slot">
5280           <jint/>
5281           <description>
5282             The slot number.
5283           </description>
5284         </param>
5285         <param id="user_data">
5286           <outptr><void/></outptr>
5287           <description>
5288             The user supplied data that was passed into the iteration function.
5289           </description>
5290         </param>
5291       </parameters>
5292     </callback>
5293 
5294     <callback id="jvmtiObjectReferenceCallback">
5295       <enum>jvmtiIterationControl</enum>
5296       <synopsis>Object Reference Callback</synopsis>
5297       <description>
5298         Agent supplied callback function.
5299         Describes a reference from an object (the referrer) to another object
5300         (the referree).
5301         <p/>
5302         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5303         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5304         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5305         <p/>
5306         See the <internallink id="heapCallbacks">heap callback
5307         function restrictions</internallink>.
5308       </description>
5309       <parameters>
5310         <param id="reference_kind">
5311           <enum>jvmtiObjectReferenceKind</enum>
5312           <description>
5313             The type of reference.
5314           </description>
5315         </param>
5316         <param id="class_tag">
5317           <jlong/>
5318           <description>
5319             The tag of the class of referree object (zero if the class is not tagged).
5320             If the referree object represents a runtime class,
5321             the  <code>class_tag</code> is the tag
5322             associated with <code>java.lang.Class</code>
5323             (zero if <code>java.lang.Class</code> is not tagged).
5324           </description>
5325         </param>
5326         <param id="size">
5327           <jlong/>
5328           <description>
5329             Size of the referree object (in bytes).
5330             See <functionlink id="GetObjectSize"/>.
5331           </description>
5332         </param>
5333         <param id="tag_ptr">
5334           <outptr><jlong/></outptr>
5335           <description>
5336             The referree object tag value, or zero if the object is not
5337             tagged.
5338             To set the tag value to be associated with the object
5339             the agent sets the <code>jlong</code> pointed to by the parameter.
5340           </description>
5341         </param>
5342         <param id="referrer_tag">
5343           <jlong/>
5344           <description>
5345             The tag of the referrer object, or zero if the referrer
5346             object is not tagged.
5347           </description>
5348         </param>
5349         <param id="referrer_index">
5350           <jint/>
5351           <description>
5352             For references of type <code>JVMTI_REFERENCE_FIELD</code> or
5353             <code>JVMTI_REFERENCE_STATIC_FIELD</code> the index
5354             of the field in the referrer object. The index is based on the
5355             order of all the object's fields - see <internallink
5356             id="JVMTI_REFERENCE_FIELD">JVMTI_REFERENCE_FIELD</internallink>
5357             or <internallink
5358             id="JVMTI_REFERENCE_STATIC_FIELD">JVMTI_REFERENCE_STATIC_FIELD
5359             </internallink> for further description.
5360             <p/>
5361             For references of type <code>JVMTI_REFERENCE_ARRAY_ELEMENT</code>
5362             the array index - see <internallink id="JVMTI_REFERENCE_ARRAY_ELEMENT">
5363             JVMTI_REFERENCE_ARRAY_ELEMENT</internallink> for further description.
5364             <p/>
5365             For references of type <code>JVMTI_REFERENCE_CONSTANT_POOL</code>
5366             the index into the constant pool of the class - see
5367             <internallink id="JVMTI_REFERENCE_CONSTANT_POOL">
5368             JVMTI_REFERENCE_CONSTANT_POOL</internallink> for further
5369             description.
5370             <p/>
5371             For references of other kinds the <code>referrer_index</code> is
5372             <code>-1</code>.
5373           </description>
5374         </param>
5375         <param id="user_data">
5376           <outptr><void/></outptr>
5377           <description>
5378             The user supplied data that was passed into the iteration function.
5379           </description>
5380         </param>
5381       </parameters>
5382     </callback>
5383 
5384     <function id="IterateOverObjectsReachableFromObject" num="109">
5385       <synopsis>Iterate Over Objects Reachable From Object</synopsis>
5386       <description>
5387         This function iterates over all objects that are directly
5388         and indirectly reachable from the specified object.
5389         For each object <i>A</i> (known
5390         as the referrer) with a reference to object <i>B</i> the specified
5391         callback function is called to describe the object reference.
5392         The callback is called exactly once for each reference from a referrer;
5393         this is true even if there are reference cycles or multiple paths to
5394         the referrer.
5395         There may be more than one reference between a referrer and a referree,
5396         These may be distinguished by the
5397         <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5398         <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5399         The callback for an object will always occur after the callback for
5400         its referrer.
5401         <p/>
5402         See <functionlink id="FollowReferences"/> for the object
5403         references which are reported.
5404         <p/>
5405         During the execution of this function the state of the heap
5406         does not change: no objects are allocated, no objects are
5407         garbage collected, and the state of objects (including
5408         held values) does not change.
5409         As a result, threads executing Java
5410         programming language code, threads attempting to resume the
5411         execution of Java programming language code, and threads
5412         attempting to execute JNI functions are typically stalled.
5413       </description>
5414       <origin>new</origin>
5415       <capabilities>
5416         <required id="can_tag_objects"></required>
5417       </capabilities>
5418       <parameters>
5419         <param id="object">
5420           <jobject/>
5421             <description>
5422               The object
5423             </description>
5424         </param>
5425         <param id="object_reference_callback">
5426           <ptrtype>
5427             <struct>jvmtiObjectReferenceCallback</struct>
5428           </ptrtype>
5429             <description>
5430               The callback to be called to describe each
5431               object reference.
5432             </description>
5433         </param>
5434         <param id="user_data">
5435           <inbuf>
5436             <void/>
5437             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5438           </inbuf>
5439           <description>
5440             User supplied data to be passed to the callback.
5441           </description>
5442         </param>
5443       </parameters>
5444       <errors>
5445       </errors>
5446     </function>
5447 
5448     <function id="IterateOverReachableObjects" num="110">
5449       <synopsis>Iterate Over Reachable Objects</synopsis>
5450       <description>
5451         This function iterates over the root objects and all objects that
5452         are directly and indirectly reachable from the root objects.
5453         The root objects comprise the set of system classes,
5454         JNI globals, references from thread stacks, and other objects used as roots
5455         for the purposes of garbage collection.
5456         <p/>
5457         For each root the <paramlink id="heap_root_callback"></paramlink>
5458         or <paramlink id="stack_ref_callback"></paramlink> callback is called.
5459         An object can be a root object for more than one reason and in that case
5460         the appropriate callback is called for each reason.
5461         <p/>
5462         For each object reference the <paramlink id="object_ref_callback"></paramlink>
5463         callback function is called to describe the object reference.
5464         The callback is called exactly once for each reference from a referrer;
5465         this is true even if there are reference cycles or multiple paths to
5466         the referrer.
5467         There may be more than one reference between a referrer and a referree,
5468         These may be distinguished by the
5469         <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5470         <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5471         The callback for an object will always occur after the callback for
5472         its referrer.
5473         <p/>
5474         See <functionlink id="FollowReferences"/> for the object
5475         references which are reported.
5476         <p/>
5477         Roots are always reported to the profiler before any object references
5478         are reported. In other words, the <paramlink id="object_ref_callback"></paramlink>
5479         callback will not be called until the appropriate callback has been called
5480         for all roots. If the <paramlink id="object_ref_callback"></paramlink> callback is
5481         specified as <code>NULL</code> then this function returns after
5482         reporting the root objects to the profiler.
5483         <p/>
5484         During the execution of this function the state of the heap
5485         does not change: no objects are allocated, no objects are
5486         garbage collected, and the state of objects (including
5487         held values) does not change.
5488         As a result, threads executing Java
5489         programming language code, threads attempting to resume the
5490         execution of Java programming language code, and threads
5491         attempting to execute JNI functions are typically stalled.
5492       </description>
5493       <origin>new</origin>
5494       <capabilities>
5495         <required id="can_tag_objects"></required>
5496       </capabilities>
5497       <parameters>
5498         <param id="heap_root_callback">
5499           <ptrtype>
5500             <struct>jvmtiHeapRootCallback</struct>
5501             <nullok>do not report heap roots</nullok>
5502           </ptrtype>
5503             <description>
5504               The callback function to be called for each heap root of type
5505               <code>JVMTI_HEAP_ROOT_JNI_GLOBAL</code>,
5506               <code>JVMTI_HEAP_ROOT_SYSTEM_CLASS</code>,
5507               <code>JVMTI_HEAP_ROOT_MONITOR</code>,
5508               <code>JVMTI_HEAP_ROOT_THREAD</code>, or
5509               <code>JVMTI_HEAP_ROOT_OTHER</code>.
5510             </description>
5511         </param>
5512         <param id="stack_ref_callback">
5513           <ptrtype>
5514             <struct>jvmtiStackReferenceCallback</struct>
5515             <nullok>do not report stack references</nullok>
5516           </ptrtype>
5517             <description>
5518               The callback function to be called for each heap root of
5519               <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5520               <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>.
5521             </description>
5522         </param>
5523         <param id="object_ref_callback">
5524           <ptrtype>
5525             <struct>jvmtiObjectReferenceCallback</struct>
5526             <nullok>do not follow references from the root objects</nullok>
5527           </ptrtype>
5528             <description>
5529               The callback function to be called for each object reference.
5530             </description>
5531         </param>
5532         <param id="user_data">
5533           <inbuf>
5534             <void/>
5535             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5536           </inbuf>
5537           <description>
5538             User supplied data to be passed to the callback.
5539           </description>
5540         </param>
5541       </parameters>
5542       <errors>
5543       </errors>
5544     </function>
5545 
5546     <function id="IterateOverHeap" num="111">
5547       <synopsis>Iterate Over Heap</synopsis>
5548       <description>
5549         Iterate over all objects in the heap. This includes both reachable and
5550         unreachable objects.
5551         <p/>
5552         The <paramlink id="object_filter"></paramlink> parameter indicates the
5553         objects for which the callback function is called. If this parameter
5554         is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be
5555         called for every object that is tagged. If the parameter is
5556         <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5557         for objects that are not tagged. If the parameter
5558         is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5559         called for every object in the heap, irrespective of whether it is
5560         tagged or not.
5561         <p/>
5562         During the execution of this function the state of the heap
5563         does not change: no objects are allocated, no objects are
5564         garbage collected, and the state of objects (including
5565         held values) does not change.
5566         As a result, threads executing Java
5567         programming language code, threads attempting to resume the
5568         execution of Java programming language code, and threads
5569         attempting to execute JNI functions are typically stalled.
5570       </description>
5571       <origin>new</origin>
5572       <capabilities>
5573         <required id="can_tag_objects"></required>
5574       </capabilities>
5575       <parameters>
5576         <param id="object_filter">
5577           <enum>jvmtiHeapObjectFilter</enum>
5578           <description>
5579             Indicates the objects for which the callback function is called.
5580           </description>
5581         </param>
5582         <param id="heap_object_callback">
5583           <ptrtype>
5584             <struct>jvmtiHeapObjectCallback</struct>
5585           </ptrtype>
5586             <description>
5587               The iterator function to be called for each
5588               object matching the <paramlink id="object_filter"/>.
5589             </description>
5590         </param>
5591         <param id="user_data">
5592           <inbuf>
5593             <void/>
5594             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5595           </inbuf>
5596           <description>
5597             User supplied data to be passed to the callback.
5598           </description>
5599         </param>
5600       </parameters>
5601       <errors>
5602       </errors>
5603     </function>
5604 
5605     <function id="IterateOverInstancesOfClass" num="112">
5606       <synopsis>Iterate Over Instances Of Class</synopsis>
5607       <description>
5608         Iterate over all objects in the heap that are instances of the specified class.
5609         This includes direct instances of the specified class and
5610         instances of all subclasses of the specified class.
5611         This includes both reachable and unreachable objects.
5612         <p/>
5613         The <paramlink id="object_filter"></paramlink> parameter indicates the
5614         objects for which the callback function is called. If this parameter
5615         is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be
5616         called for every object that is tagged. If the parameter is
5617         <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5618         called for objects that are not tagged. If the parameter
5619         is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5620         called for every object in the heap, irrespective of whether it is
5621         tagged or not.
5622         <p/>
5623         During the execution of this function the state of the heap
5624         does not change: no objects are allocated, no objects are
5625         garbage collected, and the state of objects (including
5626         held values) does not change.
5627         As a result, threads executing Java
5628         programming language code, threads attempting to resume the
5629         execution of Java programming language code, and threads
5630         attempting to execute JNI functions are typically stalled.
5631       </description>
5632       <origin>new</origin>
5633       <capabilities>
5634         <required id="can_tag_objects"></required>
5635       </capabilities>
5636       <parameters>
5637         <param id="klass">
5638           <jclass/>
5639             <description>
5640               Iterate over objects of this class only.
5641             </description>
5642         </param>
5643         <param id="object_filter">
5644           <enum>jvmtiHeapObjectFilter</enum>
5645           <description>
5646             Indicates the objects for which the callback function is called.
5647           </description>
5648         </param>
5649         <param id="heap_object_callback">
5650           <ptrtype>
5651             <struct>jvmtiHeapObjectCallback</struct>
5652           </ptrtype>
5653             <description>
5654               The iterator function to be called for each
5655               <paramlink id="klass"/> instance matching
5656               the <paramlink id="object_filter"/>.
5657             </description>
5658         </param>
5659         <param id="user_data">
5660           <inbuf>
5661             <void/>
5662             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5663           </inbuf>
5664           <description>
5665             User supplied data to be passed to the callback.
5666           </description>
5667         </param>
5668       </parameters>
5669       <errors>
5670       </errors>
5671     </function>
5672 
5673   </category>
5674 
5675   <category id="local" label="Local Variable">
5676 
5677     <intro>
5678       These functions are used to retrieve or set the value of a local variable.
5679       The variable is identified by the depth of the frame containing its
5680       value and the variable's slot number within that frame.
5681       The mapping of variables to
5682       slot numbers can be obtained with the function
5683       <functionlink id="GetLocalVariableTable"></functionlink>.
5684     </intro>
5685 
5686     <function id="GetLocalObject" num="21">
5687       <synopsis>Get Local Variable - Object</synopsis>
5688       <description>
5689         This function can be used to retrieve the value of a local
5690         variable whose type is <code>Object</code> or a subclass of <code>Object</code>.
5691       </description>
5692       <origin>jvmdi</origin>
5693       <capabilities>
5694         <required id="can_access_local_variables"></required>
5695       </capabilities>
5696       <parameters>
5697         <param id="thread">
5698           <jthread null="current" frame="frame"/>
5699           <description>
5700             The thread of the frame containing the variable's value.
5701           </description>
5702         </param>
5703         <param id="depth">
5704           <jframeID thread="thread"/>
5705           <description>
5706             The depth of the frame containing the variable's value.
5707           </description>
5708         </param>
5709         <param id="slot">
5710           <jint/>
5711           <description>
5712             The variable's slot number.
5713           </description>
5714         </param>
5715         <param id="value_ptr">
5716           <outptr><jobject/></outptr>
5717             <description>
5718               On return, points to the variable's value.
5719             </description>
5720         </param>
5721       </parameters>
5722       <errors>
5723         <error id="JVMTI_ERROR_INVALID_SLOT">
5724           Invalid <code>slot</code>.
5725         </error>
5726         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5727           The variable type is not
5728           <code>Object</code> or a subclass of <code>Object</code>.
5729         </error>
5730         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5731           Not a visible frame
5732         </error>
5733       </errors>
5734     </function>
5735 
5736     <function id="GetLocalInstance" num="155" since="1.2">
5737       <synopsis>Get Local Instance</synopsis>
5738       <description>
5739         This function can be used to retrieve the value of the local object
5740         variable at slot 0 (the "<code>this</code>" object) from non-static
5741         frames.  This function can retrieve the "<code>this</code>" object from
5742         native method frames, whereas <code>GetLocalObject()</code> would
5743         return <code>JVMTI_ERROR_OPAQUE_FRAME</code> in those cases.
5744       </description>
5745       <origin>new</origin>
5746       <capabilities>
5747         <required id="can_access_local_variables"></required>
5748       </capabilities>
5749       <parameters>
5750         <param id="thread">
5751           <jthread null="current" frame="frame"/>
5752           <description>
5753             The thread of the frame containing the variable's value.
5754           </description>
5755         </param>
5756         <param id="depth">
5757           <jframeID thread="thread"/>
5758           <description>
5759             The depth of the frame containing the variable's value.
5760           </description>
5761         </param>
5762         <param id="value_ptr">
5763           <outptr><jobject/></outptr>
5764             <description>
5765               On return, points to the variable's value.
5766             </description>
5767         </param>
5768       </parameters>
5769       <errors>
5770         <error id="JVMTI_ERROR_INVALID_SLOT">
5771           If the specified frame is a static method frame.
5772         </error>
5773       </errors>
5774     </function>
5775     <function id="GetLocalInt" num="22">
5776       <synopsis>Get Local Variable - Int</synopsis>
5777       <description>
5778         This function can be used to retrieve the value of a local
5779         variable whose type is <code>int</code>,
5780         <code>short</code>, <code>char</code>, <code>byte</code>, or
5781         <code>boolean</code>.
5782       </description>
5783       <origin>jvmdi</origin>
5784       <capabilities>
5785         <required id="can_access_local_variables"></required>
5786       </capabilities>
5787       <parameters>
5788         <param id="thread">
5789           <jthread null="current" frame="frame"/>
5790           <description>
5791             The thread of the frame containing the variable's value.
5792           </description>
5793         </param>
5794         <param id="depth">
5795           <jframeID thread="thread"/>
5796           <description>
5797             The depth of the frame containing the variable's value.
5798           </description>
5799         </param>
5800         <param id="slot">
5801           <jint/>
5802           <description>
5803             The variable's slot number.
5804           </description>
5805         </param>
5806         <param id="value_ptr">
5807           <outptr><jint/></outptr>
5808           <description>
5809             On return, points to the variable's value.
5810           </description>
5811         </param>
5812       </parameters>
5813       <errors>
5814         <error id="JVMTI_ERROR_INVALID_SLOT">
5815           Invalid <code>slot</code>.
5816         </error>
5817         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5818           The variable type is not
5819           <code>int</code>, <code>short</code>,
5820           <code>char</code>, <code>byte</code>, or
5821           <code>boolean</code>.
5822         </error>
5823         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5824           Not a visible frame
5825         </error>
5826       </errors>
5827     </function>
5828 
5829     <function id="GetLocalLong" num="23">
5830       <synopsis>Get Local Variable - Long</synopsis>
5831       <description>
5832         This function can be used to retrieve the value of a local
5833         variable whose type is <code>long</code>.
5834       </description>
5835       <origin>jvmdi</origin>
5836       <capabilities>
5837         <required id="can_access_local_variables"></required>
5838       </capabilities>
5839       <parameters>
5840         <param id="thread">
5841           <jthread null="current" frame="frame"/>
5842           <description>
5843             The thread of the frame containing the variable's value.
5844           </description>
5845         </param>
5846         <param id="depth">
5847           <jframeID thread="thread"/>
5848           <description>
5849             The depth of the frame containing the variable's value.
5850           </description>
5851         </param>
5852         <param id="slot">
5853           <jint/>
5854           <description>
5855             The variable's slot number.
5856           </description>
5857         </param>
5858         <param id="value_ptr">
5859           <outptr><jlong/></outptr>
5860           <description>
5861             On return, points to the variable's value.
5862           </description>
5863         </param>
5864       </parameters>
5865       <errors>
5866         <error id="JVMTI_ERROR_INVALID_SLOT">
5867           Invalid <code>slot</code>.
5868         </error>
5869         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5870           The variable type is not <code>long</code>.
5871         </error>
5872         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5873           Not a visible frame
5874         </error>
5875       </errors>
5876     </function>
5877 
5878     <function id="GetLocalFloat" num="24">
5879       <synopsis>Get Local Variable - Float</synopsis>
5880       <description>
5881         This function can be used to retrieve the value of a local
5882         variable whose type is <code>float</code>.
5883       </description>
5884       <origin>jvmdi</origin>
5885       <capabilities>
5886         <required id="can_access_local_variables"></required>
5887       </capabilities>
5888       <parameters>
5889         <param id="thread">
5890           <jthread null="current" frame="frame"/>
5891           <description>
5892             The thread of the frame containing the variable's value.
5893           </description>
5894         </param>
5895         <param id="depth">
5896           <jframeID thread="thread"/>
5897           <description>
5898             The depth of the frame containing the variable's value.
5899           </description>
5900         </param>
5901         <param id="slot">
5902           <jint/>
5903           <description>
5904             The variable's slot number.
5905           </description>
5906         </param>
5907         <param id="value_ptr">
5908           <outptr><jfloat/></outptr>
5909           <description>
5910             On return, points to the variable's value.
5911           </description>
5912         </param>
5913       </parameters>
5914       <errors>
5915         <error id="JVMTI_ERROR_INVALID_SLOT">
5916           Invalid <code>slot</code>.
5917         </error>
5918         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5919           The variable type is not <code>float</code>.
5920         </error>
5921         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5922           Not a visible frame
5923         </error>
5924       </errors>
5925     </function>
5926 
5927     <function id="GetLocalDouble" num="25">
5928       <synopsis>Get Local Variable - Double</synopsis>
5929       <description>
5930         This function can be used to retrieve the value of a local
5931         variable whose type is <code>long</code>.
5932       </description>
5933       <origin>jvmdi</origin>
5934       <capabilities>
5935         <required id="can_access_local_variables"></required>
5936       </capabilities>
5937       <parameters>
5938         <param id="thread">
5939           <jthread null="current" frame="frame"/>
5940           <description>
5941             The thread of the frame containing the variable's value.
5942           </description>
5943         </param>
5944         <param id="depth">
5945           <jframeID thread="thread"/>
5946           <description>
5947             The depth of the frame containing the variable's value.
5948           </description>
5949         </param>
5950         <param id="slot">
5951           <jint/>
5952           <description>
5953             The variable's slot number.
5954           </description>
5955         </param>
5956         <param id="value_ptr">
5957           <outptr><jdouble/></outptr>
5958           <description>
5959             On return, points to the variable's value.
5960           </description>
5961         </param>
5962       </parameters>
5963       <errors>
5964         <error id="JVMTI_ERROR_INVALID_SLOT">
5965           Invalid <code>slot</code>.
5966         </error>
5967         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5968           The variable type is not <code>double</code>.
5969         </error>
5970         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5971           Not a visible frame
5972         </error>
5973       </errors>
5974     </function>
5975 
5976     <function id="SetLocalObject" num="26">
5977       <synopsis>Set Local Variable - Object</synopsis>
5978       <description>
5979         This function can be used to set the value of a local
5980         variable whose type is <code>Object</code> or a subclass of <code>Object</code>.
5981       </description>
5982       <origin>jvmdi</origin>
5983       <capabilities>
5984         <required id="can_access_local_variables"></required>
5985       </capabilities>
5986       <parameters>
5987         <param id="thread">
5988           <jthread null="current" frame="frame"/>
5989           <description>
5990             The thread of the frame containing the variable's value.
5991           </description>
5992         </param>
5993         <param id="depth">
5994           <jframeID thread="thread"/>
5995           <description>
5996             The depth of the frame containing the variable's value.
5997           </description>
5998         </param>
5999         <param id="slot">
6000           <jint/>
6001           <description>
6002             The variable's slot number.
6003           </description>
6004         </param>
6005         <param id="value">
6006           <jobject/>
6007             <description>
6008               The new value for the variable.
6009             </description>
6010         </param>
6011       </parameters>
6012       <errors>
6013         <error id="JVMTI_ERROR_INVALID_SLOT">
6014           Invalid <code>slot</code>.
6015         </error>
6016         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6017           The variable type is not
6018           <code>Object</code> or a subclass of <code>Object</code>.
6019         </error>
6020         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6021           The supplied <paramlink id="value"/> is not compatible
6022           with the variable type.
6023         </error>
6024         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6025           Not a visible frame
6026         </error>
6027       </errors>
6028     </function>
6029 
6030     <function id="SetLocalInt" num="27">
6031       <synopsis>Set Local Variable - Int</synopsis>
6032       <description>
6033         This function can be used to set the value of a local
6034         variable whose type is <code>int</code>,
6035         <code>short</code>, <code>char</code>, <code>byte</code>, or
6036         <code>boolean</code>.
6037       </description>
6038       <origin>jvmdi</origin>
6039       <capabilities>
6040         <required id="can_access_local_variables"></required>
6041       </capabilities>
6042       <parameters>
6043         <param id="thread">
6044           <jthread null="current" frame="frame"/>
6045           <description>
6046             The thread of the frame containing the variable's value.
6047           </description>
6048         </param>
6049         <param id="depth">
6050           <jframeID thread="thread"/>
6051           <description>
6052             The depth of the frame containing the variable's value.
6053           </description>
6054         </param>
6055         <param id="slot">
6056           <jint/>
6057           <description>
6058             The variable's slot number.
6059           </description>
6060         </param>
6061         <param id="value">
6062           <jint/>
6063           <description>
6064             The new value for the variable.
6065           </description>
6066         </param>
6067       </parameters>
6068       <errors>
6069         <error id="JVMTI_ERROR_INVALID_SLOT">
6070           Invalid <code>slot</code>.
6071         </error>
6072         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6073           The variable type is not
6074           <code>int</code>, <code>short</code>,
6075           <code>char</code>, <code>byte</code>, or
6076           <code>boolean</code>.
6077         </error>
6078         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6079           Not a visible frame
6080         </error>
6081       </errors>
6082     </function>
6083 
6084     <function id="SetLocalLong" num="28">
6085       <synopsis>Set Local Variable - Long</synopsis>
6086       <description>
6087         This function can be used to set the value of a local
6088         variable whose type is <code>long</code>.
6089       </description>
6090       <origin>jvmdi</origin>
6091       <capabilities>
6092         <required id="can_access_local_variables"></required>
6093       </capabilities>
6094       <parameters>
6095         <param id="thread">
6096           <jthread null="current" frame="frame"/>
6097           <description>
6098             The thread of the frame containing the variable's value.
6099           </description>
6100         </param>
6101         <param id="depth">
6102           <jframeID thread="thread"/>
6103           <description>
6104             The depth of the frame containing the variable's value.
6105           </description>
6106         </param>
6107         <param id="slot">
6108           <jint/>
6109           <description>
6110             The variable's slot number.
6111           </description>
6112         </param>
6113         <param id="value">
6114           <jlong/>
6115           <description>
6116             The new value for the variable.
6117           </description>
6118         </param>
6119       </parameters>
6120       <errors>
6121         <error id="JVMTI_ERROR_INVALID_SLOT">
6122           Invalid <code>slot</code>.
6123         </error>
6124         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6125           The variable type is not <code>long</code>.
6126         </error>
6127         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6128           Not a visible frame
6129         </error>
6130       </errors>
6131     </function>
6132 
6133     <function id="SetLocalFloat" num="29">
6134       <synopsis>Set Local Variable - Float</synopsis>
6135       <description>
6136         This function can be used to set the value of a local
6137         variable whose type is <code>float</code>.
6138       </description>
6139       <origin>jvmdi</origin>
6140       <capabilities>
6141         <required id="can_access_local_variables"></required>
6142       </capabilities>
6143       <parameters>
6144         <param id="thread">
6145           <jthread null="current" frame="frame"/>
6146           <description>
6147             The thread of the frame containing the variable's value.
6148           </description>
6149         </param>
6150         <param id="depth">
6151           <jframeID thread="thread"/>
6152           <description>
6153             The depth of the frame containing the variable's value.
6154           </description>
6155         </param>
6156         <param id="slot">
6157           <jint/>
6158           <description>
6159             The variable's slot number.
6160           </description>
6161         </param>
6162         <param id="value">
6163           <jfloat/>
6164           <description>
6165             The new value for the variable.
6166           </description>
6167         </param>
6168       </parameters>
6169       <errors>
6170         <error id="JVMTI_ERROR_INVALID_SLOT">
6171           Invalid <code>slot</code>.
6172         </error>
6173         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6174           The variable type is not <code>float</code>.
6175         </error>
6176         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6177           Not a visible frame
6178         </error>
6179       </errors>
6180     </function>
6181 
6182     <function id="SetLocalDouble" num="30">
6183       <synopsis>Set Local Variable - Double</synopsis>
6184       <description>
6185         This function can be used to set the value of a local
6186         variable whose type is <code>double</code>.
6187       </description>
6188       <origin>jvmdi</origin>
6189       <capabilities>
6190         <required id="can_access_local_variables"></required>
6191       </capabilities>
6192       <parameters>
6193         <param id="thread">
6194           <jthread null="current" frame="frame"/>
6195           <description>
6196             The thread of the frame containing the variable's value.
6197           </description>
6198         </param>
6199         <param id="depth">
6200           <jframeID thread="thread"/>
6201           <description>
6202             The depth of the frame containing the variable's value.
6203           </description>
6204         </param>
6205         <param id="slot">
6206           <jint/>
6207           <description>
6208             The variable's slot number.
6209           </description>
6210         </param>
6211         <param id="value">
6212           <jdouble/>
6213           <description>
6214             The new value for the variable.
6215           </description>
6216         </param>
6217       </parameters>
6218       <errors>
6219         <error id="JVMTI_ERROR_INVALID_SLOT">
6220           Invalid <code>slot</code>.
6221         </error>
6222         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6223           The variable type is not <code>double</code>.
6224         </error>
6225         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6226           Not a visible frame
6227         </error>
6228       </errors>
6229     </function>
6230   </category>
6231 
6232   <category id="breakpointCategory" label="Breakpoint">
6233 
6234     <intro>
6235     </intro>
6236 
6237     <function id="SetBreakpoint" num="38">
6238       <synopsis>Set Breakpoint</synopsis>
6239       <description>
6240         Set a breakpoint at the instruction indicated by
6241         <code>method</code> and <code>location</code>.
6242         An instruction can only have one breakpoint.
6243         <p/>
6244         Whenever the designated instruction is about to be executed, a
6245         <eventlink id="Breakpoint"></eventlink> event is generated.
6246       </description>
6247       <origin>jvmdi</origin>
6248       <capabilities>
6249         <required id="can_generate_breakpoint_events"></required>
6250       </capabilities>
6251       <parameters>
6252         <param id="klass">
6253           <jclass method="method"/>
6254             <description>
6255               The class in which to set the breakpoint
6256             </description>
6257         </param>
6258         <param id="method">
6259           <jmethodID class="klass"/>
6260             <description>
6261               The method in which to set the breakpoint
6262             </description>
6263         </param>
6264         <param id="location">
6265           <jlocation/>
6266           <description>
6267             the index of the instruction at which to set the breakpoint
6268 
6269           </description>
6270         </param>
6271       </parameters>
6272       <errors>
6273         <error id="JVMTI_ERROR_DUPLICATE">
6274           The designated bytecode already has a breakpoint.
6275         </error>
6276       </errors>
6277     </function>
6278 
6279     <function id="ClearBreakpoint" num="39">
6280       <synopsis>Clear Breakpoint</synopsis>
6281       <description>
6282         Clear the breakpoint at the bytecode indicated by
6283         <code>method</code> and <code>location</code>.
6284       </description>
6285       <origin>jvmdi</origin>
6286       <capabilities>
6287         <required id="can_generate_breakpoint_events"></required>
6288       </capabilities>
6289       <parameters>
6290         <param id="klass">
6291           <jclass method="method"/>
6292             <description>
6293               The class in which to clear the breakpoint
6294             </description>
6295         </param>
6296         <param id="method">
6297           <jmethodID class="klass"/>
6298             <description>
6299               The method in which to clear the breakpoint
6300             </description>
6301         </param>
6302         <param id="location">
6303           <jlocation/>
6304           <description>
6305             the index of the instruction at which to clear the breakpoint
6306           </description>
6307         </param>
6308       </parameters>
6309       <errors>
6310         <error id="JVMTI_ERROR_NOT_FOUND">
6311           There's no breakpoint at the designated bytecode.
6312         </error>
6313       </errors>
6314     </function>
6315 
6316   </category>
6317 
6318   <category id="fieldWatch" label="Watched Field">
6319 
6320     <intro>
6321     </intro>
6322 
6323     <function id="SetFieldAccessWatch" num="41">
6324       <synopsis>Set Field Access Watch</synopsis>
6325       <description>
6326         Generate a <eventlink id="FieldAccess"></eventlink> event
6327         when the field specified
6328         by <code>klass</code> and
6329         <code>field</code> is about to be accessed.
6330         An event will be generated for each access of the field
6331         until it is canceled with
6332         <functionlink id="ClearFieldAccessWatch"></functionlink>.
6333         Field accesses from Java programming language code or from JNI code are watched,
6334         fields modified by other means are not watched.
6335         Note that <jvmti/> users should be aware that their own field accesses
6336         will trigger the watch.
6337         A field can only have one field access watch set.
6338         Modification of a field is not considered an access--use
6339         <functionlink id="SetFieldModificationWatch"></functionlink>
6340         to monitor modifications.
6341       </description>
6342       <origin>jvmdi</origin>
6343       <capabilities>
6344         <required id="can_generate_field_access_events"></required>
6345       </capabilities>
6346       <parameters>
6347         <param id="klass">
6348           <jclass field="field"/>
6349             <description>
6350               The class containing the field to watch
6351             </description>
6352         </param>
6353         <param id="field">
6354           <jfieldID class="klass"/>
6355             <description>
6356               The field to watch
6357 
6358             </description>
6359         </param>
6360       </parameters>
6361       <errors>
6362         <error id="JVMTI_ERROR_DUPLICATE">
6363           The designated field is already being watched for accesses.
6364         </error>
6365       </errors>
6366     </function>
6367 
6368     <function id="ClearFieldAccessWatch" num="42">
6369       <synopsis>Clear Field Access Watch</synopsis>
6370       <description>
6371         Cancel a field access watch previously set by
6372         <functionlink id="SetFieldAccessWatch"></functionlink>, on the
6373         field specified
6374         by <code>klass</code> and
6375         <code>field</code>.
6376       </description>
6377       <origin>jvmdi</origin>
6378       <capabilities>
6379         <required id="can_generate_field_access_events"></required>
6380       </capabilities>
6381       <parameters>
6382         <param id="klass">
6383           <jclass field="field"/>
6384             <description>
6385               The class containing the field to watch
6386             </description>
6387         </param>
6388         <param id="field">
6389           <jfieldID class="klass"/>
6390             <description>
6391               The field to watch
6392 
6393             </description>
6394         </param>
6395       </parameters>
6396       <errors>
6397         <error id="JVMTI_ERROR_NOT_FOUND">
6398           The designated field is not being watched for accesses.
6399         </error>
6400       </errors>
6401     </function>
6402 
6403     <function id="SetFieldModificationWatch" num="43">
6404       <synopsis>Set Field Modification Watch</synopsis>
6405       <description>
6406         Generate a <eventlink id="FieldModification"></eventlink> event
6407         when the field specified
6408         by <code>klass</code> and
6409         <code>field</code> is about to be modified.
6410         An event will be generated for each modification of the field
6411         until it is canceled with
6412         <functionlink id="ClearFieldModificationWatch"></functionlink>.
6413         Field modifications from Java programming language code or from JNI code are watched,
6414         fields modified by other means are not watched.
6415         Note that <jvmti/> users should be aware that their own field modifications
6416         will trigger the watch.
6417         A field can only have one field modification watch set.
6418       </description>
6419       <origin>jvmdi</origin>
6420       <capabilities>
6421         <required id="can_generate_field_modification_events"></required>
6422       </capabilities>
6423       <parameters>
6424         <param id="klass">
6425           <jclass field="field"/>
6426             <description>
6427               The class containing the field to watch
6428             </description>
6429         </param>
6430         <param id="field">
6431           <jfieldID class="klass"/>
6432             <description>
6433               The field to watch
6434 
6435             </description>
6436         </param>
6437       </parameters>
6438       <errors>
6439         <error id="JVMTI_ERROR_DUPLICATE">
6440           The designated field is already being watched for modifications.
6441         </error>
6442       </errors>
6443     </function>
6444 
6445     <function id="ClearFieldModificationWatch" num="44">
6446       <synopsis>Clear Field Modification Watch</synopsis>
6447       <description>
6448 
6449         Cancel a field modification watch previously set by
6450         <functionlink id="SetFieldModificationWatch"></functionlink>, on the
6451         field specified
6452         by <code>klass</code> and
6453         <code>field</code>.
6454       </description>
6455       <origin>jvmdi</origin>
6456       <capabilities>
6457         <required id="can_generate_field_modification_events"></required>
6458       </capabilities>
6459       <parameters>
6460         <param id="klass">
6461           <jclass field="field"/>
6462             <description>
6463               The class containing the field to watch
6464             </description>
6465         </param>
6466         <param id="field">
6467           <jfieldID class="klass"/>
6468             <description>
6469               The field to watch
6470 
6471             </description>
6472         </param>
6473       </parameters>
6474       <errors>
6475         <error id="JVMTI_ERROR_NOT_FOUND">
6476           The designated field is not being watched for modifications.
6477         </error>
6478       </errors>
6479     </function>
6480   </category>
6481 
6482   <category id="module" label="Module">
6483 
6484     <intro>
6485     </intro>
6486 
6487     <function id="GetAllModules" num="3" since="9">
6488       <synopsis>Get All Modules</synopsis>
6489       <description>
6490         Return an array of all modules loaded in the virtual machine.
6491         The array includes the unnamed module for each class loader.
6492         The number of modules in the array is returned via
6493         <code>module_count_ptr</code>, and the array itself via
6494         <code>modules_ptr</code>.
6495         <p/>
6496       </description>
6497       <origin>new</origin>
6498       <capabilities>
6499       </capabilities>
6500       <parameters>
6501         <param id="module_count_ptr">
6502           <outptr><jint/></outptr>
6503           <description>
6504             On return, points to the number of returned modules.
6505           </description>
6506         </param>
6507         <param id="modules_ptr">
6508           <allocbuf outcount="module_count_ptr"><jobject/></allocbuf>
6509             <description>
6510               On return, points to an array of references, one
6511               for each module.
6512             </description>
6513         </param>
6514       </parameters>
6515       <errors>
6516       </errors>
6517     </function>
6518 
6519     <function id="GetNamedModule" num="40" since="9">
6520       <synopsis>Get Named Module</synopsis>
6521       <description>
6522         Return the <code>java.lang.Module</code> object for a named
6523         module defined to a class loader that contains a given package.
6524         The module is returned via <code>module_ptr</code>.
6525         <p/>
6526         If a named module is defined to the class loader and it
6527         contains the package then that named module is returned,
6528         otherwise <code>NULL</code> is returned.
6529         <p/>
6530       </description>
6531       <origin>new</origin>
6532       <capabilities>
6533       </capabilities>
6534       <parameters>
6535         <param id="class_loader">
6536           <ptrtype>
6537             <jobject/>
6538             <nullok>the bootstrap loader is assumed</nullok>
6539           </ptrtype>
6540           <description>
6541             A class loader.
6542             If the <code>class_loader</code> is not <code>NULL</code>
6543             or a subclass of <code>java.lang.ClassLoader</code>
6544             this function returns
6545             <errorlink id="JVMTI_ERROR_ILLEGAL_ARGUMENT"></errorlink>.
6546           </description>
6547         </param>
6548         <param id="package_name">
6549           <inbuf><char/></inbuf>
6550           <description>
6551             The name of the package, encoded as a
6552             <internallink id="mUTF">modified UTF-8</internallink> string.
6553             The package name is in internal form (JVMS 4.2.1);
6554             identifiers are separated by forward slashes rather than periods.
6555           </description>
6556         </param>
6557         <param id="module_ptr">
6558           <outptr><jobject/></outptr>
6559           <description>
6560             On return, points to a <code>java.lang.Module</code> object
6561             or points to <code>NULL</code>.
6562           </description>
6563         </param>
6564       </parameters>
6565       <errors>
6566         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6567           If class loader is not <code>NULL</code> and is not a class loader object.
6568         </error>
6569       </errors>
6570     </function>
6571 
6572     <function id="AddModuleReads" num="94" since="9">
6573       <synopsis>Add Module Reads</synopsis>
6574       <description>
6575          Update a module to read another module. This function is a no-op
6576          when <paramlink id="module"></paramlink> is an unnamed module.
6577          This function facilitates the instrumentation of code
6578          in named modules where that instrumentation requires
6579          expanding the set of modules that a module reads.
6580       </description>
6581       <origin>new</origin>
6582       <capabilities>
6583       </capabilities>
6584       <parameters>
6585         <param id="module">
6586           <ptrtype><jobject/></ptrtype>
6587           <description>
6588             The module to update.
6589           </description>
6590         </param>
6591         <param id="to_module">
6592           <ptrtype><jobject/></ptrtype>
6593           <description>
6594             The additional module to read.
6595           </description>
6596         </param>
6597       </parameters>
6598       <errors>
6599         <error id="JVMTI_ERROR_INVALID_MODULE">
6600           If <paramlink id="module"></paramlink> is not a module object.
6601         </error>
6602         <error id="JVMTI_ERROR_INVALID_MODULE">
6603           If <paramlink id="to_module"></paramlink> is not a module object.
6604         </error>
6605         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6606           if the module cannot be modified.
6607           See <functionlink id="IsModifiableModule"/>.
6608         </error>
6609       </errors>
6610     </function>
6611 
6612     <function id="AddModuleExports" num="95" since="9">
6613       <synopsis>Add Module Exports</synopsis>
6614       <description>
6615          Update a module to export a package to another module.
6616          This function is a no-op when <paramlink id="module"></paramlink>
6617          is an unnamed module or an open module.
6618          This function facilitates the instrumentation of code
6619          in named modules where that instrumentation requires
6620          expanding the set of packages that a module exports.
6621       </description>
6622       <origin>new</origin>
6623       <capabilities>
6624       </capabilities>
6625       <parameters>
6626         <param id="module">
6627           <ptrtype><jobject/></ptrtype>
6628           <description>
6629             The module to update.
6630           </description>
6631         </param>
6632         <param id="pkg_name">
6633           <inbuf><char/></inbuf>
6634           <description>
6635             The exported package name.
6636           </description>
6637         </param>
6638         <param id="to_module">
6639           <ptrtype><jobject/></ptrtype>
6640           <description>
6641             The module the package is exported to.
6642             If the <code>to_module</code> is not a subclass of
6643             <code>java.lang.Module</code> this function returns
6644             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6645           </description>
6646         </param>
6647       </parameters>
6648       <errors>
6649         <error id="JVMTI_ERROR_INVALID_MODULE">
6650           If <paramlink id="module"></paramlink> is not a module object.
6651         </error>
6652         <error id="JVMTI_ERROR_INVALID_MODULE">
6653           If <paramlink id="to_module"></paramlink> is not a module object.
6654         </error>
6655         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6656           If the package <paramlink id="pkg_name"></paramlink>
6657           does not belong to the module.
6658         </error>
6659         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6660           if the module cannot be modified.
6661           See <functionlink id="IsModifiableModule"/>.
6662         </error>
6663       </errors>
6664     </function>
6665 
6666     <function id="AddModuleOpens" num="96" since="9">
6667       <synopsis>Add Module Opens</synopsis>
6668       <description>
6669          Update a module to open a package to another module.
6670          This function is a no-op when <paramlink id="module"></paramlink>
6671          is an unnamed module or an open module.
6672          This function facilitates the instrumentation of code
6673          in modules where that instrumentation requires
6674          expanding the set of packages that a module opens to
6675          other modules.
6676       </description>
6677       <origin>new</origin>
6678       <capabilities>
6679       </capabilities>
6680       <parameters>
6681         <param id="module">
6682           <ptrtype><jobject/></ptrtype>
6683           <description>
6684             The module to update.
6685           </description>
6686         </param>
6687         <param id="pkg_name">
6688           <inbuf><char/></inbuf>
6689           <description>
6690             The package name of the package to open.
6691           </description>
6692         </param>
6693         <param id="to_module">
6694           <ptrtype><jobject/></ptrtype>
6695           <description>
6696             The module with the package to open.
6697             If the <code>to_module</code> is not a subclass of
6698             <code>java.lang.Module</code> this function returns
6699             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6700           </description>
6701         </param>
6702       </parameters>
6703       <errors>
6704         <error id="JVMTI_ERROR_INVALID_MODULE">
6705           If <paramlink id="module"></paramlink> is not a module object.
6706         </error>
6707         <error id="JVMTI_ERROR_INVALID_MODULE">
6708           If <paramlink id="to_module"></paramlink> is not a module object.
6709         </error>
6710         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6711           If the package <paramlink id="pkg_name"></paramlink>
6712           does not belong to the module.
6713         </error>
6714         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6715           if the module cannot be modified.
6716           See <functionlink id="IsModifiableModule"/>.
6717         </error>
6718       </errors>
6719     </function>
6720 
6721     <function id="AddModuleUses" num="97" since="9">
6722       <synopsis>Add Module Uses</synopsis>
6723       <description>
6724          Updates a module to add a service to the set of services that
6725          a module uses. This function is a no-op when the module
6726          is an unnamed module.
6727          This function facilitates the instrumentation of code
6728          in named modules where that instrumentation requires
6729          expanding the set of services that a module is using.
6730       </description>
6731       <origin>new</origin>
6732       <capabilities>
6733       </capabilities>
6734       <parameters>
6735         <param id="module">
6736           <ptrtype><jobject/></ptrtype>
6737           <description>
6738             The module to update.
6739           </description>
6740         </param>
6741         <param id="service">
6742           <ptrtype><jclass/></ptrtype>
6743           <description>
6744             The service to use.
6745           </description>
6746         </param>
6747       </parameters>
6748       <errors>
6749         <error id="JVMTI_ERROR_INVALID_MODULE">
6750           If <paramlink id="module"></paramlink> is not a module object.
6751         </error>
6752         <error id="JVMTI_ERROR_INVALID_CLASS">
6753           If <paramlink id="service"></paramlink> is not a class object.
6754         </error>
6755         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6756           if the module cannot be modified.
6757           See <functionlink id="IsModifiableModule"/>.
6758         </error>
6759       </errors>
6760     </function>
6761 
6762     <function id="AddModuleProvides" num="98" since="9">
6763       <synopsis>Add Module Provides</synopsis>
6764       <description>
6765          Updates a module to add a service to the set of services that
6766          a module provides. This function is a no-op when the module
6767          is an unnamed module.
6768          This function facilitates the instrumentation of code
6769          in named modules where that instrumentation requires
6770          changes to the services that are provided.
6771       </description>
6772       <origin>new</origin>
6773       <capabilities>
6774       </capabilities>
6775       <parameters>
6776         <param id="module">
6777           <ptrtype><jobject/></ptrtype>
6778           <description>
6779             The module to update.
6780           </description>
6781         </param>
6782         <param id="service">
6783           <ptrtype><jclass/></ptrtype>
6784           <description>
6785             The service to provide.
6786           </description>
6787         </param>
6788         <param id="impl_class">
6789           <ptrtype><jclass/></ptrtype>
6790           <description>
6791             The implementation class for the provided service.
6792           </description>
6793         </param>
6794       </parameters>
6795       <errors>
6796         <error id="JVMTI_ERROR_INVALID_MODULE">
6797           If <paramlink id="module"></paramlink> is not a module object.
6798         </error>
6799         <error id="JVMTI_ERROR_INVALID_CLASS">
6800           If <paramlink id="service"></paramlink> is not a class object.
6801         </error>
6802         <error id="JVMTI_ERROR_INVALID_CLASS">
6803           If <paramlink id="impl_class"></paramlink> is not a class object.
6804         </error>
6805         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6806           if the module cannot be modified.
6807           See <functionlink id="IsModifiableModule"/>.
6808         </error>
6809       </errors>
6810     </function>
6811 
6812     <function id="IsModifiableModule" num="99" since="9">
6813       <synopsis>Is Modifiable Module</synopsis>
6814       <description>
6815         Determines whether a module is modifiable.
6816         If a module is modifiable then this module can be updated with
6817         <functionlink id="AddModuleReads"/>, <functionlink id="AddModuleExports"/>,
6818         <functionlink id="AddModuleOpens"/>, <functionlink id="AddModuleUses"/>,
6819         and <functionlink id="AddModuleProvides"/>. If a module is not modifiable
6820         then the module can not be updated with these functions. The result of
6821         this function is always <code>JNI_TRUE</code> when called to determine
6822         if an unnamed module is modifiable.
6823       </description>
6824       <origin>new</origin>
6825       <capabilities>
6826       </capabilities>
6827       <parameters>
6828         <param id="module">
6829           <ptrtype><jobject/></ptrtype>
6830           <description>
6831             The module to query.
6832           </description>
6833         </param>
6834         <param id="is_modifiable_module_ptr">
6835           <outptr><jboolean/></outptr>
6836           <description>
6837             On return, points to the boolean result of this function.
6838           </description>
6839         </param>
6840       </parameters>
6841       <errors>
6842         <error id="JVMTI_ERROR_INVALID_MODULE">
6843           If <paramlink id="module"></paramlink> is not a module object.
6844         </error>
6845       </errors>
6846     </function>
6847 
6848   </category>
6849 
6850   <category id="class" label="Class">
6851 
6852     <intro>
6853     </intro>
6854 
6855     <function id="GetLoadedClasses" jkernel="yes" num="78">
6856       <synopsis>Get Loaded Classes</synopsis>
6857       <description>
6858         Return an array of all classes loaded in the virtual machine.
6859         The number of classes in the array is returned via
6860         <code>class_count_ptr</code>, and the array itself via
6861         <code>classes_ptr</code>.
6862         <p/>
6863         Array classes of all types (including arrays of primitive types) are
6864         included in the returned list. Primitive classes (for example,
6865         <code>java.lang.Integer.TYPE</code>) are <i>not</i> included in this list.
6866       </description>
6867       <origin>jvmdi</origin>
6868       <capabilities>
6869       </capabilities>
6870       <parameters>
6871         <param id="class_count_ptr">
6872           <outptr><jint/></outptr>
6873           <description>
6874             On return, points to the number of classes.
6875           </description>
6876         </param>
6877         <param id="classes_ptr">
6878           <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
6879             <description>
6880               On return, points to an array of references, one
6881               for each class.
6882             </description>
6883         </param>
6884       </parameters>
6885       <errors>
6886       </errors>
6887     </function>
6888 
6889     <function id="GetClassLoaderClasses" jkernel="yes" num="79">
6890       <synopsis>Get Classloader Classes</synopsis>
6891       <description>
6892         Returns an array of those classes for which this class loader has
6893         been recorded as an initiating loader. Each
6894         class in the returned array was created by this class loader,
6895         either by defining it directly or by delegation to another class loader.
6896         See <vmspec chapter="5.3"/>.
6897         <p/>
6898         The number of classes in the array is returned via
6899         <code>class_count_ptr</code>, and the array itself via
6900         <code>classes_ptr</code>.
6901       </description>
6902       <origin>jvmdi</origin>
6903       <capabilities>
6904       </capabilities>
6905       <parameters>
6906         <param id="initiating_loader">
6907           <ptrtype>
6908             <jobject/>
6909             <nullok>the classes initiated by the bootstrap loader will be returned</nullok>
6910           </ptrtype>
6911             <description>
6912               An initiating class loader.
6913             </description>
6914         </param>
6915         <param id="class_count_ptr">
6916           <outptr><jint/></outptr>
6917           <description>
6918             On return, points to the number of classes.
6919           </description>
6920         </param>
6921         <param id="classes_ptr">
6922           <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
6923             <description>
6924               On return, points to an array of references, one
6925               for each class.
6926             </description>
6927         </param>
6928       </parameters>
6929       <errors>
6930       </errors>
6931     </function>
6932 
6933     <function id="GetClassSignature" phase="start" num="48">
6934       <synopsis>Get Class Signature</synopsis>
6935       <description>
6936         For the class indicated by <code>klass</code>, return the
6937         <externallink id="jni/types.html#type-signatures">JNI
6938             type signature</externallink>
6939         and the generic signature of the class.
6940         For example, <code>java.util.List</code> is <code>"Ljava/util/List;"</code>
6941         and <code>int[]</code> is <code>"[I"</code>
6942         The returned name for primitive classes
6943         is the type signature character of the corresponding primitive type.
6944         For example, <code>java.lang.Integer.TYPE</code> is <code>"I"</code>.
6945       </description>
6946       <origin>jvmdiClone</origin>
6947       <capabilities>
6948       </capabilities>
6949       <parameters>
6950         <param id="klass">
6951           <jclass/>
6952             <description>
6953               The class to query.
6954             </description>
6955         </param>
6956         <param id="signature_ptr">
6957           <allocbuf>
6958             <char/>
6959             <nullok>the signature is not returned</nullok>
6960           </allocbuf>
6961           <description>
6962             On return, points to the JNI type signature of the class, encoded as a
6963             <internallink id="mUTF">modified UTF-8</internallink> string.
6964           </description>
6965         </param>
6966         <param id="generic_ptr">
6967           <allocbuf>
6968             <char/>
6969             <nullok>the generic signature is not returned</nullok>
6970           </allocbuf>
6971           <description>
6972             On return, points to the generic signature of the class, encoded as a
6973             <internallink id="mUTF">modified UTF-8</internallink> string.
6974             If there is no generic signature attribute for the class, then,
6975             on return, points to <code>NULL</code>.
6976           </description>
6977         </param>
6978       </parameters>
6979       <errors>
6980       </errors>
6981     </function>
6982 
6983     <function id="GetClassStatus" phase="start" num="49">
6984       <synopsis>Get Class Status</synopsis>
6985       <description>
6986         Get the status of the class. Zero or more of the following bits can be
6987         set.
6988         <constants id="jvmtiClassStatus" label="Class Status Flags" kind="bits">
6989           <constant id="JVMTI_CLASS_STATUS_VERIFIED" num="1">
6990             Class bytecodes have been verified
6991           </constant>
6992           <constant id="JVMTI_CLASS_STATUS_PREPARED" num="2">
6993             Class preparation is complete
6994           </constant>
6995           <constant id="JVMTI_CLASS_STATUS_INITIALIZED" num="4">
6996             Class initialization is complete. Static initializer has been run.
6997           </constant>
6998           <constant id="JVMTI_CLASS_STATUS_ERROR" num="8">
6999             Error during initialization makes class unusable
7000           </constant>
7001           <constant id="JVMTI_CLASS_STATUS_ARRAY" num="16">
7002             Class is an array.  If set, all other bits are zero.
7003           </constant>
7004           <constant id="JVMTI_CLASS_STATUS_PRIMITIVE" num="32">
7005             Class is a primitive class (for example, <code>java.lang.Integer.TYPE</code>).
7006             If set, all other bits are zero.
7007           </constant>
7008         </constants>
7009       </description>
7010       <origin>jvmdi</origin>
7011       <capabilities>
7012       </capabilities>
7013       <parameters>
7014         <param id="klass">
7015           <jclass/>
7016             <description>
7017               The class to query.
7018             </description>
7019         </param>
7020         <param id="status_ptr">
7021           <outptr><jint/></outptr>
7022           <description>
7023             On return, points to the current state of this class as one or
7024             more of the <internallink id="jvmtiClassStatus">class status flags</internallink>.
7025           </description>
7026         </param>
7027       </parameters>
7028       <errors>
7029       </errors>
7030     </function>
7031 
7032     <function id="GetSourceFileName" phase="start" num="50">
7033       <synopsis>Get Source File Name</synopsis>
7034       <description>
7035         For the class indicated by <code>klass</code>, return the source file
7036         name via <code>source_name_ptr</code>. The returned string
7037         is a file name only and never contains a directory name.
7038         <p/>
7039         For primitive classes (for example, <code>java.lang.Integer.TYPE</code>)
7040         and for arrays this function returns
7041         <errorlink id="JVMTI_ERROR_ABSENT_INFORMATION"></errorlink>.
7042       </description>
7043       <origin>jvmdi</origin>
7044       <capabilities>
7045         <required id="can_get_source_file_name"></required>
7046       </capabilities>
7047       <parameters>
7048         <param id="klass">
7049           <jclass/>
7050             <description>
7051               The class to query.
7052             </description>
7053         </param>
7054         <param id="source_name_ptr">
7055           <allocbuf><char/></allocbuf>
7056           <description>
7057             On return, points to the class's source file name, encoded as a
7058             <internallink id="mUTF">modified UTF-8</internallink> string.
7059           </description>
7060         </param>
7061       </parameters>
7062       <errors>
7063         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7064           Class information does not include a source file name. This includes
7065           cases where the class is an array class or primitive class.
7066         </error>
7067       </errors>
7068     </function>
7069 
7070     <function id="GetClassModifiers" phase="start" num="51">
7071       <synopsis>Get Class Modifiers</synopsis>
7072       <description>
7073         For the class indicated by <code>klass</code>, return the access
7074         flags
7075         via <code>modifiers_ptr</code>.
7076         Access flags are defined in <vmspec chapter="4"/>.
7077         <p/>
7078         If the class is an array class, then its public, private, and protected
7079         modifiers are the same as those of its component type. For arrays of
7080         primitives, this component type is represented by one of the primitive
7081         classes (for example, <code>java.lang.Integer.TYPE</code>).
7082         <p/>
7083         If the class is a primitive class, its public modifier is always true,
7084         and its protected and private modifiers are always false.
7085         <p/>
7086         If the class is an array class or a primitive class then its final
7087         modifier is always true and its interface modifier is always false.
7088         The values of its other modifiers are not determined by this specification.
7089 
7090       </description>
7091       <origin>jvmdi</origin>
7092       <capabilities>
7093       </capabilities>
7094       <parameters>
7095         <param id="klass">
7096           <jclass/>
7097             <description>
7098               The class to query.
7099             </description>
7100         </param>
7101         <param id="modifiers_ptr">
7102           <outptr><jint/></outptr>
7103           <description>
7104             On return, points to the current access flags of this class.
7105 
7106           </description>
7107         </param>
7108       </parameters>
7109       <errors>
7110       </errors>
7111     </function>
7112 
7113     <function id="GetClassMethods" phase="start" num="52">
7114       <synopsis>Get Class Methods</synopsis>
7115       <description>
7116         For the class indicated by <code>klass</code>, return a count of
7117         methods via <code>method_count_ptr</code> and a list of
7118         method IDs via <code>methods_ptr</code>. The method list contains
7119         constructors and static initializers as well as true methods.
7120         Only directly declared methods are returned (not inherited methods).
7121         An empty method list is returned for array classes and primitive classes
7122         (for example, <code>java.lang.Integer.TYPE</code>).
7123       </description>
7124       <origin>jvmdi</origin>
7125       <capabilities>
7126         <capability id="can_maintain_original_method_order"/>
7127       </capabilities>
7128       <parameters>
7129         <param id="klass">
7130           <jclass/>
7131             <description>
7132               The class to query.
7133             </description>
7134         </param>
7135         <param id="method_count_ptr">
7136           <outptr><jint/></outptr>
7137           <description>
7138             On return, points to the number of methods declared in this class.
7139           </description>
7140         </param>
7141         <param id="methods_ptr">
7142           <allocbuf outcount="method_count_ptr"><jmethodID class="klass"/></allocbuf>
7143             <description>
7144               On return, points to the method ID array.
7145             </description>
7146         </param>
7147       </parameters>
7148       <errors>
7149         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7150           <paramlink id="klass"></paramlink> is not prepared.
7151         </error>
7152       </errors>
7153     </function>
7154 
7155     <function id="GetClassFields" phase="start" num="53">
7156       <synopsis>Get Class Fields</synopsis>
7157       <description>
7158         For the class indicated by <code>klass</code>, return a count of fields
7159         via <code>field_count_ptr</code> and a list of field IDs via
7160         <code>fields_ptr</code>.
7161         Only directly declared fields are returned (not inherited fields).
7162         Fields are returned in the order they occur in the class file.
7163         An empty field list is returned for array classes and primitive classes
7164         (for example, <code>java.lang.Integer.TYPE</code>).
7165         Use JNI to determine the length of an array.
7166       </description>
7167       <origin>jvmdi</origin>
7168       <capabilities>
7169       </capabilities>
7170       <parameters>
7171         <param id="klass">
7172           <jclass/>
7173             <description>
7174               The class to query.
7175             </description>
7176         </param>
7177         <param id="field_count_ptr">
7178           <outptr><jint/></outptr>
7179           <description>
7180             On return, points to the number of fields declared in this class.
7181           </description>
7182         </param>
7183         <param id="fields_ptr">
7184           <allocbuf outcount="field_count_ptr"><jfieldID/></allocbuf>
7185             <description>
7186               On return, points to the field ID array.
7187             </description>
7188         </param>
7189       </parameters>
7190       <errors>
7191         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7192           <paramlink id="klass"></paramlink> is not prepared.
7193         </error>
7194       </errors>
7195     </function>
7196 
7197     <function id="GetImplementedInterfaces" phase="start" num="54">
7198       <synopsis>Get Implemented Interfaces</synopsis>
7199       <description>
7200         Return the direct super-interfaces of this class. For a class, this
7201         function returns the interfaces declared in its <code>implements</code>
7202         clause. For an interface, this function returns the interfaces declared in
7203         its <code>extends</code> clause.
7204         An empty interface list is returned for array classes and primitive classes
7205         (for example, <code>java.lang.Integer.TYPE</code>).
7206       </description>
7207       <origin>jvmdi</origin>
7208       <capabilities>
7209       </capabilities>
7210       <parameters>
7211         <param id="klass">
7212           <jclass/>
7213             <description>
7214               The class to query.
7215             </description>
7216         </param>
7217         <param id="interface_count_ptr">
7218           <outptr><jint/></outptr>
7219           <description>
7220             On return, points to the number of interfaces.
7221           </description>
7222         </param>
7223         <param id="interfaces_ptr">
7224           <allocbuf outcount="interface_count_ptr"><jclass/></allocbuf>
7225             <description>
7226               On return, points to the interface array.
7227             </description>
7228         </param>
7229       </parameters>
7230       <errors>
7231         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7232           <paramlink id="klass"></paramlink> is not prepared.
7233         </error>
7234       </errors>
7235     </function>
7236 
7237     <function id="GetClassVersionNumbers" phase="start" num="145" since="1.1">
7238       <synopsis>Get Class Version Numbers</synopsis>
7239       <description>
7240         For the class indicated by <code>klass</code>,
7241         return the minor and major version numbers,
7242         as defined in
7243         <vmspec chapter="4"/>.
7244       </description>
7245       <origin>new</origin>
7246       <capabilities>
7247       </capabilities>
7248       <parameters>
7249         <param id="klass">
7250           <jclass/>
7251             <description>
7252               The class to query.
7253             </description>
7254         </param>
7255         <param id="minor_version_ptr">
7256           <outptr><jint/></outptr>
7257           <description>
7258             On return, points to the value of the
7259             <code>minor_version</code> item of the
7260             Class File Format.
7261             Note: to be consistent with the Class File Format,
7262             the minor version number is the first parameter.
7263           </description>
7264         </param>
7265         <param id="major_version_ptr">
7266           <outptr><jint/></outptr>
7267           <description>
7268             On return, points to the value of the
7269             <code>major_version</code> item of the
7270             Class File Format.
7271           </description>
7272         </param>
7273       </parameters>
7274       <errors>
7275         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7276           The class is a primitive or array class.
7277         </error>
7278       </errors>
7279     </function>
7280 
7281     <function id="GetConstantPool" phase="start" num="146" since="1.1">
7282       <synopsis>Get Constant Pool</synopsis>
7283       <description>
7284         For the class indicated by <code>klass</code>,
7285         return the raw bytes of the constant pool in the format of the
7286         <code>constant_pool</code> item of
7287         <vmspec chapter="4"/>.
7288         The format of the constant pool may differ between versions
7289         of the Class File Format, so, the
7290         <functionlink id="GetClassVersionNumbers">minor and major
7291         class version numbers</functionlink> should be checked for
7292         compatibility.
7293         <p/>
7294         The returned constant pool might not have the same layout or
7295         contents as the constant pool in the defining class file.
7296         The constant pool returned by GetConstantPool() may have
7297         more or fewer entries than the defining constant pool.
7298         Entries may be in a different order.
7299         The constant pool returned by GetConstantPool() will match the
7300         constant pool used by
7301         <functionlink id="GetBytecodes">GetBytecodes()</functionlink>.
7302         That is, the bytecodes returned by GetBytecodes() will have
7303         constant pool indices which refer to constant pool entries returned
7304         by GetConstantPool().
7305         Note that since <functionlink id="RetransformClasses"/>
7306         and <functionlink id="RedefineClasses"/> can change
7307         the constant pool, the constant pool returned by this function
7308         can change accordingly.  Thus, the correspondence between
7309         GetConstantPool() and GetBytecodes() does not hold if there
7310         is an intervening class retransformation or redefinition.
7311         The value of a constant pool entry used by a given bytecode will
7312         match that of the defining class file (even if the indices don't match).
7313         Constant pool entries which are not used directly or indirectly by
7314         bytecodes (for example,  UTF-8 strings associated with annotations) are
7315         not  required to exist in the returned constant pool.
7316       </description>
7317       <origin>new</origin>
7318       <capabilities>
7319         <required id="can_get_constant_pool"></required>
7320       </capabilities>
7321       <parameters>
7322         <param id="klass">
7323           <jclass/>
7324             <description>
7325               The class to query.
7326             </description>
7327         </param>
7328         <param id="constant_pool_count_ptr">
7329           <outptr><jint/></outptr>
7330           <description>
7331             On return, points to the number of entries
7332             in the constant pool table plus one.
7333             This corresponds to the <code>constant_pool_count</code>
7334             item of the Class File Format.
7335           </description>
7336         </param>
7337         <param id="constant_pool_byte_count_ptr">
7338           <outptr><jint/></outptr>
7339           <description>
7340             On return, points to the number of bytes
7341             in the returned raw constant pool.
7342           </description>
7343         </param>
7344         <param id="constant_pool_bytes_ptr">
7345           <allocbuf outcount="constant_pool_byte_count_ptr"><uchar/></allocbuf>
7346             <description>
7347               On return, points to the raw constant pool, that is the bytes
7348               defined by the <code>constant_pool</code> item of the
7349               Class File Format
7350             </description>
7351         </param>
7352       </parameters>
7353       <errors>
7354         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7355           The class is a primitive or array class.
7356         </error>
7357       </errors>
7358     </function>
7359 
7360     <function id="IsInterface" phase="start" num="55">
7361       <synopsis>Is Interface</synopsis>
7362       <description>
7363         Determines whether a class object reference represents an interface.
7364         The <code>jboolean</code> result is
7365         <code>JNI_TRUE</code> if the "class" is actually an interface,
7366         <code>JNI_FALSE</code> otherwise.
7367       </description>
7368       <origin>jvmdi</origin>
7369       <capabilities>
7370       </capabilities>
7371       <parameters>
7372         <param id="klass">
7373           <jclass/>
7374             <description>
7375               The class to query.
7376             </description>
7377         </param>
7378         <param id="is_interface_ptr">
7379           <outptr><jboolean/></outptr>
7380           <description>
7381             On return, points to the boolean result of this function.
7382 
7383           </description>
7384         </param>
7385       </parameters>
7386       <errors>
7387       </errors>
7388     </function>
7389 
7390     <function id="IsArrayClass" phase="start" num="56">
7391       <synopsis>Is Array Class</synopsis>
7392       <description>
7393         Determines whether a class object reference represents an array.
7394         The <code>jboolean</code> result is
7395         <code>JNI_TRUE</code> if the class is an array,
7396         <code>JNI_FALSE</code> otherwise.
7397       </description>
7398       <origin>jvmdi</origin>
7399       <capabilities>
7400       </capabilities>
7401       <parameters>
7402         <param id="klass">
7403           <jclass/>
7404             <description>
7405               The class to query.
7406             </description>
7407         </param>
7408         <param id="is_array_class_ptr">
7409           <outptr><jboolean/></outptr>
7410           <description>
7411             On return, points to the boolean result of this function.
7412 
7413           </description>
7414         </param>
7415       </parameters>
7416       <errors>
7417       </errors>
7418     </function>
7419 
7420     <function id="IsModifiableClass" jkernel="yes" phase="start" num="45" since="1.1">
7421       <synopsis>Is Modifiable Class</synopsis>
7422       <description>
7423         Determines whether a class is modifiable.
7424         If a class is modifiable (<paramlink id="is_modifiable_class_ptr"/>
7425         returns <code>JNI_TRUE</code>) the class can be
7426         redefined with <functionlink id="RedefineClasses"/> (assuming
7427         the agent possesses the
7428         <fieldlink id="can_redefine_classes" struct="jvmtiCapabilities"/>
7429         capability) or
7430         retransformed with <functionlink id="RetransformClasses"/> (assuming
7431         the agent possesses the
7432         <fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
7433         capability).
7434         If a class is not modifiable (<paramlink id="is_modifiable_class_ptr"/>
7435         returns <code>JNI_FALSE</code>) the class can be neither
7436         redefined nor retransformed.
7437         <p/>
7438         Primitive classes (for example, <code>java.lang.Integer.TYPE</code>),
7439         array classes, and some implementation defined classes are never modifiable.
7440         <p/>
7441       </description>
7442       <origin>new</origin>
7443       <capabilities>
7444         <capability id="can_redefine_any_class">
7445           If possessed then all classes (except primitive, array, and some implementation defined
7446           classes) are modifiable (redefine or retransform).
7447         </capability>
7448         <capability id="can_retransform_any_class">
7449           If possessed then all classes (except primitive, array, and some implementation defined
7450           classes) are modifiable with <functionlink id="RetransformClasses"/>.
7451         </capability>
7452         <capability id="can_redefine_classes">
7453           No effect on the result of the function.
7454           But must additionally be possessed to modify the class with
7455           <functionlink id="RedefineClasses"/>.
7456         </capability>
7457         <capability id="can_retransform_classes">
7458           No effect on the result of the function.
7459           But must additionally be possessed to modify the class with
7460           <functionlink id="RetransformClasses"/>.
7461         </capability>
7462       </capabilities>
7463       <parameters>
7464         <param id="klass">
7465           <jclass/>
7466             <description>
7467               The class to query.
7468             </description>
7469         </param>
7470         <param id="is_modifiable_class_ptr">
7471           <outptr><jboolean/></outptr>
7472           <description>
7473             On return, points to the boolean result of this function.
7474           </description>
7475         </param>
7476       </parameters>
7477       <errors>
7478       </errors>
7479     </function>
7480 
7481     <function id="GetClassLoader" phase="start" num="57">
7482       <synopsis>Get Class Loader</synopsis>
7483       <description>
7484         For the class indicated by <code>klass</code>, return via
7485         <code>classloader_ptr</code> a reference to the class loader for the
7486         class.
7487       </description>
7488       <origin>jvmdi</origin>
7489       <capabilities>
7490       </capabilities>
7491       <parameters>
7492         <param id="klass">
7493           <jclass/>
7494             <description>
7495               The class to query.
7496             </description>
7497         </param>
7498         <param id="classloader_ptr">
7499           <outptr><jobject/></outptr>
7500             <description>
7501               On return, points to the class loader that loaded
7502               this class.
7503               If the class was not created by a class loader
7504               or if the class loader is the bootstrap class loader,
7505               points to <code>NULL</code>.
7506             </description>
7507         </param>
7508       </parameters>
7509       <errors>
7510       </errors>
7511 
7512     </function>
7513 
7514     <function id="GetSourceDebugExtension" phase="start" num="90">
7515       <synopsis>Get Source Debug Extension</synopsis>
7516       <description>
7517         For the class indicated by <code>klass</code>, return the debug
7518         extension via <code>source_debug_extension_ptr</code>.
7519         The returned string
7520         contains exactly the debug extension information present in the
7521         class file of <code>klass</code>.
7522       </description>
7523       <origin>jvmdi</origin>
7524       <capabilities>
7525         <required id="can_get_source_debug_extension"></required>
7526       </capabilities>
7527       <parameters>
7528         <param id="klass">
7529           <jclass/>
7530             <description>
7531               The class to query.
7532             </description>
7533         </param>
7534         <param id="source_debug_extension_ptr">
7535           <allocbuf><char/></allocbuf>
7536           <description>
7537             On return, points to the class's debug extension, encoded as a
7538             <internallink id="mUTF">modified UTF-8</internallink> string.
7539           </description>
7540         </param>
7541       </parameters>
7542       <errors>
7543         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7544           Class information does not include a debug extension.
7545         </error>
7546       </errors>
7547     </function>
7548 
7549     <function id="RetransformClasses" jkernel="yes" num="152" since="1.1">
7550       <synopsis>Retransform Classes</synopsis>
7551       <description>
7552         This function facilitates the
7553         <internallink id="bci">bytecode instrumentation</internallink>
7554         of already loaded classes.
7555         To replace the class definition without reference to the existing
7556         bytecodes, as one might do when recompiling from source for
7557         fix-and-continue debugging, <functionlink id="RedefineClasses"/>
7558         function should be used instead.
7559         <p/>
7560         When classes are initially loaded or when they are
7561         <functionlink id="RedefineClasses">redefined</functionlink>,
7562         the initial class file bytes can be transformed with the
7563         <eventlink id="ClassFileLoadHook"/> event.
7564         This function reruns the transformation process
7565         (whether or not a transformation has previously occurred).
7566         This retransformation follows these steps:
7567         <ul>
7568           <li>starting from the initial class file bytes
7569           </li>
7570           <li>for each <fieldlink id="can_retransform_classes"
7571                      struct="jvmtiCapabilities">retransformation
7572                                                 incapable</fieldlink>
7573             agent which received a
7574             <code>ClassFileLoadHook</code> event during the previous
7575             load or redefine, the bytes it returned
7576             (via the <code>new_class_data</code> parameter)
7577             are reused as the output of the transformation;
7578             note that this is equivalent to reapplying
7579             the previous transformation, unaltered. except that
7580             the <code>ClassFileLoadHook</code> event
7581             is <b>not</b> sent to these agents
7582           </li>
7583           <li>for each <fieldlink id="can_retransform_classes"
7584                      struct="jvmtiCapabilities">retransformation
7585                                                 capable</fieldlink>
7586             agent, the <code>ClassFileLoadHook</code> event is sent,
7587             allowing a new transformation to be applied
7588           </li>
7589           <li>the transformed class file bytes are installed as the new
7590             definition of the class
7591           </li>
7592         </ul>
7593         See the <eventlink id="ClassFileLoadHook"/> event for more details.
7594         <p/>
7595         The initial class file bytes represent the bytes passed to
7596         <code>ClassLoader.defineClass</code>
7597         or <code>RedefineClasses</code> (before any transformations
7598         were applied), however they may not exactly match them.
7599         The constant pool may differ in ways described in
7600         <functionlink id="GetConstantPool"/>.
7601         Constant pool indices in the bytecodes of methods will correspond.
7602         Some attributes may not be present.
7603         Where order is not meaningful, for example the order of methods,
7604         order may not be preserved.
7605         <p/>
7606         Retransformation can cause new versions of methods to be installed.
7607         Old method versions may become
7608         <internallink id="obsoleteMethods">obsolete</internallink>
7609         The new method version will be used on new invokes.
7610         If a method has active stack frames, those active frames continue to
7611         run the bytecodes of the original method version.
7612         <p/>
7613         This function does not cause any initialization except that which
7614         would occur under the customary JVM semantics.
7615         In other words, retransforming a class does not cause its initializers to be
7616         run. The values of static fields will remain as they were
7617         prior to the call.
7618         <p/>
7619         Threads need not be suspended.
7620         <p/>
7621         All breakpoints in the class are cleared.
7622         <p/>
7623         All attributes are updated.
7624         <p/>
7625         Instances of the retransformed class are not affected -- fields retain their
7626         previous values.
7627         <functionlink id="GetTag">Tags</functionlink> on the instances are
7628         also unaffected.
7629         <p/>
7630         In response to this call, no events other than the
7631         <eventlink id="ClassFileLoadHook"/> event
7632         will be sent.
7633         <p/>
7634         The retransformation may change method bodies, the constant pool and attributes.
7635         The retransformation must not add, remove or rename fields or methods, change the
7636         signatures of methods, change modifiers, or change inheritance.
7637         These restrictions may be lifted in future versions.
7638         See the error return description below for information on error codes
7639         returned if an unsupported retransformation is attempted.
7640         The class file bytes are not verified or installed until they have passed
7641         through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7642         returned error code reflects the result of the transformations.
7643         If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7644         none of the classes to be retransformed will have a new definition installed.
7645         When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7646         all of the classes to be retransformed will have their new definitions installed.
7647       </description>
7648       <origin>new</origin>
7649       <capabilities>
7650         <required id="can_retransform_classes"></required>
7651         <capability id="can_retransform_any_class"></capability>
7652       </capabilities>
7653       <parameters>
7654         <param id="class_count">
7655           <jint min="0"/>
7656           <description>
7657             The number of classes to be retransformed.
7658           </description>
7659         </param>
7660         <param id="classes">
7661           <inbuf incount="class_count"><jclass/></inbuf>
7662           <description>
7663             The array of classes to be retransformed.
7664           </description>
7665         </param>
7666       </parameters>
7667       <errors>
7668         <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7669           One of the <paramlink id="classes"/> cannot be modified.
7670           See <functionlink id="IsModifiableClass"/>.
7671         </error>
7672         <error id="JVMTI_ERROR_INVALID_CLASS">
7673           One of the <paramlink id="classes"/> is not a valid class.
7674         </error>
7675         <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7676           A retransformed class file has a version number not supported by this VM.
7677         </error>
7678         <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7679           A retransformed class file is malformed (The VM would return a <code>ClassFormatError</code>).
7680         </error>
7681         <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7682           The retransformed class file definitions would lead to a circular definition
7683           (the VM would return a <code>ClassCircularityError</code>).
7684         </error>
7685         <error id="JVMTI_ERROR_FAILS_VERIFICATION">
7686           The retransformed class file bytes fail verification.
7687         </error>
7688         <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7689           The class name defined in a retransformed class file is
7690           different from the name in the old class object.
7691         </error>
7692         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7693           A retransformed class file would require adding a method.
7694         </error>
7695         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7696           A retransformed class file changes a field.
7697         </error>
7698         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7699           A direct superclass is different for a retransformed class file,
7700           or the set of directly implemented
7701           interfaces is different.
7702         </error>
7703         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7704           A retransformed class file does not declare a method
7705           declared in the old class version.
7706         </error>
7707         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7708           A retransformed class file has different class modifiers.
7709         </error>
7710         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7711           A method in the retransformed class file has different modifiers
7712           than its counterpart in the old class version.
7713         </error>
7714       </errors>
7715     </function>
7716 
7717     <function id="RedefineClasses" jkernel="yes" num="87">
7718       <synopsis>Redefine Classes</synopsis>
7719       <typedef id="jvmtiClassDefinition" label="Class redefinition description">
7720         <field id="klass">
7721           <jclass/>
7722             <description>
7723               Class object for this class
7724             </description>
7725         </field>
7726         <field id="class_byte_count">
7727           <jint/>
7728           <description>
7729             Number of bytes defining class (below)
7730           </description>
7731         </field>
7732         <field id="class_bytes">
7733           <inbuf incount="class_byte_count"><uchar/></inbuf>
7734           <description>
7735             Bytes defining class (in <vmspec chapter="4"/>)
7736           </description>
7737         </field>
7738       </typedef>
7739       <description>
7740         All classes given are redefined according to the definitions
7741         supplied.
7742         This function is used to replace the definition of a class
7743         with a new definition, as might be needed in fix-and-continue
7744         debugging.
7745         Where the existing class file bytes are to be transformed, for
7746         example in
7747         <internallink id="bci">bytecode instrumentation</internallink>,
7748         <functionlink id="RetransformClasses"/> should be used.
7749         <p/>
7750         Redefinition can cause new versions of methods to be installed.
7751         Old method versions may become
7752         <internallink id="obsoleteMethods">obsolete</internallink>
7753         The new method version will be used on new invokes.
7754         If a method has active stack frames, those active frames continue to
7755         run the bytecodes of the original method version.
7756         If resetting of stack frames is desired, use
7757         <functionlink id="PopFrame"></functionlink>
7758         to pop frames with obsolete method versions.
7759         <p/>
7760         This function does not cause any initialization except that which
7761         would occur under the customary JVM semantics.
7762         In other words, redefining a class does not cause its initializers to be
7763         run. The values of static fields will remain as they were
7764         prior to the call.
7765         <p/>
7766         Threads need not be suspended.
7767         <p/>
7768         All breakpoints in the class are cleared.
7769         <p/>
7770         All attributes are updated.
7771         <p/>
7772         Instances of the redefined class are not affected -- fields retain their
7773         previous values.
7774         <functionlink id="GetTag">Tags</functionlink> on the instances are
7775         also unaffected.
7776         <p/>
7777         In response to this call, the <jvmti/> event
7778         <eventlink id="ClassFileLoadHook">Class File Load Hook</eventlink>
7779         will be sent (if enabled), but no other <jvmti/> events will be sent.
7780         <p/>
7781         The redefinition may change method bodies, the constant pool and attributes.
7782         The redefinition must not add, remove or rename fields or methods, change the
7783         signatures of methods, change modifiers, or change inheritance.
7784         These restrictions may be lifted in future versions.
7785         See the error return description below for information on error codes
7786         returned if an unsupported redefinition is attempted.
7787         The class file bytes are not verified or installed until they have passed
7788         through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7789         returned error code reflects the result of the transformations applied
7790         to the bytes passed into <paramlink id="class_definitions"/>.
7791         If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7792         none of the classes to be redefined will have a new definition installed.
7793         When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7794         all of the classes to be redefined will have their new definitions installed.
7795       </description>
7796       <origin>jvmdi</origin>
7797       <capabilities>
7798         <required id="can_redefine_classes"></required>
7799         <capability id="can_redefine_any_class"></capability>
7800       </capabilities>
7801       <parameters>
7802         <param id="class_count">
7803           <jint min="0"/>
7804           <description>
7805             The number of classes specified in <code>class_definitions</code>
7806           </description>
7807         </param>
7808         <param id="class_definitions">
7809           <inbuf incount="class_count"><struct>jvmtiClassDefinition</struct></inbuf>
7810           <description>
7811             The array of new class definitions
7812           </description>
7813         </param>
7814       </parameters>
7815       <errors>
7816         <error id="JVMTI_ERROR_NULL_POINTER">
7817           One of <code>class_bytes</code> is <code>NULL</code>.
7818         </error>
7819         <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7820           An element of <code>class_definitions</code> cannot be modified.
7821           See <functionlink id="IsModifiableClass"/>.
7822         </error>
7823         <error id="JVMTI_ERROR_INVALID_CLASS">
7824           An element of <code>class_definitions</code> is not a valid class.
7825         </error>
7826         <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7827           A new class file has a version number not supported by this VM.
7828         </error>
7829         <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7830           A new class file is malformed (The VM would return a <code>ClassFormatError</code>).
7831         </error>
7832         <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7833           The new class file definitions would lead to a circular definition
7834           (the VM would return a <code>ClassCircularityError</code>).
7835         </error>
7836         <error id="JVMTI_ERROR_FAILS_VERIFICATION">
7837           The class bytes fail verification.
7838         </error>
7839         <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7840           The class name defined in a new class file is
7841           different from the name in the old class object.
7842         </error>
7843         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7844           A new class file would require adding a method.
7845         </error>
7846         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7847           A new class version changes a field.
7848         </error>
7849         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7850           A direct superclass is different for a new class
7851           version, or the set of directly implemented
7852           interfaces is different.
7853         </error>
7854         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7855           A new class version does not declare a method
7856           declared in the old class version.
7857         </error>
7858         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7859           A new class version has different modifiers.
7860         </error>
7861         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7862           A method in the new class version has different modifiers
7863           than its counterpart in the old class version.
7864         </error>
7865         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
7866           A module cannot be modified.
7867           See <functionlink id="IsModifiableModule"/>.
7868         </error>
7869       </errors>
7870     </function>
7871 
7872   </category>
7873 
7874   <category id="object" label="Object">
7875 
7876     <function id="GetObjectSize" jkernel="yes" phase="start" num="154">
7877       <synopsis>Get Object Size</synopsis>
7878       <description>
7879         For the object indicated by <code>object</code>,
7880         return via <code>size_ptr</code> the size of the object.
7881         This size is an implementation-specific approximation of
7882         the amount of storage consumed by this object.
7883         It may include some or all of the object's overhead, and thus
7884         is useful for comparison within an implementation but not
7885         between implementations.
7886         The estimate may change during a single invocation of the JVM.
7887       </description>
7888       <origin>new</origin>
7889       <capabilities>
7890       </capabilities>
7891       <parameters>
7892         <param id="object">
7893           <jobject/>
7894             <description>
7895               The object to query.
7896             </description>
7897         </param>
7898         <param id="size_ptr">
7899           <outptr><jlong/></outptr>
7900           <description>
7901             On return, points to the object's size in bytes.
7902           </description>
7903         </param>
7904       </parameters>
7905       <errors>
7906       </errors>
7907     </function>
7908 
7909     <function id="GetObjectHashCode" phase="start" num="58">
7910       <synopsis>Get Object Hash Code</synopsis>
7911       <description>
7912         For the object indicated by <code>object</code>,
7913         return via <code>hash_code_ptr</code> a hash code.
7914         This hash code could be used to maintain a hash table of object references,
7915         however, on some implementations this can cause significant performance
7916         impacts--in most cases
7917         <internallink id="Heap">tags</internallink>
7918         will be a more efficient means of associating information with objects.
7919         This function guarantees
7920         the same hash code value for a particular object throughout its life
7921       </description>
7922       <origin>jvmdi</origin>
7923       <capabilities>
7924       </capabilities>
7925       <parameters>
7926         <param id="object">
7927           <jobject/>
7928             <description>
7929               The object to query.
7930             </description>
7931         </param>
7932         <param id="hash_code_ptr">
7933           <outptr><jint/></outptr>
7934           <description>
7935             On return, points to the object's hash code.
7936           </description>
7937         </param>
7938       </parameters>
7939       <errors>
7940       </errors>
7941     </function>
7942 
7943     <function id="GetObjectMonitorUsage" num="59">
7944       <synopsis>Get Object Monitor Usage</synopsis>
7945       <typedef id="jvmtiMonitorUsage" label="Object monitor usage information">
7946         <field id="owner">
7947           <jthread/>
7948             <description>
7949               The thread owning this monitor, or <code>NULL</code> if unused
7950             </description>
7951         </field>
7952         <field id="entry_count">
7953           <jint/>
7954           <description>
7955             The number of times the owning thread has entered the monitor
7956           </description>
7957         </field>
7958         <field id="waiter_count">
7959           <jint/>
7960           <description>
7961             The number of threads waiting to own this monitor
7962           </description>
7963         </field>
7964         <field id="waiters">
7965           <allocfieldbuf><jthread/></allocfieldbuf>
7966             <description>
7967               The <code>waiter_count</code> waiting threads
7968             </description>
7969         </field>
7970         <field id="notify_waiter_count">
7971           <jint/>
7972           <description>
7973             The number of threads waiting to be notified by this monitor
7974           </description>
7975         </field>
7976         <field id="notify_waiters">
7977           <allocfieldbuf><jthread/></allocfieldbuf>
7978             <description>
7979               The <code>notify_waiter_count</code> threads waiting to be notified
7980             </description>
7981         </field>
7982       </typedef>
7983       <description>
7984         Get information about the object's monitor.
7985         The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure
7986         are filled in with information about usage of the monitor.
7987           <todo>
7988             Decide and then clarify suspend requirements.
7989           </todo>
7990       </description>
7991       <origin>jvmdi</origin>
7992       <capabilities>
7993         <required id="can_get_monitor_info"></required>
7994       </capabilities>
7995       <parameters>
7996         <param id="object">
7997           <jobject/>
7998             <description>
7999               The object to query.
8000             </description>
8001         </param>
8002         <param id="info_ptr">
8003           <outptr><struct>jvmtiMonitorUsage</struct></outptr>
8004           <description>
8005             On return, filled with monitor information for the
8006             specified object.
8007           </description>
8008         </param>
8009       </parameters>
8010       <errors>
8011       </errors>
8012     </function>
8013 
8014     <elide>
8015     <function id="GetObjectMonitors" num="116">
8016       <synopsis>Get Object Monitors</synopsis>
8017       <description>
8018         Return the list of object monitors.
8019         <p/>
8020         Note: details about each monitor can be examined with
8021         <functionlink id="GetObjectMonitorUsage"></functionlink>.
8022       </description>
8023       <origin>new</origin>
8024       <capabilities>
8025         <required id="can_get_monitor_info"></required>
8026       </capabilities>
8027       <parameters>
8028         <param id="monitorCnt">
8029           <outptr><jint/></outptr>
8030           <description>
8031             On return, pointer to the number
8032             of monitors returned in <code>monitors_ptr</code>.
8033           </description>
8034         </param>
8035         <param id="monitors_ptr">
8036           <allocbuf outcount="monitorCnt"><jobject/></allocbuf>
8037             <description>
8038               On return, pointer to the monitor list.
8039             </description>
8040         </param>
8041       </parameters>
8042       <errors>
8043       </errors>
8044     </function>
8045     </elide>
8046 
8047   </category>
8048 
8049   <category id="fieldCategory" label="Field">
8050 
8051     <intro>
8052     </intro>
8053 
8054     <function id="GetFieldName" phase="start" num="60">
8055       <synopsis>Get Field Name (and Signature)</synopsis>
8056       <description>
8057         For the field indicated by <paramlink id="klass"/> and <paramlink id="field"/>,
8058         return the field name via <paramlink id="name_ptr"/> and field signature via
8059         <paramlink id="signature_ptr"/>.
8060         <p/>
8061         Field signatures are defined in the
8062         <externallink id="jni/index.html">JNI Specification</externallink>
8063         and are referred to as <code>field descriptors</code> in
8064         <vmspec chapter="4.3.2"/>.
8065       </description>
8066       <origin>jvmdiClone</origin>
8067       <capabilities>
8068       </capabilities>
8069       <parameters>
8070         <param id="klass">
8071           <jclass field="field"/>
8072             <description>
8073               The class of the field to query.
8074             </description>
8075         </param>
8076         <param id="field">
8077           <jfieldID class="klass"/>
8078             <description>
8079               The field to query.
8080             </description>
8081         </param>
8082         <param id="name_ptr">
8083           <allocbuf>
8084             <char/>
8085             <nullok>the name is not returned</nullok>
8086           </allocbuf>
8087           <description>
8088             On return, points to the field name, encoded as a
8089             <internallink id="mUTF">modified UTF-8</internallink> string.
8090           </description>
8091         </param>
8092         <param id="signature_ptr">
8093           <allocbuf>
8094             <char/>
8095             <nullok>the signature is not returned</nullok>
8096           </allocbuf>
8097           <description>
8098             On return, points to the field signature, encoded as a
8099             <internallink id="mUTF">modified UTF-8</internallink> string.
8100           </description>
8101         </param>
8102         <param id="generic_ptr">
8103           <allocbuf>
8104             <char/>
8105             <nullok>the generic signature is not returned</nullok>
8106           </allocbuf>
8107           <description>
8108             On return, points to the generic signature of the field, encoded as a
8109             <internallink id="mUTF">modified UTF-8</internallink> string.
8110             If there is no generic signature attribute for the field, then,
8111             on return, points to <code>NULL</code>.
8112           </description>
8113         </param>
8114       </parameters>
8115       <errors>
8116       </errors>
8117     </function>
8118 
8119     <function id="GetFieldDeclaringClass" phase="start" num="61">
8120       <synopsis>Get Field Declaring Class</synopsis>
8121       <description>
8122         For the field indicated by <code>klass</code> and <code>field</code>
8123         return the class that defined it via <code>declaring_class_ptr</code>.
8124         The declaring class will either be <code>klass</code>, a superclass, or
8125         an implemented interface.
8126       </description>
8127       <origin>jvmdi</origin>
8128       <capabilities>
8129       </capabilities>
8130       <parameters>
8131         <param id="klass">
8132           <jclass field="field"/>
8133             <description>
8134               The class to query.
8135             </description>
8136         </param>
8137         <param id="field">
8138           <jfieldID class="klass"/>
8139             <description>
8140               The field to query.
8141             </description>
8142         </param>
8143         <param id="declaring_class_ptr">
8144           <outptr><jclass/></outptr>
8145             <description>
8146               On return, points to the declaring class
8147             </description>
8148         </param>
8149       </parameters>
8150       <errors>
8151       </errors>
8152     </function>
8153 
8154     <function id="GetFieldModifiers" phase="start" num="62">
8155       <synopsis>Get Field Modifiers</synopsis>
8156       <description>
8157         For the field indicated by <code>klass</code> and <code>field</code>
8158         return the access flags via <code>modifiers_ptr</code>.
8159         Access flags are defined in <vmspec chapter="4"/>.
8160       </description>
8161       <origin>jvmdi</origin>
8162       <capabilities>
8163       </capabilities>
8164       <parameters>
8165         <param id="klass">
8166           <jclass field="field"/>
8167             <description>
8168               The class to query.
8169             </description>
8170         </param>
8171         <param id="field">
8172           <jfieldID class="klass"/>
8173             <description>
8174               The field to query.
8175             </description>
8176         </param>
8177         <param id="modifiers_ptr">
8178           <outptr><jint/></outptr>
8179           <description>
8180             On return, points to the access flags.
8181           </description>
8182         </param>
8183       </parameters>
8184       <errors>
8185       </errors>
8186     </function>
8187 
8188     <function id="IsFieldSynthetic" phase="start" num="63">
8189       <synopsis>Is Field Synthetic</synopsis>
8190       <description>
8191         For the field indicated by <code>klass</code> and <code>field</code>, return a
8192         value indicating whether the field is synthetic via <code>is_synthetic_ptr</code>.
8193         Synthetic fields are generated by the compiler but not present in the
8194         original source code.
8195       </description>
8196       <origin>jvmdi</origin>
8197       <capabilities>
8198         <required id="can_get_synthetic_attribute"></required>
8199       </capabilities>
8200       <parameters>
8201         <param id="klass">
8202           <jclass field="field"/>
8203             <description>
8204               The class of the field to query.
8205             </description>
8206         </param>
8207         <param id="field">
8208           <jfieldID class="klass"/>
8209             <description>
8210               The field to query.
8211             </description>
8212         </param>
8213         <param id="is_synthetic_ptr">
8214           <outptr><jboolean/></outptr>
8215           <description>
8216             On return, points to the boolean result of this function.
8217           </description>
8218         </param>
8219       </parameters>
8220       <errors>
8221       </errors>
8222     </function>
8223 
8224   </category>
8225 
8226   <category id="method" label="Method">
8227 
8228     <intro>
8229       These functions provide information about a method (represented as a
8230       <typelink id="jmethodID"/>) and set how methods are processed.
8231     </intro>
8232 
8233     <intro id="obsoleteMethods" label="Obsolete Methods">
8234       The functions <functionlink id="RetransformClasses"/> and
8235       <functionlink id="RedefineClasses"/> can cause new versions
8236       of methods to be installed.
8237       An original version of a method is considered equivalent
8238       to the new version if:
8239       <ul>
8240         <li>their bytecodes are the same except for indices into the
8241           constant pool and </li>
8242         <li>the referenced constants are equal.</li>
8243       </ul>
8244       An original method version which is not equivalent to the
8245       new method version is called obsolete and is assigned a new method ID;
8246       the original method ID now refers to the new method version.
8247       A method ID can be tested for obsolescence with
8248       <functionlink id="IsMethodObsolete"/>.
8249     </intro>
8250 
8251     <function id="GetMethodName" phase="start" num="64">
8252       <synopsis>Get Method Name (and Signature)</synopsis>
8253       <description>
8254         For the method indicated by <code>method</code>,
8255         return the method name via <code>name_ptr</code> and method signature via
8256         <code>signature_ptr</code>.
8257         <p/>
8258         Method signatures are defined in the
8259         <externallink id="jni/index.html">JNI Specification</externallink>
8260         and are referred to as <code>method descriptors</code> in
8261         <vmspec chapter="4.3.3"/>.
8262         Note this is different
8263         than method signatures as defined in the <i>Java Language Specification</i>.
8264       </description>
8265       <origin>jvmdiClone</origin>
8266       <capabilities>
8267       </capabilities>
8268       <parameters>
8269         <param id="method">
8270           <jmethodID/>
8271             <description>
8272               The method to query.
8273             </description>
8274         </param>
8275         <param id="name_ptr">
8276           <allocbuf>
8277             <char/>
8278             <nullok>the name is not returned</nullok>
8279           </allocbuf>
8280           <description>
8281             On return, points to the method name, encoded as a
8282             <internallink id="mUTF">modified UTF-8</internallink> string.
8283           </description>
8284         </param>
8285         <param id="signature_ptr">
8286           <allocbuf>
8287             <char/>
8288             <nullok>the signature is not returned</nullok>
8289           </allocbuf>
8290           <description>
8291             On return, points to the method signature, encoded as a
8292             <internallink id="mUTF">modified UTF-8</internallink> string.
8293           </description>
8294         </param>
8295         <param id="generic_ptr">
8296           <allocbuf>
8297             <char/>
8298             <nullok>the generic signature is not returned</nullok>
8299           </allocbuf>
8300           <description>
8301             On return, points to the generic signature of the method, encoded as a
8302             <internallink id="mUTF">modified UTF-8</internallink> string.
8303             If there is no generic signature attribute for the method, then,
8304             on return, points to <code>NULL</code>.
8305           </description>
8306         </param>
8307       </parameters>
8308       <errors>
8309       </errors>
8310     </function>
8311 
8312     <function id="GetMethodDeclaringClass" phase="start" num="65">
8313       <synopsis>Get Method Declaring Class</synopsis>
8314       <description>
8315         For the method indicated by <code>method</code>,
8316         return the class that defined it via <code>declaring_class_ptr</code>.
8317       </description>
8318       <origin>jvmdi</origin>
8319       <capabilities>
8320       </capabilities>
8321       <parameters>
8322         <param id="klass">
8323           <jclass method="method"/>
8324             <description>
8325               The class to query.
8326             </description>
8327         </param>
8328         <param id="method">
8329           <jmethodID class="klass"/>
8330             <description>
8331               The method to query.
8332             </description>
8333         </param>
8334         <param id="declaring_class_ptr">
8335           <outptr><jclass/></outptr>
8336             <description>
8337               On return, points to the declaring class
8338             </description>
8339         </param>
8340       </parameters>
8341       <errors>
8342       </errors>
8343     </function>
8344 
8345     <function id="GetMethodModifiers" phase="start" num="66">
8346       <synopsis>Get Method Modifiers</synopsis>
8347       <description>
8348         For the method indicated by <code>method</code>,
8349         return the access flags via <code>modifiers_ptr</code>.
8350         Access flags are defined in <vmspec chapter="4"/>.
8351       </description>
8352       <origin>jvmdi</origin>
8353       <capabilities>
8354       </capabilities>
8355       <parameters>
8356         <param id="klass">
8357           <jclass method="method"/>
8358             <description>
8359               The class to query.
8360             </description>
8361         </param>
8362         <param id="method">
8363           <jmethodID class="klass"/>
8364             <description>
8365               The method to query.
8366             </description>
8367         </param>
8368         <param id="modifiers_ptr">
8369           <outptr><jint/></outptr>
8370           <description>
8371             On return, points to the access flags.
8372           </description>
8373         </param>
8374       </parameters>
8375       <errors>
8376       </errors>
8377     </function>
8378 
8379     <function id="GetMaxLocals" phase="start" num="68">
8380       <synopsis>Get Max Locals</synopsis>
8381       <description>
8382           For the method indicated by <code>method</code>,
8383           return the number of local variable slots used by the method,
8384           including the local variables used to pass parameters to the
8385           method on its invocation.
8386           <p/>
8387           See <code>max_locals</code> in <vmspec chapter="4.7.3"/>.
8388       </description>
8389       <origin>jvmdi</origin>
8390       <capabilities>
8391       </capabilities>
8392       <parameters>
8393         <param id="klass">
8394           <jclass method="method"/>
8395             <description>
8396               The class to query.
8397             </description>
8398         </param>
8399         <param id="method">
8400           <jmethodID class="klass" native="error"/>
8401             <description>
8402               The method to query.
8403             </description>
8404         </param>
8405         <param id="max_ptr">
8406           <outptr><jint/></outptr>
8407           <description>
8408             On return, points to the maximum number of local slots
8409           </description>
8410         </param>
8411       </parameters>
8412       <errors>
8413       </errors>
8414     </function>
8415 
8416     <function id="GetArgumentsSize" phase="start" num="69">
8417       <synopsis>Get Arguments Size</synopsis>
8418       <description>
8419         For the method indicated by <code>method</code>,
8420         return via <code>max_ptr</code> the number of local variable slots used
8421         by the method's arguments.
8422         Note that two-word arguments use two slots.
8423       </description>
8424       <origin>jvmdi</origin>
8425       <capabilities>
8426       </capabilities>
8427       <parameters>
8428         <param id="klass">
8429           <jclass method="method"/>
8430             <description>
8431               The class to query.
8432             </description>
8433         </param>
8434         <param id="method">
8435           <jmethodID class="klass" native="error"/>
8436             <description>
8437               The method to query.
8438             </description>
8439         </param>
8440         <param id="size_ptr">
8441           <outptr><jint/></outptr>
8442           <description>
8443             On return, points to the number of argument slots
8444           </description>
8445         </param>
8446       </parameters>
8447       <errors>
8448       </errors>
8449     </function>
8450 
8451     <function id="GetLineNumberTable" phase="start" num="70">
8452       <synopsis>Get Line Number Table</synopsis>
8453       <typedef id="jvmtiLineNumberEntry" label="Line number table entry">
8454         <field id="start_location">
8455           <jlocation/>
8456           <description>
8457             the <datalink id="jlocation"></datalink> where the line begins
8458           </description>
8459         </field>
8460         <field id="line_number">
8461           <jint/>
8462           <description>
8463             the line number
8464           </description>
8465         </field>
8466       </typedef>
8467       <description>
8468         For the method indicated by <code>method</code>,
8469         return a table of source line number entries. The size of the table is
8470         returned via <code>entry_count_ptr</code> and the table itself is
8471         returned via <code>table_ptr</code>.
8472       </description>
8473       <origin>jvmdi</origin>
8474       <capabilities>
8475         <required id="can_get_line_numbers"></required>
8476       </capabilities>
8477       <parameters>
8478         <param id="klass">
8479           <jclass method="method"/>
8480             <description>
8481               The class to query.
8482             </description>
8483         </param>
8484         <param id="method">
8485           <jmethodID class="klass" native="error"/>
8486             <description>
8487               The method to query.
8488             </description>
8489         </param>
8490         <param id="entry_count_ptr">
8491           <outptr><jint/></outptr>
8492           <description>
8493             On return, points to the number of entries in the table
8494           </description>
8495         </param>
8496         <param id="table_ptr">
8497           <allocbuf outcount="entry_count_ptr"><struct>jvmtiLineNumberEntry</struct></allocbuf>
8498           <description>
8499             On return, points to the line number table pointer.
8500           </description>
8501         </param>
8502       </parameters>
8503       <errors>
8504         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8505           Class information does not include line numbers.
8506         </error>
8507       </errors>
8508     </function>
8509 
8510     <function id="GetMethodLocation" phase="start" num="71">
8511       <synopsis>Get Method Location</synopsis>
8512       <description>
8513         For the method indicated by <code>method</code>,
8514         return the beginning and ending addresses through
8515         <code>start_location_ptr</code> and <code>end_location_ptr</code>. In a
8516         conventional byte code indexing scheme,
8517         <code>start_location_ptr</code> will always point to zero
8518         and <code>end_location_ptr</code>
8519         will always point to the byte code count minus one.
8520       </description>
8521       <origin>jvmdi</origin>
8522       <capabilities>
8523       </capabilities>
8524       <parameters>
8525         <param id="klass">
8526           <jclass method="method"/>
8527             <description>
8528               The class to query.
8529             </description>
8530         </param>
8531         <param id="method">
8532           <jmethodID class="klass" native="error"/>
8533             <description>
8534               The method to query.
8535             </description>
8536         </param>
8537         <param id="start_location_ptr">
8538           <outptr><jlocation/></outptr>
8539           <description>
8540             On return, points to the first location, or
8541             <code>-1</code> if location information is not available.
8542             If the information is available and
8543             <functionlink id="GetJLocationFormat"></functionlink>
8544             returns <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>
8545             then this will always be zero.
8546           </description>
8547         </param>
8548         <param id="end_location_ptr">
8549           <outptr><jlocation/></outptr>
8550           <description>
8551             On return, points to the last location,
8552             or <code>-1</code> if location information is not available.
8553           </description>
8554         </param>
8555       </parameters>
8556       <errors>
8557         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8558           Class information does not include method sizes.
8559         </error>
8560       </errors>
8561     </function>
8562 
8563     <function id="GetLocalVariableTable" num="72">
8564       <synopsis>Get Local Variable Table</synopsis>
8565       <typedef id="jvmtiLocalVariableEntry" label="Local variable table entry">
8566         <field id="start_location">
8567           <jlocation/>
8568           <description>
8569             The code array index where the local variable is first valid
8570             (that is, where it must have a value).
8571           </description>
8572         </field>
8573         <field id="length">
8574           <jint/>
8575           <description>
8576             The length of the valid section for this local variable.
8577             The last code array index where the local variable is valid
8578             is <code>start_location + length</code>.
8579           </description>
8580         </field>
8581         <field id="name">
8582           <allocfieldbuf><char/></allocfieldbuf>
8583           <description>
8584             The local variable name, encoded as a
8585             <internallink id="mUTF">modified UTF-8</internallink> string.
8586           </description>
8587         </field>
8588         <field id="signature">
8589           <allocfieldbuf><char/></allocfieldbuf>
8590           <description>
8591             The local variable's type signature, encoded as a
8592             <internallink id="mUTF">modified UTF-8</internallink> string.
8593             The signature format is the same as that defined in
8594             <vmspec chapter="4.3.2"/>.
8595           </description>
8596         </field>
8597         <field id="generic_signature">
8598           <allocfieldbuf><char/></allocfieldbuf>
8599           <description>
8600             The local variable's generic signature, encoded as a
8601             <internallink id="mUTF">modified UTF-8</internallink> string.
8602             The value of this field will be <code>NULL</code> for any local
8603             variable which does not have a generic type.
8604           </description>
8605         </field>
8606         <field id="slot">
8607           <jint/>
8608           <description>
8609             The local variable's slot.  See <internallink id="local">Local Variables</internallink>.
8610           </description>
8611         </field>
8612       </typedef>
8613       <description>
8614         Return local variable information.
8615       </description>
8616       <origin>jvmdiClone</origin>
8617       <capabilities>
8618         <required id="can_access_local_variables"></required>
8619       </capabilities>
8620       <parameters>
8621         <param id="method">
8622           <jmethodID native="error"/>
8623             <description>
8624               The method to query.
8625             </description>
8626         </param>
8627         <param id="entry_count_ptr">
8628           <outptr><jint/></outptr>
8629           <description>
8630             On return, points to the number of entries in the table
8631           </description>
8632         </param>
8633         <param id="table_ptr">
8634           <allocbuf outcount="entry_count_ptr"><struct>jvmtiLocalVariableEntry</struct></allocbuf>
8635           <description>
8636             On return, points to an array of local variable table entries.
8637           </description>
8638         </param>
8639       </parameters>
8640       <errors>
8641         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8642           Class information does not include local variable
8643           information.
8644         </error>
8645       </errors>
8646     </function>
8647 
8648     <function id="GetBytecodes" phase="start" num="75">
8649       <synopsis>Get Bytecodes</synopsis>
8650       <description>
8651         For the method indicated by <code>method</code>,
8652         return the byte codes that implement the method. The number of
8653         bytecodes is returned via <code>bytecode_count_ptr</code>. The byte codes
8654         themselves are returned via <code>bytecodes_ptr</code>.
8655       </description>
8656       <origin>jvmdi</origin>
8657       <capabilities>
8658         <required id="can_get_bytecodes"></required>
8659       </capabilities>
8660       <parameters>
8661         <param id="klass">
8662           <jclass method="method"/>
8663             <description>
8664               The class to query.
8665             </description>
8666         </param>
8667         <param id="method">
8668           <jmethodID class="klass" native="error"/>
8669             <description>
8670               The method to query.
8671             </description>
8672         </param>
8673         <param id="bytecode_count_ptr">
8674           <outptr><jint/></outptr>
8675           <description>
8676             On return, points to the length of the byte code array
8677           </description>
8678         </param>
8679         <param id="bytecodes_ptr">
8680           <allocbuf outcount="bytecode_count_ptr"><uchar/></allocbuf>
8681           <description>
8682             On return, points to the pointer to the byte code array
8683           </description>
8684         </param>
8685       </parameters>
8686       <errors>
8687       </errors>
8688     </function>
8689 
8690     <function id="IsMethodNative" phase="start" num="76">
8691       <synopsis>Is Method Native</synopsis>
8692       <description>
8693         For the method indicated by <code>method</code>, return a
8694         value indicating whether the method is native via <code>is_native_ptr</code>
8695       </description>
8696       <origin>jvmdi</origin>
8697       <capabilities>
8698       </capabilities>
8699       <parameters>
8700         <param id="klass">
8701           <jclass method="method"/>
8702             <description>
8703               The class to query.
8704             </description>
8705         </param>
8706         <param id="method">
8707           <jmethodID class="klass"/>
8708             <description>
8709               The method to query.
8710             </description>
8711         </param>
8712         <param id="is_native_ptr">
8713           <outptr><jboolean/></outptr>
8714           <description>
8715             On return, points to the boolean result of this function.
8716           </description>
8717         </param>
8718       </parameters>
8719       <errors>
8720       </errors>
8721     </function>
8722 
8723     <function id="IsMethodSynthetic" phase="start" num="77">
8724       <synopsis>Is Method Synthetic</synopsis>
8725       <description>
8726         For the method indicated by <code>method</code>, return a
8727         value indicating whether the method is synthetic via <code>is_synthetic_ptr</code>.
8728         Synthetic methods are generated by the compiler but not present in the
8729         original source code.
8730       </description>
8731       <origin>jvmdi</origin>
8732       <capabilities>
8733         <required id="can_get_synthetic_attribute"></required>
8734       </capabilities>
8735       <parameters>
8736         <param id="klass">
8737           <jclass method="method"/>
8738             <description>
8739               The class to query.
8740             </description>
8741         </param>
8742         <param id="method">
8743           <jmethodID class="klass"/>
8744             <description>
8745               The method to query.
8746             </description>
8747         </param>
8748         <param id="is_synthetic_ptr">
8749           <outptr><jboolean/></outptr>
8750           <description>
8751             On return, points to the boolean result of this function.
8752           </description>
8753         </param>
8754       </parameters>
8755       <errors>
8756       </errors>
8757     </function>
8758 
8759     <function id="IsMethodObsolete" phase="start" num="91">
8760       <synopsis>Is Method Obsolete</synopsis>
8761       <description>
8762         Determine if a method ID refers to an
8763         <internallink id="obsoleteMethods">obsolete</internallink>
8764         method version.
8765       </description>
8766       <origin>jvmdi</origin>
8767       <capabilities>
8768       </capabilities>
8769       <parameters>
8770         <param id="klass">
8771           <jclass method="method"/>
8772             <description>
8773               The class to query.
8774             </description>
8775         </param>
8776         <param id="method">
8777           <jmethodID class="klass"/>
8778             <description>
8779               The method ID to query.
8780             </description>
8781         </param>
8782         <param id="is_obsolete_ptr">
8783           <outptr><jboolean/></outptr>
8784           <description>
8785             On return, points to the boolean result of this function.
8786           </description>
8787         </param>
8788       </parameters>
8789       <errors>
8790       </errors>
8791     </function>
8792 
8793     <function id="SetNativeMethodPrefix" jkernel="yes" phase="any" num="73" since="1.1">
8794       <synopsis>Set Native Method Prefix</synopsis>
8795       <description>
8796         This function modifies the failure handling of
8797         native method resolution by allowing retry
8798         with a prefix applied to the name.
8799         When used with the
8800         <eventlink id="ClassFileLoadHook">ClassFileLoadHook
8801         event</eventlink>, it enables native methods to be
8802         <internallink id="bci">instrumented</internallink>.
8803         <p/>
8804         Since native methods cannot be directly instrumented
8805         (they have no bytecodes), they must be wrapped with
8806         a non-native method which can be instrumented.
8807         For example, if we had:
8808         <example>
8809 native boolean foo(int x);</example>
8810         <p/>
8811         We could transform the class file (with the
8812         ClassFileLoadHook event) so that this becomes:
8813         <example>
8814 boolean foo(int x) {
8815   <i>... record entry to foo ...</i>
8816   return wrapped_foo(x);
8817 }
8818 
8819 native boolean wrapped_foo(int x);</example>
8820         <p/>
8821         Where foo becomes a wrapper for the actual native method
8822         with the appended prefix "wrapped_".  Note that
8823         "wrapped_" would be a poor choice of prefix since it
8824         might conceivably form the name of an existing method
8825         thus something like "$$$MyAgentWrapped$$$_" would be
8826         better but would make these examples less readable.
8827         <p/>
8828         The wrapper will allow data to be collected on the native
8829         method call, but now the problem becomes linking up the
8830         wrapped method with the native implementation.
8831         That is, the method <code>wrapped_foo</code> needs to be
8832         resolved to the native implementation of <code>foo</code>,
8833         which might be:
8834         <example>
8835 Java_somePackage_someClass_foo(JNIEnv* env, jint x)</example>
8836         <p/>
8837         This function allows the prefix to be specified and the
8838         proper resolution to occur.
8839         Specifically, when the standard resolution fails, the
8840         resolution is retried taking the prefix into consideration.
8841         There are two ways that resolution occurs, explicit
8842         resolution with the JNI function <code>RegisterNatives</code>
8843         and the normal automatic resolution.  For
8844         <code>RegisterNatives</code>, the VM will attempt this
8845         association:
8846         <example>
8847 method(foo) -> nativeImplementation(foo)</example>
8848         <p/>
8849         When this fails, the resolution will be retried with
8850         the specified prefix prepended to the method name,
8851         yielding the correct resolution:
8852         <example>
8853 method(wrapped_foo) -> nativeImplementation(foo)</example>
8854         <p/>
8855         For automatic resolution, the VM will attempt:
8856         <example>
8857 method(wrapped_foo) -> nativeImplementation(wrapped_foo)</example>
8858         <p/>
8859         When this fails, the resolution will be retried with
8860         the specified prefix deleted from the implementation name,
8861         yielding the correct resolution:
8862         <example>
8863 method(wrapped_foo) -> nativeImplementation(foo)</example>
8864         <p/>
8865         Note that since the prefix is only used when standard
8866         resolution fails, native methods can be wrapped selectively.
8867         <p/>
8868         Since each <jvmti/> environment is independent and
8869         can do its own transformation of the bytecodes, more
8870         than one layer of wrappers may be applied. Thus each
8871         environment needs its own prefix.  Since transformations
8872         are applied in order, the prefixes, if applied, will
8873         be applied in the same order.
8874         The order of transformation application is described in
8875         the <eventlink id="ClassFileLoadHook"/> event.
8876         Thus if three environments applied
8877         wrappers, <code>foo</code> might become
8878         <code>$env3_$env2_$env1_foo</code>.  But if, say,
8879         the second environment did not apply a wrapper to
8880         <code>foo</code> it would be just
8881         <code>$env3_$env1_foo</code>.  To be able to
8882         efficiently determine the sequence of prefixes,
8883         an intermediate prefix is only applied if its non-native
8884         wrapper exists.  Thus, in the last example, even though
8885         <code>$env1_foo</code> is not a native method, the
8886         <code>$env1_</code> prefix is applied since
8887         <code>$env1_foo</code> exists.
8888         <p/>
8889         Since the prefixes are used at resolution time
8890         and since resolution may be arbitrarily delayed, a
8891         native method prefix must remain set as long as there
8892         are corresponding prefixed native methods.
8893       </description>
8894       <origin>new</origin>
8895       <capabilities>
8896         <required id="can_set_native_method_prefix"></required>
8897       </capabilities>
8898       <parameters>
8899         <param id="prefix">
8900           <inbuf>
8901             <char/>
8902             <nullok>
8903               any existing prefix in this environment is cancelled
8904             </nullok>
8905           </inbuf>
8906           <description>
8907             The prefix to apply, encoded as a
8908             <internallink id="mUTF">modified UTF-8</internallink> string.
8909           </description>
8910         </param>
8911       </parameters>
8912       <errors>
8913       </errors>
8914     </function>
8915 
8916     <function id="SetNativeMethodPrefixes" jkernel="yes" phase="any" num="74" since="1.1">
8917       <synopsis>Set Native Method Prefixes</synopsis>
8918       <description>
8919          For a normal agent, <functionlink id="SetNativeMethodPrefix"/>
8920          will provide all needed native method prefixing.
8921          For a meta-agent that performs multiple independent class
8922          file transformations (for example as a proxy for another
8923          layer of agents) this function allows each transformation
8924          to have its own prefix.
8925          The prefixes are applied in the order supplied and are
8926          processed in the same manor as described for the
8927          application of prefixes from multiple <jvmti/> environments
8928          in <functionlink id="SetNativeMethodPrefix"/>.
8929          <p/>
8930          Any previous prefixes are replaced.  Thus, calling this
8931          function with a <paramlink id="prefix_count"/> of <code>0</code>
8932          disables prefixing in this environment.
8933          <p/>
8934          <functionlink id="SetNativeMethodPrefix"/> and this function
8935          are the two ways to set the prefixes.
8936          Calling <code>SetNativeMethodPrefix</code> with
8937          a prefix is the same as calling this function with
8938          <paramlink id="prefix_count"/> of <code>1</code>.
8939          Calling <code>SetNativeMethodPrefix</code> with
8940          <code>NULL</code> is the same as calling this function with
8941          <paramlink id="prefix_count"/> of <code>0</code>.
8942       </description>
8943       <origin>new</origin>
8944       <capabilities>
8945         <required id="can_set_native_method_prefix"></required>
8946       </capabilities>
8947       <parameters>
8948         <param id="prefix_count">
8949           <jint min="0"/>
8950             <description>
8951               The number of prefixes to apply.
8952             </description>
8953         </param>
8954         <param id="prefixes">
8955           <agentbuf>
8956             <char/>
8957           </agentbuf>
8958           <description>
8959             The prefixes to apply for this environment, each encoded as a
8960             <internallink id="mUTF">modified UTF-8</internallink> string.
8961           </description>
8962         </param>
8963       </parameters>
8964       <errors>
8965       </errors>
8966     </function>
8967 
8968   </category>
8969 
8970   <category id="RawMonitors" label="Raw Monitor">
8971 
8972     <function id="CreateRawMonitor" phase="onload" callbacksafe="safe" num="31">
8973       <synopsis>Create Raw Monitor</synopsis>
8974       <description>
8975         Create a raw monitor.
8976       </description>
8977       <origin>jvmdi</origin>
8978       <capabilities>
8979       </capabilities>
8980       <parameters>
8981         <param id="name">
8982           <inbuf><char/></inbuf>
8983           <description>
8984             A name to identify the monitor, encoded as a
8985             <internallink id="mUTF">modified UTF-8</internallink> string.
8986           </description>
8987         </param>
8988         <param id="monitor_ptr">
8989           <outptr><jrawMonitorID/></outptr>
8990           <description>
8991             On return, points to the created monitor.
8992           </description>
8993         </param>
8994       </parameters>
8995       <errors>
8996       </errors>
8997     </function>
8998 
8999     <function id="DestroyRawMonitor" phase="onload" callbacksafe="safe" num="32">
9000       <synopsis>Destroy Raw Monitor</synopsis>
9001       <description>
9002         Destroy the raw monitor.
9003         If the monitor being destroyed has been entered by this thread, it will be
9004         exited before it is destroyed.
9005         If the monitor being destroyed has been entered by another thread,
9006         an error will be returned and the monitor will not be destroyed.
9007       </description>
9008       <origin>jvmdi</origin>
9009       <capabilities>
9010       </capabilities>
9011       <parameters>
9012         <param id="monitor">
9013           <jrawMonitorID/>
9014           <description>
9015             The monitor
9016           </description>
9017         </param>
9018       </parameters>
9019       <errors>
9020         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9021           Not monitor owner
9022         </error>
9023       </errors>
9024     </function>
9025 
9026     <function id="RawMonitorEnter" phase="any" callbacksafe="safe" impl="innative notrace" num="33">
9027       <synopsis>Raw Monitor Enter</synopsis>
9028       <description>
9029         Gain exclusive ownership of a raw monitor.
9030         The same thread may enter a monitor more then once.
9031         The thread must
9032         <functionlink id="RawMonitorExit">exit</functionlink>
9033         the monitor the same number of times as it is entered.
9034         If a monitor is entered during <code>OnLoad</code> (before attached threads exist)
9035         and has not exited when attached threads come into existence, the enter
9036         is considered to have occurred on the main thread.
9037       </description>
9038       <origin>jvmdi</origin>
9039       <capabilities>
9040       </capabilities>
9041       <parameters>
9042         <param id="monitor">
9043           <jrawMonitorID/>
9044           <description>
9045             The monitor
9046           </description>
9047         </param>
9048       </parameters>
9049       <errors>
9050       </errors>
9051     </function>
9052 
9053     <function id="RawMonitorExit" phase="any" callbacksafe="safe" impl="innative notrace" num="34">
9054       <synopsis>Raw Monitor Exit</synopsis>
9055       <description>
9056         Release exclusive ownership of a raw monitor.
9057       </description>
9058       <origin>jvmdi</origin>
9059       <capabilities>
9060       </capabilities>
9061       <parameters>
9062         <param id="monitor">
9063           <jrawMonitorID/>
9064           <description>
9065             The monitor
9066           </description>
9067         </param>
9068       </parameters>
9069       <errors>
9070         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9071           Not monitor owner
9072         </error>
9073       </errors>
9074     </function>
9075 
9076     <function id="RawMonitorWait" phase="any" callbacksafe="safe" impl="innative notrace" num="35">
9077       <synopsis>Raw Monitor Wait</synopsis>
9078       <description>
9079         Wait for notification of the raw monitor.
9080         <p/>
9081         Causes the current thread to wait until either another thread calls
9082         <functionlink id="RawMonitorNotify"/> or
9083         <functionlink id="RawMonitorNotifyAll"/>
9084         for the specified raw monitor, or the specified
9085         <paramlink id="millis">timeout</paramlink>
9086         has elapsed.
9087       </description>
9088       <origin>jvmdi</origin>
9089       <capabilities>
9090       </capabilities>
9091       <parameters>
9092         <param id="monitor">
9093           <jrawMonitorID/>
9094           <description>
9095             The monitor
9096           </description>
9097         </param>
9098         <param id="millis">
9099           <jlong/>
9100           <description>
9101             The timeout, in milliseconds.  If the timeout is
9102             zero, then real time is not taken into consideration
9103             and the thread simply waits until notified.
9104           </description>
9105         </param>
9106       </parameters>
9107       <errors>
9108         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9109           Not monitor owner
9110         </error>
9111         <error id="JVMTI_ERROR_INTERRUPT">
9112           Wait was interrupted, try again
9113         </error>
9114       </errors>
9115     </function>
9116 
9117     <function id="RawMonitorNotify" phase="any" callbacksafe="safe" impl="notrace" num="36">
9118       <synopsis>Raw Monitor Notify</synopsis>
9119       <description>
9120         Notify a single thread waiting on the raw monitor.
9121       </description>
9122       <origin>jvmdi</origin>
9123       <capabilities>
9124       </capabilities>
9125       <parameters>
9126         <param id="monitor">
9127           <jrawMonitorID/>
9128           <description>
9129             The monitor
9130           </description>
9131         </param>
9132       </parameters>
9133       <errors>
9134         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9135           Not monitor owner
9136         </error>
9137       </errors>
9138     </function>
9139 
9140     <function id="RawMonitorNotifyAll" phase="any" callbacksafe="safe" impl="notrace" num="37">
9141       <synopsis>Raw Monitor Notify All</synopsis>
9142       <description>
9143         Notify all threads waiting on the raw monitor.
9144       </description>
9145       <origin>jvmdi</origin>
9146       <capabilities>
9147       </capabilities>
9148       <parameters>
9149         <param id="monitor">
9150           <jrawMonitorID/>
9151           <description>
9152             The monitor
9153           </description>
9154         </param>
9155       </parameters>
9156       <errors>
9157         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9158           Not monitor owner
9159         </error>
9160       </errors>
9161     </function>
9162 
9163    <elide>
9164     <function id="GetRawMonitorUse" num="118">
9165       <synopsis>Get Raw Monitor Use</synopsis>
9166       <description>
9167         The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure
9168         are filled in with information about usage of the raw monitor.
9169       </description>
9170       <origin>new</origin>
9171       <capabilities>
9172         <required id="can_get_raw_monitor_usage"></required>
9173       </capabilities>
9174       <parameters>
9175         <param id="monitor">
9176           <jrawMonitorID/>
9177           <description>
9178             the raw monitor to query.
9179           </description>
9180         </param>
9181         <param id="info_ptr">
9182           <outptr><struct>jvmtiMonitorUsage</struct></outptr>
9183           <description>
9184             On return, filled with monitor information for the
9185             specified raw monitor.
9186           </description>
9187         </param>
9188       </parameters>
9189       <errors>
9190       </errors>
9191     </function>
9192 
9193     <function id="GetRawMonitors" num="119">
9194       <synopsis>Get Raw Monitors</synopsis>
9195       <description>
9196         Return the list of raw monitors.
9197         <p/>
9198         Note: details about each monitor can be examined with
9199         <functionlink id="GetRawMonitorUse"></functionlink>.
9200       </description>
9201       <origin>new</origin>
9202       <capabilities>
9203         <required id="can_get_raw_monitor_usage"></required>
9204       </capabilities>
9205       <parameters>
9206         <param id="monitorCnt">
9207           <outptr><jint/></outptr>
9208           <description>
9209             On return, pointer to the number
9210             of monitors returned in <code>monitors_ptr</code>.
9211           </description>
9212         </param>
9213         <param id="monitors_ptr">
9214           <allocbuf outcount="monitorCnt"><jrawMonitorID/></allocbuf>
9215           <description>
9216             On return, pointer to the monitor list.
9217           </description>
9218         </param>
9219       </parameters>
9220       <errors>
9221       </errors>
9222     </function>
9223     </elide>
9224   </category>
9225 
9226   <category id="jniIntercept" label="JNI Function Interception">
9227 
9228     <intro>
9229       Provides the ability to intercept and resend
9230       Java Native Interface (JNI) function calls
9231       by manipulating the JNI function table.
9232       See <externallink id="jni/functions.html">JNI
9233         Functions</externallink> in the <i>Java Native Interface Specification</i>.
9234       <p/>
9235       The following example illustrates intercepting the
9236       <code>NewGlobalRef</code> JNI call in order to count reference
9237       creation.
9238       <example>
9239 JNIEnv original_jni_Functions;
9240 JNIEnv redirected_jni_Functions;
9241 int my_global_ref_count = 0;
9242 
9243 jobject
9244 MyNewGlobalRef(JNIEnv *jni_env, jobject lobj) {
9245    ++my_global_ref_count;
9246    return originalJNIFunctions-&gt;NewGlobalRef(env, lobj);
9247 }
9248 
9249 void
9250 myInit() {
9251    jvmtiError err;
9252 
9253    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;original_jni_Functions);
9254    if (err != JVMTI_ERROR_NONE) {
9255       die();
9256    }
9257    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;redirected_jni_Functions);
9258    if (err != JVMTI_ERROR_NONE) {
9259       die();
9260    }
9261    redirectedJNIFunctions-&gt;NewGlobalRef = MyNewGlobalRef;
9262       err = (*jvmti_env)-&gt;SetJNIFunctionTable(jvmti_env, redirected_jni_Functions);
9263    if (err != JVMTI_ERROR_NONE) {
9264       die();
9265    }
9266 }
9267       </example>
9268       Sometime after <code>myInit</code> is called the user's JNI
9269       code is executed which makes the call to create a new global
9270       reference.  Instead of going to the normal JNI implementation
9271       the call goes to <code>myNewGlobalRef</code>.  Note that a
9272       copy of the original function table is kept so that the normal
9273       JNI function can be called after the data is collected.
9274       Note also that any JNI functions which are not overwritten
9275       will behave normally.
9276       <todo>
9277         check that the example compiles and executes.
9278       </todo>
9279     </intro>
9280 
9281     <function id="SetJNIFunctionTable" phase="start" num="120">
9282       <synopsis>Set JNI Function Table</synopsis>
9283       <description>
9284         Set the JNI function table
9285         in all current and future JNI environments.
9286         As a result, all future JNI calls are directed to the specified functions.
9287         Use <functionlink id="GetJNIFunctionTable"></functionlink> to get the
9288         function table to pass to this function.
9289         For this function to take effect the the updated table entries must be
9290         used by the JNI clients.
9291         Since the table is defined <code>const</code> some compilers may optimize
9292         away the access to the table, thus preventing this function from taking
9293         effect.
9294         The table is copied--changes to the local copy of the
9295         table have no effect.
9296         This function affects only the function table, all other aspects of the environment are
9297         unaffected.
9298         See the examples <internallink id="jniIntercept">above</internallink>.
9299       </description>
9300       <origin>new</origin>
9301       <capabilities>
9302       </capabilities>
9303       <parameters>
9304         <param id="function_table">
9305           <inptr>
9306             <struct>jniNativeInterface</struct>
9307           </inptr>
9308           <description>
9309             Points to the new JNI function table.
9310           </description>
9311         </param>
9312       </parameters>
9313       <errors>
9314       </errors>
9315     </function>
9316 
9317     <function id="GetJNIFunctionTable" phase="start" num="121">
9318       <synopsis>Get JNI Function Table</synopsis>
9319       <description>
9320         Get the JNI function table.
9321         The JNI function table is copied into allocated memory.
9322         If <functionlink id="SetJNIFunctionTable"></functionlink>
9323         has been called, the modified (not the original) function
9324         table is returned.
9325         Only the function table is copied, no other aspects of the environment
9326         are copied.
9327         See the examples <internallink id="jniIntercept">above</internallink>.
9328       </description>
9329       <origin>new</origin>
9330       <capabilities>
9331       </capabilities>
9332       <parameters>
9333         <param id="function_table">
9334           <allocbuf>
9335             <struct>jniNativeInterface</struct>
9336           </allocbuf>
9337           <description>
9338             On return, <code>*function_table</code>
9339             points a newly allocated copy of the JNI function table.
9340           </description>
9341         </param>
9342       </parameters>
9343       <errors>
9344       </errors>
9345     </function>
9346 
9347   </category>
9348 
9349   <category id="eventManagement" label="Event Management">
9350 
9351     <function id="SetEventCallbacks" jkernel="yes" phase="onload" num="122">
9352       <synopsis>Set Event Callbacks</synopsis>
9353       <description>
9354         Set the functions to be called for each event.
9355         The callbacks are specified by supplying a replacement function table.
9356         The function table is copied--changes to the local copy of the
9357         table have no effect.
9358         This is an atomic action, all callbacks are set at once.
9359         No events are sent before this function is called.
9360         When an entry is <code>NULL</code> or when the event is beyond
9361         <paramlink id="size_of_callbacks"></paramlink> no event is sent.
9362         Details on events are
9363         described <internallink id="EventSection">later</internallink> in this document.
9364         An event must be enabled and have a callback in order to be
9365         sent--the order in which this function and
9366         <functionlink id="SetEventNotificationMode"></functionlink>
9367         are called does not affect the result.
9368       </description>
9369       <origin>new</origin>
9370       <capabilities>
9371       </capabilities>
9372       <parameters>
9373         <param id="callbacks">
9374           <inptr>
9375             <struct>jvmtiEventCallbacks</struct>
9376             <nullok>remove the existing callbacks</nullok>
9377           </inptr>
9378           <description>
9379             The new event callbacks.
9380           </description>
9381         </param>
9382         <param id="size_of_callbacks">
9383           <jint min="0"/>
9384           <description>
9385             <code>sizeof(jvmtiEventCallbacks)</code>--for version
9386             compatibility.
9387           </description>
9388         </param>
9389       </parameters>
9390       <errors>
9391       </errors>
9392     </function>
9393 
9394     <function id="SetEventNotificationMode" jkernel="yes" phase="onload" num="2">
9395       <synopsis>Set Event Notification Mode</synopsis>
9396       <description>
9397         Control the generation of events.
9398         <constants id="jvmtiEventMode" label="Event Enable/Disable" kind="enum">
9399           <constant id="JVMTI_ENABLE" num="1">
9400             If <paramlink id="mode"></paramlink> is <code>JVMTI_ENABLE</code>,
9401             the event <paramlink id="event_type"></paramlink> will be enabled
9402           </constant>
9403           <constant id="JVMTI_DISABLE" num="0">
9404             If <paramlink id="mode"></paramlink> is <code>JVMTI_DISABLE</code>,
9405             the event <paramlink id="event_type"></paramlink> will be disabled
9406           </constant>
9407         </constants>
9408         If <code>event_thread</code> is <code>NULL</code>,
9409         the event is enabled or disabled globally; otherwise, it is
9410         enabled or disabled for a particular thread.
9411         An event is generated for
9412         a particular thread if it is enabled either at the thread or global
9413         levels.
9414         <p/>
9415         See <internallink id="EventIndex">below</internallink> for information on specific events.
9416         <p/>
9417         The following events cannot be controlled at the thread
9418         level through this function.
9419         <ul>
9420           <li><eventlink id="VMInit"></eventlink></li>
9421           <li><eventlink id="VMStart"></eventlink></li>
9422           <li><eventlink id="VMDeath"></eventlink></li>
9423           <li><eventlink id="ThreadStart"></eventlink></li>
9424           <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9425           <li><eventlink id="CompiledMethodUnload"></eventlink></li>
9426           <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9427           <li><eventlink id="DataDumpRequest"></eventlink></li>
9428         </ul>
9429         <p/>
9430         Initially, no events are enabled at either the thread level
9431         or the global level.
9432         <p/>
9433         Any needed capabilities (see Event Enabling Capabilities below) must be possessed
9434         before calling this function.
9435         <p/>
9436         Details on events are
9437         described <internallink id="EventSection">below</internallink>.
9438       </description>
9439       <origin>jvmdiClone</origin>
9440       <eventcapabilities></eventcapabilities>
9441       <parameters>
9442         <param id="mode">
9443           <enum>jvmtiEventMode</enum>
9444           <description>
9445             <code>JVMTI_ENABLE</code> or <code>JVMTI_DISABLE</code>
9446           </description>
9447         </param>
9448         <param id="event_type">
9449           <enum>jvmtiEvent</enum>
9450           <description>
9451             the event to control
9452           </description>
9453         </param>
9454         <param id="event_thread">
9455           <ptrtype>
9456             <jthread impl="noconvert"/>
9457             <nullok>event is controlled at the global level</nullok>
9458           </ptrtype>
9459             <description>
9460               The thread to control
9461             </description>
9462         </param>
9463         <param id="...">
9464           <varargs/>
9465             <description>
9466               for future expansion
9467             </description>
9468         </param>
9469       </parameters>
9470       <errors>
9471         <error id="JVMTI_ERROR_INVALID_THREAD">
9472           <paramlink id="event_thread"/> is non-<code>NULL</code> and is not a valid thread.
9473         </error>
9474         <error id="JVMTI_ERROR_THREAD_NOT_ALIVE">
9475           <paramlink id="event_thread"/> is non-<code>NULL</code> and is not live (has not been started or is now dead).
9476         </error>
9477         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9478           thread level control was attempted on events which do not
9479           permit thread level control.
9480         </error>
9481         <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
9482           The Required Event Enabling Capability is not possessed.
9483         </error>
9484       </errors>
9485     </function>
9486 
9487     <function id="GenerateEvents" num="123">
9488       <synopsis>Generate Events</synopsis>
9489       <description>
9490         Generate events to represent the current state of the VM.
9491         For example, if <paramlink id="event_type"/> is
9492         <code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code>,
9493         a <eventlink id="CompiledMethodLoad"></eventlink> event will be
9494         sent for each currently compiled method.
9495         Methods that were loaded and now have been unloaded are not sent.
9496         The history of what events have previously been sent does not
9497         effect what events are sent by this function--for example,
9498         all currently compiled methods
9499         will be sent each time this function is called.
9500         <p/>
9501         This function is useful when
9502         events may have been missed due to the agent attaching after program
9503         execution begins; this function generates the missed events.
9504         <p/>
9505         Attempts to execute Java programming language code or
9506         JNI functions may be paused until this function returns -
9507         so neither should be called from the thread sending the event.
9508         This function returns only after the missed events have been
9509         sent, processed and have returned.
9510         The event may be sent on a different thread than the thread
9511         on which the event occurred.
9512         The callback for the event must be set with
9513         <functionlink id="SetEventCallbacks"></functionlink>
9514         and the event must be enabled with
9515         <functionlink id="SetEventNotificationMode"></functionlink>
9516         or the events will not occur.
9517         If the VM no longer has the information to generate some or
9518         all of the requested events, the events are simply not sent -
9519         no error is returned.
9520         <p/>
9521         Only the following events are supported:
9522         <ul>
9523           <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9524           <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9525         </ul>
9526       </description>
9527       <origin>new</origin>
9528       <capabilities>
9529         <capability id="can_generate_compiled_method_load_events"></capability>
9530       </capabilities>
9531       <parameters>
9532         <param id="event_type">
9533           <enum>jvmtiEvent</enum>
9534           <description>
9535             The type of event to generate.  Must be one of these:
9536             <ul>
9537               <li><eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink></li>
9538               <li><eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink></li>
9539             </ul>
9540           </description>
9541         </param>
9542       </parameters>
9543       <errors>
9544         <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
9545           <paramlink id="event_type"/> is
9546           <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9547           and <fieldlink id="can_generate_compiled_method_load_events" struct="jvmtiCapabilities"></fieldlink>
9548           is <code>false</code>.
9549         </error>
9550         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9551           <paramlink id="event_type"/> is other than
9552           <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9553           or <eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink>.
9554         </error>
9555       </errors>
9556     </function>
9557 
9558   </category>
9559 
9560     <category id="extension" label="Extension Mechanism">
9561 
9562       <intro>
9563         These functions
9564         allow a <jvmti/> implementation to provide functions and events
9565         beyond those defined in this specification.
9566         <p/>
9567         Both extension functions and extension events have parameters
9568         each of which has a 'type' and 'kind' chosen from the following tables:
9569 
9570         <constants id="jvmtiParamTypes" label="Extension Function/Event Parameter Types" kind="enum">
9571           <constant id="JVMTI_TYPE_JBYTE" num="101">
9572             Java programming language primitive type - <code>byte</code>.
9573             JNI type <code>jbyte</code>.
9574           </constant>
9575           <constant id="JVMTI_TYPE_JCHAR" num="102">
9576             Java programming language primitive type - <code>char</code>.
9577             JNI type <code>jchar</code>.
9578           </constant>
9579           <constant id="JVMTI_TYPE_JSHORT" num="103">
9580             Java programming language primitive type - <code>short</code>.
9581             JNI type <code>jshort</code>.
9582           </constant>
9583           <constant id="JVMTI_TYPE_JINT" num="104">
9584             Java programming language primitive type - <code>int</code>.
9585             JNI type <datalink id="jint"></datalink>.
9586           </constant>
9587           <constant id="JVMTI_TYPE_JLONG" num="105">
9588             Java programming language primitive type - <code>long</code>.
9589             JNI type <datalink id="jlong"></datalink>.
9590           </constant>
9591           <constant id="JVMTI_TYPE_JFLOAT" num="106">
9592             Java programming language primitive type - <code>float</code>.
9593             JNI type <datalink id="jfloat"></datalink>.
9594           </constant>
9595           <constant id="JVMTI_TYPE_JDOUBLE" num="107">
9596             Java programming language primitive type - <code>double</code>.
9597             JNI type <datalink id="jdouble"></datalink>.
9598           </constant>
9599           <constant id="JVMTI_TYPE_JBOOLEAN" num="108">
9600             Java programming language primitive type - <code>boolean</code>.
9601             JNI type <datalink id="jboolean"></datalink>.
9602           </constant>
9603           <constant id="JVMTI_TYPE_JOBJECT" num="109">
9604             Java programming language object type - <code>java.lang.Object</code>.
9605             JNI type <datalink id="jobject"></datalink>.
9606             Returned values are JNI local references and must be managed.
9607           </constant>
9608           <constant id="JVMTI_TYPE_JTHREAD" num="110">
9609             Java programming language object type - <code>java.lang.Thread</code>.
9610             <jvmti/> type <datalink id="jthread"></datalink>.
9611             Returned values are JNI local references and must be managed.
9612           </constant>
9613           <constant id="JVMTI_TYPE_JCLASS" num="111">
9614             Java programming language object type - <code>java.lang.Class</code>.
9615             JNI type <datalink id="jclass"></datalink>.
9616             Returned values are JNI local references and must be managed.
9617           </constant>
9618           <constant id="JVMTI_TYPE_JVALUE" num="112">
9619             Union of all Java programming language primitive and object types -
9620             JNI type <datalink id="jvalue"></datalink>.
9621             Returned values which represent object types are JNI local references and must be managed.
9622           </constant>
9623           <constant id="JVMTI_TYPE_JFIELDID" num="113">
9624             Java programming language field identifier -
9625             JNI type <datalink id="jfieldID"></datalink>.
9626           </constant>
9627           <constant id="JVMTI_TYPE_JMETHODID" num="114">
9628             Java programming language method identifier -
9629             JNI type <datalink id="jmethodID"></datalink>.
9630           </constant>
9631           <constant id="JVMTI_TYPE_CCHAR" num="115">
9632             C programming language type - <code>char</code>.
9633           </constant>
9634           <constant id="JVMTI_TYPE_CVOID" num="116">
9635             C programming language type - <code>void</code>.
9636           </constant>
9637           <constant id="JVMTI_TYPE_JNIENV" num="117">
9638             JNI environment - <code>JNIEnv</code>.
9639             Should be used with the correct <datalink id="jvmtiParamKind"/> to make it a pointer type.
9640           </constant>
9641         </constants>
9642 
9643         <constants id="jvmtiParamKind" label="Extension Function/Event Parameter Kinds" kind="enum">
9644           <constant id="JVMTI_KIND_IN" num="91">
9645             Ingoing argument - <code>foo</code>.
9646           </constant>
9647           <constant id="JVMTI_KIND_IN_PTR" num="92">
9648             Ingoing pointer argument - <code>const foo*</code>.
9649           </constant>
9650           <constant id="JVMTI_KIND_IN_BUF" num="93">
9651             Ingoing array argument - <code>const foo*</code>.
9652           </constant>
9653           <constant id="JVMTI_KIND_ALLOC_BUF" num="94">
9654             Outgoing allocated array argument -  <code>foo**</code>.
9655             Free with <code>Deallocate</code>.
9656           </constant>
9657           <constant id="JVMTI_KIND_ALLOC_ALLOC_BUF" num="95">
9658             Outgoing allocated array of allocated arrays argument - <code>foo***</code>.
9659             Free with <code>Deallocate</code>.
9660           </constant>
9661           <constant id="JVMTI_KIND_OUT" num="96">
9662             Outgoing argument - <code>foo*</code>.
9663           </constant>
9664           <constant id="JVMTI_KIND_OUT_BUF" num="97">
9665             Outgoing array argument (pre-allocated by agent) - <code>foo*</code>.
9666             Do not <code>Deallocate</code>.
9667           </constant>
9668         </constants>
9669 
9670       </intro>
9671 
9672       <typedef id="jvmtiParamInfo" label="Extension Function/Event Parameter Info">
9673         <field id="name">
9674           <allocfieldbuf><char/></allocfieldbuf>
9675             <description>
9676               The parameter name, encoded as a
9677               <internallink id="mUTF">modified UTF-8</internallink> string
9678             </description>
9679         </field>
9680         <field id="kind">
9681           <enum>jvmtiParamKind</enum>
9682           <description>
9683             The kind of the parameter - type modifiers
9684           </description>
9685         </field>
9686         <field id="base_type">
9687           <enum>jvmtiParamTypes</enum>
9688           <description>
9689             The base type of the parameter -  modified by <code>kind</code>
9690           </description>
9691         </field>
9692         <field id="null_ok">
9693           <jboolean/>
9694             <description>
9695               Is a <code>NULL</code> argument permitted? Applies only to pointer and object types.
9696             </description>
9697         </field>
9698       </typedef>
9699 
9700       <callback id="jvmtiExtensionFunction">
9701         <enum>jvmtiError</enum>
9702           <synopsis>Extension Function</synopsis>
9703         <description>
9704           This is the implementation-specific extension function.
9705         </description>
9706         <parameters>
9707           <param id="jvmti_env">
9708             <outptr>
9709               <struct>jvmtiEnv</struct>
9710             </outptr>
9711             <description>
9712               The <jvmti/> environment is the only fixed parameter for extension functions.
9713             </description>
9714           </param>
9715           <param id="...">
9716             <varargs/>
9717               <description>
9718                 The extension function-specific parameters
9719               </description>
9720           </param>
9721         </parameters>
9722       </callback>
9723 
9724       <function id="GetExtensionFunctions" phase="onload" num="124">
9725         <synopsis>Get Extension Functions</synopsis>
9726 
9727         <typedef id="jvmtiExtensionFunctionInfo" label="Extension Function Info">
9728           <field id="func">
9729             <ptrtype>
9730               <struct>jvmtiExtensionFunction</struct>
9731             </ptrtype>
9732             <description>
9733               The actual function to call
9734             </description>
9735           </field>
9736           <field id="id">
9737             <allocfieldbuf><char/></allocfieldbuf>
9738               <description>
9739                 The identifier for the extension function, encoded as a
9740                 <internallink id="mUTF">modified UTF-8</internallink> string.
9741                 Uses package name conventions.
9742                 For example, <code>com.sun.hotspot.bar</code>
9743               </description>
9744           </field>
9745           <field id="short_description">
9746             <allocfieldbuf><char/></allocfieldbuf>
9747               <description>
9748                 A one sentence description of the function, encoded as a
9749                 <internallink id="mUTF">modified UTF-8</internallink> string.
9750               </description>
9751           </field>
9752           <field id="param_count">
9753             <jint/>
9754               <description>
9755                 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
9756               </description>
9757           </field>
9758           <field id="params">
9759             <allocfieldbuf outcount="param_count">
9760               <struct>jvmtiParamInfo</struct>
9761             </allocfieldbuf>
9762             <description>
9763               Array of
9764               <fieldlink id="param_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
9765               parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
9766             </description>
9767           </field>
9768           <field id="error_count">
9769             <jint/>
9770               <description>
9771                 The number of possible error returns (excluding universal errors)
9772               </description>
9773           </field>
9774           <field id="errors">
9775             <allocfieldbuf outcount="error_count">
9776               <enum>jvmtiError</enum>
9777             </allocfieldbuf>
9778             <description>
9779               Array of <fieldlink id="error_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
9780               possible errors
9781             </description>
9782           </field>
9783         </typedef>
9784 
9785         <description>
9786           Returns the set of extension functions.
9787         </description>
9788         <origin>new</origin>
9789         <capabilities>
9790         </capabilities>
9791         <parameters>
9792           <param id="extension_count_ptr">
9793             <outptr><jint/></outptr>
9794               <description>
9795                 On return, points to the number of extension functions
9796               </description>
9797           </param>
9798           <param id="extensions">
9799             <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionFunctionInfo</struct></allocbuf>
9800             <description>
9801               Returns an array of extension function info, one per function
9802             </description>
9803           </param>
9804         </parameters>
9805         <errors>
9806         </errors>
9807       </function>
9808 
9809       <function id="GetExtensionEvents" phase="onload" num="125">
9810         <synopsis>Get Extension Events</synopsis>
9811 
9812         <typedef id="jvmtiExtensionEventInfo" label="Extension Event Info">
9813           <field id="extension_event_index">
9814             <jint/>
9815             <description>
9816               The identifying index of the event
9817             </description>
9818           </field>
9819           <field id="id">
9820             <allocfieldbuf><char/></allocfieldbuf>
9821               <description>
9822                 The identifier for the extension event, encoded as a
9823                 <internallink id="mUTF">modified UTF-8</internallink> string.
9824                 Uses package name conventions.
9825                 For example, <code>com.sun.hotspot.bar</code>
9826               </description>
9827           </field>
9828           <field id="short_description">
9829             <allocfieldbuf><char/></allocfieldbuf>
9830               <description>
9831                 A one sentence description of the event, encoded as a
9832                 <internallink id="mUTF">modified UTF-8</internallink> string.
9833               </description>
9834           </field>
9835           <field id="param_count">
9836             <jint/>
9837               <description>
9838                 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
9839               </description>
9840           </field>
9841           <field id="params">
9842             <allocfieldbuf outcount="param_count">
9843               <struct>jvmtiParamInfo</struct>
9844             </allocfieldbuf>
9845             <description>
9846               Array of
9847               <fieldlink id="param_count" struct="jvmtiExtensionEventInfo"></fieldlink>
9848               parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
9849             </description>
9850           </field>
9851         </typedef>
9852 
9853         <description>
9854           Returns the set of extension events.
9855         </description>
9856         <origin>new</origin>
9857         <capabilities>
9858         </capabilities>
9859         <parameters>
9860           <param id="extension_count_ptr">
9861             <outptr><jint/></outptr>
9862               <description>
9863                 On return, points to the number of extension events
9864               </description>
9865           </param>
9866           <param id="extensions">
9867             <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionEventInfo</struct></allocbuf>
9868             <description>
9869               Returns an array of extension event info, one per event
9870             </description>
9871           </param>
9872         </parameters>
9873         <errors>
9874         </errors>
9875       </function>
9876 
9877       <callback id="jvmtiExtensionEvent">
9878         <void/>
9879           <synopsis>Extension Event</synopsis>
9880         <description>
9881           This is the implementation-specific event.
9882           The event handler is set with
9883           <functionlink id="SetExtensionEventCallback"/>.
9884           <p/>
9885           Event handlers for extension events must be declared varargs to match this definition.
9886           Failure to do so could result in calling convention mismatch and undefined behavior
9887           on some platforms.
9888           <p/>
9889           For example, if the <code>jvmtiParamInfo</code>
9890           returned by <functionlink id="GetExtensionEvents"/> indicates that
9891           there is a <code>jint</code> parameter, the event handler should be
9892           declared:
9893 <example>
9894     void JNICALL myHandler(jvmtiEnv* jvmti_env, jint myInt, ...)
9895 </example>
9896           Note the terminal "<code>...</code>" which indicates varargs.
9897         </description>
9898         <parameters>
9899           <param id="jvmti_env">
9900             <outptr>
9901               <struct>jvmtiEnv</struct>
9902             </outptr>
9903             <description>
9904               The <jvmti/> environment is the only fixed parameter for extension events.
9905             </description>
9906           </param>
9907           <param id="...">
9908             <varargs/>
9909               <description>
9910                 The extension event-specific parameters
9911               </description>
9912           </param>
9913         </parameters>
9914       </callback>
9915 
9916       <function id="SetExtensionEventCallback" phase="onload" num="126">
9917         <synopsis>Set Extension Event Callback</synopsis>
9918 
9919         <description>
9920           Sets the callback function for an extension event and
9921           enables the event. Or, if the callback is <code>NULL</code>, disables
9922           the event.  Note that unlike standard events, setting
9923           the callback and enabling the event are a single operation.
9924         </description>
9925         <origin>new</origin>
9926         <capabilities>
9927         </capabilities>
9928         <parameters>
9929           <param id="extension_event_index">
9930             <jint/>
9931               <description>
9932                 Identifies which callback to set.
9933                 This index is the
9934                 <fieldlink id="extension_event_index" struct="jvmtiExtensionEventInfo"></fieldlink>
9935                 field of
9936                 <datalink id="jvmtiExtensionEventInfo"/>.
9937               </description>
9938           </param>
9939           <param id="callback">
9940             <ptrtype>
9941               <struct>jvmtiExtensionEvent</struct>
9942               <nullok>disable the event</nullok>
9943             </ptrtype>
9944             <description>
9945               If <code>callback</code> is non-<code>NULL</code>,
9946               set <code>callback</code> to be the event callback function
9947               and enable the event.
9948             </description>
9949           </param>
9950         </parameters>
9951         <errors>
9952         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9953             <paramlink id="extension_event_index"/> is not an
9954             <fieldlink id="extension_event_index"
9955                        struct="jvmtiExtensionEventInfo"/>
9956             returned by
9957             <functionlink id="GetExtensionEvents"/>
9958         </error>
9959         </errors>
9960       </function>
9961 
9962     </category>
9963 
9964   <category id="capability" label="Capability">
9965 
9966     <intro>
9967       The capabilities functions allow you to change the
9968       functionality available to <jvmti/>--that is,
9969       which <jvmti/>
9970       functions can be called, what events can be generated,
9971       and what functionality these events and functions can
9972       provide.
9973       <p/>
9974         The "Capabilities" section of each function and event describe which
9975         capabilities, if any, they are associated with. "Required Functionality"
9976         means it is available for use and no capabilities must be added to use it.
9977         "Optional Functionality" means the agent must possess the capability
9978         before it can be used.
9979         To possess a capability, the agent must
9980         <functionlink id="AddCapabilities">add the capability</functionlink>.
9981         "Optional Features" describe capabilities which,
9982         if added, extend the feature set.
9983         <p/>
9984         The potentially available capabilities of each <jvmti/> implementation are different.
9985         Depending on the implementation, a capability:
9986         <ul>
9987           <li>may never be added</li>
9988           <li>may be added in either the <code>OnLoad</code> or live phase in any environment</li>
9989           <li>may be added only during the <code>OnLoad</code> phase</li>
9990           <li>may be possessed by only one environment at a time</li>
9991           <li>may be possessed by only one environment at a time,
9992               and only during the <code>OnLoad</code> phase</li>
9993           <li>and so on ...</li>
9994         </ul>
9995       Frequently, the addition of a capability may incur a cost in execution speed, start up
9996       time, and/or memory footprint.  Note that the overhead of using a capability
9997       is completely different than the overhead of possessing a capability.
9998       Take single stepping as an example. When single stepping is on (that
9999       is, when the event is enabled and thus actively sending events)
10000       the overhead of sending and processing an event
10001       on each instruction is huge in any implementation.
10002       However, the overhead of possessing the capability may be small or large,
10003       depending on the implementation.  Also, when and if a capability is potentially
10004       available depends on the implementation.  Some examples:
10005       <ul>
10006         <li>One VM might perform all execution by compiling bytecodes into
10007           native code and be unable to generate single step instructions.
10008           In this implementation the capability can not be added.</li>
10009         <li>Another VM may be able to switch execution to a single stepping
10010           interpreter at any time.  In this implementation, having the capability has no
10011           overhead and could be added at any time.</li>
10012         <li>Yet another VM might be able to choose a bytecode compiling or single stepping capable interpreted
10013           execution engine at start up, but be unable to switch between them.
10014           In this implementation the capability would need to be added
10015           during the <code>OnLoad</code> phase (before bytecode
10016           execution begins) and would have a large impact on execution speed
10017           even if single stepping was never used.</li>
10018         <li>Still another VM might be able to add an "is single stepping on" check
10019           into compiled bytecodes or a generated interpreter.  Again in this implementation
10020           the capability would need to be added during the <code>OnLoad</code> phase but the overhead (a test
10021           and branch on each instruction) would be considerably less.</li>
10022       </ul>
10023       <p/>
10024       Each <jvmti/> <internallink id="environments">environment</internallink>
10025       has its own set of capabilities.
10026       Initially, that set is empty.
10027       Any desired capability must be added.
10028       If possible, capabilities should be added during the <code>OnLoad</code> phase.  For most
10029       virtual machines certain capabilities require special set up for
10030       the virtual machine and this set up must happen
10031       during the <code>OnLoad</code> phase, before the virtual machine begins execution.
10032       Once a capability is added, it can
10033       only be removed if explicitly relinquished by the environment.
10034       <p/>
10035       The agent can,
10036       <functionlink id="GetPotentialCapabilities">determine what
10037         capabilities this VM can potentially provide</functionlink>,
10038       <functionlink id="AddCapabilities">add the capabilities
10039         to be used</functionlink>,
10040       <functionlink id="RelinquishCapabilities">release capabilities
10041         which are no longer needed</functionlink>, and
10042       <functionlink id="GetCapabilities">examine the currently available
10043         capabilities</functionlink>.
10044     </intro>
10045 
10046     <intro id="capabilityExamples" label="Capability Examples">
10047       For example, a freshly started agent (in the <code>OnLoad</code> function)
10048       wants to enable all possible capabilities.
10049       Note that, in general, this is not advisable as the agent may suffer
10050       a performance penalty for functionality it is not using.
10051       The code might look like this in C:
10052       <example>
10053         jvmtiCapabilities capa;
10054         jvmtiError err;
10055 
10056         err = (*jvmti)-&gt;GetPotentialCapabilities(jvmti, &amp;capa);
10057         if (err == JVMTI_ERROR_NONE) {
10058            err = (*jvmti)-&gt;AddCapabilities(jvmti, &amp;capa);
10059       </example>
10060       For example, if an  agent wants to check if it can get
10061       the bytecodes of a method (that is, it wants to check
10062       if it previously added this capability and has not
10063       relinquished it), the code might
10064       look like this in C:
10065       <example>
10066         jvmtiCapabilities capa;
10067         jvmtiError err;
10068 
10069         err = (*jvmti)-&gt;GetCapabilities(jvmti, &amp;capa);
10070         if (err == JVMTI_ERROR_NONE) {
10071            if (capa.can_get_bytecodes) { ... } }
10072       </example>
10073     </intro>
10074 
10075     <capabilitiestypedef id="jvmtiCapabilities" label="The Capabilities Structure">
10076       <description>
10077         The functions in this category use this capabilities structure
10078         which contains boolean flags corresponding to each capability:
10079       </description>
10080       <capabilityfield id="can_tag_objects">
10081         <description>
10082           Can set and get tags, as described in the
10083           <internallink id="Heap">Heap category</internallink>.
10084         </description>
10085       </capabilityfield>
10086       <capabilityfield id="can_generate_field_modification_events">
10087         <description>
10088           Can set watchpoints on field modification -
10089           <functionlink id="SetFieldModificationWatch"></functionlink>
10090         </description>
10091       </capabilityfield>
10092       <capabilityfield id="can_generate_field_access_events">
10093         <description>
10094           Can set watchpoints on field access -
10095           <functionlink id="SetFieldAccessWatch"></functionlink>
10096         </description>
10097       </capabilityfield>
10098       <capabilityfield id="can_get_bytecodes">
10099         <description>
10100           Can get bytecodes of a method <functionlink id="GetBytecodes"></functionlink>
10101         </description>
10102       </capabilityfield>
10103       <capabilityfield id="can_get_synthetic_attribute">
10104         <description>
10105           Can test if a field or method is synthetic -
10106           <functionlink id="IsFieldSynthetic"></functionlink> and
10107           <functionlink id="IsMethodSynthetic"></functionlink>
10108         </description>
10109       </capabilityfield>
10110       <capabilityfield id="can_get_owned_monitor_info">
10111         <description>
10112           Can get information about ownership of monitors -
10113           <functionlink id="GetOwnedMonitorInfo"></functionlink>
10114         </description>
10115       </capabilityfield>
10116       <capabilityfield id="can_get_current_contended_monitor">
10117         <description>
10118           Can <functionlink id="GetCurrentContendedMonitor"></functionlink>
10119         </description>
10120       </capabilityfield>
10121       <capabilityfield id="can_get_monitor_info">
10122       <description>
10123         Can <functionlink id="GetObjectMonitorUsage"></functionlink>
10124       </description>
10125       </capabilityfield>
10126       <capabilityfield id="can_pop_frame">
10127         <description>
10128           Can pop frames off the stack - <functionlink id="PopFrame"></functionlink>
10129         </description>
10130       </capabilityfield>
10131       <capabilityfield id="can_redefine_classes">
10132         <description>
10133           Can redefine classes with <functionlink id="RedefineClasses"/>.
10134         </description>
10135       </capabilityfield>
10136       <capabilityfield id="can_signal_thread">
10137         <description>
10138           Can send stop or interrupt to threads
10139         </description>
10140       </capabilityfield>
10141       <capabilityfield id="can_get_source_file_name">
10142         <description>
10143           Can get the source file name of a class
10144         </description>
10145       </capabilityfield>
10146       <capabilityfield id="can_get_line_numbers">
10147         <description>
10148           Can get the line number table of a method
10149         </description>
10150       </capabilityfield>
10151       <capabilityfield id="can_get_source_debug_extension">
10152         <description>
10153           Can get the source debug extension of a class
10154         </description>
10155       </capabilityfield>
10156       <capabilityfield id="can_access_local_variables">
10157         <description>
10158           Can set and get local variables
10159         </description>
10160       </capabilityfield>
10161       <capabilityfield id="can_maintain_original_method_order">
10162         <description>
10163           Can return methods in the order they occur in the class file
10164         </description>
10165       </capabilityfield>
10166       <capabilityfield id="can_generate_single_step_events">
10167         <description>
10168           Can get <eventlink id="SingleStep">single step</eventlink> events
10169         </description>
10170       </capabilityfield>
10171       <capabilityfield id="can_generate_exception_events">
10172         <description>
10173           Can get <eventlink id="Exception">exception thrown</eventlink> and
10174             <eventlink id="ExceptionCatch">exception catch</eventlink> events
10175         </description>
10176       </capabilityfield>
10177       <capabilityfield id="can_generate_frame_pop_events">
10178         <description>
10179           Can <functionlink id="NotifyFramePop">set</functionlink> and thus get
10180             <eventlink id="FramePop"></eventlink> events
10181         </description>
10182       </capabilityfield>
10183       <capabilityfield id="can_generate_breakpoint_events">
10184         <description>
10185           Can <functionlink id="SetBreakpoint">set</functionlink> and thus get
10186             <eventlink id="Breakpoint"></eventlink> events
10187         </description>
10188       </capabilityfield>
10189       <capabilityfield id="can_suspend">
10190         <description>
10191           Can suspend and resume threads
10192         </description>
10193       </capabilityfield>
10194       <capabilityfield id="can_redefine_any_class">
10195         <description>
10196           Can modify (retransform or redefine) any modifiable class.
10197           See <functionlink id="IsModifiableClass"/>.
10198         </description>
10199       </capabilityfield>
10200       <capabilityfield id="can_get_current_thread_cpu_time">
10201         <description>
10202           Can <functionlink id="GetCurrentThreadCpuTime">get</functionlink>
10203           current thread CPU time
10204         </description>
10205       </capabilityfield>
10206       <capabilityfield id="can_get_thread_cpu_time">
10207         <description>
10208           Can <functionlink id="GetThreadCpuTime">get</functionlink>
10209           thread CPU time
10210         </description>
10211       </capabilityfield>
10212       <capabilityfield id="can_generate_method_entry_events"
10213                        disp1="can_generate" disp2="_method_entry_events"
10214                        >
10215         <description>
10216           Can generate method entry events on entering a method
10217         </description>
10218       </capabilityfield>
10219       <capabilityfield id="can_generate_method_exit_events"
10220                        disp1="can_generate" disp2="_method_exit_events"
10221                        >
10222         <description>
10223           Can generate method exit events on leaving a method
10224         </description>
10225       </capabilityfield>
10226       <capabilityfield id="can_generate_all_class_hook_events"
10227                        disp1="can_generate" disp2="_all_class_hook_events"
10228                        >
10229         <description>
10230           Can generate ClassFileLoadHook events for every loaded class.
10231         </description>
10232       </capabilityfield>
10233       <capabilityfield id="can_generate_compiled_method_load_events"
10234                        disp1="can_generate" disp2="_compiled_method_load_events"
10235                        >
10236         <description>
10237           Can generate events when a method is compiled or unloaded
10238         </description>
10239       </capabilityfield>
10240       <capabilityfield id="can_generate_monitor_events"
10241                        disp1="can_generate" disp2="_monitor_events"
10242                        >
10243         <description>
10244           Can generate events on monitor activity
10245         </description>
10246       </capabilityfield>
10247       <capabilityfield id="can_generate_vm_object_alloc_events"
10248                        disp1="can_generate" disp2="_vm_object_alloc_events"
10249                        >
10250         <description>
10251           Can generate events on VM allocation of an object
10252         </description>
10253       </capabilityfield>
10254       <capabilityfield id="can_generate_native_method_bind_events"
10255                        disp1="can_generate" disp2="_native_method_bind_events"
10256                        >
10257         <description>
10258           Can generate events when a native method is bound to its
10259           implementation
10260         </description>
10261       </capabilityfield>
10262       <capabilityfield id="can_generate_garbage_collection_events"
10263                        disp1="can_generate" disp2="_garbage_collection_events"
10264                        >
10265         <description>
10266           Can generate events when garbage collection begins or ends
10267         </description>
10268       </capabilityfield>
10269       <capabilityfield id="can_generate_object_free_events"
10270                        disp1="can_generate" disp2="_object_free_events"
10271                        >
10272         <description>
10273           Can generate events when the garbage collector frees an object
10274         </description>
10275       </capabilityfield>
10276       <capabilityfield id="can_force_early_return" since="1.1">
10277         <description>
10278           Can return early from a method, as described in the
10279           <internallink id="ForceEarlyReturn">Force Early Return category</internallink>.
10280         </description>
10281       </capabilityfield>
10282       <capabilityfield id="can_get_owned_monitor_stack_depth_info" since="1.1">
10283         <description>
10284           Can get information about owned monitors with stack depth -
10285           <functionlink id="GetOwnedMonitorStackDepthInfo"></functionlink>
10286         </description>
10287       </capabilityfield>
10288       <capabilityfield id="can_get_constant_pool" since="1.1">
10289         <description>
10290           Can get the constant pool of a class -
10291           <functionlink id="GetConstantPool"></functionlink>
10292         </description>
10293       </capabilityfield>
10294       <capabilityfield id="can_set_native_method_prefix" since="1.1">
10295         <description>
10296           Can set prefix to be applied when native method cannot be resolved -
10297           <functionlink id="SetNativeMethodPrefix"/> and
10298           <functionlink id="SetNativeMethodPrefixes"/>
10299         </description>
10300       </capabilityfield>
10301       <capabilityfield id="can_retransform_classes" since="1.1">
10302         <description>
10303           Can retransform classes with <functionlink id="RetransformClasses"/>.
10304           In addition to the restrictions imposed by the specific
10305           implementation on this capability (see the
10306           <internallink id="capability">Capability</internallink> section),
10307           this capability must be set before the
10308           <eventlink id="ClassFileLoadHook"/> event is enabled for the
10309           first time in this environment.
10310           An environment that possesses this capability at the time that
10311           <code>ClassFileLoadHook</code> is enabled for the first time is
10312           said to be <i>retransformation capable</i>.
10313           An environment that does not possess this capability at the time that
10314           <code>ClassFileLoadHook</code> is enabled for the first time is
10315           said to be <i>retransformation incapable</i>.
10316         </description>
10317       </capabilityfield>
10318       <capabilityfield id="can_retransform_any_class" since="1.1">
10319         <description>
10320           <functionlink id="RetransformClasses"/> can be called on any modifiable class.
10321           See <functionlink id="IsModifiableClass"/>.
10322           (<fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
10323           must also be set)
10324         </description>
10325       </capabilityfield>
10326       <capabilityfield id="can_generate_resource_exhaustion_heap_events" since="1.1">
10327         <description>
10328           Can generate events when the VM is unable to allocate memory from
10329           the <tm>Java</tm> platform heap.
10330           See <eventlink id="ResourceExhausted"/>.
10331         </description>
10332       </capabilityfield>
10333       <capabilityfield id="can_generate_resource_exhaustion_threads_events" since="1.1">
10334         <description>
10335           Can generate events when the VM is unable to create a thread.
10336           See <eventlink id="ResourceExhausted"/>.
10337         </description>
10338       </capabilityfield>
10339       <capabilityfield id="can_generate_early_vmstart" since="9">
10340         <description>
10341           Can generate the <code>VMStart</code> event early.
10342           See <eventlink id="VMStart"/>.
10343         </description>
10344       </capabilityfield>
10345       <capabilityfield id="can_generate_early_class_hook_events" since="9">
10346         <description>
10347           Can generate the <eventlink id="ClassFileLoadHook"/> events
10348           in the primordial phase. If this capability and
10349           <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
10350           <code>can_generate_all_class_hook_events</code></internallink>
10351           are enabled then the <eventlink id="ClassFileLoadHook"/> events
10352           can be posted for classes loaded in the primordial phase.
10353           See <eventlink id="ClassFileLoadHook"/>.
10354         </description>
10355       </capabilityfield>
10356       <capabilityfield id="can_generate_sampled_alloc_events" since="11">
10357         <description>
10358           Can generate sampled allocation events.
10359           If this capability is enabled then the heap sampling method
10360           <functionlink id="SetHeapSamplingRate"></functionlink> can be called and the
10361           <eventlink id="SampledObjectAlloc"></eventlink> events can be enabled.
10362         </description>
10363       </capabilityfield>
10364     </capabilitiestypedef>
10365 
10366     <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140">
10367       <synopsis>Get Potential Capabilities</synopsis>
10368       <description>
10369         Returns via <paramlink id="capabilities_ptr"></paramlink> the <jvmti/>
10370         features that can potentially be possessed by this environment
10371         at this time.
10372         The returned capabilities differ from the complete set of capabilities
10373         implemented by the VM in two cases: another environment possesses
10374         capabilities that can only be possessed by one environment, or the
10375         current <functionlink id="GetPhase">phase</functionlink> is live,
10376         and certain capabilities can only be added during the <code>OnLoad</code> phase.
10377         The <functionlink id="AddCapabilities"></functionlink> function
10378         may be used to set any or all or these capabilities.
10379         Currently possessed capabilities are included.
10380         <p/>
10381         Typically this function is used in the <code>OnLoad</code> function.
10382         Some virtual machines may allow a limited set of capabilities to be
10383         added in the live phase.
10384         In this case, the set of potentially available capabilities
10385         will likely differ from the <code>OnLoad</code> phase set.
10386         <p/>
10387         See the
10388         <internallink id="capabilityExamples">Capability Examples</internallink>.
10389       </description>
10390       <origin>new</origin>
10391       <capabilities>
10392       </capabilities>
10393       <parameters>
10394         <param id="capabilities_ptr">
10395           <outptr><struct>jvmtiCapabilities</struct></outptr>
10396           <description>
10397             On return, points to the <jvmti/> capabilities that may be added.
10398           </description>
10399         </param>
10400       </parameters>
10401       <errors>
10402       </errors>
10403     </function>
10404 
10405     <elide>
10406     <function id="EstimateCostOfCapabilities" phase="onload" num="141">
10407       <synopsis>Estimate Cost Of Capabilities</synopsis>
10408       <description>
10409         <issue>There is strong opposition to this function.  The concern is
10410           that it would be difficult or impossible to provide meaningful
10411           numbers, as the amount of impact is conditional on many factors
10412           that a single number could not represent.  There is doubt that
10413           conditional implementations would be used or are even a good idea.
10414           The thought is that release documentation for the implementation
10415           would be the best means of exposing this information.
10416           Unless new arguments are presented, I intend to remove this
10417           function in the next revision.
10418         </issue>
10419         <p/>
10420         Return via the <paramlink id="time_impact_ptr"></paramlink> and
10421         <paramlink id="space_impact_ptr"></paramlink> an estimate of the impact
10422         of adding the capabilities pointed to by
10423         <paramlink id="capabilities_ptr"></paramlink>.
10424         The returned estimates are in percentage of additional overhead, thus
10425         a time impact of 100 mean the application might run
10426         at half the speed.
10427         The estimates are very rough approximations and are not guaranteed.
10428         Note also, that the estimates are of the impact of having the
10429         capability available--when and if it is used the impact may be
10430         much greater.
10431         Estimates can be for a single capability or for a set of
10432         capabilities.  Note that the costs are not necessarily additive,
10433         adding support for one capability might make another available
10434         for free or conversely having two capabilities at once may
10435         have multiplicative impact.
10436         Estimates are relative to the current set of capabilities -
10437         that is, how much more impact given the currently possessed capabilities.
10438         <p/>
10439         Typically this function is used in the OnLoad function,
10440         some virtual machines may allow a limited set of capabilities to be
10441         added in the live phase.
10442         In this case, the set of potentially available capabilities
10443         will likely differ from the OnLoad phase set.
10444         <p/>
10445         See the
10446         <internallink id="capabilityExamples">Capability Examples</internallink>.
10447       </description>
10448       <origin>new</origin>
10449       <capabilities>
10450       </capabilities>
10451       <parameters>
10452         <param id="capabilities_ptr">
10453           <inptr><struct>jvmtiCapabilities</struct></inptr>
10454           <description>
10455             points to the <jvmti/> capabilities to evaluate.
10456           </description>
10457         </param>
10458         <param id="time_impact_ptr">
10459           <outptr><jint/></outptr>
10460           <description>
10461             On return, points to the estimated percentage increase in
10462             run time if this capability was added.
10463           </description>
10464         </param>
10465         <param id="space_impact_ptr">
10466           <outptr><jint/></outptr>
10467           <description>
10468             On return, points to the estimated percentage increase in
10469             memory space used if this capability was added.
10470           </description>
10471         </param>
10472       </parameters>
10473       <errors>
10474         <error id="JVMTI_ERROR_NOT_AVAILABLE">
10475           The desired capabilities are not even potentially available.
10476         </error>
10477       </errors>
10478     </function>
10479     </elide>
10480 
10481     <function id="AddCapabilities" jkernel="yes" phase="onload" num="142">
10482       <synopsis>Add Capabilities</synopsis>
10483       <description>
10484         Set new capabilities by adding the capabilities
10485         whose values are set to one (<code>1</code>) in
10486         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10487         All previous capabilities are retained.
10488         Typically this function is used in the <code>OnLoad</code> function.
10489         Some virtual machines may allow a limited set of capabilities to be
10490         added in the live phase.
10491         <p/>
10492         See the
10493         <internallink id="capabilityExamples">Capability Examples</internallink>.
10494       </description>
10495       <origin>new</origin>
10496       <capabilities>
10497       </capabilities>
10498       <parameters>
10499         <param id="capabilities_ptr">
10500           <inptr><struct>jvmtiCapabilities</struct></inptr>
10501           <description>
10502             Points to the <jvmti/> capabilities to add.
10503           </description>
10504         </param>
10505       </parameters>
10506       <errors>
10507         <error id="JVMTI_ERROR_NOT_AVAILABLE">
10508           The desired capabilities are not even potentially available.
10509         </error>
10510       </errors>
10511     </function>
10512 
10513 
10514     <function id="RelinquishCapabilities" phase="onload" num="143">
10515       <synopsis>Relinquish Capabilities</synopsis>
10516       <description>
10517         Relinquish the capabilities
10518         whose values are set to one (<code>1</code>) in
10519         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10520         Some implementations may allow only one environment to have a capability
10521         (see the <internallink id="capability">capability introduction</internallink>).
10522         This function releases capabilities
10523         so that they may be used by other agents.
10524         All other capabilities are retained.
10525         The capability will no longer be present in <functionlink id="GetCapabilities"></functionlink>.
10526         Attempting to relinquish a capability that the agent does not possess is not an error.
10527           <issue>
10528             It is possible for the agent to be actively using capabilities
10529             which are being relinquished.  For example, a thread is currently
10530             suspended and can_suspend is being relinquished or an event is currently
10531             enabled and can_generate_whatever is being relinquished.
10532             There are three possible ways we could spec this:
10533             <ul>
10534               <li>relinquish automatically releases them</li>
10535               <li>relinquish checks and returns some error code if held</li>
10536               <li>it is the agent's responsibility and it is not checked</li>
10537             </ul>
10538             One of these should be chosen.
10539           </issue>
10540       </description>
10541       <origin>new</origin>
10542       <capabilities>
10543       </capabilities>
10544       <parameters>
10545         <param id="capabilities_ptr">
10546           <inptr><struct>jvmtiCapabilities</struct></inptr>
10547           <description>
10548             Points to the <jvmti/> capabilities to relinquish.
10549           </description>
10550         </param>
10551       </parameters>
10552       <errors>
10553       </errors>
10554     </function>
10555 
10556 
10557 
10558     <function id="GetCapabilities" jkernel="yes" phase="any" num="89">
10559       <synopsis>Get Capabilities</synopsis>
10560         <description>
10561           Returns via <paramlink id="capabilities_ptr"></paramlink> the optional <jvmti/>
10562           features which this environment currently possesses.
10563           Each possessed capability is indicated by a one (<code>1</code>) in the
10564           corresponding field of the <internallink id="jvmtiCapabilities">capabilities
10565           structure</internallink>.
10566           An environment does not possess a capability unless it has been successfully added with
10567           <functionlink id="AddCapabilities"/>.
10568           An environment only loses possession of a capability if it has been relinquished with
10569           <functionlink id="RelinquishCapabilities"/>. Thus, this function returns the net result
10570           of the <code>AddCapabilities</code> and <code>RelinquishCapabilities</code> calls which
10571           have been made.
10572           <p/>
10573           See the
10574           <internallink id="capabilityExamples">Capability Examples</internallink>.
10575         </description>
10576       <origin>jvmdiClone</origin>
10577       <capabilities>
10578       </capabilities>
10579       <parameters>
10580         <param id="capabilities_ptr">
10581           <outptr><struct>jvmtiCapabilities</struct></outptr>
10582           <description>
10583             On return, points to the <jvmti/> capabilities.
10584           </description>
10585         </param>
10586       </parameters>
10587       <errors>
10588       </errors>
10589     </function>
10590 
10591   </category>
10592 
10593 
10594   <category id="timers" label="Timers">
10595 
10596       <intro>
10597         These functions provide timing information.
10598         The resolution at which the time is updated is not specified.
10599         They provides nanosecond precision, but not necessarily nanosecond accuracy.
10600         Details about the timers, such as their maximum values, can be accessed with
10601         the timer information functions.
10602       </intro>
10603 
10604       <typedef id="jvmtiTimerInfo" label="Timer Info">
10605         <description>
10606           The information function for each timer returns this data structure.
10607         </description>
10608         <field id="max_value">
10609           <jlong/>
10610             <description>
10611               The maximum value the timer can reach.
10612               After this value is reached the timer wraps back to zero.
10613               This is an unsigned value.  If tested or printed as a jlong (signed value)
10614               it may appear to be a negative number.
10615             </description>
10616         </field>
10617         <field id="may_skip_forward">
10618           <jboolean/>
10619           <description>
10620             If true, the timer can be externally adjusted and as a result skip forward.
10621             If false, the timer value will never increase faster than real time.
10622           </description>
10623         </field>
10624         <field id="may_skip_backward">
10625           <jboolean/>
10626           <description>
10627             If true, the timer can be externally adjusted and as a result skip backward.
10628             If false, the timer value will be monotonically increasing.
10629           </description>
10630         </field>
10631         <field id="kind">
10632           <enum>jvmtiTimerKind</enum>
10633           <description>
10634             The kind of timer.
10635             On a platform that does not distinguish between user and system time, <datalink
10636                  id="JVMTI_TIMER_TOTAL_CPU"><code>JVMTI_TIMER_TOTAL_CPU</code></datalink>
10637             is returned.
10638           </description>
10639         </field>
10640         <field id="reserved1">
10641           <jlong/>
10642             <description>
10643               Reserved for future use.
10644             </description>
10645         </field>
10646         <field id="reserved2">
10647           <jlong/>
10648             <description>
10649               Reserved for future use.
10650             </description>
10651         </field>
10652       </typedef>
10653 
10654       <intro>
10655         Where the timer kind is --
10656 
10657         <constants id="jvmtiTimerKind" label="Timer Kinds" kind="enum">
10658           <constant id="JVMTI_TIMER_USER_CPU" num="30">
10659             CPU time that a thread is in user mode.
10660           </constant>
10661           <constant id="JVMTI_TIMER_TOTAL_CPU" num="31">
10662             CPU time that a thread is in user or system mode.
10663           </constant>
10664           <constant id="JVMTI_TIMER_ELAPSED" num="32">
10665             Elapsed time.
10666           </constant>
10667         </constants>
10668       </intro>
10669 
10670     <function id="GetCurrentThreadCpuTimerInfo" callbacksafe="safe"  impl="innative notrace" phase="start" num="134">
10671       <synopsis>Get Current Thread CPU Timer Information</synopsis>
10672       <description>
10673         Get information about the
10674         <functionlink id="GetCurrentThreadCpuTime"/> timer.
10675         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10676         are filled in with details about the timer.
10677         This information is specific to the platform and the implementation of
10678         <functionlink id="GetCurrentThreadCpuTime"/> and thus
10679         does not vary by thread nor does it vary
10680         during a particular invocation of the VM.
10681         <p/>
10682         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10683         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10684         returned by <code>GetCurrentThreadCpuTimerInfo</code>
10685         and <functionlink id="GetThreadCpuTimerInfo"/>
10686         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10687       </description>
10688       <origin>new</origin>
10689       <capabilities>
10690         <required id="can_get_current_thread_cpu_time">
10691             Can get current thread CPU time.
10692         </required>
10693       </capabilities>
10694       <parameters>
10695         <param id="info_ptr">
10696           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10697           <description>
10698             On return, filled with information describing the time
10699             returned by <functionlink id="GetCurrentThreadCpuTime"/>.
10700           </description>
10701         </param>
10702       </parameters>
10703       <errors>
10704       </errors>
10705     </function>
10706 
10707     <function id="GetCurrentThreadCpuTime" callbacksafe="safe" impl="innative notrace" phase="start" num="135">
10708       <synopsis>Get Current Thread CPU Time</synopsis>
10709       <description>
10710             Return the CPU time utilized by the current thread.
10711             <p/>
10712             Note that the <functionlink id="GetThreadCpuTime"/>
10713             function provides CPU time for any thread, including
10714             the current thread. <code>GetCurrentThreadCpuTime</code>
10715             exists to support platforms which cannot
10716             supply CPU time for threads other than the current
10717             thread or which have more accurate information for
10718             the current thread (see
10719             <functionlink id="GetCurrentThreadCpuTimerInfo"/> vs
10720             <functionlink id="GetThreadCpuTimerInfo"/>).
10721             On many platforms this call will be equivalent to:
10722 <example>
10723   GetThreadCpuTime(env, NULL, nanos_ptr)
10724 </example>
10725       </description>
10726       <origin>new</origin>
10727       <capabilities>
10728         <required id="can_get_current_thread_cpu_time">
10729             Can get current thread CPU time.
10730             <p/>
10731             If this capability is enabled after threads have started,
10732             the implementation may choose any time up
10733             to and including the time that the capability is enabled
10734             as the point where CPU time collection starts.
10735             <p/>
10736             This capability must be potentially available on any
10737             platform where
10738             <internallink id="jvmtiCapabilities.can_get_thread_cpu_time"><code>can_get_thread_cpu_time</code></internallink>
10739             is potentially available.
10740         </required>
10741       </capabilities>
10742       <parameters>
10743         <param id="nanos_ptr">
10744           <outptr><jlong/></outptr>
10745           <description>
10746             On return, points to the CPU time used by this thread
10747             in nanoseconds.
10748             This is an unsigned value.  If tested or printed as a jlong (signed value)
10749             it may appear to be a negative number.
10750           </description>
10751         </param>
10752       </parameters>
10753       <errors>
10754       </errors>
10755     </function>
10756 
10757     <function id="GetThreadCpuTimerInfo" num="136">
10758       <synopsis>Get Thread CPU Timer Information</synopsis>
10759       <description>
10760         Get information about the
10761         <functionlink id="GetThreadCpuTime"/> timer.
10762         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10763         are filled in with details about the timer.
10764         This information is specific to the platform and the implementation of
10765         <functionlink id="GetThreadCpuTime"/> and thus
10766         does not vary by thread nor does it vary
10767         during a particular invocation of the VM.
10768         <p/>
10769         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10770         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10771         returned by <functionlink id="GetCurrentThreadCpuTimerInfo"/>
10772         and <code>GetThreadCpuTimerInfo</code>
10773         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10774       </description>
10775       <origin>new</origin>
10776       <capabilities>
10777         <required id="can_get_thread_cpu_time">
10778             Can get thread CPU time.
10779         </required>
10780       </capabilities>
10781       <parameters>
10782         <param id="info_ptr">
10783           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10784           <description>
10785             On return, filled with information describing the time
10786             returned by <functionlink id="GetThreadCpuTime"/>.
10787           </description>
10788         </param>
10789       </parameters>
10790       <errors>
10791       </errors>
10792     </function>
10793 
10794     <function id="GetThreadCpuTime" num="137">
10795       <synopsis>Get Thread CPU Time</synopsis>
10796       <description>
10797           Return the CPU time utilized by the specified thread.
10798           <p/>
10799           Get information about this timer with
10800           <functionlink id="GetThreadCpuTimerInfo"/>.
10801       </description>
10802       <origin>new</origin>
10803       <capabilities>
10804         <required id="can_get_thread_cpu_time">
10805             Can get thread CPU time.
10806             <p/>
10807             If this capability is enabled after threads have started,
10808             the implementation may choose any time up
10809             to and including the time that the capability is enabled
10810             as the point where CPU time collection starts.
10811         </required>
10812       </capabilities>
10813       <parameters>
10814         <param id="thread">
10815           <jthread null="current"/>
10816             <description>
10817               The thread to query.
10818             </description>
10819         </param>
10820         <param id="nanos_ptr">
10821           <outptr><jlong/></outptr>
10822           <description>
10823             On return, points to the CPU time used by the specified thread
10824             in nanoseconds.
10825             This is an unsigned value.  If tested or printed as a jlong (signed value)
10826             it may appear to be a negative number.
10827           </description>
10828         </param>
10829       </parameters>
10830       <errors>
10831       </errors>
10832     </function>
10833 
10834     <function id="GetTimerInfo" phase="any" callbacksafe="safe" num="138">
10835       <synopsis>Get Timer Information</synopsis>
10836       <description>
10837         Get information about the
10838         <functionlink id="GetTime"/> timer.
10839         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10840         are filled in with details about the timer.
10841         This information will not change during a particular invocation of the VM.
10842       </description>
10843       <origin>new</origin>
10844       <capabilities>
10845       </capabilities>
10846       <parameters>
10847         <param id="info_ptr">
10848           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10849           <description>
10850             On return, filled with information describing the time
10851             returned by <functionlink id="GetTime"/>.
10852           </description>
10853         </param>
10854       </parameters>
10855       <errors>
10856       </errors>
10857     </function>
10858 
10859     <function id="GetTime" phase="any" callbacksafe="safe" num="139">
10860       <synopsis>Get Time</synopsis>
10861       <description>
10862           Return the current value of the system timer, in nanoseconds.
10863           <p/>
10864           The value returned represents nanoseconds since some fixed but
10865           arbitrary time (perhaps in the future, so values may be
10866           negative).  This function provides nanosecond precision, but not
10867           necessarily nanosecond accuracy. No guarantees are made about
10868           how frequently values change.
10869           <p/>
10870           Get information about this timer with
10871           <functionlink id="GetTimerInfo"/>.
10872       </description>
10873       <origin>new</origin>
10874       <capabilities>
10875       </capabilities>
10876       <parameters>
10877         <param id="nanos_ptr">
10878           <outptr><jlong/></outptr>
10879           <description>
10880             On return, points to the time in nanoseconds.
10881             This is an unsigned value.  If tested or printed as a jlong (signed value)
10882             it may appear to be a negative number.
10883           </description>
10884         </param>
10885       </parameters>
10886       <errors>
10887       </errors>
10888     </function>
10889 
10890     <function id="GetAvailableProcessors" phase="any" num="144">
10891       <synopsis>Get Available Processors</synopsis>
10892       <description>
10893           Returns the number of processors available to the Java virtual machine.
10894           <p/>
10895           This value may change during a particular invocation of the virtual machine.
10896           Applications that are sensitive to the number of available processors should
10897           therefore occasionally poll this property.
10898       </description>
10899       <origin>new</origin>
10900       <capabilities>
10901       </capabilities>
10902       <parameters>
10903         <param id="processor_count_ptr">
10904           <outptr><jint/></outptr>
10905           <description>
10906             On return, points to the maximum number of processors available to the
10907             virtual machine; never smaller than one.
10908           </description>
10909         </param>
10910       </parameters>
10911       <errors>
10912       </errors>
10913     </function>
10914 
10915   </category>
10916 
10917 
10918   <category id="classLoaderSearch" label="Class Loader Search">
10919 
10920     <intro>
10921       These functions allow the agent to add to the locations that a class loader searches for a class.
10922       This is useful for installing instrumentation under the correct class loader.
10923     </intro>
10924 
10925     <function id="AddToBootstrapClassLoaderSearch" jkernel="yes" phase="onload" num="149">
10926       <synopsis>Add To Bootstrap Class Loader Search</synopsis>
10927       <description>
10928           This function can be used to cause instrumentation classes to be defined by the
10929           bootstrap class loader. See <vmspec chapter="5.3.1"/>.
10930           After the bootstrap
10931           class loader unsuccessfully searches for a class, the specified platform-dependent
10932           search path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in
10933           the <paramlink id="segment"/>. This function may be called multiple times to add multiple segments,
10934           the segments will be searched in the order that this function was called.
10935           <p/>
10936           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
10937           search path segment to be searched after the bootstrap class loader unsuccessfully searches
10938           for a class. The segment is typically a directory or JAR file.
10939           <p/>
10940           In the live phase the <paramlink id="segment"/> may be used to specify any platform-dependent
10941           path to a <externallink id="jar/jar.html">
10942           JAR file</externallink>. The agent should take care that the JAR file does not
10943           contain any classes or resources other than those to be defined by the bootstrap
10944           class loader for the purposes of instrumentation.
10945           <p/>
10946           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
10947           reference that the Java virtual machine has previously unsuccessfully attempted
10948           to resolve always fails with the same error that was thrown as a result of the
10949           initial resolution attempt. Consequently, if the JAR file contains an entry
10950           that corresponds to a class for which the Java virtual machine has
10951           unsuccessfully attempted to resolve a reference, then subsequent attempts to
10952           resolve that reference will fail with the same error as the initial attempt.
10953       </description>
10954       <origin>new</origin>
10955       <capabilities>
10956       </capabilities>
10957       <parameters>
10958         <param id="segment">
10959           <inbuf><char/></inbuf>
10960           <description>
10961             The platform-dependent search path segment, encoded as a
10962             <internallink id="mUTF">modified UTF-8</internallink> string.
10963           </description>
10964         </param>
10965       </parameters>
10966       <errors>
10967         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
10968           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
10969            existing JAR file is an invalid path.
10970         </error>
10971       </errors>
10972     </function>
10973 
10974     <function id="AddToSystemClassLoaderSearch" jkernel="yes" phase="onload" num="151" since="1.1">
10975       <synopsis>Add To System Class Loader Search</synopsis>
10976       <description>
10977           This function can be used to cause instrumentation classes to be
10978           defined by the system class loader. See <vmspec chapter="5.3.2"/>.
10979           After the class loader unsuccessfully searches for a class, the specified platform-dependent search
10980           path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in the
10981           <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, the
10982           segments will be searched in the order that this function was called.
10983           <p/>
10984           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
10985           search path segment to be searched after the system class loader unsuccessfully searches
10986           for a class. The segment is typically a directory or JAR file.
10987           <p/>
10988           In the live phase the <paramlink id="segment"/> is a platform-dependent path to a
10989           <externallink id="jar/jar.html">JAR file</externallink> to be
10990           searched after the system class loader unsuccessfully searches for a class. The agent should
10991           take care that the JAR file does not contain any classes or resources other than those to be
10992           defined by the system class loader for the purposes of instrumentation.
10993           <p/>
10994           In the live phase the system class loader supports adding a JAR file to be searched if
10995           the system class loader implements a method name <code>appendToClassPathForInstrumentation</code>
10996           which takes a single parameter of type <code>java.lang.String</code>. The method is not required
10997           to have <code>public</code> access.
10998           <p/>
10999           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
11000           reference that the Java virtual machine has previously unsuccessfully attempted
11001           to resolve always fails with the same error that was thrown as a result of the
11002           initial resolution attempt. Consequently, if the JAR file contains an entry
11003           that corresponds to a class for which the Java virtual machine has
11004           unsuccessfully attempted to resolve a reference, then subsequent attempts to
11005           resolve that reference will fail with the same error as the initial attempt.
11006       </description>
11007       <origin>new</origin>
11008       <capabilities>
11009       </capabilities>
11010       <parameters>
11011         <param id="segment">
11012           <inbuf><char/></inbuf>
11013           <description>
11014             The platform-dependent search path segment, encoded as a
11015             <internallink id="mUTF">modified UTF-8</internallink> string.
11016           </description>
11017         </param>
11018       </parameters>
11019       <errors>
11020         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11021           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
11022            existing JAR file is an invalid path.
11023         </error>
11024         <error id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED">
11025           Operation not supported by the system class loader.
11026         </error>
11027       </errors>
11028     </function>
11029 
11030   </category>
11031 
11032 
11033   <category id="props" label="System Properties">
11034 
11035     <intro>
11036       These functions get and set system properties.
11037     </intro>
11038 
11039     <function id="GetSystemProperties" phase="onload" num="130">
11040       <synopsis>Get System Properties</synopsis>
11041       <description>
11042         The list of VM system property keys which may be used with
11043         <functionlink id="GetSystemProperty"/> is returned.
11044         It is strongly recommended that virtual machines provide the
11045         following property keys:
11046         <ul>
11047           <li><code>java.vm.vendor</code></li>
11048           <li><code>java.vm.version</code></li>
11049           <li><code>java.vm.name</code></li>
11050           <li><code>java.vm.info</code></li>
11051           <li><code>java.library.path</code></li>
11052           <li><code>java.class.path</code></li>
11053         </ul>
11054         Provides access to system properties defined by and used
11055         by the VM.
11056         Properties set on the command-line are included.
11057         This allows getting and setting of these properties
11058         before the VM even begins executing bytecodes.
11059         Since this is a VM view of system properties, the set of available
11060         properties will usually be different than that
11061         in <code>java.lang.System.getProperties</code>.
11062         JNI method invocation may be used to access
11063         <code>java.lang.System.getProperties</code>.
11064         <p/>
11065         The set of properties may grow during execution.
11066       </description>
11067       <origin>new</origin>
11068       <capabilities>
11069       </capabilities>
11070       <parameters>
11071         <param id="count_ptr">
11072           <outptr><jint/></outptr>
11073           <description>
11074             On return, points to the number of property keys returned.
11075           </description>
11076         </param>
11077         <param id="property_ptr">
11078           <allocallocbuf outcount="count_ptr"><char/></allocallocbuf>
11079           <description>
11080             On return, points to an array of property keys, encoded as
11081             <internallink id="mUTF">modified UTF-8</internallink> strings.
11082           </description>
11083         </param>
11084       </parameters>
11085       <errors>
11086       </errors>
11087     </function>
11088 
11089     <function id="GetSystemProperty" phase="onload" num="131">
11090       <synopsis>Get System Property</synopsis>
11091       <description>
11092         Return a VM system property value given the property key.
11093         <p/>
11094         The function <functionlink id="GetSystemProperties"/>
11095         returns the set of property keys which may be used.
11096         The properties which can be retrieved may grow during
11097         execution.
11098         <p/>
11099         Since this is a VM view of system properties, the values
11100         of properties may differ from that returned by
11101         <code>java.lang.System.getProperty(String)</code>.
11102         A typical VM might copy the values of the VM system
11103         properties into the <code>Properties</code> held by
11104         <code>java.lang.System</code> during the initialization
11105         of that class. Thereafter any changes to the VM system
11106         properties (with <functionlink id="SetSystemProperty"/>)
11107         or the <code>java.lang.System</code> system properties
11108         (with <code>java.lang.System.setProperty(String,String)</code>)
11109         would cause the values to diverge.
11110         JNI method invocation may be used to access
11111         <code>java.lang.System.getProperty(String)</code>.
11112       </description>
11113       <origin>new</origin>
11114       <capabilities>
11115       </capabilities>
11116       <parameters>
11117         <param id="property">
11118           <inbuf><char/></inbuf>
11119           <description>
11120             The key of the property to retrieve, encoded as a
11121             <internallink id="mUTF">modified UTF-8</internallink> string.
11122           </description>
11123         </param>
11124         <param id="value_ptr">
11125           <allocbuf><char/></allocbuf>
11126           <description>
11127             On return, points to the property value, encoded as a
11128             <internallink id="mUTF">modified UTF-8</internallink> string.
11129           </description>
11130         </param>
11131       </parameters>
11132       <errors>
11133         <error id="JVMTI_ERROR_NOT_AVAILABLE">
11134           This property is not available.
11135           Use <functionlink id="GetSystemProperties"/> to find available properties.
11136         </error>
11137       </errors>
11138     </function>
11139 
11140     <function id="SetSystemProperty" phase="onloadOnly" num="132">
11141       <synopsis>Set System Property</synopsis>
11142       <description>
11143         Set a VM system property value.
11144         <p/>
11145         The function <functionlink id="GetSystemProperties"/>
11146         returns the set of property keys, some of these may be settable.
11147         See <functionlink id="GetSystemProperty"/>.
11148       </description>
11149       <origin>new</origin>
11150       <capabilities>
11151       </capabilities>
11152       <parameters>
11153         <param id="property">
11154           <inbuf><char/></inbuf>
11155           <description>
11156             The key of the property, encoded as a
11157             <internallink id="mUTF">modified UTF-8</internallink> string.
11158           </description>
11159         </param>
11160         <param id="value_ptr">
11161           <inbuf>
11162             <char/>
11163             <nullok>
11164               do not set the value, but return <errorlink id="JVMTI_ERROR_NOT_AVAILABLE"/>
11165               if the property is not writeable
11166             </nullok>
11167           </inbuf>
11168           <description>
11169             The property value to set, encoded as a
11170             <internallink id="mUTF">modified UTF-8</internallink> string.
11171           </description>
11172         </param>
11173       </parameters>
11174       <errors>
11175         <error id="JVMTI_ERROR_NOT_AVAILABLE">
11176           This property is not available or is not writeable.
11177         </error>
11178       </errors>
11179     </function>
11180 
11181   </category>
11182 
11183   <category id="general" label="General">
11184 
11185     <intro>
11186     </intro>
11187 
11188     <function id="GetPhase" jkernel="yes" phase="any" num="133">
11189       <synopsis>Get Phase</synopsis>
11190       <description>
11191           Return the current phase of VM execution.
11192           The phases proceed in sequence:
11193           <constants id="jvmtiPhase" label="Phases of execution" kind="enum">
11194             <constant id="JVMTI_PHASE_ONLOAD" num="1">
11195               <code>OnLoad</code> phase: while in the
11196               <internallink id="onload"><code>Agent_OnLoad</code></internallink>
11197               or, for statically linked agents, the <internallink id="onload">
11198               <code>Agent_OnLoad_&lt;agent-lib-name&gt;
11199               </code></internallink> function.
11200             </constant>
11201             <constant id="JVMTI_PHASE_PRIMORDIAL" num="2">
11202               Primordial phase: between return from <code>Agent_OnLoad</code>
11203               or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> and the
11204               <code>VMStart</code> event.
11205             </constant>
11206             <constant id="JVMTI_PHASE_START" num="6">
11207               Start phase: when the <eventlink id="VMStart"><code>VMStart</code></eventlink> event
11208               is sent and until the <code>VMInit</code> event is sent.
11209             </constant>
11210             <constant id="JVMTI_PHASE_LIVE" num="4">
11211               Live phase: when the <eventlink id="VMInit"><code>VMInit</code></eventlink> event is sent
11212               and until the <eventlink id="VMDeath"></eventlink> event returns.
11213             </constant>
11214             <constant id="JVMTI_PHASE_DEAD" num="8">
11215               Dead phase: after the <eventlink id="VMDeath"></eventlink> event returns or after
11216               start-up failure.
11217             </constant>
11218           </constants>
11219           In the case of start-up failure the VM will proceed directly to the dead
11220           phase skipping intermediate phases and neither a <code>VMInit</code> nor
11221           <code>VMDeath</code> event will be sent.
11222           <p/>
11223           Most <jvmti/> functions operate only in the live phase.
11224           The following functions operate in either the <code>OnLoad</code> or live phases:
11225           <functionphaselist phase="onload"/>
11226           The following functions operate in only the <code>OnLoad</code> phase:
11227           <functionphaselist phase="onloadOnly"/>
11228           The following functions operate in the start or live phases:
11229           <functionphaselist phase="start"/>
11230           The following functions operate in any phase:
11231           <functionphaselist phase="any"/>
11232           JNI functions (except the Invocation API) must only be used in the start or live phases.
11233           <p/>
11234           Most <jvmti/> events are sent only in the live phase.
11235           The following events operate in others phases:
11236           <eventphaselist phase="start"/>
11237           <eventphaselist phase="any"/>
11238       </description>
11239       <origin>new</origin>
11240       <capabilities>
11241       </capabilities>
11242       <parameters>
11243         <param id="phase_ptr">
11244           <outptr><enum>jvmtiPhase</enum></outptr>
11245           <description>
11246             On return, points to the phase.
11247           </description>
11248         </param>
11249       </parameters>
11250       <errors>
11251       </errors>
11252     </function>
11253 
11254     <function id="DisposeEnvironment" jkernel="yes" phase="any" num="127">
11255       <synopsis>Dispose Environment</synopsis>
11256       <description>
11257         Shutdown a <jvmti/> connection created with JNI <code>GetEnv</code>
11258         (see <internallink id="environments"><jvmti/> Environments</internallink>).
11259         Dispose of any resources held by the environment.
11260         <issue>
11261             What resources are reclaimed? What is undone?
11262             Breakpoints,watchpoints removed?
11263         </issue>
11264         Threads suspended by this environment are not resumed by this call,
11265         this must be done explicitly by the agent.
11266         Memory allocated by this environment via calls to <jvmti/> functions
11267         is not released, this can be done explicitly by the agent
11268         by calling <functionlink id="Deallocate"/>.
11269         Raw monitors created by this environment are not destroyed,
11270         this can be done explicitly by the agent
11271         by calling <functionlink id="DestroyRawMonitor"/>.
11272         The state of threads waiting on raw monitors created by this environment
11273         are not affected.
11274         <p/>
11275         Any <functionlink id="SetNativeMethodPrefix">native method
11276         prefixes</functionlink> for this environment will be unset;
11277         the agent must remove any prefixed native methods before
11278         dispose is called.
11279         <p/>
11280         Any <internallink id="capability">capabilities</internallink>
11281         held by this environment are relinquished.
11282         <p/>
11283         Events enabled by this environment will no longer be sent, however
11284         event handlers currently running will continue to run.  Caution must
11285         be exercised in the design of event handlers whose environment may
11286         be disposed and thus become invalid during their execution.
11287         <p/>
11288         This environment may not be used after this call.
11289         This call returns to the caller.
11290       </description>
11291       <origin>new</origin>
11292       <capabilities>
11293       </capabilities>
11294       <parameters>
11295       </parameters>
11296       <errors>
11297       </errors>
11298     </function>
11299 
11300     <function id="SetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="148">
11301       <synopsis>Set Environment Local Storage</synopsis>
11302       <description>
11303         The VM stores a pointer value associated with each environment.
11304         This pointer value is called <i>environment-local storage</i>.
11305         This value is <code>NULL</code> unless set with this function.
11306         Agents can allocate memory in which they store environment specific
11307         information. By setting environment-local storage it can then be
11308         accessed with
11309         <functionlink id="GetEnvironmentLocalStorage"></functionlink>.
11310         <p/>
11311         Called by the agent to set the value of the <jvmti/>
11312         environment-local storage. <jvmti/> supplies to the agent a pointer-size
11313         environment-local storage that can be used to record per-environment
11314         information.
11315       </description>
11316       <origin>new</origin>
11317       <capabilities>
11318       </capabilities>
11319       <parameters>
11320         <param id="data">
11321           <inbuf>
11322             <void/>
11323             <nullok>value is set to <code>NULL</code></nullok>
11324           </inbuf>
11325           <description>
11326             The value to be entered into the environment-local storage.
11327           </description>
11328         </param>
11329       </parameters>
11330       <errors>
11331       </errors>
11332     </function>
11333 
11334     <function id="GetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="147">
11335       <synopsis>Get Environment Local Storage</synopsis>
11336       <description>
11337         Called by the agent to get the value of the <jvmti/> environment-local
11338         storage.
11339       </description>
11340       <origin>new</origin>
11341       <capabilities>
11342       </capabilities>
11343       <parameters>
11344         <param id="data_ptr">
11345           <agentbuf><void/></agentbuf>
11346           <description>
11347             Pointer through which the value of the environment local
11348             storage is returned.
11349             If environment-local storage has not been set with
11350             <functionlink id="SetEnvironmentLocalStorage"></functionlink> returned
11351             pointer is <code>NULL</code>.
11352           </description>
11353         </param>
11354       </parameters>
11355       <errors>
11356       </errors>
11357     </function>
11358 
11359     <function id="GetVersionNumber" jkernel="yes" phase="any" num="88">
11360       <synopsis>Get Version Number</synopsis>
11361       <description>
11362         Return the <jvmti/> version via <code>version_ptr</code>.
11363         The return value is the version identifier.
11364         The version identifier includes major, minor and micro
11365         version as well as the interface type.
11366         <constants id="jvmtiVersionInterfaceTypes" label="Version Interface Types" kind="bits">
11367           <constant id="JVMTI_VERSION_INTERFACE_JNI" num="0x00000000">
11368             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for JNI.
11369           </constant>
11370           <constant id="JVMTI_VERSION_INTERFACE_JVMTI" num="0x30000000">
11371             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for <jvmti/>.
11372           </constant>
11373         </constants>
11374         <constants id="jvmtiVersionMasks" label="Version Masks" kind="bits">
11375           <constant id="JVMTI_VERSION_MASK_INTERFACE_TYPE" num="0x70000000">
11376             Mask to extract interface type.
11377             The value of the version returned by this function masked with
11378             <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> is always
11379             <code>JVMTI_VERSION_INTERFACE_JVMTI</code>
11380             since this is a <jvmti/> function.
11381           </constant>
11382           <constant id="JVMTI_VERSION_MASK_MAJOR" num="0x0FFF0000">
11383             Mask to extract major version number.
11384           </constant>
11385           <constant id="JVMTI_VERSION_MASK_MINOR" num="0x0000FF00">
11386             Mask to extract minor version number.
11387           </constant>
11388           <constant id="JVMTI_VERSION_MASK_MICRO" num="0x000000FF">
11389             Mask to extract micro version number.
11390           </constant>
11391         </constants>
11392         <constants id="jvmtiVersionShifts" label="Version Shifts" kind="bits">
11393           <constant id="JVMTI_VERSION_SHIFT_MAJOR" num="16">
11394             Shift to extract major version number.
11395           </constant>
11396           <constant id="JVMTI_VERSION_SHIFT_MINOR" num="8">
11397             Shift to extract minor version number.
11398           </constant>
11399           <constant id="JVMTI_VERSION_SHIFT_MICRO" num="0">
11400             Shift to extract micro version number.
11401           </constant>
11402         </constants>
11403       </description>
11404       <origin>jvmdi</origin>
11405       <capabilities>
11406       </capabilities>
11407       <parameters>
11408         <param id="version_ptr">
11409           <outptr><jint/></outptr>
11410           <description>
11411             On return, points to the <jvmti/> version.
11412           </description>
11413         </param>
11414       </parameters>
11415       <errors>
11416       </errors>
11417     </function>
11418 
11419 
11420     <function id="GetErrorName" phase="any" num="128">
11421       <synopsis>Get Error Name</synopsis>
11422       <description>
11423         Return the symbolic name for an
11424           <internallink id="ErrorSection">error code</internallink>.
11425         <p/>
11426         For example
11427         <code>GetErrorName(env, JVMTI_ERROR_NONE, &amp;err_name)</code>
11428         would return in <code>err_name</code> the string
11429         <code>"JVMTI_ERROR_NONE"</code>.
11430       </description>
11431       <origin>new</origin>
11432       <capabilities>
11433       </capabilities>
11434       <parameters>
11435         <param id="error">
11436           <enum>jvmtiError</enum>
11437           <description>
11438             The error code.
11439           </description>
11440         </param>
11441         <param id="name_ptr">
11442           <allocbuf><char/></allocbuf>
11443           <description>
11444             On return, points to the error name.
11445             The name is encoded as a
11446             <internallink id="mUTF">modified UTF-8</internallink> string,
11447             but is restricted to the ASCII subset.
11448           </description>
11449         </param>
11450       </parameters>
11451       <errors>
11452       </errors>
11453     </function>
11454 
11455     <function id="SetVerboseFlag" phase="any" num="150">
11456       <synopsis>Set Verbose Flag</synopsis>
11457       <description>
11458         <constants id="jvmtiVerboseFlag" label="Verbose Flag Enumeration" kind="enum">
11459           <constant id="JVMTI_VERBOSE_OTHER" num="0">
11460             Verbose output other than the below.
11461           </constant>
11462           <constant id="JVMTI_VERBOSE_GC" num="1">
11463             Verbose garbage collector output, like that specified with <code>-verbose:gc</code>.
11464           </constant>
11465           <constant id="JVMTI_VERBOSE_CLASS" num="2">
11466             Verbose class loading output, like that specified with <code>-verbose:class</code>.
11467           </constant>
11468           <constant id="JVMTI_VERBOSE_JNI" num="4">
11469             Verbose JNI output, like that specified with <code>-verbose:jni</code>.
11470           </constant>
11471         </constants>
11472         Control verbose output.
11473         This is the output which typically is sent to <code>stderr</code>.
11474       </description>
11475       <origin>new</origin>
11476       <capabilities>
11477       </capabilities>
11478       <parameters>
11479         <param id="flag">
11480           <enum>jvmtiVerboseFlag</enum>
11481           <description>
11482             Which verbose flag to set.
11483           </description>
11484         </param>
11485         <param id="value">
11486           <jboolean/>
11487           <description>
11488             New value of the flag.
11489           </description>
11490         </param>
11491       </parameters>
11492       <errors>
11493       </errors>
11494     </function>
11495 
11496 
11497     <function id="GetJLocationFormat" phase="any" num="129">
11498       <synopsis>Get JLocation Format</synopsis>
11499       <description>
11500         Although the greatest functionality is achieved with location information
11501         referencing the virtual machine bytecode index, the definition of
11502         <code>jlocation</code> has intentionally been left unconstrained to allow VM
11503         implementations that do not have this information.
11504         <p/>
11505         This function describes the representation of <code>jlocation</code> used in this VM.
11506         If the returned format is <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>,
11507         <code>jlocation</code>s can
11508         be used as in indices into the array returned by
11509         <functionlink id="GetBytecodes"></functionlink>.
11510         <constants id="jvmtiJlocationFormat" label="JLocation Format Enumeration" kind="enum">
11511           <constant id="JVMTI_JLOCATION_JVMBCI" num="1">
11512             <code>jlocation</code> values represent virtual machine
11513             bytecode indices--that is, offsets into the
11514             virtual machine code for a method.
11515           </constant>
11516           <constant id="JVMTI_JLOCATION_MACHINEPC" num="2">
11517             <code>jlocation</code> values represent native machine
11518             program counter values.
11519           </constant>
11520           <constant id="JVMTI_JLOCATION_OTHER" num="0">
11521             <code>jlocation</code> values have some other representation.
11522           </constant>
11523         </constants>
11524       </description>
11525       <origin>new</origin>
11526       <capabilities>
11527       </capabilities>
11528       <parameters>
11529         <param id="format_ptr">
11530           <outptr><enum>jvmtiJlocationFormat</enum></outptr>
11531           <description>
11532             On return, points to the format identifier for <code>jlocation</code> values.
11533           </description>
11534         </param>
11535       </parameters>
11536       <errors>
11537       </errors>
11538     </function>
11539 
11540   </category>
11541 
11542   <category id="heap_monitoring" label="Heap Monitoring">
11543     <function id="SetHeapSamplingRate" phase="onload" num="156" since="11">
11544       <synopsis>Set Heap Sampling Rate</synopsis>
11545       <description>
11546         Set up the allocation system to sample memory allocations at a given
11547         average rate via the <paramlink id="sampling_rate"></paramlink> parameter, defined
11548         by sampling rate in bytes. The
11549         <paramlink id="sampling_rate"></paramlink> will be the average sampling rate in bytes used throughout
11550         the execution.
11551         <p/>
11552         Setting <paramlink id="sampling_rate"></paramlink> to 0 samples each allocation supported by the system.
11553         Combined with a <eventlink id="SampledObjectAlloc"/> event, the Java agent can obtain object allocations with a given sample rate.
11554       </description>
11555       <origin>new</origin>
11556       <capabilities>
11557         <required id="can_generate_sampled_alloc_events"></required>
11558       </capabilities>
11559       <parameters>
11560         <param id="sampling_rate">
11561           <jint/>
11562           <description>
11563             The sampling rate in bytes used for sampling. The sampler will use a statistical approach to
11564             provide in average sampling every <paramlink id="sampling_rate"/> allocated bytes.
11565             <p/>
11566             Passing 0 as a sampling rate provokes a sample per allocation by the system.
11567             <p/>
11568             Note: a low sampling rate, such as sampling every 1024 bytes, will probably incur a high overhead.
11569             Due to the incurred overhead, the sampler should only be used when knowing it may impact performance.
11570             On the other hand, sampling however every 1024kB has a far less chance of a high overhead since it will sample
11571             1024 times less than the 1024-byte sampling.
11572           </description>
11573         </param>
11574       </parameters>
11575       <errors>
11576         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11577           <paramlink id="sampling_rate"></paramlink> is less than zero.
11578         </error>
11579       </errors>
11580     </function>
11581   </category>
11582 
11583 </functionsection>
11584 
11585 <errorsection label="Error Reference">
11586   <intro>
11587     Every <jvmti/> function returns a <b><code>jvmtiError</code></b> error code.
11588     <p/>
11589     It is the responsibility of the agent to call <jvmti/> functions with
11590     valid parameters and in the proper context (calling thread is attached,
11591     phase is correct, etc.).
11592     Detecting some error conditions may be difficult, inefficient, or
11593     impossible for an implementation.
11594     The errors listed in
11595     <internallink id="reqerrors">Function Specific Required Errors</internallink>
11596     must be detected by the implementation.
11597     All other errors represent the recommended response to the error
11598     condition.
11599   </intro>
11600 
11601   <errorcategory id="universal-error" label="Universal Errors">
11602     <intro>
11603       The following errors may be returned by any function
11604     </intro>
11605 
11606     <errorid id="JVMTI_ERROR_NONE" num="0">
11607       No error has occurred.  This is the error code that is returned
11608       on successful completion of the function.
11609     </errorid>
11610     <errorid id="JVMTI_ERROR_NULL_POINTER" num="100">
11611       Pointer is unexpectedly <code>NULL</code>.
11612     </errorid>
11613     <errorid id="JVMTI_ERROR_OUT_OF_MEMORY" num="110">
11614       The function attempted to allocate memory and no more memory was
11615       available for allocation.
11616     </errorid>
11617     <errorid id="JVMTI_ERROR_ACCESS_DENIED" num="111">
11618       The desired functionality has not been enabled in this virtual machine.
11619     </errorid>
11620     <errorid id="JVMTI_ERROR_UNATTACHED_THREAD" num="115">
11621       The thread being used to call this function is not attached
11622       to the virtual machine.  Calls must be made from attached threads.
11623       See <code>AttachCurrentThread</code> in the JNI invocation API.
11624     </errorid>
11625     <errorid id="JVMTI_ERROR_INVALID_ENVIRONMENT" num="116">
11626       The <jvmti/> environment provided is no longer connected or is
11627       not an environment.
11628     </errorid>
11629     <errorid id="JVMTI_ERROR_WRONG_PHASE" num="112">
11630       The desired functionality is not available in the current
11631         <functionlink id="GetPhase">phase</functionlink>.
11632       Always returned if the virtual machine has completed running.
11633     </errorid>
11634     <errorid id="JVMTI_ERROR_INTERNAL" num="113">
11635       An unexpected internal error has occurred.
11636     </errorid>
11637   </errorcategory>
11638 
11639   <errorcategory id="reqerrors" label="Function Specific Required Errors">
11640     <intro>
11641       The following errors are returned by some <jvmti/> functions and must
11642       be returned by the implementation when the condition occurs.
11643     </intro>
11644 
11645     <errorid id="JVMTI_ERROR_INVALID_PRIORITY" num="12">
11646       Invalid priority.
11647     </errorid>
11648     <errorid id="JVMTI_ERROR_THREAD_NOT_SUSPENDED" num="13">
11649       Thread was not suspended.
11650     </errorid>
11651     <errorid id="JVMTI_ERROR_THREAD_SUSPENDED" num="14">
11652       Thread already suspended.
11653     </errorid>
11654     <errorid id="JVMTI_ERROR_THREAD_NOT_ALIVE" num="15">
11655       This operation requires the thread to be alive--that is,
11656       it must be started and not yet have died.
11657     </errorid>
11658     <errorid id="JVMTI_ERROR_CLASS_NOT_PREPARED" num="22">
11659       The class has been loaded but not yet prepared.
11660     </errorid>
11661     <errorid id="JVMTI_ERROR_NO_MORE_FRAMES" num="31">
11662       There are no Java programming language or JNI stack frames at the specified depth.
11663     </errorid>
11664     <errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32">
11665       Information about the frame is not available (e.g. for native frames).
11666     </errorid>
11667     <errorid id="JVMTI_ERROR_DUPLICATE" num="40">
11668       Item already set.
11669     </errorid>
11670     <errorid id="JVMTI_ERROR_NOT_FOUND" num="41">
11671       Desired element (e.g. field or breakpoint) not found
11672     </errorid>
11673     <errorid id="JVMTI_ERROR_NOT_MONITOR_OWNER" num="51">
11674       This thread doesn't own the raw monitor.
11675     </errorid>
11676     <errorid id="JVMTI_ERROR_INTERRUPT" num="52">
11677       The call has been interrupted before completion.
11678     </errorid>
11679     <errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79">
11680       The class cannot be modified.
11681     </errorid>
11682     <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80">
11683       The module cannot be modified.
11684     </errorid>
11685     <errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98">
11686       The functionality is not available in this virtual machine.
11687     </errorid>
11688     <errorid id="JVMTI_ERROR_ABSENT_INFORMATION" num="101">
11689       The requested information is not available.
11690     </errorid>
11691     <errorid id="JVMTI_ERROR_INVALID_EVENT_TYPE" num="102">
11692       The specified event type ID is not recognized.
11693     </errorid>
11694     <errorid id="JVMTI_ERROR_NATIVE_METHOD" num="104">
11695       The requested information is not available for native method.
11696     </errorid>
11697     <errorid id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED" num="106">
11698       The class loader does not support this operation.
11699     </errorid>
11700   </errorcategory>
11701 
11702   <errorcategory id="function-specific-errors" label="Function Specific Agent Errors">
11703     <intro>
11704       The following errors are returned by some <jvmti/> functions.
11705       They are returned in the event of invalid parameters passed by the
11706       agent or usage in an invalid context.
11707       An implementation is not required to detect these errors.
11708     </intro>
11709 
11710     <errorid id="JVMTI_ERROR_INVALID_THREAD" num="10">
11711       The passed thread is not a valid thread.
11712     </errorid>
11713     <errorid id="JVMTI_ERROR_INVALID_FIELDID" num="25">
11714       Invalid field.
11715     </errorid>
11716     <errorid id="JVMTI_ERROR_INVALID_MODULE" num="26">
11717       Invalid module.
11718     </errorid>
11719     <errorid id="JVMTI_ERROR_INVALID_METHODID" num="23">
11720       Invalid method.
11721     </errorid>
11722     <errorid id="JVMTI_ERROR_INVALID_LOCATION" num="24">
11723       Invalid location.
11724     </errorid>
11725     <errorid id="JVMTI_ERROR_INVALID_OBJECT" num="20">
11726       Invalid object.
11727     </errorid>
11728     <errorid id="JVMTI_ERROR_INVALID_CLASS" num="21">
11729       Invalid class.
11730     </errorid>
11731     <errorid id="JVMTI_ERROR_TYPE_MISMATCH" num="34">
11732       The variable is not an appropriate type for the function used.
11733     </errorid>
11734     <errorid id="JVMTI_ERROR_INVALID_SLOT" num="35">
11735       Invalid slot.
11736     </errorid>
11737     <errorid id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY" num="99">
11738       The capability being used is false in this environment.
11739     </errorid>
11740     <errorid id="JVMTI_ERROR_INVALID_THREAD_GROUP" num="11">
11741       Thread group invalid.
11742     </errorid>
11743     <errorid id="JVMTI_ERROR_INVALID_MONITOR" num="50">
11744       Invalid raw monitor.
11745     </errorid>
11746     <errorid id="JVMTI_ERROR_ILLEGAL_ARGUMENT" num="103">
11747       Illegal argument.
11748     </errorid>
11749     <errorid id="JVMTI_ERROR_INVALID_TYPESTATE" num="65">
11750       The state of the thread has been modified, and is now inconsistent.
11751     </errorid>
11752     <errorid id="JVMTI_ERROR_UNSUPPORTED_VERSION" num="68">
11753       A new class file has a version number not supported by this VM.
11754     </errorid>
11755     <errorid id="JVMTI_ERROR_INVALID_CLASS_FORMAT" num="60">
11756       A new class file is malformed (the VM would return a <code>ClassFormatError</code>).
11757     </errorid>
11758     <errorid id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION" num="61">
11759       The new class file definitions would lead to a circular
11760       definition (the VM would return a <code>ClassCircularityError</code>).
11761     </errorid>
11762     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED" num="63">
11763       A new class file would require adding a method.
11764     </errorid>
11765     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED" num="64">
11766       A new class version changes a field.
11767     </errorid>
11768     <errorid id="JVMTI_ERROR_FAILS_VERIFICATION" num="62">
11769       The class bytes fail verification.
11770     </errorid>
11771     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED" num="66">
11772       A direct superclass is different for the new class
11773       version, or the set of directly implemented
11774       interfaces is different.
11775     </errorid>
11776     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED" num="67">
11777       A new class version does not declare a method
11778       declared in the old class version.
11779     </errorid>
11780     <errorid id="JVMTI_ERROR_NAMES_DONT_MATCH" num="69">
11781       The class name defined in the new class file is
11782       different from the name in the old class object.
11783     </errorid>
11784     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED" num="70">
11785       A new class version has different modifiers.
11786     </errorid>
11787     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED" num="71">
11788       A method in the new class version has different modifiers
11789       than its counterpart in the old class version.
11790     </errorid>
11791   </errorcategory>
11792 </errorsection>
11793 
11794 <eventsection label="Events">
11795   <intro label="Handling Events" id="eventIntro">
11796     Agents can be informed of many events that occur in application
11797     programs.
11798     <p/>
11799     To handle events, designate a set of callback functions with
11800     <functionlink id="SetEventCallbacks"></functionlink>.
11801     For each event the corresponding callback function will be
11802     called.
11803     Arguments to the callback function provide additional
11804     information about the event.
11805     <p/>
11806     The callback function is usually called from within an application
11807     thread. The <jvmti/> implementation does not
11808     queue events in any way. This means
11809     that event callback functions must be written
11810     carefully. Here are some general guidelines. See
11811     the individual event descriptions for further
11812     suggestions.
11813     <p/>
11814     <ul>
11815       <li>Any exception thrown during the execution of an event callback can
11816         overwrite any current pending exception in the current application thread.
11817         Care must be taken to preserve a pending exception
11818         when an event callback makes a JNI call that might generate an exception.
11819       </li>
11820       <li>Event callback functions must be re-entrant. The <jvmti/> implementation does
11821         not queue events. If an agent needs to process events one at a time, it
11822         can use a raw monitor inside the
11823         event callback functions to serialize event processing.
11824       </li>
11825       <li>Event callback functions that execute JNI's FindClass function to load
11826         classes need to note that FindClass locates the class loader associated
11827         with the current native method. For the purposes of class loading, an
11828         event callback that includes a JNI environment as a parameter to the
11829         callback will treated as if it is a native call, where the native method
11830         is in the class of the event thread's current frame.
11831       </li>
11832     </ul>
11833     <p/>
11834     Some <jvmti/> events identify objects with JNI references.
11835     All references
11836     in <jvmti/> events are JNI local references and will become invalid
11837     after the event callback returns.
11838     Unless stated otherwise, memory referenced by pointers sent in event
11839     callbacks may not be referenced after the event callback returns.
11840     <p/>
11841     Except where stated otherwise, events are delivered on the thread
11842     that caused the event.
11843     Events are sent at the time they occur.
11844     The specification for each event includes the set of
11845     <functionlink id="GetPhase">phases</functionlink> in which it can be sent;
11846     if an event triggering activity occurs during another phase, no event
11847     is sent.
11848     <p/>
11849     A thread that generates an event does not change its execution status
11850     (for example, the event does not cause the thread to be suspended).
11851     If an agent wishes the event to result in suspension, then the agent
11852     is responsible for explicitly suspending the thread with
11853     <functionlink id="SuspendThread"></functionlink>.
11854     <p/>
11855     If an event is enabled in multiple environments, the event will be sent
11856     to each agent in the order that the environments were created.
11857   </intro>
11858 
11859   <intro label="Enabling Events" id="enablingevents">
11860     All events are initially disabled.  In order to receive any
11861     event:
11862       <ul>
11863         <li>
11864           If the event requires a capability, that capability must
11865           be added with
11866           <functionlink id="AddCapabilities"></functionlink>.
11867         </li>
11868         <li>
11869           A callback for the event must be set with
11870           <functionlink id="SetEventCallbacks"></functionlink>.
11871         </li>
11872         <li>
11873           The event must be enabled with
11874           <functionlink id="SetEventNotificationMode"></functionlink>.
11875         </li>
11876       </ul>
11877   </intro>
11878 
11879   <intro label="Multiple Co-located Events" id="eventorder">
11880     In many situations it is possible for multiple events to occur
11881     at the same location in one thread. When this happens, all the events
11882     are reported through the event callbacks in the order specified in this section.
11883     <p/>
11884     If the current location is at the entry point of a method, the
11885     <eventlink id="MethodEntry"></eventlink> event is reported before
11886     any other event at the current location in the same thread.
11887     <p/>
11888     If an exception catch has been detected at the current location,
11889     either because it is the beginning of a catch clause or a native method
11890     that cleared a pending exception has returned, the
11891     <code>exceptionCatch</code> event is reported before
11892     any other event at the current location in the same thread.
11893     <p/>
11894     If a <code>singleStep</code> event or
11895     <code>breakpoint</code> event is triggered at the
11896     current location, the event is defined to occur
11897     immediately before the code at the current location is executed.
11898     These events are reported before any events which are triggered
11899     by the execution of code at the current location in the same
11900     thread (specifically:
11901     <code>exception</code>,
11902     <code>fieldAccess</code>, and
11903     <code>fieldModification</code>).
11904     If both a step and breakpoint event are triggered for the same thread and
11905     location, the step event is reported before the breakpoint event.
11906     <p/>
11907     If the current location is the exit point of a method (that is, the last
11908     location before returning to the caller), the
11909     <eventlink id="MethodExit"></eventlink> event and
11910     the <eventlink id="FramePop"></eventlink> event (if requested)
11911     are reported after all other events at the current location in the same
11912     thread. There is no specified ordering of these two events
11913     with respect to each other.
11914     <p/>
11915     Co-located events can be triggered during the processing of some other
11916     event by the agent at the same location in the same thread.
11917     If such an event, of type <i>y</i>, is triggered during the processing of
11918     an event of type <i>x</i>, and if <i>x</i>
11919     precedes <i>y</i> in the ordering specified above, the co-located event
11920     <i>y</i> is reported for the current thread and location. If <i>x</i> does not precede
11921     <i>y</i>, <i>y</i> is not reported for the current thread and location.
11922     For example, if a breakpoint is set at the current location
11923     during the processing of <eventlink id="SingleStep"></eventlink>,
11924     that breakpoint will be reported before the thread moves off the current
11925     location.
11926     <p/>The following events are never considered to be co-located with
11927     other events.
11928     <ul>
11929       <li><eventlink id="VMStart"></eventlink></li>
11930       <li><eventlink id="VMInit"></eventlink></li>
11931       <li><eventlink id="VMDeath"></eventlink></li>
11932       <li><eventlink id="ThreadStart"></eventlink></li>
11933       <li><eventlink id="ThreadEnd"></eventlink></li>
11934       <li><eventlink id="ClassLoad"></eventlink></li>
11935       <li><eventlink id="ClassPrepare"></eventlink></li>
11936     </ul>
11937   </intro>
11938 
11939   <intro label="Event Callbacks" id="jvmtiEventCallbacks">
11940       The event callback structure below is used to specify the handler function
11941       for events.  It is set with the
11942       <functionlink id="SetEventCallbacks"></functionlink> function.
11943   </intro>
11944 
11945   <event label="Single Step"
11946          id="SingleStep" const="JVMTI_EVENT_SINGLE_STEP" filtered="thread" num="60">
11947     <description>
11948       Single step events allow the agent to trace thread execution
11949       at the finest granularity allowed by the VM. A single step event is
11950       generated whenever a thread reaches a new location.
11951       Typically, single step events represent the completion of one VM
11952       instruction as defined in <vmspec/>. However, some implementations
11953       may define locations differently. In any case the
11954       <code>method</code> and <code>location</code>
11955       parameters  uniquely identify the current location and allow
11956       the mapping to source file and line number when that information is
11957       available.
11958       <p/>
11959       No single step events are generated from within native methods.
11960     </description>
11961     <origin>jvmdi</origin>
11962     <capabilities>
11963       <required id="can_generate_single_step_events"></required>
11964     </capabilities>
11965     <parameters>
11966       <param id="jni_env">
11967         <outptr>
11968           <struct>JNIEnv</struct>
11969         </outptr>
11970           <description>
11971             The JNI environment of the event (current) thread
11972           </description>
11973       </param>
11974       <param id="thread">
11975         <jthread/>
11976           <description>
11977             Thread about to execution a new instruction
11978           </description>
11979       </param>
11980       <param id="klass">
11981         <jclass method="method"/>
11982           <description>
11983             Class of the method about to execute a new instruction
11984           </description>
11985       </param>
11986       <param id="method">
11987         <jmethodID class="klass"/>
11988           <description>
11989             Method about to execute a new instruction
11990           </description>
11991       </param>
11992       <param id="location">
11993         <jlocation/>
11994         <description>
11995           Location of the new instruction
11996         </description>
11997       </param>
11998     </parameters>
11999   </event>
12000 
12001   <event label="Breakpoint"
12002          id="Breakpoint" const="JVMTI_EVENT_BREAKPOINT" filtered="thread" num="62">
12003     <description>
12004       Breakpoint events are generated whenever a thread reaches a location
12005       designated as a breakpoint with <functionlink id="SetBreakpoint"></functionlink>.
12006       The <code>method</code> and <code>location</code>
12007       parameters uniquely identify the current location and allow
12008       the mapping to source file and line number when that information is
12009       available.
12010     </description>
12011     <origin>jvmdi</origin>
12012     <capabilities>
12013       <required id="can_generate_breakpoint_events"></required>
12014     </capabilities>
12015     <parameters>
12016       <param id="jni_env">
12017         <outptr>
12018           <struct>JNIEnv</struct>
12019         </outptr>
12020           <description>
12021             The JNI environment of the event (current) thread.
12022           </description>
12023       </param>
12024       <param id="thread">
12025         <jthread/>
12026           <description>
12027             Thread that hit the breakpoint
12028           </description>
12029       </param>
12030       <param id="klass">
12031         <jclass method="method"/>
12032           <description>
12033             Class of the method that hit the breakpoint
12034           </description>
12035       </param>
12036       <param id="method">
12037         <jmethodID class="klass"/>
12038           <description>
12039             Method that hit the breakpoint
12040           </description>
12041       </param>
12042       <param id="location">
12043         <jlocation/>
12044         <description>
12045           location of the breakpoint
12046         </description>
12047       </param>
12048     </parameters>
12049   </event>
12050 
12051   <event label="Field Access"
12052          id="FieldAccess" const="JVMTI_EVENT_FIELD_ACCESS" filtered="thread" num="63">
12053     <description>
12054       Field access events are generated whenever a thread accesses
12055       a field that was designated as a watchpoint
12056       with <functionlink id="SetFieldAccessWatch"></functionlink>.
12057       The <code>method</code> and <code>location</code>
12058       parameters uniquely identify the current location and allow
12059       the mapping to source file and line number when that information is
12060       available.
12061     </description>
12062     <origin>jvmdi</origin>
12063     <capabilities>
12064       <required id="can_generate_field_access_events"></required>
12065     </capabilities>
12066     <parameters>
12067       <param id="jni_env">
12068         <outptr>
12069           <struct>JNIEnv</struct>
12070         </outptr>
12071           <description>
12072             The JNI environment of the event (current) thread
12073           </description>
12074       </param>
12075       <param id="thread">
12076         <jthread/>
12077           <description>
12078             Thread accessing the field
12079           </description>
12080       </param>
12081       <param id="klass">
12082         <jclass method="method"/>
12083           <description>
12084             Class of the method where the access is occurring
12085           </description>
12086       </param>
12087       <param id="method">
12088         <jmethodID class="klass"/>
12089           <description>
12090             Method where the access is occurring
12091           </description>
12092       </param>
12093       <param id="location">
12094         <jlocation/>
12095         <description>
12096           Location where the access is occurring
12097         </description>
12098       </param>
12099       <param id="field_klass">
12100         <jclass field="field"/>
12101           <description>
12102             Class of the field being accessed
12103           </description>
12104       </param>
12105       <param id="object">
12106         <jobject/>
12107           <description>
12108             Object with the field being accessed if the field is an
12109             instance field; <code>NULL</code> otherwise
12110           </description>
12111       </param>
12112       <param id="field">
12113         <jfieldID class="field_klass"/>
12114           <description>
12115             Field being accessed
12116           </description>
12117       </param>
12118     </parameters>
12119   </event>
12120 
12121   <event label="Field Modification"
12122          id="FieldModification" const="JVMTI_EVENT_FIELD_MODIFICATION" filtered="thread" num="64">
12123     <description>
12124       Field modification events are generated whenever a thread modifies
12125       a field that was designated as a watchpoint
12126       with <functionlink id="SetFieldModificationWatch"></functionlink>.
12127       The <code>method</code> and <code>location</code>
12128       parameters uniquely identify the current location and allow
12129       the mapping to source file and line number when that information is
12130       available.
12131     </description>
12132     <origin>jvmdi</origin>
12133     <capabilities>
12134       <required id="can_generate_field_modification_events"></required>
12135     </capabilities>
12136     <parameters>
12137       <param id="jni_env">
12138         <outptr>
12139           <struct>JNIEnv</struct>
12140         </outptr>
12141           <description>
12142             The JNI environment of the event (current) thread
12143           </description>
12144       </param>
12145       <param id="thread">
12146         <jthread/>
12147           <description>
12148             Thread modifying the field
12149           </description>
12150       </param>
12151       <param id="klass">
12152         <jclass method="method"/>
12153           <description>
12154             Class of the method where the modification is occurring
12155           </description>
12156       </param>
12157       <param id="method">
12158         <jmethodID class="klass"/>
12159           <description>
12160             Method where the modification is occurring
12161           </description>
12162       </param>
12163       <param id="location">
12164         <jlocation/>
12165         <description>
12166           Location where the modification is occurring
12167         </description>
12168       </param>
12169       <param id="field_klass">
12170         <jclass field="field"/>
12171           <description>
12172             Class of the field being modified
12173           </description>
12174       </param>
12175       <param id="object">
12176         <jobject/>
12177           <description>
12178             Object with the field being modified if the field is an
12179             instance field; <code>NULL</code> otherwise
12180           </description>
12181       </param>
12182       <param id="field">
12183         <jfieldID class="field_klass"/>
12184           <description>
12185             Field being modified
12186           </description>
12187       </param>
12188       <param id="signature_type">
12189         <char/>
12190         <description>
12191           Signature type of the new value
12192         </description>
12193       </param>
12194       <param id="new_value">
12195         <jvalue/>
12196         <description>
12197           The new value
12198         </description>
12199       </param>
12200     </parameters>
12201   </event>
12202 
12203   <event label="Frame Pop"
12204          id="FramePop" const="JVMTI_EVENT_FRAME_POP" filtered="thread" num="61">
12205     <description>
12206       Frame pop events are generated upon exit from a single method
12207       in a single frame as specified
12208       in a call to <functionlink id="NotifyFramePop"></functionlink>.
12209       This is true whether termination is caused by
12210       executing its return instruction
12211       or by throwing an exception to its caller
12212       (see <paramlink id="was_popped_by_exception"></paramlink>).
12213       However, frame pops caused by the <functionlink id="PopFrame"/>
12214       function are not reported.
12215       <p/>
12216       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12217       identifies the executable location in the returning method,
12218       immediately prior to the return.
12219     </description>
12220     <origin>jvmdi</origin>
12221     <capabilities>
12222       <required id="can_generate_frame_pop_events"></required>
12223     </capabilities>
12224     <parameters>
12225       <param id="jni_env">
12226         <outptr>
12227           <struct>JNIEnv</struct>
12228         </outptr>
12229           <description>
12230             The JNI environment of the event (current) thread
12231           </description>
12232       </param>
12233       <param id="thread">
12234         <jthread/>
12235           <description>
12236             Thread that is popping the frame
12237           </description>
12238       </param>
12239       <param id="klass">
12240         <jclass method="method"/>
12241           <description>
12242             Class of the method being popped
12243           </description>
12244       </param>
12245       <param id="method">
12246         <jmethodID class="klass"/>
12247           <description>
12248             Method being popped
12249           </description>
12250       </param>
12251       <param id="was_popped_by_exception">
12252         <jboolean/>
12253         <description>
12254           True if frame was popped by a thrown exception.
12255           False if method exited through its return instruction.
12256         </description>
12257       </param>
12258     </parameters>
12259   </event>
12260 
12261   <event label="Method Entry"
12262          id="MethodEntry" const="JVMTI_EVENT_METHOD_ENTRY" filtered="thread" num="65">
12263     <description>
12264       Method entry events are generated upon entry of Java
12265       programming language methods (including native methods).
12266       <p/>
12267       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12268       identifies the initial executable location in
12269       the method.
12270       <p/>
12271       Enabling method
12272       entry or exit events will significantly degrade performance on many platforms and is thus
12273       not advised for performance critical usage (such as profiling).
12274       <internallink id="bci">Bytecode instrumentation</internallink> should be
12275       used in these cases.
12276     </description>
12277     <origin>jvmdi</origin>
12278     <capabilities>
12279       <required id="can_generate_method_entry_events"></required>
12280     </capabilities>
12281     <parameters>
12282       <param id="jni_env">
12283         <outptr>
12284           <struct>JNIEnv</struct>
12285         </outptr>
12286           <description>
12287             The JNI environment of the event (current) thread
12288           </description>
12289       </param>
12290       <param id="thread">
12291         <jthread/>
12292           <description>
12293             Thread entering the method
12294           </description>
12295       </param>
12296       <param id="klass">
12297         <jclass method="method"/>
12298           <description>
12299             Class of the method being entered
12300           </description>
12301       </param>
12302       <param id="method">
12303         <jmethodID class="klass"/>
12304           <description>
12305             Method being entered
12306           </description>
12307       </param>
12308     </parameters>
12309   </event>
12310 
12311   <event label="Method Exit"
12312          id="MethodExit" const="JVMTI_EVENT_METHOD_EXIT" filtered="thread" num="66">
12313     <description>
12314       Method exit events are generated upon exit from Java
12315       programming language methods (including native methods).
12316       This is true whether termination is caused by
12317       executing its return instruction
12318       or by throwing an exception to its caller
12319       (see <paramlink id="was_popped_by_exception"></paramlink>).
12320       <p/>
12321       The <code>method</code> field uniquely identifies the
12322       method being entered or exited. The <code>frame</code> field provides
12323       access to the stack frame for the method.
12324       <p/>
12325       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12326       identifies the executable location in the returning method
12327       immediately prior to the return.
12328       <p/>
12329         Enabling method
12330         entry or exit events will significantly degrade performance on many platforms and is thus
12331         not advised for performance critical usage (such as profiling).
12332         <internallink id="bci">Bytecode instrumentation</internallink> should be
12333         used in these cases.
12334     </description>
12335     <origin>jvmdi</origin>
12336     <capabilities>
12337       <required id="can_generate_method_exit_events"></required>
12338     </capabilities>
12339     <parameters>
12340       <param id="jni_env">
12341         <outptr>
12342           <struct>JNIEnv</struct>
12343         </outptr>
12344           <description>
12345             The JNI environment of the event (current) thread
12346           </description>
12347       </param>
12348       <param id="thread">
12349         <jthread/>
12350           <description>
12351             Thread exiting the method
12352           </description>
12353       </param>
12354       <param id="klass">
12355         <jclass method="method"/>
12356           <description>
12357             Class of the method being exited
12358           </description>
12359       </param>
12360       <param id="method">
12361         <jmethodID class="klass"/>
12362           <description>
12363             Method being exited
12364           </description>
12365       </param>
12366       <param id="was_popped_by_exception">
12367         <jboolean/>
12368         <description>
12369           True if frame was popped by a thrown exception.
12370           False if method exited through its return instruction.
12371         </description>
12372       </param>
12373       <param id="return_value">
12374         <jvalue/>
12375         <description>
12376           The return value of the method being exited.
12377           Undefined and should not be used if
12378           <paramlink id="was_popped_by_exception"></paramlink>
12379           is true.
12380         </description>
12381       </param>
12382     </parameters>
12383   </event>
12384 
12385   <event label="Native Method Bind" phase="any"
12386          id="NativeMethodBind" const="JVMTI_EVENT_NATIVE_METHOD_BIND" num="67">
12387     <description>
12388       A Native Method Bind event is sent when a VM binds a
12389       Java programming language native method
12390       to the address of a function that implements the native method.
12391       This will occur when the native method is called for the first time
12392       and also occurs when the JNI function <code>RegisterNatives</code> is called.
12393       This event allows the bind to be redirected to an agent-specified
12394       proxy function.
12395       This event is not sent when the native method is unbound.
12396       Typically, this proxy function will need to be specific to a
12397       particular method or, to handle the general case, automatically
12398       generated assembly code, since after instrumentation code is
12399       executed the function at the original binding
12400       address will usually be invoked.
12401       The original binding can be restored or the redirection changed
12402       by use of the JNI function <code>RegisterNatives</code>.
12403       Some events may be sent during the primordial phase, JNI and
12404       most of <jvmti/> cannot be used at this time but the method and
12405       address can be saved for use later.
12406     </description>
12407     <origin>new</origin>
12408     <capabilities>
12409       <required id="can_generate_native_method_bind_events"></required>
12410     </capabilities>
12411     <parameters>
12412       <param id="jni_env">
12413         <outptr>
12414           <struct>JNIEnv</struct>
12415         </outptr>
12416           <description>
12417             The JNI environment of the event (current) thread
12418             Will be <code>NULL</code> if sent during the primordial
12419             <functionlink id="GetPhase">phase</functionlink>.
12420           </description>
12421       </param>
12422       <param id="thread">
12423         <jthread/>
12424           <description>
12425             Thread requesting the bind
12426           </description>
12427       </param>
12428       <param id="klass">
12429         <jclass method="method"/>
12430           <description>
12431             Class of the method being bound
12432           </description>
12433       </param>
12434       <param id="method">
12435         <jmethodID class="klass"/>
12436           <description>
12437             Native method being bound
12438           </description>
12439       </param>
12440       <param id="address">
12441         <outptr><void/></outptr>
12442         <description>
12443           The address the VM is about to bind to--that is, the
12444           address of the implementation of the native method
12445         </description>
12446       </param>
12447       <param id="new_address_ptr">
12448         <agentbuf><void/></agentbuf>
12449         <description>
12450           if the referenced address is changed (that is, if
12451           <code>*new_address_ptr</code> is set), the binding
12452           will instead be made to the supplied address.
12453         </description>
12454       </param>
12455     </parameters>
12456   </event>
12457 
12458   <event label="Exception"
12459          id="Exception" const="JVMTI_EVENT_EXCEPTION" filtered="thread" num="58">
12460     <description>
12461       Exception events are generated whenever an exception is first detected
12462       in a Java programming language method.
12463       Where "exception" means any <code>java.lang.Throwable</code>.
12464       The exception may have been thrown by a Java programming language or native
12465       method, but in the case of native methods, the event is not generated
12466       until the exception is first seen by a Java programming language method. If an exception is
12467       set and cleared in a native method (and thus is never visible to Java programming language code),
12468       no exception event is generated.
12469       <p/>
12470       The <code>method</code> and <code>location</code>
12471       parameters  uniquely identify the current location
12472       (where the exception was detected) and allow
12473       the mapping to source file and line number when that information is
12474       available. The <code>exception</code> field identifies the thrown
12475       exception object. The <code>catch_method</code>
12476       and <code>catch_location</code> identify the location of the catch clause,
12477       if any, that handles the thrown exception. If there is no such catch clause,
12478       each field is set to 0. There is no guarantee that the thread will ever
12479       reach this catch clause. If there are native methods on the call stack
12480       between the throw location and the catch clause, the exception may
12481       be reset by one of those native methods.
12482       Similarly, exceptions that are reported as uncaught (<code>catch_klass</code>
12483       et al. set to 0) may in fact be caught by native code.
12484       Agents can check for these occurrences by monitoring
12485       <eventlink id="ExceptionCatch"></eventlink> events.
12486       Note that finally clauses are implemented as catch and re-throw. Therefore they
12487       will be reported in the catch location.
12488     </description>
12489     <origin>jvmdi</origin>
12490     <capabilities>
12491       <required id="can_generate_exception_events"></required>
12492     </capabilities>
12493     <parameters>
12494       <param id="jni_env">
12495         <outptr>
12496           <struct>JNIEnv</struct>
12497         </outptr>
12498           <description>
12499             The JNI environment of the event (current) thread
12500           </description>
12501       </param>
12502       <param id="thread">
12503         <jthread/>
12504           <description>
12505             Thread generating the exception
12506           </description>
12507       </param>
12508       <param id="klass">
12509         <jclass method="method"/>
12510           <description>
12511             Class generating the exception
12512           </description>
12513       </param>
12514       <param id="method">
12515         <jmethodID class="klass"/>
12516           <description>
12517             Method generating the exception
12518           </description>
12519       </param>
12520       <param id="location">
12521         <jlocation/>
12522         <description>
12523           Location where exception occurred
12524         </description>
12525       </param>
12526       <param id="exception">
12527         <jobject/>
12528           <description>
12529             The exception being thrown
12530           </description>
12531       </param>
12532       <param id="catch_klass">
12533         <jclass method="catch_method"/>
12534           <description>
12535             Class that will catch the exception, or <code>NULL</code> if no known catch
12536           </description>
12537       </param>
12538       <param id="catch_method">
12539         <jmethodID class="catch_klass"/>
12540           <description>
12541             Method that will catch the exception, or <code>NULL</code> if no known catch
12542           </description>
12543       </param>
12544       <param id="catch_location">
12545         <jlocation/>
12546         <description>
12547           location which will catch the exception or zero if no known catch
12548         </description>
12549       </param>
12550     </parameters>
12551   </event>
12552 
12553   <event label="Exception Catch"
12554          id="ExceptionCatch" const="JVMTI_EVENT_EXCEPTION_CATCH" filtered="thread" num="59">
12555     <description>
12556       Exception catch events are generated whenever a thrown exception is caught.
12557       Where "exception" means any <code>java.lang.Throwable</code>.
12558       If the exception is caught in a Java programming language method, the event is generated
12559       when the catch clause is reached. If the exception is caught in a native
12560       method, the event is generated as soon as control is returned to a Java programming language
12561       method. Exception catch events are generated for any exception for which
12562       a throw was detected in a Java programming language method.
12563       Note that finally clauses are implemented as catch and re-throw. Therefore they
12564       will generate exception catch events.
12565       <p/>
12566       The <code>method</code> and <code>location</code>
12567       parameters uniquely identify the current location
12568       and allow the mapping to source file and line number when that information is
12569       available. For exceptions caught in a Java programming language method, the
12570       <code>exception</code> object identifies the exception object. Exceptions
12571       caught in native methods are not necessarily available by the time the
12572       exception catch is reported, so the <code>exception</code> field is set
12573       to <code>NULL</code>.
12574     </description>
12575     <origin>jvmdi</origin>
12576     <capabilities>
12577       <required id="can_generate_exception_events"></required>
12578     </capabilities>
12579     <parameters>
12580       <param id="jni_env">
12581         <outptr>
12582           <struct>JNIEnv</struct>
12583         </outptr>
12584           <description>
12585             The JNI environment of the event (current) thread
12586           </description>
12587       </param>
12588       <param id="thread">
12589         <jthread/>
12590           <description>
12591             Thread catching the exception
12592           </description>
12593       </param>
12594       <param id="klass">
12595         <jclass method="method"/>
12596           <description>
12597             Class catching the exception
12598           </description>
12599       </param>
12600       <param id="method">
12601         <jmethodID class="klass"/>
12602           <description>
12603             Method catching the exception
12604           </description>
12605       </param>
12606       <param id="location">
12607         <jlocation/>
12608         <description>
12609           Location where exception is being caught
12610         </description>
12611       </param>
12612       <param id="exception">
12613         <jobject/>
12614           <description>
12615             Exception being caught
12616           </description>
12617       </param>
12618     </parameters>
12619   </event>
12620 
12621   <event label="Thread Start"
12622          id="ThreadStart" const="JVMTI_EVENT_THREAD_START" num="52" phase="start">
12623     <description>
12624       Thread start events are generated by a new thread before its initial
12625       method executes.
12626       <p/>
12627       A thread may be listed in the array returned by
12628       <functionlink id="GetAllThreads"></functionlink>
12629       before its thread start event is generated.
12630       It is possible for other events to be generated
12631       on a thread before its thread start event.
12632       <p/>
12633       The event is sent on the newly started <paramlink id="thread"></paramlink>.
12634     </description>
12635     <origin>jvmdi</origin>
12636     <capabilities>
12637     </capabilities>
12638     <parameters>
12639       <param id="jni_env">
12640         <outptr>
12641           <struct>JNIEnv</struct>
12642         </outptr>
12643           <description>
12644             The JNI environment of the event (current) thread.
12645           </description>
12646       </param>
12647       <param id="thread">
12648         <jthread/>
12649           <description>
12650             Thread starting
12651           </description>
12652       </param>
12653     </parameters>
12654   </event>
12655 
12656   <event label="Thread End"
12657          id="ThreadEnd" const="JVMTI_EVENT_THREAD_END" filtered="thread" num="53" phase="start">
12658     <description>
12659       Thread end events are generated by a terminating thread
12660       after its initial method has finished execution.
12661       <p/>
12662       A thread may be listed in the array returned by
12663       <functionlink id="GetAllThreads"></functionlink>
12664       after its thread end event is generated.
12665       No events are generated on a thread
12666       after its thread end event.
12667       <p/>
12668       The event is sent on the dying <paramlink id="thread"></paramlink>.
12669     </description>
12670     <origin>jvmdi</origin>
12671     <capabilities>
12672     </capabilities>
12673     <parameters>
12674       <param id="jni_env">
12675         <outptr>
12676           <struct>JNIEnv</struct>
12677         </outptr>
12678           <description>
12679             The JNI environment of the event (current) thread.
12680           </description>
12681       </param>
12682       <param id="thread">
12683         <jthread/>
12684           <description>
12685             Thread ending
12686           </description>
12687       </param>
12688     </parameters>
12689   </event>
12690 
12691   <event label="Class Load"
12692          id="ClassLoad" const="JVMTI_EVENT_CLASS_LOAD" filtered="thread" phase="start" num="55">
12693     <description>
12694       A class load event is generated when a class is first loaded. The order
12695       of class load events generated by a particular thread are guaranteed
12696       to match the order of class loading within that thread.
12697       Array class creation does not generate a class load event.
12698       The creation of a primitive class (for example, java.lang.Integer.TYPE)
12699       does not generate a class load event.
12700       <p/>
12701       This event is sent at an early stage in loading the class. As
12702       a result the class should be used carefully.  Note, for example,
12703       that methods and fields are not yet loaded, so queries for methods,
12704       fields, subclasses, and so on will not give correct results.
12705       See "Loading of Classes and Interfaces" in the <i>Java Language
12706       Specification</i>.  For most
12707       purposes the <eventlink id="ClassPrepare"></eventlink> event will
12708       be more useful.
12709     </description>
12710     <origin>jvmdi</origin>
12711     <capabilities>
12712     </capabilities>
12713     <parameters>
12714       <param id="jni_env">
12715         <outptr>
12716           <struct>JNIEnv</struct>
12717         </outptr>
12718           <description>
12719             The JNI environment of the event (current) thread
12720           </description>
12721       </param>
12722       <param id="thread">
12723         <jthread/>
12724           <description>
12725             Thread loading the class
12726           </description>
12727       </param>
12728       <param id="klass">
12729         <jclass/>
12730           <description>
12731             Class being loaded
12732           </description>
12733       </param>
12734     </parameters>
12735   </event>
12736 
12737   <elide>
12738   <event label="Class Unload"
12739          id="ClassUnload" const="JVMTI_EVENT_CLASS_UNLOAD" num="57">
12740     <description>
12741       A class unload event is generated when the class is about to be unloaded.
12742       Class unload events take place during garbage collection and must be
12743       handled extremely carefully. The garbage collector holds many locks
12744       and has suspended all other threads, so the event handler cannot depend
12745       on the ability to acquire any locks. The class unload event handler should
12746       do as little as possible, perhaps by queuing information to be processed
12747       later.  In particular, the <code>jclass</code> should be used only in
12748       the JNI function <code>isSameObject</code> or in the following <jvmti/> functions:
12749       <ul>
12750         <li><functionlink id="GetClassSignature"></functionlink></li>
12751         <li><functionlink id="GetSourceFileName"></functionlink></li>
12752         <li><functionlink id="IsInterface"></functionlink></li>
12753         <li><functionlink id="IsArrayClass"></functionlink></li>
12754       </ul>
12755     </description>
12756     <origin>jvmdi</origin>
12757     <capabilities>
12758     </capabilities>
12759     <parameters>
12760       <param id="jni_env">
12761         <outptr>
12762           <struct>JNIEnv</struct>
12763         </outptr>
12764           <description>
12765             The JNI environment of the event (current) thread
12766           </description>
12767       </param>
12768       <param id="thread">
12769         <jthread/>
12770           <description>
12771             Thread generating the class unload
12772           </description>
12773       </param>
12774       <param id="klass">
12775         <jclass/>
12776           <description>
12777             Class being unloaded
12778           </description>
12779       </param>
12780     </parameters>
12781   </event>
12782   </elide>
12783 
12784   <event label="Class Prepare"
12785          id="ClassPrepare" const="JVMTI_EVENT_CLASS_PREPARE" filtered="thread" phase="start" num="56">
12786     <description>
12787       A class prepare event is generated when class preparation is complete.
12788       At this point, class fields, methods, and implemented interfaces are
12789       available, and no code from the class has been executed. Since array
12790       classes never have fields or methods, class prepare events are not
12791       generated for them. Class prepare events are not generated for
12792       primitive classes (for example, <code>java.lang.Integer.TYPE</code>).
12793     </description>
12794     <origin>jvmdi</origin>
12795     <capabilities>
12796     </capabilities>
12797     <parameters>
12798       <param id="jni_env">
12799         <outptr>
12800           <struct>JNIEnv</struct>
12801         </outptr>
12802           <description>
12803             The JNI environment of the event (current) thread
12804           </description>
12805       </param>
12806       <param id="thread">
12807         <jthread/>
12808           <description>
12809             Thread generating the class prepare
12810           </description>
12811       </param>
12812       <param id="klass">
12813         <jclass/>
12814           <description>
12815             Class being prepared
12816           </description>
12817       </param>
12818     </parameters>
12819   </event>
12820 
12821   <event label="Class File Load Hook" phase="any"
12822          id="ClassFileLoadHook" const="JVMTI_EVENT_CLASS_FILE_LOAD_HOOK" num="54">
12823     <description>
12824       This event is sent when the VM obtains class file data,
12825       but before it constructs
12826       the in-memory representation for that class.
12827       This event is also sent when the class is being modified by the
12828       <functionlink id="RetransformClasses"/> function or
12829       the <functionlink id="RedefineClasses"/> function,
12830       called in any <jvmti/> environment.
12831       The agent can instrument
12832       the existing class file data sent by the VM to include profiling/debugging hooks.
12833       See the description of
12834       <internallink id="bci">bytecode instrumentation</internallink>
12835       for usage information.
12836       <p/>
12837     When the capabilities
12838     <internallink id="jvmtiCapabilities.can_generate_early_class_hook_events">
12839     <code>can_generate_early_class_hook_events</code></internallink> and
12840     <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
12841     <code>can_generate_all_class_hook_events</code></internallink>
12842     are enabled then this event may be sent in the primordial phase.
12843     Otherwise, this event may be sent before the VM is initialized (the start
12844     <functionlink id="GetPhase">phase</functionlink>).
12845     Some classes might not be compatible
12846     with the function (eg. ROMized classes or implementation defined classes) and this event will
12847     not be generated for these classes.
12848     <p/>
12849     The agent must allocate the space for the modified
12850     class file data buffer
12851     using the memory allocation function
12852     <functionlink id="Allocate"></functionlink> because the
12853     VM is responsible for freeing the new class file data buffer
12854     using <functionlink id="Deallocate"></functionlink>.
12855     <p/>
12856     If the agent wishes to modify the class file, it must set
12857     <code>new_class_data</code> to point
12858     to the newly instrumented class file data buffer and set
12859     <code>new_class_data_len</code> to the length of that
12860     buffer before returning
12861     from this call.  If no modification is desired, the agent simply
12862     does not set <code>new_class_data</code>.  If multiple agents
12863     have enabled this event the results are chained. That is, if
12864     <code>new_class_data</code> has been set, it becomes the
12865     <code>class_data</code> for the next agent.
12866     <p/>
12867     When handling a class load in the live phase, then the
12868     <functionlink id="GetNamedModule"></functionlink>
12869     function can be used to map class loader and a package name to a module.
12870     When a class is being redefined or retransformed then
12871     <code>class_being_redefined</code> is non <code>NULL</code> and so
12872     the JNI <code>GetModule</code> function can also be used
12873     to obtain the Module.
12874     <p/>
12875     The order that this event is sent to each environment differs
12876     from other events.
12877     This event is sent to environments in the following order:
12878     <ul>
12879       <li><fieldlink id="can_retransform_classes"
12880                      struct="jvmtiCapabilities">retransformation
12881                                                 incapable</fieldlink>
12882           environments, in the
12883           order in which they were created
12884       </li>
12885       <li><fieldlink id="can_retransform_classes"
12886                      struct="jvmtiCapabilities">retransformation
12887                                                 capable</fieldlink>
12888           environments, in the
12889           order in which they were created
12890       </li>
12891     </ul>
12892     When triggered by <functionlink id="RetransformClasses"/>,
12893     this event is sent only to <fieldlink id="can_retransform_classes"
12894                      struct="jvmtiCapabilities">retransformation
12895                                                 capable</fieldlink>
12896     environments.
12897   </description>
12898   <origin>jvmpi</origin>
12899     <capabilities>
12900       <capability id="can_generate_all_class_hook_events"></capability>
12901       <capability id="can_generate_early_class_hook_events"></capability>
12902     </capabilities>
12903     <parameters>
12904       <param id="jni_env">
12905         <outptr>
12906           <struct>JNIEnv</struct>
12907         </outptr>
12908           <description>
12909             The JNI environment of the event (current) thread.
12910           </description>
12911       </param>
12912       <param id="class_being_redefined">
12913         <jclass/>
12914         <description>
12915           The class being
12916           <functionlink id="RedefineClasses">redefined</functionlink> or
12917           <functionlink id="RetransformClasses">retransformed</functionlink>.
12918           <code>NULL</code> if sent by class load.
12919         </description>
12920       </param>
12921       <param id="loader">
12922         <jobject/>
12923           <description>
12924             The class loader loading the class.
12925             <code>NULL</code> if the bootstrap class loader.
12926           </description>
12927       </param>
12928       <param id="name">
12929         <vmbuf><char/></vmbuf>
12930         <description>
12931             Name of class being loaded as a VM internal qualified name
12932             (for example, "java/util/List"), encoded as a
12933             <internallink id="mUTF">modified UTF-8</internallink> string.
12934             Note: if the class is defined with a <code>NULL</code> name or
12935             without a name specified, <code>name</code> will be <code>NULL</code>.
12936         </description>
12937       </param>
12938       <param id="protection_domain">
12939         <jobject/>
12940         <description>
12941           The <code>ProtectionDomain</code> of the class.
12942         </description>
12943       </param>
12944       <param id="class_data_len">
12945         <jint/>
12946         <description>
12947           Length of current class file data buffer.
12948         </description>
12949       </param>
12950       <param id="class_data">
12951         <vmbuf><uchar/></vmbuf>
12952         <description>
12953           Pointer to the current class file data buffer.
12954         </description>
12955       </param>
12956       <param id="new_class_data_len">
12957         <outptr><jint/></outptr>
12958         <description>
12959           Pointer to the length of the new class file data buffer.
12960         </description>
12961       </param>
12962       <param id="new_class_data">
12963         <agentbuf incount="new_class_data_len"><uchar/></agentbuf>
12964         <description>
12965           Pointer to the pointer to the instrumented class file data buffer.
12966         </description>
12967       </param>
12968     </parameters>
12969   </event>
12970 
12971   <event label="VM Start Event"
12972          id="VMStart" const="JVMTI_EVENT_VM_START" num="57" phase="start">
12973     <description>
12974       The VM start event signals the start of the VM.
12975       At this time JNI is live but the VM is not yet fully initialized.
12976       Once this event is generated, the agent is free to call any JNI function.
12977       This event signals the beginning of the start phase,
12978       <jvmti/> functions permitted in the start phase may be called.
12979       <p/>
12980       The timing of this event may depend on whether the agent has added the
12981       <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
12982       <code>can_generate_early_vmstart</code></internallink> capability or not.
12983       If the capability has been added then the VM posts the event as early
12984       as possible. The VM is capable of executing bytecode but it may not have
12985       initialized to the point where it can load classes in modules other than
12986       <code>java.base</code>, or even arbitrary classes in <code>java.base</code>.
12987       Agents that do load-time instrumentation in this
12988       phase must take great care when instrumenting code that potentially
12989       executes in this phase. Extreme care should also be taken with JNI
12990       <code>FindClass</code> as it may not be possible to load classes and attempts
12991       to do so may result in unpredictable behavior, maybe even stability issues
12992       on some VM implementations.
12993       If the capability has not been added then the VM delays posting this
12994       event until it is capable of loading classes in modules other than
12995       <code>java.base</code> or the VM has completed its initialization.
12996       Agents that create more than one JVM TI environment, where the
12997       capability is added to some but not all environments, may observe the
12998       start phase beginning earlier in the JVM TI environments that possess
12999       the capabilty.
13000       <p/>
13001       In the case of VM start-up failure, this event will not be sent.
13002     </description>
13003     <origin>jvmdi</origin>
13004     <capabilities>
13005     </capabilities>
13006     <parameters>
13007       <param id="jni_env">
13008         <outptr>
13009           <struct>JNIEnv</struct>
13010         </outptr>
13011           <description>
13012             The JNI environment of the event (current) thread.
13013           </description>
13014       </param>
13015     </parameters>
13016   </event>
13017 
13018   <event label="VM Initialization Event"
13019          id="VMInit" const="JVMTI_EVENT_VM_INIT" num="50">
13020     <description>
13021       The VM initialization event signals the completion of VM initialization. Once
13022       this event is generated, the agent is free to call any JNI or <jvmti/>
13023       function. The VM initialization event can be preceded by or can be concurrent
13024       with other events, but
13025       the preceding events should be handled carefully, if at all, because the
13026       VM has not completed its initialization. The thread start event for the
13027       main application thread is guaranteed not to occur until after the
13028       handler for the VM initialization event returns.
13029       <p/>
13030       In the case of VM start-up failure, this event will not be sent.
13031     </description>
13032     <origin>jvmdi</origin>
13033     <capabilities>
13034     </capabilities>
13035     <parameters>
13036       <param id="jni_env">
13037         <outptr>
13038           <struct>JNIEnv</struct>
13039         </outptr>
13040           <description>
13041             The JNI environment of the event (current) thread.
13042           </description>
13043       </param>
13044       <param id="thread">
13045         <jthread/>
13046           <description>
13047             The initial thread
13048           </description>
13049       </param>
13050     </parameters>
13051   </event>
13052 
13053   <event label="VM Death Event"
13054          id="VMDeath" const="JVMTI_EVENT_VM_DEATH" num="51">
13055     <description>
13056       The VM death event notifies the agent of the termination of the VM.
13057       No events will occur after the VMDeath event.
13058       <p/>
13059       In the case of VM start-up failure, this event will not be sent.
13060       Note that <internallink id="onunload">Agent_OnUnload</internallink>
13061       will still be called in these cases.
13062     </description>
13063     <origin>jvmdi</origin>
13064     <capabilities>
13065     </capabilities>
13066     <parameters>
13067       <param id="jni_env">
13068         <outptr>
13069           <struct>JNIEnv</struct>
13070         </outptr>
13071           <description>
13072             The JNI environment of the event (current) thread
13073           </description>
13074       </param>
13075     </parameters>
13076   </event>
13077 
13078   <event label="Compiled Method Load" phase="start"
13079          id="CompiledMethodLoad" const="JVMTI_EVENT_COMPILED_METHOD_LOAD" num="68">
13080     <description>
13081       Sent when a method is compiled and loaded into memory by the VM.
13082       If it is unloaded, the <eventlink id="CompiledMethodUnload"/> event is sent.
13083       If it is moved, the <eventlink id="CompiledMethodUnload"/> event is sent,
13084       followed by a new <code>CompiledMethodLoad</code> event.
13085       Note that a single method may have multiple compiled forms, and that
13086       this event will be sent for each form.
13087       Note also that several methods may be inlined into a single
13088       address range, and that this event will be sent for each method.
13089       <p/>
13090       These events can be sent after their initial occurrence with
13091       <functionlink id="GenerateEvents"></functionlink>.
13092     </description>
13093     <origin>jvmpi</origin>
13094     <typedef id="jvmtiAddrLocationMap" label="Native address to location entry">
13095       <field id="start_address">
13096         <vmbuf><void/></vmbuf>
13097         <description>
13098           Starting native address of code corresponding to a location
13099         </description>
13100       </field>
13101       <field id="location">
13102         <jlocation/>
13103         <description>
13104           Corresponding location. See
13105           <functionlink id="GetJLocationFormat"></functionlink>
13106           for the meaning of location.
13107         </description>
13108       </field>
13109     </typedef>
13110     <capabilities>
13111       <required id="can_generate_compiled_method_load_events"></required>
13112     </capabilities>
13113     <parameters>
13114       <param id="klass">
13115         <jclass method="method"/>
13116           <description>
13117             Class of the method being compiled and loaded
13118           </description>
13119       </param>
13120       <param id="method">
13121         <jmethodID class="klass"/>
13122           <description>
13123             Method being compiled and loaded
13124           </description>
13125       </param>
13126       <param id="code_size">
13127         <jint/>
13128         <description>
13129           Size of compiled code
13130         </description>
13131       </param>
13132       <param id="code_addr">
13133         <vmbuf><void/></vmbuf>
13134         <description>
13135           Address where compiled method code is loaded
13136         </description>
13137       </param>
13138       <param id="map_length">
13139         <jint/>
13140         <description>
13141           Number of <typelink id="jvmtiAddrLocationMap"></typelink>
13142           entries in the address map.
13143           Zero if mapping information cannot be supplied.
13144         </description>
13145       </param>
13146       <param id="map">
13147         <vmbuf><struct>jvmtiAddrLocationMap</struct></vmbuf>
13148         <description>
13149           Map from native addresses to location.
13150           The native address range of each entry is from
13151           <fieldlink id="start_address" struct="jvmtiAddrLocationMap"></fieldlink>
13152           to <code>start_address-1</code> of the next entry.
13153           <code>NULL</code> if mapping information cannot be supplied.
13154         </description>
13155       </param>
13156       <param id="compile_info">
13157         <vmbuf><void/></vmbuf>
13158         <description>
13159           VM-specific compilation information.
13160           The referenced compile information is managed by the VM
13161           and must not depend on the agent for collection.
13162           A VM implementation defines the content and lifetime
13163           of the information.
13164         </description>
13165       </param>
13166     </parameters>
13167   </event>
13168 
13169   <event label="Compiled Method Unload" phase="start"
13170          id="CompiledMethodUnload" const="JVMTI_EVENT_COMPILED_METHOD_UNLOAD" num="69">
13171     <description>
13172       Sent when a compiled method is unloaded from memory.
13173       This event might not be sent on the thread which performed the unload.
13174       This event may be sent sometime after the unload occurs, but
13175       will be sent before the memory is reused
13176       by a newly generated compiled method. This event may be sent after
13177       the class is unloaded.
13178     </description>
13179     <origin>jvmpi</origin>
13180     <capabilities>
13181       <required id="can_generate_compiled_method_load_events"></required>
13182     </capabilities>
13183     <parameters>
13184       <param id="klass">
13185         <jclass method="method"/>
13186           <description>
13187             Class of the compiled method being unloaded.
13188           </description>
13189       </param>
13190       <param id="method">
13191         <jmethodID class="klass"/>
13192           <description>
13193             Compiled method being unloaded.
13194             For identification of the compiled method only -- the class
13195             may be unloaded and therefore the method should not be used
13196             as an argument to further JNI or <jvmti/> functions.
13197           </description>
13198       </param>
13199       <param id="code_addr">
13200         <vmbuf><void/></vmbuf>
13201         <description>
13202           Address where compiled method code was loaded.
13203           For identification of the compiled method only --
13204           the space may have been reclaimed.
13205         </description>
13206       </param>
13207     </parameters>
13208   </event>
13209 
13210   <event label="Dynamic Code Generated" phase="any"
13211          id="DynamicCodeGenerated" const="JVMTI_EVENT_DYNAMIC_CODE_GENERATED" num="70">
13212     <description>
13213       Sent when a component of the virtual machine is generated dynamically.
13214       This does not correspond to Java programming language code that is
13215       compiled--see <eventlink id="CompiledMethodLoad"></eventlink>.
13216       This is for native code--for example, an interpreter that is generated
13217       differently depending on command-line options.
13218       <p/>
13219       Note that this event has no controlling capability.
13220       If a VM cannot generate these events, it simply does not send any.
13221       <p/>
13222       These events can be sent after their initial occurrence with
13223       <functionlink id="GenerateEvents"></functionlink>.
13224     </description>
13225     <origin>jvmpi</origin>
13226     <capabilities>
13227     </capabilities>
13228     <parameters>
13229       <param id="name">
13230         <vmbuf><char/></vmbuf>
13231         <description>
13232           Name of the code, encoded as a
13233           <internallink id="mUTF">modified UTF-8</internallink> string.
13234           Intended for display to an end-user.
13235           The name might not be unique.
13236         </description>
13237       </param>
13238       <param id="address">
13239         <vmbuf><void/></vmbuf>
13240         <description>
13241           Native address of the code
13242         </description>
13243       </param>
13244       <param id="length">
13245         <jint/>
13246         <description>
13247           Length in bytes of the code
13248         </description>
13249       </param>
13250     </parameters>
13251   </event>
13252 
13253   <event label="Data Dump Request"
13254          id="DataDumpRequest" const="JVMTI_EVENT_DATA_DUMP_REQUEST" num="71">
13255     <description>
13256       Sent by the VM to request the agent to dump its data.  This
13257       is just a hint and the agent need not react to this event.
13258       This is useful for processing command-line signals from users.  For
13259       example, in the Java 2 SDK a CTRL-Break on Win32 and a CTRL-\ on Solaris
13260       causes the VM to send this event to the agent.
13261     </description>
13262     <origin>jvmpi</origin>
13263     <capabilities>
13264     </capabilities>
13265     <parameters>
13266     </parameters>
13267   </event>
13268 
13269   <event label="Monitor Contended Enter"
13270          id="MonitorContendedEnter" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTER" filtered="thread" num="75">
13271     <description>
13272       Sent when a thread is attempting to enter a Java programming language
13273       monitor already acquired by another thread.
13274     </description>
13275     <origin>jvmpi</origin>
13276     <capabilities>
13277       <required id="can_generate_monitor_events"></required>
13278     </capabilities>
13279     <parameters>
13280       <param id="jni_env">
13281         <outptr>
13282           <struct>JNIEnv</struct>
13283         </outptr>
13284           <description>
13285             The JNI environment of the event (current) thread
13286           </description>
13287       </param>
13288       <param id="thread">
13289         <jthread/>
13290           <description>
13291             JNI local reference to the thread
13292             attempting to enter the monitor
13293           </description>
13294       </param>
13295       <param id="object">
13296         <jobject/>
13297           <description>
13298             JNI local reference to the monitor
13299           </description>
13300       </param>
13301     </parameters>
13302   </event>
13303 
13304   <event label="Monitor Contended Entered"
13305          id="MonitorContendedEntered" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTERED" filtered="thread" num="76">
13306     <description>
13307       Sent when a thread enters a Java programming language
13308       monitor after waiting for it to be released by another thread.
13309     </description>
13310     <origin>jvmpi</origin>
13311     <capabilities>
13312       <required id="can_generate_monitor_events"></required>
13313     </capabilities>
13314     <parameters>
13315       <param id="jni_env">
13316         <outptr>
13317           <struct>JNIEnv</struct>
13318         </outptr>
13319           <description>
13320             The JNI environment of the event (current) thread
13321           </description>
13322       </param>
13323       <param id="thread">
13324         <jthread/>
13325           <description>
13326             JNI local reference to the thread entering
13327             the monitor
13328           </description>
13329       </param>
13330       <param id="object">
13331         <jobject/>
13332           <description>
13333             JNI local reference to the monitor
13334           </description>
13335       </param>
13336     </parameters>
13337   </event>
13338 
13339   <event label="Monitor Wait"
13340          id="MonitorWait" const="JVMTI_EVENT_MONITOR_WAIT" filtered="thread" num="73">
13341     <description>
13342       Sent when a thread is about to wait on an object.
13343     </description>
13344     <origin>jvmpi</origin>
13345     <capabilities>
13346       <required id="can_generate_monitor_events"></required>
13347     </capabilities>
13348     <parameters>
13349       <param id="jni_env">
13350         <outptr>
13351           <struct>JNIEnv</struct>
13352         </outptr>
13353           <description>
13354             The JNI environment of the event (current) thread
13355           </description>
13356       </param>
13357       <param id="thread">
13358         <jthread/>
13359           <description>
13360             JNI local reference to the thread about to wait
13361           </description>
13362       </param>
13363       <param id="object">
13364         <jobject/>
13365           <description>
13366             JNI local reference to the monitor
13367           </description>
13368       </param>
13369       <param id="timeout">
13370         <jlong/>
13371         <description>
13372           The number of milliseconds the thread will wait
13373         </description>
13374       </param>
13375     </parameters>
13376   </event>
13377 
13378   <event label="Monitor Waited"
13379          id="MonitorWaited" const="JVMTI_EVENT_MONITOR_WAITED" filtered="thread" num="74">
13380     <description>
13381       Sent when a thread finishes waiting on an object.
13382     </description>
13383     <origin>jvmpi</origin>
13384     <capabilities>
13385       <required id="can_generate_monitor_events"></required>
13386     </capabilities>
13387     <parameters>
13388       <param id="jni_env">
13389         <outptr>
13390           <struct>JNIEnv</struct>
13391         </outptr>
13392           <description>
13393             The JNI environment of the event (current) thread
13394           </description>
13395       </param>
13396       <param id="thread">
13397         <jthread/>
13398           <description>
13399             JNI local reference to the thread that was finished waiting
13400           </description>
13401       </param>
13402       <param id="object">
13403         <jobject/>
13404           <description>
13405             JNI local reference to the monitor.
13406           </description>
13407       </param>
13408       <param id="timed_out">
13409         <jboolean/>
13410         <description>
13411           True if the monitor timed out
13412         </description>
13413       </param>
13414     </parameters>
13415   </event>
13416 
13417   <event label="Resource Exhausted"
13418          id="ResourceExhausted" const="JVMTI_EVENT_RESOURCE_EXHAUSTED" num="80"
13419          since="1.1">
13420     <description>
13421       Sent when a VM resource needed by a running application has been exhausted.
13422       Except as required by the optional capabilities, the set of resources
13423       which report exhaustion is implementation dependent.
13424       <p/>
13425       The following bit flags define the properties of the resource exhaustion:
13426       <constants id="jvmtiResourceExhaustionFlags"
13427                  label="Resource Exhaustion Flags"
13428                  kind="bits"
13429                  since="1.1">
13430         <constant id="JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR" num="0x0001">
13431           After this event returns, the VM will throw a
13432           <code>java.lang.OutOfMemoryError</code>.
13433         </constant>
13434         <constant id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP" num="0x0002">
13435           The VM was unable to allocate memory from the <tm>Java</tm>
13436           platform <i>heap</i>.
13437           The <i>heap</i> is the runtime
13438           data area from which memory for all class instances and
13439           arrays are allocated.
13440         </constant>
13441         <constant id="JVMTI_RESOURCE_EXHAUSTED_THREADS" num="0x0004">
13442           The VM was unable to create a thread.
13443         </constant>
13444       </constants>
13445     </description>
13446     <origin>new</origin>
13447     <capabilities>
13448       <capability id="can_generate_resource_exhaustion_heap_events">
13449         Can generate events when the VM is unable to allocate memory from the
13450         <internallink id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP">heap</internallink>.
13451       </capability>
13452       <capability id="can_generate_resource_exhaustion_threads_events">
13453         Can generate events when the VM is unable to
13454         <internallink id="JVMTI_RESOURCE_EXHAUSTED_THREADS">create
13455         a thread</internallink>.
13456       </capability>
13457     </capabilities>
13458     <parameters>
13459       <param id="jni_env">
13460         <outptr>
13461           <struct>JNIEnv</struct>
13462         </outptr>
13463           <description>
13464             The JNI environment of the event (current) thread
13465           </description>
13466       </param>
13467       <param id="flags">
13468         <jint/>
13469         <description>
13470           Flags defining the properties of the of resource exhaustion
13471           as specified by the
13472           <internallink id="jvmtiResourceExhaustionFlags">Resource
13473           Exhaustion Flags</internallink>.
13474           </description>
13475         </param>
13476       <param id="reserved">
13477         <vmbuf><void/></vmbuf>
13478         <description>
13479           Reserved.
13480         </description>
13481       </param>
13482       <param id="description">
13483         <vmbuf><char/></vmbuf>
13484         <description>
13485           Description of the resource exhaustion, encoded as a
13486           <internallink id="mUTF">modified UTF-8</internallink> string.
13487         </description>
13488       </param>
13489     </parameters>
13490   </event>
13491 
13492   <event label="VM Object Allocation"
13493          id="VMObjectAlloc" const="JVMTI_EVENT_VM_OBJECT_ALLOC" num="84">
13494     <description>
13495       Sent when a method causes the virtual machine to allocate an
13496       Object visible to Java programming language code and the
13497       allocation is not detectable by other intrumentation mechanisms.
13498       Generally object allocation should be detected by instrumenting
13499       the bytecodes of allocating methods.
13500       Object allocation generated in native code by JNI function
13501       calls should be detected using
13502       <internallink id="jniIntercept">JNI function interception</internallink>.
13503       Some methods might not have associated bytecodes and are not
13504       native methods, they instead are executed directly by the
13505       VM. These methods should send this event.
13506       Virtual machines which are incapable of bytecode instrumentation
13507       for some or all of their methods can send this event.
13508       <p/>
13509       Typical examples where this event might be sent:
13510       <ul>
13511         <li>Reflection -- for example, <code>java.lang.Class.newInstance()</code></li>
13512         <li>Methods not represented by bytecodes -- for example, VM intrinsics and
13513             J2ME preloaded classes</li>
13514       </ul>
13515       Cases where this event would not be generated:
13516       <ul>
13517         <li>Allocation due to bytecodes -- for example, the <code>new</code>
13518             and <code>newarray</code> VM instructions</li>
13519         <li>Allocation due to JNI function calls -- for example,
13520             <code>AllocObject</code></li>
13521         <li>Allocations during VM initialization</li>
13522         <li>VM internal objects</li>
13523       </ul>
13524     </description>
13525     <origin>new</origin>
13526     <capabilities>
13527       <required id="can_generate_vm_object_alloc_events"></required>
13528     </capabilities>
13529     <parameters>
13530       <param id="jni_env">
13531         <outptr>
13532           <struct>JNIEnv</struct>
13533         </outptr>
13534           <description>
13535             The JNI environment of the event (current) thread
13536           </description>
13537       </param>
13538       <param id="thread">
13539         <jthread/>
13540           <description>
13541             Thread allocating the object.
13542           </description>
13543       </param>
13544       <param id="object">
13545         <jobject/>
13546           <description>
13547             JNI local reference to the object that was allocated.
13548           </description>
13549       </param>
13550       <param id="object_klass">
13551         <jclass/>
13552           <description>
13553             JNI local reference to the class of the object.
13554           </description>
13555       </param>
13556       <param id="size">
13557         <jlong/>
13558         <description>
13559             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
13560         </description>
13561       </param>
13562     </parameters>
13563   </event>
13564 
13565   <event label="Sampled Object Allocation"
13566     id="SampledObjectAlloc" const="JVMTI_EVENT_SAMPLED_OBJECT_ALLOC" num="86" since="11">
13567     <description>
13568       Sent when an object is sampled via the
13569       <internallink id="heap_monitoring"> Heap Sampling Monitoring system </internallink>.
13570       <p/>
13571       By default, the sampling rate used is geometric variable with a 512kb mean, meaning one object every 512k bytes,
13572       in average, per thread will
13573       provoke a callback. Each thread having its own internal allocation count, each thread will be sampling
13574       at the same default rate of 512kb.
13575       <p/>
13576       If another sampling rate is required, the user can call
13577       <functionlink id="SetHeapSamplingRate"></functionlink> with a strictly positive integer value, representing
13578       the new sampling rate to be used by the default sampler.
13579       <p/>
13580       This event is sent once the allocation has been done and provides the object, stack trace
13581       for the allocation, the thread allocating, the size of allocation, and class.
13582       <p/>
13583       Typical use cases of this system is to determine where most heap allocation are originating from.
13584       Using this in conjunction of weak references and the function
13585       <functionlink id="GetStackTrace"></functionlink>, a user can track which objects were allocated from which
13586       stacktrace and which are still live during the execution of the program.
13587     </description>
13588     <origin>new</origin>
13589     <capabilities>
13590       <required id="can_generate_sampled_alloc_events"></required>
13591     </capabilities>
13592     <parameters>
13593       <param id="jni_env">
13594         <outptr>
13595           <struct>JNIEnv</struct>
13596         </outptr>
13597         <description>
13598           The JNI environment of the event (current) thread.
13599         </description>
13600       </param>
13601       <param id="thread">
13602         <jthread/>
13603         <description>
13604           Thread allocating the object.
13605         </description>
13606       </param>
13607       <param id="object">
13608         <jobject/>
13609         <description>
13610           JNI local reference to the object that was allocated.
13611         </description>
13612       </param>
13613       <param id="object_klass">
13614         <jclass/>
13615         <description>
13616           JNI local reference to the class of the object
13617         </description>
13618       </param>
13619       <param id="size">
13620         <jlong/>
13621         <description>
13622           Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
13623         </description>
13624       </param>
13625     </parameters>
13626   </event>
13627 
13628   <event label="Object Free"
13629         id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83">
13630     <description>
13631       An Object Free event is sent when the garbage collector frees an object.
13632       Events are only sent for tagged objects--see
13633       <internallink id="Heap">heap functions</internallink>.
13634       <p/>
13635       The event handler must not use JNI functions and
13636       must not use <jvmti/> functions except those which
13637       specifically allow such use (see the raw monitor, memory management,
13638       and environment local storage functions).
13639     </description>
13640     <origin>new</origin>
13641     <capabilities>
13642       <required id="can_generate_object_free_events"></required>
13643     </capabilities>
13644     <parameters>
13645       <param id="tag">
13646         <jlong/>
13647         <description>
13648           The freed object's tag
13649         </description>        
13650       </param>
13651     </parameters>
13652   </event>
13653 
13654   <event label="Garbage Collection Start"
13655          id="GarbageCollectionStart" const="JVMTI_EVENT_GARBAGE_COLLECTION_START" num="81">
13656     <description>
13657       A Garbage Collection Start event is sent when a
13658       garbage collection pause begins.
13659       Only stop-the-world collections are reported--that is, collections during
13660       which all threads cease to modify the state of the Java virtual machine.
13661       This means that some collectors will never generate these events.
13662       This event is sent while the VM is still stopped, thus
13663       the event handler must not use JNI functions and
13664       must not use <jvmti/> functions except those which
13665       specifically allow such use (see the raw monitor, memory management,
13666       and environment local storage functions).
13667       <p/>
13668       This event is always sent as a matched pair with
13669       <eventlink id="GarbageCollectionFinish"/>
13670       (assuming both events are enabled) and no garbage collection
13671       events will occur between them.
13672     </description>
13673     <origin>new</origin>
13674     <capabilities>
13675       <required id="can_generate_garbage_collection_events"></required>
13676     </capabilities>
13677     <parameters>
13678     </parameters>
13679   </event>
13680 
13681   <event label="Garbage Collection Finish"
13682          id="GarbageCollectionFinish" const="JVMTI_EVENT_GARBAGE_COLLECTION_FINISH" num="82">
13683     <description>
13684       A Garbage Collection Finish event is sent when a
13685       garbage collection pause ends.
13686       This event is sent while the VM is still stopped, thus
13687       the event handler must not use JNI functions and
13688       must not use <jvmti/> functions except those which
13689       specifically allow such use (see the raw monitor, memory management,
13690       and environment local storage functions).
13691       <p/>
13692       Some agents may need to do post garbage collection operations that
13693       require the use of the disallowed <jvmti/> or JNI functions. For these
13694       cases an agent thread can be created which waits on a raw monitor,
13695       and the handler for the Garbage Collection Finish event simply
13696       notifies the raw monitor
13697       <p/>
13698       This event is always sent as a matched pair with
13699       <eventlink id="GarbageCollectionStart"/> (assuming both events are enabled).
13700       <issue>
13701         The most important use of this event is to provide timing information,
13702         and thus additional information is not required.  However,
13703         information about the collection which is "free" should be included -
13704         what that information is needs to be determined.
13705       </issue>
13706     </description>
13707     <origin>new</origin>
13708     <capabilities>
13709       <required id="can_generate_garbage_collection_events"></required>
13710     </capabilities>
13711     <parameters>
13712     </parameters>
13713   </event>
13714 
13715   <elide>
13716   <event label="Verbose Output" phase="any"
13717          id="VerboseOutput" const="JVMTI_EVENT_VERBOSE_OUTPUT" num="85">
13718     <description>
13719       Send verbose messages as strings.
13720         <issue>
13721           This format is extremely fragile, as it can change with each
13722           platform, collector and version.  Alternatives include:
13723           <ul>
13724             <li>building off Java programming language M and M APIs</li>
13725             <li>XML</li>
13726             <li>key/value pairs</li>
13727             <li>removing it</li>
13728           </ul>
13729         </issue>
13730         <issue>
13731           Though this seemed trivial to implement.
13732           In the RI it appears this will be quite complex.
13733         </issue>
13734     </description>
13735     <origin>new</origin>
13736     <capabilities>
13737     </capabilities>
13738     <parameters>
13739       <param id="flag">
13740         <enum>jvmtiVerboseFlag</enum>
13741         <description>
13742           Which verbose output is being sent.
13743         </description>
13744       </param>
13745       <param id="message">
13746         <vmbuf><char/></vmbuf>
13747         <description>
13748           Message text, encoded as a
13749           <internallink id="mUTF">modified UTF-8</internallink> string.
13750         </description>
13751       </param>
13752     </parameters>
13753   </event>
13754   </elide>
13755 
13756 </eventsection>
13757 
13758 <datasection>
13759   <intro>
13760     <jvmti/> extends the data types defined by JNI.
13761   </intro>
13762   <basetypes id="jniTypes" label="JNI Types Used in the JVM Tool Interface">
13763     <basetype id="jboolean">
13764       <description>
13765         Holds a Java programming language <code>boolean</code>.
13766         Unsigned 8 bits.
13767       </description>
13768     </basetype>
13769     <basetype id="jchar">
13770       <description>
13771         Holds a Java programming language <code>char</code>.
13772         Unsigned 16 bits.
13773       </description>
13774     </basetype>
13775     <basetype id="jint">
13776       <description>
13777         Holds a Java programming language <code>int</code>.
13778         Signed 32 bits.
13779       </description>
13780     </basetype>
13781     <basetype id="jlong">
13782       <description>
13783         Holds a Java programming language <code>long</code>.
13784         Signed 64 bits.
13785       </description>
13786     </basetype>
13787     <basetype id="jfloat">
13788       <description>
13789         Holds a Java programming language <code>float</code>.
13790         32 bits.
13791       </description>
13792     </basetype>
13793     <basetype id="jdouble">
13794       <description>
13795         Holds a Java programming language <code>double</code>.
13796         64 bits.
13797       </description>
13798     </basetype>
13799     <basetype id="jobject">
13800       <description>
13801         Holds a Java programming language object.
13802       </description>
13803     </basetype>
13804     <basetype id="jclass">
13805       <description>
13806         Holds a Java programming language class.
13807       </description>
13808     </basetype>
13809     <basetype id="jvalue">
13810       <description>
13811         Is a union of all primitive types and <code>jobject</code>.  Thus, holds any Java
13812         programming language value.
13813       </description>
13814     </basetype>
13815     <basetype id="jfieldID">
13816       <description>
13817         Identifies a Java programming language field.
13818         <code>jfieldID</code>s returned by <jvmti/> functions and events may be
13819         safely stored.
13820       </description>
13821     </basetype>
13822     <basetype id="jmethodID">
13823       <description>
13824         Identifies a Java programming language method, initializer, or constructor.
13825         <code>jmethodID</code>s returned by <jvmti/> functions and events may be
13826         safely stored.  However, if the class is unloaded, they become invalid
13827         and must not be used.
13828       </description>
13829     </basetype>
13830     <basetype id="JNIEnv">
13831       <description>
13832         Pointer to the JNI function table.  Pointer to this (<code>JNIEnv *</code>)
13833         is a JNI environment.
13834       </description>
13835     </basetype>
13836   </basetypes>
13837 
13838   <basetypes id="jvmtiTypes" label="JVM Tool Interface Base Types">
13839     <basetype id="jvmtiEnv">
13840       <description>
13841         The <jvmti/> <internallink id="environments">environment</internallink> pointer.
13842         See the <internallink id="FunctionSection">Function Section</internallink>.
13843         <code>jvmtiEnv</code> points to the
13844         <internallink id="FunctionTable">function table</internallink> pointer.
13845       </description>
13846     </basetype>
13847     <basetype id="jthread">
13848       <definition>typedef jobject jthread;</definition>
13849       <description>
13850         Subtype of <datalink id="jobject"></datalink> that holds a thread.
13851       </description>
13852     </basetype>
13853     <basetype id="jthreadGroup">
13854       <definition>typedef jobject jthreadGroup;</definition>
13855       <description>
13856         Subtype of <datalink id="jobject"></datalink> that holds a thread group.
13857       </description>
13858     </basetype>
13859     <basetype id="jlocation">
13860       <definition>typedef jlong jlocation;</definition>
13861       <description>
13862         A 64 bit value, representing a monotonically increasing
13863         executable position within a method.
13864         <code>-1</code> indicates a native method.
13865         See <functionlink id="GetJLocationFormat"></functionlink> for the format on a
13866         given VM.
13867       </description>
13868     </basetype>
13869     <basetype id="jrawMonitorID">
13870       <definition>struct _jrawMonitorID;
13871 typedef struct _jrawMonitorID *jrawMonitorID;</definition>
13872       <description>
13873         A raw monitor.
13874       </description>
13875     </basetype>
13876     <basetype id="jvmtiError">
13877       <description>
13878         Holds an error return code.
13879         See the <internallink id="ErrorSection">Error section</internallink> for possible values.
13880         <example>
13881 typedef enum {
13882     JVMTI_ERROR_NONE = 0,
13883     JVMTI_ERROR_INVALID_THREAD = 10,
13884       ...
13885 } jvmtiError;
13886 </example>
13887       </description>
13888     </basetype>
13889     <basetype id="jvmtiEvent">
13890       <description>
13891         An identifier for an event type.
13892         See the <internallink id="EventSection">Event section</internallink> for possible values.
13893         It is guaranteed that future versions of this specification will
13894         never assign zero as an event type identifier.
13895 <example>
13896 typedef enum {
13897     JVMTI_EVENT_SINGLE_STEP = 1,
13898     JVMTI_EVENT_BREAKPOINT = 2,
13899       ...
13900 } jvmtiEvent;
13901 </example>
13902       </description>
13903     </basetype>
13904     <basetype id="jvmtiEventCallbacks" name="eventCallbacks">
13905       <description>
13906         The callbacks used for events.
13907 <example>
13908 typedef struct {
13909     jvmtiEventVMInit VMInit;
13910     jvmtiEventVMDeath VMDeath;
13911       ...
13912 } jvmtiEventCallbacks;
13913 </example>
13914         See <internallink id="jvmtiEventCallbacks">event callbacks</internallink>
13915         for the complete structure.
13916         <p/>
13917         Where, for example, the VM initialization callback is defined:
13918 <example>
13919 typedef void (JNICALL *jvmtiEventVMInit)
13920     (jvmtiEnv *jvmti_env,
13921      JNIEnv* jni_env,
13922      jthread thread);
13923 </example>
13924         See the individual events for the callback function definition.
13925       </description>
13926     </basetype>
13927     <basetype id="jniNativeInterface">
13928       <definition>typedef struct JNINativeInterface_ jniNativeInterface;</definition>
13929       <description>
13930         Typedef for the JNI function table <code>JNINativeInterface</code>
13931         defined in the
13932         <externallink id="jni/functions.html#interface-function-table">
13933           JNI Specification</externallink>.
13934         The JNI reference implementation defines this with an underscore.
13935       </description>
13936     </basetype>
13937   </basetypes>
13938 
13939 </datasection>
13940 
13941 <issuessection label="Issues">
13942   <intro id="suspendRequired" label="Resolved Issue: Suspend - Required or Automatic">
13943     JVMDI requires that the agent suspend threads before calling
13944     certain sensitive functions.  JVMPI requires garbage collection to be
13945     disabled before calling certain sensitive functions.
13946     It was suggested that rather than have this requirement, that
13947     VM place itself in a suitable state before performing an
13948     operation.  This makes considerable sense since each VM
13949     knows its requirements and can most easily arrange a
13950     safe state.
13951     <p/>
13952     The ability to externally suspend/resume threads will, of
13953     course, remain.  The ability to enable/disable garbage collection will not.
13954     <p/>
13955     This issue is resolved--suspend will not
13956     be required.  The spec has been updated to reflect this.
13957   </intro>
13958 
13959   <intro id="stackSampling" label="Resolved Issue: Call Stack Sampling">
13960     There are a variety of approaches to sampling call stacks.
13961     The biggest bifurcation is between VM controlled and agent
13962     controlled.
13963     <p/>
13964     This issue is resolved--agent controlled
13965     sampling will be the approach.
13966   </intro>
13967 
13968   <intro id="threadRepresentation" label="Resolved Issue: Thread Representation">
13969     JVMDI represents threads as jthread.  JVMPI primarily
13970     uses JNIEnv* to represent threads.
13971     <p/>
13972     The Expert Group has chosen jthread as the representation
13973     for threads in <jvmti/>.
13974     JNIEnv* is sent by
13975     events since it is needed to JNI functions.  JNIEnv, per the
13976     JNI spec, are not supposed to be used outside their thread.
13977   </intro>
13978 
13979   <intro id="design" label="Resolved Issue: Method Representation">
13980     The JNI spec allows an implementation to depend on jclass/jmethodID
13981     pairs, rather than simply a jmethodID, to reference a method.
13982     JVMDI, for consistency, choose the same representation.
13983     JVMPI, however, specifies that a jmethodID alone maps to a
13984     method.  Both of the Sun <tm>J2SE</tm> virtual machines (Classic and <tm>HotSpot</tm>) store
13985     pointers in jmethodIDs, and as a result, a jmethodID is sufficient.
13986     In fact, any JVM implementation that supports JVMPI must have
13987     such a representation.
13988     <jvmti/> will use jmethodID as a unique representation of a method
13989     (no jclass is used).
13990     There should be efficiency gains, particularly in
13991     functionality like stack dumping, to this representation.
13992     <p/>
13993     Note that fields were not used in JVMPI and that the access profile
13994     of fields differs from methods--for implementation efficiency
13995     reasons, a jclass/jfieldID pair will still be needed for field
13996     reference.
13997   </intro>
13998 
13999   <intro id="localReferenceIssue" label="Resolved Issue: Local References">
14000     Functions return local references.
14001   </intro>
14002 
14003   <intro id="frameRep" label="Resolved Issue: Representation of frames">
14004     In JVMDI, a frame ID is used to represent a frame.  Problem with this
14005     is that a VM must track when a frame becomes invalid, a far better
14006     approach, and the one used in <jvmti/>, is to reference frames by depth.
14007   </intro>
14008 
14009   <intro id="requiredCapabilities" label="Issue: Required Capabilities">
14010     Currently, having a required capabilities means that the functionality
14011     is optional.   Capabilities are useful even for required functionality
14012     since they can inform the VM is needed set-up.  Thus, there should be
14013     a set of capabilities that a conformant implementation must provide
14014     (if requested during Agent_OnLoad).
14015   </intro>
14016 
14017   <intro id="taghint" label="Proposal: add tag hint function">
14018     A hint of the percentage of objects that will be tagged would
14019     help the VM pick a good implementation.
14020   </intro>
14021 
14022   <intro id="moreMonitorQueries" label="Request: More Monitor Quires">
14023   How difficult or easy would be to extend the monitor_info category to include
14024     <pre>
14025   - current number of monitors
14026   - enumeration of monitors
14027   - enumeration of threads waiting on a given monitor
14028     </pre>
14029   The reason for my question is the fact that current get_monitor_info support
14030   requires the agent to specify a given thread to get the info which is probably
14031   OK in the profiling/debugging space, while in the monitoring space the agent
14032   could be watching the monitor list and then decide which thread to ask for
14033   the info. You might ask why is this important for monitoring .... I think it
14034   can aid in the detection/prediction of application contention caused by hot-locks.
14035   </intro>
14036 </issuessection>
14037 
14038 <changehistory id="ChangeHistory" update="09/05/07">
14039   <intro>
14040     The <jvmti/> specification is an evolving document with major, minor,
14041     and micro version numbers.
14042     A released version of the specification is uniquely identified
14043     by its major and minor version.
14044     The functions, events, and capabilities in this specification
14045     indicate a "Since" value which is the major and minor version in
14046     which it was introduced.
14047     The version of the specification implemented by the VM can
14048     be retrieved at runtime with the <functionlink id="GetVersionNumber"/>
14049     function.
14050   </intro>
14051   <change date="14 Nov 2002">
14052     Converted to XML document.
14053   </change>
14054   <change date="14 Nov 2002">
14055     Elided heap dump functions (for now) since what was there
14056     was wrong.
14057   </change>
14058   <change date="18 Nov 2002">
14059     Added detail throughout.
14060   </change>
14061   <change date="18 Nov 2002">
14062     Changed JVMTI_THREAD_STATUS_RUNNING to JVMTI_THREAD_STATUS_RUNNABLE.
14063   </change>
14064   <change date="19 Nov 2002">
14065     Added AsyncGetStackTrace.
14066   </change>
14067   <change date="19 Nov 2002">
14068     Added jframeID return to GetStackTrace.
14069   </change>
14070   <change date="19 Nov 2002">
14071     Elided GetCurrentFrame and GetCallingFrame functions (for now) since what was there
14072     since they are redundant with GetStackTrace.
14073   </change>
14074   <change date="19 Nov 2002">
14075     Elided ClearAllBreakpoints since it has always been redundant.
14076   </change>
14077   <change date="19 Nov 2002">
14078     Added GetSystemProperties.
14079   </change>
14080   <change date="19 Nov 2002">
14081     Changed the thread local storage functions to use jthread.
14082   </change>
14083   <change date="20 Nov 2002">
14084     Added GetJLocationFormat.
14085   </change>
14086   <change date="22 Nov 2002">
14087     Added events and introductory text.
14088   </change>
14089   <change date="22 Nov 2002">
14090     Cross reference type and constant definitions.
14091   </change>
14092   <change date="24 Nov 2002">
14093     Added DTD.
14094   </change>
14095   <change date="24 Nov 2002">
14096     Added capabilities function section.
14097   </change>
14098   <change date="29 Nov 2002">
14099     Assign capabilities to each function and event.
14100   </change>
14101   <change date="29 Nov 2002">
14102     Add <internallink id="jniIntercept">JNI interception functions</internallink>.
14103   </change>
14104   <change date="30 Nov 2002">
14105     Auto generate SetEventNotificationMode capabilities.
14106   </change>
14107   <change date="30 Nov 2002">
14108     Add <eventlink id="VMObjectAlloc"></eventlink> event.
14109   </change>
14110   <change date="30 Nov 2002">
14111     Add <eventlink id="DynamicCodeGenerated"></eventlink> event.
14112   </change>
14113   <change date="30 Nov 2002">
14114     Add const to declarations.
14115   </change>
14116   <change date="30 Nov 2002">
14117     Change method exit and frame pop to send on exception.
14118   </change>
14119   <change date="1 Dec 2002">
14120     Add ForceGarbageCollection.
14121   </change>
14122   <change date="2 Dec 2002">
14123     Redo Xrun section; clarify GetStackTrace and add example;
14124     Fix width problems; use "agent" consistently.
14125   </change>
14126   <change date="8 Dec 2002">
14127     Remove previous start-up intro.
14128     Add <internallink id="environments"><jvmti/> Environments</internallink>
14129     section.
14130   </change>
14131   <change date="8 Dec 2002">
14132     Add <functionlink id="DisposeEnvironment"></functionlink>.
14133   </change>
14134   <change date="9 Dec 2002">
14135     Numerous minor updates.
14136   </change>
14137   <change date="15 Dec 2002">
14138     Add heap profiling functions added:
14139     get/set annotation, iterate live objects/heap.
14140     Add heap profiling functions place holder added:
14141     heap roots.
14142     Heap profiling event added: object free.
14143     Heap profiling event redesigned: vm object allocation.
14144     Heap profiling event placeholders added: garbage collection start/finish.
14145     Native method bind event added.
14146   </change>
14147   <change date="19 Dec 2002">
14148     Revamp suspend/resume functions.
14149     Add origin information with jvmdi tag.
14150     Misc fixes.
14151   </change>
14152   <change date="24 Dec 2002">
14153     Add semantics to types.
14154   </change>
14155   <change date="27 Dec 2002">
14156     Add local reference section.
14157     Autogenerate parameter descriptions from types.
14158   </change>
14159   <change date="28 Dec 2002">
14160     Document that RunAgentThread sends threadStart.
14161   </change>
14162   <change date="29 Dec 2002">
14163     Remove redundant local ref and dealloc warning.
14164     Convert GetRawMonitorName to allocated buffer.
14165     Add GenerateEvents.
14166   </change>
14167   <change date="30 Dec 2002">
14168     Make raw monitors a type and rename to "jrawMonitorID".
14169   </change>
14170   <change date="1 Jan 2003">
14171     Include origin information.
14172     Clean-up JVMDI issue references.
14173     Remove Deallocate warnings which are now automatically generated.
14174   </change>
14175   <change date="2 Jan 2003">
14176     Fix representation issues for jthread.
14177   </change>
14178   <change date="3 Jan 2003">
14179     Make capabilities buffered out to 64 bits - and do it automatically.
14180   </change>
14181   <change date="4 Jan 2003">
14182     Make constants which are enumeration into enum types.
14183     Parameters now of enum type.
14184     Clean-up and index type section.
14185     Replace remaining datadef entities with callback.
14186   </change>
14187   <change date="7 Jan 2003">
14188     Correct GenerateEvents description.
14189     More internal semantics work.
14190   </change>
14191   <change date="9 Jan 2003">
14192     Replace previous GetSystemProperties with two functions
14193     which use allocated information instead fixed.
14194     Add SetSystemProperty.
14195     More internal semantics work.
14196   </change>
14197   <change date="12 Jan 2003">
14198     Add varargs to end of SetEventNotificationMode.
14199   </change>
14200   <change date="20 Jan 2003">
14201     Finish fixing spec to reflect that alloc sizes are jlong.
14202   </change>
14203   <change date="22 Jan 2003">
14204     Allow NULL as RunAgentThread arg.
14205   </change>
14206   <change date="22 Jan 2003">
14207     Fixed names to standardized naming convention
14208     Removed AsyncGetStackTrace.
14209   </change>
14210   <change date="29 Jan 2003">
14211     Since we are using jthread, removed GetThread.
14212   </change>
14213   <change date="31 Jan 2003">
14214     Change GetFieldName to allow NULLs like GetMethodName.
14215   </change>
14216   <change date="29 Feb 2003" version="v40">
14217       Rewrite the introductory text, adding sections on
14218       start-up, environments and bytecode instrumentation.
14219       Change the command line arguments per EG discussions.
14220       Add an introduction to the capabilities section.
14221       Add the extension mechanism category and functions.
14222       Mark for deletion, but clarified anyhow, SuspendAllThreads.
14223       Rename IterateOverLiveObjects to IterateOverReachableObjects and
14224       change the text accordingly.
14225       Clarify IterateOverHeap.
14226       Clarify CompiledMethodLoad.
14227       Discuss prerequisite state for Calling Functions.
14228       Clarify SetAllocationHooks.
14229       Added issues ("To be resolved:") through-out.
14230       And so on...
14231   </change>
14232   <change date="6 Mar 2003" version="v41">
14233       Remove struct from the call to GetOwnedMonitorInfo.
14234       Automatically generate most error documentation, remove
14235       (rather broken) hand written error doc.
14236       Better describe capability use (empty initial set).
14237       Add min value to jint params.
14238       Remove the capability can_access_thread_local_storage.
14239       Rename error JVMTI_ERROR_NOT_IMPLEMENTED to JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
14240       same for *NOT_IMPLEMENTED.
14241       Description fixes.
14242   </change>
14243   <change date="8 Mar 2003" version="v42">
14244       Rename GetClassSignature to GetClassName.
14245       Rename IterateOverClassObjects to IterateOverInstancesOfClass.
14246       Remove GetMaxStack (operand stack isn't used in <jvmti/>).
14247       Description fixes: define launch-time, remove native frame pop
14248       from PopFrame, and assorted clarifications.
14249   </change>
14250   <change date="8 Mar 2003" version="v43">
14251       Fix minor editing problem.
14252   </change>
14253   <change date="10 Mar 2003" version="v44">
14254       Add phase information.
14255       Remap (compact) event numbers.
14256   </change>
14257   <change date="11 Mar 2003" version="v45">
14258       More phase information - allow "any".
14259       Elide raw monitor queries and events.
14260       Minor description fixes.
14261   </change>
14262   <change date="12 Mar 2003" version="v46">
14263       Add GetPhase.
14264       Use "phase" through document.
14265       Elide GetRawMonitorName.
14266       Elide GetObjectMonitors.
14267   </change>
14268   <change date="12 Mar 2003" version="v47">
14269       Fixes from link, XML, and spell checking.
14270       Auto-generate the callback structure.
14271   </change>
14272   <change date="13 Mar 2003" version="v48">
14273       One character XML fix.
14274   </change>
14275   <change date="13 Mar 2003" version="v49">
14276       Change function parameter names to be consistent with
14277       event parameters (fooBarBaz becomes foo_bar_baz).
14278   </change>
14279   <change date="14 Mar 2003" version="v50">
14280       Fix broken link.  Fix thread markers.
14281   </change>
14282   <change date="14 Mar 2003" version="v51">
14283       Change constants so they are under 128 to workaround
14284       compiler problems.
14285   </change>
14286   <change date="23 Mar 2003" version="v52">
14287       Overhaul capabilities.  Separate GetStackTrace into
14288       GetStackTrace and GetStackFrames.
14289   </change>
14290   <change date="8 Apr 2003" version="v54">
14291       Use depth instead of jframeID to reference frames.
14292       Remove the now irrelevant GetCurrentFrame, GetCallerFrame and GetStackFrames.
14293       Remove frame arg from events.
14294   </change>
14295   <change date="9 Apr 2003" version="v55">
14296       Remove GetObjectWithAnnotation since tests show bufferred approach more efficient.
14297       Add missing annotation_count to GetObjectsWithAnnotations
14298   </change>
14299   <change date="10 Apr 2003" version="v56">
14300       Remove confusing parenthetical statement in GetObjectsWithAnnotations
14301   </change>
14302   <change date="13 Apr 2003" version="v58">
14303       Replace jclass/jmethodID representation of method with simply jmethodID;
14304       Pass JvmtiEnv* as first arg of every event; remove JNIEnv* where inappropriate.
14305       Replace can_access_frames with can_access_local_variables; remove from purely stack access.
14306       Use can_get_synthetic_attribute; fix description.
14307       Clarify that zero length arrays must be deallocated.
14308       Clarify RelinquishCapabilities.
14309       Generalize JVMTI_ERROR_VM_DEAD to JVMTI_ERROR_WRONG_PHASE.
14310   </change>
14311   <change date="27 Apr 2003" version="v59">
14312       Remove lingering indirect references to OBSOLETE_METHOD_ID.
14313   </change>
14314   <change date="4 May 2003" version="v60">
14315       Allow DestroyRawMonitor during OnLoad.
14316   </change>
14317   <change date="7 May 2003" version="v61">
14318       Added not monitor owner error return to DestroyRawMonitor.
14319   </change>
14320   <change date="13 May 2003" version="v62">
14321       Clarify semantics of raw monitors.
14322       Change flags on <code>GetThreadStatus</code>.
14323       <code>GetClassLoader</code> return NULL for the bootstrap class loader.
14324       Add <code>GetClassName</code> issue.
14325       Define local variable signature.
14326       Disallow zero in annotations array of <code>GetObjectsWithAnnotations</code>.
14327       Remove over specification in <code>GetObjectsWithAnnotations</code>.
14328       Elide <code>SetAllocationHooks</code>.
14329       Elide <code>SuspendAllThreads</code>.
14330   </change>
14331   <change date="14 May 2003" version="v63">
14332       Define the data type <code>jvmtiEventCallbacks</code>.
14333       Zero length allocations return NULL.
14334       Keep SetAllocationHooks in JVMDI, but remove from <jvmti/>.
14335       Add JVMTI_THREAD_STATUS_FLAG_INTERRUPTED.
14336   </change>
14337   <change date="15 May 2003" version="v64">
14338       Better wording, per review.
14339   </change>
14340   <change date="15 May 2003" version="v65">
14341       First Alpha.
14342       Make jmethodID and jfieldID unique, jclass not used.
14343   </change>
14344   <change date="27 May 2003" version="v66">
14345       Fix minor XSLT errors.
14346   </change>
14347   <change date="13 June 2003" version="v67">
14348       Undo making jfieldID unique (jmethodID still is).
14349   </change>
14350   <change date="17 June 2003" version="v68">
14351       Changes per June 11th Expert Group meeting --
14352       Overhaul Heap functionality: single callback,
14353       remove GetHeapRoots, add reachable iterators,
14354       and rename "annotation" to "tag".
14355       NULL thread parameter on most functions is current
14356       thread.
14357       Add timers.
14358       Remove ForceExit.
14359       Add GetEnvironmentLocalStorage.
14360       Add verbose flag and event.
14361       Add AddToBootstrapClassLoaderSearch.
14362       Update ClassFileLoadHook.
14363   </change>
14364   <change date="18 June 2003" version="v69">
14365       Clean up issues sections.
14366       Rename GetClassName back to GetClassSignature and
14367       fix description.
14368       Add generic signature to GetClassSignature,
14369       GetFieldSignature, GetMethodSignature, and
14370       GetLocalVariableTable.
14371       Elide EstimateCostOfCapabilities.
14372       Clarify that the system property functions operate
14373       on the VM view of system properties.
14374       Clarify Agent_OnLoad.
14375       Remove "const" from JNIEnv* in events.
14376       Add metadata accessors.
14377   </change>
14378   <change date="18 June 2003" version="v70">
14379       Add start_depth to GetStackTrace.
14380       Move system properties to a new category.
14381       Add GetObjectSize.
14382       Remove "X" from command line flags.
14383       XML, HTML, and spell check corrections.
14384   </change>
14385   <change date="19 June 2003" version="v71">
14386       Fix JVMTI_HEAP_ROOT_THREAD to be 6.
14387       Make each synopsis match the function name.
14388       Fix unclear wording.
14389   </change>
14390   <change date="26 June 2003" version="v72">
14391       SetThreadLocalStorage and SetEnvironmentLocalStorage should allow value
14392       to be set to NULL.
14393       NotifyFramePop, GetFrameLocationm and all the local variable operations
14394       needed to have their wording about frames fixed.
14395       Grammar and clarity need to be fixed throughout.
14396       Capitalization and puntuation need to be consistent.
14397       Need micro version number and masks for accessing major, minor, and micro.
14398       The error code lists should indicate which must be returned by
14399       an implementation.
14400       The command line properties should be visible in the properties functions.
14401       Disallow popping from the current thread.
14402       Allow implementations to return opaque frame error when they cannot pop.
14403       The NativeMethodBind event should be sent during any phase.
14404       The DynamicCodeGenerated event should be sent during any phase.
14405       The following functions should be allowed to operate before VMInit:
14406         Set/GetEnvironmentLocalStorage
14407         GetMethodDeclaringClass
14408         GetClassSignature
14409         GetClassModifiers
14410         IsInterface
14411         IsArrayClass
14412         GetMethodName
14413         GetMethodModifiers
14414         GetMaxLocals
14415         GetArgumentsSize
14416         GetLineNumberTable
14417         GetMethodLocation
14418         IsMethodNative
14419         IsMethodSynthetic.
14420       Other changes (to XSL):
14421       Argument description should show asterisk after not before pointers.
14422       NotifyFramePop, GetFrameLocationm and all the local variable operations
14423       should hsve the NO_MORE_FRAMES error added.
14424       Not alive threads should have a different error return than invalid thread.
14425   </change>
14426   <change date="7 July 2003" version="v73">
14427       VerboseOutput event was missing message parameter.
14428       Minor fix-ups.
14429   </change>
14430   <change date="14 July 2003" version="v74">
14431       Technical Publications Department corrections.
14432       Allow thread and environment local storage to be set to NULL.
14433   </change>
14434   <change date="23 July 2003" version="v75">
14435       Use new Agent_OnLoad rather than overloaded JVM_OnLoad.
14436       Add JNICALL to callbacks (XSL).
14437       Document JNICALL requirement for both events and callbacks (XSL).
14438       Restrict RedefineClasses to methods and attributes.
14439       Elide the VerboseOutput event.
14440       VMObjectAlloc: restrict when event is sent and remove method parameter.
14441       Finish loose ends from Tech Pubs edit.
14442   </change>
14443   <change date="24 July 2003" version="v76">
14444       Change ClassFileLoadHook event to send the class instead of a boolean of redefine.
14445   </change>
14446   <change date="24 July 2003" version="v77">
14447       XML fixes.
14448       Minor text clarifications and corrections.
14449   </change>
14450   <change date="24 July 2003" version="v78">
14451       Remove GetExceptionHandlerTable and GetThrownExceptions from <jvmti/>.
14452       Clarify that stack frames are JVM Spec frames.
14453       Split can_get_source_info into can_get_source_file_name, can_get_line_numbers,
14454       and can_get_source_debug_extension.
14455       PopFrame cannot have a native calling method.
14456       Removed incorrect statement in GetClassloaderClasses
14457       (see <vmspec chapter="4.4"/>).
14458   </change>
14459   <change date="24 July 2003" version="v79">
14460       XML and text fixes.
14461       Move stack frame description into Stack Frame category.
14462   </change>
14463   <change date="26 July 2003" version="v80">
14464       Allow NULL (means bootstrap loader) for GetClassloaderClasses.
14465       Add new heap reference kinds for references from classes.
14466       Add timer information struct and query functions.
14467       Add AvailableProcessors.
14468       Rename GetOtherThreadCpuTime to GetThreadCpuTime.
14469       Explicitly add JVMTI_ERROR_INVALID_THREAD and JVMTI_ERROR_THREAD_NOT_ALIVE
14470       to SetEventNotification mode.
14471       Add initial thread to the VM_INIT event.
14472       Remove platform assumptions from AddToBootstrapClassLoaderSearch.
14473   </change>
14474   <change date="26 July 2003" version="v81">
14475       Grammar and clarity changes per review.
14476   </change>
14477   <change date="27 July 2003" version="v82">
14478       More grammar and clarity changes per review.
14479       Add Agent_OnUnload.
14480   </change>
14481   <change date="28 July 2003" version="v83">
14482       Change return type of Agent_OnUnload to void.
14483   </change>
14484   <change date="28 July 2003" version="v84">
14485       Rename JVMTI_REFERENCE_ARRAY to JVMTI_REFERENCE_ARRAY_ELEMENT.
14486   </change>
14487   <change date="28 July 2003" version="v85">
14488       Steal java.lang.Runtime.availableProcessors() wording for
14489       AvailableProcessors().
14490       Guarantee that zero will never be an event ID.
14491       Remove some issues which are no longer issues.
14492       Per review, rename and more completely document the timer
14493       information functions.
14494   </change>
14495   <change date="29 July 2003" version="v86">
14496       Non-spec visible change to XML controlled implementation:
14497         SetThreadLocalStorage must run in VM mode.
14498   </change>
14499   <change date="5 August 2003" version="0.1.87">
14500       Add GetErrorName.
14501       Add varargs warning to jvmtiExtensionEvent.
14502       Remove "const" on the jvmtiEnv* of jvmtiExtensionEvent.
14503       Remove unused can_get_exception_info capability.
14504       Pass jvmtiEnv* and JNIEnv* to the jvmtiStartFunction.
14505       Fix jvmtiExtensionFunctionInfo.func declared type.
14506       Extension function returns error code.
14507       Use new version numbering.
14508   </change>
14509   <change date="5 August 2003" version="0.2.88">
14510       Remove the ClassUnload event.
14511   </change>
14512   <change date="8 August 2003" version="0.2.89">
14513       Heap reference iterator callbacks return an enum that
14514       allows outgoing object references to be ignored.
14515       Allow JNIEnv as a param type to extension events/functions.
14516   </change>
14517   <change date="15 August 2003" version="0.2.90">
14518       Fix a typo.
14519   </change>
14520   <change date="2 September 2003" version="0.2.91">
14521       Remove all metadata functions: GetClassMetadata,
14522       GetFieldMetadata, and GetMethodMetadata.
14523   </change>
14524   <change date="1 October 2003" version="0.2.92">
14525       Mark the functions Allocate. Deallocate, RawMonitor*,
14526       SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage
14527       as safe for use in heap callbacks and GC events.
14528   </change>
14529   <change date="24 November 2003" version="0.2.93">
14530       Add pass through opaque user data pointer to heap iterate
14531       functions and callbacks.
14532       In the CompiledMethodUnload event, send the code address.
14533       Add GarbageCollectionOccurred event.
14534       Add constant pool reference kind.
14535       Mark the functions CreateRawMonitor and DestroyRawMonitor
14536       as safe for use in heap callbacks and GC events.
14537       Clarify: VMDeath, GetCurrentThreadCpuTimerInfo,
14538       GetThreadCpuTimerInfo, IterateOverReachableObjects,
14539       IterateOverObjectsReachableFromObject, GetTime and
14540       JVMTI_ERROR_NULL_POINTER.
14541       Add missing errors to: GenerateEvents and
14542       AddToBootstrapClassLoaderSearch.
14543       Fix description of ClassFileLoadHook name parameter.
14544       In heap callbacks and GC/ObjectFree events, specify
14545       that only explicitly allowed functions can be called.
14546       Allow GetCurrentThreadCpuTimerInfo, GetCurrentThreadCpuTime,
14547       GetTimerInfo, and GetTime during callback.
14548       Allow calling SetTag/GetTag during the onload phase.
14549       SetEventNotificationMode, add: error attempted inappropriate
14550       thread level control.
14551       Remove jvmtiExceptionHandlerEntry.
14552       Fix handling of native methods on the stack --
14553       location_ptr param of GetFrameLocation, remove
14554       JVMTI_ERROR_OPAQUE_FRAME from GetFrameLocation,
14555       jvmtiFrameInfo.location, and jlocation.
14556       Remove typo (from JVMPI) implying that the MonitorWaited
14557       event is sent on sleep.
14558   </change>
14559   <change date="25 November 2003" version="0.2.94">
14560       Clarifications and typos.
14561   </change>
14562   <change date="3 December 2003" version="0.2.95">
14563       Allow NULL user_data in heap iterators.
14564   </change>
14565   <change date="28 January 2004" version="0.2.97">
14566       Add GetThreadState, deprecate GetThreadStatus.
14567   </change>
14568   <change date="29 January 2004" version="0.2.98">
14569       INVALID_SLOT and TYPE_MISMATCH errors should be optional.
14570   </change>
14571   <change date="12 February 2004" version="0.2.102">
14572       Remove MonitorContendedExit.
14573       Added JNIEnv parameter to VMObjectAlloc.
14574       Clarified definition of class_tag and referrer_index
14575       parameters to heap callbacks.
14576   </change>
14577   <change date="16 Febuary 2004" version="0.2.103">
14578       Document JAVA_TOOL_OPTIONS.
14579   </change>
14580   <change date="17 Febuary 2004" version="0.2.105">
14581       Divide start phase into primordial and start.
14582       Add VMStart event
14583       Change phase associations of functions and events.
14584   </change>
14585   <change date="18 Febuary 2004" version="0.3.6">
14586       Elide deprecated GetThreadStatus.
14587       Bump minor version, subtract 100 from micro version
14588   </change>
14589   <change date="18 Febuary 2004" version="0.3.7">
14590       Document that timer nanosecond values are unsigned.
14591       Clarify text having to do with native methods.
14592   </change>
14593   <change date="19 Febuary 2004" version="0.3.8">
14594       Fix typos.
14595       Remove elided deprecated GetThreadStatus.
14596   </change>
14597   <change date="23 Febuary 2004" version="0.3.9">
14598       Require NotifyFramePop to act on suspended threads.
14599   </change>
14600   <change date="24 Febuary 2004" version="0.3.10">
14601       Add capabilities
14602         (<internallink id="jvmtiCapabilities.can_redefine_any_class"
14603          ><code>can_redefine_any_class</code></internallink>
14604       and
14605          <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events"
14606          ><code>can_generate_all_class_hook_events</code></internallink>)
14607       and an error (<errorlink id="JVMTI_ERROR_UNMODIFIABLE_CLASS"></errorlink>)
14608       which allow some classes to be unmodifiable.
14609   </change>
14610   <change date="28 Febuary 2004" version="0.3.11">
14611       Add JVMTI_ERROR_MUST_POSSESS_CAPABILITY to SetEventNotificationMode.
14612   </change>
14613   <change date="8 March 2004" version="0.3.12">
14614       Clarified CompiledMethodUnload so that it is clear the event
14615       may be posted after the class has been unloaded.
14616   </change>
14617   <change date="5 March 2004" version="0.3.13">
14618       Change the size parameter of VMObjectAlloc to jlong to match GetObjectSize.
14619   </change>
14620   <change date="13 March 2004" version="0.3.14">
14621       Added guideline for the use of the JNI FindClass function in event
14622       callback functions.
14623   </change>
14624   <change date="15 March 2004" version="0.3.15">
14625       Add GetAllStackTraces and GetThreadListStackTraces.
14626   </change>
14627   <change date="19 March 2004" version="0.3.16">
14628       ClassLoad and ClassPrepare events can be posted during start phase.
14629   </change>
14630   <change date="25 March 2004" version="0.3.17">
14631       Add JVMTI_ERROR_NATIVE_METHOD to GetLineNumberTable, GetLocalVariableTable,
14632       GetMaxLocals, GetArgumentsSize, GetMethodLocation, GetBytecodes.
14633   </change>
14634   <change date="29 March 2004" version="0.3.18">
14635       Return the timer kind in the timer information structure.
14636   </change>
14637   <change date="31 March 2004" version="0.3.19">
14638       Spec clarifications:
14639       JVMTI_THREAD_STATE_IN_NATIVE might not include JNI or <jvmti/>.
14640       ForceGarbageCollection does not run finalizers.
14641       The context of the specification is the Java platform.
14642       Warn about early instrumentation.
14643   </change>
14644   <change date="1 April 2004" version="0.3.20">
14645       Refinements to the above clarifications and
14646       Clarify that an error returned by Agent_OnLoad terminates the VM.
14647   </change>
14648   <change date="1 April 2004" version="0.3.21">
14649       Array class creation does not generate a class load event.
14650   </change>
14651   <change date="7 April 2004" version="0.3.22">
14652       Align thread state hierarchy more closely with java.lang.Thread.State.
14653   </change>
14654   <change date="12 April 2004" version="0.3.23">
14655       Clarify the documentation of thread state.
14656   </change>
14657   <change date="19 April 2004" version="0.3.24">
14658       Remove GarbageCollectionOccurred event -- can be done by agent.
14659   </change>
14660   <change date="22 April 2004" version="0.3.25">
14661       Define "command-line option".
14662   </change>
14663   <change date="29 April 2004" version="0.3.26">
14664       Describe the intended use of bytecode instrumentation.
14665       Fix description of extension event first parameter.
14666   </change>
14667   <change date="30 April 2004" version="0.3.27">
14668       Clarification and typos.
14669   </change>
14670   <change date="18 May 2004" version="0.3.28">
14671       Remove DataDumpRequest event.
14672   </change>
14673   <change date="18 May 2004" version="0.3.29">
14674       Clarify RawMonitorWait with zero timeout.
14675       Clarify thread state after RunAgentThread.
14676   </change>
14677   <change date="24 May 2004" version="0.3.30">
14678       Clean-up: fix bad/old links, etc.
14679   </change>
14680   <change date="30 May 2004" version="0.3.31">
14681       Clarifications including:
14682       All character strings are modified UTF-8.
14683       Agent thread visibiity.
14684       Meaning of obsolete method version.
14685       Thread invoking heap callbacks,
14686   </change>
14687   <change date="1 June 2004" version="1.0.32">
14688       Bump major.minor version numbers to "1.0".
14689   </change>
14690   <change date="2 June 2004" version="1.0.33">
14691       Clarify interaction between ForceGarbageCollection
14692       and ObjectFree.
14693   </change>
14694   <change date="6 June 2004" version="1.0.34">
14695       Restrict AddToBootstrapClassLoaderSearch and
14696       SetSystemProperty to the OnLoad phase only.
14697   </change>
14698   <change date="11 June 2004" version="1.0.35">
14699       Fix typo in SetTag.
14700   </change>
14701   <change date="18 June 2004" version="1.0.36">
14702       Fix trademarks.
14703       Add missing parameter in example GetThreadState usage.
14704   </change>
14705   <change date="4 August 2004" version="1.0.37">
14706       Copyright updates.
14707   </change>
14708   <change date="5 November 2004" version="1.0.38">
14709       Add missing function table layout.
14710       Add missing description of C++ member function format of functions.
14711       Clarify that name in CFLH can be NULL.
14712       Released as part of <tm>J2SE</tm> 5.0.
14713   </change>
14714   <change date="24 April 2005" version="1.1.47">
14715       Bump major.minor version numbers to "1.1".
14716       Add ForceEarlyReturn* functions.
14717       Add GetOwnedMonitorStackDepthInfo function.
14718       Add GetCurrentThread function.
14719       Add "since" version marker.
14720       Add AddToSystemClassLoaderSearch.
14721       Allow AddToBootstrapClassLoaderSearch be used in live phase.
14722       Fix historic rubbish in the descriptions of the heap_object_callback
14723       parameter of IterateOverHeap and IterateOverInstancesOfClass functions;
14724       disallow NULL for this parameter.
14725       Clarify, correct and make consistent: wording about current thread,
14726       opaque frames and insufficient number of frames in PopFrame.
14727       Consistently use "current frame" rather than "topmost".
14728       Clarify the JVMTI_ERROR_TYPE_MISMATCH errors in GetLocal* and SetLocal*
14729       by making them compatible with those in ForceEarlyReturn*.
14730       Many other clarifications and wording clean ups.
14731   </change>
14732   <change date="25 April 2005" version="1.1.48">
14733       Add GetConstantPool.
14734       Switch references to the first edition of the VM Spec, to the seconds edition.
14735   </change>
14736   <change date="26 April 2005" version="1.1.49">
14737       Clarify minor/major version order in GetConstantPool.
14738   </change>
14739   <change date="26 April 2005" version="1.1.50">
14740       Add SetNativeMethodPrefix and SetNativeMethodPrefixes.
14741       Reassign GetOwnedMonitorStackDepthInfo to position 153.
14742       Break out Class Loader Search in its own documentation category.
14743       Deal with overly long lines in XML source.
14744   </change>
14745   <change date="29 April 2005" version="1.1.51">
14746       Allow agents be started in the live phase.
14747       Added paragraph about deploying agents.
14748   </change>
14749   <change date="30 April 2005" version="1.1.52">
14750       Add specification description to SetNativeMethodPrefix(es).
14751       Better define the conditions on GetConstantPool.
14752   </change>
14753   <change date="30 April 2005" version="1.1.53">
14754       Break out the GetClassVersionNumber function from GetConstantPool.
14755       Clean-up the references to the VM Spec.
14756   </change>
14757   <change date="1 May 2005" version="1.1.54">
14758       Allow SetNativeMethodPrefix(es) in any phase.
14759       Add clarifications about the impact of redefinition on GetConstantPool.
14760   </change>
14761   <change date="2 May 2005" version="1.1.56">
14762       Various clarifications to SetNativeMethodPrefix(es).
14763   </change>
14764   <change date="2 May 2005" version="1.1.57">
14765       Add missing performance warning to the method entry event.
14766   </change>
14767   <change date="5 May 2005" version="1.1.58">
14768       Remove internal JVMDI support.
14769   </change>
14770   <change date="8 May 2005" version="1.1.59">
14771       Add <functionlink id="RetransformClasses"/>.
14772       Revamp the bytecode instrumentation documentation.
14773       Change <functionlink id="IsMethodObsolete"/> to no longer
14774       require the can_redefine_classes capability.
14775   </change>
14776   <change date="11 May 2005" version="1.1.63">
14777       Clarifications for retransformation.
14778   </change>
14779   <change date="11 May 2005" version="1.1.64">
14780       Clarifications for retransformation, per review.
14781       Lock "retransformation (in)capable" at class load enable time.
14782   </change>
14783   <change date="4 June 2005" version="1.1.67">
14784       Add new heap functionity which supports reporting primitive values,
14785       allows setting the referrer tag, and has more powerful filtering:
14786       FollowReferences, IterateThroughHeap, and their associated
14787       callbacks, structs, enums, and constants.
14788   </change>
14789   <change date="4 June 2005" version="1.1.68">
14790       Clarification.
14791   </change>
14792   <change date="6 June 2005" version="1.1.69">
14793       FollowReferences, IterateThroughHeap: Put callbacks in a struct;
14794       Add missing error codes; reduce bits in the visit control flags.
14795   </change>
14796   <change date="14 June 2005" version="1.1.70">
14797       More on new heap functionity: spec clean-up per review.
14798   </change>
14799   <change date="15 June 2005" version="1.1.71">
14800       More on new heap functionity: Rename old heap section to Heap (1.0).
14801   </change>
14802   <change date="21 June 2005" version="1.1.72">
14803       Fix typos.
14804   </change>
14805   <change date="27 June 2005" version="1.1.73">
14806       Make referrer info structure a union.
14807   </change>
14808   <change date="9 September 2005" version="1.1.74">
14809       In new heap functions:
14810       Add missing superclass reference kind.
14811       Use a single scheme for computing field indexes.
14812       Remove outdated references to struct based referrer info.
14813   </change>
14814   <change date="12 September 2005" version="1.1.75">
14815       Don't callback during FollowReferences on frivolous java.lang.Object superclass.
14816   </change>
14817   <change date="13 September 2005" version="1.1.76">
14818       In string primitive callback, length now Unicode length.
14819       In array and string primitive callbacks, value now "const".
14820       Note possible compiler impacts on setting JNI function table.
14821   </change>
14822   <change date="13 September 2005" version="1.1.77">
14823       GetClassVersionNumbers() and GetConstantPool() should return
14824       error on array or primitive class.
14825   </change>
14826   <change date="14 September 2005" version="1.1.78">
14827       Grammar fixes.
14828   </change>
14829   <change date="26 September 2005" version="1.1.79">
14830       Add IsModifiableClass query.
14831   </change>
14832   <change date="9 February 2006" version="1.1.81">
14833       Add referrer_class_tag parameter to jvmtiHeapReferenceCallback.
14834   </change>
14835   <change date="13 February 2006" version="1.1.82">
14836       Doc fixes: update can_redefine_any_class to include retransform.
14837       Clarify that exception events cover all Throwables.
14838       In GetStackTrace, no test is done for start_depth too big if start_depth is zero,
14839       Clarify fields reported in Primitive Field Callback -- static vs instance.
14840       Repair confusing names of heap types, including callback names.
14841       Require consistent usage of stack depth in the face of thread launch methods.
14842       Note incompatibility of <jvmti/> memory management with other systems.
14843   </change>
14844   <change date="14 February 2006" version="1.1.85">
14845       Fix typos and missing renames.
14846   </change>
14847   <change date="13 March 2006" version="1.1.86">
14848       Clarify that jmethodIDs and jfieldIDs can be saved.
14849       Clarify that Iterate Over Instances Of Class includes subclasses.
14850   </change>
14851   <change date="14 March 2006" version="1.1.87">
14852       Better phrasing.
14853   </change>
14854   <change date="16 March 2006" version="1.1.88">
14855       Match the referrer_index for static fields in Object Reference Callback
14856       with the Reference Implementation (and all other known implementations);
14857       that is, make it match the definition for instance fields.
14858       In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover
14859       an invalid thread in the list; and specify that not started threads
14860       return empty stacks.
14861   </change>
14862   <change date="17 March 2006" version="1.1.89">
14863       Typo.
14864   </change>
14865   <change date="25 March 2006" version="1.1.90">
14866       Typo.
14867   </change>
14868   <change date="6 April 2006" version="1.1.91">
14869       Remove restrictions on AddToBootstrapClassLoaderSearch and
14870       AddToSystemClassLoaderSearch.
14871   </change>
14872   <change date="1 May 2006" version="1.1.93">
14873       Changed spec to return -1 for monitor stack depth for the
14874       implementation which can not determine stack depth.
14875   </change>
14876   <change date="3 May 2006" version="1.1.94">
14877       Corrections for readability and accuracy courtesy of Alan Pratt of IBM.
14878       List the object relationships reported in FollowReferences.
14879   </change>
14880   <change date="5 May 2006" version="1.1.95">
14881       Clarify the object relationships reported in FollowReferences.
14882   </change>
14883   <change date="28 June 2006" version="1.1.98">
14884       Clarify DisposeEnvironment; add warning.
14885       Fix typos in SetLocalXXX "retrieve" => "set".
14886       Clarify that native method prefixes must remain set while used.
14887       Clarify that exactly one Agent_OnXXX is called per agent.
14888       Clarify that library loading is independent from start-up.
14889       Remove ambiguous reference to Agent_OnLoad in the Agent_OnUnload spec.
14890   </change>
14891   <change date="31 July 2006" version="1.1.99">
14892       Clarify the interaction between functions and exceptions.
14893       Clarify and give examples of field indices.
14894       Remove confusing "That is" sentence from MonitorWait and MonitorWaited events.
14895       Update links to point to Java 6.
14896   </change>
14897   <change date="6 August 2006" version="1.1.102">
14898       Add ResourceExhaustedEvent.
14899   </change>
14900   <change date="11 October 2012" version="1.2.2">
14901       Fixed the "HTTP" and "Missing Anchor" errors reported by the LinkCheck tool.
14902   </change>
14903   <change date="19 June 2013" version="1.2.3">
14904       Added support for statically linked agents.
14905   </change>
14906   <change date="13 October 2016" version="9.0.0">
14907       Support for modules:
14908        - The majorversion is 9 now
14909        - The ClassFileLoadHook events are not sent during the primordial phase anymore.
14910        - Allow CompiledMethodLoad events at start phase
14911        - Add new capabilities:
14912           - can_generate_early_vmstart
14913           - can_generate_early_class_hook_events
14914        - Add new functions:
14915           - GetAllModules
14916           - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides
14917           - IsModifiableModule
14918       Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to
14919       disallow some implementation defined classes.
14920   </change>
14921   <change date="12 February 2017" version="9.0.0">
14922       Minor update for GetCurrentThread function:
14923        - The function may return NULL in the start phase if the
14924          can_generate_early_vmstart capability is enabled.
14925   </change>
14926 </changehistory>
14927 
14928 </specification>
14929 <!-- Keep this comment at the end of the file
14930 Local variables:
14931 mode: sgml
14932 sgml-omittag:t
14933 sgml-shorttag:t
14934 sgml-namecase-general:t
14935 sgml-general-insert-case:lower
14936 sgml-minimize-attributes:nil
14937 sgml-always-quote-attributes:t
14938 sgml-indent-step:2
14939 sgml-indent-data:t
14940 sgml-parent-document:nil
14941 sgml-exposed-tags:nil
14942 sgml-local-catalogs:nil
14943 sgml-local-ecat-files:nil
14944 End:
14945 -->