1 <?xml version="1.0" encoding="ISO-8859-1"?>
   2 <?xml-stylesheet type="text/xsl" href="jvmti.xsl"?>
   3 <!--
   4  Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
   5  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6 
   7  This code is free software; you can redistribute it and/or modify it
   8  under the terms of the GNU General Public License version 2 only, as
   9  published by the Free Software Foundation.
  10 
  11  This code is distributed in the hope that it will be useful, but WITHOUT
  12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  version 2 for more details (a copy is included in the LICENSE file that
  15  accompanied this code).
  16 
  17  You should have received a copy of the GNU General Public License version
  18  2 along with this work; if not, write to the Free Software Foundation,
  19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 
  21  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  or visit www.oracle.com if you need additional information or have any
  23  questions.
  24 -->
  25 
  26 <!DOCTYPE specification [
  27    <!ELEMENT specification (title, intro*, functionsection, errorsection,
  28                             eventsection, datasection, issuessection, changehistory)>
  29    <!ATTLIST specification label CDATA #REQUIRED>
  30 
  31    <!ELEMENT title (#PCDATA|jvmti|tm)*>
  32    <!ATTLIST title subtitle CDATA #REQUIRED>
  33 
  34    <!ELEMENT intro ANY>
  35    <!ATTLIST intro id CDATA #IMPLIED
  36                    label CDATA "">
  37 
  38    <!ELEMENT functionsection (intro*, category*)>
  39    <!ATTLIST functionsection label CDATA #REQUIRED>
  40 
  41    <!ELEMENT category ((intro|typedef|uniontypedef|capabilitiestypedef)*,
  42                           (function|callback|elide)*)>
  43    <!ATTLIST category id CDATA #REQUIRED
  44                       label CDATA #REQUIRED>
  45 
  46    <!ELEMENT function (synopsis, typedef*, description?, origin,
  47                          (capabilities|eventcapabilities),
  48                          parameters, errors)>
  49    <!ATTLIST function id CDATA #REQUIRED
  50                       num CDATA #REQUIRED
  51                       phase (onload|onloadOnly|start|live|any) #IMPLIED
  52                       callbacksafe (safe|unsafe) #IMPLIED
  53                       impl CDATA #IMPLIED
  54                       hide CDATA #IMPLIED
  55                       jkernel (yes|no) #IMPLIED
  56                       since CDATA "1.0">
  57 
  58    <!ELEMENT callback ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
  59                         jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void),
  60                         synopsis, description?, parameters)>
  61    <!ATTLIST callback id CDATA #REQUIRED
  62                       since CDATA "1.0">
  63 
  64    <!ELEMENT synopsis (#PCDATA|jvmti)*>
  65 
  66    <!ELEMENT typedef (description?, field*)>
  67    <!ATTLIST typedef id CDATA #REQUIRED
  68                      label CDATA #REQUIRED
  69                      since CDATA "1.0">
  70 
  71    <!ELEMENT uniontypedef (description?, field*)>
  72    <!ATTLIST uniontypedef id CDATA #REQUIRED
  73                      label CDATA #REQUIRED
  74                      since CDATA "1.0">
  75 
  76    <!ELEMENT field ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
  77                      jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|allocfieldbuf|inptr|inbuf|outbuf|vmbuf|ptrtype|struct),
  78                     description)>
  79    <!ATTLIST field id CDATA #REQUIRED>
  80 
  81    <!ELEMENT capabilitiestypedef (description?, capabilityfield*)>
  82    <!ATTLIST capabilitiestypedef id CDATA #REQUIRED
  83                      label CDATA #REQUIRED>
  84 
  85    <!ELEMENT capabilityfield (description)>
  86    <!ATTLIST capabilityfield id CDATA #REQUIRED
  87                    disp1 CDATA ""
  88                    disp2 CDATA ""
  89                    since CDATA "1.0">
  90 
  91    <!ELEMENT description ANY>
  92 
  93    <!ELEMENT capabilities (required*, capability*)>
  94 
  95    <!ELEMENT eventcapabilities EMPTY>
  96 
  97    <!ELEMENT required ANY>
  98    <!ATTLIST required id CDATA #REQUIRED>
  99 
 100    <!ELEMENT capability ANY>
 101    <!ATTLIST capability id CDATA #REQUIRED>
 102 
 103    <!ELEMENT parameters (param*)>
 104 
 105    <!ELEMENT param ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
 106                      jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct|ptrtype|
 107                      outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf),
 108                     description)>
 109    <!ATTLIST param id CDATA #REQUIRED>
 110 
 111    <!ELEMENT jmethodID EMPTY>
 112    <!ATTLIST jmethodID class  CDATA #IMPLIED
 113                        native CDATA #IMPLIED>
 114 
 115    <!ELEMENT jfieldID EMPTY>
 116    <!ATTLIST jfieldID class CDATA #IMPLIED>
 117 
 118    <!ELEMENT jclass EMPTY>
 119    <!ATTLIST jclass method CDATA #IMPLIED
 120                     field  CDATA #IMPLIED>
 121 
 122    <!ELEMENT jframeID EMPTY>
 123    <!ATTLIST jframeID thread CDATA #IMPLIED>
 124 
 125    <!ELEMENT jrawMonitorID EMPTY>
 126 
 127    <!ELEMENT jthread EMPTY>
 128    <!ATTLIST jthread started CDATA #IMPLIED
 129                      null CDATA #IMPLIED
 130                      frame CDATA #IMPLIED
 131                      impl CDATA #IMPLIED>
 132 
 133    <!ELEMENT varargs EMPTY>
 134 
 135    <!ELEMENT jthreadGroup EMPTY>
 136    <!ELEMENT jobject EMPTY>
 137    <!ELEMENT jvalue EMPTY>
 138    <!ELEMENT jchar EMPTY>
 139    <!ELEMENT jint EMPTY>
 140    <!ATTLIST jint min CDATA #IMPLIED>
 141    <!ELEMENT jlong EMPTY>
 142    <!ELEMENT jfloat EMPTY>
 143    <!ELEMENT jdouble EMPTY>
 144    <!ELEMENT jlocation EMPTY>
 145    <!ELEMENT jboolean EMPTY>
 146    <!ELEMENT char EMPTY>
 147    <!ELEMENT uchar EMPTY>
 148    <!ELEMENT size_t EMPTY>
 149    <!ELEMENT void EMPTY>
 150    <!ELEMENT enum (#PCDATA)*>
 151    <!ELEMENT struct (#PCDATA)*>
 152 
 153    <!ELEMENT nullok ANY>
 154 
 155    <!ELEMENT ptrtype     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 156                                    jthreadGroup|jobject|jvalue), nullok?)>
 157 
 158    <!ELEMENT outptr     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 159                                    jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble|
 160                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 161 
 162    <!ELEMENT allocbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 163                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 164                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 165    <!ATTLIST allocbuf incount CDATA #IMPLIED
 166                       outcount CDATA #IMPLIED>
 167 
 168    <!ELEMENT allocallocbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 169                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 170                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 171    <!ATTLIST allocallocbuf incount CDATA #IMPLIED
 172                       outcount CDATA #IMPLIED>
 173 
 174    <!ELEMENT inptr      (struct, nullok?)>
 175 
 176    <!ELEMENT inbuf      ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 177                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 178                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 179    <!ATTLIST inbuf    incount CDATA #IMPLIED>
 180 
 181    <!ELEMENT outbuf     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 182                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 183                                    jlocation|jboolean|char|uchar|size_t|void|outbuf), nullok?)>
 184    <!ATTLIST outbuf   incount CDATA #IMPLIED
 185                       outcount CDATA #IMPLIED>
 186 
 187    <!ELEMENT vmbuf      ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 188                                    jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble|
 189                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 190    <!ATTLIST vmbuf    incount CDATA #IMPLIED
 191                       outcount CDATA #IMPLIED>
 192 
 193    <!ELEMENT agentbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 194                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 195                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 196    <!ATTLIST agentbuf incount CDATA #IMPLIED
 197                       outcount CDATA #IMPLIED>
 198 
 199    <!ELEMENT allocfieldbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 200                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 201                                    jlocation|jboolean|char|uchar|size_t|void))>
 202    <!ATTLIST allocfieldbuf outcount CDATA #IMPLIED>
 203 
 204    <!ELEMENT errors (error*)>
 205 
 206    <!ELEMENT error ANY>
 207    <!ATTLIST error id CDATA #REQUIRED>
 208 
 209    <!ELEMENT errorsection (intro*, errorcategory*)>
 210    <!ATTLIST errorsection label CDATA #REQUIRED>
 211 
 212    <!ELEMENT errorcategory (intro*, errorid*)>
 213    <!ATTLIST errorcategory id CDATA #REQUIRED
 214                            label CDATA #REQUIRED>
 215 
 216    <!ELEMENT errorid ANY>
 217    <!ATTLIST errorid id CDATA #REQUIRED
 218                      num CDATA #REQUIRED>
 219 
 220    <!ELEMENT datasection (intro*, basetypes*)>
 221 
 222    <!ELEMENT basetypes (intro*, basetype*)>
 223    <!ATTLIST basetypes id CDATA #REQUIRED
 224                        label CDATA #REQUIRED>
 225 
 226    <!ELEMENT basetype (definition?,description)>
 227    <!ATTLIST basetype id CDATA #REQUIRED
 228                       name CDATA #IMPLIED>
 229 
 230    <!ELEMENT definition (#PCDATA|jvmti)*>
 231 
 232    <!ELEMENT eventsection (intro*, (event|elide)*)>
 233    <!ATTLIST eventsection label CDATA #REQUIRED>
 234 
 235    <!ELEMENT event (description, origin, typedef*, capabilities, parameters)>
 236    <!ATTLIST event id CDATA #REQUIRED
 237                    label CDATA #REQUIRED
 238                    const CDATA #REQUIRED
 239                    num CDATA #REQUIRED
 240                    phase (onload|start|live|any) #IMPLIED
 241                    filtered (thread|global) #IMPLIED
 242                    since CDATA "1.0">
 243 
 244    <!ELEMENT issuessection (intro*)>
 245    <!ATTLIST issuessection label CDATA #REQUIRED>
 246 
 247    <!ELEMENT changehistory (intro*, change*)>
 248    <!ATTLIST changehistory update CDATA #REQUIRED
 249                            id CDATA #REQUIRED>
 250 
 251    <!ELEMENT change ANY>
 252    <!ATTLIST change date CDATA #REQUIRED
 253                     version CDATA #IMPLIED>
 254 
 255    <!ELEMENT functionlink (#PCDATA|jvmti|code|i|b)*>
 256    <!ATTLIST functionlink id CDATA #REQUIRED>
 257 
 258    <!ELEMENT datalink (#PCDATA|jvmti|code|i|b)*>
 259    <!ATTLIST datalink id CDATA #REQUIRED>
 260 
 261    <!ELEMENT typelink (#PCDATA|jvmti|code|i|b)*>
 262    <!ATTLIST typelink id CDATA #REQUIRED>
 263 
 264    <!ELEMENT fieldlink (#PCDATA|jvmti|code|i|b)*>
 265    <!ATTLIST fieldlink id CDATA #REQUIRED
 266                        struct CDATA #REQUIRED>
 267 
 268    <!ELEMENT paramlink (#PCDATA|jvmti|code|i|b)*>
 269    <!ATTLIST paramlink id CDATA #REQUIRED>
 270 
 271    <!ELEMENT eventlink (#PCDATA|jvmti|code|i|b)*>
 272    <!ATTLIST eventlink id CDATA #REQUIRED>
 273 
 274    <!ELEMENT errorlink (#PCDATA|jvmti|code|i|b|tm)*>
 275    <!ATTLIST errorlink id CDATA #REQUIRED>
 276 
 277    <!ELEMENT externallink (#PCDATA|jvmti|code|i|b|tm)*>
 278    <!ATTLIST externallink id CDATA #REQUIRED>
 279 
 280    <!ELEMENT vmspec EMPTY>
 281    <!ATTLIST vmspec chapter CDATA #IMPLIED>
 282 
 283    <!ELEMENT internallink (#PCDATA|jvmti|code|i|b)*>
 284    <!ATTLIST internallink id CDATA #REQUIRED>
 285 
 286    <!ELEMENT functionphaselist EMPTY>
 287    <!ATTLIST functionphaselist phase (onload|onloadOnly|start|live|any) #REQUIRED>
 288 
 289    <!ELEMENT eventphaselist EMPTY>
 290    <!ATTLIST eventphaselist phase (onload|start|live|any) #REQUIRED>
 291 
 292    <!ELEMENT issue ANY>
 293 
 294    <!ELEMENT rationale ANY>
 295 
 296    <!ELEMENT todo ANY>
 297 
 298    <!ELEMENT origin (#PCDATA)*>
 299 
 300    <!ELEMENT elide (intro|function|callback|event)*>
 301    <!ATTLIST elide why CDATA #IMPLIED>
 302 
 303    <!ELEMENT constants (constant*)>
 304    <!ATTLIST constants id CDATA #REQUIRED
 305                        label CDATA #REQUIRED
 306                        kind (enum|bits|const) #REQUIRED
 307                        since CDATA "1.0">
 308 
 309    <!ELEMENT constant ANY>
 310    <!ATTLIST constant id CDATA #REQUIRED
 311                       num CDATA #REQUIRED>
 312 
 313    <!ELEMENT tm (#PCDATA)>
 314 
 315    <!ELEMENT i (#PCDATA|jvmti|tm)*>
 316 
 317    <!ELEMENT b (#PCDATA|jvmti|code)*>
 318 
 319    <!ELEMENT code (#PCDATA|space)*>
 320 
 321    <!ELEMENT pre ANY>
 322 
 323    <!ELEMENT space EMPTY>
 324 
 325    <!ELEMENT jvmti EMPTY>
 326 
 327    <!ELEMENT example (#PCDATA|i)*>
 328 
 329    <!ELEMENT br EMPTY>
 330 
 331    <!ELEMENT p EMPTY>
 332 
 333    <!ELEMENT blockquote ANY>
 334 
 335    <!ELEMENT dl  (dt|dd)+>
 336 
 337    <!ELEMENT dd  ANY>
 338 
 339    <!ELEMENT dt  (#PCDATA|jvmti|code|i|b)*>
 340 
 341    <!ELEMENT table  (tr)+>
 342 
 343    <!ELEMENT tr  (td|th)*>
 344 
 345    <!ELEMENT td  ANY>
 346    <!ATTLIST td class CDATA #IMPLIED>
 347 
 348    <!ELEMENT th  ANY>
 349    <!ATTLIST th class CDATA #IMPLIED>
 350 
 351    <!ELEMENT ul  (li)+>
 352    <!ATTLIST ul type (disc|circle|square) "disc">
 353 
 354    <!ELEMENT li  ANY>
 355  ]>
 356 
 357 <specification label="JVM(TM) Tool Interface">
 358   <title subtitle="Version">
 359     <tm>JVM</tm> Tool Interface
 360   </title>
 361 
 362   <intro id="whatIs" label="What is the JVM Tool Interface?">
 363     The <tm>JVM</tm> Tool Interface (<jvmti/>)
 364     is a programming interface used by development and monitoring tools.
 365     It provides both a way to inspect the state and
 366     to control the execution of applications running in the
 367     <tm>Java</tm> virtual machine (VM).
 368     <p/>
 369     <jvmti/> is intended to provide a VM interface for the full breadth of tools
 370     that need access to VM state, including but not limited to: profiling,
 371     debugging, monitoring, thread analysis, and coverage analysis tools.
 372     <p/>
 373     <jvmti/> may not be available in all implementations of the <tm>Java</tm> virtual
 374     machine.
 375     <p/>
 376     <jvmti/> is a two-way interface.
 377     A client of <jvmti/>, hereafter called an <i>agent</i>,
 378     can be notified of
 379     interesting occurrences through <internallink id="EventSection">events</internallink>.
 380     <jvmti/>
 381     can query and control the application through many
 382     <internallink id="FunctionSection">functions</internallink>,
 383     either in response to events or
 384     independent of them.
 385     <p/>
 386     Agents run in the same process with and communicate directly with
 387     the virtual machine executing
 388     the application being examined.  This communication is
 389     through a native interface (<jvmti/>). The native in-process interface allows
 390     maximal control with minimal intrusion on the part of a tool.
 391     Typically, agents are relatively compact. They can be controlled
 392     by a separate process which implements the bulk of a tool's
 393     function without interfering with the target application's normal execution.
 394   </intro>
 395 
 396   <intro id="architecture" label="Architecture">
 397     Tools can be written directly to <jvmti/> or indirectly
 398     through higher level interfaces.
 399     The Java Platform Debugger Architecture includes <jvmti/>, but also
 400     contains higher-level, out-of-process debugger interfaces. The higher-level
 401     interfaces are more appropriate than <jvmti/> for many tools.
 402     For more information on the Java Platform Debugger Architecture,
 403     see the
 404     <externallink id="jpda/architecture.html">Java
 405       Platform Debugger Architecture website</externallink>.
 406   </intro>
 407 
 408   <intro id="writingAgents" label="Writing Agents">
 409     Agents can be written in any native language that supports C
 410     language calling conventions and C or C++
 411     definitions.
 412     <p/>
 413     The function, event, data type, and constant definitions needed for
 414     using <jvmti/> are defined in the include file <code>jvmti.h</code>.
 415     To use these definitions add the <tm>J2SE</tm> include directory
 416     to your include path and add
 417     <example>
 418 #include &lt;jvmti.h&gt;
 419     </example>
 420     to your source code.
 421   </intro>
 422 
 423   <intro id="deployingAgents" label="Deploying Agents">
 424     An agent is deployed in a platform specific manner but is typically the
 425     platform equivalent of a dynamic library. On the <tm>Windows</tm> operating
 426     system, for example, an agent library is a "Dynamic Linked Library" (DLL).
 427     On the <tm>Solaris</tm> Operating Environment, an agent library is a shared
 428     object (<code>.so</code> file).
 429     <p/>
 430 
 431     An agent may be started at VM startup by specifying the agent library
 432     name using a <internallink id="starting">command line option</internallink>.
 433     Some implementations may support a mechanism to <internallink id="onattach">
 434     start agents</internallink> in the live <functionlink id="GetPhase">phase</functionlink>.
 435     The details of how this is initiated are implementation specific.
 436   </intro>
 437 
 438     <intro id="entryPoint" label="Statically Linked Agents (since version 1.2.3)">
 439 
 440       A native JVMTI Agent may be <i>statically linked</i> with the VM.
 441       The manner in which the library and VM image are combined is
 442       implementation-dependent.
 443       An agent L whose image has been combined with the VM is defined as
 444       <i>statically linked</i> if and only if the agent exports a function
 445       called Agent_OnLoad_L.
 446 <p/>
 447       If a <i>statically linked</i> agent L exports a function called
 448       Agent_OnLoad_L and a function called Agent_OnLoad, the Agent_OnLoad
 449       function will be ignored.
 450       If an agent L is <i>statically linked</i>, an Agent_OnLoad_L
 451       function will be invoked with the same arguments and expected return
 452       value as specified for the Agent_OnLoad function.
 453       An agent L that is <i>statically linked</i> will prohibit an agent of
 454       the same name from being loaded dynamically.
 455 <p/>
 456       The VM will invoke the Agent_OnUnload_L function of the agent, if such
 457       a function is exported, at the same point during VM execution as it would
 458       have called the dynamic entry point Agent_OnUnLoad. A statically loaded
 459       agent cannot be unloaded. The Agent_OnUnload_L function will still be
 460       called to do any other agent shutdown related tasks.
 461       If a <i>statically linked</i> agent L exports a function called
 462       Agent_OnUnLoad_L and a function called Agent_OnUnLoad, the Agent_OnUnLoad
 463       function will be ignored.
 464 <p/>
 465       If an agent L is <i>statically linked</i>, an Agent_OnAttach_L function
 466       will be invoked with the same arguments and expected return value as
 467       specified for the Agent_OnAttach function.
 468       If a <i>statically linked</i> agent L exports a function called
 469       Agent_OnAttach_L and a function called Agent_OnAttach, the Agent_OnAttach
 470       function will be ignored.
 471 </intro>
 472 
 473   <intro id="starting" label="Agent Command Line Options">
 474     The term "command-line option" is used below to
 475     mean options supplied in the <code>JavaVMInitArgs</code> argument
 476     to the <code>JNI_CreateJavaVM</code> function of the JNI
 477     Invocation API.
 478     <p/>
 479     One of the two following
 480     command-line options is used on VM startup to
 481     properly load and run agents.
 482     These arguments identify the library containing
 483     the agent as well as an options
 484     string to be passed in at startup.
 485     <dl>
 486       <dt><code>-agentlib:</code><i>&lt;agent-lib-name&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
 487       <dd>
 488         The name following <code>-agentlib:</code> is the name of the
 489         library to load.  Lookup of the library, both its full name and location,
 490         proceeds in a platform-specific manner.
 491         Typically, the <i>&lt;agent-lib-name&gt;</i> is expanded to an
 492         operating system specific file name.
 493         The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
 494         For example, if the option
 495         <code>-agentlib:foo=opt1,opt2</code> is specified, the VM will attempt to
 496         load the shared library <code>foo.dll</code> from the system <code>PATH</code>
 497         under <tm>Windows</tm> or <code>libfoo.so</code> from the
 498         <code>LD_LIBRARY_PATH</code> under the <tm>Solaris</tm> operating
 499         environment.
 500         If the agent library is statically linked into the executable
 501         then no actual loading takes place.
 502     <p/>
 503       </dd>
 504       <dt><code>-agentpath:</code><i>&lt;path-to-agent&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
 505       <dd>
 506         The path following <code>-agentpath:</code> is the absolute path from which
 507         to load the library.
 508         No library name expansion will occur.
 509         The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
 510         For example, if the option
 511         <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code> is specified, the VM will attempt to
 512         load the shared library <code>c:\myLibs\foo.dll</code>. If the agent
 513         library is statically linked into the executable
 514         then no actual loading takes place.
 515     <p/>
 516       </dd>
 517     </dl>
 518     For a dynamic shared library agent, the start-up routine
 519     <internallink id="onload"><code>Agent_OnLoad</code></internallink>
 520     in the library will be invoked. If the agent library is statically linked
 521     into the executable then the system will attempt to invoke the
 522     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> entry point where
 523     &lt;agent-lib-name&gt; is the basename of the
 524     agent. In the above example <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code>,
 525     the system will attempt to find and call the <code>Agent_OnLoad_foo</code> start-up routine.
 526     <p/>
 527     Libraries loaded with <code>-agentlib:</code> or <code>-agentpath:</code>
 528     will be searched for JNI native method implementations to facilitate the
 529     use of Java programming language code in tools, as is needed for
 530     <internallink id="bci">bytecode instrumentation</internallink>.
 531     <p/>
 532     The agent libraries will be searched after all other libraries have been
 533     searched (agents wishing to override or intercept the native method
 534     implementations of non-agent methods can use the
 535     <eventlink id="NativeMethodBind">NativeMethodBind event</eventlink>).
 536     <p/>
 537     These switches do the above and nothing more - they do not change the
 538     state of the VM or <jvmti/>.  No command line options are needed
 539     to enable <jvmti/>
 540     or aspects of <jvmti/>, this is handled programmatically
 541     by the use of
 542     <internallink id="capability">capabilities</internallink>.
 543   </intro>
 544 
 545   <intro id="startup" label="Agent Start-Up">
 546     The VM starts each agent by invoking a start-up function.
 547     If the agent is started in the <code>OnLoad</code>
 548     <functionlink id="GetPhase">phase</functionlink> the function
 549     <internallink id="onload"><code>Agent_OnLoad</code></internallink>
 550     or <internallink id="onload"><code>Agent_OnLoad_L</code></internallink>
 551     for statically linked agents will be invoked.
 552     If the agent is started in the live
 553     <functionlink id="GetPhase">phase</functionlink> the function
 554     <internallink id="onattach"><code>Agent_OnAttach</code></internallink>
 555     or <internallink id="onattach"><code>Agent_OnAttach_L</code></internallink>
 556     for statically linked agents will be invoked.
 557     Exactly one call to a start-up function is made per agent.
 558   </intro>
 559 
 560   <intro id="onload" label="Agent Start-Up (OnLoad phase)">
 561     If an agent is started during the <code>OnLoad</code> phase then its
 562     agent library must export a start-up function with the following prototype:
 563     <example>
 564 JNIEXPORT jint JNICALL
 565 Agent_OnLoad(JavaVM *vm, char *options, void *reserved)</example>
 566     Or for a statically linked agent named 'L':
 567     <example>
 568 JNIEXPORT jint JNICALL
 569 Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved)</example>
 570 
 571     The VM will start the agent by calling this function.
 572     It will be called early enough in VM initialization that:
 573     <ul>
 574       <li><functionlink id="SetSystemProperty">system properties</functionlink>
 575         may be set before they have been used in the start-up of the VM</li>
 576       <li>the full set of
 577         <internallink id="capability">capabilities</internallink>
 578         is still available (note that capabilities that configure the VM
 579         may only be available at this time--see the
 580         <internallink id="capability">Capability function section</internallink>)</li>
 581       <li>no bytecodes have executed</li>
 582       <li>no classes have been loaded</li>
 583       <li>no objects have been created</li>
 584     </ul>
 585     <p/>
 586     The VM will call the <code>Agent_OnLoad</code> or
 587     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> function with
 588     <i>&lt;options&gt;</i> as the second argument -
 589     that is, using the command-line option examples,
 590     <code>"opt1,opt2"</code> will be passed to the <code>char *options</code>
 591     argument of <code>Agent_OnLoad</code>.
 592     The <code>options</code> argument is encoded as a
 593     <internallink id="mUTF">modified UTF-8</internallink> string.
 594     If <i>=&lt;options&gt;</i> is not specified,
 595     a zero length string is passed to <code>options</code>.
 596     The lifespan of the <code>options</code> string is the
 597     <code>Agent_OnLoad</code> or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code>
 598     call.  If needed beyond this time the string or parts of the string must
 599     be copied.
 600     The period between when <code>Agent_OnLoad</code> is called and when it
 601     returns is called the <i>OnLoad phase</i>.
 602     Since the VM is not initialized during the OnLoad
 603     <functionlink id="GetPhase">phase</functionlink>,
 604     the set of allowed operations
 605     inside <code>Agent_OnLoad</code> is restricted (see the function descriptions for the
 606     functionality available at this time).
 607     The agent can safely process the options and set
 608     event callbacks with <functionlink id="SetEventCallbacks"></functionlink>. Once
 609     the VM initialization event is received
 610     (that is, the <eventlink id="VMInit">VMInit</eventlink>
 611     callback is invoked), the agent
 612     can complete its initialization.
 613     <rationale>
 614       Early startup is required so that agents can set the desired capabilities,
 615       many of which must be set before the VM is initialized.
 616       In JVMDI, the -Xdebug command-line option provided
 617       very coarse-grain control of capabilities.
 618       JVMPI implementations use various tricks to provide a single "JVMPI on" switch.
 619       No reasonable command-line
 620       option could provide the fine-grain of control required to balance needed capabilities vs
 621       performance impact.
 622       Early startup is also needed so that agents can control the execution
 623       environment - modifying the file system and system properties to install
 624       their functionality.
 625     </rationale>
 626     <p/>
 627     The return value from <code>Agent_OnLoad</code> or
 628     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> is used to indicate an error.
 629     Any value other than zero indicates an error and causes termination of the VM.
 630   </intro>
 631 
 632   <intro id="onattach" label="Agent Start-Up (Live phase)">
 633     A VM may support a mechanism that allows agents to be started in the VM during the live
 634     <functionlink id="GetPhase">phase</functionlink>. The details of how this is supported,
 635     are implementation specific. For example, a tool may use some platform specific mechanism,
 636     or implementation specific API, to attach to the running VM, and request it start a given
 637     agent.
 638     <p/>
 639     If an agent is started during the live phase then its agent library
 640     must export a start-up function
 641     with the following prototype:
 642     <example>
 643 JNIEXPORT jint JNICALL
 644 Agent_OnAttach(JavaVM* vm, char *options, void *reserved)</example>
 645 Or for a statically linked agent named 'L':
 646     <example>
 647 JNIEXPORT jint JNICALL
 648 Agent_OnAttach_L(JavaVM* vm, char *options, void *reserved)</example>
 649 
 650     <p/>
 651     The VM will start the agent by calling this function.
 652     It will be called in the context of a thread
 653     that is attached to the VM. The first argument <i>&lt;vm&gt;</i> is the Java VM.
 654     The <i>&lt;options&gt;</i> argument is the startup options provided to the agent.
 655     <i>&lt;options&gt;</i> is encoded as a <internallink id="mUTF">modified UTF-8
 656     </internallink> string.
 657     If startup options were not provided, a zero length string is passed to
 658     <code>options</code>. The lifespan of the <code>options</code> string is the
 659     <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name&gt;</code> call.
 660     If needed beyond this time the string or parts of the string must be copied.
 661     <p/>
 662     Note that some <internallink id="capability">capabilities</internallink>
 663     may not be available in the live phase.
 664     <p/>
 665     The <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name
 666     &gt;</code> function initializes the agent and returns a value
 667     to the VM to indicate if an error occurred. Any value other than zero indicates an error.
 668     An error does not cause the VM to terminate. Instead the VM ignores the error, or takes
 669     some implementation specific action -- for example it might print an error to standard error,
 670     or record the error in a system log.
 671   </intro>
 672 
 673   <intro id="onunload" label="Agent Shutdown">
 674     The library may optionally export a
 675     shutdown function with the following prototype:
 676     <example>
 677 JNIEXPORT void JNICALL
 678 Agent_OnUnload(JavaVM *vm)</example>
 679     Or for a statically linked agent named 'L':
 680     <example>
 681 JNIEXPORT void JNICALL
 682 Agent_OnUnload_L(JavaVM *vm)</example>
 683 
 684     This function will be called by the VM when the library is about to be unloaded.
 685     The library will be unloaded (unless it is statically linked into the
 686     executable) and this function will be called if some platform specific
 687     mechanism causes the unload (an unload mechanism is not specified in this document)
 688     or the library is (in effect) unloaded by the termination of the VM whether through
 689     normal termination or VM failure, including start-up failure.
 690     Uncontrolled shutdown is, of course, an exception to this rule.
 691     Note the distinction between this function and the
 692     <eventlink id="VMDeath">VM Death event</eventlink>: for the VM Death event
 693     to be sent, the VM must have run at least to the point of initialization and a valid
 694     <jvmti/> environment must exist which has set a callback for VMDeath
 695     and enabled the event.
 696     None of these are required for <code>Agent_OnUnload</code> or
 697     <code>Agent_OnUnload_&lt;agent-lib-name&gt;</code> and this function
 698     is also called if the library is unloaded for other reasons.
 699     In the case that a VM Death event is sent, it will be sent before this
 700     function is called (assuming this function is called due to VM termination).
 701     This function can be used to clean-up resources allocated by the agent.
 702   </intro>
 703 
 704   <intro id="tooloptions" label="JAVA_TOOL_OPTIONS">
 705     Since the command-line cannot always be accessed or modified, for example in embedded VMs
 706     or simply VMs launched deep within scripts, a <code>JAVA_TOOL_OPTIONS</code> variable is
 707     provided so that agents may be launched in these cases.
 708     <p/>
 709     Platforms which support environment variables or other named strings, may support the
 710     <code>JAVA_TOOL_OPTIONS</code> variable.  This variable will be broken into options at white-space
 711     boundaries.  White-space characters include space, tab, carriage-return, new-line,
 712     vertical-tab, and form-feed.  Sequences of white-space characters are considered
 713     equivalent to a single white-space character.  No white-space is included in the options
 714     unless quoted.  Quoting is as follows:
 715     <ul>
 716         <li>All characters enclosed between a pair of single quote marks (''), except a single
 717         quote, are quoted.</li>
 718         <li>Double quote characters have no special meaning inside a pair of single quote marks.</li>
 719         <li>All characters enclosed between a pair of double quote marks (""), except a double
 720         quote, are quoted.</li>
 721         <li>Single quote characters have no special meaning inside a pair of double quote marks.</li>
 722         <li>A quoted part can start or end anywhere in the variable.</li>
 723         <li>White-space characters have no special meaning when quoted -- they are included in
 724         the option like any other character and do not mark white-space boundaries.</li>
 725         <li>The pair of quote marks is not included in the option.</li>
 726     </ul>
 727     <code>JNI_CreateJavaVM</code> (in the JNI Invocation API) will prepend these options to the options supplied
 728     in its <code>JavaVMInitArgs</code> argument. Platforms may disable this feature in cases where security is
 729     a concern; for example, the Reference Implementation disables this feature on Unix systems when
 730     the effective user or group ID differs from the real ID.
 731     This feature is intended to support the initialization of tools -- specifically including the
 732     launching of native or Java programming language agents.  Multiple tools may wish to use this
 733     feature, so the variable should not be overwritten, instead,  options should be appended to
 734     the variable.  Note that since the variable is processed at the time of the JNI Invocation
 735     API create VM call, options processed by a launcher (e.g., VM selection options) will not be handled.
 736   </intro>
 737 
 738   <intro id="environments" label="Environments">
 739     The <jvmti/> specification supports the use of multiple simultaneous
 740     <jvmti/> agents.
 741     Each agent has its own <jvmti/> environment.
 742     That is, the <jvmti/> state is
 743     separate for each agent - changes to one environment do not affect the
 744     others.  The state of a <jvmti/>
 745     environment includes:
 746     <ul>
 747       <li><functionlink id="SetEventCallbacks">the event callbacks</functionlink></li>
 748       <li><functionlink id="SetEventNotificationMode">the set of events which are enabled</functionlink></li>
 749       <li><internallink id="capability">the capabilities</internallink></li>
 750       <li><internallink id="memory">the memory allocation/deallocation hooks</internallink></li>
 751     </ul>
 752     Although their <jvmti/> state
 753     is separate, agents inspect and modify the shared state
 754     of the VM, they also share the native environment in which they execute.
 755     As such, an agent can perturb the results of other agents or cause them
 756     to fail.  It is the responsibility of the agent writer to specify the level
 757     of compatibility with other agents.  <jvmti/> implementations are not capable
 758     of preventing destructive interactions between agents. Techniques to reduce
 759     the likelihood of these occurrences are beyond the scope of this document.
 760     <p/>
 761     An agent creates a <jvmti/> environment
 762     by passing a <jvmti/> version
 763     as the interface ID to the JNI Invocation API function
 764     <externallink id="jni/invocation.html#getenv">
 765       <code>GetEnv</code></externallink>.
 766     See <internallink id="jvmtiEnvAccess">Accessing <jvmti/> Functions</internallink>
 767     for more details on the creation and use of
 768     <jvmti/> environments.
 769     Typically, <jvmti/> environments are created by calling <code>GetEnv</code> from
 770     <internallink id="onload"><code>Agent_OnLoad</code></internallink>.
 771   </intro>
 772 
 773   <intro id="bci" label="Bytecode Instrumentation">
 774     This interface does not include some events that one might expect in an interface with
 775     profiling support.  Some examples include full speed
 776     method enter and exit events.  The interface instead provides support for
 777     <i>bytecode instrumentation</i>, the ability to alter the Java virtual machine
 778     bytecode instructions which comprise the target program.  Typically, these alterations
 779     are to add "events" to the code of a method - for example, to add, at the beginning of a method,
 780     a call to <code>MyProfiler.methodEntered()</code>.
 781     Since the changes are purely additive, they do not modify application
 782     state or behavior.
 783     Because the inserted agent code is standard bytecodes, the VM can run at full speed,
 784     optimizing not only the target program but also the instrumentation.  If the
 785     instrumentation does not involve switching from bytecode execution, no expensive
 786     state transitions are needed.  The result is high performance events.
 787     This approach also provides complete control to the agent: instrumentation can be
 788     restricted to "interesting" portions of the code (e.g., the end user's code) and
 789     can be conditional.  Instrumentation can run entirely in Java programming language
 790     code or can call into the native agent.  Instrumentation can simply maintain
 791     counters or can statistically sample events.
 792     <p/>
 793     Instrumentation can be inserted in one of three ways:
 794     <ul>
 795       <li>
 796         Static Instrumentation: The class file is instrumented before it
 797         is loaded into the VM - for example, by creating a duplicate directory of
 798         <code>*.class</code> files which have been modified to add the instrumentation.
 799         This method is extremely awkward and, in general, an agent cannot know
 800         the origin of the class files which will be loaded.
 801       </li>
 802       <li>
 803         Load-Time Instrumentation: When a class file is loaded by the VM, the raw
 804         bytes of the class file are sent for instrumentation to the agent.
 805         The <eventlink id="ClassFileLoadHook"/>
 806         event, triggered by the class load,
 807         provides this functionality.  This mechanism provides efficient
 808         and complete access to one-time instrumentation.
 809       </li>
 810       <li>
 811         Dynamic Instrumentation: A class which is already loaded (and possibly
 812         even running) is modified.  This optional feature is provided by the
 813         <eventlink id="ClassFileLoadHook"/> event, triggered by calling the
 814         <functionlink id="RetransformClasses"/> function.
 815         Classes can be modified multiple times and can be returned to their
 816         original state.
 817         The mechanism allows instrumentation which changes during the
 818         course of execution.
 819       </li>
 820     </ul>
 821     <p/>
 822     The class modification functionality provided in this interface
 823     is intended to provide a mechanism for instrumentation
 824     (the <eventlink id="ClassFileLoadHook"/> event
 825     and the <functionlink id="RetransformClasses"/> function)
 826     and, during development, for fix-and-continue debugging
 827     (the <functionlink id="RedefineClasses"/> function).
 828     <p/>
 829     Care must be taken to avoid perturbing dependencies, especially when
 830     instrumenting core classes.  For example, an approach to getting notification
 831     of every object allocation is to instrument the constructor on
 832     <code>Object</code>.  Assuming that the constructor is initially
 833     empty, the constructor could be changed to:
 834     <example>
 835       public Object() {
 836         MyProfiler.allocationTracker(this);
 837       }
 838     </example>
 839     However, if this change was made using the
 840     <eventlink id="ClassFileLoadHook"/>
 841     event then this might impact a typical VM as follows:
 842     the first created object will call the constructor causing a class load of
 843     <code>MyProfiler</code>; which will then cause
 844     object creation, and since <code>MyProfiler</code> isn't loaded yet,
 845     infinite recursion; resulting in a stack overflow.  A refinement of this
 846     would be to delay invoking the tracking method until a safe time.  For
 847     example, <code>trackAllocations</code> could be set in the
 848     handler for the <code>VMInit</code> event.
 849     <example>
 850       static boolean trackAllocations = false;
 851 
 852       public Object() {
 853         if (trackAllocations) {
 854           MyProfiler.allocationTracker(this);
 855         }
 856       }
 857     </example>
 858     <p/>
 859     The <functionlink id="SetNativeMethodPrefix"/> allows native methods
 860     to be instrumented by the use of wrapper methods.
 861   </intro>
 862 
 863 <intro id="bcimodules" label="Bytecode Instrumentation of code in modules">
 864   Agents can use the functions <functionlink id="AddModuleReads"/>,
 865   <functionlink id="AddModuleExports"/>, <functionlink id="AddModuleOpens"/>,
 866   <functionlink id="AddModuleUses"/> and <functionlink id="AddModuleProvides"/>
 867   to update a module to expand the set of modules that it reads, the set of
 868   packages that it exports or opens to other modules, or the services that it
 869   uses and provides.
 870   <p/>
 871   As an aid to agents that deploy supporting classes on the search path of
 872   the bootstrap class loader, or the search path of the class loader that
 873   loads the main class, the Java virtual machine arranges for the module
 874   of classes transformed by the <eventlink id="ClassFileLoadHook"/> event to
 875   read the unnamed module of both class loaders.
 876 </intro>
 877 
 878   <intro id="mUTF" label="Modified UTF-8 String Encoding">
 879     <jvmti/> uses modified UTF-8 to encode character strings.
 880     This is the same encoding used by JNI.
 881     Modified UTF-8 differs
 882     from standard UTF-8 in the representation of supplementary characters
 883     and of the null character. See the
 884     <externallink id="jni/types.html#modified-utf-8-strings">
 885       Modified UTF-8 Strings</externallink>
 886     section of the JNI specification for details.
 887   </intro>
 888 
 889   <intro id="context" label="Specification Context">
 890     Since this interface provides access to the state of applications running in the
 891     Java virtual machine;
 892     terminology refers to the Java platform and not the native
 893     platform (unless stated otherwise).  For example:
 894     <ul>
 895       <li>"thread" means Java programming language thread.</li>
 896       <li>"stack frame" means Java virtual machine stack frame.</li>
 897       <li>"class" means Java programming language class.</li>
 898       <li>"heap" means Java virtual machine heap.</li>
 899       <li>"monitor" means Java programming language object monitor.</li>
 900     </ul>
 901     <p/>
 902     Sun, Sun Microsystems, the Sun logo, Java, and JVM
 903     are trademarks or registered trademarks of Oracle
 904     and/or its affiliates, in the U.S. and other countries.
 905   </intro>
 906 
 907 
 908 <functionsection label="Functions">
 909   <intro id="jvmtiEnvAccess" label="Accessing Functions">
 910     Native code accesses <jvmti/> features
 911     by calling <jvmti/> functions.
 912     Access to <jvmti/> functions is by use of an interface pointer
 913     in the same manner as
 914     <externallink id="jni/design.html">Java
 915       Native Interface (JNI) functions</externallink> are accessed.
 916     The <jvmti/> interface pointer is called the
 917     <i>environment pointer</i>.
 918     <p/>
 919     An environment pointer is a pointer to an environment and has
 920     the type <code>jvmtiEnv*</code>.
 921     An environment has information about its <jvmti/> connection.
 922     The first value in the environment is a pointer to the function table.
 923     The function table is an array of pointers to <jvmti/> functions.
 924     Every function pointer is at a predefined offset inside the
 925     array.
 926     <p/>
 927     When used from the C language:
 928     double indirection is used to access the functions;
 929     the environment pointer provides context and is the first
 930     parameter of each function call; for example:
 931     <example>
 932 jvmtiEnv *jvmti;
 933 ...
 934 jvmtiError err = (*jvmti)->GetLoadedClasses(jvmti, &amp;class_count, &amp;classes);
 935     </example>
 936     <p/>
 937     When used from the C++ language:
 938     functions are accessed as member functions of <code>jvmtiEnv</code>;
 939     the environment pointer is not passed to the function call; for example:
 940     <example>
 941 jvmtiEnv *jvmti;
 942 ...
 943 jvmtiError err = jvmti->GetLoadedClasses(&amp;class_count, &amp;classes);
 944     </example>
 945     Unless otherwise stated, all examples and declarations in this
 946     specification use the C language.
 947     <p/>
 948     A <jvmti/> environment can be obtained through the JNI Invocation API
 949     <code>GetEnv</code> function:
 950     <example>
 951 jvmtiEnv *jvmti;
 952 ...
 953 (*jvm)->GetEnv(jvm, &amp;jvmti, JVMTI_VERSION_1_0);
 954     </example>
 955     Each call to <code>GetEnv</code>
 956     creates a new <jvmti/> connection and thus
 957     a new <jvmti/> environment.
 958     The <code>version</code> argument of <code>GetEnv</code> must be
 959     a <jvmti/> version.
 960     The returned environment may have a different version than the
 961     requested version but the returned environment must be compatible.
 962     <code>GetEnv</code> will return <code>JNI_EVERSION</code> if a
 963     compatible version is not available, if <jvmti/> is not supported or
 964     <jvmti/> is not supported in the current VM configuration.
 965     Other interfaces may be added for creating <jvmti/> environments
 966     in specific contexts.
 967     Each environment has its own state (for example,
 968     <functionlink id="SetEventNotificationMode">desired events</functionlink>,
 969     <functionlink id="SetEventCallbacks">event handling functions</functionlink>, and
 970     <functionlink id="AddCapabilities">capabilities</functionlink>).
 971     An environment is released with
 972     <functionlink id="DisposeEnvironment"></functionlink>.
 973     Thus, unlike JNI which has one environment per thread, <jvmti/> environments work
 974     across threads and are created dynamically.
 975   </intro>
 976 
 977   <intro id="functionReturn" label="Function Return Values">
 978     <jvmti/> functions always return an
 979     <internallink id="ErrorSection">error code</internallink> via the
 980     <datalink id="jvmtiError"/> function return value.
 981     Some functions can return additional
 982     values through pointers provided by the calling function.
 983     In some cases, <jvmti/> functions allocate memory that your program must
 984     explicitly deallocate. This is indicated in the individual <jvmti/>
 985     function descriptions.  Empty lists, arrays, sequences, etc are
 986     returned as <code>NULL</code>.
 987     <p/>
 988     In the event that the <jvmti/> function encounters
 989     an error (any return value other than <code>JVMTI_ERROR_NONE</code>) the values
 990     of memory referenced by argument pointers is undefined, but no memory
 991     will have been allocated and no global references will have been allocated.
 992     If the error occurs because of invalid input, no action will have occurred.
 993   </intro>
 994 
 995 <intro id="refs" label="Managing JNI Object References">
 996     <jvmti/> functions identify objects with JNI references
 997     (<datalink id="jobject"/> and <datalink id="jclass"/>)
 998     and their derivatives
 999     (<datalink id="jthread"/> and <datalink id="jthreadGroup"/>).
1000     References passed to
1001     <jvmti/> functions can be either global or local, but they must be
1002     strong references. All references returned by <jvmti/> functions are
1003     local references--these local references are created
1004     during the <jvmti/> call.
1005     Local references are a resource that must be managed (see the
1006     <externallink id="jni/functions.html#local-references">
1007       JNI Documentation</externallink>).
1008     When threads return from native code all local references
1009     are freed.  Note that some threads, including typical
1010     agent threads, will never return from native code.
1011     A thread is ensured the ability to create sixteen local
1012     references without the need for any explicit management.
1013     For threads executing a limited number of <jvmti/> calls before
1014     returning from native code
1015     (for example, threads processing events),
1016     it may be determined that no explicit management
1017     is needed.
1018     However, long running agent threads will need explicit
1019     local reference management--usually with the JNI functions
1020     <code>PushLocalFrame</code> and <code>PopLocalFrame</code>.
1021     Conversely, to preserve references beyond the
1022     return from native code, they must be converted to global references.
1023     These rules do not apply to <datalink id="jmethodID"/> and <datalink id="jfieldID"/>
1024     as they are not <datalink id="jobject"/>s.
1025 </intro>
1026 
1027     <intro id="prereqState" label="Prerequisite State for Calling Functions">
1028       Unless the function explicitly states that the agent must bring
1029       a thread or the VM to a particular state (for example, suspended),
1030       the <jvmti/> implementation is responsible for bringing the VM to a
1031       safe and consistent state for performing the function.
1032     </intro>
1033 
1034     <intro id="functionsExceptions" label="Exceptions and Functions">
1035       <jvmti/> functions never throw exceptions; error conditions are
1036       communicated via the
1037       <internallink id="functionReturn">function return value</internallink>.
1038       Any existing exception state is preserved across a call to a
1039       <jvmti/> function.
1040       See the
1041       <externallink
1042         id="jni/design.html#java-exceptions"
1043              >Java Exceptions</externallink>
1044       section of the JNI specification for information on handling exceptions.
1045     </intro>
1046 
1047   <category id="memory" label="Memory Management">
1048     <intro>
1049       These functions provide for the allocation and deallocation of
1050       memory used by <jvmti/> functionality and can be used to provide
1051       working memory for agents.
1052       Memory managed by <jvmti/> is not compatible with other memory
1053       allocation libraries and mechanisms.
1054     </intro>
1055 
1056     <function id="Allocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="46">
1057       <synopsis>Allocate</synopsis>
1058       <description>
1059         Allocate an area of memory through the <jvmti/> allocator.
1060         The allocated
1061         memory should be freed with <functionlink id="Deallocate"></functionlink>.
1062       </description>
1063       <origin>jvmdi</origin>
1064       <capabilities>
1065       </capabilities>
1066       <parameters>
1067         <param id="size">
1068           <jlong/>
1069           <description>
1070             The number of bytes to allocate.
1071             <rationale>
1072               <code>jlong</code> is used for compatibility with JVMDI.
1073             </rationale>
1074           </description>
1075         </param>
1076         <param id="mem_ptr">
1077           <allocbuf incount="size"><uchar/></allocbuf>
1078           <description>
1079             On return, a pointer to the beginning of the allocated memory.
1080             If <code>size</code> is zero, <code>NULL</code> is returned.
1081           </description>
1082         </param>
1083       </parameters>
1084       <errors>
1085         <error id="JVMTI_ERROR_OUT_OF_MEMORY">
1086           Memory request cannot be honored.
1087         </error>
1088         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
1089           <paramlink id="size"></paramlink> is less than zero.
1090         </error>
1091       </errors>
1092     </function>
1093 
1094     <function id="Deallocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="47">
1095       <synopsis>Deallocate</synopsis>
1096       <description>
1097         Deallocate <code>mem</code>  using the <jvmti/> allocator.
1098         This function should
1099         be used to deallocate any memory allocated and returned
1100         by a <jvmti/> function
1101         (including memory allocated with <functionlink id="Allocate"></functionlink>).
1102         All allocated memory must be deallocated
1103         or the memory cannot be reclaimed.
1104       </description>
1105       <origin>jvmdi</origin>
1106       <capabilities>
1107       </capabilities>
1108       <parameters>
1109         <param id="mem">
1110           <outbuf>
1111             <uchar/>
1112             <nullok>the call is ignored</nullok>
1113           </outbuf>
1114           <description>
1115             A pointer to the beginning of the allocated memory.
1116             Please ignore "On return, the elements are set."
1117               <todo>keep it from generating "On return, the elements are set"</todo>
1118           </description>
1119         </param>
1120       </parameters>
1121       <errors>
1122       </errors>
1123     </function>
1124   </category>
1125 
1126   <category id="threadCategory" label="Thread">
1127     <intro>
1128     </intro>
1129 
1130     <function id="GetThreadState" num="17">
1131       <synopsis>Get Thread State</synopsis>
1132       <description>
1133         Get the state of a thread.  The state of the thread is represented by the
1134         answers to the hierarchical set of questions below:
1135           <ul type="circle">
1136             <li><i>Alive?</i>
1137               <ul>
1138                 <li>Not alive.
1139                   <ul type="circle">
1140                     <li><i>Why not alive?</i>
1141                       <ul>
1142                         <li>New.</li>
1143                         <li>Terminated (<datalink
1144                             id="JVMTI_THREAD_STATE_TERMINATED"><code>JVMTI_THREAD_STATE_TERMINATED</code></datalink>)</li>
1145                       </ul>
1146                     </li>
1147                   </ul>
1148                 </li>
1149                 <li>Alive (<datalink
1150                     id="JVMTI_THREAD_STATE_ALIVE"><code>JVMTI_THREAD_STATE_ALIVE</code></datalink>)
1151                   <ul type="circle">
1152                     <li><i>Suspended?</i>
1153                       <ul>
1154                         <li>Suspended (<datalink
1155                             id="JVMTI_THREAD_STATE_SUSPENDED"><code>JVMTI_THREAD_STATE_SUSPENDED</code></datalink>)</li>
1156                         <li>Not suspended</li>
1157                       </ul>
1158                     </li>
1159                     <li><i>Interrupted?</i>
1160                       <ul>
1161                         <li>Interrupted (<datalink
1162                             id="JVMTI_THREAD_STATE_INTERRUPTED"><code>JVMTI_THREAD_STATE_INTERRUPTED</code></datalink>)</li>
1163                         <li>Not interrupted.</li>
1164                       </ul>
1165                     </li>
1166                     <li><i>In native?</i>
1167                       <ul>
1168                         <li>In native code (<datalink
1169                             id="JVMTI_THREAD_STATE_IN_NATIVE"><code>JVMTI_THREAD_STATE_IN_NATIVE</code></datalink>)</li>
1170                         <li>In Java programming language code</li>
1171                       </ul>
1172                     </li>
1173                     <li><i>What alive state?</i>
1174                       <ul>
1175                         <li>Runnable (<datalink
1176                             id="JVMTI_THREAD_STATE_RUNNABLE"><code>JVMTI_THREAD_STATE_RUNNABLE</code></datalink>)</li>
1177                         <li>Blocked (<datalink
1178                             id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER"><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></datalink>)</li>
1179                         <li>Waiting (<datalink
1180                             id="JVMTI_THREAD_STATE_WAITING"><code>JVMTI_THREAD_STATE_WAITING</code></datalink>)
1181                           <ul type="circle">
1182                             <li><i>Timed wait?</i>
1183                               <ul>
1184                                 <li>Indefinite (<datalink
1185                                     id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY"><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></datalink></li>
1186                                 <li>Timed (<datalink
1187                                     id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT"><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></datalink>)</li>
1188                               </ul>
1189                             </li>
1190                             <li><i>Why waiting?</i>
1191                               <ul>
1192                                 <li>Object.wait (<datalink
1193                                     id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT"><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></datalink>)</li>
1194                                 <li>LockSupport.park (<datalink
1195                                     id="JVMTI_THREAD_STATE_PARKED"><code>JVMTI_THREAD_STATE_PARKED</code></datalink>)</li>
1196                                 <li>Sleeping (<datalink
1197                                     id="JVMTI_THREAD_STATE_SLEEPING"><code>JVMTI_THREAD_STATE_SLEEPING</code></datalink>)</li>
1198                               </ul>
1199                             </li>
1200                           </ul>
1201                         </li>
1202                       </ul>
1203                     </li>
1204                   </ul>
1205                 </li>
1206               </ul>
1207             </li>
1208           </ul>
1209         <p/>
1210         The answers are represented by the following bit vector.
1211         <constants id="jvmtiThreadState" label="Thread State Flags" kind="bits">
1212           <constant id="JVMTI_THREAD_STATE_ALIVE" num="0x0001">
1213             Thread is alive. Zero if thread is new (not started) or terminated.
1214           </constant>
1215           <constant id="JVMTI_THREAD_STATE_TERMINATED" num="0x0002">
1216             Thread has completed execution.
1217           </constant>
1218           <constant id="JVMTI_THREAD_STATE_RUNNABLE" num="0x0004">
1219             Thread is runnable.
1220           </constant>
1221           <constant id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER" num="0x0400">
1222             Thread is waiting to enter a synchronization block/method or,
1223             after an <code>Object.wait()</code>, waiting to re-enter a
1224             synchronization block/method.
1225           </constant>
1226           <constant id="JVMTI_THREAD_STATE_WAITING" num="0x0080">
1227             Thread is waiting.
1228           </constant>
1229           <constant id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY" num="0x0010">
1230             Thread is waiting without a timeout.
1231             For example, <code>Object.wait()</code>.
1232           </constant>
1233           <constant id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT" num="0x0020">
1234             Thread is waiting with a maximum time to wait specified.
1235             For example, <code>Object.wait(long)</code>.
1236           </constant>
1237           <constant id="JVMTI_THREAD_STATE_SLEEPING" num="0x0040">
1238             Thread is sleeping -- <code>Thread.sleep(long)</code>.
1239           </constant>
1240           <constant id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT" num="0x0100">
1241             Thread is waiting on an object monitor -- <code>Object.wait</code>.
1242           </constant>
1243           <constant id="JVMTI_THREAD_STATE_PARKED" num="0x0200">
1244             Thread is parked, for example: <code>LockSupport.park</code>,
1245             <code>LockSupport.parkUtil</code> and <code>LockSupport.parkNanos</code>.
1246           </constant>
1247           <constant id="JVMTI_THREAD_STATE_SUSPENDED" num="0x100000">
1248             Thread suspended.
1249             <code>java.lang.Thread.suspend()</code>
1250             or a <jvmti/> suspend function
1251             (such as <functionlink id="SuspendThread"></functionlink>)
1252             has been called on the thread. If this bit
1253             is set, the other bits refer to the thread state before suspension.
1254           </constant>
1255           <constant id="JVMTI_THREAD_STATE_INTERRUPTED" num="0x200000">
1256             Thread has been interrupted.
1257           </constant>
1258           <constant id="JVMTI_THREAD_STATE_IN_NATIVE" num="0x400000">
1259             Thread is in native code--that is, a native method is running
1260             which has not called back into the VM or Java programming
1261             language code.
1262             <p/>
1263             This flag is not set when running VM compiled Java programming
1264             language code nor is it set when running VM code or
1265             VM support code. Native VM interface functions, such as JNI and
1266             <jvmti/> functions, may be implemented as VM code.
1267           </constant>
1268           <constant id="JVMTI_THREAD_STATE_VENDOR_1" num="0x10000000">
1269             Defined by VM vendor.
1270           </constant>
1271           <constant id="JVMTI_THREAD_STATE_VENDOR_2" num="0x20000000">
1272             Defined by VM vendor.
1273           </constant>
1274           <constant id="JVMTI_THREAD_STATE_VENDOR_3" num="0x40000000">
1275             Defined by VM vendor.
1276           </constant>
1277         </constants>
1278         The following definitions are used to convert <jvmti/> thread state
1279         to <code>java.lang.Thread.State</code> style states.
1280         <constants id="jvmtiJavaLangThreadState" label="java.lang.Thread.State Conversion Masks" kind="bits">
1281           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_MASK"
1282                      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">
1283             Mask the state with this before comparison
1284           </constant>
1285           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_NEW"
1286                      num="0">
1287             <code>java.lang.Thread.State.NEW</code>
1288           </constant>
1289           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED"
1290                      num="JVMTI_THREAD_STATE_TERMINATED">
1291             <code>java.lang.Thread.State.TERMINATED</code>
1292           </constant>
1293           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE"
1294                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE">
1295             <code>java.lang.Thread.State.RUNNABLE</code>
1296           </constant>
1297           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED"
1298                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER">
1299             <code>java.lang.Thread.State.BLOCKED</code>
1300           </constant>
1301           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_WAITING"
1302                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY">
1303             <code>java.lang.Thread.State.WAITING</code>
1304           </constant>
1305           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING"
1306                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT">
1307             <code>java.lang.Thread.State.TIMED_WAITING</code>
1308           </constant>
1309         </constants>
1310         <b>Rules</b>
1311         <p/>
1312         There can be no more than one answer to a question, although there can be no
1313         answer (because the answer is unknown, does not apply, or none of the answers is
1314         correct).  An answer is set only when the enclosing answers match.
1315         That is, no more than one of
1316           <ul type="circle">
1317               <li><code>JVMTI_THREAD_STATE_RUNNABLE</code></li>
1318               <li><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></li>
1319               <li><code>JVMTI_THREAD_STATE_WAITING</code></li>
1320           </ul>
1321         can be set (a <tm>J2SE</tm> compliant implementation will always set
1322         one of these if <code>JVMTI_THREAD_STATE_ALIVE</code> is set).
1323         And if any of these are set, the enclosing answer
1324         <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1325         No more than one of
1326           <ul type="circle">
1327               <li><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></li>
1328               <li><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></li>
1329           </ul>
1330         can be set (a <tm>J2SE</tm> compliant implementation will always set
1331         one of these if <code>JVMTI_THREAD_STATE_WAITING</code> is set).
1332         And if either is set, the enclosing answers
1333         <code>JVMTI_THREAD_STATE_ALIVE</code> and
1334         <code>JVMTI_THREAD_STATE_WAITING</code> are set.
1335         No more than one of
1336           <ul type="circle">
1337               <li><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></li>
1338               <li><code>JVMTI_THREAD_STATE_PARKED</code></li>
1339               <li><code>JVMTI_THREAD_STATE_SLEEPING</code></li>
1340           </ul>
1341         can be set. And if any of these is set, the enclosing answers
1342         <code>JVMTI_THREAD_STATE_ALIVE</code> and
1343         <code>JVMTI_THREAD_STATE_WAITING</code> are set.
1344         Also, if <code>JVMTI_THREAD_STATE_SLEEPING</code> is set,
1345         then <code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code> is set.
1346         If a state <i>A</i> is implemented using the mechanism of
1347         state <i>B</i> then it is state <i>A</i> which
1348         is returned by this function.
1349         For example, if <code>Thread.sleep(long)</code>
1350         is implemented using <code>Object.wait(long)</code>
1351         then it is still <code>JVMTI_THREAD_STATE_SLEEPING</code>
1352         which is returned.
1353         More than one of
1354           <ul type="circle">
1355               <li><code>JVMTI_THREAD_STATE_SUSPENDED</code></li>
1356               <li><code>JVMTI_THREAD_STATE_INTERRUPTED</code></li>
1357               <li><code>JVMTI_THREAD_STATE_IN_NATIVE</code></li>
1358           </ul>
1359         can be set, but if any is set,
1360         <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1361         <p/>
1362         And finally,
1363         <code>JVMTI_THREAD_STATE_TERMINATED</code> cannot be set unless
1364         <code>JVMTI_THREAD_STATE_ALIVE</code> is not set.
1365         <p/>
1366         The thread state representation is designed for extension in future versions
1367         of the specification; thread state values should be used accordingly, that is
1368         they should not be used as ordinals.
1369         Most queries can be made by testing a single bit, if use in a switch statement is desired,
1370         the state bits should be masked with the interesting bits.
1371         All bits not defined above are reserved for future use.
1372         A VM, compliant to the current specification, must set reserved bits to zero.
1373         An agent should ignore reserved bits --
1374         they should not be assumed to be zero and thus should not be included in comparisons.
1375         <p/>
1376         <b>Examples</b>
1377         <p/>
1378         Note that the values below exclude reserved and vendor bits.
1379         <p/>
1380         The state of a thread blocked at a <code>synchronized</code>-statement would be:
1381         <example>
1382             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER
1383         </example>
1384         The state of a thread which hasn't started yet would be:
1385         <example>
1386             0
1387         </example>
1388         The state of a thread at a <code>Object.wait(3000)</code> would be:
1389         <example>
1390             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_WAITING +
1391                 JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
1392                 JVMTI_THREAD_STATE_MONITOR_WAITING
1393         </example>
1394         The state of a thread suspended while runnable would be:
1395         <example>
1396             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_RUNNABLE + JVMTI_THREAD_STATE_SUSPENDED
1397         </example>
1398         <p/>
1399         <b>Testing the State</b>
1400         <p/>
1401         In most cases, the thread state can be determined by testing the one bit corresponding
1402         to that question.  For example, the code to test if a thread is sleeping:
1403         <example>
1404         jint state;
1405         jvmtiError err;
1406 
1407         err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1408         if (err == JVMTI_ERROR_NONE) {
1409            if (state &amp; JVMTI_THREAD_STATE_SLEEPING) {  ...
1410         </example>
1411         <p/>
1412         For waiting (that is, in <code>Object.wait</code>, parked, or sleeping) it would be:
1413         <example>
1414            if (state &amp; JVMTI_THREAD_STATE_WAITING) {  ...
1415         </example>
1416         For some states, more than one bit will need to be tested as is the case
1417         when testing if a thread has not yet been started:
1418         <example>
1419            if ((state &amp; (JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_TERMINATED)) == 0)  {  ...
1420         </example>
1421         To distinguish timed from untimed <code>Object.wait</code>:
1422         <example>
1423            if (state &amp; JVMTI_THREAD_STATE_IN_OBJECT_WAIT)  {
1424              if (state &amp; JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)  {
1425                printf("in Object.wait(long timeout)\n");
1426              } else {
1427                printf("in Object.wait()\n");
1428              }
1429            }
1430         </example>
1431         <p/>
1432         <b>Relationship to <code>java.lang.Thread.State</code></b>
1433         <p/>
1434         The thread state represented by <code>java.lang.Thread.State</code>
1435         returned from <code>java.lang.Thread.getState()</code> is a subset of the
1436         information returned from this function.
1437         The corresponding <code>java.lang.Thread.State</code> can be determined
1438         by using the provided conversion masks.
1439         For example, this returns the name of the <code>java.lang.Thread.State</code> thread state:
1440         <example>
1441             err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1442             abortOnError(err);
1443             switch (state &amp; JVMTI_JAVA_LANG_THREAD_STATE_MASK) {
1444             case JVMTI_JAVA_LANG_THREAD_STATE_NEW:
1445               return "NEW";
1446             case JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED:
1447               return "TERMINATED";
1448             case JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE:
1449               return "RUNNABLE";
1450             case JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED:
1451               return "BLOCKED";
1452             case JVMTI_JAVA_LANG_THREAD_STATE_WAITING:
1453               return "WAITING";
1454             case JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING:
1455               return "TIMED_WAITING";
1456             }
1457         </example>
1458       </description>
1459       <origin>new</origin>
1460       <capabilities>
1461       </capabilities>
1462       <parameters>
1463         <param id="thread">
1464           <jthread null="current" started="maybe" impl="noconvert"/>
1465             <description>
1466               The thread to query.
1467             </description>
1468         </param>
1469         <param id="thread_state_ptr">
1470           <outptr><jint/></outptr>
1471           <description>
1472             On return, points to state flags,
1473             as defined by the <internallink id="jvmtiThreadState">Thread State Flags</internallink>.
1474           </description>
1475         </param>
1476       </parameters>
1477       <errors>
1478       </errors>
1479     </function>
1480 
1481     <function id="GetCurrentThread" phase="start" num="18" since="1.1">
1482       <synopsis>Get Current Thread</synopsis>
1483       <description>
1484         Get the current thread.
1485         The current thread is the Java programming language thread which has called the function.
1486         The function may return <code>NULL</code> in the start phase if the
1487         <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
1488         <code>can_generate_early_vmstart</code></internallink> capability is enabled
1489         and the <code>java.lang.Thread</code> class has not been initialized yet.
1490         <p/>
1491         Note that most <jvmti/> functions that take a thread
1492         as an argument will accept <code>NULL</code> to mean
1493         the current thread.
1494       </description>
1495       <origin>new</origin>
1496       <capabilities>
1497       </capabilities>
1498       <parameters>
1499         <param id="thread_ptr">
1500           <outptr><jthread/></outptr>
1501           <description>
1502              On return, points to the current thread, or <code>NULL</code>.
1503           </description>
1504         </param>
1505       </parameters>
1506       <errors>
1507       </errors>
1508     </function>
1509 
1510     <function id="GetAllThreads" num="4">
1511       <synopsis>Get All Threads</synopsis>
1512       <description>
1513         Get all live threads.
1514         The threads are Java programming language threads;
1515         that is, threads that are attached to the VM.
1516         A thread is live if <code>java.lang.Thread.isAlive()</code>
1517         would return <code>true</code>, that is, the thread has
1518         been started and has not yet died.
1519         The universe of threads is determined by the context of the <jvmti/>
1520         environment, which typically is all threads attached to the VM.
1521         Note that this includes <jvmti/> agent threads
1522         (see <functionlink id="RunAgentThread"/>).
1523       </description>
1524       <origin>jvmdi</origin>
1525       <capabilities>
1526       </capabilities>
1527       <parameters>
1528         <param id="threads_count_ptr">
1529           <outptr><jint/></outptr>
1530           <description>
1531             On return, points to the number of running threads.
1532           </description>
1533         </param>
1534         <param id="threads_ptr">
1535           <allocbuf outcount="threads_count_ptr"><jthread/></allocbuf>
1536             <description>
1537               On return, points to an array of references, one
1538               for each running thread.
1539             </description>
1540         </param>
1541       </parameters>
1542       <errors>
1543       </errors>
1544     </function>
1545 
1546     <function id="SuspendThread" num="5">
1547       <synopsis>Suspend Thread</synopsis>
1548       <description>
1549         Suspend the specified thread. If the calling thread is specified,
1550         this function will not return until some other thread calls
1551         <functionlink id="ResumeThread"></functionlink>.
1552         If the thread is currently suspended, this function
1553         does nothing and returns an error.
1554       </description>
1555       <origin>jvmdi</origin>
1556       <capabilities>
1557         <required id="can_suspend"></required>
1558       </capabilities>
1559       <parameters>
1560         <param id="thread">
1561           <jthread null="current"/>
1562             <description>
1563               The thread to suspend.
1564             </description>
1565         </param>
1566       </parameters>
1567       <errors>
1568         <error id="JVMTI_ERROR_THREAD_SUSPENDED">
1569           Thread already suspended.
1570         </error>
1571       </errors>
1572     </function>
1573 
1574     <elide>
1575     <function id="SuspendAllThreads" num="101">
1576       <synopsis>Suspend All Threads</synopsis>
1577       <description>
1578         <issue>
1579             There has been no explicit call for this function, and it will
1580             thus be removed if there is no interest.
1581         </issue>
1582         Suspend all live threads except:
1583         <ul>
1584           <li>already suspended threads</li>
1585           <li>those listed in <paramlink id="except_list"></paramlink></li>
1586           <li>certain system (non application) threads, as determined
1587             by the VM implementation</li>
1588         </ul>
1589         The threads are Java programming language threads;
1590         native threads which are not attached to the VM are not
1591         Java programming language threads.
1592         A thread is live if <code>java.lang.Thread.isAlive()</code>
1593         would return <code>true</code>, that is, the thread has
1594         been started and has not yet died.
1595         The universe of threads is determined
1596         by the context of the <jvmti/>
1597         environment, which, typically, is all threads attached to the VM,
1598         except critical VM internal threads and <jvmti/> agent threads
1599         (see <functionlink id="RunAgentThread"/>).
1600         <p/>
1601         If the calling thread is specified,
1602         all other threads are suspended first then the caller thread is suspended -
1603         this function will not return until some other thread calls
1604         <functionlink id="ResumeThread"></functionlink>.
1605         <p/>
1606         The list of actually
1607         suspended threads is returned in
1608         <paramlink id="suspended_list_ptr"></paramlink>.
1609         Suspension is as defined in <functionlink id="SuspendThread"></functionlink>.
1610         <functionlink id="ResumeThreadList"></functionlink>
1611         can be used to resume the suspended threads.
1612       </description>
1613       <origin>new</origin>
1614       <capabilities>
1615         <required id="can_suspend"></required>
1616       </capabilities>
1617       <parameters>
1618         <param id="except_count">
1619           <jint min="0"/>
1620           <description>
1621             The number of threads in the list of threads not to be suspended.
1622           </description>
1623         </param>
1624         <param id="except_list">
1625             <inbuf incount="except_count">
1626               <jthread/>
1627               <nullok>not an error if <code>except_count == 0</code></nullok>
1628             </inbuf>
1629             <description>
1630               The list of threads not to be suspended.
1631             </description>
1632         </param>
1633         <param id="suspended_count_ptr">
1634           <outptr><jint/></outptr>
1635           <description>
1636             On return, points to the number of threads suspended by this call.
1637           </description>
1638         </param>
1639         <param id="suspended_list_ptr">
1640           <allocbuf outcount="suspended_count_ptr"><jthread/></allocbuf>
1641             <description>
1642               On return, points to an array of references, one
1643               for each thread suspended.
1644             </description>
1645         </param>
1646       </parameters>
1647       <errors>
1648         <error id="JVMTI_ERROR_INVALID_THREAD">
1649           A thread in <paramlink id="except_list"></paramlink> was invalid.
1650         </error>
1651         <error id="JVMTI_ERROR_NULL_POINTER">
1652           Both <paramlink id="except_list"></paramlink> was <code>NULL</code>
1653           and <paramlink id="except_count"></paramlink> was non-zero.
1654         </error>
1655       </errors>
1656     </function>
1657     </elide>
1658 
1659     <function id="SuspendThreadList" num="92">
1660       <synopsis>Suspend Thread List</synopsis>
1661       <description>
1662         Suspend the <paramlink id="request_count"></paramlink>
1663         threads specified in the
1664         <paramlink id="request_list"></paramlink> array.
1665         Threads may be resumed with
1666         <functionlink id="ResumeThreadList"></functionlink> or
1667         <functionlink id="ResumeThread"></functionlink>.
1668         If the calling thread is specified in the
1669         <paramlink id="request_list"></paramlink> array, this function will
1670         not return until some other thread resumes it.
1671         Errors encountered in the suspension of a thread
1672         are returned in the <paramlink id="results"></paramlink>
1673         array, <b>not</b> in the return value of this function.
1674         Threads that are currently suspended do not change state.
1675       </description>
1676       <origin>jvmdi</origin>
1677       <capabilities>
1678         <required id="can_suspend"></required>
1679       </capabilities>
1680       <parameters>
1681         <param id="request_count">
1682           <jint min="0"/>
1683           <description>
1684             The number of threads to suspend.
1685           </description>
1686         </param>
1687         <param id="request_list">
1688           <inbuf incount="request_count"><jthread/></inbuf>
1689             <description>
1690               The list of threads to suspend.
1691             </description>
1692         </param>
1693         <param id="results">
1694           <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1695           <description>
1696             An agent supplied array of
1697             <paramlink id="request_count"></paramlink> elements.
1698             On return, filled with the error code for
1699             the suspend of the corresponding thread.
1700             The error code will be
1701             <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1702             if the thread was suspended by this call.
1703             Possible error codes are those specified
1704             for <functionlink id="SuspendThread"></functionlink>.
1705           </description>
1706         </param>
1707       </parameters>
1708       <errors>
1709       </errors>
1710     </function>
1711 
1712     <function id="ResumeThread" num="6">
1713       <synopsis>Resume Thread</synopsis>
1714       <description>
1715         Resume a suspended thread.
1716         Any threads currently suspended through
1717         a <jvmti/> suspend function (eg.
1718         <functionlink id="SuspendThread"></functionlink>)
1719         or <code>java.lang.Thread.suspend()</code>
1720         will resume execution;
1721         all other threads are unaffected.
1722       </description>
1723       <origin>jvmdi</origin>
1724       <capabilities>
1725         <required id="can_suspend"></required>
1726       </capabilities>
1727       <parameters>
1728         <param id="thread">
1729           <jthread/>
1730             <description>
1731               The thread to resume.
1732             </description>
1733         </param>
1734       </parameters>
1735       <errors>
1736         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
1737           Thread was not suspended.
1738         </error>
1739         <error id="JVMTI_ERROR_INVALID_TYPESTATE">
1740           The state of the thread has been modified, and is now inconsistent.
1741         </error>
1742       </errors>
1743     </function>
1744 
1745     <function id="ResumeThreadList" num="93">
1746       <synopsis>Resume Thread List</synopsis>
1747       <description>
1748         Resume the <paramlink id="request_count"></paramlink>
1749         threads specified in the
1750         <paramlink id="request_list"></paramlink> array.
1751         Any thread suspended through
1752         a <jvmti/> suspend function (eg.
1753         <functionlink id="SuspendThreadList"></functionlink>)
1754         or <code>java.lang.Thread.suspend()</code>
1755         will resume execution.
1756       </description>
1757       <origin>jvmdi</origin>
1758       <capabilities>
1759         <required id="can_suspend"></required>
1760       </capabilities>
1761       <parameters>
1762         <param id="request_count">
1763           <jint min="0"/>
1764           <description>
1765             The number of threads to resume.
1766           </description>
1767         </param>
1768         <param id="request_list">
1769           <inbuf incount="request_count"><jthread/></inbuf>
1770             <description>
1771               The threads to resume.
1772             </description>
1773         </param>
1774         <param id="results">
1775           <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1776           <description>
1777             An agent supplied array of
1778             <paramlink id="request_count"></paramlink> elements.
1779             On return, filled with the error code for
1780             the resume of the corresponding thread.
1781             The error code will be
1782             <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1783             if the thread was suspended by this call.
1784             Possible error codes are those specified
1785             for <functionlink id="ResumeThread"></functionlink>.
1786           </description>
1787         </param>
1788       </parameters>
1789       <errors>
1790       </errors>
1791     </function>
1792 
1793     <function id="StopThread" num="7">
1794       <synopsis>Stop Thread</synopsis>
1795       <description>
1796         Send the specified asynchronous exception to the specified thread.
1797         Normally, this function is used to kill the specified thread with an
1798         instance of the exception <code>ThreadDeath</code>, similar to
1799         <code>java.lang.Thread.stop</code>.
1800       </description>
1801       <origin>jvmdi</origin>
1802       <capabilities>
1803         <required id="can_signal_thread"></required>
1804       </capabilities>
1805       <parameters>
1806         <param id="thread">
1807           <jthread/>
1808             <description>
1809               The thread to stop.
1810             </description>
1811         </param>
1812         <param id="exception">
1813           <jobject/>
1814             <description>
1815               The asynchronous exception object.
1816             </description>
1817         </param>
1818       </parameters>
1819       <errors>
1820       </errors>
1821     </function>
1822 
1823     <function id="InterruptThread" num="8">
1824       <synopsis>Interrupt Thread</synopsis>
1825       <description>
1826         Interrupt the specified thread
1827         (similar to <code>java.lang.Thread.interrupt</code>).
1828       </description>
1829       <origin>jvmdi</origin>
1830       <capabilities>
1831         <required id="can_signal_thread"></required>
1832       </capabilities>
1833       <parameters>
1834         <param id="thread">
1835           <jthread impl="noconvert"/>
1836             <description>
1837               The thread to interrupt.
1838             </description>
1839         </param>
1840       </parameters>
1841       <errors>
1842       </errors>
1843     </function>
1844 
1845     <function id="GetThreadInfo" num="9">
1846       <synopsis>Get Thread Info</synopsis>
1847       <typedef id="jvmtiThreadInfo" label="Thread information structure">
1848         <field id="name">
1849           <allocfieldbuf><char/></allocfieldbuf>
1850           <description>
1851             The thread name, encoded as a
1852             <internallink id="mUTF">modified UTF-8</internallink> string.
1853           </description>
1854         </field>
1855         <field id="priority">
1856           <jint/>
1857           <description>
1858             The thread priority.  See the thread priority constants:
1859             <datalink id="jvmtiThreadPriority"></datalink>.
1860           </description>
1861         </field>
1862         <field id="is_daemon">
1863           <jboolean/>
1864           <description>
1865             Is this a daemon thread?
1866           </description>
1867         </field>
1868         <field id="thread_group">
1869           <jthreadGroup/>
1870           <description>
1871             The thread group to which this thread belongs.
1872             <code>NULL</code> if the thread has died.
1873           </description>
1874         </field>
1875         <field id="context_class_loader">
1876           <jobject/>
1877             <description>
1878               The context class loader associated with this thread.
1879             </description>
1880         </field>
1881       </typedef>
1882       <description>
1883         Get thread information. The fields of the <datalink id="jvmtiThreadInfo"/> structure
1884         are filled in with details of the specified thread.
1885       </description>
1886       <origin>jvmdi</origin>
1887       <capabilities>
1888       </capabilities>
1889       <parameters>
1890         <param id="thread">
1891           <jthread null="current" impl="noconvert" started="maybe"/>
1892             <description>
1893               The thread to query.
1894             </description>
1895         </param>
1896         <param id="info_ptr">
1897           <outptr><struct>jvmtiThreadInfo</struct></outptr>
1898           <description>
1899             On return, filled with information describing the specified thread.
1900           </description>
1901         </param>
1902       </parameters>
1903       <errors>
1904       </errors>
1905     </function>
1906 
1907     <function id="GetOwnedMonitorInfo" num="10">
1908       <synopsis>Get Owned Monitor Info</synopsis>
1909       <description>
1910         Get information about the monitors owned by the
1911         specified thread.
1912       </description>
1913       <origin>jvmdiClone</origin>
1914       <capabilities>
1915         <required id="can_get_owned_monitor_info"></required>
1916       </capabilities>
1917       <parameters>
1918         <param id="thread">
1919           <jthread null="current"/>
1920             <description>
1921               The thread to query.
1922             </description>
1923         </param>
1924         <param id="owned_monitor_count_ptr">
1925           <outptr><jint/></outptr>
1926           <description>
1927             The number of monitors returned.
1928           </description>
1929         </param>
1930         <param id="owned_monitors_ptr">
1931           <allocbuf outcount="owned_monitor_count_ptr"><jobject/></allocbuf>
1932             <description>
1933               The array of owned monitors.
1934             </description>
1935         </param>
1936       </parameters>
1937       <errors>
1938       </errors>
1939     </function>
1940 
1941     <function id="GetOwnedMonitorStackDepthInfo" num="153" since="1.1">
1942       <synopsis>Get Owned Monitor Stack Depth Info</synopsis>
1943       <typedef id="jvmtiMonitorStackDepthInfo"
1944                label="Monitor stack depth information structure">
1945         <field id="monitor">
1946           <jobject/>
1947             <description>
1948               The owned monitor.
1949             </description>
1950         </field>
1951         <field id="stack_depth">
1952           <jint/>
1953           <description>
1954             The stack depth.  Corresponds to the stack depth used in the
1955             <internallink id="stack">Stack Frame functions</internallink>.
1956             That is, zero is the current frame, one is the frame which
1957             called the current frame. And it is negative one if the
1958             implementation cannot determine the stack depth (e.g., for
1959             monitors acquired by JNI <code>MonitorEnter</code>).
1960           </description>
1961         </field>
1962       </typedef>
1963       <description>
1964         Get information about the monitors owned by the
1965         specified thread and the depth of the stack frame which locked them.
1966       </description>
1967       <origin>new</origin>
1968       <capabilities>
1969         <required id="can_get_owned_monitor_stack_depth_info"></required>
1970       </capabilities>
1971       <parameters>
1972         <param id="thread">
1973           <jthread null="current"/>
1974             <description>
1975               The thread to query.
1976             </description>
1977         </param>
1978         <param id="monitor_info_count_ptr">
1979           <outptr><jint/></outptr>
1980           <description>
1981             The number of monitors returned.
1982           </description>
1983         </param>
1984         <param id="monitor_info_ptr">
1985           <allocbuf outcount="monitor_info_count_ptr">
1986             <struct>jvmtiMonitorStackDepthInfo</struct>
1987           </allocbuf>
1988           <description>
1989             The array of owned monitor depth information.
1990           </description>
1991         </param>
1992       </parameters>
1993       <errors>
1994       </errors>
1995     </function>
1996 
1997     <function id="GetCurrentContendedMonitor" num="11">
1998       <synopsis>Get Current Contended Monitor</synopsis>
1999       <description>
2000         Get the object, if any, whose monitor the specified thread is waiting to
2001         enter or waiting to regain through <code>java.lang.Object.wait</code>.
2002       </description>
2003       <origin>jvmdi</origin>
2004       <capabilities>
2005         <required id="can_get_current_contended_monitor"></required>
2006       </capabilities>
2007       <parameters>
2008         <param id="thread">
2009           <jthread null="current"/>
2010             <description>
2011               The thread to query.
2012             </description>
2013         </param>
2014         <param id="monitor_ptr">
2015           <outptr><jobject/></outptr>
2016             <description>
2017               On return, filled with the current contended monitor, or
2018               NULL if there is none.
2019             </description>
2020         </param>
2021       </parameters>
2022       <errors>
2023       </errors>
2024     </function>
2025 
2026     <callback id="jvmtiStartFunction">
2027       <void/>
2028       <synopsis>Agent Start Function</synopsis>
2029       <description>
2030         Agent supplied callback function.
2031         This function is the entry point for an agent thread
2032         started with
2033         <functionlink id="RunAgentThread"></functionlink>.
2034       </description>
2035       <parameters>
2036           <param id="jvmti_env">
2037             <outptr>
2038               <struct>jvmtiEnv</struct>
2039             </outptr>
2040             <description>
2041               The <jvmti/> environment.
2042             </description>
2043           </param>
2044           <param id="jni_env">
2045             <outptr>
2046               <struct>JNIEnv</struct>
2047             </outptr>
2048             <description>
2049               The JNI environment.
2050             </description>
2051           </param>
2052           <param id="arg">
2053             <outptr>
2054               <void/>
2055             </outptr>
2056               <description>
2057                 The <code>arg</code> parameter passed to
2058                 <functionlink id="RunAgentThread"></functionlink>.
2059               </description>
2060           </param>
2061       </parameters>
2062     </callback>
2063 
2064     <function id="RunAgentThread" num="12">
2065       <synopsis>Run Agent Thread</synopsis>
2066       <description>
2067         Starts the execution of an agent thread. with the specified native function.
2068         The parameter <paramlink id="arg"></paramlink> is forwarded on to the
2069         <functionlink id="jvmtiStartFunction">start function</functionlink>
2070         (specified with <paramlink id="proc"></paramlink>) as its single argument.
2071         This function allows the creation of agent threads
2072         for handling communication with another process or for handling events
2073         without the need to load a special subclass of <code>java.lang.Thread</code> or
2074         implementer of <code>java.lang.Runnable</code>.
2075         Instead, the created thread can run entirely in native code.
2076         However, the created thread does require a newly created instance
2077         of <code>java.lang.Thread</code> (referenced by the argument <code>thread</code>) to
2078         which it will be associated.
2079         The thread object can be created with JNI calls.
2080         <p/>
2081         The following common thread priorities are provided for your convenience:
2082         <constants id="jvmtiThreadPriority" label="Thread Priority Constants" kind="const">
2083           <constant id="JVMTI_THREAD_MIN_PRIORITY" num="1">
2084             Minimum possible thread priority
2085           </constant>
2086           <constant id="JVMTI_THREAD_NORM_PRIORITY" num="5">
2087             Normal thread priority
2088           </constant>
2089           <constant id="JVMTI_THREAD_MAX_PRIORITY" num="10">
2090             Maximum possible thread priority
2091           </constant>
2092         </constants>
2093         <p/>
2094         The new thread is started as a daemon thread with the specified
2095         <paramlink id="priority"></paramlink>.
2096         If enabled, a <eventlink id="ThreadStart"/> event will be sent.
2097         <p/>
2098         Since the thread has been started, the thread will be live when this function
2099         returns, unless the thread has died immediately.
2100         <p/>
2101         The thread group of the thread is ignored -- specifically, the thread is not
2102         added to the thread group and the thread is not seen on queries of the thread
2103         group at either the Java programming language or <jvmti/> levels.
2104         <p/>
2105         The thread is not visible to Java programming language queries but is
2106         included in <jvmti/> queries (for example,
2107         <functionlink id="GetAllThreads"/> and
2108         <functionlink id="GetAllStackTraces"/>).
2109         <p/>
2110         Upon execution of <code>proc</code>, the new thread will be attached to the
2111         VM -- see the JNI documentation on
2112         <externallink id="jni/invocation.html#attaching-to-the-vm"
2113                       >Attaching to the VM</externallink>.
2114       </description>
2115       <origin>jvmdiClone</origin>
2116       <capabilities>
2117       </capabilities>
2118       <parameters>
2119         <param id="thread">
2120           <jthread impl="noconvert" started="no"/>
2121             <description>
2122               The thread to run.
2123             </description>
2124         </param>
2125         <param id="proc">
2126           <ptrtype>
2127             <struct>jvmtiStartFunction</struct>
2128           </ptrtype>
2129           <description>
2130             The start function.
2131           </description>
2132         </param>
2133         <param id="arg">
2134           <inbuf>
2135             <void/>
2136             <nullok><code>NULL</code> is passed to the start function</nullok>
2137           </inbuf>
2138           <description>
2139             The argument to the start function.
2140           </description>
2141         </param>
2142         <param id="priority">
2143           <jint/>
2144           <description>
2145             The priority of the started thread. Any thread
2146             priority allowed by <code>java.lang.Thread.setPriority</code> can be used including
2147             those in <datalink id="jvmtiThreadPriority"></datalink>.
2148           </description>
2149         </param>
2150       </parameters>
2151       <errors>
2152         <error id="JVMTI_ERROR_INVALID_PRIORITY">
2153             <paramlink id="priority"/> is less than
2154             <datalink id="JVMTI_THREAD_MIN_PRIORITY"/>
2155               or greater than
2156             <datalink id="JVMTI_THREAD_MAX_PRIORITY"/>
2157         </error>
2158       </errors>
2159     </function>
2160 
2161     <function id="SetThreadLocalStorage" jkernel="yes" impl="notrace" phase="start" num="103">
2162       <synopsis>Set Thread Local Storage</synopsis>
2163       <description>
2164         The VM stores a pointer value associated with each environment-thread
2165         pair. This pointer value is called <i>thread-local storage</i>.
2166         This value is <code>NULL</code> unless set with this function.
2167         Agents can allocate memory in which they store thread specific
2168         information. By setting thread-local storage it can then be
2169         accessed with
2170         <functionlink id="GetThreadLocalStorage"></functionlink>.
2171         <p/>
2172         This function is called by the agent to set the value of the <jvmti/>
2173         thread-local storage. <jvmti/> supplies to the agent a pointer-size
2174         thread-local storage that can be used to record per-thread
2175         information.
2176       </description>
2177       <origin>jvmpi</origin>
2178       <capabilities>
2179       </capabilities>
2180       <parameters>
2181         <param id="thread">
2182           <jthread null="current"/>
2183             <description>
2184               Store to this thread.
2185             </description>
2186         </param>
2187         <param id="data">
2188           <inbuf>
2189             <void/>
2190             <nullok>value is set to <code>NULL</code></nullok>
2191           </inbuf>
2192           <description>
2193             The value to be entered into the thread-local storage.
2194           </description>
2195         </param>
2196       </parameters>
2197       <errors>
2198       </errors>
2199     </function>
2200 
2201     <function id="GetThreadLocalStorage" jkernel="yes" impl="innative notrace" phase="start" num="102">
2202       <synopsis>Get Thread Local Storage</synopsis>
2203       <description>
2204         Called by the agent to get the value of the <jvmti/> thread-local
2205         storage.
2206       </description>
2207       <origin>jvmpi</origin>
2208       <capabilities>
2209       </capabilities>
2210       <parameters>
2211         <param id="thread">
2212           <jthread null="current" impl="noconvert"/>
2213             <description>
2214               Retrieve from this thread.
2215             </description>
2216         </param>
2217         <param id="data_ptr">
2218           <agentbuf><void/></agentbuf>
2219           <description>
2220             Pointer through which the value of the thread local
2221             storage is returned.
2222             If thread-local storage has not been set with
2223             <functionlink id="SetThreadLocalStorage"></functionlink> the returned
2224             pointer is <code>NULL</code>.
2225           </description>
2226         </param>
2227       </parameters>
2228       <errors>
2229       </errors>
2230     </function>
2231 
2232   </category>
2233 
2234   <category id="thread_groups" label="Thread Group">
2235     <intro>
2236     </intro>
2237 
2238     <function id="GetTopThreadGroups" num="13">
2239       <synopsis>Get Top Thread Groups</synopsis>
2240       <description>
2241         Return all top-level (parentless) thread groups in the VM.
2242       </description>
2243       <origin>jvmdi</origin>
2244       <capabilities>
2245       </capabilities>
2246       <parameters>
2247         <param id="group_count_ptr">
2248           <outptr><jint/></outptr>
2249           <description>
2250             On return, points to the number of top-level thread groups.
2251           </description>
2252         </param>
2253         <param id="groups_ptr">
2254           <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2255             <description>
2256               On return, refers to a pointer to the top-level thread group array.
2257             </description>
2258         </param>
2259       </parameters>
2260       <errors>
2261       </errors>
2262     </function>
2263 
2264     <function id="GetThreadGroupInfo" num="14">
2265       <synopsis>Get Thread Group Info</synopsis>
2266       <typedef id="jvmtiThreadGroupInfo" label="Thread group information structure">
2267         <field id="parent">
2268           <jthreadGroup/>
2269           <description>
2270             The parent thread group.
2271           </description>
2272         </field>
2273         <field id="name">
2274           <allocfieldbuf><char/></allocfieldbuf>
2275           <description>
2276             The thread group's name, encoded as a
2277             <internallink id="mUTF">modified UTF-8</internallink> string.
2278           </description>
2279         </field>
2280         <field id="max_priority">
2281           <jint/>
2282           <description>
2283             The maximum priority for this thread group.
2284           </description>
2285         </field>
2286         <field id="is_daemon">
2287           <jboolean/>
2288           <description>
2289             Is this a daemon thread group?
2290           </description>
2291         </field>
2292       </typedef>
2293       <description>
2294         Get information about the thread group. The fields of the
2295         <functionlink id="jvmtiThreadGroupInfo"></functionlink> structure
2296         are filled in with details of the specified thread group.
2297       </description>
2298       <origin>jvmdi</origin>
2299       <capabilities>
2300       </capabilities>
2301       <parameters>
2302         <param id="group">
2303           <jthreadGroup/>
2304           <description>
2305             The thread group to query.
2306           </description>
2307         </param>
2308         <param id="info_ptr">
2309           <outptr><struct>jvmtiThreadGroupInfo</struct></outptr>
2310           <description>
2311             On return, filled with information describing the specified
2312             thread group.
2313           </description>
2314         </param>
2315       </parameters>
2316       <errors>
2317       </errors>
2318     </function>
2319 
2320     <function id="GetThreadGroupChildren" num="15">
2321       <synopsis>Get Thread Group Children</synopsis>
2322       <description>
2323         Get the live threads and active subgroups in this thread group.
2324       </description>
2325       <origin>jvmdi</origin>
2326       <capabilities>
2327       </capabilities>
2328       <parameters>
2329         <param id="group">
2330           <jthreadGroup/>
2331           <description>
2332             The group to query.
2333           </description>
2334         </param>
2335         <param id="thread_count_ptr">
2336           <outptr><jint/></outptr>
2337           <description>
2338             On return, points to the number of live threads in this thread group.
2339           </description>
2340         </param>
2341         <param id="threads_ptr">
2342           <allocbuf outcount="thread_count_ptr"><jthread/></allocbuf>
2343             <description>
2344               On return, points to an array of the live threads in this thread group.
2345             </description>
2346         </param>
2347         <param id="group_count_ptr">
2348           <outptr><jint/></outptr>
2349           <description>
2350             On return, points to the number of active child thread groups
2351           </description>
2352         </param>
2353         <param id="groups_ptr">
2354           <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2355             <description>
2356               On return, points to an array of the active child thread groups.
2357             </description>
2358         </param>
2359       </parameters>
2360       <errors>
2361       </errors>
2362     </function>
2363   </category>
2364 
2365   <category id="stack" label="Stack Frame">
2366     <intro>
2367         These functions provide information about the stack of a thread.
2368         Stack frames are referenced by depth.
2369         The frame at depth zero is the current frame.
2370         <p/>
2371         Stack frames are as described in
2372         <vmspec chapter="3.6"/>,
2373         That is, they correspond to method
2374         invocations (including native methods) but do not correspond to platform native or
2375         VM internal frames.
2376         <p/>
2377         A <jvmti/> implementation may use method invocations to launch a thread and
2378         the corresponding frames may be included in the stack as presented by these functions --
2379         that is, there may be frames shown
2380         deeper than <code>main()</code> and <code>run()</code>.
2381         However this presentation must be consistent across all <jvmti/> functionality which
2382         uses stack frames or stack depth.
2383     </intro>
2384 
2385       <typedef id="jvmtiFrameInfo" label="Stack frame information structure">
2386         <description>
2387           Information about a stack frame is returned in this structure.
2388         </description>
2389         <field id="method">
2390           <jmethodID/>
2391             <description>
2392               The method executing in this frame.
2393             </description>
2394         </field>
2395         <field id="location">
2396           <jlocation/>
2397           <description>
2398             The index of the instruction executing in this frame.
2399             <code>-1</code> if the frame is executing a native method.
2400           </description>
2401         </field>
2402       </typedef>
2403 
2404       <typedef id="jvmtiStackInfo" label="Stack information structure">
2405         <description>
2406           Information about a set of stack frames is returned in this structure.
2407         </description>
2408         <field id="thread">
2409           <jthread/>
2410           <description>
2411             On return, the thread traced.
2412           </description>
2413         </field>
2414         <field id="state">
2415           <jint/>
2416           <description>
2417             On return, the thread state. See <functionlink id="GetThreadState"></functionlink>.
2418           </description>
2419         </field>
2420         <field id="frame_buffer">
2421           <outbuf incount="max_frame_count">
2422             <struct>jvmtiFrameInfo</struct>
2423           </outbuf>
2424             <description>
2425               On return, this agent allocated buffer is filled
2426               with stack frame information.
2427             </description>
2428         </field>
2429         <field id="frame_count">
2430           <jint/>
2431           <description>
2432             On return, the number of records filled into
2433             <code>frame_buffer</code>.
2434             This will be
2435             min(<code>max_frame_count</code>, <i>stackDepth</i>).
2436           </description>
2437         </field>
2438       </typedef>
2439 
2440     <function id="GetStackTrace" num="104">
2441       <synopsis>Get Stack Trace</synopsis>
2442       <description>
2443         Get information about the stack of a thread.
2444         If <paramlink id="max_frame_count"></paramlink> is less than the depth of the stack,
2445         the <paramlink id="max_frame_count"></paramlink> topmost frames are returned,
2446         otherwise the entire stack is returned.
2447         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2448         <p/>
2449         The following example causes up to five of the topmost frames
2450         to be returned and (if there are any frames) the currently
2451         executing method name to be printed.
2452         <example>
2453 jvmtiFrameInfo frames[5];
2454 jint count;
2455 jvmtiError err;
2456 
2457 err = (*jvmti)-&gt;GetStackTrace(jvmti, aThread, 0, 5,
2458                                frames, &amp;count);
2459 if (err == JVMTI_ERROR_NONE &amp;&amp; count &gt;= 1) {
2460    char *methodName;
2461    err = (*jvmti)-&gt;GetMethodName(jvmti, frames[0].method,
2462                        &amp;methodName, NULL, NULL);
2463    if (err == JVMTI_ERROR_NONE) {
2464       printf("Executing method: %s", methodName);
2465    }
2466 }
2467         </example>
2468         <todo>
2469           check example code.
2470         </todo>
2471         <p/>
2472         The <paramlink id="thread"></paramlink> need not be suspended
2473         to call this function.
2474         <p/>
2475         The <functionlink id="GetLineNumberTable"></functionlink>
2476         function can be used to map locations to line numbers. Note that
2477         this mapping can be done lazily.
2478       </description>
2479       <origin>jvmpi</origin>
2480       <capabilities>
2481       </capabilities>
2482       <parameters>
2483         <param id="thread">
2484           <jthread null="current"/>
2485             <description>
2486               Fetch the stack trace of this thread.
2487             </description>
2488         </param>
2489         <param id="start_depth">
2490           <jint/>
2491           <description>
2492             Begin retrieving frames at this depth.
2493             If non-negative, count from the current frame,
2494             the first frame retrieved is at depth <code>start_depth</code>.
2495             For example, if zero, start from the current frame; if one, start from the
2496             caller of the current frame; if two, start from the caller of the
2497             caller of the current frame; and so on.
2498             If negative, count from below the oldest frame,
2499             the first frame retrieved is at depth <i>stackDepth</i><code> + start_depth</code>,
2500             where <i>stackDepth</i> is the count of frames on the stack.
2501             For example, if negative one, only the oldest frame is retrieved;
2502             if negative two, start from the frame called by the oldest frame.
2503           </description>
2504         </param>
2505         <param id="max_frame_count">
2506           <jint min="0"/>
2507           <description>
2508             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2509           </description>
2510         </param>
2511         <param id="frame_buffer">
2512           <outbuf incount="max_frame_count" outcount="count_ptr">
2513             <struct>jvmtiFrameInfo</struct>
2514           </outbuf>
2515             <description>
2516               On return, this agent allocated buffer is filled
2517               with stack frame information.
2518             </description>
2519         </param>
2520         <param id="count_ptr">
2521           <outptr><jint/></outptr>
2522           <description>
2523             On return, points to the number of records filled in.
2524             For non-negative <code>start_depth</code>, this will be
2525             min(<code>max_frame_count</code>, <i>stackDepth</i><code> - start_depth</code>).
2526             For negative <code>start_depth</code>, this will be
2527             min(<code>max_frame_count</code>, <code>-start_depth</code>).
2528           </description>
2529         </param>
2530       </parameters>
2531       <errors>
2532         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
2533           <paramlink id="start_depth"/> is positive and greater than or equal to <i>stackDepth</i>.
2534           Or <paramlink id="start_depth"/> is negative and less than <i>-stackDepth</i>.
2535         </error>
2536       </errors>
2537     </function>
2538 
2539 
2540     <function id="GetAllStackTraces" num="100">
2541       <synopsis>Get All Stack Traces</synopsis>
2542       <description>
2543         Get information about the stacks of all live threads
2544         (including <internallink id="RunAgentThread">agent threads</internallink>).
2545         If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2546         the <paramlink id="max_frame_count"/> topmost frames are returned for that thread,
2547         otherwise the entire stack is returned.
2548         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2549         <p/>
2550         All stacks are collected simultaneously, that is, no changes will occur to the
2551         thread state or stacks between the sampling of one thread and the next.
2552         The threads need not be suspended.
2553 
2554         <example>
2555 jvmtiStackInfo *stack_info;
2556 jint thread_count;
2557 int ti;
2558 jvmtiError err;
2559 
2560 err = (*jvmti)-&gt;GetAllStackTraces(jvmti, MAX_FRAMES, &amp;stack_info, &amp;thread_count);
2561 if (err != JVMTI_ERROR_NONE) {
2562    ...
2563 }
2564 for (ti = 0; ti &lt; thread_count; ++ti) {
2565    jvmtiStackInfo *infop = &amp;stack_info[ti];
2566    jthread thread = infop-&gt;thread;
2567    jint state = infop-&gt;state;
2568    jvmtiFrameInfo *frames = infop-&gt;frame_buffer;
2569    int fi;
2570 
2571    myThreadAndStatePrinter(thread, state);
2572    for (fi = 0; fi &lt; infop-&gt;frame_count; fi++) {
2573       myFramePrinter(frames[fi].method, frames[fi].location);
2574    }
2575 }
2576 /* this one Deallocate call frees all data allocated by GetAllStackTraces */
2577 err = (*jvmti)-&gt;Deallocate(jvmti, stack_info);
2578         </example>
2579         <todo>
2580           check example code.
2581         </todo>
2582 
2583       </description>
2584       <origin>new</origin>
2585       <capabilities>
2586       </capabilities>
2587       <parameters>
2588         <param id="max_frame_count">
2589           <jint min="0"/>
2590           <description>
2591             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2592           </description>
2593         </param>
2594         <param id="stack_info_ptr">
2595           <allocbuf>
2596             <struct>jvmtiStackInfo</struct>
2597           </allocbuf>
2598             <description>
2599               On return, this buffer is filled
2600               with stack information for each thread.
2601               The number of <datalink id="jvmtiStackInfo"/> records is determined
2602               by <paramlink id="thread_count_ptr"/>.
2603               <p/>
2604               Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/>
2605               buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2606               These buffers must not be separately deallocated.
2607             </description>
2608         </param>
2609         <param id="thread_count_ptr">
2610           <outptr><jint/></outptr>
2611           <description>
2612             The number of threads traced.
2613           </description>
2614         </param>
2615       </parameters>
2616       <errors>
2617       </errors>
2618     </function>
2619 
2620     <function id="GetThreadListStackTraces" num="101">
2621       <synopsis>Get Thread List Stack Traces</synopsis>
2622       <description>
2623         Get information about the stacks of the supplied threads.
2624         If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2625         the <paramlink id="max_frame_count"/> topmost frames are returned for that thread,
2626         otherwise the entire stack is returned.
2627         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2628         <p/>
2629         All stacks are collected simultaneously, that is, no changes will occur to the
2630         thread state or stacks between the sampling one thread and the next.
2631         The threads need not be suspended.
2632         <p/>
2633         If a thread has not yet started or terminates before the stack information is collected,
2634         a zero length stack (<datalink id="jvmtiStackInfo.frame_count"/> will be zero)
2635         will be returned and the thread <datalink id="jvmtiStackInfo.state"/> can be checked.
2636         <p/>
2637         See the example for the similar function
2638         <functionlink id="GetAllStackTraces"/>.
2639       </description>
2640       <origin>new</origin>
2641       <capabilities>
2642       </capabilities>
2643       <parameters>
2644         <param id="thread_count">
2645           <jint min="0"/>
2646           <description>
2647             The number of threads to trace.
2648           </description>
2649         </param>
2650         <param id="thread_list">
2651           <inbuf incount="thread_count"><jthread/></inbuf>
2652             <description>
2653               The list of threads to trace.
2654             </description>
2655         </param>
2656         <param id="max_frame_count">
2657           <jint min="0"/>
2658           <description>
2659             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2660           </description>
2661         </param>
2662         <param id="stack_info_ptr">
2663           <allocbuf outcount="thread_count">
2664             <struct>jvmtiStackInfo</struct>
2665           </allocbuf>
2666             <description>
2667               On return, this buffer is filled
2668               with stack information for each thread.
2669               The number of <datalink id="jvmtiStackInfo"/> records is determined
2670               by <paramlink id="thread_count"/>.
2671               <p/>
2672               Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/>
2673               buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2674               These buffers must not be separately deallocated.
2675             </description>
2676         </param>
2677       </parameters>
2678       <errors>
2679         <error id="JVMTI_ERROR_INVALID_THREAD">
2680           An element in <paramlink id="thread_list"/> is not a thread object.
2681         </error>
2682       </errors>
2683     </function>
2684 
2685     <elide>
2686     <function id="AsyncGetStackTrace" num="1000">
2687       <synopsis>Get Stack Trace--Asynchronous</synopsis>
2688       <description>
2689         Get information about the entire stack of a thread (or a sub-section of it).
2690         This is the asynchronous version of <functionlink id="GetStackTrace"></functionlink>
2691         and is reentrant and safe to call
2692         from asynchronous signal handlers.
2693         The stack trace is returned only for the calling thread.
2694         <p/>
2695         The <functionlink id="GetLineNumberTable"></functionlink>
2696         function can be used to map locations to line numbers. Note that
2697         this mapping can be done lazily.
2698       </description>
2699       <origin>jvmpi</origin>
2700       <capabilities>
2701         <required id="can_get_async_stack_trace"></required>
2702         <capability id="can_show_JVM_spec_async_frames">
2703           If <code>false</code>,
2704           <paramlink id="use_java_stack"></paramlink>
2705           must be <code>false</code>.
2706         </capability>
2707       </capabilities>
2708       <parameters>
2709         <param id="use_java_stack">
2710           <jboolean/>
2711           <description>
2712             Return the stack showing <vmspec/>
2713             model of the stack;
2714             otherwise, show the internal representation of the stack with
2715             inlined and optimized methods missing.  If the virtual machine
2716             is using the <i>Java Virtual Machine Specification</i> stack model
2717             internally, this flag is ignored.
2718           </description>
2719         </param>
2720         <param id="max_count">
2721           <jint min="0"/>
2722           <description>
2723             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2724             Retrieve this many unless the stack depth is less than <code>max_count</code>.
2725           </description>
2726         </param>
2727         <param id="frame_buffer">
2728           <outbuf incount="max_count" outcount="count_ptr">
2729             <struct>jvmtiFrameInfo</struct>
2730             <nullok>this information is not returned</nullok>
2731           </outbuf>
2732             <description>
2733               The agent passes in a buffer
2734               large enough to hold <code>max_count</code> records of
2735               <datalink id="jvmtiFrameInfo"></datalink>.  This buffer must be
2736               pre-allocated by the agent.
2737             </description>
2738         </param>
2739         <param id="count_ptr">
2740           <outptr><jint/></outptr>
2741           <description>
2742             On return, points to the number of records filled in..
2743           </description>
2744         </param>
2745       </parameters>
2746       <errors>
2747         <error id="JVMTI_ERROR_UNATTACHED_THREAD">
2748           The thread being used to call this function is not attached
2749           to the virtual machine.  Calls must be made from attached threads.
2750         </error>
2751       </errors>
2752     </function>
2753     </elide>
2754 
2755     <function id="GetFrameCount" num="16">
2756       <synopsis>Get Frame Count</synopsis>
2757       <description>
2758         Get the number of frames currently in the specified thread's call stack.
2759         <p/>
2760         If this function is called for a thread actively executing bytecodes (for example,
2761         not the current thread and not suspended), the information returned is transient.
2762       </description>
2763       <origin>jvmdi</origin>
2764       <capabilities>
2765       </capabilities>
2766       <parameters>
2767         <param id="thread">
2768           <jthread null="current"/>
2769             <description>
2770               The thread to query.
2771             </description>
2772         </param>
2773         <param id="count_ptr">
2774           <outptr><jint/></outptr>
2775           <description>
2776             On return, points to the number of frames in the call stack.
2777           </description>
2778         </param>
2779       </parameters>
2780       <errors>
2781       </errors>
2782     </function>
2783 
2784     <function id="PopFrame" num="80">
2785       <synopsis>Pop Frame</synopsis>
2786       <description>
2787         Pop the current frame of <code>thread</code>'s stack.
2788         Popping a frame takes you to the previous frame.
2789         When the thread is resumed, the execution
2790         state of the thread is reset to the state
2791         immediately before the called method was invoked.
2792         That is (using <vmspec/> terminology):
2793           <ul>
2794             <li>the current frame is discarded as the previous frame becomes the current one</li>
2795             <li>the operand stack is restored--the argument values are added back
2796               and if the invoke was not <code>invokestatic</code>,
2797               <code>objectref</code> is added back as well</li>
2798             <li>the Java virtual machine PC is restored to the opcode
2799               of the invoke instruction</li>
2800           </ul>
2801         Note however, that any changes to the arguments, which
2802         occurred in the called method, remain;
2803         when execution continues, the first instruction to
2804         execute will be the invoke.
2805         <p/>
2806         Between calling <code>PopFrame</code> and resuming the
2807         thread the state of the stack is undefined.
2808         To pop frames beyond the first,
2809         these three steps must be repeated:
2810         <ul>
2811           <li>suspend the thread via an event (step, breakpoint, ...)</li>
2812           <li>call <code>PopFrame</code></li>
2813           <li>resume the thread</li>
2814         </ul>
2815         <p/>
2816         A lock acquired by calling the called method
2817         (if it is a <code>synchronized</code>  method)
2818         and locks acquired by entering <code>synchronized</code>
2819         blocks within the called method are released.
2820         Note: this does not apply to native locks or
2821         <code>java.util.concurrent.locks</code> locks.
2822         <p/>
2823         Finally blocks are not executed.
2824         <p/>
2825         Changes to global state are not addressed and thus remain changed.
2826         <p/>
2827         The specified thread must be suspended or must be the current thread.
2828         <p/>
2829         Both the called method and calling method must be non-native Java programming
2830         language methods.
2831         <p/>
2832         No <jvmti/> events are generated by this function.
2833       </description>
2834       <origin>jvmdi</origin>
2835       <capabilities>
2836         <required id="can_pop_frame"></required>
2837       </capabilities>
2838       <parameters>
2839         <param id="thread">
2840           <jthread/>
2841             <description>
2842               The thread whose current frame is to be popped.
2843             </description>
2844         </param>
2845       </parameters>
2846       <errors>
2847         <error id="JVMTI_ERROR_OPAQUE_FRAME">
2848           Called or calling method is a native method.
2849           The implementation is unable to pop this frame.
2850         </error>
2851         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
2852           Thread was not suspended and was not the current thread.
2853         </error>
2854         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
2855           There are less than two stack frames on the call stack.
2856         </error>
2857       </errors>
2858     </function>
2859 
2860     <function id="GetFrameLocation" num="19">
2861       <synopsis>Get Frame Location</synopsis>
2862       <description>
2863         <p/>
2864         For a Java programming language frame, return the location of the instruction
2865         currently executing.
2866       </description>
2867       <origin>jvmdiClone</origin>
2868       <capabilities>
2869       </capabilities>
2870       <parameters>
2871         <param id="thread">
2872           <jthread null="current" frame="frame"/>
2873           <description>
2874             The thread of the frame to query.
2875           </description>
2876         </param>
2877         <param id="depth">
2878           <jframeID thread="thread"/>
2879           <description>
2880             The depth of the frame to query.
2881           </description>
2882         </param>
2883         <param id="method_ptr">
2884           <outptr><jmethodID/></outptr>
2885             <description>
2886               On return, points to the method for the current location.
2887             </description>
2888         </param>
2889         <param id="location_ptr">
2890           <outptr><jlocation/></outptr>
2891           <description>
2892             On return, points to the index of the currently
2893             executing instruction.
2894             Is set to <code>-1</code> if the frame is executing
2895             a native method.
2896           </description>
2897         </param>
2898       </parameters>
2899       <errors>
2900       </errors>
2901     </function>
2902 
2903     <function id="NotifyFramePop" num="20">
2904       <synopsis>Notify Frame Pop</synopsis>
2905       <description>
2906         When the frame that is currently at <paramlink id="depth"></paramlink>
2907         is popped from the stack, generate a
2908         <eventlink id="FramePop"></eventlink> event.  See the
2909         <eventlink id="FramePop"></eventlink> event for details.
2910         Only frames corresponding to non-native Java programming language
2911         methods can receive notification.
2912         <p/>
2913         The specified thread must be suspended or must be the current thread.
2914       </description>
2915       <origin>jvmdi</origin>
2916       <capabilities>
2917         <required id="can_generate_frame_pop_events"></required>
2918       </capabilities>
2919       <parameters>
2920         <param id="thread">
2921           <jthread null="current" frame="depth"/>
2922           <description>
2923             The thread of the frame for which the frame pop event will be generated.
2924           </description>
2925         </param>
2926         <param id="depth">
2927           <jframeID thread="thread"/>
2928           <description>
2929             The depth of the frame for which the frame pop event will be generated.
2930           </description>
2931         </param>
2932       </parameters>
2933       <errors>
2934         <error id="JVMTI_ERROR_OPAQUE_FRAME">
2935           The frame at <code>depth</code> is executing a
2936           native method.
2937         </error>
2938         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
2939           Thread was not suspended and was not the current thread.
2940         </error>
2941       </errors>
2942     </function>
2943 
2944   </category>
2945 
2946   <category id="ForceEarlyReturn" label="Force Early Return">
2947     <intro>
2948       These functions allow an agent to force a method
2949       to return at any point during its execution.
2950       The method which will return early is referred to as the <i>called method</i>.
2951       The called method is the current method
2952       (as defined by
2953       <vmspec chapter="3.6"/>)
2954       for the specified thread at
2955       the time the function is called.
2956       <p/>
2957       The specified thread must be suspended or must be the current thread.
2958       The return occurs when execution of Java programming
2959       language code is resumed on this thread.
2960       Between calling one of these functions and resumption
2961       of thread execution, the state of the stack is undefined.
2962       <p/>
2963       No further instructions are executed in the called method.
2964       Specifically, finally blocks are not executed.
2965       Note: this can cause inconsistent states in the application.
2966       <p/>
2967       A lock acquired by calling the called method
2968       (if it is a <code>synchronized</code>  method)
2969       and locks acquired by entering <code>synchronized</code>
2970       blocks within the called method are released.
2971       Note: this does not apply to native locks or
2972       <code>java.util.concurrent.locks</code> locks.
2973       <p/>
2974       Events, such as <eventlink id="MethodExit"></eventlink>,
2975       are generated as they would be in a normal return.
2976       <p/>
2977       The called method must be a non-native Java programming
2978       language method.
2979       Forcing return on a thread with only one frame on the
2980       stack causes the thread to exit when resumed.
2981     </intro>
2982 
2983     <function id="ForceEarlyReturnObject" num="81" since="1.1">
2984       <synopsis>Force Early Return - Object</synopsis>
2985       <description>
2986         This function can be used to return from a method whose
2987         result type is <code>Object</code>
2988         or a subclass of <code>Object</code>.
2989       </description>
2990       <origin>new</origin>
2991       <capabilities>
2992         <required id="can_force_early_return"></required>
2993       </capabilities>
2994       <parameters>
2995         <param id="thread">
2996           <jthread null="current"/>
2997           <description>
2998             The thread whose current frame is to return early.
2999           </description>
3000         </param>
3001         <param id="value">
3002           <jobject/>
3003           <description>
3004             The return value for the called frame.
3005             An object or <code>NULL</code>.
3006           </description>
3007         </param>
3008       </parameters>
3009       <errors>
3010         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3011           Attempted to return early from a frame
3012           corresponding to a native method.
3013           Or the implementation is unable to provide
3014           this functionality on this frame.
3015         </error>
3016         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3017           The result type of the called method is not
3018           <code>Object</code> or a subclass of <code>Object</code>.
3019         </error>
3020         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3021           The supplied <paramlink id="value"/> is not compatible with the
3022           result type of the called method.
3023         </error>
3024         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3025           Thread was not suspended and was not the current thread.
3026         </error>
3027         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3028           There are no more frames on the call stack.
3029         </error>
3030       </errors>
3031     </function>
3032 
3033     <function id="ForceEarlyReturnInt" num="82" since="1.1">
3034       <synopsis>Force Early Return - Int</synopsis>
3035       <description>
3036         This function can be used to return from a method whose
3037         result type is <code>int</code>, <code>short</code>,
3038         <code>char</code>, <code>byte</code>, or
3039         <code>boolean</code>.
3040       </description>
3041       <origin>new</origin>
3042       <capabilities>
3043         <required id="can_force_early_return"></required>
3044       </capabilities>
3045       <parameters>
3046         <param id="thread">
3047           <jthread null="current"/>
3048           <description>
3049             The thread whose current frame is to return early.
3050           </description>
3051         </param>
3052         <param id="value">
3053           <jint/>
3054           <description>
3055             The return value for the called frame.
3056           </description>
3057         </param>
3058       </parameters>
3059       <errors>
3060         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3061           Attempted to return early from a frame
3062           corresponding to a native method.
3063           Or the implementation is unable to provide
3064           this functionality on this frame.
3065         </error>
3066         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3067           The result type of the called method is not
3068           <code>int</code>, <code>short</code>,
3069           <code>char</code>, <code>byte</code>, or
3070           <code>boolean</code>.
3071         </error>
3072         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3073           Thread was not suspended and was not the current thread.
3074         </error>
3075         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3076           There are no frames on the call stack.
3077         </error>
3078       </errors>
3079     </function>
3080 
3081     <function id="ForceEarlyReturnLong" num="83" since="1.1">
3082       <synopsis>Force Early Return - Long</synopsis>
3083       <description>
3084         This function can be used to return from a method whose
3085         result type is <code>long</code>.
3086       </description>
3087       <origin>new</origin>
3088       <capabilities>
3089         <required id="can_force_early_return"></required>
3090       </capabilities>
3091       <parameters>
3092         <param id="thread">
3093           <jthread null="current"/>
3094           <description>
3095             The thread whose current frame is to return early.
3096           </description>
3097         </param>
3098         <param id="value">
3099           <jlong/>
3100           <description>
3101             The return value for the called frame.
3102           </description>
3103         </param>
3104       </parameters>
3105       <errors>
3106         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3107           Attempted to return early from a frame
3108           corresponding to a native method.
3109           Or the implementation is unable to provide
3110           this functionality on this frame.
3111         </error>
3112         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3113           The result type of the called method is not <code>long</code>.
3114         </error>
3115         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3116           Thread was not suspended and was not the current thread.
3117         </error>
3118         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3119           There are no frames on the call stack.
3120         </error>
3121       </errors>
3122     </function>
3123 
3124     <function id="ForceEarlyReturnFloat" num="84" since="1.1">
3125       <synopsis>Force Early Return - Float</synopsis>
3126       <description>
3127         This function can be used to return from a method whose
3128         result type is <code>float</code>.
3129       </description>
3130       <origin>new</origin>
3131       <capabilities>
3132         <required id="can_force_early_return"></required>
3133       </capabilities>
3134       <parameters>
3135         <param id="thread">
3136           <jthread null="current"/>
3137           <description>
3138             The thread whose current frame is to return early.
3139           </description>
3140         </param>
3141         <param id="value">
3142           <jfloat/>
3143           <description>
3144             The return value for the called frame.
3145           </description>
3146         </param>
3147       </parameters>
3148       <errors>
3149         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3150           Attempted to return early from a frame
3151           corresponding to a native method.
3152           Or the implementation is unable to provide
3153           this functionality on this frame.
3154         </error>
3155         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3156           The result type of the called method is not <code>float</code>.
3157         </error>
3158         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3159           Thread was not suspended and was not the current thread.
3160         </error>
3161         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3162           There are no frames on the call stack.
3163         </error>
3164       </errors>
3165     </function>
3166 
3167     <function id="ForceEarlyReturnDouble" num="85" since="1.1">
3168       <synopsis>Force Early Return - Double</synopsis>
3169       <description>
3170         This function can be used to return from a method whose
3171         result type is <code>double</code>.
3172       </description>
3173       <origin>new</origin>
3174       <capabilities>
3175         <required id="can_force_early_return"></required>
3176       </capabilities>
3177       <parameters>
3178         <param id="thread">
3179           <jthread null="current"/>
3180           <description>
3181             The thread whose current frame is to return early.
3182           </description>
3183         </param>
3184         <param id="value">
3185           <jdouble/>
3186           <description>
3187             The return value for the called frame.
3188           </description>
3189         </param>
3190       </parameters>
3191       <errors>
3192         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3193           Attempted to return early from a frame corresponding to a native method.
3194           Or the implementation is unable to provide this functionality on this frame.
3195         </error>
3196         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3197           The result type of the called method is not <code>double</code>.
3198         </error>
3199         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3200           Thread was not suspended and was not the current thread.
3201         </error>
3202         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3203           There are no frames on the call stack.
3204         </error>
3205       </errors>
3206     </function>
3207 
3208     <function id="ForceEarlyReturnVoid" num="86" since="1.1">
3209       <synopsis>Force Early Return - Void</synopsis>
3210       <description>
3211         This function can be used to return from a method with no result type.
3212         That is, the called method must be declared <code>void</code>.
3213       </description>
3214       <origin>new</origin>
3215       <capabilities>
3216         <required id="can_force_early_return"></required>
3217       </capabilities>
3218       <parameters>
3219         <param id="thread">
3220           <jthread null="current"/>
3221           <description>
3222             The thread whose current frame is to return early.
3223           </description>
3224         </param>
3225       </parameters>
3226       <errors>
3227         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3228           Attempted to return early from a frame
3229           corresponding to a native method.
3230           Or the implementation is unable to provide
3231           this functionality on this frame.
3232         </error>
3233         <error id="JVMTI_ERROR_TYPE_MISMATCH">
3234           The called method has a result type.
3235         </error>
3236         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3237           Thread was not suspended and was not the current thread.
3238         </error>
3239         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3240           There are no frames on the call stack.
3241         </error>
3242       </errors>
3243     </function>
3244 
3245   </category>
3246 
3247   <category id="Heap" label="Heap">
3248     <intro>
3249       These functions are used to analyze the heap.
3250       Functionality includes the ability to view the objects in the
3251       heap and to tag these objects.
3252     </intro>
3253 
3254     <intro id="objectTags" label="Object Tags">
3255       A <i>tag</i> is a value associated with an object.
3256       Tags are explicitly set by the agent using the
3257       <functionlink id="SetTag"></functionlink> function or by
3258       callback functions such as <functionlink id="jvmtiHeapIterationCallback"/>.
3259       <p/>
3260       Tags are local to the environment; that is, the tags of one
3261       environment are not visible in another.
3262       <p/>
3263       Tags are <code>jlong</code> values which can be used
3264       simply to mark an object or to store a pointer to more detailed
3265       information.  Objects which have not been tagged have a
3266       tag of zero.
3267       Setting a tag to zero makes the object untagged.
3268     </intro>
3269 
3270     <intro id="heapCallbacks" label="Heap Callback Functions">
3271         Heap functions which iterate through the heap and recursively
3272         follow object references use agent supplied callback functions
3273         to deliver the information.
3274         <p/>
3275         These heap callback functions must adhere to the following restrictions --
3276         These callbacks must not use JNI functions.
3277         These callbacks must not use <jvmti/> functions except
3278         <i>callback safe</i> functions which
3279         specifically allow such use (see the raw monitor, memory management,
3280         and environment local storage functions).
3281         <p/>
3282         An implementation may invoke a callback on an internal thread or
3283         the thread which called the iteration function.
3284         Heap callbacks are single threaded -- no more than one callback will
3285         be invoked at a time.
3286         <p/>
3287         The Heap Filter Flags can be used to prevent reporting
3288         based on the tag status of an object or its class.
3289         If no flags are set (the <code>jint</code> is zero), objects
3290         will not be filtered out.
3291 
3292         <constants id="jvmtiHeapFilter" label="Heap Filter Flags" kind="bits">
3293           <constant id="JVMTI_HEAP_FILTER_TAGGED" num="0x4">
3294             Filter out tagged objects. Objects which are tagged are not included.
3295           </constant>
3296           <constant id="JVMTI_HEAP_FILTER_UNTAGGED" num="0x8">
3297             Filter out untagged objects. Objects which are not tagged are not included.
3298           </constant>
3299           <constant id="JVMTI_HEAP_FILTER_CLASS_TAGGED" num="0x10">
3300             Filter out objects with tagged classes. Objects whose class is tagged are not included.
3301           </constant>
3302           <constant id="JVMTI_HEAP_FILTER_CLASS_UNTAGGED" num="0x20">
3303             Filter out objects with untagged classes. Objects whose class is not tagged are not included.
3304           </constant>
3305         </constants>
3306 
3307         <p/>
3308         The Heap Visit Control Flags are returned by the heap callbacks
3309         and can be used to abort the iteration.  For the
3310         <functionlink id="jvmtiHeapReferenceCallback">Heap
3311         Reference Callback</functionlink>, it can also be used
3312         to prune the graph of traversed references
3313         (<code>JVMTI_VISIT_OBJECTS</code> is not set).
3314 
3315         <constants id="jvmtiHeapVisitControl"
3316                    label="Heap Visit Control Flags"
3317                    kind="bits"
3318                    since="1.1">
3319           <constant id="JVMTI_VISIT_OBJECTS" num="0x100">
3320             If we are visiting an object and if this callback
3321             was initiated by <functionlink id="FollowReferences"/>,
3322             traverse the references of this object.
3323             Otherwise ignored.
3324           </constant>
3325           <constant id="JVMTI_VISIT_ABORT" num="0x8000">
3326             Abort the iteration.  Ignore all other bits.
3327           </constant>
3328         </constants>
3329 
3330         <p/>
3331         The Heap Reference Enumeration is provided by the
3332         <functionlink id="jvmtiHeapReferenceCallback">Heap
3333         Reference Callback</functionlink> and
3334         <functionlink id="jvmtiPrimitiveFieldCallback">Primitive Field
3335         Callback</functionlink> to
3336         describe the kind of reference
3337         being reported.
3338 
3339         <constants id="jvmtiHeapReferenceKind"
3340                    label="Heap Reference Enumeration"
3341                    kind="enum"
3342                    since="1.1">
3343           <constant id="JVMTI_HEAP_REFERENCE_CLASS" num="1">
3344             Reference from an object to its class.
3345           </constant>
3346           <constant id="JVMTI_HEAP_REFERENCE_FIELD" num="2">
3347             Reference from an object to the value of one of its instance fields.
3348           </constant>
3349           <constant id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT" num="3">
3350             Reference from an array to one of its elements.
3351           </constant>
3352           <constant id="JVMTI_HEAP_REFERENCE_CLASS_LOADER" num="4">
3353             Reference from a class to its class loader.
3354           </constant>
3355           <constant id="JVMTI_HEAP_REFERENCE_SIGNERS" num="5">
3356             Reference from a class to its signers array.
3357           </constant>
3358           <constant id="JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN" num="6">
3359             Reference from a class to its protection domain.
3360           </constant>
3361           <constant id="JVMTI_HEAP_REFERENCE_INTERFACE" num="7">
3362             Reference from a class to one of its interfaces.
3363             Note: interfaces are defined via a constant pool reference,
3364             so the referenced interfaces may also be reported with a
3365             <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3366           </constant>
3367           <constant id="JVMTI_HEAP_REFERENCE_STATIC_FIELD" num="8">
3368             Reference from a class to the value of one of its static fields.
3369           </constant>
3370           <constant id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL" num="9">
3371             Reference from a class to a resolved entry in the constant pool.
3372           </constant>
3373           <constant id="JVMTI_HEAP_REFERENCE_SUPERCLASS" num="10">
3374             Reference from a class to its superclass.
3375             A callback is not sent if the superclass is <code>java.lang.Object</code>.
3376             Note: loaded classes define superclasses via a constant pool
3377             reference, so the referenced superclass may also be reported with
3378             a <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3379           </constant>
3380           <constant id="JVMTI_HEAP_REFERENCE_JNI_GLOBAL" num="21">
3381             Heap root reference: JNI global reference.
3382           </constant>
3383           <constant id="JVMTI_HEAP_REFERENCE_SYSTEM_CLASS" num="22">
3384             Heap root reference: System class.
3385           </constant>
3386           <constant id="JVMTI_HEAP_REFERENCE_MONITOR" num="23">
3387             Heap root reference: monitor.
3388           </constant>
3389           <constant id="JVMTI_HEAP_REFERENCE_STACK_LOCAL" num="24">
3390             Heap root reference: local variable on the stack.
3391           </constant>
3392           <constant id="JVMTI_HEAP_REFERENCE_JNI_LOCAL" num="25">
3393             Heap root reference: JNI local reference.
3394           </constant>
3395           <constant id="JVMTI_HEAP_REFERENCE_THREAD" num="26">
3396             Heap root reference: Thread.
3397           </constant>
3398           <constant id="JVMTI_HEAP_REFERENCE_OTHER" num="27">
3399             Heap root reference: other heap root reference.
3400           </constant>
3401         </constants>
3402 
3403         <p/>
3404         Definitions for the single character type descriptors of
3405         primitive types.
3406 
3407         <constants id="jvmtiPrimitiveType"
3408                    label="Primitive Type Enumeration"
3409                    kind="enum"
3410                    since="1.1">
3411           <constant id="JVMTI_PRIMITIVE_TYPE_BOOLEAN" num="90">
3412             'Z' - Java programming language <code>boolean</code> - JNI <code>jboolean</code>
3413           </constant>
3414           <constant id="JVMTI_PRIMITIVE_TYPE_BYTE" num="66">
3415             'B' - Java programming language <code>byte</code> - JNI <code>jbyte</code>
3416           </constant>
3417           <constant id="JVMTI_PRIMITIVE_TYPE_CHAR" num="67">
3418             'C' - Java programming language <code>char</code> - JNI <code>jchar</code>
3419           </constant>
3420           <constant id="JVMTI_PRIMITIVE_TYPE_SHORT" num="83">
3421             'S' - Java programming language <code>short</code> - JNI <code>jshort</code>
3422           </constant>
3423           <constant id="JVMTI_PRIMITIVE_TYPE_INT" num="73">
3424             'I' - Java programming language <code>int</code> - JNI <code>jint</code>
3425           </constant>
3426           <constant id="JVMTI_PRIMITIVE_TYPE_LONG" num="74">
3427             'J' - Java programming language <code>long</code> - JNI <code>jlong</code>
3428           </constant>
3429           <constant id="JVMTI_PRIMITIVE_TYPE_FLOAT" num="70">
3430             'F' - Java programming language <code>float</code> - JNI <code>jfloat</code>
3431           </constant>
3432           <constant id="JVMTI_PRIMITIVE_TYPE_DOUBLE" num="68">
3433             'D' - Java programming language <code>double</code> - JNI <code>jdouble</code>
3434           </constant>
3435         </constants>
3436     </intro>
3437 
3438       <typedef id="jvmtiHeapReferenceInfoField"
3439                label="Reference information structure for Field references"
3440                since="1.1">
3441         <description>
3442           Reference information returned for
3443           <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> and
3444           <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3445         </description>
3446         <field id="index">
3447           <jint/>
3448           <description>
3449             For <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>, the
3450             referrer object is not a class or an interface.
3451             In this case, <code>index</code> is the index of the field
3452             in the class of the referrer object.
3453             This class is referred to below as <i>C</i>.
3454             <p/>
3455             For <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
3456             the referrer object is a class (referred to below as <i>C</i>)
3457             or an interface (referred to below as <i>I</i>).
3458             In this case, <code>index</code> is the index of the field in
3459             that class or interface.
3460             <p/>
3461             If the referrer object is not an interface, then the field
3462             indices are determined as follows:
3463             <ul>
3464               <li>make a list of all the fields in <i>C</i> and its
3465                   superclasses, starting with all the fields in
3466                   <code>java.lang.Object</code> and ending with all the
3467                   fields in <i>C</i>.</li>
3468               <li>Within this list, put
3469                   the fields for a given class in the order returned by
3470                   <functionlink id="GetClassFields"/>.</li>
3471               <li>Assign the fields in this list indices
3472                   <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i>
3473                   is the count of the fields in all the interfaces
3474                   implemented by <i>C</i>.
3475                   Note that <i>C</i> implements all interfaces
3476                   directly implemented by its superclasses; as well
3477                   as all superinterfaces of these interfaces.</li>
3478             </ul>
3479             If the referrer object is an interface, then the field
3480             indices are determined as follows:
3481             <ul>
3482               <li>make a list of the fields directly declared in
3483                   <i>I</i>.</li>
3484               <li>Within this list, put
3485                   the fields in the order returned by
3486                   <functionlink id="GetClassFields"/>.</li>
3487               <li>Assign the fields in this list indices
3488                   <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i>
3489                   is the count of the fields in all the superinterfaces
3490                   of <i>I</i>.</li>
3491             </ul>
3492             All fields are included in this computation, regardless of
3493             field modifier (static, public, private, etc).
3494             <p/>
3495             For example, given the following classes and interfaces:
3496             <example>
3497 interface I0 {
3498     int p = 0;
3499 }
3500 
3501 interface I1 extends I0 {
3502     int x = 1;
3503 }
3504 
3505 interface I2 extends I0 {
3506     int y = 2;
3507 }
3508 
3509 class C1 implements I1 {
3510     public static int a = 3;
3511     private int b = 4;
3512 }
3513 
3514 class C2 extends C1 implements I2 {
3515     static int q = 5;
3516     final int r = 6;
3517 }
3518             </example>
3519             Assume that <functionlink id="GetClassFields"/> called on
3520             <code>C1</code> returns the fields of <code>C1</code> in the
3521             order: a, b; and that the fields of <code>C2</code> are
3522             returned in the order: q, r.
3523             An instance of class <code>C1</code> will have the
3524             following field indices:
3525             <blockquote><table>
3526               <tr>
3527                 <td class="centered">
3528                   a
3529                 </td>
3530                 <td class="centered">
3531                   2
3532                 </td>
3533                 <td>
3534                   The count of the fields in the interfaces
3535                   implemented by <code>C1</code> is two (<i>n</i>=2):
3536                   <code>p</code> of <code>I0</code>
3537                   and <code>x</code> of <code>I1</code>.
3538                 </td>
3539               </tr>
3540               <tr>
3541                 <td class="centered">
3542                   b
3543                 </td>
3544                 <td class="centered">
3545                   3
3546                 </td>
3547                 <td>
3548                   the subsequent index.
3549                 </td>
3550               </tr>
3551             </table></blockquote>
3552             The class <code>C1</code> will have the same field indices.
3553             <p/>
3554             An instance of class <code>C2</code> will have the
3555             following field indices:
3556             <blockquote><table>
3557               <tr>
3558                 <td class="centered">
3559                   a
3560                 </td>
3561                 <td class="centered">
3562                   3
3563                 </td>
3564                 <td>
3565                   The count of the fields in the interfaces
3566                   implemented by <code>C2</code> is three (<i>n</i>=3):
3567                   <code>p</code> of <code>I0</code>,
3568                   <code>x</code> of <code>I1</code> and <code>y</code> of <code>I2</code>
3569                   (an interface of <code>C2</code>).  Note that the field <code>p</code>
3570                   of <code>I0</code> is only included once.
3571                 </td>
3572               </tr>
3573               <tr>
3574                 <td class="centered">
3575                   b
3576                 </td>
3577                 <td class="centered">
3578                   4
3579                 </td>
3580                 <td>
3581                   the subsequent index to "a".
3582                 </td>
3583               </tr>
3584               <tr>
3585                 <td class="centered">
3586                   q
3587                 </td>
3588                 <td class="centered">
3589                   5
3590                 </td>
3591                 <td>
3592                   the subsequent index to "b".
3593                 </td>
3594               </tr>
3595               <tr>
3596                 <td class="centered">
3597                   r
3598                 </td>
3599                 <td class="centered">
3600                   6
3601                 </td>
3602                 <td>
3603                   the subsequent index to "q".
3604                 </td>
3605               </tr>
3606             </table></blockquote>
3607             The class <code>C2</code> will have the same field indices.
3608             Note that a field may have a different index depending on the
3609             object that is viewing it -- for example field "a" above.
3610             Note also: not all field indices may be visible from the
3611             callbacks, but all indices are shown for illustrative purposes.
3612             <p/>
3613             The interface <code>I1</code> will have the
3614             following field indices:
3615             <blockquote><table>
3616               <tr>
3617                 <td class="centered">
3618                   x
3619                 </td>
3620                 <td class="centered">
3621                   1
3622                 </td>
3623                 <td>
3624                   The count of the fields in the superinterfaces
3625                   of <code>I1</code> is one (<i>n</i>=1):
3626                   <code>p</code> of <code>I0</code>.
3627                 </td>
3628               </tr>
3629             </table></blockquote>
3630           </description>
3631         </field>
3632       </typedef>
3633 
3634       <typedef id="jvmtiHeapReferenceInfoArray"
3635                label="Reference information structure for Array references"
3636                since="1.1">
3637         <description>
3638           Reference information returned for
3639          <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3640         </description>
3641         <field id="index">
3642           <jint/>
3643           <description>
3644             The array index.
3645           </description>
3646         </field>
3647       </typedef>
3648 
3649       <typedef id="jvmtiHeapReferenceInfoConstantPool"
3650                label="Reference information structure for Constant Pool references"
3651                since="1.1">
3652         <description>
3653           Reference information returned for
3654           <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3655         </description>
3656         <field id="index">
3657           <jint/>
3658           <description>
3659             The index into the constant pool of the class. See the description in
3660       <vmspec chapter="4.4"/>.
3661           </description>
3662         </field>
3663       </typedef>
3664 
3665       <typedef id="jvmtiHeapReferenceInfoStackLocal"
3666                label="Reference information structure for Local Variable references"
3667                since="1.1">
3668         <description>
3669           Reference information returned for
3670           <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3671         </description>
3672         <field id="thread_tag">
3673           <jlong/>
3674           <description>
3675             The tag of the thread corresponding to this stack, zero if not tagged.
3676           </description>
3677         </field>
3678         <field id="thread_id">
3679           <jlong/>
3680           <description>
3681             The unique thread ID of the thread corresponding to this stack.
3682           </description>
3683         </field>
3684         <field id="depth">
3685           <jint/>
3686           <description>
3687             The depth of the frame.
3688           </description>
3689         </field>
3690         <field id="method">
3691           <jmethodID/>
3692           <description>
3693             The method executing in this frame.
3694           </description>
3695         </field>
3696         <field id="location">
3697           <jlocation/>
3698           <description>
3699             The currently executing location in this frame.
3700           </description>
3701         </field>
3702         <field id="slot">
3703           <jint/>
3704           <description>
3705             The slot number of the local variable.
3706           </description>
3707         </field>
3708       </typedef>
3709 
3710       <typedef id="jvmtiHeapReferenceInfoJniLocal"
3711                label="Reference information structure for JNI local references"
3712                since="1.1">
3713         <description>
3714           Reference information returned for
3715           <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3716         </description>
3717         <field id="thread_tag">
3718           <jlong/>
3719           <description>
3720             The tag of the thread corresponding to this stack, zero if not tagged.
3721           </description>
3722         </field>
3723         <field id="thread_id">
3724           <jlong/>
3725           <description>
3726             The unique thread ID of the thread corresponding to this stack.
3727           </description>
3728         </field>
3729         <field id="depth">
3730           <jint/>
3731           <description>
3732             The depth of the frame.
3733           </description>
3734         </field>
3735         <field id="method">
3736           <jmethodID/>
3737           <description>
3738             The method executing in this frame.
3739           </description>
3740         </field>
3741       </typedef>
3742 
3743       <typedef id="jvmtiHeapReferenceInfoReserved"
3744                label="Reference information structure for Other references"
3745                since="1.1">
3746         <description>
3747           Reference information returned for other references.
3748         </description>
3749         <field id="reserved1">
3750           <jlong/>
3751           <description>
3752             reserved for future use.
3753           </description>
3754         </field>
3755         <field id="reserved2">
3756           <jlong/>
3757           <description>
3758             reserved for future use.
3759           </description>
3760         </field>
3761         <field id="reserved3">
3762           <jlong/>
3763           <description>
3764             reserved for future use.
3765           </description>
3766         </field>
3767         <field id="reserved4">
3768           <jlong/>
3769           <description>
3770             reserved for future use.
3771           </description>
3772         </field>
3773         <field id="reserved5">
3774           <jlong/>
3775           <description>
3776             reserved for future use.
3777           </description>
3778         </field>
3779         <field id="reserved6">
3780           <jlong/>
3781           <description>
3782             reserved for future use.
3783           </description>
3784         </field>
3785         <field id="reserved7">
3786           <jlong/>
3787           <description>
3788             reserved for future use.
3789           </description>
3790         </field>
3791         <field id="reserved8">
3792           <jlong/>
3793           <description>
3794             reserved for future use.
3795           </description>
3796         </field>
3797       </typedef>
3798 
3799       <uniontypedef id="jvmtiHeapReferenceInfo"
3800                label="Reference information structure"
3801                since="1.1">
3802         <description>
3803           The information returned about referrers.
3804           Represented as a union of the various kinds of reference information.
3805         </description>
3806         <field id="field">
3807           <struct>jvmtiHeapReferenceInfoField</struct>
3808           <description>
3809             The referrer information for
3810             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>
3811             and <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3812           </description>
3813         </field>
3814         <field id="array">
3815           <struct>jvmtiHeapReferenceInfoArray</struct>
3816           <description>
3817             The referrer information for
3818             For <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3819           </description>
3820         </field>
3821         <field id="constant_pool">
3822           <struct>jvmtiHeapReferenceInfoConstantPool</struct>
3823           <description>
3824             The referrer information for
3825             For <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3826           </description>
3827         </field>
3828         <field id="stack_local">
3829           <struct>jvmtiHeapReferenceInfoStackLocal</struct>
3830           <description>
3831             The referrer information for
3832             For <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3833           </description>
3834         </field>
3835         <field id="jni_local">
3836           <struct>jvmtiHeapReferenceInfoJniLocal</struct>
3837           <description>
3838             The referrer information for
3839             For <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3840           </description>
3841         </field>
3842         <field id="other">
3843           <struct>jvmtiHeapReferenceInfoReserved</struct>
3844           <description>
3845             reserved for future use.
3846           </description>
3847         </field>
3848       </uniontypedef>
3849 
3850       <typedef id="jvmtiHeapCallbacks"
3851                label="Heap callback function structure"
3852                since="1.1">
3853         <field id="heap_iteration_callback">
3854           <ptrtype>
3855             <struct>jvmtiHeapIterationCallback</struct>
3856           </ptrtype>
3857           <description>
3858             The callback to be called to describe an
3859             object in the heap. Used by the
3860             <functionlink id="IterateThroughHeap"/> function, ignored by the
3861             <functionlink id="FollowReferences"/> function.
3862           </description>
3863         </field>
3864         <field id="heap_reference_callback">
3865           <ptrtype>
3866             <struct>jvmtiHeapReferenceCallback</struct>
3867           </ptrtype>
3868           <description>
3869             The callback to be called to describe an
3870             object reference.  Used by the
3871             <functionlink id="FollowReferences"/> function, ignored by the
3872             <functionlink id="IterateThroughHeap"/> function.
3873           </description>
3874         </field>
3875         <field id="primitive_field_callback">
3876           <ptrtype>
3877             <struct>jvmtiPrimitiveFieldCallback</struct>
3878           </ptrtype>
3879           <description>
3880             The callback to be called to describe a
3881             primitive field.
3882           </description>
3883         </field>
3884         <field id="array_primitive_value_callback">
3885           <ptrtype>
3886             <struct>jvmtiArrayPrimitiveValueCallback</struct>
3887           </ptrtype>
3888           <description>
3889             The callback to be called to describe an
3890             array of primitive values.
3891           </description>
3892         </field>
3893         <field id="string_primitive_value_callback">
3894           <ptrtype>
3895             <struct>jvmtiStringPrimitiveValueCallback</struct>
3896           </ptrtype>
3897           <description>
3898             The callback to be called to describe a String value.
3899           </description>
3900         </field>
3901         <field id="reserved5">
3902           <ptrtype>
3903             <struct>jvmtiReservedCallback</struct>
3904           </ptrtype>
3905           <description>
3906             Reserved for future use..
3907           </description>
3908         </field>
3909         <field id="reserved6">
3910           <ptrtype>
3911             <struct>jvmtiReservedCallback</struct>
3912           </ptrtype>
3913           <description>
3914             Reserved for future use..
3915           </description>
3916         </field>
3917         <field id="reserved7">
3918           <ptrtype>
3919             <struct>jvmtiReservedCallback</struct>
3920           </ptrtype>
3921           <description>
3922             Reserved for future use..
3923           </description>
3924         </field>
3925         <field id="reserved8">
3926           <ptrtype>
3927             <struct>jvmtiReservedCallback</struct>
3928           </ptrtype>
3929           <description>
3930             Reserved for future use..
3931           </description>
3932         </field>
3933         <field id="reserved9">
3934           <ptrtype>
3935             <struct>jvmtiReservedCallback</struct>
3936           </ptrtype>
3937           <description>
3938             Reserved for future use..
3939           </description>
3940         </field>
3941         <field id="reserved10">
3942           <ptrtype>
3943             <struct>jvmtiReservedCallback</struct>
3944           </ptrtype>
3945           <description>
3946             Reserved for future use..
3947           </description>
3948         </field>
3949         <field id="reserved11">
3950           <ptrtype>
3951             <struct>jvmtiReservedCallback</struct>
3952           </ptrtype>
3953           <description>
3954             Reserved for future use..
3955           </description>
3956         </field>
3957         <field id="reserved12">
3958           <ptrtype>
3959             <struct>jvmtiReservedCallback</struct>
3960           </ptrtype>
3961           <description>
3962             Reserved for future use..
3963           </description>
3964         </field>
3965         <field id="reserved13">
3966           <ptrtype>
3967             <struct>jvmtiReservedCallback</struct>
3968           </ptrtype>
3969           <description>
3970             Reserved for future use..
3971           </description>
3972         </field>
3973         <field id="reserved14">
3974           <ptrtype>
3975             <struct>jvmtiReservedCallback</struct>
3976           </ptrtype>
3977           <description>
3978             Reserved for future use..
3979           </description>
3980         </field>
3981         <field id="reserved15">
3982           <ptrtype>
3983             <struct>jvmtiReservedCallback</struct>
3984           </ptrtype>
3985           <description>
3986             Reserved for future use..
3987           </description>
3988         </field>
3989       </typedef>
3990 
3991 
3992     <intro>
3993       <rationale>
3994         The heap dumping functionality (below) uses a callback
3995         for each object.  While it would seem that a buffered approach
3996         would provide better throughput, tests do
3997         not show this to be the case--possibly due to locality of
3998         memory reference or array access overhead.
3999       </rationale>
4000 
4001       <issue>
4002         Still under investigation as to if java.lang.ref references
4003         are reported as a different type of reference.
4004       </issue>
4005 
4006       <issue>
4007         Should or can an indication of the cost or relative cost of
4008         these operations be included?
4009       </issue>
4010 
4011     </intro>
4012 
4013     <callback id="jvmtiHeapIterationCallback" since="1.1">
4014       <jint/>
4015       <synopsis>Heap Iteration Callback</synopsis>
4016       <description>
4017         Agent supplied callback function.
4018         Describes (but does not pass in) an object in the heap.
4019         <p/>
4020         This function should return a bit vector of the desired
4021         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4022         This will determine if the entire iteration should be aborted
4023         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4024         <p/>
4025         See the <internallink id="heapCallbacks">heap callback
4026         function restrictions</internallink>.
4027       </description>
4028       <parameters>
4029         <param id="class_tag">
4030           <jlong/>
4031           <description>
4032             The tag of the class of object (zero if the class is not tagged).
4033             If the object represents a runtime class,
4034             the <code>class_tag</code> is the tag
4035             associated with <code>java.lang.Class</code>
4036             (zero if <code>java.lang.Class</code> is not tagged).
4037           </description>
4038         </param>
4039         <param id="size">
4040           <jlong/>
4041           <description>
4042             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
4043           </description>
4044         </param>
4045         <param id="tag_ptr">
4046           <outptr><jlong/></outptr>
4047           <description>
4048             The object tag value, or zero if the object is not tagged.
4049             To set the tag value to be associated with the object
4050             the agent sets the <code>jlong</code> pointed to by the parameter.
4051           </description>
4052         </param>
4053         <param id="length">
4054           <jint/>
4055           <description>
4056             If this object is an array, the length of the array. Otherwise negative one (-1).
4057           </description>
4058         </param>
4059         <param id="user_data">
4060           <outptr><void/></outptr>
4061           <description>
4062             The user supplied data that was passed into the iteration function.
4063           </description>
4064         </param>
4065       </parameters>
4066     </callback>
4067 
4068     <callback id="jvmtiHeapReferenceCallback" since="1.1">
4069       <jint/>
4070       <synopsis>Heap Reference Callback</synopsis>
4071       <description>
4072         Agent supplied callback function.
4073         Describes a reference from an object or the VM (the referrer) to another object
4074         (the referree) or a heap root to a referree.
4075         <p/>
4076         This function should return a bit vector of the desired
4077         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4078         This will determine if the objects referenced by the referree
4079         should be visited or if the entire iteration should be aborted.
4080         <p/>
4081         See the <internallink id="heapCallbacks">heap callback
4082         function restrictions</internallink>.
4083       </description>
4084       <parameters>
4085         <param id="reference_kind">
4086           <enum>jvmtiHeapReferenceKind</enum>
4087           <description>
4088             The kind of reference.
4089           </description>
4090         </param>
4091         <param id="reference_info">
4092           <inptr>
4093             <struct>jvmtiHeapReferenceInfo</struct>
4094           </inptr>
4095           <description>
4096             Details about the reference.
4097             Set when the <datalink id="jvmtiHeapReferenceCallback.reference_kind">reference_kind</datalink> is
4098             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>,
4099             <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
4100             <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/>,
4101             <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/>,
4102             <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/>,
4103             or <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/>.
4104             Otherwise <code>NULL</code>.
4105           </description>
4106         </param>
4107         <param id="class_tag">
4108           <jlong/>
4109           <description>
4110             The tag of the class of referree object (zero if the class is not tagged).
4111             If the referree object represents a runtime class,
4112             the <code>class_tag</code> is the tag
4113             associated with <code>java.lang.Class</code>
4114             (zero if <code>java.lang.Class</code> is not tagged).
4115           </description>
4116         </param>
4117         <param id="referrer_class_tag">
4118           <jlong/>
4119           <description>
4120             The tag of the class of the referrer object (zero if the class is not tagged
4121             or the referree is a heap root). If the referrer object represents a runtime
4122             class, the <code>referrer_class_tag</code> is the tag associated with
4123             the <code>java.lang.Class</code>
4124             (zero if <code>java.lang.Class</code> is not tagged).
4125           </description>
4126         </param>
4127         <param id="size">
4128           <jlong/>
4129           <description>
4130             Size of the referree object (in bytes).
4131             See <functionlink id="GetObjectSize"/>.
4132           </description>
4133         </param>
4134         <param id="tag_ptr">
4135           <outptr><jlong/></outptr>
4136           <description>
4137             Points to the referree object tag value, or zero if the object is not
4138             tagged.
4139             To set the tag value to be associated with the object
4140             the agent sets the <code>jlong</code> pointed to by the parameter.
4141           </description>
4142         </param>
4143         <param id="referrer_tag_ptr">
4144           <outptr><jlong/></outptr>
4145           <description>
4146             Points to the tag of the referrer object, or
4147             points to the zero if the referrer
4148             object is not tagged.
4149             <code>NULL</code> if the referrer in not an object (that is,
4150             this callback is reporting a heap root).
4151             To set the tag value to be associated with the referrer object
4152             the agent sets the <code>jlong</code> pointed to by the parameter.
4153             If this callback is reporting a reference from an object to itself,
4154             <code>referrer_tag_ptr == tag_ptr</code>.
4155           </description>
4156         </param>
4157         <param id="length">
4158           <jint/>
4159           <description>
4160             If this object is an array, the length of the array. Otherwise negative one (-1).
4161           </description>
4162         </param>
4163         <param id="user_data">
4164           <outptr><void/></outptr>
4165           <description>
4166             The user supplied data that was passed into the iteration function.
4167           </description>
4168         </param>
4169       </parameters>
4170     </callback>
4171 
4172     <callback id="jvmtiPrimitiveFieldCallback" since="1.1">
4173       <jint/>
4174       <synopsis>Primitive Field Callback</synopsis>
4175       <description>
4176         Agent supplied callback function which
4177         describes a primitive field of an object (<i>the object</i>).
4178         A primitive field is a field whose type is a primitive type.
4179         This callback will describe a static field if the object is a class,
4180         and otherwise will describe an instance field.
4181         <p/>
4182         This function should return a bit vector of the desired
4183         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4184         This will determine if the entire iteration should be aborted
4185         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4186         <p/>
4187         See the <internallink id="heapCallbacks">heap callback
4188         function restrictions</internallink>.
4189       </description>
4190       <parameters>
4191         <param id="kind">
4192           <enum>jvmtiHeapReferenceKind</enum>
4193           <description>
4194             The kind of field -- instance or static (<datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> or
4195             <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>).
4196           </description>
4197         </param>
4198         <param id="info">
4199           <inptr>
4200             <struct>jvmtiHeapReferenceInfo</struct>
4201           </inptr>
4202           <description>
4203             Which field (the field index).
4204           </description>
4205         </param>
4206         <param id="object_class_tag">
4207           <jlong/>
4208           <description>
4209             The tag of the class of the object (zero if the class is not tagged).
4210             If the object represents a runtime class, the
4211             <code>object_class_tag</code> is the tag
4212             associated with <code>java.lang.Class</code>
4213             (zero if <code>java.lang.Class</code> is not tagged).
4214           </description>
4215         </param>
4216         <param id="object_tag_ptr">
4217           <outptr><jlong/></outptr>
4218           <description>
4219             Points to the tag of the object, or zero if the object is not
4220             tagged.
4221             To set the tag value to be associated with the object
4222             the agent sets the <code>jlong</code> pointed to by the parameter.
4223           </description>
4224         </param>
4225         <param id="value">
4226           <jvalue/>
4227           <description>
4228             The value of the field.
4229           </description>
4230         </param>
4231         <param id="value_type">
4232           <enum>jvmtiPrimitiveType</enum>
4233           <description>
4234             The type of the field.
4235           </description>
4236         </param>
4237         <param id="user_data">
4238           <outptr><void/></outptr>
4239           <description>
4240             The user supplied data that was passed into the iteration function.
4241           </description>
4242         </param>
4243       </parameters>
4244     </callback>
4245 
4246     <callback id="jvmtiArrayPrimitiveValueCallback" since="1.1">
4247       <jint/>
4248       <synopsis>Array Primitive Value Callback</synopsis>
4249       <description>
4250         Agent supplied callback function.
4251         Describes the values in an array of a primitive type.
4252         <p/>
4253         This function should return a bit vector of the desired
4254         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4255         This will determine if the entire iteration should be aborted
4256         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4257         <p/>
4258         See the <internallink id="heapCallbacks">heap callback
4259         function restrictions</internallink>.
4260       </description>
4261       <parameters>
4262         <param id="class_tag">
4263           <jlong/>
4264           <description>
4265             The tag of the class of the array object (zero if the class is not tagged).
4266           </description>
4267         </param>
4268         <param id="size">
4269           <jlong/>
4270           <description>
4271             Size of the array (in bytes).
4272             See <functionlink id="GetObjectSize"/>.
4273           </description>
4274         </param>
4275         <param id="tag_ptr">
4276           <outptr><jlong/></outptr>
4277           <description>
4278             Points to the tag of the array object, or zero if the object is not
4279             tagged.
4280             To set the tag value to be associated with the object
4281             the agent sets the <code>jlong</code> pointed to by the parameter.
4282           </description>
4283         </param>
4284         <param id="element_count">
4285           <jint/>
4286           <description>
4287             The length of the primitive array.
4288           </description>
4289         </param>
4290         <param id="element_type">
4291           <enum>jvmtiPrimitiveType</enum>
4292           <description>
4293             The type of the elements of the array.
4294           </description>
4295         </param>
4296         <param id="elements">
4297           <vmbuf><void/></vmbuf>
4298           <description>
4299             The elements of the array in a packed array of <code>element_count</code>
4300             items of <code>element_type</code> size each.
4301           </description>
4302         </param>
4303         <param id="user_data">
4304           <outptr><void/></outptr>
4305           <description>
4306             The user supplied data that was passed into the iteration function.
4307           </description>
4308         </param>
4309       </parameters>
4310     </callback>
4311 
4312     <callback id="jvmtiStringPrimitiveValueCallback" since="1.1">
4313       <jint/>
4314       <synopsis>String Primitive Value Callback</synopsis>
4315       <description>
4316         Agent supplied callback function.
4317         Describes the value of a java.lang.String.
4318         <p/>
4319         This function should return a bit vector of the desired
4320         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4321         This will determine if the entire iteration should be aborted
4322         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4323         <p/>
4324         See the <internallink id="heapCallbacks">heap callback
4325         function restrictions</internallink>.
4326       </description>
4327       <parameters>
4328         <param id="class_tag">
4329           <jlong/>
4330           <description>
4331             The tag of the class of the String class (zero if the class is not tagged).
4332             <issue>Is this needed?</issue>
4333           </description>
4334         </param>
4335         <param id="size">
4336           <jlong/>
4337           <description>
4338             Size of the string (in bytes).
4339             See <functionlink id="GetObjectSize"/>.
4340           </description>
4341         </param>
4342         <param id="tag_ptr">
4343           <outptr><jlong/></outptr>
4344           <description>
4345             Points to the tag of the String object, or zero if the object is not
4346             tagged.
4347             To set the tag value to be associated with the object
4348             the agent sets the <code>jlong</code> pointed to by the parameter.
4349           </description>
4350         </param>
4351         <param id="value">
4352           <vmbuf><jchar/></vmbuf>
4353           <description>
4354             The value of the String, encoded as a Unicode string.
4355           </description>
4356         </param>
4357         <param id="value_length">
4358           <jint/>
4359           <description>
4360             The length of the string.
4361             The length is equal to the number of 16-bit Unicode
4362             characters in the string.
4363           </description>
4364         </param>
4365         <param id="user_data">
4366           <outptr><void/></outptr>
4367           <description>
4368             The user supplied data that was passed into the iteration function.
4369           </description>
4370         </param>
4371       </parameters>
4372     </callback>
4373 
4374 
4375     <callback id="jvmtiReservedCallback" since="1.1">
4376       <jint/>
4377       <synopsis>reserved for future use Callback</synopsis>
4378       <description>
4379         Placeholder -- reserved for future use.
4380       </description>
4381       <parameters>
4382       </parameters>
4383     </callback>
4384 
4385     <function id="FollowReferences" num="115" since="1.1">
4386       <synopsis>Follow References</synopsis>
4387       <description>
4388         This function initiates a traversal over the objects that are
4389         directly and indirectly reachable from the specified object or,
4390         if <code>initial_object</code> is not specified, all objects
4391         reachable from the heap roots.
4392         The heap root are the set of system classes,
4393         JNI globals, references from thread stacks, and other objects used as roots
4394         for the purposes of garbage collection.
4395         <p/>
4396         This function operates by traversing the reference graph.
4397         Let <i>A</i>, <i>B</i>, ... represent objects.
4398         When a reference from <i>A</i> to <i>B</i> is traversed,
4399         when a reference from a heap root to <i>B</i> is traversed,
4400         or when <i>B</i> is specified as the <paramlink id="initial_object"/>,
4401         then <i>B</i> is said to be <i>visited</i>.
4402         A reference from <i>A</i> to <i>B</i> is not traversed until <i>A</i>
4403         is visited.
4404         References are reported in the same order that the references are traversed.
4405         Object references are reported by invoking the agent supplied
4406         callback function <functionlink id="jvmtiHeapReferenceCallback"/>.
4407         In a reference from <i>A</i> to <i>B</i>, <i>A</i> is known
4408         as the <i>referrer</i> and <i>B</i> as the <i>referree</i>.
4409         The callback is invoked exactly once for each reference from a referrer;
4410         this is true even if there are reference cycles or multiple paths to
4411         the referrer.
4412         There may be more than one reference between a referrer and a referree,
4413         each reference is reported.
4414         These references may be distinguished by examining the
4415         <datalink
4416          id="jvmtiHeapReferenceCallback.reference_kind"><code>reference_kind</code></datalink>
4417          and
4418         <datalink
4419          id="jvmtiHeapReferenceCallback.reference_info"><code>reference_info</code></datalink>
4420         parameters of the <functionlink id="jvmtiHeapReferenceCallback"/> callback.
4421         <p/>
4422         This function reports a Java programming language view of object references,
4423         not a virtual machine implementation view. The following object references
4424         are reported when they are non-null:
4425         <ul>
4426           <li>Instance objects report references to each non-primitive instance fields
4427               (including inherited fields).</li>
4428           <li>Instance objects report a reference to the object type (class).</li>
4429           <li>Classes report a reference to the superclass and directly
4430               implemented/extended interfaces.</li>
4431           <li>Classes report a reference to the class loader, protection domain,
4432               signers, and resolved entries in the constant pool.</li>
4433           <li>Classes report a reference to each directly declared non-primitive
4434               static field.</li>
4435           <li>Arrays report a reference to the array type (class) and each
4436               array element.</li>
4437           <li>Primitive arrays report a reference to the array type.</li>
4438         </ul>
4439         <p/>
4440         This function can also be used to examine primitive (non-object) values.
4441         The primitive value of an array or String
4442         is reported after the object has been visited;
4443         it is reported by invoking the agent supplied callback function
4444         <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4445         <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4446         A primitive field
4447         is reported after the object with that field is visited;
4448         it is reported by invoking the agent supplied callback function
4449         <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4450         <p/>
4451         Whether a callback is provided or is <code>NULL</code> only determines
4452         whether the callback will be invoked, it does not influence
4453         which objects are visited nor does it influence whether other callbacks
4454         will be invoked.
4455         However, the
4456         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>
4457         returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4458         do determine if the objects referenced by the
4459         current object as visited.
4460         The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4461         and <paramlink id="klass"/> provided as parameters to this function
4462         do not control which objects are visited but they do control which
4463         objects and primitive values are reported by the callbacks.
4464         For example, if the only callback that was set is
4465         <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4466         is set to the array of bytes class, then only arrays of byte will be
4467         reported.
4468         The table below summarizes this:
4469         <p/>
4470         <table>
4471           <tr>
4472             <th/>
4473             <th>
4474               Controls objects visited
4475             </th>
4476             <th>
4477               Controls objects reported
4478             </th>
4479             <th>
4480               Controls primitives reported
4481             </th>
4482           </tr>
4483           <tr>
4484             <th class="leftAligned">
4485               the
4486               <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4487               returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4488             </th>
4489             <td class="centered">
4490               <b>Yes</b>
4491             </td>
4492             <td class="centered">
4493               <b>Yes</b>, since visits are controlled
4494             </td>
4495             <td class="centered">
4496               <b>Yes</b>, since visits are controlled
4497             </td>
4498           </tr>
4499           <tr>
4500             <th class="leftAligned">
4501               <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4502               in <paramlink id="callbacks"/> set
4503             </th>
4504             <td class="centered">
4505               No
4506             </td>
4507             <td class="centered">
4508               <b>Yes</b>
4509             </td>
4510             <td class="centered">
4511               No
4512             </td>
4513           </tr>
4514           <tr>
4515             <th class="leftAligned">
4516               <paramlink id="heap_filter"/>
4517             </th>
4518             <td class="centered">
4519               No
4520             </td>
4521             <td class="centered">
4522               <b>Yes</b>
4523             </td>
4524             <td class="centered">
4525               <b>Yes</b>
4526             </td>
4527           </tr>
4528           <tr>
4529             <th class="leftAligned">
4530               <paramlink id="klass"/>
4531             </th>
4532             <td class="centered">
4533               No
4534             </td>
4535             <td class="centered">
4536               <b>Yes</b>
4537             </td>
4538             <td class="centered">
4539               <b>Yes</b>
4540             </td>
4541           </tr>
4542         </table>
4543         <p/>
4544         During the execution of this function the state of the heap
4545         does not change: no objects are allocated, no objects are
4546         garbage collected, and the state of objects (including
4547         held values) does not change.
4548         As a result, threads executing Java
4549         programming language code, threads attempting to resume the
4550         execution of Java programming language code, and threads
4551         attempting to execute JNI functions are typically stalled.
4552       </description>
4553       <origin>new</origin>
4554       <capabilities>
4555         <required id="can_tag_objects"></required>
4556       </capabilities>
4557       <parameters>
4558         <param id="heap_filter">
4559           <jint/>
4560           <description>
4561             This bit vector of
4562             <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4563             restricts the objects for which the callback function is called.
4564             This applies to both the object and primitive callbacks.
4565           </description>
4566         </param>
4567         <param id="klass">
4568           <ptrtype>
4569             <jclass/>
4570             <nullok>callbacks are not limited to instances of a particular
4571                     class</nullok>
4572           </ptrtype>
4573           <description>
4574             Callbacks are only reported when the object is an instance of
4575             this class.
4576             Objects which are instances of a subclass of <code>klass</code>
4577             are not reported.
4578             If <code>klass</code> is an interface, no objects are reported.
4579             This applies to both the object and primitive callbacks.
4580           </description>
4581         </param>
4582         <param id="initial_object">
4583           <ptrtype>
4584             <jobject/>
4585             <nullok>references are followed from the heap roots</nullok>
4586           </ptrtype>
4587           <description>
4588             The object to follow
4589           </description>
4590         </param>
4591         <param id="callbacks">
4592           <inptr>
4593             <struct>jvmtiHeapCallbacks</struct>
4594           </inptr>
4595           <description>
4596             Structure defining the set of callback functions.
4597           </description>
4598         </param>
4599         <param id="user_data">
4600           <inbuf>
4601             <void/>
4602             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4603           </inbuf>
4604           <description>
4605             User supplied data to be passed to the callback.
4606           </description>
4607         </param>
4608       </parameters>
4609       <errors>
4610         <error id="JVMTI_ERROR_INVALID_CLASS">
4611           <paramlink id="klass"/> is not a valid class.
4612         </error>
4613         <error id="JVMTI_ERROR_INVALID_OBJECT">
4614           <paramlink id="initial_object"/> is not a valid object.
4615         </error>
4616       </errors>
4617     </function>
4618 
4619 
4620     <function id="IterateThroughHeap" num="116" since="1.1">
4621       <synopsis>Iterate Through Heap</synopsis>
4622       <description>
4623         Initiate an iteration over all objects in the heap.
4624         This includes both reachable and
4625         unreachable objects. Objects are visited in no particular order.
4626         <p/>
4627         Heap objects are reported by invoking the agent supplied
4628         callback function <functionlink id="jvmtiHeapIterationCallback"/>.
4629         References between objects are not reported.
4630         If only reachable objects are desired, or if object reference information
4631         is needed, use <functionlink id="FollowReferences"/>.
4632         <p/>
4633         This function can also be used to examine primitive (non-object) values.
4634         The primitive value of an array or String
4635         is reported after the object has been visited;
4636         it is reported by invoking the agent supplied callback function
4637         <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4638         <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4639         A primitive field
4640         is reported after the object with that field is visited;
4641         it is reported by invoking the agent supplied
4642         callback function
4643         <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4644         <p/>
4645         Unless the iteration is aborted by the
4646         <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4647         returned by a callback, all objects in the heap are visited.
4648         Whether a callback is provided or is <code>NULL</code> only determines
4649         whether the callback will be invoked, it does not influence
4650         which objects are visited nor does it influence whether other callbacks
4651         will be invoked.
4652         The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4653         and <paramlink id="klass"/> provided as parameters to this function
4654         do not control which objects are visited but they do control which
4655         objects and primitive values are reported by the callbacks.
4656         For example, if the only callback that was set is
4657         <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4658         is set to the array of bytes class, then only arrays of byte will be
4659         reported. The table below summarizes this (contrast this with
4660         <functionlink id="FollowReferences"/>):
4661         <p/>
4662         <table>
4663           <tr>
4664             <th/>
4665             <th>
4666               Controls objects visited
4667             </th>
4668             <th>
4669               Controls objects reported
4670             </th>
4671             <th>
4672               Controls primitives reported
4673             </th>
4674           </tr>
4675           <tr>
4676             <th class="leftAligned">
4677               the
4678               <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4679               returned by <functionlink id="jvmtiHeapIterationCallback"/>
4680             </th>
4681             <td class="centered">
4682               No<br/>(unless they abort the iteration)
4683             </td>
4684             <td class="centered">
4685               No<br/>(unless they abort the iteration)
4686             </td>
4687             <td class="centered">
4688               No<br/>(unless they abort the iteration)
4689             </td>
4690           </tr>
4691           <tr>
4692             <th class="leftAligned">
4693               <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4694               in <paramlink id="callbacks"/> set
4695             </th>
4696             <td class="centered">
4697               No
4698             </td>
4699             <td class="centered">
4700               <b>Yes</b>
4701             </td>
4702             <td class="centered">
4703               No
4704             </td>
4705           </tr>
4706           <tr>
4707             <th class="leftAligned">
4708               <paramlink id="heap_filter"/>
4709             </th>
4710             <td class="centered">
4711               No
4712             </td>
4713             <td class="centered">
4714               <b>Yes</b>
4715             </td>
4716             <td class="centered">
4717               <b>Yes</b>
4718             </td>
4719           </tr>
4720           <tr>
4721             <th class="leftAligned">
4722               <paramlink id="klass"/>
4723             </th>
4724             <td class="centered">
4725               No
4726             </td>
4727             <td class="centered">
4728               <b>Yes</b>
4729             </td>
4730             <td class="centered">
4731               <b>Yes</b>
4732             </td>
4733           </tr>
4734         </table>
4735         <p/>
4736         During the execution of this function the state of the heap
4737         does not change: no objects are allocated, no objects are
4738         garbage collected, and the state of objects (including
4739         held values) does not change.
4740         As a result, threads executing Java
4741         programming language code, threads attempting to resume the
4742         execution of Java programming language code, and threads
4743         attempting to execute JNI functions are typically stalled.
4744       </description>
4745       <origin>new</origin>
4746       <capabilities>
4747         <required id="can_tag_objects"></required>
4748       </capabilities>
4749       <parameters>
4750         <param id="heap_filter">
4751           <jint/>
4752           <description>
4753             This bit vector of
4754             <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4755             restricts the objects for which the callback function is called.
4756             This applies to both the object and primitive callbacks.
4757           </description>
4758         </param>
4759         <param id="klass">
4760           <ptrtype>
4761             <jclass/>
4762             <nullok>callbacks are not limited to instances of a particular class</nullok>
4763           </ptrtype>
4764           <description>
4765             Callbacks are only reported when the object is an instance of
4766             this class.
4767             Objects which are instances of a subclass of <code>klass</code>
4768             are not reported.
4769             If <code>klass</code> is an interface, no objects are reported.
4770             This applies to both the object and primitive callbacks.
4771           </description>
4772         </param>
4773         <param id="callbacks">
4774           <inptr>
4775             <struct>jvmtiHeapCallbacks</struct>
4776           </inptr>
4777           <description>
4778             Structure defining the set callback functions.
4779           </description>
4780         </param>
4781         <param id="user_data">
4782           <inbuf>
4783             <void/>
4784             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4785           </inbuf>
4786           <description>
4787             User supplied data to be passed to the callback.
4788           </description>
4789         </param>
4790       </parameters>
4791       <errors>
4792         <error id="JVMTI_ERROR_INVALID_CLASS">
4793           <paramlink id="klass"/> is not a valid class.
4794         </error>
4795       </errors>
4796     </function>
4797 
4798     <function id="GetTag" phase="start" num="106">
4799       <synopsis>Get Tag</synopsis>
4800       <description>
4801         Retrieve the tag associated with an object.
4802         The tag is a long value typically used to store a
4803         unique identifier or pointer to object information.
4804         The tag is set with
4805         <functionlink id="SetTag"></functionlink>.
4806         Objects for which no tags have been set return a
4807         tag value of zero.
4808       </description>
4809       <origin>new</origin>
4810       <capabilities>
4811         <required id="can_tag_objects"></required>
4812       </capabilities>
4813       <parameters>
4814         <param id="object">
4815           <jobject/>
4816             <description>
4817               The object whose tag is to be retrieved.
4818             </description>
4819         </param>
4820         <param id="tag_ptr">
4821           <outptr><jlong/></outptr>
4822           <description>
4823             On return, the referenced long is set to the value
4824             of the tag.
4825           </description>
4826         </param>
4827       </parameters>
4828       <errors>
4829       </errors>
4830     </function>
4831 
4832     <function id="SetTag" phase="start" num="107">
4833       <synopsis>Set Tag</synopsis>
4834       <description>
4835         Set the tag associated with an object.
4836         The tag is a long value typically used to store a
4837         unique identifier or pointer to object information.
4838         The tag is visible with
4839         <functionlink id="GetTag"></functionlink>.
4840       </description>
4841       <origin>new</origin>
4842       <capabilities>
4843         <required id="can_tag_objects"></required>
4844       </capabilities>
4845       <parameters>
4846         <param id="object">
4847           <jobject/>
4848             <description>
4849               The object whose tag is to be set.
4850             </description>
4851         </param>
4852         <param id="tag">
4853           <jlong/>
4854           <description>
4855             The new value of the tag.
4856           </description>
4857         </param>
4858       </parameters>
4859       <errors>
4860       </errors>
4861     </function>
4862 
4863     <function id="GetObjectsWithTags" num="114">
4864       <synopsis>Get Objects With Tags</synopsis>
4865       <description>
4866         Return objects in the heap with the specified tags.
4867         The format is parallel arrays of objects and tags.
4868       </description>
4869       <origin>new</origin>
4870       <capabilities>
4871         <required id="can_tag_objects"></required>
4872       </capabilities>
4873       <parameters>
4874         <param id="tag_count">
4875           <jint min="0"/>
4876             <description>
4877               Number of tags to scan for.
4878             </description>
4879         </param>
4880         <param id="tags">
4881           <inbuf incount="tag_count">
4882             <jlong/>
4883           </inbuf>
4884             <description>
4885               Scan for objects with these tags.
4886               Zero is not permitted in this array.
4887             </description>
4888         </param>
4889         <param id="count_ptr">
4890           <outptr>
4891             <jint/>
4892           </outptr>
4893             <description>
4894               Return the number of objects with any of the tags
4895               in <paramlink id="tags"/>.
4896             </description>
4897         </param>
4898         <param id="object_result_ptr">
4899           <allocbuf outcount="count_ptr">
4900             <jobject/>
4901             <nullok>this information is not returned</nullok>
4902           </allocbuf>
4903             <description>
4904               Returns the array of objects with any of the tags
4905               in <paramlink id="tags"/>.
4906             </description>
4907         </param>
4908         <param id="tag_result_ptr">
4909           <allocbuf outcount="count_ptr">
4910             <jlong/>
4911             <nullok>this information is not returned</nullok>
4912           </allocbuf>
4913             <description>
4914               For each object in <paramlink id="object_result_ptr"/>,
4915               return the tag at the corresponding index.
4916             </description>
4917         </param>
4918       </parameters>
4919       <errors>
4920         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
4921           Zero is present in <paramlink id="tags"></paramlink>.
4922         </error>
4923       </errors>
4924     </function>
4925 
4926     <function id="ForceGarbageCollection" num="108">
4927       <synopsis>Force Garbage Collection</synopsis>
4928       <description>
4929         Force the VM to perform a garbage collection.
4930         The garbage collection is as complete as possible.
4931         This function does not cause finalizers to be run.
4932         This function does not return until the garbage collection
4933         is finished.
4934         <p/>
4935         Although garbage collection is as complete
4936         as possible there is no guarantee that all
4937         <eventlink id="ObjectFree"/>
4938         events will have been
4939         sent by the time that this function
4940         returns. In particular, an object may be
4941         prevented from being freed because it
4942         is awaiting finalization.
4943       </description>
4944       <origin>new</origin>
4945       <capabilities>
4946       </capabilities>
4947       <parameters>
4948       </parameters>
4949       <errors>
4950       </errors>
4951     </function>
4952 
4953 
4954   </category>
4955 
4956   <category id="Heap_1_0" label="Heap (1.0)">
4957     <intro>
4958       <b>
4959         These functions and data types were introduced in the original
4960         <jvmti/> version 1.0 and have been superseded by more
4961       </b>
4962       <internallink id="Heap"><b>powerful and flexible versions</b></internallink>
4963       <b>
4964         which:
4965       </b>
4966       <ul>
4967         <li>
4968           <b>
4969             Allow access to primitive values (the value of Strings, arrays,
4970             and primitive fields)
4971           </b>
4972         </li>
4973         <li>
4974           <b>
4975             Allow the tag of the referrer to be set, thus enabling more
4976             efficient localized reference graph building
4977           </b>
4978         </li>
4979         <li>
4980           <b>
4981             Provide more extensive filtering abilities
4982           </b>
4983         </li>
4984         <li>
4985           <b>
4986             Are extensible, allowing their abilities to grow in future versions of <jvmti/>
4987           </b>
4988         </li>
4989       </ul>
4990       <p/>
4991       <b>Please use the </b>
4992       <internallink id="Heap"><b>current Heap functions</b></internallink>.
4993         <p/>
4994         <constants id="jvmtiHeapObjectFilter" label="Heap Object Filter Enumeration" kind="enum">
4995           <constant id="JVMTI_HEAP_OBJECT_TAGGED" num="1">
4996             Tagged objects only.
4997           </constant>
4998           <constant id="JVMTI_HEAP_OBJECT_UNTAGGED" num="2">
4999             Untagged objects only.
5000           </constant>
5001           <constant id="JVMTI_HEAP_OBJECT_EITHER" num="3">
5002             Either tagged or untagged objects.
5003           </constant>
5004         </constants>
5005 
5006         <constants id="jvmtiHeapRootKind" label="Heap Root Kind Enumeration" kind="enum">
5007           <constant id="JVMTI_HEAP_ROOT_JNI_GLOBAL" num="1">
5008             JNI global reference.
5009           </constant>
5010           <constant id="JVMTI_HEAP_ROOT_SYSTEM_CLASS" num="2">
5011             System class.
5012           </constant>
5013           <constant id="JVMTI_HEAP_ROOT_MONITOR" num="3">
5014             Monitor.
5015           </constant>
5016           <constant id="JVMTI_HEAP_ROOT_STACK_LOCAL" num="4">
5017             Stack local.
5018           </constant>
5019           <constant id="JVMTI_HEAP_ROOT_JNI_LOCAL" num="5">
5020             JNI local reference.
5021           </constant>
5022           <constant id="JVMTI_HEAP_ROOT_THREAD" num="6">
5023             Thread.
5024           </constant>
5025           <constant id="JVMTI_HEAP_ROOT_OTHER" num="7">
5026             Other.
5027           </constant>
5028         </constants>
5029 
5030         <constants id="jvmtiObjectReferenceKind" label="Object Reference Enumeration" kind="enum">
5031           <constant id="JVMTI_REFERENCE_CLASS" num="1">
5032             Reference from an object to its class.
5033           </constant>
5034           <constant id="JVMTI_REFERENCE_FIELD" num="2">
5035             Reference from an object to the value of one of its instance fields.
5036             For references of this kind the <code>referrer_index</code>
5037             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5038             jvmtiObjectReferenceCallback</internallink> is the index of the
5039             the instance field. The index is based on the order of all the
5040             object's fields. This includes all fields of the directly declared
5041             static and instance fields in the class, and includes all fields (both
5042             public and private) fields declared in superclasses and superinterfaces.
5043             The index is thus calculated by summing the index of the field in the directly
5044             declared class (see <functionlink id="GetClassFields"/>), with the total
5045             number of fields (both public and private) declared in all superclasses
5046             and superinterfaces. The index starts at zero.
5047           </constant>
5048           <constant id="JVMTI_REFERENCE_ARRAY_ELEMENT" num="3">
5049             Reference from an array to one of its elements.
5050             For references of this kind the <code>referrer_index</code>
5051             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5052             jvmtiObjectReferenceCallback</internallink> is the array index.
5053           </constant>
5054           <constant id="JVMTI_REFERENCE_CLASS_LOADER" num="4">
5055             Reference from a class to its class loader.
5056           </constant>
5057           <constant id="JVMTI_REFERENCE_SIGNERS" num="5">
5058             Reference from a class to its signers array.
5059           </constant>
5060           <constant id="JVMTI_REFERENCE_PROTECTION_DOMAIN" num="6">
5061             Reference from a class to its protection domain.
5062           </constant>
5063           <constant id="JVMTI_REFERENCE_INTERFACE" num="7">
5064             Reference from a class to one of its interfaces.
5065           </constant>
5066           <constant id="JVMTI_REFERENCE_STATIC_FIELD" num="8">
5067             Reference from a class to the value of one of its static fields.
5068             For references of this kind the <code>referrer_index</code>
5069             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5070             jvmtiObjectReferenceCallback</internallink> is the index of the
5071             the static field. The index is based on the order of all the
5072             object's fields. This includes all fields of the directly declared
5073             static and instance fields in the class, and includes all fields (both
5074             public and private) fields declared in superclasses and superinterfaces.
5075             The index is thus calculated by summing the index of the field in the directly
5076             declared class (see <functionlink id="GetClassFields"/>), with the total
5077             number of fields (both public and private) declared in all superclasses
5078             and superinterfaces. The index starts at zero.
5079             Note: this definition differs from that in the <jvmti/> 1.0 Specification.
5080             <rationale>No known implementations used the 1.0 definition.</rationale>
5081           </constant>
5082           <constant id="JVMTI_REFERENCE_CONSTANT_POOL" num="9">
5083             Reference from a class to a resolved entry in the constant pool.
5084             For references of this kind the <code>referrer_index</code>
5085             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5086             jvmtiObjectReferenceCallback</internallink> is the index into
5087             constant pool table of the class, starting at 1. See
5088             <vmspec chapter="4.4"/>.
5089           </constant>
5090         </constants>
5091 
5092         <constants id="jvmtiIterationControl" label="Iteration Control Enumeration" kind="enum">
5093           <constant id="JVMTI_ITERATION_CONTINUE" num="1">
5094             Continue the iteration.
5095             If this is a reference iteration, follow the references of this object.
5096           </constant>
5097           <constant id="JVMTI_ITERATION_IGNORE" num="2">
5098             Continue the iteration.
5099             If this is a reference iteration, ignore the references of this object.
5100           </constant>
5101           <constant id="JVMTI_ITERATION_ABORT" num="0">
5102             Abort the iteration.
5103           </constant>
5104         </constants>
5105     </intro>
5106 
5107     <callback id="jvmtiHeapObjectCallback">
5108       <enum>jvmtiIterationControl</enum>
5109       <synopsis>Heap Object Callback</synopsis>
5110       <description>
5111         Agent supplied callback function.
5112         Describes (but does not pass in) an object in the heap.
5113         <p/>
5114         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5115         or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5116         <p/>
5117         See the <internallink id="heapCallbacks">heap callback
5118         function restrictions</internallink>.
5119       </description>
5120       <parameters>
5121         <param id="class_tag">
5122           <jlong/>
5123           <description>
5124             The tag of the class of object (zero if the class is not tagged).
5125             If the object represents a runtime class,
5126             the <code>class_tag</code> is the tag
5127             associated with <code>java.lang.Class</code>
5128             (zero if <code>java.lang.Class</code> is not tagged).
5129           </description>
5130         </param>
5131         <param id="size">
5132           <jlong/>
5133           <description>
5134             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5135           </description>
5136         </param>
5137         <param id="tag_ptr">
5138           <outptr><jlong/></outptr>
5139           <description>
5140             The object tag value, or zero if the object is not tagged.
5141             To set the tag value to be associated with the object
5142             the agent sets the <code>jlong</code> pointed to by the parameter.
5143           </description>
5144         </param>
5145         <param id="user_data">
5146           <outptr><void/></outptr>
5147           <description>
5148             The user supplied data that was passed into the iteration function.
5149           </description>
5150         </param>
5151       </parameters>
5152     </callback>
5153 
5154     <callback id="jvmtiHeapRootCallback">
5155       <enum>jvmtiIterationControl</enum>
5156       <synopsis>Heap Root Object Callback</synopsis>
5157       <description>
5158         Agent supplied callback function.
5159         Describes (but does not pass in) an object that is a root for the purposes
5160         of garbage collection.
5161         <p/>
5162         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5163         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5164         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5165         <p/>
5166         See the <internallink id="heapCallbacks">heap callback
5167         function restrictions</internallink>.
5168       </description>
5169       <parameters>
5170         <param id="root_kind">
5171           <enum>jvmtiHeapRootKind</enum>
5172           <description>
5173             The kind of heap root.
5174           </description>
5175         </param>
5176         <param id="class_tag">
5177           <jlong/>
5178           <description>
5179             The tag of the class of object (zero if the class is not tagged).
5180             If the object represents a runtime class, the <code>class_tag</code> is the tag
5181             associated with <code>java.lang.Class</code>
5182             (zero if <code>java.lang.Class</code> is not tagged).
5183           </description>
5184         </param>
5185         <param id="size">
5186           <jlong/>
5187           <description>
5188             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5189           </description>
5190         </param>
5191         <param id="tag_ptr">
5192           <outptr><jlong/></outptr>
5193           <description>
5194             The object tag value, or zero if the object is not tagged.
5195             To set the tag value to be associated with the object
5196             the agent sets the <code>jlong</code> pointed to by the parameter.
5197           </description>
5198         </param>
5199         <param id="user_data">
5200           <outptr><void/></outptr>
5201           <description>
5202             The user supplied data that was passed into the iteration function.
5203           </description>
5204         </param>
5205       </parameters>
5206     </callback>
5207 
5208     <callback id="jvmtiStackReferenceCallback">
5209       <enum>jvmtiIterationControl</enum>
5210       <synopsis>Stack Reference Object Callback</synopsis>
5211       <description>
5212         Agent supplied callback function.
5213         Describes (but does not pass in) an object on the stack that is a root for
5214         the purposes of garbage collection.
5215         <p/>
5216         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5217         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5218         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5219         <p/>
5220         See the <internallink id="heapCallbacks">heap callback
5221         function restrictions</internallink>.
5222       </description>
5223       <parameters>
5224         <param id="root_kind">
5225           <enum>jvmtiHeapRootKind</enum>
5226           <description>
5227             The kind of root (either <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5228             <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>).
5229           </description>
5230         </param>
5231         <param id="class_tag">
5232           <jlong/>
5233           <description>
5234            The tag of the class of object (zero if the class is not tagged).
5235            If the object represents a runtime class, the  <code>class_tag</code> is the tag
5236            associated with <code>java.lang.Class</code>
5237            (zero if <code>java.lang.Class</code> is not tagged).
5238           </description>
5239         </param>
5240         <param id="size">
5241           <jlong/>
5242           <description>
5243             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5244           </description>
5245         </param>
5246         <param id="tag_ptr">
5247           <outptr><jlong/></outptr>
5248           <description>
5249             The object tag value, or zero if the object is not tagged.
5250             To set the tag value to be associated with the object
5251             the agent sets the <code>jlong</code> pointed to by the parameter.
5252           </description>
5253         </param>
5254         <param id="thread_tag">
5255           <jlong/>
5256           <description>
5257             The tag of the thread corresponding to this stack, zero if not tagged.
5258           </description>
5259         </param>
5260         <param id="depth">
5261           <jint/>
5262           <description>
5263             The depth of the frame.
5264           </description>
5265         </param>
5266         <param id="method">
5267           <jmethodID/>
5268           <description>
5269             The method executing in this frame.
5270           </description>
5271         </param>
5272         <param id="slot">
5273           <jint/>
5274           <description>
5275             The slot number.
5276           </description>
5277         </param>
5278         <param id="user_data">
5279           <outptr><void/></outptr>
5280           <description>
5281             The user supplied data that was passed into the iteration function.
5282           </description>
5283         </param>
5284       </parameters>
5285     </callback>
5286 
5287     <callback id="jvmtiObjectReferenceCallback">
5288       <enum>jvmtiIterationControl</enum>
5289       <synopsis>Object Reference Callback</synopsis>
5290       <description>
5291         Agent supplied callback function.
5292         Describes a reference from an object (the referrer) to another object
5293         (the referree).
5294         <p/>
5295         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5296         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing
5297         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5298         <p/>
5299         See the <internallink id="heapCallbacks">heap callback
5300         function restrictions</internallink>.
5301       </description>
5302       <parameters>
5303         <param id="reference_kind">
5304           <enum>jvmtiObjectReferenceKind</enum>
5305           <description>
5306             The type of reference.
5307           </description>
5308         </param>
5309         <param id="class_tag">
5310           <jlong/>
5311           <description>
5312             The tag of the class of referree object (zero if the class is not tagged).
5313             If the referree object represents a runtime class,
5314             the  <code>class_tag</code> is the tag
5315             associated with <code>java.lang.Class</code>
5316             (zero if <code>java.lang.Class</code> is not tagged).
5317           </description>
5318         </param>
5319         <param id="size">
5320           <jlong/>
5321           <description>
5322             Size of the referree object (in bytes).
5323             See <functionlink id="GetObjectSize"/>.
5324           </description>
5325         </param>
5326         <param id="tag_ptr">
5327           <outptr><jlong/></outptr>
5328           <description>
5329             The referree object tag value, or zero if the object is not
5330             tagged.
5331             To set the tag value to be associated with the object
5332             the agent sets the <code>jlong</code> pointed to by the parameter.
5333           </description>
5334         </param>
5335         <param id="referrer_tag">
5336           <jlong/>
5337           <description>
5338             The tag of the referrer object, or zero if the referrer
5339             object is not tagged.
5340           </description>
5341         </param>
5342         <param id="referrer_index">
5343           <jint/>
5344           <description>
5345             For references of type <code>JVMTI_REFERENCE_FIELD</code> or
5346             <code>JVMTI_REFERENCE_STATIC_FIELD</code> the index
5347             of the field in the referrer object. The index is based on the
5348             order of all the object's fields - see <internallink
5349             id="JVMTI_REFERENCE_FIELD">JVMTI_REFERENCE_FIELD</internallink>
5350             or <internallink
5351             id="JVMTI_REFERENCE_STATIC_FIELD">JVMTI_REFERENCE_STATIC_FIELD
5352             </internallink> for further description.
5353             <p/>
5354             For references of type <code>JVMTI_REFERENCE_ARRAY_ELEMENT</code>
5355             the array index - see <internallink id="JVMTI_REFERENCE_ARRAY_ELEMENT">
5356             JVMTI_REFERENCE_ARRAY_ELEMENT</internallink> for further description.
5357             <p/>
5358             For references of type <code>JVMTI_REFERENCE_CONSTANT_POOL</code>
5359             the index into the constant pool of the class - see
5360             <internallink id="JVMTI_REFERENCE_CONSTANT_POOL">
5361             JVMTI_REFERENCE_CONSTANT_POOL</internallink> for further
5362             description.
5363             <p/>
5364             For references of other kinds the <code>referrer_index</code> is
5365             <code>-1</code>.
5366           </description>
5367         </param>
5368         <param id="user_data">
5369           <outptr><void/></outptr>
5370           <description>
5371             The user supplied data that was passed into the iteration function.
5372           </description>
5373         </param>
5374       </parameters>
5375     </callback>
5376 
5377     <function id="IterateOverObjectsReachableFromObject" num="109">
5378       <synopsis>Iterate Over Objects Reachable From Object</synopsis>
5379       <description>
5380         This function iterates over all objects that are directly
5381         and indirectly reachable from the specified object.
5382         For each object <i>A</i> (known
5383         as the referrer) with a reference to object <i>B</i> the specified
5384         callback function is called to describe the object reference.
5385         The callback is called exactly once for each reference from a referrer;
5386         this is true even if there are reference cycles or multiple paths to
5387         the referrer.
5388         There may be more than one reference between a referrer and a referree,
5389         These may be distinguished by the
5390         <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5391         <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5392         The callback for an object will always occur after the callback for
5393         its referrer.
5394         <p/>
5395         See <functionlink id="FollowReferences"/> for the object
5396         references which are reported.
5397         <p/>
5398         During the execution of this function the state of the heap
5399         does not change: no objects are allocated, no objects are
5400         garbage collected, and the state of objects (including
5401         held values) does not change.
5402         As a result, threads executing Java
5403         programming language code, threads attempting to resume the
5404         execution of Java programming language code, and threads
5405         attempting to execute JNI functions are typically stalled.
5406       </description>
5407       <origin>new</origin>
5408       <capabilities>
5409         <required id="can_tag_objects"></required>
5410       </capabilities>
5411       <parameters>
5412         <param id="object">
5413           <jobject/>
5414             <description>
5415               The object
5416             </description>
5417         </param>
5418         <param id="object_reference_callback">
5419           <ptrtype>
5420             <struct>jvmtiObjectReferenceCallback</struct>
5421           </ptrtype>
5422             <description>
5423               The callback to be called to describe each
5424               object reference.
5425             </description>
5426         </param>
5427         <param id="user_data">
5428           <inbuf>
5429             <void/>
5430             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5431           </inbuf>
5432           <description>
5433             User supplied data to be passed to the callback.
5434           </description>
5435         </param>
5436       </parameters>
5437       <errors>
5438       </errors>
5439     </function>
5440 
5441     <function id="IterateOverReachableObjects" num="110">
5442       <synopsis>Iterate Over Reachable Objects</synopsis>
5443       <description>
5444         This function iterates over the root objects and all objects that
5445         are directly and indirectly reachable from the root objects.
5446         The root objects comprise the set of system classes,
5447         JNI globals, references from thread stacks, and other objects used as roots
5448         for the purposes of garbage collection.
5449         <p/>
5450         For each root the <paramlink id="heap_root_callback"></paramlink>
5451         or <paramlink id="stack_ref_callback"></paramlink> callback is called.
5452         An object can be a root object for more than one reason and in that case
5453         the appropriate callback is called for each reason.
5454         <p/>
5455         For each object reference the <paramlink id="object_ref_callback"></paramlink>
5456         callback function is called to describe the object reference.
5457         The callback is called exactly once for each reference from a referrer;
5458         this is true even if there are reference cycles or multiple paths to
5459         the referrer.
5460         There may be more than one reference between a referrer and a referree,
5461         These may be distinguished by the
5462         <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5463         <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5464         The callback for an object will always occur after the callback for
5465         its referrer.
5466         <p/>
5467         See <functionlink id="FollowReferences"/> for the object
5468         references which are reported.
5469         <p/>
5470         Roots are always reported to the profiler before any object references
5471         are reported. In other words, the <paramlink id="object_ref_callback"></paramlink>
5472         callback will not be called until the appropriate callback has been called
5473         for all roots. If the <paramlink id="object_ref_callback"></paramlink> callback is
5474         specified as <code>NULL</code> then this function returns after
5475         reporting the root objects to the profiler.
5476         <p/>
5477         During the execution of this function the state of the heap
5478         does not change: no objects are allocated, no objects are
5479         garbage collected, and the state of objects (including
5480         held values) does not change.
5481         As a result, threads executing Java
5482         programming language code, threads attempting to resume the
5483         execution of Java programming language code, and threads
5484         attempting to execute JNI functions are typically stalled.
5485       </description>
5486       <origin>new</origin>
5487       <capabilities>
5488         <required id="can_tag_objects"></required>
5489       </capabilities>
5490       <parameters>
5491         <param id="heap_root_callback">
5492           <ptrtype>
5493             <struct>jvmtiHeapRootCallback</struct>
5494             <nullok>do not report heap roots</nullok>
5495           </ptrtype>
5496             <description>
5497               The callback function to be called for each heap root of type
5498               <code>JVMTI_HEAP_ROOT_JNI_GLOBAL</code>,
5499               <code>JVMTI_HEAP_ROOT_SYSTEM_CLASS</code>,
5500               <code>JVMTI_HEAP_ROOT_MONITOR</code>,
5501               <code>JVMTI_HEAP_ROOT_THREAD</code>, or
5502               <code>JVMTI_HEAP_ROOT_OTHER</code>.
5503             </description>
5504         </param>
5505         <param id="stack_ref_callback">
5506           <ptrtype>
5507             <struct>jvmtiStackReferenceCallback</struct>
5508             <nullok>do not report stack references</nullok>
5509           </ptrtype>
5510             <description>
5511               The callback function to be called for each heap root of
5512               <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5513               <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>.
5514             </description>
5515         </param>
5516         <param id="object_ref_callback">
5517           <ptrtype>
5518             <struct>jvmtiObjectReferenceCallback</struct>
5519             <nullok>do not follow references from the root objects</nullok>
5520           </ptrtype>
5521             <description>
5522               The callback function to be called for each object reference.
5523             </description>
5524         </param>
5525         <param id="user_data">
5526           <inbuf>
5527             <void/>
5528             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5529           </inbuf>
5530           <description>
5531             User supplied data to be passed to the callback.
5532           </description>
5533         </param>
5534       </parameters>
5535       <errors>
5536       </errors>
5537     </function>
5538 
5539     <function id="IterateOverHeap" num="111">
5540       <synopsis>Iterate Over Heap</synopsis>
5541       <description>
5542         Iterate over all objects in the heap. This includes both reachable and
5543         unreachable objects.
5544         <p/>
5545         The <paramlink id="object_filter"></paramlink> parameter indicates the
5546         objects for which the callback function is called. If this parameter
5547         is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be
5548         called for every object that is tagged. If the parameter is
5549         <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5550         for objects that are not tagged. If the parameter
5551         is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5552         called for every object in the heap, irrespective of whether it is
5553         tagged or not.
5554         <p/>
5555         During the execution of this function the state of the heap
5556         does not change: no objects are allocated, no objects are
5557         garbage collected, and the state of objects (including
5558         held values) does not change.
5559         As a result, threads executing Java
5560         programming language code, threads attempting to resume the
5561         execution of Java programming language code, and threads
5562         attempting to execute JNI functions are typically stalled.
5563       </description>
5564       <origin>new</origin>
5565       <capabilities>
5566         <required id="can_tag_objects"></required>
5567       </capabilities>
5568       <parameters>
5569         <param id="object_filter">
5570           <enum>jvmtiHeapObjectFilter</enum>
5571           <description>
5572             Indicates the objects for which the callback function is called.
5573           </description>
5574         </param>
5575         <param id="heap_object_callback">
5576           <ptrtype>
5577             <struct>jvmtiHeapObjectCallback</struct>
5578           </ptrtype>
5579             <description>
5580               The iterator function to be called for each
5581               object matching the <paramlink id="object_filter"/>.
5582             </description>
5583         </param>
5584         <param id="user_data">
5585           <inbuf>
5586             <void/>
5587             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5588           </inbuf>
5589           <description>
5590             User supplied data to be passed to the callback.
5591           </description>
5592         </param>
5593       </parameters>
5594       <errors>
5595       </errors>
5596     </function>
5597 
5598     <function id="IterateOverInstancesOfClass" num="112">
5599       <synopsis>Iterate Over Instances Of Class</synopsis>
5600       <description>
5601         Iterate over all objects in the heap that are instances of the specified class.
5602         This includes direct instances of the specified class and
5603         instances of all subclasses of the specified class.
5604         This includes both reachable and unreachable objects.
5605         <p/>
5606         The <paramlink id="object_filter"></paramlink> parameter indicates the
5607         objects for which the callback function is called. If this parameter
5608         is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be
5609         called for every object that is tagged. If the parameter is
5610         <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5611         called for objects that are not tagged. If the parameter
5612         is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5613         called for every object in the heap, irrespective of whether it is
5614         tagged or not.
5615         <p/>
5616         During the execution of this function the state of the heap
5617         does not change: no objects are allocated, no objects are
5618         garbage collected, and the state of objects (including
5619         held values) does not change.
5620         As a result, threads executing Java
5621         programming language code, threads attempting to resume the
5622         execution of Java programming language code, and threads
5623         attempting to execute JNI functions are typically stalled.
5624       </description>
5625       <origin>new</origin>
5626       <capabilities>
5627         <required id="can_tag_objects"></required>
5628       </capabilities>
5629       <parameters>
5630         <param id="klass">
5631           <jclass/>
5632             <description>
5633               Iterate over objects of this class only.
5634             </description>
5635         </param>
5636         <param id="object_filter">
5637           <enum>jvmtiHeapObjectFilter</enum>
5638           <description>
5639             Indicates the objects for which the callback function is called.
5640           </description>
5641         </param>
5642         <param id="heap_object_callback">
5643           <ptrtype>
5644             <struct>jvmtiHeapObjectCallback</struct>
5645           </ptrtype>
5646             <description>
5647               The iterator function to be called for each
5648               <paramlink id="klass"/> instance matching
5649               the <paramlink id="object_filter"/>.
5650             </description>
5651         </param>
5652         <param id="user_data">
5653           <inbuf>
5654             <void/>
5655             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5656           </inbuf>
5657           <description>
5658             User supplied data to be passed to the callback.
5659           </description>
5660         </param>
5661       </parameters>
5662       <errors>
5663       </errors>
5664     </function>
5665 
5666   </category>
5667 
5668   <category id="local" label="Local Variable">
5669 
5670     <intro>
5671       These functions are used to retrieve or set the value of a local variable.
5672       The variable is identified by the depth of the frame containing its
5673       value and the variable's slot number within that frame.
5674       The mapping of variables to
5675       slot numbers can be obtained with the function
5676       <functionlink id="GetLocalVariableTable"></functionlink>.
5677     </intro>
5678 
5679     <function id="GetLocalObject" num="21">
5680       <synopsis>Get Local Variable - Object</synopsis>
5681       <description>
5682         This function can be used to retrieve the value of a local
5683         variable whose type is <code>Object</code> or a subclass of <code>Object</code>.
5684       </description>
5685       <origin>jvmdi</origin>
5686       <capabilities>
5687         <required id="can_access_local_variables"></required>
5688       </capabilities>
5689       <parameters>
5690         <param id="thread">
5691           <jthread null="current" frame="frame"/>
5692           <description>
5693             The thread of the frame containing the variable's value.
5694           </description>
5695         </param>
5696         <param id="depth">
5697           <jframeID thread="thread"/>
5698           <description>
5699             The depth of the frame containing the variable's value.
5700           </description>
5701         </param>
5702         <param id="slot">
5703           <jint/>
5704           <description>
5705             The variable's slot number.
5706           </description>
5707         </param>
5708         <param id="value_ptr">
5709           <outptr><jobject/></outptr>
5710             <description>
5711               On return, points to the variable's value.
5712             </description>
5713         </param>
5714       </parameters>
5715       <errors>
5716         <error id="JVMTI_ERROR_INVALID_SLOT">
5717           Invalid <code>slot</code>.
5718         </error>
5719         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5720           The variable type is not
5721           <code>Object</code> or a subclass of <code>Object</code>.
5722         </error>
5723         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5724           Not a visible frame
5725         </error>
5726       </errors>
5727     </function>
5728 
5729     <function id="GetLocalInstance" num="155" since="1.2">
5730       <synopsis>Get Local Instance</synopsis>
5731       <description>
5732         This function can be used to retrieve the value of the local object
5733         variable at slot 0 (the "<code>this</code>" object) from non-static
5734         frames.  This function can retrieve the "<code>this</code>" object from
5735         native method frames, whereas <code>GetLocalObject()</code> would
5736         return <code>JVMTI_ERROR_OPAQUE_FRAME</code> in those cases.
5737       </description>
5738       <origin>new</origin>
5739       <capabilities>
5740         <required id="can_access_local_variables"></required>
5741       </capabilities>
5742       <parameters>
5743         <param id="thread">
5744           <jthread null="current" frame="frame"/>
5745           <description>
5746             The thread of the frame containing the variable's value.
5747           </description>
5748         </param>
5749         <param id="depth">
5750           <jframeID thread="thread"/>
5751           <description>
5752             The depth of the frame containing the variable's value.
5753           </description>
5754         </param>
5755         <param id="value_ptr">
5756           <outptr><jobject/></outptr>
5757             <description>
5758               On return, points to the variable's value.
5759             </description>
5760         </param>
5761       </parameters>
5762       <errors>
5763         <error id="JVMTI_ERROR_INVALID_SLOT">
5764           If the specified frame is a static method frame.
5765         </error>
5766       </errors>
5767     </function>
5768     <function id="GetLocalInt" num="22">
5769       <synopsis>Get Local Variable - Int</synopsis>
5770       <description>
5771         This function can be used to retrieve the value of a local
5772         variable whose type is <code>int</code>,
5773         <code>short</code>, <code>char</code>, <code>byte</code>, or
5774         <code>boolean</code>.
5775       </description>
5776       <origin>jvmdi</origin>
5777       <capabilities>
5778         <required id="can_access_local_variables"></required>
5779       </capabilities>
5780       <parameters>
5781         <param id="thread">
5782           <jthread null="current" frame="frame"/>
5783           <description>
5784             The thread of the frame containing the variable's value.
5785           </description>
5786         </param>
5787         <param id="depth">
5788           <jframeID thread="thread"/>
5789           <description>
5790             The depth of the frame containing the variable's value.
5791           </description>
5792         </param>
5793         <param id="slot">
5794           <jint/>
5795           <description>
5796             The variable's slot number.
5797           </description>
5798         </param>
5799         <param id="value_ptr">
5800           <outptr><jint/></outptr>
5801           <description>
5802             On return, points to the variable's value.
5803           </description>
5804         </param>
5805       </parameters>
5806       <errors>
5807         <error id="JVMTI_ERROR_INVALID_SLOT">
5808           Invalid <code>slot</code>.
5809         </error>
5810         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5811           The variable type is not
5812           <code>int</code>, <code>short</code>,
5813           <code>char</code>, <code>byte</code>, or
5814           <code>boolean</code>.
5815         </error>
5816         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5817           Not a visible frame
5818         </error>
5819       </errors>
5820     </function>
5821 
5822     <function id="GetLocalLong" num="23">
5823       <synopsis>Get Local Variable - Long</synopsis>
5824       <description>
5825         This function can be used to retrieve the value of a local
5826         variable whose type is <code>long</code>.
5827       </description>
5828       <origin>jvmdi</origin>
5829       <capabilities>
5830         <required id="can_access_local_variables"></required>
5831       </capabilities>
5832       <parameters>
5833         <param id="thread">
5834           <jthread null="current" frame="frame"/>
5835           <description>
5836             The thread of the frame containing the variable's value.
5837           </description>
5838         </param>
5839         <param id="depth">
5840           <jframeID thread="thread"/>
5841           <description>
5842             The depth of the frame containing the variable's value.
5843           </description>
5844         </param>
5845         <param id="slot">
5846           <jint/>
5847           <description>
5848             The variable's slot number.
5849           </description>
5850         </param>
5851         <param id="value_ptr">
5852           <outptr><jlong/></outptr>
5853           <description>
5854             On return, points to the variable's value.
5855           </description>
5856         </param>
5857       </parameters>
5858       <errors>
5859         <error id="JVMTI_ERROR_INVALID_SLOT">
5860           Invalid <code>slot</code>.
5861         </error>
5862         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5863           The variable type is not <code>long</code>.
5864         </error>
5865         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5866           Not a visible frame
5867         </error>
5868       </errors>
5869     </function>
5870 
5871     <function id="GetLocalFloat" num="24">
5872       <synopsis>Get Local Variable - Float</synopsis>
5873       <description>
5874         This function can be used to retrieve the value of a local
5875         variable whose type is <code>float</code>.
5876       </description>
5877       <origin>jvmdi</origin>
5878       <capabilities>
5879         <required id="can_access_local_variables"></required>
5880       </capabilities>
5881       <parameters>
5882         <param id="thread">
5883           <jthread null="current" frame="frame"/>
5884           <description>
5885             The thread of the frame containing the variable's value.
5886           </description>
5887         </param>
5888         <param id="depth">
5889           <jframeID thread="thread"/>
5890           <description>
5891             The depth of the frame containing the variable's value.
5892           </description>
5893         </param>
5894         <param id="slot">
5895           <jint/>
5896           <description>
5897             The variable's slot number.
5898           </description>
5899         </param>
5900         <param id="value_ptr">
5901           <outptr><jfloat/></outptr>
5902           <description>
5903             On return, points to the variable's value.
5904           </description>
5905         </param>
5906       </parameters>
5907       <errors>
5908         <error id="JVMTI_ERROR_INVALID_SLOT">
5909           Invalid <code>slot</code>.
5910         </error>
5911         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5912           The variable type is not <code>float</code>.
5913         </error>
5914         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5915           Not a visible frame
5916         </error>
5917       </errors>
5918     </function>
5919 
5920     <function id="GetLocalDouble" num="25">
5921       <synopsis>Get Local Variable - Double</synopsis>
5922       <description>
5923         This function can be used to retrieve the value of a local
5924         variable whose type is <code>long</code>.
5925       </description>
5926       <origin>jvmdi</origin>
5927       <capabilities>
5928         <required id="can_access_local_variables"></required>
5929       </capabilities>
5930       <parameters>
5931         <param id="thread">
5932           <jthread null="current" frame="frame"/>
5933           <description>
5934             The thread of the frame containing the variable's value.
5935           </description>
5936         </param>
5937         <param id="depth">
5938           <jframeID thread="thread"/>
5939           <description>
5940             The depth of the frame containing the variable's value.
5941           </description>
5942         </param>
5943         <param id="slot">
5944           <jint/>
5945           <description>
5946             The variable's slot number.
5947           </description>
5948         </param>
5949         <param id="value_ptr">
5950           <outptr><jdouble/></outptr>
5951           <description>
5952             On return, points to the variable's value.
5953           </description>
5954         </param>
5955       </parameters>
5956       <errors>
5957         <error id="JVMTI_ERROR_INVALID_SLOT">
5958           Invalid <code>slot</code>.
5959         </error>
5960         <error id="JVMTI_ERROR_TYPE_MISMATCH">
5961           The variable type is not <code>double</code>.
5962         </error>
5963         <error id="JVMTI_ERROR_OPAQUE_FRAME">
5964           Not a visible frame
5965         </error>
5966       </errors>
5967     </function>
5968 
5969     <function id="SetLocalObject" num="26">
5970       <synopsis>Set Local Variable - Object</synopsis>
5971       <description>
5972         This function can be used to set the value of a local
5973         variable whose type is <code>Object</code> or a subclass of <code>Object</code>.
5974       </description>
5975       <origin>jvmdi</origin>
5976       <capabilities>
5977         <required id="can_access_local_variables"></required>
5978       </capabilities>
5979       <parameters>
5980         <param id="thread">
5981           <jthread null="current" frame="frame"/>
5982           <description>
5983             The thread of the frame containing the variable's value.
5984           </description>
5985         </param>
5986         <param id="depth">
5987           <jframeID thread="thread"/>
5988           <description>
5989             The depth of the frame containing the variable's value.
5990           </description>
5991         </param>
5992         <param id="slot">
5993           <jint/>
5994           <description>
5995             The variable's slot number.
5996           </description>
5997         </param>
5998         <param id="value">
5999           <jobject/>
6000             <description>
6001               The new value for the variable.
6002             </description>
6003         </param>
6004       </parameters>
6005       <errors>
6006         <error id="JVMTI_ERROR_INVALID_SLOT">
6007           Invalid <code>slot</code>.
6008         </error>
6009         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6010           The variable type is not
6011           <code>Object</code> or a subclass of <code>Object</code>.
6012         </error>
6013         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6014           The supplied <paramlink id="value"/> is not compatible
6015           with the variable type.
6016         </error>
6017         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6018           Not a visible frame
6019         </error>
6020       </errors>
6021     </function>
6022 
6023     <function id="SetLocalInt" num="27">
6024       <synopsis>Set Local Variable - Int</synopsis>
6025       <description>
6026         This function can be used to set the value of a local
6027         variable whose type is <code>int</code>,
6028         <code>short</code>, <code>char</code>, <code>byte</code>, or
6029         <code>boolean</code>.
6030       </description>
6031       <origin>jvmdi</origin>
6032       <capabilities>
6033         <required id="can_access_local_variables"></required>
6034       </capabilities>
6035       <parameters>
6036         <param id="thread">
6037           <jthread null="current" frame="frame"/>
6038           <description>
6039             The thread of the frame containing the variable's value.
6040           </description>
6041         </param>
6042         <param id="depth">
6043           <jframeID thread="thread"/>
6044           <description>
6045             The depth of the frame containing the variable's value.
6046           </description>
6047         </param>
6048         <param id="slot">
6049           <jint/>
6050           <description>
6051             The variable's slot number.
6052           </description>
6053         </param>
6054         <param id="value">
6055           <jint/>
6056           <description>
6057             The new value for the variable.
6058           </description>
6059         </param>
6060       </parameters>
6061       <errors>
6062         <error id="JVMTI_ERROR_INVALID_SLOT">
6063           Invalid <code>slot</code>.
6064         </error>
6065         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6066           The variable type is not
6067           <code>int</code>, <code>short</code>,
6068           <code>char</code>, <code>byte</code>, or
6069           <code>boolean</code>.
6070         </error>
6071         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6072           Not a visible frame
6073         </error>
6074       </errors>
6075     </function>
6076 
6077     <function id="SetLocalLong" num="28">
6078       <synopsis>Set Local Variable - Long</synopsis>
6079       <description>
6080         This function can be used to set the value of a local
6081         variable whose type is <code>long</code>.
6082       </description>
6083       <origin>jvmdi</origin>
6084       <capabilities>
6085         <required id="can_access_local_variables"></required>
6086       </capabilities>
6087       <parameters>
6088         <param id="thread">
6089           <jthread null="current" frame="frame"/>
6090           <description>
6091             The thread of the frame containing the variable's value.
6092           </description>
6093         </param>
6094         <param id="depth">
6095           <jframeID thread="thread"/>
6096           <description>
6097             The depth of the frame containing the variable's value.
6098           </description>
6099         </param>
6100         <param id="slot">
6101           <jint/>
6102           <description>
6103             The variable's slot number.
6104           </description>
6105         </param>
6106         <param id="value">
6107           <jlong/>
6108           <description>
6109             The new value for the variable.
6110           </description>
6111         </param>
6112       </parameters>
6113       <errors>
6114         <error id="JVMTI_ERROR_INVALID_SLOT">
6115           Invalid <code>slot</code>.
6116         </error>
6117         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6118           The variable type is not <code>long</code>.
6119         </error>
6120         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6121           Not a visible frame
6122         </error>
6123       </errors>
6124     </function>
6125 
6126     <function id="SetLocalFloat" num="29">
6127       <synopsis>Set Local Variable - Float</synopsis>
6128       <description>
6129         This function can be used to set the value of a local
6130         variable whose type is <code>float</code>.
6131       </description>
6132       <origin>jvmdi</origin>
6133       <capabilities>
6134         <required id="can_access_local_variables"></required>
6135       </capabilities>
6136       <parameters>
6137         <param id="thread">
6138           <jthread null="current" frame="frame"/>
6139           <description>
6140             The thread of the frame containing the variable's value.
6141           </description>
6142         </param>
6143         <param id="depth">
6144           <jframeID thread="thread"/>
6145           <description>
6146             The depth of the frame containing the variable's value.
6147           </description>
6148         </param>
6149         <param id="slot">
6150           <jint/>
6151           <description>
6152             The variable's slot number.
6153           </description>
6154         </param>
6155         <param id="value">
6156           <jfloat/>
6157           <description>
6158             The new value for the variable.
6159           </description>
6160         </param>
6161       </parameters>
6162       <errors>
6163         <error id="JVMTI_ERROR_INVALID_SLOT">
6164           Invalid <code>slot</code>.
6165         </error>
6166         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6167           The variable type is not <code>float</code>.
6168         </error>
6169         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6170           Not a visible frame
6171         </error>
6172       </errors>
6173     </function>
6174 
6175     <function id="SetLocalDouble" num="30">
6176       <synopsis>Set Local Variable - Double</synopsis>
6177       <description>
6178         This function can be used to set the value of a local
6179         variable whose type is <code>double</code>.
6180       </description>
6181       <origin>jvmdi</origin>
6182       <capabilities>
6183         <required id="can_access_local_variables"></required>
6184       </capabilities>
6185       <parameters>
6186         <param id="thread">
6187           <jthread null="current" frame="frame"/>
6188           <description>
6189             The thread of the frame containing the variable's value.
6190           </description>
6191         </param>
6192         <param id="depth">
6193           <jframeID thread="thread"/>
6194           <description>
6195             The depth of the frame containing the variable's value.
6196           </description>
6197         </param>
6198         <param id="slot">
6199           <jint/>
6200           <description>
6201             The variable's slot number.
6202           </description>
6203         </param>
6204         <param id="value">
6205           <jdouble/>
6206           <description>
6207             The new value for the variable.
6208           </description>
6209         </param>
6210       </parameters>
6211       <errors>
6212         <error id="JVMTI_ERROR_INVALID_SLOT">
6213           Invalid <code>slot</code>.
6214         </error>
6215         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6216           The variable type is not <code>double</code>.
6217         </error>
6218         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6219           Not a visible frame
6220         </error>
6221       </errors>
6222     </function>
6223   </category>
6224 
6225   <category id="breakpointCategory" label="Breakpoint">
6226 
6227     <intro>
6228     </intro>
6229 
6230     <function id="SetBreakpoint" num="38">
6231       <synopsis>Set Breakpoint</synopsis>
6232       <description>
6233         Set a breakpoint at the instruction indicated by
6234         <code>method</code> and <code>location</code>.
6235         An instruction can only have one breakpoint.
6236         <p/>
6237         Whenever the designated instruction is about to be executed, a
6238         <eventlink id="Breakpoint"></eventlink> event is generated.
6239       </description>
6240       <origin>jvmdi</origin>
6241       <capabilities>
6242         <required id="can_generate_breakpoint_events"></required>
6243       </capabilities>
6244       <parameters>
6245         <param id="klass">
6246           <jclass method="method"/>
6247             <description>
6248               The class in which to set the breakpoint
6249             </description>
6250         </param>
6251         <param id="method">
6252           <jmethodID class="klass"/>
6253             <description>
6254               The method in which to set the breakpoint
6255             </description>
6256         </param>
6257         <param id="location">
6258           <jlocation/>
6259           <description>
6260             the index of the instruction at which to set the breakpoint
6261 
6262           </description>
6263         </param>
6264       </parameters>
6265       <errors>
6266         <error id="JVMTI_ERROR_DUPLICATE">
6267           The designated bytecode already has a breakpoint.
6268         </error>
6269       </errors>
6270     </function>
6271 
6272     <function id="ClearBreakpoint" num="39">
6273       <synopsis>Clear Breakpoint</synopsis>
6274       <description>
6275         Clear the breakpoint at the bytecode indicated by
6276         <code>method</code> and <code>location</code>.
6277       </description>
6278       <origin>jvmdi</origin>
6279       <capabilities>
6280         <required id="can_generate_breakpoint_events"></required>
6281       </capabilities>
6282       <parameters>
6283         <param id="klass">
6284           <jclass method="method"/>
6285             <description>
6286               The class in which to clear the breakpoint
6287             </description>
6288         </param>
6289         <param id="method">
6290           <jmethodID class="klass"/>
6291             <description>
6292               The method in which to clear the breakpoint
6293             </description>
6294         </param>
6295         <param id="location">
6296           <jlocation/>
6297           <description>
6298             the index of the instruction at which to clear the breakpoint
6299           </description>
6300         </param>
6301       </parameters>
6302       <errors>
6303         <error id="JVMTI_ERROR_NOT_FOUND">
6304           There's no breakpoint at the designated bytecode.
6305         </error>
6306       </errors>
6307     </function>
6308 
6309   </category>
6310 
6311   <category id="fieldWatch" label="Watched Field">
6312 
6313     <intro>
6314     </intro>
6315 
6316     <function id="SetFieldAccessWatch" num="41">
6317       <synopsis>Set Field Access Watch</synopsis>
6318       <description>
6319         Generate a <eventlink id="FieldAccess"></eventlink> event
6320         when the field specified
6321         by <code>klass</code> and
6322         <code>field</code> is about to be accessed.
6323         An event will be generated for each access of the field
6324         until it is canceled with
6325         <functionlink id="ClearFieldAccessWatch"></functionlink>.
6326         Field accesses from Java programming language code or from JNI code are watched,
6327         fields modified by other means are not watched.
6328         Note that <jvmti/> users should be aware that their own field accesses
6329         will trigger the watch.
6330         A field can only have one field access watch set.
6331         Modification of a field is not considered an access--use
6332         <functionlink id="SetFieldModificationWatch"></functionlink>
6333         to monitor modifications.
6334       </description>
6335       <origin>jvmdi</origin>
6336       <capabilities>
6337         <required id="can_generate_field_access_events"></required>
6338       </capabilities>
6339       <parameters>
6340         <param id="klass">
6341           <jclass field="field"/>
6342             <description>
6343               The class containing the field to watch
6344             </description>
6345         </param>
6346         <param id="field">
6347           <jfieldID class="klass"/>
6348             <description>
6349               The field to watch
6350 
6351             </description>
6352         </param>
6353       </parameters>
6354       <errors>
6355         <error id="JVMTI_ERROR_DUPLICATE">
6356           The designated field is already being watched for accesses.
6357         </error>
6358       </errors>
6359     </function>
6360 
6361     <function id="ClearFieldAccessWatch" num="42">
6362       <synopsis>Clear Field Access Watch</synopsis>
6363       <description>
6364         Cancel a field access watch previously set by
6365         <functionlink id="SetFieldAccessWatch"></functionlink>, on the
6366         field specified
6367         by <code>klass</code> and
6368         <code>field</code>.
6369       </description>
6370       <origin>jvmdi</origin>
6371       <capabilities>
6372         <required id="can_generate_field_access_events"></required>
6373       </capabilities>
6374       <parameters>
6375         <param id="klass">
6376           <jclass field="field"/>
6377             <description>
6378               The class containing the field to watch
6379             </description>
6380         </param>
6381         <param id="field">
6382           <jfieldID class="klass"/>
6383             <description>
6384               The field to watch
6385 
6386             </description>
6387         </param>
6388       </parameters>
6389       <errors>
6390         <error id="JVMTI_ERROR_NOT_FOUND">
6391           The designated field is not being watched for accesses.
6392         </error>
6393       </errors>
6394     </function>
6395 
6396     <function id="SetFieldModificationWatch" num="43">
6397       <synopsis>Set Field Modification Watch</synopsis>
6398       <description>
6399         Generate a <eventlink id="FieldModification"></eventlink> event
6400         when the field specified
6401         by <code>klass</code> and
6402         <code>field</code> is about to be modified.
6403         An event will be generated for each modification of the field
6404         until it is canceled with
6405         <functionlink id="ClearFieldModificationWatch"></functionlink>.
6406         Field modifications from Java programming language code or from JNI code are watched,
6407         fields modified by other means are not watched.
6408         Note that <jvmti/> users should be aware that their own field modifications
6409         will trigger the watch.
6410         A field can only have one field modification watch set.
6411       </description>
6412       <origin>jvmdi</origin>
6413       <capabilities>
6414         <required id="can_generate_field_modification_events"></required>
6415       </capabilities>
6416       <parameters>
6417         <param id="klass">
6418           <jclass field="field"/>
6419             <description>
6420               The class containing the field to watch
6421             </description>
6422         </param>
6423         <param id="field">
6424           <jfieldID class="klass"/>
6425             <description>
6426               The field to watch
6427 
6428             </description>
6429         </param>
6430       </parameters>
6431       <errors>
6432         <error id="JVMTI_ERROR_DUPLICATE">
6433           The designated field is already being watched for modifications.
6434         </error>
6435       </errors>
6436     </function>
6437 
6438     <function id="ClearFieldModificationWatch" num="44">
6439       <synopsis>Clear Field Modification Watch</synopsis>
6440       <description>
6441 
6442         Cancel a field modification watch previously set by
6443         <functionlink id="SetFieldModificationWatch"></functionlink>, on the
6444         field specified
6445         by <code>klass</code> and
6446         <code>field</code>.
6447       </description>
6448       <origin>jvmdi</origin>
6449       <capabilities>
6450         <required id="can_generate_field_modification_events"></required>
6451       </capabilities>
6452       <parameters>
6453         <param id="klass">
6454           <jclass field="field"/>
6455             <description>
6456               The class containing the field to watch
6457             </description>
6458         </param>
6459         <param id="field">
6460           <jfieldID class="klass"/>
6461             <description>
6462               The field to watch
6463 
6464             </description>
6465         </param>
6466       </parameters>
6467       <errors>
6468         <error id="JVMTI_ERROR_NOT_FOUND">
6469           The designated field is not being watched for modifications.
6470         </error>
6471       </errors>
6472     </function>
6473   </category>
6474 
6475   <category id="module" label="Module">
6476 
6477     <intro>
6478     </intro>
6479 
6480     <function id="GetAllModules" num="3" since="9">
6481       <synopsis>Get All Modules</synopsis>
6482       <description>
6483         Return an array of all modules loaded in the virtual machine.
6484         The array includes the unnamed module for each class loader.
6485         The number of modules in the array is returned via
6486         <code>module_count_ptr</code>, and the array itself via
6487         <code>modules_ptr</code>.
6488         <p/>
6489       </description>
6490       <origin>new</origin>
6491       <capabilities>
6492       </capabilities>
6493       <parameters>
6494         <param id="module_count_ptr">
6495           <outptr><jint/></outptr>
6496           <description>
6497             On return, points to the number of returned modules.
6498           </description>
6499         </param>
6500         <param id="modules_ptr">
6501           <allocbuf outcount="module_count_ptr"><jobject/></allocbuf>
6502             <description>
6503               On return, points to an array of references, one
6504               for each module.
6505             </description>
6506         </param>
6507       </parameters>
6508       <errors>
6509       </errors>
6510     </function>
6511 
6512     <function id="GetNamedModule" num="40" since="9">
6513       <synopsis>Get Named Module</synopsis>
6514       <description>
6515         Return the <code>java.lang.Module</code> object for a named
6516         module defined to a class loader that contains a given package.
6517         The module is returned via <code>module_ptr</code>.
6518         <p/>
6519         If a named module is defined to the class loader and it
6520         contains the package then that named module is returned,
6521         otherwise <code>NULL</code> is returned.
6522         <p/>
6523       </description>
6524       <origin>new</origin>
6525       <capabilities>
6526       </capabilities>
6527       <parameters>
6528         <param id="class_loader">
6529           <ptrtype>
6530             <jobject/>
6531             <nullok>the bootstrap loader is assumed</nullok>
6532           </ptrtype>
6533           <description>
6534             A class loader.
6535             If the <code>class_loader</code> is not <code>NULL</code>
6536             or a subclass of <code>java.lang.ClassLoader</code>
6537             this function returns
6538             <errorlink id="JVMTI_ERROR_ILLEGAL_ARGUMENT"></errorlink>.
6539           </description>
6540         </param>
6541         <param id="package_name">
6542           <inbuf><char/></inbuf>
6543           <description>
6544             The name of the package, encoded as a
6545             <internallink id="mUTF">modified UTF-8</internallink> string.
6546             The package name is in internal form (JVMS 4.2.1);
6547             identifiers are separated by forward slashes rather than periods.
6548           </description>
6549         </param>
6550         <param id="module_ptr">
6551           <outptr><jobject/></outptr>
6552           <description>
6553             On return, points to a <code>java.lang.Module</code> object
6554             or points to <code>NULL</code>.
6555           </description>
6556         </param>
6557       </parameters>
6558       <errors>
6559         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6560           If class loader is not <code>NULL</code> and is not a class loader object.
6561         </error>
6562       </errors>
6563     </function>
6564 
6565     <function id="AddModuleReads" num="94" since="9">
6566       <synopsis>Add Module Reads</synopsis>
6567       <description>
6568          Update a module to read another module. This function is a no-op
6569          when <paramlink id="module"></paramlink> is an unnamed module.
6570          This function facilitates the instrumentation of code
6571          in named modules where that instrumentation requires
6572          expanding the set of modules that a module reads.
6573       </description>
6574       <origin>new</origin>
6575       <capabilities>
6576       </capabilities>
6577       <parameters>
6578         <param id="module">
6579           <ptrtype><jobject/></ptrtype>
6580           <description>
6581             The module to update.
6582           </description>
6583         </param>
6584         <param id="to_module">
6585           <ptrtype><jobject/></ptrtype>
6586           <description>
6587             The additional module to read.
6588           </description>
6589         </param>
6590       </parameters>
6591       <errors>
6592         <error id="JVMTI_ERROR_INVALID_MODULE">
6593           If <paramlink id="module"></paramlink> is not a module object.
6594         </error>
6595         <error id="JVMTI_ERROR_INVALID_MODULE">
6596           If <paramlink id="to_module"></paramlink> is not a module object.
6597         </error>
6598         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6599           if the module cannot be modified.
6600           See <functionlink id="IsModifiableModule"/>.
6601         </error>
6602       </errors>
6603     </function>
6604 
6605     <function id="AddModuleExports" num="95" since="9">
6606       <synopsis>Add Module Exports</synopsis>
6607       <description>
6608          Update a module to export a package to another module.
6609          This function is a no-op when <paramlink id="module"></paramlink>
6610          is an unnamed module or an open module.
6611          This function facilitates the instrumentation of code
6612          in named modules where that instrumentation requires
6613          expanding the set of packages that a module exports.
6614       </description>
6615       <origin>new</origin>
6616       <capabilities>
6617       </capabilities>
6618       <parameters>
6619         <param id="module">
6620           <ptrtype><jobject/></ptrtype>
6621           <description>
6622             The module to update.
6623           </description>
6624         </param>
6625         <param id="pkg_name">
6626           <inbuf><char/></inbuf>
6627           <description>
6628             The exported package name.
6629           </description>
6630         </param>
6631         <param id="to_module">
6632           <ptrtype><jobject/></ptrtype>
6633           <description>
6634             The module the package is exported to.
6635             If the <code>to_module</code> is not a subclass of
6636             <code>java.lang.Module</code> this function returns
6637             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6638           </description>
6639         </param>
6640       </parameters>
6641       <errors>
6642         <error id="JVMTI_ERROR_INVALID_MODULE">
6643           If <paramlink id="module"></paramlink> is not a module object.
6644         </error>
6645         <error id="JVMTI_ERROR_INVALID_MODULE">
6646           If <paramlink id="to_module"></paramlink> is not a module object.
6647         </error>
6648         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6649           If the package <paramlink id="pkg_name"></paramlink>
6650           does not belong to the module.
6651         </error>
6652         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6653           if the module cannot be modified.
6654           See <functionlink id="IsModifiableModule"/>.
6655         </error>
6656       </errors>
6657     </function>
6658 
6659     <function id="AddModuleOpens" num="96" since="9">
6660       <synopsis>Add Module Opens</synopsis>
6661       <description>
6662          Update a module to open a package to another module.
6663          This function is a no-op when <paramlink id="module"></paramlink>
6664          is an unnamed module or an open module.
6665          This function facilitates the instrumentation of code
6666          in modules where that instrumentation requires
6667          expanding the set of packages that a module opens to
6668          other modules.
6669       </description>
6670       <origin>new</origin>
6671       <capabilities>
6672       </capabilities>
6673       <parameters>
6674         <param id="module">
6675           <ptrtype><jobject/></ptrtype>
6676           <description>
6677             The module to update.
6678           </description>
6679         </param>
6680         <param id="pkg_name">
6681           <inbuf><char/></inbuf>
6682           <description>
6683             The package name of the package to open.
6684           </description>
6685         </param>
6686         <param id="to_module">
6687           <ptrtype><jobject/></ptrtype>
6688           <description>
6689             The module with the package to open.
6690             If the <code>to_module</code> is not a subclass of
6691             <code>java.lang.Module</code> this function returns
6692             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6693           </description>
6694         </param>
6695       </parameters>
6696       <errors>
6697         <error id="JVMTI_ERROR_INVALID_MODULE">
6698           If <paramlink id="module"></paramlink> is not a module object.
6699         </error>
6700         <error id="JVMTI_ERROR_INVALID_MODULE">
6701           If <paramlink id="to_module"></paramlink> is not a module object.
6702         </error>
6703         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6704           If the package <paramlink id="pkg_name"></paramlink>
6705           does not belong to the module.
6706         </error>
6707         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6708           if the module cannot be modified.
6709           See <functionlink id="IsModifiableModule"/>.
6710         </error>
6711       </errors>
6712     </function>
6713 
6714     <function id="AddModuleUses" num="97" since="9">
6715       <synopsis>Add Module Uses</synopsis>
6716       <description>
6717          Updates a module to add a service to the set of services that
6718          a module uses. This function is a no-op when the module
6719          is an unnamed module.
6720          This function facilitates the instrumentation of code
6721          in named modules where that instrumentation requires
6722          expanding the set of services that a module is using.
6723       </description>
6724       <origin>new</origin>
6725       <capabilities>
6726       </capabilities>
6727       <parameters>
6728         <param id="module">
6729           <ptrtype><jobject/></ptrtype>
6730           <description>
6731             The module to update.
6732           </description>
6733         </param>
6734         <param id="service">
6735           <ptrtype><jclass/></ptrtype>
6736           <description>
6737             The service to use.
6738           </description>
6739         </param>
6740       </parameters>
6741       <errors>
6742         <error id="JVMTI_ERROR_INVALID_MODULE">
6743           If <paramlink id="module"></paramlink> is not a module object.
6744         </error>
6745         <error id="JVMTI_ERROR_INVALID_CLASS">
6746           If <paramlink id="service"></paramlink> is not a class object.
6747         </error>
6748         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6749           if the module cannot be modified.
6750           See <functionlink id="IsModifiableModule"/>.
6751         </error>
6752       </errors>
6753     </function>
6754 
6755     <function id="AddModuleProvides" num="98" since="9">
6756       <synopsis>Add Module Provides</synopsis>
6757       <description>
6758          Updates a module to add a service to the set of services that
6759          a module provides. This function is a no-op when the module
6760          is an unnamed module.
6761          This function facilitates the instrumentation of code
6762          in named modules where that instrumentation requires
6763          changes to the services that are provided.
6764       </description>
6765       <origin>new</origin>
6766       <capabilities>
6767       </capabilities>
6768       <parameters>
6769         <param id="module">
6770           <ptrtype><jobject/></ptrtype>
6771           <description>
6772             The module to update.
6773           </description>
6774         </param>
6775         <param id="service">
6776           <ptrtype><jclass/></ptrtype>
6777           <description>
6778             The service to provide.
6779           </description>
6780         </param>
6781         <param id="impl_class">
6782           <ptrtype><jclass/></ptrtype>
6783           <description>
6784             The implementation class for the provided service.
6785           </description>
6786         </param>
6787       </parameters>
6788       <errors>
6789         <error id="JVMTI_ERROR_INVALID_MODULE">
6790           If <paramlink id="module"></paramlink> is not a module object.
6791         </error>
6792         <error id="JVMTI_ERROR_INVALID_CLASS">
6793           If <paramlink id="service"></paramlink> is not a class object.
6794         </error>
6795         <error id="JVMTI_ERROR_INVALID_CLASS">
6796           If <paramlink id="impl_class"></paramlink> is not a class object.
6797         </error>
6798         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6799           if the module cannot be modified.
6800           See <functionlink id="IsModifiableModule"/>.
6801         </error>
6802       </errors>
6803     </function>
6804 
6805     <function id="IsModifiableModule" num="99" since="9">
6806       <synopsis>Is Modifiable Module</synopsis>
6807       <description>
6808         Determines whether a module is modifiable.
6809         If a module is modifiable then this module can be updated with
6810         <functionlink id="AddModuleReads"/>, <functionlink id="AddModuleExports"/>,
6811         <functionlink id="AddModuleOpens"/>, <functionlink id="AddModuleUses"/>,
6812         and <functionlink id="AddModuleProvides"/>. If a module is not modifiable
6813         then the module can not be updated with these functions. The result of
6814         this function is always <code>JNI_TRUE</code> when called to determine
6815         if an unnamed module is modifiable.
6816       </description>
6817       <origin>new</origin>
6818       <capabilities>
6819       </capabilities>
6820       <parameters>
6821         <param id="module">
6822           <ptrtype><jobject/></ptrtype>
6823           <description>
6824             The module to query.
6825           </description>
6826         </param>
6827         <param id="is_modifiable_module_ptr">
6828           <outptr><jboolean/></outptr>
6829           <description>
6830             On return, points to the boolean result of this function.
6831           </description>
6832         </param>
6833       </parameters>
6834       <errors>
6835         <error id="JVMTI_ERROR_INVALID_MODULE">
6836           If <paramlink id="module"></paramlink> is not a module object.
6837         </error>
6838       </errors>
6839     </function>
6840 
6841   </category>
6842 
6843   <category id="class" label="Class">
6844 
6845     <intro>
6846     </intro>
6847 
6848     <function id="GetLoadedClasses" jkernel="yes" num="78">
6849       <synopsis>Get Loaded Classes</synopsis>
6850       <description>
6851         Return an array of all classes loaded in the virtual machine.
6852         The number of classes in the array is returned via
6853         <code>class_count_ptr</code>, and the array itself via
6854         <code>classes_ptr</code>.
6855         <p/>
6856         Array classes of all types (including arrays of primitive types) are
6857         included in the returned list. Primitive classes (for example,
6858         <code>java.lang.Integer.TYPE</code>) are <i>not</i> included in this list.
6859       </description>
6860       <origin>jvmdi</origin>
6861       <capabilities>
6862       </capabilities>
6863       <parameters>
6864         <param id="class_count_ptr">
6865           <outptr><jint/></outptr>
6866           <description>
6867             On return, points to the number of classes.
6868           </description>
6869         </param>
6870         <param id="classes_ptr">
6871           <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
6872             <description>
6873               On return, points to an array of references, one
6874               for each class.
6875             </description>
6876         </param>
6877       </parameters>
6878       <errors>
6879       </errors>
6880     </function>
6881 
6882     <function id="GetClassLoaderClasses" jkernel="yes" num="79">
6883       <synopsis>Get Classloader Classes</synopsis>
6884       <description>
6885         Returns an array of those classes for which this class loader has
6886         been recorded as an initiating loader. Each
6887         class in the returned array was created by this class loader,
6888         either by defining it directly or by delegation to another class loader.
6889         See <vmspec chapter="5.3"/>.
6890         <p/>
6891         The number of classes in the array is returned via
6892         <code>class_count_ptr</code>, and the array itself via
6893         <code>classes_ptr</code>.
6894       </description>
6895       <origin>jvmdi</origin>
6896       <capabilities>
6897       </capabilities>
6898       <parameters>
6899         <param id="initiating_loader">
6900           <ptrtype>
6901             <jobject/>
6902             <nullok>the classes initiated by the bootstrap loader will be returned</nullok>
6903           </ptrtype>
6904             <description>
6905               An initiating class loader.
6906             </description>
6907         </param>
6908         <param id="class_count_ptr">
6909           <outptr><jint/></outptr>
6910           <description>
6911             On return, points to the number of classes.
6912           </description>
6913         </param>
6914         <param id="classes_ptr">
6915           <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
6916             <description>
6917               On return, points to an array of references, one
6918               for each class.
6919             </description>
6920         </param>
6921       </parameters>
6922       <errors>
6923       </errors>
6924     </function>
6925 
6926     <function id="GetClassSignature" phase="start" num="48">
6927       <synopsis>Get Class Signature</synopsis>
6928       <description>
6929         For the class indicated by <code>klass</code>, return the
6930         <externallink id="jni/types.html#type-signatures">JNI
6931             type signature</externallink>
6932         and the generic signature of the class.
6933         For example, <code>java.util.List</code> is <code>"Ljava/util/List;"</code>
6934         and <code>int[]</code> is <code>"[I"</code>
6935         The returned name for primitive classes
6936         is the type signature character of the corresponding primitive type.
6937         For example, <code>java.lang.Integer.TYPE</code> is <code>"I"</code>.
6938       </description>
6939       <origin>jvmdiClone</origin>
6940       <capabilities>
6941       </capabilities>
6942       <parameters>
6943         <param id="klass">
6944           <jclass/>
6945             <description>
6946               The class to query.
6947             </description>
6948         </param>
6949         <param id="signature_ptr">
6950           <allocbuf>
6951             <char/>
6952             <nullok>the signature is not returned</nullok>
6953           </allocbuf>
6954           <description>
6955             On return, points to the JNI type signature of the class, encoded as a
6956             <internallink id="mUTF">modified UTF-8</internallink> string.
6957           </description>
6958         </param>
6959         <param id="generic_ptr">
6960           <allocbuf>
6961             <char/>
6962             <nullok>the generic signature is not returned</nullok>
6963           </allocbuf>
6964           <description>
6965             On return, points to the generic signature of the class, encoded as a
6966             <internallink id="mUTF">modified UTF-8</internallink> string.
6967             If there is no generic signature attribute for the class, then,
6968             on return, points to <code>NULL</code>.
6969           </description>
6970         </param>
6971       </parameters>
6972       <errors>
6973       </errors>
6974     </function>
6975 
6976     <function id="GetClassStatus" phase="start" num="49">
6977       <synopsis>Get Class Status</synopsis>
6978       <description>
6979         Get the status of the class. Zero or more of the following bits can be
6980         set.
6981         <constants id="jvmtiClassStatus" label="Class Status Flags" kind="bits">
6982           <constant id="JVMTI_CLASS_STATUS_VERIFIED" num="1">
6983             Class bytecodes have been verified
6984           </constant>
6985           <constant id="JVMTI_CLASS_STATUS_PREPARED" num="2">
6986             Class preparation is complete
6987           </constant>
6988           <constant id="JVMTI_CLASS_STATUS_INITIALIZED" num="4">
6989             Class initialization is complete. Static initializer has been run.
6990           </constant>
6991           <constant id="JVMTI_CLASS_STATUS_ERROR" num="8">
6992             Error during initialization makes class unusable
6993           </constant>
6994           <constant id="JVMTI_CLASS_STATUS_ARRAY" num="16">
6995             Class is an array.  If set, all other bits are zero.
6996           </constant>
6997           <constant id="JVMTI_CLASS_STATUS_PRIMITIVE" num="32">
6998             Class is a primitive class (for example, <code>java.lang.Integer.TYPE</code>).
6999             If set, all other bits are zero.
7000           </constant>
7001         </constants>
7002       </description>
7003       <origin>jvmdi</origin>
7004       <capabilities>
7005       </capabilities>
7006       <parameters>
7007         <param id="klass">
7008           <jclass/>
7009             <description>
7010               The class to query.
7011             </description>
7012         </param>
7013         <param id="status_ptr">
7014           <outptr><jint/></outptr>
7015           <description>
7016             On return, points to the current state of this class as one or
7017             more of the <internallink id="jvmtiClassStatus">class status flags</internallink>.
7018           </description>
7019         </param>
7020       </parameters>
7021       <errors>
7022       </errors>
7023     </function>
7024 
7025     <function id="GetSourceFileName" phase="start" num="50">
7026       <synopsis>Get Source File Name</synopsis>
7027       <description>
7028         For the class indicated by <code>klass</code>, return the source file
7029         name via <code>source_name_ptr</code>. The returned string
7030         is a file name only and never contains a directory name.
7031         <p/>
7032         For primitive classes (for example, <code>java.lang.Integer.TYPE</code>)
7033         and for arrays this function returns
7034         <errorlink id="JVMTI_ERROR_ABSENT_INFORMATION"></errorlink>.
7035       </description>
7036       <origin>jvmdi</origin>
7037       <capabilities>
7038         <required id="can_get_source_file_name"></required>
7039       </capabilities>
7040       <parameters>
7041         <param id="klass">
7042           <jclass/>
7043             <description>
7044               The class to query.
7045             </description>
7046         </param>
7047         <param id="source_name_ptr">
7048           <allocbuf><char/></allocbuf>
7049           <description>
7050             On return, points to the class's source file name, encoded as a
7051             <internallink id="mUTF">modified UTF-8</internallink> string.
7052           </description>
7053         </param>
7054       </parameters>
7055       <errors>
7056         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7057           Class information does not include a source file name. This includes
7058           cases where the class is an array class or primitive class.
7059         </error>
7060       </errors>
7061     </function>
7062 
7063     <function id="GetClassModifiers" phase="start" num="51">
7064       <synopsis>Get Class Modifiers</synopsis>
7065       <description>
7066         For the class indicated by <code>klass</code>, return the access
7067         flags
7068         via <code>modifiers_ptr</code>.
7069         Access flags are defined in <vmspec chapter="4"/>.
7070         <p/>
7071         If the class is an array class, then its public, private, and protected
7072         modifiers are the same as those of its component type. For arrays of
7073         primitives, this component type is represented by one of the primitive
7074         classes (for example, <code>java.lang.Integer.TYPE</code>).
7075         <p/>
7076         If the class is a primitive class, its public modifier is always true,
7077         and its protected and private modifiers are always false.
7078         <p/>
7079         If the class is an array class or a primitive class then its final
7080         modifier is always true and its interface modifier is always false.
7081         The values of its other modifiers are not determined by this specification.
7082 
7083       </description>
7084       <origin>jvmdi</origin>
7085       <capabilities>
7086       </capabilities>
7087       <parameters>
7088         <param id="klass">
7089           <jclass/>
7090             <description>
7091               The class to query.
7092             </description>
7093         </param>
7094         <param id="modifiers_ptr">
7095           <outptr><jint/></outptr>
7096           <description>
7097             On return, points to the current access flags of this class.
7098 
7099           </description>
7100         </param>
7101       </parameters>
7102       <errors>
7103       </errors>
7104     </function>
7105 
7106     <function id="GetClassMethods" phase="start" num="52">
7107       <synopsis>Get Class Methods</synopsis>
7108       <description>
7109         For the class indicated by <code>klass</code>, return a count of
7110         methods via <code>method_count_ptr</code> and a list of
7111         method IDs via <code>methods_ptr</code>. The method list contains
7112         constructors and static initializers as well as true methods.
7113         Only directly declared methods are returned (not inherited methods).
7114         An empty method list is returned for array classes and primitive classes
7115         (for example, <code>java.lang.Integer.TYPE</code>).
7116       </description>
7117       <origin>jvmdi</origin>
7118       <capabilities>
7119         <capability id="can_maintain_original_method_order"/>
7120       </capabilities>
7121       <parameters>
7122         <param id="klass">
7123           <jclass/>
7124             <description>
7125               The class to query.
7126             </description>
7127         </param>
7128         <param id="method_count_ptr">
7129           <outptr><jint/></outptr>
7130           <description>
7131             On return, points to the number of methods declared in this class.
7132           </description>
7133         </param>
7134         <param id="methods_ptr">
7135           <allocbuf outcount="method_count_ptr"><jmethodID class="klass"/></allocbuf>
7136             <description>
7137               On return, points to the method ID array.
7138             </description>
7139         </param>
7140       </parameters>
7141       <errors>
7142         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7143           <paramlink id="klass"></paramlink> is not prepared.
7144         </error>
7145       </errors>
7146     </function>
7147 
7148     <function id="GetClassFields" phase="start" num="53">
7149       <synopsis>Get Class Fields</synopsis>
7150       <description>
7151         For the class indicated by <code>klass</code>, return a count of fields
7152         via <code>field_count_ptr</code> and a list of field IDs via
7153         <code>fields_ptr</code>.
7154         Only directly declared fields are returned (not inherited fields).
7155         Fields are returned in the order they occur in the class file.
7156         An empty field list is returned for array classes and primitive classes
7157         (for example, <code>java.lang.Integer.TYPE</code>).
7158         Use JNI to determine the length of an array.
7159       </description>
7160       <origin>jvmdi</origin>
7161       <capabilities>
7162       </capabilities>
7163       <parameters>
7164         <param id="klass">
7165           <jclass/>
7166             <description>
7167               The class to query.
7168             </description>
7169         </param>
7170         <param id="field_count_ptr">
7171           <outptr><jint/></outptr>
7172           <description>
7173             On return, points to the number of fields declared in this class.
7174           </description>
7175         </param>
7176         <param id="fields_ptr">
7177           <allocbuf outcount="field_count_ptr"><jfieldID/></allocbuf>
7178             <description>
7179               On return, points to the field ID array.
7180             </description>
7181         </param>
7182       </parameters>
7183       <errors>
7184         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7185           <paramlink id="klass"></paramlink> is not prepared.
7186         </error>
7187       </errors>
7188     </function>
7189 
7190     <function id="GetImplementedInterfaces" phase="start" num="54">
7191       <synopsis>Get Implemented Interfaces</synopsis>
7192       <description>
7193         Return the direct super-interfaces of this class. For a class, this
7194         function returns the interfaces declared in its <code>implements</code>
7195         clause. For an interface, this function returns the interfaces declared in
7196         its <code>extends</code> clause.
7197         An empty interface list is returned for array classes and primitive classes
7198         (for example, <code>java.lang.Integer.TYPE</code>).
7199       </description>
7200       <origin>jvmdi</origin>
7201       <capabilities>
7202       </capabilities>
7203       <parameters>
7204         <param id="klass">
7205           <jclass/>
7206             <description>
7207               The class to query.
7208             </description>
7209         </param>
7210         <param id="interface_count_ptr">
7211           <outptr><jint/></outptr>
7212           <description>
7213             On return, points to the number of interfaces.
7214           </description>
7215         </param>
7216         <param id="interfaces_ptr">
7217           <allocbuf outcount="interface_count_ptr"><jclass/></allocbuf>
7218             <description>
7219               On return, points to the interface array.
7220             </description>
7221         </param>
7222       </parameters>
7223       <errors>
7224         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7225           <paramlink id="klass"></paramlink> is not prepared.
7226         </error>
7227       </errors>
7228     </function>
7229 
7230     <function id="GetClassVersionNumbers" phase="start" num="145" since="1.1">
7231       <synopsis>Get Class Version Numbers</synopsis>
7232       <description>
7233         For the class indicated by <code>klass</code>,
7234         return the minor and major version numbers,
7235         as defined in
7236         <vmspec chapter="4"/>.
7237       </description>
7238       <origin>new</origin>
7239       <capabilities>
7240       </capabilities>
7241       <parameters>
7242         <param id="klass">
7243           <jclass/>
7244             <description>
7245               The class to query.
7246             </description>
7247         </param>
7248         <param id="minor_version_ptr">
7249           <outptr><jint/></outptr>
7250           <description>
7251             On return, points to the value of the
7252             <code>minor_version</code> item of the
7253             Class File Format.
7254             Note: to be consistent with the Class File Format,
7255             the minor version number is the first parameter.
7256           </description>
7257         </param>
7258         <param id="major_version_ptr">
7259           <outptr><jint/></outptr>
7260           <description>
7261             On return, points to the value of the
7262             <code>major_version</code> item of the
7263             Class File Format.
7264           </description>
7265         </param>
7266       </parameters>
7267       <errors>
7268         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7269           The class is a primitive or array class.
7270         </error>
7271       </errors>
7272     </function>
7273 
7274     <function id="GetConstantPool" phase="start" num="146" since="1.1">
7275       <synopsis>Get Constant Pool</synopsis>
7276       <description>
7277         For the class indicated by <code>klass</code>,
7278         return the raw bytes of the constant pool in the format of the
7279         <code>constant_pool</code> item of
7280         <vmspec chapter="4"/>.
7281         The format of the constant pool may differ between versions
7282         of the Class File Format, so, the
7283         <functionlink id="GetClassVersionNumbers">minor and major
7284         class version numbers</functionlink> should be checked for
7285         compatibility.
7286         <p/>
7287         The returned constant pool might not have the same layout or
7288         contents as the constant pool in the defining class file.
7289         The constant pool returned by GetConstantPool() may have
7290         more or fewer entries than the defining constant pool.
7291         Entries may be in a different order.
7292         The constant pool returned by GetConstantPool() will match the
7293         constant pool used by
7294         <functionlink id="GetBytecodes">GetBytecodes()</functionlink>.
7295         That is, the bytecodes returned by GetBytecodes() will have
7296         constant pool indices which refer to constant pool entries returned
7297         by GetConstantPool().
7298         Note that since <functionlink id="RetransformClasses"/>
7299         and <functionlink id="RedefineClasses"/> can change
7300         the constant pool, the constant pool returned by this function
7301         can change accordingly.  Thus, the correspondence between
7302         GetConstantPool() and GetBytecodes() does not hold if there
7303         is an intervening class retransformation or redefinition.
7304         The value of a constant pool entry used by a given bytecode will
7305         match that of the defining class file (even if the indices don't match).
7306         Constant pool entries which are not used directly or indirectly by
7307         bytecodes (for example,  UTF-8 strings associated with annotations) are
7308         not  required to exist in the returned constant pool.
7309       </description>
7310       <origin>new</origin>
7311       <capabilities>
7312         <required id="can_get_constant_pool"></required>
7313       </capabilities>
7314       <parameters>
7315         <param id="klass">
7316           <jclass/>
7317             <description>
7318               The class to query.
7319             </description>
7320         </param>
7321         <param id="constant_pool_count_ptr">
7322           <outptr><jint/></outptr>
7323           <description>
7324             On return, points to the number of entries
7325             in the constant pool table plus one.
7326             This corresponds to the <code>constant_pool_count</code>
7327             item of the Class File Format.
7328           </description>
7329         </param>
7330         <param id="constant_pool_byte_count_ptr">
7331           <outptr><jint/></outptr>
7332           <description>
7333             On return, points to the number of bytes
7334             in the returned raw constant pool.
7335           </description>
7336         </param>
7337         <param id="constant_pool_bytes_ptr">
7338           <allocbuf outcount="constant_pool_byte_count_ptr"><uchar/></allocbuf>
7339             <description>
7340               On return, points to the raw constant pool, that is the bytes
7341               defined by the <code>constant_pool</code> item of the
7342               Class File Format
7343             </description>
7344         </param>
7345       </parameters>
7346       <errors>
7347         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7348           The class is a primitive or array class.
7349         </error>
7350       </errors>
7351     </function>
7352 
7353     <function id="IsInterface" phase="start" num="55">
7354       <synopsis>Is Interface</synopsis>
7355       <description>
7356         Determines whether a class object reference represents an interface.
7357         The <code>jboolean</code> result is
7358         <code>JNI_TRUE</code> if the "class" is actually an interface,
7359         <code>JNI_FALSE</code> otherwise.
7360       </description>
7361       <origin>jvmdi</origin>
7362       <capabilities>
7363       </capabilities>
7364       <parameters>
7365         <param id="klass">
7366           <jclass/>
7367             <description>
7368               The class to query.
7369             </description>
7370         </param>
7371         <param id="is_interface_ptr">
7372           <outptr><jboolean/></outptr>
7373           <description>
7374             On return, points to the boolean result of this function.
7375 
7376           </description>
7377         </param>
7378       </parameters>
7379       <errors>
7380       </errors>
7381     </function>
7382 
7383     <function id="IsArrayClass" phase="start" num="56">
7384       <synopsis>Is Array Class</synopsis>
7385       <description>
7386         Determines whether a class object reference represents an array.
7387         The <code>jboolean</code> result is
7388         <code>JNI_TRUE</code> if the class is an array,
7389         <code>JNI_FALSE</code> otherwise.
7390       </description>
7391       <origin>jvmdi</origin>
7392       <capabilities>
7393       </capabilities>
7394       <parameters>
7395         <param id="klass">
7396           <jclass/>
7397             <description>
7398               The class to query.
7399             </description>
7400         </param>
7401         <param id="is_array_class_ptr">
7402           <outptr><jboolean/></outptr>
7403           <description>
7404             On return, points to the boolean result of this function.
7405 
7406           </description>
7407         </param>
7408       </parameters>
7409       <errors>
7410       </errors>
7411     </function>
7412 
7413     <function id="IsModifiableClass" jkernel="yes" phase="start" num="45" since="1.1">
7414       <synopsis>Is Modifiable Class</synopsis>
7415       <description>
7416         Determines whether a class is modifiable.
7417         If a class is modifiable (<paramlink id="is_modifiable_class_ptr"/>
7418         returns <code>JNI_TRUE</code>) the class can be
7419         redefined with <functionlink id="RedefineClasses"/> (assuming
7420         the agent possesses the
7421         <fieldlink id="can_redefine_classes" struct="jvmtiCapabilities"/>
7422         capability) or
7423         retransformed with <functionlink id="RetransformClasses"/> (assuming
7424         the agent possesses the
7425         <fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
7426         capability).
7427         If a class is not modifiable (<paramlink id="is_modifiable_class_ptr"/>
7428         returns <code>JNI_FALSE</code>) the class can be neither
7429         redefined nor retransformed.
7430         <p/>
7431         Primitive classes (for example, <code>java.lang.Integer.TYPE</code>),
7432         array classes, and some implementation defined classes are never modifiable.
7433         <p/>
7434       </description>
7435       <origin>new</origin>
7436       <capabilities>
7437         <capability id="can_redefine_any_class">
7438           If possessed then all classes (except primitive, array, and some implementation defined
7439           classes) are modifiable with <functionlink id="RedefineClasses"/>.
7440         </capability>
7441         <capability id="can_retransform_any_class">
7442           If possessed then all classes (except primitive, array, and some implementation defined
7443           classes) are modifiable with <functionlink id="RetransformClasses"/>.
7444         </capability>
7445         <capability id="can_redefine_classes">
7446           No effect on the result of the function.
7447           But must additionally be possessed to modify the class with
7448           <functionlink id="RedefineClasses"/>.
7449         </capability>
7450         <capability id="can_retransform_classes">
7451           No effect on the result of the function.
7452           But must additionally be possessed to modify the class with
7453           <functionlink id="RetransformClasses"/>.
7454         </capability>
7455       </capabilities>
7456       <parameters>
7457         <param id="klass">
7458           <jclass/>
7459             <description>
7460               The class to query.
7461             </description>
7462         </param>
7463         <param id="is_modifiable_class_ptr">
7464           <outptr><jboolean/></outptr>
7465           <description>
7466             On return, points to the boolean result of this function.
7467           </description>
7468         </param>
7469       </parameters>
7470       <errors>
7471       </errors>
7472     </function>
7473 
7474     <function id="GetClassLoader" phase="start" num="57">
7475       <synopsis>Get Class Loader</synopsis>
7476       <description>
7477         For the class indicated by <code>klass</code>, return via
7478         <code>classloader_ptr</code> a reference to the class loader for the
7479         class.
7480       </description>
7481       <origin>jvmdi</origin>
7482       <capabilities>
7483       </capabilities>
7484       <parameters>
7485         <param id="klass">
7486           <jclass/>
7487             <description>
7488               The class to query.
7489             </description>
7490         </param>
7491         <param id="classloader_ptr">
7492           <outptr><jobject/></outptr>
7493             <description>
7494               On return, points to the class loader that loaded
7495               this class.
7496               If the class was not created by a class loader
7497               or if the class loader is the bootstrap class loader,
7498               points to <code>NULL</code>.
7499             </description>
7500         </param>
7501       </parameters>
7502       <errors>
7503       </errors>
7504 
7505     </function>
7506 
7507     <function id="GetSourceDebugExtension" phase="start" num="90">
7508       <synopsis>Get Source Debug Extension</synopsis>
7509       <description>
7510         For the class indicated by <code>klass</code>, return the debug
7511         extension via <code>source_debug_extension_ptr</code>.
7512         The returned string
7513         contains exactly the debug extension information present in the
7514         class file of <code>klass</code>.
7515       </description>
7516       <origin>jvmdi</origin>
7517       <capabilities>
7518         <required id="can_get_source_debug_extension"></required>
7519       </capabilities>
7520       <parameters>
7521         <param id="klass">
7522           <jclass/>
7523             <description>
7524               The class to query.
7525             </description>
7526         </param>
7527         <param id="source_debug_extension_ptr">
7528           <allocbuf><char/></allocbuf>
7529           <description>
7530             On return, points to the class's debug extension, encoded as a
7531             <internallink id="mUTF">modified UTF-8</internallink> string.
7532           </description>
7533         </param>
7534       </parameters>
7535       <errors>
7536         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
7537           Class information does not include a debug extension.
7538         </error>
7539       </errors>
7540     </function>
7541 
7542     <function id="RetransformClasses" jkernel="yes" num="152" since="1.1">
7543       <synopsis>Retransform Classes</synopsis>
7544       <description>
7545         This function facilitates the
7546         <internallink id="bci">bytecode instrumentation</internallink>
7547         of already loaded classes.
7548         To replace the class definition without reference to the existing
7549         bytecodes, as one might do when recompiling from source for
7550         fix-and-continue debugging, <functionlink id="RedefineClasses"/>
7551         function should be used instead.
7552         <p/>
7553         When classes are initially loaded or when they are
7554         <functionlink id="RedefineClasses">redefined</functionlink>,
7555         the initial class file bytes can be transformed with the
7556         <eventlink id="ClassFileLoadHook"/> event.
7557         This function reruns the transformation process
7558         (whether or not a transformation has previously occurred).
7559         This retransformation follows these steps:
7560         <ul>
7561           <li>starting from the initial class file bytes
7562           </li>
7563           <li>for each <fieldlink id="can_retransform_classes"
7564                      struct="jvmtiCapabilities">retransformation
7565                                                 incapable</fieldlink>
7566             agent which received a
7567             <code>ClassFileLoadHook</code> event during the previous
7568             load or redefine, the bytes it returned
7569             (via the <code>new_class_data</code> parameter)
7570             are reused as the output of the transformation;
7571             note that this is equivalent to reapplying
7572             the previous transformation, unaltered. except that
7573             the <code>ClassFileLoadHook</code> event
7574             is <b>not</b> sent to these agents
7575           </li>
7576           <li>for each <fieldlink id="can_retransform_classes"
7577                      struct="jvmtiCapabilities">retransformation
7578                                                 capable</fieldlink>
7579             agent, the <code>ClassFileLoadHook</code> event is sent,
7580             allowing a new transformation to be applied
7581           </li>
7582           <li>the transformed class file bytes are installed as the new
7583             definition of the class
7584           </li>
7585         </ul>
7586         See the <eventlink id="ClassFileLoadHook"/> event for more details.
7587         <p/>
7588         The initial class file bytes represent the bytes passed to
7589         <code>ClassLoader.defineClass</code>
7590         or <code>RedefineClasses</code> (before any transformations
7591         were applied), however they may not exactly match them.
7592         The constant pool may differ in ways described in
7593         <functionlink id="GetConstantPool"/>.
7594         Constant pool indices in the bytecodes of methods will correspond.
7595         Some attributes may not be present.
7596         Where order is not meaningful, for example the order of methods,
7597         order may not be preserved.
7598         <p/>
7599         Retransformation can cause new versions of methods to be installed.
7600         Old method versions may become
7601         <internallink id="obsoleteMethods">obsolete</internallink>
7602         The new method version will be used on new invokes.
7603         If a method has active stack frames, those active frames continue to
7604         run the bytecodes of the original method version.
7605         <p/>
7606         This function does not cause any initialization except that which
7607         would occur under the customary JVM semantics.
7608         In other words, retransforming a class does not cause its initializers to be
7609         run. The values of static fields will remain as they were
7610         prior to the call.
7611         <p/>
7612         Threads need not be suspended.
7613         <p/>
7614         All breakpoints in the class are cleared.
7615         <p/>
7616         All attributes are updated.
7617         <p/>
7618         Instances of the retransformed class are not affected -- fields retain their
7619         previous values.
7620         <functionlink id="GetTag">Tags</functionlink> on the instances are
7621         also unaffected.
7622         <p/>
7623         In response to this call, no events other than the
7624         <eventlink id="ClassFileLoadHook"/> event
7625         will be sent.
7626         <p/>
7627         The retransformation may change method bodies, the constant pool and attributes
7628         (unless explicitly prohibited).
7629         The retransformation must not add, remove or rename fields or methods, change the
7630         signatures of methods, change modifiers, or change inheritance.
7631         The retransformation must not change the <code>NestHost</code> or
7632         <code>NestMembers</code> attributes.
7633         These restrictions may be lifted in future versions.
7634         See the error return description below for information on error codes
7635         returned if an unsupported retransformation is attempted.
7636         The class file bytes are not verified or installed until they have passed
7637         through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7638         returned error code reflects the result of the transformations.
7639         If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7640         none of the classes to be retransformed will have a new definition installed.
7641         When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7642         all of the classes to be retransformed will have their new definitions installed.
7643       </description>
7644       <origin>new</origin>
7645       <capabilities>
7646         <required id="can_retransform_classes"></required>
7647         <capability id="can_retransform_any_class"></capability>
7648       </capabilities>
7649       <parameters>
7650         <param id="class_count">
7651           <jint min="0"/>
7652           <description>
7653             The number of classes to be retransformed.
7654           </description>
7655         </param>
7656         <param id="classes">
7657           <inbuf incount="class_count"><jclass/></inbuf>
7658           <description>
7659             The array of classes to be retransformed.
7660           </description>
7661         </param>
7662       </parameters>
7663       <errors>
7664         <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7665           One of the <paramlink id="classes"/> cannot be modified.
7666           See <functionlink id="IsModifiableClass"/>.
7667         </error>
7668         <error id="JVMTI_ERROR_INVALID_CLASS">
7669           One of the <paramlink id="classes"/> is not a valid class.
7670         </error>
7671         <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7672           A retransformed class file has a version number not supported by this VM.
7673         </error>
7674         <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7675           A retransformed class file is malformed (The VM would return a <code>ClassFormatError</code>).
7676         </error>
7677         <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7678           The retransformed class file definitions would lead to a circular definition
7679           (the VM would return a <code>ClassCircularityError</code>).
7680         </error>
7681         <error id="JVMTI_ERROR_FAILS_VERIFICATION">
7682           The retransformed class file bytes fail verification.
7683         </error>
7684         <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7685           The class name defined in a retransformed class file is
7686           different from the name in the old class object.
7687         </error>
7688         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7689           A retransformed class file would require adding a method.
7690         </error>
7691         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7692           A retransformed class file changes a field.
7693         </error>
7694         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7695           A direct superclass is different for a retransformed class file,
7696           or the set of directly implemented
7697           interfaces is different.
7698         </error>
7699         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7700           A retransformed class file does not declare a method
7701           declared in the old class version.
7702         </error>
7703         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED">
7704           A retransformed class file has unsupported differences in class attributes.
7705         </error>
7706         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7707           A retransformed class file has different class modifiers.
7708         </error>
7709         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7710           A method in the retransformed class file has different modifiers
7711           than its counterpart in the old class version.
7712         </error>
7713       </errors>
7714     </function>
7715 
7716     <function id="RedefineClasses" jkernel="yes" num="87">
7717       <synopsis>Redefine Classes</synopsis>
7718       <typedef id="jvmtiClassDefinition" label="Class redefinition description">
7719         <field id="klass">
7720           <jclass/>
7721             <description>
7722               Class object for this class
7723             </description>
7724         </field>
7725         <field id="class_byte_count">
7726           <jint/>
7727           <description>
7728             Number of bytes defining class (below)
7729           </description>
7730         </field>
7731         <field id="class_bytes">
7732           <inbuf incount="class_byte_count"><uchar/></inbuf>
7733           <description>
7734             Bytes defining class (in <vmspec chapter="4"/>)
7735           </description>
7736         </field>
7737       </typedef>
7738       <description>
7739         All classes given are redefined according to the definitions
7740         supplied.
7741         This function is used to replace the definition of a class
7742         with a new definition, as might be needed in fix-and-continue
7743         debugging.
7744         Where the existing class file bytes are to be transformed, for
7745         example in
7746         <internallink id="bci">bytecode instrumentation</internallink>,
7747         <functionlink id="RetransformClasses"/> should be used.
7748         <p/>
7749         Redefinition can cause new versions of methods to be installed.
7750         Old method versions may become
7751         <internallink id="obsoleteMethods">obsolete</internallink>
7752         The new method version will be used on new invokes.
7753         If a method has active stack frames, those active frames continue to
7754         run the bytecodes of the original method version.
7755         If resetting of stack frames is desired, use
7756         <functionlink id="PopFrame"></functionlink>
7757         to pop frames with obsolete method versions.
7758         <p/>
7759         This function does not cause any initialization except that which
7760         would occur under the customary JVM semantics.
7761         In other words, redefining a class does not cause its initializers to be
7762         run. The values of static fields will remain as they were
7763         prior to the call.
7764         <p/>
7765         Threads need not be suspended.
7766         <p/>
7767         All breakpoints in the class are cleared.
7768         <p/>
7769         All attributes are updated.
7770         <p/>
7771         Instances of the redefined class are not affected -- fields retain their
7772         previous values.
7773         <functionlink id="GetTag">Tags</functionlink> on the instances are
7774         also unaffected.
7775         <p/>
7776         In response to this call, the <jvmti/> event
7777         <eventlink id="ClassFileLoadHook">Class File Load Hook</eventlink>
7778         will be sent (if enabled), but no other <jvmti/> events will be sent.
7779         <p/>
7780         The redefinition may change method bodies, the constant pool and attributes
7781         (unless explicitly prohibited).
7782         The redefinition must not add, remove or rename fields or methods, change the
7783         signatures of methods, change modifiers, or change inheritance.
7784         The retransformation must not change the <code>NestHost</code> or
7785         <code>NestMembers</code> attributes.
7786         These restrictions may be lifted in future versions.
7787         See the error return description below for information on error codes
7788         returned if an unsupported redefinition is attempted.
7789         The class file bytes are not verified or installed until they have passed
7790         through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7791         returned error code reflects the result of the transformations applied
7792         to the bytes passed into <paramlink id="class_definitions"/>.
7793         If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7794         none of the classes to be redefined will have a new definition installed.
7795         When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7796         all of the classes to be redefined will have their new definitions installed.
7797       </description>
7798       <origin>jvmdi</origin>
7799       <capabilities>
7800         <required id="can_redefine_classes"></required>
7801         <capability id="can_redefine_any_class"></capability>
7802       </capabilities>
7803       <parameters>
7804         <param id="class_count">
7805           <jint min="0"/>
7806           <description>
7807             The number of classes specified in <code>class_definitions</code>
7808           </description>
7809         </param>
7810         <param id="class_definitions">
7811           <inbuf incount="class_count"><struct>jvmtiClassDefinition</struct></inbuf>
7812           <description>
7813             The array of new class definitions
7814           </description>
7815         </param>
7816       </parameters>
7817       <errors>
7818         <error id="JVMTI_ERROR_NULL_POINTER">
7819           One of <code>class_bytes</code> is <code>NULL</code>.
7820         </error>
7821         <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7822           An element of <code>class_definitions</code> cannot be modified.
7823           See <functionlink id="IsModifiableClass"/>.
7824         </error>
7825         <error id="JVMTI_ERROR_INVALID_CLASS">
7826           An element of <code>class_definitions</code> is not a valid class.
7827         </error>
7828         <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7829           A new class file has a version number not supported by this VM.
7830         </error>
7831         <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7832           A new class file is malformed (The VM would return a <code>ClassFormatError</code>).
7833         </error>
7834         <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7835           The new class file definitions would lead to a circular definition
7836           (the VM would return a <code>ClassCircularityError</code>).
7837         </error>
7838         <error id="JVMTI_ERROR_FAILS_VERIFICATION">
7839           The class bytes fail verification.
7840         </error>
7841         <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7842           The class name defined in a new class file is
7843           different from the name in the old class object.
7844         </error>
7845         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7846           A new class file would require adding a method.
7847         </error>
7848         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7849           A new class version changes a field.
7850         </error>
7851         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7852           A direct superclass is different for a new class
7853           version, or the set of directly implemented
7854           interfaces is different.
7855         </error>
7856         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7857           A new class version does not declare a method
7858           declared in the old class version.
7859         </error>
7860         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED">
7861           A new class version has unsupported differences in class attributes.
7862         </error>
7863         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7864           A new class version has different modifiers.
7865         </error>
7866         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7867           A method in the new class version has different modifiers
7868           than its counterpart in the old class version.
7869         </error>
7870         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
7871           A module cannot be modified.
7872           See <functionlink id="IsModifiableModule"/>.
7873         </error>
7874       </errors>
7875     </function>
7876 
7877   </category>
7878 
7879   <category id="object" label="Object">
7880 
7881     <function id="GetObjectSize" jkernel="yes" phase="start" num="154">
7882       <synopsis>Get Object Size</synopsis>
7883       <description>
7884         For the object indicated by <code>object</code>,
7885         return via <code>size_ptr</code> the size of the object.
7886         This size is an implementation-specific approximation of
7887         the amount of storage consumed by this object.
7888         It may include some or all of the object's overhead, and thus
7889         is useful for comparison within an implementation but not
7890         between implementations.
7891         The estimate may change during a single invocation of the JVM.
7892       </description>
7893       <origin>new</origin>
7894       <capabilities>
7895       </capabilities>
7896       <parameters>
7897         <param id="object">
7898           <jobject/>
7899             <description>
7900               The object to query.
7901             </description>
7902         </param>
7903         <param id="size_ptr">
7904           <outptr><jlong/></outptr>
7905           <description>
7906             On return, points to the object's size in bytes.
7907           </description>
7908         </param>
7909       </parameters>
7910       <errors>
7911       </errors>
7912     </function>
7913 
7914     <function id="GetObjectHashCode" phase="start" num="58">
7915       <synopsis>Get Object Hash Code</synopsis>
7916       <description>
7917         For the object indicated by <code>object</code>,
7918         return via <code>hash_code_ptr</code> a hash code.
7919         This hash code could be used to maintain a hash table of object references,
7920         however, on some implementations this can cause significant performance
7921         impacts--in most cases
7922         <internallink id="Heap">tags</internallink>
7923         will be a more efficient means of associating information with objects.
7924         This function guarantees
7925         the same hash code value for a particular object throughout its life
7926       </description>
7927       <origin>jvmdi</origin>
7928       <capabilities>
7929       </capabilities>
7930       <parameters>
7931         <param id="object">
7932           <jobject/>
7933             <description>
7934               The object to query.
7935             </description>
7936         </param>
7937         <param id="hash_code_ptr">
7938           <outptr><jint/></outptr>
7939           <description>
7940             On return, points to the object's hash code.
7941           </description>
7942         </param>
7943       </parameters>
7944       <errors>
7945       </errors>
7946     </function>
7947 
7948     <function id="GetObjectMonitorUsage" num="59">
7949       <synopsis>Get Object Monitor Usage</synopsis>
7950       <typedef id="jvmtiMonitorUsage" label="Object monitor usage information">
7951         <field id="owner">
7952           <jthread/>
7953             <description>
7954               The thread owning this monitor, or <code>NULL</code> if unused
7955             </description>
7956         </field>
7957         <field id="entry_count">
7958           <jint/>
7959           <description>
7960             The number of times the owning thread has entered the monitor
7961           </description>
7962         </field>
7963         <field id="waiter_count">
7964           <jint/>
7965           <description>
7966             The number of threads waiting to own this monitor
7967           </description>
7968         </field>
7969         <field id="waiters">
7970           <allocfieldbuf><jthread/></allocfieldbuf>
7971             <description>
7972               The <code>waiter_count</code> waiting threads
7973             </description>
7974         </field>
7975         <field id="notify_waiter_count">
7976           <jint/>
7977           <description>
7978             The number of threads waiting to be notified by this monitor
7979           </description>
7980         </field>
7981         <field id="notify_waiters">
7982           <allocfieldbuf><jthread/></allocfieldbuf>
7983             <description>
7984               The <code>notify_waiter_count</code> threads waiting to be notified
7985             </description>
7986         </field>
7987       </typedef>
7988       <description>
7989         Get information about the object's monitor.
7990         The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure
7991         are filled in with information about usage of the monitor.
7992           <todo>
7993             Decide and then clarify suspend requirements.
7994           </todo>
7995       </description>
7996       <origin>jvmdi</origin>
7997       <capabilities>
7998         <required id="can_get_monitor_info"></required>
7999       </capabilities>
8000       <parameters>
8001         <param id="object">
8002           <jobject/>
8003             <description>
8004               The object to query.
8005             </description>
8006         </param>
8007         <param id="info_ptr">
8008           <outptr><struct>jvmtiMonitorUsage</struct></outptr>
8009           <description>
8010             On return, filled with monitor information for the
8011             specified object.
8012           </description>
8013         </param>
8014       </parameters>
8015       <errors>
8016       </errors>
8017     </function>
8018 
8019     <elide>
8020     <function id="GetObjectMonitors" num="116">
8021       <synopsis>Get Object Monitors</synopsis>
8022       <description>
8023         Return the list of object monitors.
8024         <p/>
8025         Note: details about each monitor can be examined with
8026         <functionlink id="GetObjectMonitorUsage"></functionlink>.
8027       </description>
8028       <origin>new</origin>
8029       <capabilities>
8030         <required id="can_get_monitor_info"></required>
8031       </capabilities>
8032       <parameters>
8033         <param id="monitorCnt">
8034           <outptr><jint/></outptr>
8035           <description>
8036             On return, pointer to the number
8037             of monitors returned in <code>monitors_ptr</code>.
8038           </description>
8039         </param>
8040         <param id="monitors_ptr">
8041           <allocbuf outcount="monitorCnt"><jobject/></allocbuf>
8042             <description>
8043               On return, pointer to the monitor list.
8044             </description>
8045         </param>
8046       </parameters>
8047       <errors>
8048       </errors>
8049     </function>
8050     </elide>
8051 
8052   </category>
8053 
8054   <category id="fieldCategory" label="Field">
8055 
8056     <intro>
8057     </intro>
8058 
8059     <function id="GetFieldName" phase="start" num="60">
8060       <synopsis>Get Field Name (and Signature)</synopsis>
8061       <description>
8062         For the field indicated by <paramlink id="klass"/> and <paramlink id="field"/>,
8063         return the field name via <paramlink id="name_ptr"/> and field signature via
8064         <paramlink id="signature_ptr"/>.
8065         <p/>
8066         Field signatures are defined in the
8067         <externallink id="jni/index.html">JNI Specification</externallink>
8068         and are referred to as <code>field descriptors</code> in
8069         <vmspec chapter="4.3.2"/>.
8070       </description>
8071       <origin>jvmdiClone</origin>
8072       <capabilities>
8073       </capabilities>
8074       <parameters>
8075         <param id="klass">
8076           <jclass field="field"/>
8077             <description>
8078               The class of the field to query.
8079             </description>
8080         </param>
8081         <param id="field">
8082           <jfieldID class="klass"/>
8083             <description>
8084               The field to query.
8085             </description>
8086         </param>
8087         <param id="name_ptr">
8088           <allocbuf>
8089             <char/>
8090             <nullok>the name is not returned</nullok>
8091           </allocbuf>
8092           <description>
8093             On return, points to the field name, encoded as a
8094             <internallink id="mUTF">modified UTF-8</internallink> string.
8095           </description>
8096         </param>
8097         <param id="signature_ptr">
8098           <allocbuf>
8099             <char/>
8100             <nullok>the signature is not returned</nullok>
8101           </allocbuf>
8102           <description>
8103             On return, points to the field signature, encoded as a
8104             <internallink id="mUTF">modified UTF-8</internallink> string.
8105           </description>
8106         </param>
8107         <param id="generic_ptr">
8108           <allocbuf>
8109             <char/>
8110             <nullok>the generic signature is not returned</nullok>
8111           </allocbuf>
8112           <description>
8113             On return, points to the generic signature of the field, encoded as a
8114             <internallink id="mUTF">modified UTF-8</internallink> string.
8115             If there is no generic signature attribute for the field, then,
8116             on return, points to <code>NULL</code>.
8117           </description>
8118         </param>
8119       </parameters>
8120       <errors>
8121       </errors>
8122     </function>
8123 
8124     <function id="GetFieldDeclaringClass" phase="start" num="61">
8125       <synopsis>Get Field Declaring Class</synopsis>
8126       <description>
8127         For the field indicated by <code>klass</code> and <code>field</code>
8128         return the class that defined it via <code>declaring_class_ptr</code>.
8129         The declaring class will either be <code>klass</code>, a superclass, or
8130         an implemented interface.
8131       </description>
8132       <origin>jvmdi</origin>
8133       <capabilities>
8134       </capabilities>
8135       <parameters>
8136         <param id="klass">
8137           <jclass field="field"/>
8138             <description>
8139               The class to query.
8140             </description>
8141         </param>
8142         <param id="field">
8143           <jfieldID class="klass"/>
8144             <description>
8145               The field to query.
8146             </description>
8147         </param>
8148         <param id="declaring_class_ptr">
8149           <outptr><jclass/></outptr>
8150             <description>
8151               On return, points to the declaring class
8152             </description>
8153         </param>
8154       </parameters>
8155       <errors>
8156       </errors>
8157     </function>
8158 
8159     <function id="GetFieldModifiers" phase="start" num="62">
8160       <synopsis>Get Field Modifiers</synopsis>
8161       <description>
8162         For the field indicated by <code>klass</code> and <code>field</code>
8163         return the access flags via <code>modifiers_ptr</code>.
8164         Access flags are defined in <vmspec chapter="4"/>.
8165       </description>
8166       <origin>jvmdi</origin>
8167       <capabilities>
8168       </capabilities>
8169       <parameters>
8170         <param id="klass">
8171           <jclass field="field"/>
8172             <description>
8173               The class to query.
8174             </description>
8175         </param>
8176         <param id="field">
8177           <jfieldID class="klass"/>
8178             <description>
8179               The field to query.
8180             </description>
8181         </param>
8182         <param id="modifiers_ptr">
8183           <outptr><jint/></outptr>
8184           <description>
8185             On return, points to the access flags.
8186           </description>
8187         </param>
8188       </parameters>
8189       <errors>
8190       </errors>
8191     </function>
8192 
8193     <function id="IsFieldSynthetic" phase="start" num="63">
8194       <synopsis>Is Field Synthetic</synopsis>
8195       <description>
8196         For the field indicated by <code>klass</code> and <code>field</code>, return a
8197         value indicating whether the field is synthetic via <code>is_synthetic_ptr</code>.
8198         Synthetic fields are generated by the compiler but not present in the
8199         original source code.
8200       </description>
8201       <origin>jvmdi</origin>
8202       <capabilities>
8203         <required id="can_get_synthetic_attribute"></required>
8204       </capabilities>
8205       <parameters>
8206         <param id="klass">
8207           <jclass field="field"/>
8208             <description>
8209               The class of the field to query.
8210             </description>
8211         </param>
8212         <param id="field">
8213           <jfieldID class="klass"/>
8214             <description>
8215               The field to query.
8216             </description>
8217         </param>
8218         <param id="is_synthetic_ptr">
8219           <outptr><jboolean/></outptr>
8220           <description>
8221             On return, points to the boolean result of this function.
8222           </description>
8223         </param>
8224       </parameters>
8225       <errors>
8226       </errors>
8227     </function>
8228 
8229   </category>
8230 
8231   <category id="method" label="Method">
8232 
8233     <intro>
8234       These functions provide information about a method (represented as a
8235       <typelink id="jmethodID"/>) and set how methods are processed.
8236     </intro>
8237 
8238     <intro id="obsoleteMethods" label="Obsolete Methods">
8239       The functions <functionlink id="RetransformClasses"/> and
8240       <functionlink id="RedefineClasses"/> can cause new versions
8241       of methods to be installed.
8242       An original version of a method is considered equivalent
8243       to the new version if:
8244       <ul>
8245         <li>their bytecodes are the same except for indices into the
8246           constant pool and </li>
8247         <li>the referenced constants are equal.</li>
8248       </ul>
8249       An original method version which is not equivalent to the
8250       new method version is called obsolete and is assigned a new method ID;
8251       the original method ID now refers to the new method version.
8252       A method ID can be tested for obsolescence with
8253       <functionlink id="IsMethodObsolete"/>.
8254     </intro>
8255 
8256     <function id="GetMethodName" phase="start" num="64">
8257       <synopsis>Get Method Name (and Signature)</synopsis>
8258       <description>
8259         For the method indicated by <code>method</code>,
8260         return the method name via <code>name_ptr</code> and method signature via
8261         <code>signature_ptr</code>.
8262         <p/>
8263         Method signatures are defined in the
8264         <externallink id="jni/index.html">JNI Specification</externallink>
8265         and are referred to as <code>method descriptors</code> in
8266         <vmspec chapter="4.3.3"/>.
8267         Note this is different
8268         than method signatures as defined in the <i>Java Language Specification</i>.
8269       </description>
8270       <origin>jvmdiClone</origin>
8271       <capabilities>
8272       </capabilities>
8273       <parameters>
8274         <param id="method">
8275           <jmethodID/>
8276             <description>
8277               The method to query.
8278             </description>
8279         </param>
8280         <param id="name_ptr">
8281           <allocbuf>
8282             <char/>
8283             <nullok>the name is not returned</nullok>
8284           </allocbuf>
8285           <description>
8286             On return, points to the method name, encoded as a
8287             <internallink id="mUTF">modified UTF-8</internallink> string.
8288           </description>
8289         </param>
8290         <param id="signature_ptr">
8291           <allocbuf>
8292             <char/>
8293             <nullok>the signature is not returned</nullok>
8294           </allocbuf>
8295           <description>
8296             On return, points to the method signature, encoded as a
8297             <internallink id="mUTF">modified UTF-8</internallink> string.
8298           </description>
8299         </param>
8300         <param id="generic_ptr">
8301           <allocbuf>
8302             <char/>
8303             <nullok>the generic signature is not returned</nullok>
8304           </allocbuf>
8305           <description>
8306             On return, points to the generic signature of the method, encoded as a
8307             <internallink id="mUTF">modified UTF-8</internallink> string.
8308             If there is no generic signature attribute for the method, then,
8309             on return, points to <code>NULL</code>.
8310           </description>
8311         </param>
8312       </parameters>
8313       <errors>
8314       </errors>
8315     </function>
8316 
8317     <function id="GetMethodDeclaringClass" phase="start" num="65">
8318       <synopsis>Get Method Declaring Class</synopsis>
8319       <description>
8320         For the method indicated by <code>method</code>,
8321         return the class that defined it via <code>declaring_class_ptr</code>.
8322       </description>
8323       <origin>jvmdi</origin>
8324       <capabilities>
8325       </capabilities>
8326       <parameters>
8327         <param id="klass">
8328           <jclass method="method"/>
8329             <description>
8330               The class to query.
8331             </description>
8332         </param>
8333         <param id="method">
8334           <jmethodID class="klass"/>
8335             <description>
8336               The method to query.
8337             </description>
8338         </param>
8339         <param id="declaring_class_ptr">
8340           <outptr><jclass/></outptr>
8341             <description>
8342               On return, points to the declaring class
8343             </description>
8344         </param>
8345       </parameters>
8346       <errors>
8347       </errors>
8348     </function>
8349 
8350     <function id="GetMethodModifiers" phase="start" num="66">
8351       <synopsis>Get Method Modifiers</synopsis>
8352       <description>
8353         For the method indicated by <code>method</code>,
8354         return the access flags via <code>modifiers_ptr</code>.
8355         Access flags are defined in <vmspec chapter="4"/>.
8356       </description>
8357       <origin>jvmdi</origin>
8358       <capabilities>
8359       </capabilities>
8360       <parameters>
8361         <param id="klass">
8362           <jclass method="method"/>
8363             <description>
8364               The class to query.
8365             </description>
8366         </param>
8367         <param id="method">
8368           <jmethodID class="klass"/>
8369             <description>
8370               The method to query.
8371             </description>
8372         </param>
8373         <param id="modifiers_ptr">
8374           <outptr><jint/></outptr>
8375           <description>
8376             On return, points to the access flags.
8377           </description>
8378         </param>
8379       </parameters>
8380       <errors>
8381       </errors>
8382     </function>
8383 
8384     <function id="GetMaxLocals" phase="start" num="68">
8385       <synopsis>Get Max Locals</synopsis>
8386       <description>
8387           For the method indicated by <code>method</code>,
8388           return the number of local variable slots used by the method,
8389           including the local variables used to pass parameters to the
8390           method on its invocation.
8391           <p/>
8392           See <code>max_locals</code> in <vmspec chapter="4.7.3"/>.
8393       </description>
8394       <origin>jvmdi</origin>
8395       <capabilities>
8396       </capabilities>
8397       <parameters>
8398         <param id="klass">
8399           <jclass method="method"/>
8400             <description>
8401               The class to query.
8402             </description>
8403         </param>
8404         <param id="method">
8405           <jmethodID class="klass" native="error"/>
8406             <description>
8407               The method to query.
8408             </description>
8409         </param>
8410         <param id="max_ptr">
8411           <outptr><jint/></outptr>
8412           <description>
8413             On return, points to the maximum number of local slots
8414           </description>
8415         </param>
8416       </parameters>
8417       <errors>
8418       </errors>
8419     </function>
8420 
8421     <function id="GetArgumentsSize" phase="start" num="69">
8422       <synopsis>Get Arguments Size</synopsis>
8423       <description>
8424         For the method indicated by <code>method</code>,
8425         return via <code>max_ptr</code> the number of local variable slots used
8426         by the method's arguments.
8427         Note that two-word arguments use two slots.
8428       </description>
8429       <origin>jvmdi</origin>
8430       <capabilities>
8431       </capabilities>
8432       <parameters>
8433         <param id="klass">
8434           <jclass method="method"/>
8435             <description>
8436               The class to query.
8437             </description>
8438         </param>
8439         <param id="method">
8440           <jmethodID class="klass" native="error"/>
8441             <description>
8442               The method to query.
8443             </description>
8444         </param>
8445         <param id="size_ptr">
8446           <outptr><jint/></outptr>
8447           <description>
8448             On return, points to the number of argument slots
8449           </description>
8450         </param>
8451       </parameters>
8452       <errors>
8453       </errors>
8454     </function>
8455 
8456     <function id="GetLineNumberTable" phase="start" num="70">
8457       <synopsis>Get Line Number Table</synopsis>
8458       <typedef id="jvmtiLineNumberEntry" label="Line number table entry">
8459         <field id="start_location">
8460           <jlocation/>
8461           <description>
8462             the <datalink id="jlocation"></datalink> where the line begins
8463           </description>
8464         </field>
8465         <field id="line_number">
8466           <jint/>
8467           <description>
8468             the line number
8469           </description>
8470         </field>
8471       </typedef>
8472       <description>
8473         For the method indicated by <code>method</code>,
8474         return a table of source line number entries. The size of the table is
8475         returned via <code>entry_count_ptr</code> and the table itself is
8476         returned via <code>table_ptr</code>.
8477       </description>
8478       <origin>jvmdi</origin>
8479       <capabilities>
8480         <required id="can_get_line_numbers"></required>
8481       </capabilities>
8482       <parameters>
8483         <param id="klass">
8484           <jclass method="method"/>
8485             <description>
8486               The class to query.
8487             </description>
8488         </param>
8489         <param id="method">
8490           <jmethodID class="klass" native="error"/>
8491             <description>
8492               The method to query.
8493             </description>
8494         </param>
8495         <param id="entry_count_ptr">
8496           <outptr><jint/></outptr>
8497           <description>
8498             On return, points to the number of entries in the table
8499           </description>
8500         </param>
8501         <param id="table_ptr">
8502           <allocbuf outcount="entry_count_ptr"><struct>jvmtiLineNumberEntry</struct></allocbuf>
8503           <description>
8504             On return, points to the line number table pointer.
8505           </description>
8506         </param>
8507       </parameters>
8508       <errors>
8509         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8510           Class information does not include line numbers.
8511         </error>
8512       </errors>
8513     </function>
8514 
8515     <function id="GetMethodLocation" phase="start" num="71">
8516       <synopsis>Get Method Location</synopsis>
8517       <description>
8518         For the method indicated by <code>method</code>,
8519         return the beginning and ending addresses through
8520         <code>start_location_ptr</code> and <code>end_location_ptr</code>. In a
8521         conventional bytecode indexing scheme,
8522         <code>start_location_ptr</code> will always point to zero
8523         and <code>end_location_ptr</code>
8524         will always point to the bytecode count minus one.
8525       </description>
8526       <origin>jvmdi</origin>
8527       <capabilities>
8528       </capabilities>
8529       <parameters>
8530         <param id="klass">
8531           <jclass method="method"/>
8532             <description>
8533               The class to query.
8534             </description>
8535         </param>
8536         <param id="method">
8537           <jmethodID class="klass" native="error"/>
8538             <description>
8539               The method to query.
8540             </description>
8541         </param>
8542         <param id="start_location_ptr">
8543           <outptr><jlocation/></outptr>
8544           <description>
8545             On return, points to the first location, or
8546             <code>-1</code> if location information is not available.
8547             If the information is available and
8548             <functionlink id="GetJLocationFormat"></functionlink>
8549             returns <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>
8550             then this will always be zero.
8551           </description>
8552         </param>
8553         <param id="end_location_ptr">
8554           <outptr><jlocation/></outptr>
8555           <description>
8556             On return, points to the last location,
8557             or <code>-1</code> if location information is not available.
8558           </description>
8559         </param>
8560       </parameters>
8561       <errors>
8562         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8563           Class information does not include method sizes.
8564         </error>
8565       </errors>
8566     </function>
8567 
8568     <function id="GetLocalVariableTable" num="72">
8569       <synopsis>Get Local Variable Table</synopsis>
8570       <typedef id="jvmtiLocalVariableEntry" label="Local variable table entry">
8571         <field id="start_location">
8572           <jlocation/>
8573           <description>
8574             The code array index where the local variable is first valid
8575             (that is, where it must have a value).
8576           </description>
8577         </field>
8578         <field id="length">
8579           <jint/>
8580           <description>
8581             The length of the valid section for this local variable.
8582             The last code array index where the local variable is valid
8583             is <code>start_location + length</code>.
8584           </description>
8585         </field>
8586         <field id="name">
8587           <allocfieldbuf><char/></allocfieldbuf>
8588           <description>
8589             The local variable name, encoded as a
8590             <internallink id="mUTF">modified UTF-8</internallink> string.
8591           </description>
8592         </field>
8593         <field id="signature">
8594           <allocfieldbuf><char/></allocfieldbuf>
8595           <description>
8596             The local variable's type signature, encoded as a
8597             <internallink id="mUTF">modified UTF-8</internallink> string.
8598             The signature format is the same as that defined in
8599             <vmspec chapter="4.3.2"/>.
8600           </description>
8601         </field>
8602         <field id="generic_signature">
8603           <allocfieldbuf><char/></allocfieldbuf>
8604           <description>
8605             The local variable's generic signature, encoded as a
8606             <internallink id="mUTF">modified UTF-8</internallink> string.
8607             The value of this field will be <code>NULL</code> for any local
8608             variable which does not have a generic type.
8609           </description>
8610         </field>
8611         <field id="slot">
8612           <jint/>
8613           <description>
8614             The local variable's slot.  See <internallink id="local">Local Variables</internallink>.
8615           </description>
8616         </field>
8617       </typedef>
8618       <description>
8619         Return local variable information.
8620       </description>
8621       <origin>jvmdiClone</origin>
8622       <capabilities>
8623         <required id="can_access_local_variables"></required>
8624       </capabilities>
8625       <parameters>
8626         <param id="method">
8627           <jmethodID native="error"/>
8628             <description>
8629               The method to query.
8630             </description>
8631         </param>
8632         <param id="entry_count_ptr">
8633           <outptr><jint/></outptr>
8634           <description>
8635             On return, points to the number of entries in the table
8636           </description>
8637         </param>
8638         <param id="table_ptr">
8639           <allocbuf outcount="entry_count_ptr"><struct>jvmtiLocalVariableEntry</struct></allocbuf>
8640           <description>
8641             On return, points to an array of local variable table entries.
8642           </description>
8643         </param>
8644       </parameters>
8645       <errors>
8646         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8647           Class information does not include local variable
8648           information.
8649         </error>
8650       </errors>
8651     </function>
8652 
8653     <function id="GetBytecodes" phase="start" num="75">
8654       <synopsis>Get Bytecodes</synopsis>
8655       <description>
8656         For the method indicated by <code>method</code>,
8657         return the bytecodes that implement the method. The number of
8658         bytecodes is returned via <code>bytecode_count_ptr</code>. The bytecodes
8659         themselves are returned via <code>bytecodes_ptr</code>.
8660       </description>
8661       <origin>jvmdi</origin>
8662       <capabilities>
8663         <required id="can_get_bytecodes"></required>
8664       </capabilities>
8665       <parameters>
8666         <param id="klass">
8667           <jclass method="method"/>
8668             <description>
8669               The class to query.
8670             </description>
8671         </param>
8672         <param id="method">
8673           <jmethodID class="klass" native="error"/>
8674             <description>
8675               The method to query.
8676             </description>
8677         </param>
8678         <param id="bytecode_count_ptr">
8679           <outptr><jint/></outptr>
8680           <description>
8681             On return, points to the length of the bytecode array
8682           </description>
8683         </param>
8684         <param id="bytecodes_ptr">
8685           <allocbuf outcount="bytecode_count_ptr"><uchar/></allocbuf>
8686           <description>
8687             On return, points to the pointer to the bytecode array
8688           </description>
8689         </param>
8690       </parameters>
8691       <errors>
8692       </errors>
8693     </function>
8694 
8695     <function id="IsMethodNative" phase="start" num="76">
8696       <synopsis>Is Method Native</synopsis>
8697       <description>
8698         For the method indicated by <code>method</code>, return a
8699         value indicating whether the method is native via <code>is_native_ptr</code>
8700       </description>
8701       <origin>jvmdi</origin>
8702       <capabilities>
8703       </capabilities>
8704       <parameters>
8705         <param id="klass">
8706           <jclass method="method"/>
8707             <description>
8708               The class to query.
8709             </description>
8710         </param>
8711         <param id="method">
8712           <jmethodID class="klass"/>
8713             <description>
8714               The method to query.
8715             </description>
8716         </param>
8717         <param id="is_native_ptr">
8718           <outptr><jboolean/></outptr>
8719           <description>
8720             On return, points to the boolean result of this function.
8721           </description>
8722         </param>
8723       </parameters>
8724       <errors>
8725       </errors>
8726     </function>
8727 
8728     <function id="IsMethodSynthetic" phase="start" num="77">
8729       <synopsis>Is Method Synthetic</synopsis>
8730       <description>
8731         For the method indicated by <code>method</code>, return a
8732         value indicating whether the method is synthetic via <code>is_synthetic_ptr</code>.
8733         Synthetic methods are generated by the compiler but not present in the
8734         original source code.
8735       </description>
8736       <origin>jvmdi</origin>
8737       <capabilities>
8738         <required id="can_get_synthetic_attribute"></required>
8739       </capabilities>
8740       <parameters>
8741         <param id="klass">
8742           <jclass method="method"/>
8743             <description>
8744               The class to query.
8745             </description>
8746         </param>
8747         <param id="method">
8748           <jmethodID class="klass"/>
8749             <description>
8750               The method to query.
8751             </description>
8752         </param>
8753         <param id="is_synthetic_ptr">
8754           <outptr><jboolean/></outptr>
8755           <description>
8756             On return, points to the boolean result of this function.
8757           </description>
8758         </param>
8759       </parameters>
8760       <errors>
8761       </errors>
8762     </function>
8763 
8764     <function id="IsMethodObsolete" phase="start" num="91">
8765       <synopsis>Is Method Obsolete</synopsis>
8766       <description>
8767         Determine if a method ID refers to an
8768         <internallink id="obsoleteMethods">obsolete</internallink>
8769         method version.
8770       </description>
8771       <origin>jvmdi</origin>
8772       <capabilities>
8773       </capabilities>
8774       <parameters>
8775         <param id="klass">
8776           <jclass method="method"/>
8777             <description>
8778               The class to query.
8779             </description>
8780         </param>
8781         <param id="method">
8782           <jmethodID class="klass"/>
8783             <description>
8784               The method ID to query.
8785             </description>
8786         </param>
8787         <param id="is_obsolete_ptr">
8788           <outptr><jboolean/></outptr>
8789           <description>
8790             On return, points to the boolean result of this function.
8791           </description>
8792         </param>
8793       </parameters>
8794       <errors>
8795       </errors>
8796     </function>
8797 
8798     <function id="SetNativeMethodPrefix" jkernel="yes" phase="any" num="73" since="1.1">
8799       <synopsis>Set Native Method Prefix</synopsis>
8800       <description>
8801         This function modifies the failure handling of
8802         native method resolution by allowing retry
8803         with a prefix applied to the name.
8804         When used with the
8805         <eventlink id="ClassFileLoadHook">ClassFileLoadHook
8806         event</eventlink>, it enables native methods to be
8807         <internallink id="bci">instrumented</internallink>.
8808         <p/>
8809         Since native methods cannot be directly instrumented
8810         (they have no bytecodes), they must be wrapped with
8811         a non-native method which can be instrumented.
8812         For example, if we had:
8813         <example>
8814 native boolean foo(int x);</example>
8815         <p/>
8816         We could transform the class file (with the
8817         ClassFileLoadHook event) so that this becomes:
8818         <example>
8819 boolean foo(int x) {
8820   <i>... record entry to foo ...</i>
8821   return wrapped_foo(x);
8822 }
8823 
8824 native boolean wrapped_foo(int x);</example>
8825         <p/>
8826         Where foo becomes a wrapper for the actual native method
8827         with the appended prefix "wrapped_".  Note that
8828         "wrapped_" would be a poor choice of prefix since it
8829         might conceivably form the name of an existing method
8830         thus something like "$$$MyAgentWrapped$$$_" would be
8831         better but would make these examples less readable.
8832         <p/>
8833         The wrapper will allow data to be collected on the native
8834         method call, but now the problem becomes linking up the
8835         wrapped method with the native implementation.
8836         That is, the method <code>wrapped_foo</code> needs to be
8837         resolved to the native implementation of <code>foo</code>,
8838         which might be:
8839         <example>
8840 Java_somePackage_someClass_foo(JNIEnv* env, jint x)</example>
8841         <p/>
8842         This function allows the prefix to be specified and the
8843         proper resolution to occur.
8844         Specifically, when the standard resolution fails, the
8845         resolution is retried taking the prefix into consideration.
8846         There are two ways that resolution occurs, explicit
8847         resolution with the JNI function <code>RegisterNatives</code>
8848         and the normal automatic resolution.  For
8849         <code>RegisterNatives</code>, the VM will attempt this
8850         association:
8851         <example>
8852 method(foo) -> nativeImplementation(foo)</example>
8853         <p/>
8854         When this fails, the resolution will be retried with
8855         the specified prefix prepended to the method name,
8856         yielding the correct resolution:
8857         <example>
8858 method(wrapped_foo) -> nativeImplementation(foo)</example>
8859         <p/>
8860         For automatic resolution, the VM will attempt:
8861         <example>
8862 method(wrapped_foo) -> nativeImplementation(wrapped_foo)</example>
8863         <p/>
8864         When this fails, the resolution will be retried with
8865         the specified prefix deleted from the implementation name,
8866         yielding the correct resolution:
8867         <example>
8868 method(wrapped_foo) -> nativeImplementation(foo)</example>
8869         <p/>
8870         Note that since the prefix is only used when standard
8871         resolution fails, native methods can be wrapped selectively.
8872         <p/>
8873         Since each <jvmti/> environment is independent and
8874         can do its own transformation of the bytecodes, more
8875         than one layer of wrappers may be applied. Thus each
8876         environment needs its own prefix.  Since transformations
8877         are applied in order, the prefixes, if applied, will
8878         be applied in the same order.
8879         The order of transformation application is described in
8880         the <eventlink id="ClassFileLoadHook"/> event.
8881         Thus if three environments applied
8882         wrappers, <code>foo</code> might become
8883         <code>$env3_$env2_$env1_foo</code>.  But if, say,
8884         the second environment did not apply a wrapper to
8885         <code>foo</code> it would be just
8886         <code>$env3_$env1_foo</code>.  To be able to
8887         efficiently determine the sequence of prefixes,
8888         an intermediate prefix is only applied if its non-native
8889         wrapper exists.  Thus, in the last example, even though
8890         <code>$env1_foo</code> is not a native method, the
8891         <code>$env1_</code> prefix is applied since
8892         <code>$env1_foo</code> exists.
8893         <p/>
8894         Since the prefixes are used at resolution time
8895         and since resolution may be arbitrarily delayed, a
8896         native method prefix must remain set as long as there
8897         are corresponding prefixed native methods.
8898       </description>
8899       <origin>new</origin>
8900       <capabilities>
8901         <required id="can_set_native_method_prefix"></required>
8902       </capabilities>
8903       <parameters>
8904         <param id="prefix">
8905           <inbuf>
8906             <char/>
8907             <nullok>
8908               any existing prefix in this environment is cancelled
8909             </nullok>
8910           </inbuf>
8911           <description>
8912             The prefix to apply, encoded as a
8913             <internallink id="mUTF">modified UTF-8</internallink> string.
8914           </description>
8915         </param>
8916       </parameters>
8917       <errors>
8918       </errors>
8919     </function>
8920 
8921     <function id="SetNativeMethodPrefixes" jkernel="yes" phase="any" num="74" since="1.1">
8922       <synopsis>Set Native Method Prefixes</synopsis>
8923       <description>
8924          For a normal agent, <functionlink id="SetNativeMethodPrefix"/>
8925          will provide all needed native method prefixing.
8926          For a meta-agent that performs multiple independent class
8927          file transformations (for example as a proxy for another
8928          layer of agents) this function allows each transformation
8929          to have its own prefix.
8930          The prefixes are applied in the order supplied and are
8931          processed in the same manner as described for the
8932          application of prefixes from multiple <jvmti/> environments
8933          in <functionlink id="SetNativeMethodPrefix"/>.
8934          <p/>
8935          Any previous prefixes are replaced.  Thus, calling this
8936          function with a <paramlink id="prefix_count"/> of <code>0</code>
8937          disables prefixing in this environment.
8938          <p/>
8939          <functionlink id="SetNativeMethodPrefix"/> and this function
8940          are the two ways to set the prefixes.
8941          Calling <code>SetNativeMethodPrefix</code> with
8942          a prefix is the same as calling this function with
8943          <paramlink id="prefix_count"/> of <code>1</code>.
8944          Calling <code>SetNativeMethodPrefix</code> with
8945          <code>NULL</code> is the same as calling this function with
8946          <paramlink id="prefix_count"/> of <code>0</code>.
8947       </description>
8948       <origin>new</origin>
8949       <capabilities>
8950         <required id="can_set_native_method_prefix"></required>
8951       </capabilities>
8952       <parameters>
8953         <param id="prefix_count">
8954           <jint min="0"/>
8955             <description>
8956               The number of prefixes to apply.
8957             </description>
8958         </param>
8959         <param id="prefixes">
8960           <agentbuf>
8961             <char/>
8962           </agentbuf>
8963           <description>
8964             The prefixes to apply for this environment, each encoded as a
8965             <internallink id="mUTF">modified UTF-8</internallink> string.
8966           </description>
8967         </param>
8968       </parameters>
8969       <errors>
8970       </errors>
8971     </function>
8972 
8973   </category>
8974 
8975   <category id="RawMonitors" label="Raw Monitor">
8976 
8977     <function id="CreateRawMonitor" phase="onload" callbacksafe="safe" num="31">
8978       <synopsis>Create Raw Monitor</synopsis>
8979       <description>
8980         Create a raw monitor.
8981       </description>
8982       <origin>jvmdi</origin>
8983       <capabilities>
8984       </capabilities>
8985       <parameters>
8986         <param id="name">
8987           <inbuf><char/></inbuf>
8988           <description>
8989             A name to identify the monitor, encoded as a
8990             <internallink id="mUTF">modified UTF-8</internallink> string.
8991           </description>
8992         </param>
8993         <param id="monitor_ptr">
8994           <outptr><jrawMonitorID/></outptr>
8995           <description>
8996             On return, points to the created monitor.
8997           </description>
8998         </param>
8999       </parameters>
9000       <errors>
9001       </errors>
9002     </function>
9003 
9004     <function id="DestroyRawMonitor" phase="onload" callbacksafe="safe" num="32">
9005       <synopsis>Destroy Raw Monitor</synopsis>
9006       <description>
9007         Destroy the raw monitor.
9008         If the monitor being destroyed has been entered by this thread, it will be
9009         exited before it is destroyed.
9010         If the monitor being destroyed has been entered by another thread,
9011         an error will be returned and the monitor will not be destroyed.
9012       </description>
9013       <origin>jvmdi</origin>
9014       <capabilities>
9015       </capabilities>
9016       <parameters>
9017         <param id="monitor">
9018           <jrawMonitorID/>
9019           <description>
9020             The monitor
9021           </description>
9022         </param>
9023       </parameters>
9024       <errors>
9025         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9026           Not monitor owner
9027         </error>
9028       </errors>
9029     </function>
9030 
9031     <function id="RawMonitorEnter" phase="any" callbacksafe="safe" impl="innative notrace" num="33">
9032       <synopsis>Raw Monitor Enter</synopsis>
9033       <description>
9034         Gain exclusive ownership of a raw monitor.
9035         The same thread may enter a monitor more then once.
9036         The thread must
9037         <functionlink id="RawMonitorExit">exit</functionlink>
9038         the monitor the same number of times as it is entered.
9039         If a monitor is entered during <code>OnLoad</code> (before attached threads exist)
9040         and has not exited when attached threads come into existence, the enter
9041         is considered to have occurred on the main thread.
9042       </description>
9043       <origin>jvmdi</origin>
9044       <capabilities>
9045       </capabilities>
9046       <parameters>
9047         <param id="monitor">
9048           <jrawMonitorID/>
9049           <description>
9050             The monitor
9051           </description>
9052         </param>
9053       </parameters>
9054       <errors>
9055       </errors>
9056     </function>
9057 
9058     <function id="RawMonitorExit" phase="any" callbacksafe="safe" impl="innative notrace" num="34">
9059       <synopsis>Raw Monitor Exit</synopsis>
9060       <description>
9061         Release exclusive ownership of a raw monitor.
9062       </description>
9063       <origin>jvmdi</origin>
9064       <capabilities>
9065       </capabilities>
9066       <parameters>
9067         <param id="monitor">
9068           <jrawMonitorID/>
9069           <description>
9070             The monitor
9071           </description>
9072         </param>
9073       </parameters>
9074       <errors>
9075         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9076           Not monitor owner
9077         </error>
9078       </errors>
9079     </function>
9080 
9081     <function id="RawMonitorWait" phase="any" callbacksafe="safe" impl="innative notrace" num="35">
9082       <synopsis>Raw Monitor Wait</synopsis>
9083       <description>
9084         Wait for notification of the raw monitor.
9085         <p/>
9086         Causes the current thread to wait until either another thread calls
9087         <functionlink id="RawMonitorNotify"/> or
9088         <functionlink id="RawMonitorNotifyAll"/>
9089         for the specified raw monitor, or the specified
9090         <paramlink id="millis">timeout</paramlink>
9091         has elapsed.
9092       </description>
9093       <origin>jvmdi</origin>
9094       <capabilities>
9095       </capabilities>
9096       <parameters>
9097         <param id="monitor">
9098           <jrawMonitorID/>
9099           <description>
9100             The monitor
9101           </description>
9102         </param>
9103         <param id="millis">
9104           <jlong/>
9105           <description>
9106             The timeout, in milliseconds.  If the timeout is
9107             zero, then real time is not taken into consideration
9108             and the thread simply waits until notified.
9109           </description>
9110         </param>
9111       </parameters>
9112       <errors>
9113         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9114           Not monitor owner
9115         </error>
9116         <error id="JVMTI_ERROR_INTERRUPT">
9117           Wait was interrupted, try again
9118         </error>
9119       </errors>
9120     </function>
9121 
9122     <function id="RawMonitorNotify" phase="any" callbacksafe="safe" impl="notrace" num="36">
9123       <synopsis>Raw Monitor Notify</synopsis>
9124       <description>
9125         Notify a single thread waiting on the raw monitor.
9126       </description>
9127       <origin>jvmdi</origin>
9128       <capabilities>
9129       </capabilities>
9130       <parameters>
9131         <param id="monitor">
9132           <jrawMonitorID/>
9133           <description>
9134             The monitor
9135           </description>
9136         </param>
9137       </parameters>
9138       <errors>
9139         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9140           Not monitor owner
9141         </error>
9142       </errors>
9143     </function>
9144 
9145     <function id="RawMonitorNotifyAll" phase="any" callbacksafe="safe" impl="notrace" num="37">
9146       <synopsis>Raw Monitor Notify All</synopsis>
9147       <description>
9148         Notify all threads waiting on the raw monitor.
9149       </description>
9150       <origin>jvmdi</origin>
9151       <capabilities>
9152       </capabilities>
9153       <parameters>
9154         <param id="monitor">
9155           <jrawMonitorID/>
9156           <description>
9157             The monitor
9158           </description>
9159         </param>
9160       </parameters>
9161       <errors>
9162         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9163           Not monitor owner
9164         </error>
9165       </errors>
9166     </function>
9167 
9168    <elide>
9169     <function id="GetRawMonitorUse" num="118">
9170       <synopsis>Get Raw Monitor Use</synopsis>
9171       <description>
9172         The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure
9173         are filled in with information about usage of the raw monitor.
9174       </description>
9175       <origin>new</origin>
9176       <capabilities>
9177         <required id="can_get_raw_monitor_usage"></required>
9178       </capabilities>
9179       <parameters>
9180         <param id="monitor">
9181           <jrawMonitorID/>
9182           <description>
9183             the raw monitor to query.
9184           </description>
9185         </param>
9186         <param id="info_ptr">
9187           <outptr><struct>jvmtiMonitorUsage</struct></outptr>
9188           <description>
9189             On return, filled with monitor information for the
9190             specified raw monitor.
9191           </description>
9192         </param>
9193       </parameters>
9194       <errors>
9195       </errors>
9196     </function>
9197 
9198     <function id="GetRawMonitors" num="119">
9199       <synopsis>Get Raw Monitors</synopsis>
9200       <description>
9201         Return the list of raw monitors.
9202         <p/>
9203         Note: details about each monitor can be examined with
9204         <functionlink id="GetRawMonitorUse"></functionlink>.
9205       </description>
9206       <origin>new</origin>
9207       <capabilities>
9208         <required id="can_get_raw_monitor_usage"></required>
9209       </capabilities>
9210       <parameters>
9211         <param id="monitorCnt">
9212           <outptr><jint/></outptr>
9213           <description>
9214             On return, pointer to the number
9215             of monitors returned in <code>monitors_ptr</code>.
9216           </description>
9217         </param>
9218         <param id="monitors_ptr">
9219           <allocbuf outcount="monitorCnt"><jrawMonitorID/></allocbuf>
9220           <description>
9221             On return, pointer to the monitor list.
9222           </description>
9223         </param>
9224       </parameters>
9225       <errors>
9226       </errors>
9227     </function>
9228     </elide>
9229   </category>
9230 
9231   <category id="jniIntercept" label="JNI Function Interception">
9232 
9233     <intro>
9234       Provides the ability to intercept and resend
9235       Java Native Interface (JNI) function calls
9236       by manipulating the JNI function table.
9237       See <externallink id="jni/functions.html">JNI
9238         Functions</externallink> in the <i>Java Native Interface Specification</i>.
9239       <p/>
9240       The following example illustrates intercepting the
9241       <code>NewGlobalRef</code> JNI call in order to count reference
9242       creation.
9243       <example>
9244 JNIEnv original_jni_Functions;
9245 JNIEnv redirected_jni_Functions;
9246 int my_global_ref_count = 0;
9247 
9248 jobject
9249 MyNewGlobalRef(JNIEnv *jni_env, jobject lobj) {
9250    ++my_global_ref_count;
9251    return originalJNIFunctions-&gt;NewGlobalRef(env, lobj);
9252 }
9253 
9254 void
9255 myInit() {
9256    jvmtiError err;
9257 
9258    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;original_jni_Functions);
9259    if (err != JVMTI_ERROR_NONE) {
9260       die();
9261    }
9262    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;redirected_jni_Functions);
9263    if (err != JVMTI_ERROR_NONE) {
9264       die();
9265    }
9266    redirectedJNIFunctions-&gt;NewGlobalRef = MyNewGlobalRef;
9267       err = (*jvmti_env)-&gt;SetJNIFunctionTable(jvmti_env, redirected_jni_Functions);
9268    if (err != JVMTI_ERROR_NONE) {
9269       die();
9270    }
9271 }
9272       </example>
9273       Sometime after <code>myInit</code> is called the user's JNI
9274       code is executed which makes the call to create a new global
9275       reference.  Instead of going to the normal JNI implementation
9276       the call goes to <code>myNewGlobalRef</code>.  Note that a
9277       copy of the original function table is kept so that the normal
9278       JNI function can be called after the data is collected.
9279       Note also that any JNI functions which are not overwritten
9280       will behave normally.
9281       <todo>
9282         check that the example compiles and executes.
9283       </todo>
9284     </intro>
9285 
9286     <function id="SetJNIFunctionTable" phase="start" num="120">
9287       <synopsis>Set JNI Function Table</synopsis>
9288       <description>
9289         Set the JNI function table
9290         in all current and future JNI environments.
9291         As a result, all future JNI calls are directed to the specified functions.
9292         Use <functionlink id="GetJNIFunctionTable"></functionlink> to get the
9293         function table to pass to this function.
9294         For this function to take effect the the updated table entries must be
9295         used by the JNI clients.
9296         Since the table is defined <code>const</code> some compilers may optimize
9297         away the access to the table, thus preventing this function from taking
9298         effect.
9299         The table is copied--changes to the local copy of the
9300         table have no effect.
9301         This function affects only the function table, all other aspects of the environment are
9302         unaffected.
9303         See the examples <internallink id="jniIntercept">above</internallink>.
9304       </description>
9305       <origin>new</origin>
9306       <capabilities>
9307       </capabilities>
9308       <parameters>
9309         <param id="function_table">
9310           <inptr>
9311             <struct>jniNativeInterface</struct>
9312           </inptr>
9313           <description>
9314             Points to the new JNI function table.
9315           </description>
9316         </param>
9317       </parameters>
9318       <errors>
9319       </errors>
9320     </function>
9321 
9322     <function id="GetJNIFunctionTable" phase="start" num="121">
9323       <synopsis>Get JNI Function Table</synopsis>
9324       <description>
9325         Get the JNI function table.
9326         The JNI function table is copied into allocated memory.
9327         If <functionlink id="SetJNIFunctionTable"></functionlink>
9328         has been called, the modified (not the original) function
9329         table is returned.
9330         Only the function table is copied, no other aspects of the environment
9331         are copied.
9332         See the examples <internallink id="jniIntercept">above</internallink>.
9333       </description>
9334       <origin>new</origin>
9335       <capabilities>
9336       </capabilities>
9337       <parameters>
9338         <param id="function_table">
9339           <allocbuf>
9340             <struct>jniNativeInterface</struct>
9341           </allocbuf>
9342           <description>
9343             On return, <code>*function_table</code>
9344             points a newly allocated copy of the JNI function table.
9345           </description>
9346         </param>
9347       </parameters>
9348       <errors>
9349       </errors>
9350     </function>
9351 
9352   </category>
9353 
9354   <category id="eventManagement" label="Event Management">
9355 
9356     <function id="SetEventCallbacks" jkernel="yes" phase="onload" num="122">
9357       <synopsis>Set Event Callbacks</synopsis>
9358       <description>
9359         Set the functions to be called for each event.
9360         The callbacks are specified by supplying a replacement function table.
9361         The function table is copied--changes to the local copy of the
9362         table have no effect.
9363         This is an atomic action, all callbacks are set at once.
9364         No events are sent before this function is called.
9365         When an entry is <code>NULL</code> or when the event is beyond
9366         <paramlink id="size_of_callbacks"></paramlink> no event is sent.
9367         Details on events are
9368         described <internallink id="EventSection">later</internallink> in this document.
9369         An event must be enabled and have a callback in order to be
9370         sent--the order in which this function and
9371         <functionlink id="SetEventNotificationMode"></functionlink>
9372         are called does not affect the result.
9373       </description>
9374       <origin>new</origin>
9375       <capabilities>
9376       </capabilities>
9377       <parameters>
9378         <param id="callbacks">
9379           <inptr>
9380             <struct>jvmtiEventCallbacks</struct>
9381             <nullok>remove the existing callbacks</nullok>
9382           </inptr>
9383           <description>
9384             The new event callbacks.
9385           </description>
9386         </param>
9387         <param id="size_of_callbacks">
9388           <jint min="0"/>
9389           <description>
9390             <code>sizeof(jvmtiEventCallbacks)</code>--for version
9391             compatibility.
9392           </description>
9393         </param>
9394       </parameters>
9395       <errors>
9396       </errors>
9397     </function>
9398 
9399     <function id="SetEventNotificationMode" jkernel="yes" phase="onload" num="2">
9400       <synopsis>Set Event Notification Mode</synopsis>
9401       <description>
9402         Control the generation of events.
9403         <constants id="jvmtiEventMode" label="Event Enable/Disable" kind="enum">
9404           <constant id="JVMTI_ENABLE" num="1">
9405             If <paramlink id="mode"></paramlink> is <code>JVMTI_ENABLE</code>,
9406             the event <paramlink id="event_type"></paramlink> will be enabled
9407           </constant>
9408           <constant id="JVMTI_DISABLE" num="0">
9409             If <paramlink id="mode"></paramlink> is <code>JVMTI_DISABLE</code>,
9410             the event <paramlink id="event_type"></paramlink> will be disabled
9411           </constant>
9412         </constants>
9413         If <code>event_thread</code> is <code>NULL</code>,
9414         the event is enabled or disabled globally; otherwise, it is
9415         enabled or disabled for a particular thread.
9416         An event is generated for
9417         a particular thread if it is enabled either at the thread or global
9418         levels.
9419         <p/>
9420         See <internallink id="EventIndex">below</internallink> for information on specific events.
9421         <p/>
9422         The following events cannot be controlled at the thread
9423         level through this function.
9424         <ul>
9425           <li><eventlink id="VMInit"></eventlink></li>
9426           <li><eventlink id="VMStart"></eventlink></li>
9427           <li><eventlink id="VMDeath"></eventlink></li>
9428           <li><eventlink id="ThreadStart"></eventlink></li>
9429           <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9430           <li><eventlink id="CompiledMethodUnload"></eventlink></li>
9431           <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9432           <li><eventlink id="DataDumpRequest"></eventlink></li>
9433         </ul>
9434         <p/>
9435         Initially, no events are enabled at either the thread level
9436         or the global level.
9437         <p/>
9438         Any needed capabilities (see Event Enabling Capabilities below) must be possessed
9439         before calling this function.
9440         <p/>
9441         Details on events are
9442         described <internallink id="EventSection">below</internallink>.
9443       </description>
9444       <origin>jvmdiClone</origin>
9445       <eventcapabilities></eventcapabilities>
9446       <parameters>
9447         <param id="mode">
9448           <enum>jvmtiEventMode</enum>
9449           <description>
9450             <code>JVMTI_ENABLE</code> or <code>JVMTI_DISABLE</code>
9451           </description>
9452         </param>
9453         <param id="event_type">
9454           <enum>jvmtiEvent</enum>
9455           <description>
9456             the event to control
9457           </description>
9458         </param>
9459         <param id="event_thread">
9460           <ptrtype>
9461             <jthread impl="noconvert"/>
9462             <nullok>event is controlled at the global level</nullok>
9463           </ptrtype>
9464             <description>
9465               The thread to control
9466             </description>
9467         </param>
9468         <param id="...">
9469           <varargs/>
9470             <description>
9471               for future expansion
9472             </description>
9473         </param>
9474       </parameters>
9475       <errors>
9476         <error id="JVMTI_ERROR_INVALID_THREAD">
9477           <paramlink id="event_thread"/> is non-<code>NULL</code> and is not a valid thread.
9478         </error>
9479         <error id="JVMTI_ERROR_THREAD_NOT_ALIVE">
9480           <paramlink id="event_thread"/> is non-<code>NULL</code> and is not live (has not been started or is now dead).
9481         </error>
9482         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9483           thread level control was attempted on events which do not
9484           permit thread level control.
9485         </error>
9486         <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
9487           The Required Event Enabling Capability is not possessed.
9488         </error>
9489       </errors>
9490     </function>
9491 
9492     <function id="GenerateEvents" num="123">
9493       <synopsis>Generate Events</synopsis>
9494       <description>
9495         Generate events to represent the current state of the VM.
9496         For example, if <paramlink id="event_type"/> is
9497         <code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code>,
9498         a <eventlink id="CompiledMethodLoad"></eventlink> event will be
9499         sent for each currently compiled method.
9500         Methods that were loaded and now have been unloaded are not sent.
9501         The history of what events have previously been sent does not
9502         effect what events are sent by this function--for example,
9503         all currently compiled methods
9504         will be sent each time this function is called.
9505         <p/>
9506         This function is useful when
9507         events may have been missed due to the agent attaching after program
9508         execution begins; this function generates the missed events.
9509         <p/>
9510         Attempts to execute Java programming language code or
9511         JNI functions may be paused until this function returns -
9512         so neither should be called from the thread sending the event.
9513         This function returns only after the missed events have been
9514         sent, processed and have returned.
9515         The event may be sent on a different thread than the thread
9516         on which the event occurred.
9517         The callback for the event must be set with
9518         <functionlink id="SetEventCallbacks"></functionlink>
9519         and the event must be enabled with
9520         <functionlink id="SetEventNotificationMode"></functionlink>
9521         or the events will not occur.
9522         If the VM no longer has the information to generate some or
9523         all of the requested events, the events are simply not sent -
9524         no error is returned.
9525         <p/>
9526         Only the following events are supported:
9527         <ul>
9528           <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9529           <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9530         </ul>
9531       </description>
9532       <origin>new</origin>
9533       <capabilities>
9534         <capability id="can_generate_compiled_method_load_events"></capability>
9535       </capabilities>
9536       <parameters>
9537         <param id="event_type">
9538           <enum>jvmtiEvent</enum>
9539           <description>
9540             The type of event to generate.  Must be one of these:
9541             <ul>
9542               <li><eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink></li>
9543               <li><eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink></li>
9544             </ul>
9545           </description>
9546         </param>
9547       </parameters>
9548       <errors>
9549         <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY">
9550           <paramlink id="event_type"/> is
9551           <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9552           and <fieldlink id="can_generate_compiled_method_load_events" struct="jvmtiCapabilities"></fieldlink>
9553           is <code>false</code>.
9554         </error>
9555         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9556           <paramlink id="event_type"/> is other than
9557           <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9558           or <eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink>.
9559         </error>
9560       </errors>
9561     </function>
9562 
9563   </category>
9564 
9565     <category id="extension" label="Extension Mechanism">
9566 
9567       <intro>
9568         These functions
9569         allow a <jvmti/> implementation to provide functions and events
9570         beyond those defined in this specification.
9571         <p/>
9572         Both extension functions and extension events have parameters
9573         each of which has a 'type' and 'kind' chosen from the following tables:
9574 
9575         <constants id="jvmtiParamTypes" label="Extension Function/Event Parameter Types" kind="enum">
9576           <constant id="JVMTI_TYPE_JBYTE" num="101">
9577             Java programming language primitive type - <code>byte</code>.
9578             JNI type <code>jbyte</code>.
9579           </constant>
9580           <constant id="JVMTI_TYPE_JCHAR" num="102">
9581             Java programming language primitive type - <code>char</code>.
9582             JNI type <code>jchar</code>.
9583           </constant>
9584           <constant id="JVMTI_TYPE_JSHORT" num="103">
9585             Java programming language primitive type - <code>short</code>.
9586             JNI type <code>jshort</code>.
9587           </constant>
9588           <constant id="JVMTI_TYPE_JINT" num="104">
9589             Java programming language primitive type - <code>int</code>.
9590             JNI type <datalink id="jint"></datalink>.
9591           </constant>
9592           <constant id="JVMTI_TYPE_JLONG" num="105">
9593             Java programming language primitive type - <code>long</code>.
9594             JNI type <datalink id="jlong"></datalink>.
9595           </constant>
9596           <constant id="JVMTI_TYPE_JFLOAT" num="106">
9597             Java programming language primitive type - <code>float</code>.
9598             JNI type <datalink id="jfloat"></datalink>.
9599           </constant>
9600           <constant id="JVMTI_TYPE_JDOUBLE" num="107">
9601             Java programming language primitive type - <code>double</code>.
9602             JNI type <datalink id="jdouble"></datalink>.
9603           </constant>
9604           <constant id="JVMTI_TYPE_JBOOLEAN" num="108">
9605             Java programming language primitive type - <code>boolean</code>.
9606             JNI type <datalink id="jboolean"></datalink>.
9607           </constant>
9608           <constant id="JVMTI_TYPE_JOBJECT" num="109">
9609             Java programming language object type - <code>java.lang.Object</code>.
9610             JNI type <datalink id="jobject"></datalink>.
9611             Returned values are JNI local references and must be managed.
9612           </constant>
9613           <constant id="JVMTI_TYPE_JTHREAD" num="110">
9614             Java programming language object type - <code>java.lang.Thread</code>.
9615             <jvmti/> type <datalink id="jthread"></datalink>.
9616             Returned values are JNI local references and must be managed.
9617           </constant>
9618           <constant id="JVMTI_TYPE_JCLASS" num="111">
9619             Java programming language object type - <code>java.lang.Class</code>.
9620             JNI type <datalink id="jclass"></datalink>.
9621             Returned values are JNI local references and must be managed.
9622           </constant>
9623           <constant id="JVMTI_TYPE_JVALUE" num="112">
9624             Union of all Java programming language primitive and object types -
9625             JNI type <datalink id="jvalue"></datalink>.
9626             Returned values which represent object types are JNI local references and must be managed.
9627           </constant>
9628           <constant id="JVMTI_TYPE_JFIELDID" num="113">
9629             Java programming language field identifier -
9630             JNI type <datalink id="jfieldID"></datalink>.
9631           </constant>
9632           <constant id="JVMTI_TYPE_JMETHODID" num="114">
9633             Java programming language method identifier -
9634             JNI type <datalink id="jmethodID"></datalink>.
9635           </constant>
9636           <constant id="JVMTI_TYPE_CCHAR" num="115">
9637             C programming language type - <code>char</code>.
9638           </constant>
9639           <constant id="JVMTI_TYPE_CVOID" num="116">
9640             C programming language type - <code>void</code>.
9641           </constant>
9642           <constant id="JVMTI_TYPE_JNIENV" num="117">
9643             JNI environment - <code>JNIEnv</code>.
9644             Should be used with the correct <datalink id="jvmtiParamKind"/> to make it a pointer type.
9645           </constant>
9646         </constants>
9647 
9648         <constants id="jvmtiParamKind" label="Extension Function/Event Parameter Kinds" kind="enum">
9649           <constant id="JVMTI_KIND_IN" num="91">
9650             Ingoing argument - <code>foo</code>.
9651           </constant>
9652           <constant id="JVMTI_KIND_IN_PTR" num="92">
9653             Ingoing pointer argument - <code>const foo*</code>.
9654           </constant>
9655           <constant id="JVMTI_KIND_IN_BUF" num="93">
9656             Ingoing array argument - <code>const foo*</code>.
9657           </constant>
9658           <constant id="JVMTI_KIND_ALLOC_BUF" num="94">
9659             Outgoing allocated array argument -  <code>foo**</code>.
9660             Free with <code>Deallocate</code>.
9661           </constant>
9662           <constant id="JVMTI_KIND_ALLOC_ALLOC_BUF" num="95">
9663             Outgoing allocated array of allocated arrays argument - <code>foo***</code>.
9664             Free with <code>Deallocate</code>.
9665           </constant>
9666           <constant id="JVMTI_KIND_OUT" num="96">
9667             Outgoing argument - <code>foo*</code>.
9668           </constant>
9669           <constant id="JVMTI_KIND_OUT_BUF" num="97">
9670             Outgoing array argument (pre-allocated by agent) - <code>foo*</code>.
9671             Do not <code>Deallocate</code>.
9672           </constant>
9673         </constants>
9674 
9675       </intro>
9676 
9677       <typedef id="jvmtiParamInfo" label="Extension Function/Event Parameter Info">
9678         <field id="name">
9679           <allocfieldbuf><char/></allocfieldbuf>
9680             <description>
9681               The parameter name, encoded as a
9682               <internallink id="mUTF">modified UTF-8</internallink> string
9683             </description>
9684         </field>
9685         <field id="kind">
9686           <enum>jvmtiParamKind</enum>
9687           <description>
9688             The kind of the parameter - type modifiers
9689           </description>
9690         </field>
9691         <field id="base_type">
9692           <enum>jvmtiParamTypes</enum>
9693           <description>
9694             The base type of the parameter -  modified by <code>kind</code>
9695           </description>
9696         </field>
9697         <field id="null_ok">
9698           <jboolean/>
9699             <description>
9700               Is a <code>NULL</code> argument permitted? Applies only to pointer and object types.
9701             </description>
9702         </field>
9703       </typedef>
9704 
9705       <callback id="jvmtiExtensionFunction">
9706         <enum>jvmtiError</enum>
9707           <synopsis>Extension Function</synopsis>
9708         <description>
9709           This is the implementation-specific extension function.
9710         </description>
9711         <parameters>
9712           <param id="jvmti_env">
9713             <outptr>
9714               <struct>jvmtiEnv</struct>
9715             </outptr>
9716             <description>
9717               The <jvmti/> environment is the only fixed parameter for extension functions.
9718             </description>
9719           </param>
9720           <param id="...">
9721             <varargs/>
9722               <description>
9723                 The extension function-specific parameters
9724               </description>
9725           </param>
9726         </parameters>
9727       </callback>
9728 
9729       <function id="GetExtensionFunctions" phase="onload" num="124">
9730         <synopsis>Get Extension Functions</synopsis>
9731 
9732         <typedef id="jvmtiExtensionFunctionInfo" label="Extension Function Info">
9733           <field id="func">
9734             <ptrtype>
9735               <struct>jvmtiExtensionFunction</struct>
9736             </ptrtype>
9737             <description>
9738               The actual function to call
9739             </description>
9740           </field>
9741           <field id="id">
9742             <allocfieldbuf><char/></allocfieldbuf>
9743               <description>
9744                 The identifier for the extension function, encoded as a
9745                 <internallink id="mUTF">modified UTF-8</internallink> string.
9746                 Uses package name conventions.
9747                 For example, <code>com.sun.hotspot.bar</code>
9748               </description>
9749           </field>
9750           <field id="short_description">
9751             <allocfieldbuf><char/></allocfieldbuf>
9752               <description>
9753                 A one sentence description of the function, encoded as a
9754                 <internallink id="mUTF">modified UTF-8</internallink> string.
9755               </description>
9756           </field>
9757           <field id="param_count">
9758             <jint/>
9759               <description>
9760                 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
9761               </description>
9762           </field>
9763           <field id="params">
9764             <allocfieldbuf outcount="param_count">
9765               <struct>jvmtiParamInfo</struct>
9766             </allocfieldbuf>
9767             <description>
9768               Array of
9769               <fieldlink id="param_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
9770               parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
9771             </description>
9772           </field>
9773           <field id="error_count">
9774             <jint/>
9775               <description>
9776                 The number of possible error returns (excluding universal errors)
9777               </description>
9778           </field>
9779           <field id="errors">
9780             <allocfieldbuf outcount="error_count">
9781               <enum>jvmtiError</enum>
9782             </allocfieldbuf>
9783             <description>
9784               Array of <fieldlink id="error_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
9785               possible errors
9786             </description>
9787           </field>
9788         </typedef>
9789 
9790         <description>
9791           Returns the set of extension functions.
9792         </description>
9793         <origin>new</origin>
9794         <capabilities>
9795         </capabilities>
9796         <parameters>
9797           <param id="extension_count_ptr">
9798             <outptr><jint/></outptr>
9799               <description>
9800                 On return, points to the number of extension functions
9801               </description>
9802           </param>
9803           <param id="extensions">
9804             <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionFunctionInfo</struct></allocbuf>
9805             <description>
9806               Returns an array of extension function info, one per function
9807             </description>
9808           </param>
9809         </parameters>
9810         <errors>
9811         </errors>
9812       </function>
9813 
9814       <function id="GetExtensionEvents" phase="onload" num="125">
9815         <synopsis>Get Extension Events</synopsis>
9816 
9817         <typedef id="jvmtiExtensionEventInfo" label="Extension Event Info">
9818           <field id="extension_event_index">
9819             <jint/>
9820             <description>
9821               The identifying index of the event
9822             </description>
9823           </field>
9824           <field id="id">
9825             <allocfieldbuf><char/></allocfieldbuf>
9826               <description>
9827                 The identifier for the extension event, encoded as a
9828                 <internallink id="mUTF">modified UTF-8</internallink> string.
9829                 Uses package name conventions.
9830                 For example, <code>com.sun.hotspot.bar</code>
9831               </description>
9832           </field>
9833           <field id="short_description">
9834             <allocfieldbuf><char/></allocfieldbuf>
9835               <description>
9836                 A one sentence description of the event, encoded as a
9837                 <internallink id="mUTF">modified UTF-8</internallink> string.
9838               </description>
9839           </field>
9840           <field id="param_count">
9841             <jint/>
9842               <description>
9843                 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
9844               </description>
9845           </field>
9846           <field id="params">
9847             <allocfieldbuf outcount="param_count">
9848               <struct>jvmtiParamInfo</struct>
9849             </allocfieldbuf>
9850             <description>
9851               Array of
9852               <fieldlink id="param_count" struct="jvmtiExtensionEventInfo"></fieldlink>
9853               parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
9854             </description>
9855           </field>
9856         </typedef>
9857 
9858         <description>
9859           Returns the set of extension events.
9860         </description>
9861         <origin>new</origin>
9862         <capabilities>
9863         </capabilities>
9864         <parameters>
9865           <param id="extension_count_ptr">
9866             <outptr><jint/></outptr>
9867               <description>
9868                 On return, points to the number of extension events
9869               </description>
9870           </param>
9871           <param id="extensions">
9872             <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionEventInfo</struct></allocbuf>
9873             <description>
9874               Returns an array of extension event info, one per event
9875             </description>
9876           </param>
9877         </parameters>
9878         <errors>
9879         </errors>
9880       </function>
9881 
9882       <callback id="jvmtiExtensionEvent">
9883         <void/>
9884           <synopsis>Extension Event</synopsis>
9885         <description>
9886           This is the implementation-specific event.
9887           The event handler is set with
9888           <functionlink id="SetExtensionEventCallback"/>.
9889           <p/>
9890           Event handlers for extension events must be declared varargs to match this definition.
9891           Failure to do so could result in calling convention mismatch and undefined behavior
9892           on some platforms.
9893           <p/>
9894           For example, if the <code>jvmtiParamInfo</code>
9895           returned by <functionlink id="GetExtensionEvents"/> indicates that
9896           there is a <code>jint</code> parameter, the event handler should be
9897           declared:
9898 <example>
9899     void JNICALL myHandler(jvmtiEnv* jvmti_env, jint myInt, ...)
9900 </example>
9901           Note the terminal "<code>...</code>" which indicates varargs.
9902         </description>
9903         <parameters>
9904           <param id="jvmti_env">
9905             <outptr>
9906               <struct>jvmtiEnv</struct>
9907             </outptr>
9908             <description>
9909               The <jvmti/> environment is the only fixed parameter for extension events.
9910             </description>
9911           </param>
9912           <param id="...">
9913             <varargs/>
9914               <description>
9915                 The extension event-specific parameters
9916               </description>
9917           </param>
9918         </parameters>
9919       </callback>
9920 
9921       <function id="SetExtensionEventCallback" phase="onload" num="126">
9922         <synopsis>Set Extension Event Callback</synopsis>
9923 
9924         <description>
9925           Sets the callback function for an extension event and
9926           enables the event. Or, if the callback is <code>NULL</code>, disables
9927           the event.  Note that unlike standard events, setting
9928           the callback and enabling the event are a single operation.
9929         </description>
9930         <origin>new</origin>
9931         <capabilities>
9932         </capabilities>
9933         <parameters>
9934           <param id="extension_event_index">
9935             <jint/>
9936               <description>
9937                 Identifies which callback to set.
9938                 This index is the
9939                 <fieldlink id="extension_event_index" struct="jvmtiExtensionEventInfo"></fieldlink>
9940                 field of
9941                 <datalink id="jvmtiExtensionEventInfo"/>.
9942               </description>
9943           </param>
9944           <param id="callback">
9945             <ptrtype>
9946               <struct>jvmtiExtensionEvent</struct>
9947               <nullok>disable the event</nullok>
9948             </ptrtype>
9949             <description>
9950               If <code>callback</code> is non-<code>NULL</code>,
9951               set <code>callback</code> to be the event callback function
9952               and enable the event.
9953             </description>
9954           </param>
9955         </parameters>
9956         <errors>
9957         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9958             <paramlink id="extension_event_index"/> is not an
9959             <fieldlink id="extension_event_index"
9960                        struct="jvmtiExtensionEventInfo"/>
9961             returned by
9962             <functionlink id="GetExtensionEvents"/>
9963         </error>
9964         </errors>
9965       </function>
9966 
9967     </category>
9968 
9969   <category id="capability" label="Capability">
9970 
9971     <intro>
9972       The capabilities functions allow you to change the
9973       functionality available to <jvmti/>--that is,
9974       which <jvmti/>
9975       functions can be called, what events can be generated,
9976       and what functionality these events and functions can
9977       provide.
9978       <p/>
9979         The "Capabilities" section of each function and event describe which
9980         capabilities, if any, they are associated with. "Required Functionality"
9981         means it is available for use and no capabilities must be added to use it.
9982         "Optional Functionality" means the agent must possess the capability
9983         before it can be used.
9984         To possess a capability, the agent must
9985         <functionlink id="AddCapabilities">add the capability</functionlink>.
9986         "Optional Features" describe capabilities which,
9987         if added, extend the feature set.
9988         <p/>
9989         The potentially available capabilities of each <jvmti/> implementation are different.
9990         Depending on the implementation, a capability:
9991         <ul>
9992           <li>may never be added</li>
9993           <li>may be added in either the <code>OnLoad</code> or live phase in any environment</li>
9994           <li>may be added only during the <code>OnLoad</code> phase</li>
9995           <li>may be possessed by only one environment at a time</li>
9996           <li>may be possessed by only one environment at a time,
9997               and only during the <code>OnLoad</code> phase</li>
9998           <li>and so on ...</li>
9999         </ul>
10000       Frequently, the addition of a capability may incur a cost in execution speed, start up
10001       time, and/or memory footprint.  Note that the overhead of using a capability
10002       is completely different than the overhead of possessing a capability.
10003       Take single stepping as an example. When single stepping is on (that
10004       is, when the event is enabled and thus actively sending events)
10005       the overhead of sending and processing an event
10006       on each instruction is huge in any implementation.
10007       However, the overhead of possessing the capability may be small or large,
10008       depending on the implementation.  Also, when and if a capability is potentially
10009       available depends on the implementation.  Some examples:
10010       <ul>
10011         <li>One VM might perform all execution by compiling bytecodes into
10012           native code and be unable to generate single step instructions.
10013           In this implementation the capability can not be added.</li>
10014         <li>Another VM may be able to switch execution to a single stepping
10015           interpreter at any time.  In this implementation, having the capability has no
10016           overhead and could be added at any time.</li>
10017         <li>Yet another VM might be able to choose a bytecode compiling or single stepping capable interpreted
10018           execution engine at start up, but be unable to switch between them.
10019           In this implementation the capability would need to be added
10020           during the <code>OnLoad</code> phase (before bytecode
10021           execution begins) and would have a large impact on execution speed
10022           even if single stepping was never used.</li>
10023         <li>Still another VM might be able to add an "is single stepping on" check
10024           into compiled bytecodes or a generated interpreter.  Again in this implementation
10025           the capability would need to be added during the <code>OnLoad</code> phase but the overhead (a test
10026           and branch on each instruction) would be considerably less.</li>
10027       </ul>
10028       <p/>
10029       Each <jvmti/> <internallink id="environments">environment</internallink>
10030       has its own set of capabilities.
10031       Initially, that set is empty.
10032       Any desired capability must be added.
10033       If possible, capabilities should be added during the <code>OnLoad</code> phase.  For most
10034       virtual machines certain capabilities require special set up for
10035       the virtual machine and this set up must happen
10036       during the <code>OnLoad</code> phase, before the virtual machine begins execution.
10037       Once a capability is added, it can
10038       only be removed if explicitly relinquished by the environment.
10039       <p/>
10040       The agent can,
10041       <functionlink id="GetPotentialCapabilities">determine what
10042         capabilities this VM can potentially provide</functionlink>,
10043       <functionlink id="AddCapabilities">add the capabilities
10044         to be used</functionlink>,
10045       <functionlink id="RelinquishCapabilities">release capabilities
10046         which are no longer needed</functionlink>, and
10047       <functionlink id="GetCapabilities">examine the currently available
10048         capabilities</functionlink>.
10049     </intro>
10050 
10051     <intro id="capabilityExamples" label="Capability Examples">
10052       For example, a freshly started agent (in the <code>OnLoad</code> function)
10053       wants to enable all possible capabilities.
10054       Note that, in general, this is not advisable as the agent may suffer
10055       a performance penalty for functionality it is not using.
10056       The code might look like this in C:
10057       <example>
10058         jvmtiCapabilities capa;
10059         jvmtiError err;
10060 
10061         err = (*jvmti)-&gt;GetPotentialCapabilities(jvmti, &amp;capa);
10062         if (err == JVMTI_ERROR_NONE) {
10063            err = (*jvmti)-&gt;AddCapabilities(jvmti, &amp;capa);
10064       </example>
10065       For example, if an  agent wants to check if it can get
10066       the bytecodes of a method (that is, it wants to check
10067       if it previously added this capability and has not
10068       relinquished it), the code might
10069       look like this in C:
10070       <example>
10071         jvmtiCapabilities capa;
10072         jvmtiError err;
10073 
10074         err = (*jvmti)-&gt;GetCapabilities(jvmti, &amp;capa);
10075         if (err == JVMTI_ERROR_NONE) {
10076            if (capa.can_get_bytecodes) { ... } }
10077       </example>
10078     </intro>
10079 
10080     <capabilitiestypedef id="jvmtiCapabilities" label="The Capabilities Structure">
10081       <description>
10082         The functions in this category use this capabilities structure
10083         which contains boolean flags corresponding to each capability:
10084       </description>
10085       <capabilityfield id="can_tag_objects">
10086         <description>
10087           Can set and get tags, as described in the
10088           <internallink id="Heap">Heap category</internallink>.
10089         </description>
10090       </capabilityfield>
10091       <capabilityfield id="can_generate_field_modification_events">
10092         <description>
10093           Can set watchpoints on field modification -
10094           <functionlink id="SetFieldModificationWatch"></functionlink>
10095         </description>
10096       </capabilityfield>
10097       <capabilityfield id="can_generate_field_access_events">
10098         <description>
10099           Can set watchpoints on field access -
10100           <functionlink id="SetFieldAccessWatch"></functionlink>
10101         </description>
10102       </capabilityfield>
10103       <capabilityfield id="can_get_bytecodes">
10104         <description>
10105           Can get bytecodes of a method <functionlink id="GetBytecodes"></functionlink>
10106         </description>
10107       </capabilityfield>
10108       <capabilityfield id="can_get_synthetic_attribute">
10109         <description>
10110           Can test if a field or method is synthetic -
10111           <functionlink id="IsFieldSynthetic"></functionlink> and
10112           <functionlink id="IsMethodSynthetic"></functionlink>
10113         </description>
10114       </capabilityfield>
10115       <capabilityfield id="can_get_owned_monitor_info">
10116         <description>
10117           Can get information about ownership of monitors -
10118           <functionlink id="GetOwnedMonitorInfo"></functionlink>
10119         </description>
10120       </capabilityfield>
10121       <capabilityfield id="can_get_current_contended_monitor">
10122         <description>
10123           Can <functionlink id="GetCurrentContendedMonitor"></functionlink>
10124         </description>
10125       </capabilityfield>
10126       <capabilityfield id="can_get_monitor_info">
10127       <description>
10128         Can <functionlink id="GetObjectMonitorUsage"></functionlink>
10129       </description>
10130       </capabilityfield>
10131       <capabilityfield id="can_pop_frame">
10132         <description>
10133           Can pop frames off the stack - <functionlink id="PopFrame"></functionlink>
10134         </description>
10135       </capabilityfield>
10136       <capabilityfield id="can_redefine_classes">
10137         <description>
10138           Can redefine classes with <functionlink id="RedefineClasses"/>.
10139         </description>
10140       </capabilityfield>
10141       <capabilityfield id="can_signal_thread">
10142         <description>
10143           Can send stop or interrupt to threads
10144         </description>
10145       </capabilityfield>
10146       <capabilityfield id="can_get_source_file_name">
10147         <description>
10148           Can get the source file name of a class
10149         </description>
10150       </capabilityfield>
10151       <capabilityfield id="can_get_line_numbers">
10152         <description>
10153           Can get the line number table of a method
10154         </description>
10155       </capabilityfield>
10156       <capabilityfield id="can_get_source_debug_extension">
10157         <description>
10158           Can get the source debug extension of a class
10159         </description>
10160       </capabilityfield>
10161       <capabilityfield id="can_access_local_variables">
10162         <description>
10163           Can set and get local variables
10164         </description>
10165       </capabilityfield>
10166       <capabilityfield id="can_maintain_original_method_order">
10167         <description>
10168           Can return methods in the order they occur in the class file
10169         </description>
10170       </capabilityfield>
10171       <capabilityfield id="can_generate_single_step_events">
10172         <description>
10173           Can get <eventlink id="SingleStep">single step</eventlink> events
10174         </description>
10175       </capabilityfield>
10176       <capabilityfield id="can_generate_exception_events">
10177         <description>
10178           Can get <eventlink id="Exception">exception thrown</eventlink> and
10179             <eventlink id="ExceptionCatch">exception catch</eventlink> events
10180         </description>
10181       </capabilityfield>
10182       <capabilityfield id="can_generate_frame_pop_events">
10183         <description>
10184           Can <functionlink id="NotifyFramePop">set</functionlink> and thus get
10185             <eventlink id="FramePop"></eventlink> events
10186         </description>
10187       </capabilityfield>
10188       <capabilityfield id="can_generate_breakpoint_events">
10189         <description>
10190           Can <functionlink id="SetBreakpoint">set</functionlink> and thus get
10191             <eventlink id="Breakpoint"></eventlink> events
10192         </description>
10193       </capabilityfield>
10194       <capabilityfield id="can_suspend">
10195         <description>
10196           Can suspend and resume threads
10197         </description>
10198       </capabilityfield>
10199       <capabilityfield id="can_redefine_any_class">
10200         <description>
10201           <functionlink id="RedefineClasses"/> can be called on any modifiable class.
10202           See <functionlink id="IsModifiableClass"/>.
10203           (<fieldlink id="can_redefine_classes" struct="jvmtiCapabilities"/>
10204           must also be set)
10205         </description>
10206       </capabilityfield>
10207       <capabilityfield id="can_get_current_thread_cpu_time">
10208         <description>
10209           Can <functionlink id="GetCurrentThreadCpuTime">get</functionlink>
10210           current thread CPU time
10211         </description>
10212       </capabilityfield>
10213       <capabilityfield id="can_get_thread_cpu_time">
10214         <description>
10215           Can <functionlink id="GetThreadCpuTime">get</functionlink>
10216           thread CPU time
10217         </description>
10218       </capabilityfield>
10219       <capabilityfield id="can_generate_method_entry_events"
10220                        disp1="can_generate" disp2="_method_entry_events"
10221                        >
10222         <description>
10223           Can generate method entry events on entering a method
10224         </description>
10225       </capabilityfield>
10226       <capabilityfield id="can_generate_method_exit_events"
10227                        disp1="can_generate" disp2="_method_exit_events"
10228                        >
10229         <description>
10230           Can generate method exit events on leaving a method
10231         </description>
10232       </capabilityfield>
10233       <capabilityfield id="can_generate_all_class_hook_events"
10234                        disp1="can_generate" disp2="_all_class_hook_events"
10235                        >
10236         <description>
10237           Can generate ClassFileLoadHook events for every loaded class.
10238         </description>
10239       </capabilityfield>
10240       <capabilityfield id="can_generate_compiled_method_load_events"
10241                        disp1="can_generate" disp2="_compiled_method_load_events"
10242                        >
10243         <description>
10244           Can generate events when a method is compiled or unloaded
10245         </description>
10246       </capabilityfield>
10247       <capabilityfield id="can_generate_monitor_events"
10248                        disp1="can_generate" disp2="_monitor_events"
10249                        >
10250         <description>
10251           Can generate events on monitor activity
10252         </description>
10253       </capabilityfield>
10254       <capabilityfield id="can_generate_vm_object_alloc_events"
10255                        disp1="can_generate" disp2="_vm_object_alloc_events"
10256                        >
10257         <description>
10258           Can generate events on VM allocation of an object
10259         </description>
10260       </capabilityfield>
10261       <capabilityfield id="can_generate_native_method_bind_events"
10262                        disp1="can_generate" disp2="_native_method_bind_events"
10263                        >
10264         <description>
10265           Can generate events when a native method is bound to its
10266           implementation
10267         </description>
10268       </capabilityfield>
10269       <capabilityfield id="can_generate_garbage_collection_events"
10270                        disp1="can_generate" disp2="_garbage_collection_events"
10271                        >
10272         <description>
10273           Can generate events when garbage collection begins or ends
10274         </description>
10275       </capabilityfield>
10276       <capabilityfield id="can_generate_object_free_events"
10277                        disp1="can_generate" disp2="_object_free_events"
10278                        >
10279         <description>
10280           Can generate events when the garbage collector frees an object
10281         </description>
10282       </capabilityfield>
10283       <capabilityfield id="can_force_early_return" since="1.1">
10284         <description>
10285           Can return early from a method, as described in the
10286           <internallink id="ForceEarlyReturn">Force Early Return category</internallink>.
10287         </description>
10288       </capabilityfield>
10289       <capabilityfield id="can_get_owned_monitor_stack_depth_info" since="1.1">
10290         <description>
10291           Can get information about owned monitors with stack depth -
10292           <functionlink id="GetOwnedMonitorStackDepthInfo"></functionlink>
10293         </description>
10294       </capabilityfield>
10295       <capabilityfield id="can_get_constant_pool" since="1.1">
10296         <description>
10297           Can get the constant pool of a class -
10298           <functionlink id="GetConstantPool"></functionlink>
10299         </description>
10300       </capabilityfield>
10301       <capabilityfield id="can_set_native_method_prefix" since="1.1">
10302         <description>
10303           Can set prefix to be applied when native method cannot be resolved -
10304           <functionlink id="SetNativeMethodPrefix"/> and
10305           <functionlink id="SetNativeMethodPrefixes"/>
10306         </description>
10307       </capabilityfield>
10308       <capabilityfield id="can_retransform_classes" since="1.1">
10309         <description>
10310           Can retransform classes with <functionlink id="RetransformClasses"/>.
10311           In addition to the restrictions imposed by the specific
10312           implementation on this capability (see the
10313           <internallink id="capability">Capability</internallink> section),
10314           this capability must be set before the
10315           <eventlink id="ClassFileLoadHook"/> event is enabled for the
10316           first time in this environment.
10317           An environment that possesses this capability at the time that
10318           <code>ClassFileLoadHook</code> is enabled for the first time is
10319           said to be <i>retransformation capable</i>.
10320           An environment that does not possess this capability at the time that
10321           <code>ClassFileLoadHook</code> is enabled for the first time is
10322           said to be <i>retransformation incapable</i>.
10323         </description>
10324       </capabilityfield>
10325       <capabilityfield id="can_retransform_any_class" since="1.1">
10326         <description>
10327           <functionlink id="RetransformClasses"/> can be called on any modifiable class.
10328           See <functionlink id="IsModifiableClass"/>.
10329           (<fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
10330           must also be set)
10331         </description>
10332       </capabilityfield>
10333       <capabilityfield id="can_generate_resource_exhaustion_heap_events" since="1.1">
10334         <description>
10335           Can generate events when the VM is unable to allocate memory from
10336           the <tm>Java</tm> platform heap.
10337           See <eventlink id="ResourceExhausted"/>.
10338         </description>
10339       </capabilityfield>
10340       <capabilityfield id="can_generate_resource_exhaustion_threads_events" since="1.1">
10341         <description>
10342           Can generate events when the VM is unable to create a thread.
10343           See <eventlink id="ResourceExhausted"/>.
10344         </description>
10345       </capabilityfield>
10346       <capabilityfield id="can_generate_early_vmstart" since="9">
10347         <description>
10348           Can generate the <code>VMStart</code> event early.
10349           See <eventlink id="VMStart"/>.
10350         </description>
10351       </capabilityfield>
10352       <capabilityfield id="can_generate_early_class_hook_events" since="9">
10353         <description>
10354           Can generate the <eventlink id="ClassFileLoadHook"/> events
10355           in the primordial phase. If this capability and
10356           <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
10357           <code>can_generate_all_class_hook_events</code></internallink>
10358           are enabled then the <eventlink id="ClassFileLoadHook"/> events
10359           can be posted for classes loaded in the primordial phase.
10360           See <eventlink id="ClassFileLoadHook"/>.
10361         </description>
10362       </capabilityfield>
10363       <capabilityfield id="can_generate_sampled_object_alloc_events" since="11">
10364         <description>
10365           Can generate sampled allocation events.
10366           If this capability is enabled then the heap sampling method
10367           <functionlink id="SetHeapSamplingInterval"></functionlink> can be
10368           called and <eventlink id="SampledObjectAlloc"></eventlink> events can be generated.
10369         </description>
10370       </capabilityfield>
10371     </capabilitiestypedef>
10372 
10373     <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140">
10374       <synopsis>Get Potential Capabilities</synopsis>
10375       <description>
10376         Returns via <paramlink id="capabilities_ptr"></paramlink> the <jvmti/>
10377         features that can potentially be possessed by this environment
10378         at this time.
10379         The returned capabilities differ from the complete set of capabilities
10380         implemented by the VM in two cases: another environment possesses
10381         capabilities that can only be possessed by one environment, or the
10382         current <functionlink id="GetPhase">phase</functionlink> is live,
10383         and certain capabilities can only be added during the <code>OnLoad</code> phase.
10384         The <functionlink id="AddCapabilities"></functionlink> function
10385         may be used to set any or all or these capabilities.
10386         Currently possessed capabilities are included.
10387         <p/>
10388         Typically this function is used in the <code>OnLoad</code> function.
10389         Some virtual machines may allow a limited set of capabilities to be
10390         added in the live phase.
10391         In this case, the set of potentially available capabilities
10392         will likely differ from the <code>OnLoad</code> phase set.
10393         <p/>
10394         See the
10395         <internallink id="capabilityExamples">Capability Examples</internallink>.
10396       </description>
10397       <origin>new</origin>
10398       <capabilities>
10399       </capabilities>
10400       <parameters>
10401         <param id="capabilities_ptr">
10402           <outptr><struct>jvmtiCapabilities</struct></outptr>
10403           <description>
10404             On return, points to the <jvmti/> capabilities that may be added.
10405           </description>
10406         </param>
10407       </parameters>
10408       <errors>
10409       </errors>
10410     </function>
10411 
10412     <elide>
10413     <function id="EstimateCostOfCapabilities" phase="onload" num="141">
10414       <synopsis>Estimate Cost Of Capabilities</synopsis>
10415       <description>
10416         <issue>There is strong opposition to this function.  The concern is
10417           that it would be difficult or impossible to provide meaningful
10418           numbers, as the amount of impact is conditional on many factors
10419           that a single number could not represent.  There is doubt that
10420           conditional implementations would be used or are even a good idea.
10421           The thought is that release documentation for the implementation
10422           would be the best means of exposing this information.
10423           Unless new arguments are presented, I intend to remove this
10424           function in the next revision.
10425         </issue>
10426         <p/>
10427         Return via the <paramlink id="time_impact_ptr"></paramlink> and
10428         <paramlink id="space_impact_ptr"></paramlink> an estimate of the impact
10429         of adding the capabilities pointed to by
10430         <paramlink id="capabilities_ptr"></paramlink>.
10431         The returned estimates are in percentage of additional overhead, thus
10432         a time impact of 100 mean the application might run
10433         at half the speed.
10434         The estimates are very rough approximations and are not guaranteed.
10435         Note also, that the estimates are of the impact of having the
10436         capability available--when and if it is used the impact may be
10437         much greater.
10438         Estimates can be for a single capability or for a set of
10439         capabilities.  Note that the costs are not necessarily additive,
10440         adding support for one capability might make another available
10441         for free or conversely having two capabilities at once may
10442         have multiplicative impact.
10443         Estimates are relative to the current set of capabilities -
10444         that is, how much more impact given the currently possessed capabilities.
10445         <p/>
10446         Typically this function is used in the OnLoad function,
10447         some virtual machines may allow a limited set of capabilities to be
10448         added in the live phase.
10449         In this case, the set of potentially available capabilities
10450         will likely differ from the OnLoad phase set.
10451         <p/>
10452         See the
10453         <internallink id="capabilityExamples">Capability Examples</internallink>.
10454       </description>
10455       <origin>new</origin>
10456       <capabilities>
10457       </capabilities>
10458       <parameters>
10459         <param id="capabilities_ptr">
10460           <inptr><struct>jvmtiCapabilities</struct></inptr>
10461           <description>
10462             points to the <jvmti/> capabilities to evaluate.
10463           </description>
10464         </param>
10465         <param id="time_impact_ptr">
10466           <outptr><jint/></outptr>
10467           <description>
10468             On return, points to the estimated percentage increase in
10469             run time if this capability was added.
10470           </description>
10471         </param>
10472         <param id="space_impact_ptr">
10473           <outptr><jint/></outptr>
10474           <description>
10475             On return, points to the estimated percentage increase in
10476             memory space used if this capability was added.
10477           </description>
10478         </param>
10479       </parameters>
10480       <errors>
10481         <error id="JVMTI_ERROR_NOT_AVAILABLE">
10482           The desired capabilities are not even potentially available.
10483         </error>
10484       </errors>
10485     </function>
10486     </elide>
10487 
10488     <function id="AddCapabilities" jkernel="yes" phase="onload" num="142">
10489       <synopsis>Add Capabilities</synopsis>
10490       <description>
10491         Set new capabilities by adding the capabilities
10492         whose values are set to one (<code>1</code>) in
10493         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10494         All previous capabilities are retained.
10495         Typically this function is used in the <code>OnLoad</code> function.
10496         Some virtual machines may allow a limited set of capabilities to be
10497         added in the live phase.
10498         <p/>
10499         See the
10500         <internallink id="capabilityExamples">Capability Examples</internallink>.
10501       </description>
10502       <origin>new</origin>
10503       <capabilities>
10504       </capabilities>
10505       <parameters>
10506         <param id="capabilities_ptr">
10507           <inptr><struct>jvmtiCapabilities</struct></inptr>
10508           <description>
10509             Points to the <jvmti/> capabilities to add.
10510           </description>
10511         </param>
10512       </parameters>
10513       <errors>
10514         <error id="JVMTI_ERROR_NOT_AVAILABLE">
10515           The desired capabilities are not even potentially available.
10516         </error>
10517       </errors>
10518     </function>
10519 
10520 
10521     <function id="RelinquishCapabilities" phase="onload" num="143">
10522       <synopsis>Relinquish Capabilities</synopsis>
10523       <description>
10524         Relinquish the capabilities
10525         whose values are set to one (<code>1</code>) in
10526         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10527         Some implementations may allow only one environment to have a capability
10528         (see the <internallink id="capability">capability introduction</internallink>).
10529         This function releases capabilities
10530         so that they may be used by other agents.
10531         All other capabilities are retained.
10532         The capability will no longer be present in <functionlink id="GetCapabilities"></functionlink>.
10533         Attempting to relinquish a capability that the agent does not possess is not an error.
10534           <issue>
10535             It is possible for the agent to be actively using capabilities
10536             which are being relinquished.  For example, a thread is currently
10537             suspended and can_suspend is being relinquished or an event is currently
10538             enabled and can_generate_whatever is being relinquished.
10539             There are three possible ways we could spec this:
10540             <ul>
10541               <li>relinquish automatically releases them</li>
10542               <li>relinquish checks and returns some error code if held</li>
10543               <li>it is the agent's responsibility and it is not checked</li>
10544             </ul>
10545             One of these should be chosen.
10546           </issue>
10547       </description>
10548       <origin>new</origin>
10549       <capabilities>
10550       </capabilities>
10551       <parameters>
10552         <param id="capabilities_ptr">
10553           <inptr><struct>jvmtiCapabilities</struct></inptr>
10554           <description>
10555             Points to the <jvmti/> capabilities to relinquish.
10556           </description>
10557         </param>
10558       </parameters>
10559       <errors>
10560       </errors>
10561     </function>
10562 
10563 
10564 
10565     <function id="GetCapabilities" jkernel="yes" phase="any" num="89">
10566       <synopsis>Get Capabilities</synopsis>
10567         <description>
10568           Returns via <paramlink id="capabilities_ptr"></paramlink> the optional <jvmti/>
10569           features which this environment currently possesses.
10570           Each possessed capability is indicated by a one (<code>1</code>) in the
10571           corresponding field of the <internallink id="jvmtiCapabilities">capabilities
10572           structure</internallink>.
10573           An environment does not possess a capability unless it has been successfully added with
10574           <functionlink id="AddCapabilities"/>.
10575           An environment only loses possession of a capability if it has been relinquished with
10576           <functionlink id="RelinquishCapabilities"/>. Thus, this function returns the net result
10577           of the <code>AddCapabilities</code> and <code>RelinquishCapabilities</code> calls which
10578           have been made.
10579           <p/>
10580           See the
10581           <internallink id="capabilityExamples">Capability Examples</internallink>.
10582         </description>
10583       <origin>jvmdiClone</origin>
10584       <capabilities>
10585       </capabilities>
10586       <parameters>
10587         <param id="capabilities_ptr">
10588           <outptr><struct>jvmtiCapabilities</struct></outptr>
10589           <description>
10590             On return, points to the <jvmti/> capabilities.
10591           </description>
10592         </param>
10593       </parameters>
10594       <errors>
10595       </errors>
10596     </function>
10597 
10598   </category>
10599 
10600 
10601   <category id="timers" label="Timers">
10602 
10603       <intro>
10604         These functions provide timing information.
10605         The resolution at which the time is updated is not specified.
10606         They provides nanosecond precision, but not necessarily nanosecond accuracy.
10607         Details about the timers, such as their maximum values, can be accessed with
10608         the timer information functions.
10609       </intro>
10610 
10611       <typedef id="jvmtiTimerInfo" label="Timer Info">
10612         <description>
10613           The information function for each timer returns this data structure.
10614         </description>
10615         <field id="max_value">
10616           <jlong/>
10617             <description>
10618               The maximum value the timer can reach.
10619               After this value is reached the timer wraps back to zero.
10620               This is an unsigned value.  If tested or printed as a jlong (signed value)
10621               it may appear to be a negative number.
10622             </description>
10623         </field>
10624         <field id="may_skip_forward">
10625           <jboolean/>
10626           <description>
10627             If true, the timer can be externally adjusted and as a result skip forward.
10628             If false, the timer value will never increase faster than real time.
10629           </description>
10630         </field>
10631         <field id="may_skip_backward">
10632           <jboolean/>
10633           <description>
10634             If true, the timer can be externally adjusted and as a result skip backward.
10635             If false, the timer value will be monotonically increasing.
10636           </description>
10637         </field>
10638         <field id="kind">
10639           <enum>jvmtiTimerKind</enum>
10640           <description>
10641             The kind of timer.
10642             On a platform that does not distinguish between user and system time, <datalink
10643                  id="JVMTI_TIMER_TOTAL_CPU"><code>JVMTI_TIMER_TOTAL_CPU</code></datalink>
10644             is returned.
10645           </description>
10646         </field>
10647         <field id="reserved1">
10648           <jlong/>
10649             <description>
10650               Reserved for future use.
10651             </description>
10652         </field>
10653         <field id="reserved2">
10654           <jlong/>
10655             <description>
10656               Reserved for future use.
10657             </description>
10658         </field>
10659       </typedef>
10660 
10661       <intro>
10662         Where the timer kind is --
10663 
10664         <constants id="jvmtiTimerKind" label="Timer Kinds" kind="enum">
10665           <constant id="JVMTI_TIMER_USER_CPU" num="30">
10666             CPU time that a thread is in user mode.
10667           </constant>
10668           <constant id="JVMTI_TIMER_TOTAL_CPU" num="31">
10669             CPU time that a thread is in user or system mode.
10670           </constant>
10671           <constant id="JVMTI_TIMER_ELAPSED" num="32">
10672             Elapsed time.
10673           </constant>
10674         </constants>
10675       </intro>
10676 
10677     <function id="GetCurrentThreadCpuTimerInfo" callbacksafe="safe"  impl="innative notrace" phase="start" num="134">
10678       <synopsis>Get Current Thread CPU Timer Information</synopsis>
10679       <description>
10680         Get information about the
10681         <functionlink id="GetCurrentThreadCpuTime"/> timer.
10682         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10683         are filled in with details about the timer.
10684         This information is specific to the platform and the implementation of
10685         <functionlink id="GetCurrentThreadCpuTime"/> and thus
10686         does not vary by thread nor does it vary
10687         during a particular invocation of the VM.
10688         <p/>
10689         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10690         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10691         returned by <code>GetCurrentThreadCpuTimerInfo</code>
10692         and <functionlink id="GetThreadCpuTimerInfo"/>
10693         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10694       </description>
10695       <origin>new</origin>
10696       <capabilities>
10697         <required id="can_get_current_thread_cpu_time">
10698             Can get current thread CPU time.
10699         </required>
10700       </capabilities>
10701       <parameters>
10702         <param id="info_ptr">
10703           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10704           <description>
10705             On return, filled with information describing the time
10706             returned by <functionlink id="GetCurrentThreadCpuTime"/>.
10707           </description>
10708         </param>
10709       </parameters>
10710       <errors>
10711       </errors>
10712     </function>
10713 
10714     <function id="GetCurrentThreadCpuTime" callbacksafe="safe" impl="innative notrace" phase="start" num="135">
10715       <synopsis>Get Current Thread CPU Time</synopsis>
10716       <description>
10717             Return the CPU time utilized by the current thread.
10718             <p/>
10719             Note that the <functionlink id="GetThreadCpuTime"/>
10720             function provides CPU time for any thread, including
10721             the current thread. <code>GetCurrentThreadCpuTime</code>
10722             exists to support platforms which cannot
10723             supply CPU time for threads other than the current
10724             thread or which have more accurate information for
10725             the current thread (see
10726             <functionlink id="GetCurrentThreadCpuTimerInfo"/> vs
10727             <functionlink id="GetThreadCpuTimerInfo"/>).
10728             On many platforms this call will be equivalent to:
10729 <example>
10730   GetThreadCpuTime(env, NULL, nanos_ptr)
10731 </example>
10732       </description>
10733       <origin>new</origin>
10734       <capabilities>
10735         <required id="can_get_current_thread_cpu_time">
10736             Can get current thread CPU time.
10737             <p/>
10738             If this capability is enabled after threads have started,
10739             the implementation may choose any time up
10740             to and including the time that the capability is enabled
10741             as the point where CPU time collection starts.
10742             <p/>
10743             This capability must be potentially available on any
10744             platform where
10745             <internallink id="jvmtiCapabilities.can_get_thread_cpu_time"><code>can_get_thread_cpu_time</code></internallink>
10746             is potentially available.
10747         </required>
10748       </capabilities>
10749       <parameters>
10750         <param id="nanos_ptr">
10751           <outptr><jlong/></outptr>
10752           <description>
10753             On return, points to the CPU time used by this thread
10754             in nanoseconds.
10755             This is an unsigned value.  If tested or printed as a jlong (signed value)
10756             it may appear to be a negative number.
10757           </description>
10758         </param>
10759       </parameters>
10760       <errors>
10761       </errors>
10762     </function>
10763 
10764     <function id="GetThreadCpuTimerInfo" num="136">
10765       <synopsis>Get Thread CPU Timer Information</synopsis>
10766       <description>
10767         Get information about the
10768         <functionlink id="GetThreadCpuTime"/> timer.
10769         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10770         are filled in with details about the timer.
10771         This information is specific to the platform and the implementation of
10772         <functionlink id="GetThreadCpuTime"/> and thus
10773         does not vary by thread nor does it vary
10774         during a particular invocation of the VM.
10775         <p/>
10776         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10777         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10778         returned by <functionlink id="GetCurrentThreadCpuTimerInfo"/>
10779         and <code>GetThreadCpuTimerInfo</code>
10780         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10781       </description>
10782       <origin>new</origin>
10783       <capabilities>
10784         <required id="can_get_thread_cpu_time">
10785             Can get thread CPU time.
10786         </required>
10787       </capabilities>
10788       <parameters>
10789         <param id="info_ptr">
10790           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10791           <description>
10792             On return, filled with information describing the time
10793             returned by <functionlink id="GetThreadCpuTime"/>.
10794           </description>
10795         </param>
10796       </parameters>
10797       <errors>
10798       </errors>
10799     </function>
10800 
10801     <function id="GetThreadCpuTime" num="137">
10802       <synopsis>Get Thread CPU Time</synopsis>
10803       <description>
10804           Return the CPU time utilized by the specified thread.
10805           <p/>
10806           Get information about this timer with
10807           <functionlink id="GetThreadCpuTimerInfo"/>.
10808       </description>
10809       <origin>new</origin>
10810       <capabilities>
10811         <required id="can_get_thread_cpu_time">
10812             Can get thread CPU time.
10813             <p/>
10814             If this capability is enabled after threads have started,
10815             the implementation may choose any time up
10816             to and including the time that the capability is enabled
10817             as the point where CPU time collection starts.
10818         </required>
10819       </capabilities>
10820       <parameters>
10821         <param id="thread">
10822           <jthread null="current"/>
10823             <description>
10824               The thread to query.
10825             </description>
10826         </param>
10827         <param id="nanos_ptr">
10828           <outptr><jlong/></outptr>
10829           <description>
10830             On return, points to the CPU time used by the specified thread
10831             in nanoseconds.
10832             This is an unsigned value.  If tested or printed as a jlong (signed value)
10833             it may appear to be a negative number.
10834           </description>
10835         </param>
10836       </parameters>
10837       <errors>
10838       </errors>
10839     </function>
10840 
10841     <function id="GetTimerInfo" phase="any" callbacksafe="safe" num="138">
10842       <synopsis>Get Timer Information</synopsis>
10843       <description>
10844         Get information about the
10845         <functionlink id="GetTime"/> timer.
10846         The fields of the <datalink id="jvmtiTimerInfo"/> structure
10847         are filled in with details about the timer.
10848         This information will not change during a particular invocation of the VM.
10849       </description>
10850       <origin>new</origin>
10851       <capabilities>
10852       </capabilities>
10853       <parameters>
10854         <param id="info_ptr">
10855           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10856           <description>
10857             On return, filled with information describing the time
10858             returned by <functionlink id="GetTime"/>.
10859           </description>
10860         </param>
10861       </parameters>
10862       <errors>
10863       </errors>
10864     </function>
10865 
10866     <function id="GetTime" phase="any" callbacksafe="safe" num="139">
10867       <synopsis>Get Time</synopsis>
10868       <description>
10869           Return the current value of the system timer, in nanoseconds.
10870           <p/>
10871           The value returned represents nanoseconds since some fixed but
10872           arbitrary time (perhaps in the future, so values may be
10873           negative).  This function provides nanosecond precision, but not
10874           necessarily nanosecond accuracy. No guarantees are made about
10875           how frequently values change.
10876           <p/>
10877           Get information about this timer with
10878           <functionlink id="GetTimerInfo"/>.
10879       </description>
10880       <origin>new</origin>
10881       <capabilities>
10882       </capabilities>
10883       <parameters>
10884         <param id="nanos_ptr">
10885           <outptr><jlong/></outptr>
10886           <description>
10887             On return, points to the time in nanoseconds.
10888             This is an unsigned value.  If tested or printed as a jlong (signed value)
10889             it may appear to be a negative number.
10890           </description>
10891         </param>
10892       </parameters>
10893       <errors>
10894       </errors>
10895     </function>
10896 
10897     <function id="GetAvailableProcessors" phase="any" num="144">
10898       <synopsis>Get Available Processors</synopsis>
10899       <description>
10900           Returns the number of processors available to the Java virtual machine.
10901           <p/>
10902           This value may change during a particular invocation of the virtual machine.
10903           Applications that are sensitive to the number of available processors should
10904           therefore occasionally poll this property.
10905       </description>
10906       <origin>new</origin>
10907       <capabilities>
10908       </capabilities>
10909       <parameters>
10910         <param id="processor_count_ptr">
10911           <outptr><jint/></outptr>
10912           <description>
10913             On return, points to the maximum number of processors available to the
10914             virtual machine; never smaller than one.
10915           </description>
10916         </param>
10917       </parameters>
10918       <errors>
10919       </errors>
10920     </function>
10921 
10922   </category>
10923 
10924 
10925   <category id="classLoaderSearch" label="Class Loader Search">
10926 
10927     <intro>
10928       These functions allow the agent to add to the locations that a class loader searches for a class.
10929       This is useful for installing instrumentation under the correct class loader.
10930     </intro>
10931 
10932     <function id="AddToBootstrapClassLoaderSearch" jkernel="yes" phase="onload" num="149">
10933       <synopsis>Add To Bootstrap Class Loader Search</synopsis>
10934       <description>
10935           This function can be used to cause instrumentation classes to be defined by the
10936           bootstrap class loader. See <vmspec chapter="5.3.1"/>.
10937           After the bootstrap
10938           class loader unsuccessfully searches for a class, the specified platform-dependent
10939           search path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in
10940           the <paramlink id="segment"/>. This function may be called multiple times to add multiple segments,
10941           the segments will be searched in the order that this function was called.
10942           <p/>
10943           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
10944           search path segment to be searched after the bootstrap class loader unsuccessfully searches
10945           for a class. The segment is typically a directory or JAR file.
10946           <p/>
10947           In the live phase the <paramlink id="segment"/> may be used to specify any platform-dependent
10948           path to a <externallink id="jar/jar.html">
10949           JAR file</externallink>. The agent should take care that the JAR file does not
10950           contain any classes or resources other than those to be defined by the bootstrap
10951           class loader for the purposes of instrumentation.
10952           <p/>
10953           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
10954           reference that the Java virtual machine has previously unsuccessfully attempted
10955           to resolve always fails with the same error that was thrown as a result of the
10956           initial resolution attempt. Consequently, if the JAR file contains an entry
10957           that corresponds to a class for which the Java virtual machine has
10958           unsuccessfully attempted to resolve a reference, then subsequent attempts to
10959           resolve that reference will fail with the same error as the initial attempt.
10960       </description>
10961       <origin>new</origin>
10962       <capabilities>
10963       </capabilities>
10964       <parameters>
10965         <param id="segment">
10966           <inbuf><char/></inbuf>
10967           <description>
10968             The platform-dependent search path segment, encoded as a
10969             <internallink id="mUTF">modified UTF-8</internallink> string.
10970           </description>
10971         </param>
10972       </parameters>
10973       <errors>
10974         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
10975           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
10976            existing JAR file is an invalid path.
10977         </error>
10978       </errors>
10979     </function>
10980 
10981     <function id="AddToSystemClassLoaderSearch" jkernel="yes" phase="onload" num="151" since="1.1">
10982       <synopsis>Add To System Class Loader Search</synopsis>
10983       <description>
10984           This function can be used to cause instrumentation classes to be
10985           defined by the system class loader. See <vmspec chapter="5.3.2"/>.
10986           After the class loader unsuccessfully searches for a class, the specified platform-dependent search
10987           path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in the
10988           <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, the
10989           segments will be searched in the order that this function was called.
10990           <p/>
10991           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent
10992           search path segment to be searched after the system class loader unsuccessfully searches
10993           for a class. The segment is typically a directory or JAR file.
10994           <p/>
10995           In the live phase the <paramlink id="segment"/> is a platform-dependent path to a
10996           <externallink id="jar/jar.html">JAR file</externallink> to be
10997           searched after the system class loader unsuccessfully searches for a class. The agent should
10998           take care that the JAR file does not contain any classes or resources other than those to be
10999           defined by the system class loader for the purposes of instrumentation.
11000           <p/>
11001           In the live phase the system class loader supports adding a JAR file to be searched if
11002           the system class loader implements a method name <code>appendToClassPathForInstrumentation</code>
11003           which takes a single parameter of type <code>java.lang.String</code>. The method is not required
11004           to have <code>public</code> access.
11005           <p/>
11006           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
11007           reference that the Java virtual machine has previously unsuccessfully attempted
11008           to resolve always fails with the same error that was thrown as a result of the
11009           initial resolution attempt. Consequently, if the JAR file contains an entry
11010           that corresponds to a class for which the Java virtual machine has
11011           unsuccessfully attempted to resolve a reference, then subsequent attempts to
11012           resolve that reference will fail with the same error as the initial attempt.
11013       </description>
11014       <origin>new</origin>
11015       <capabilities>
11016       </capabilities>
11017       <parameters>
11018         <param id="segment">
11019           <inbuf><char/></inbuf>
11020           <description>
11021             The platform-dependent search path segment, encoded as a
11022             <internallink id="mUTF">modified UTF-8</internallink> string.
11023           </description>
11024         </param>
11025       </parameters>
11026       <errors>
11027         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11028           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
11029            existing JAR file is an invalid path.
11030         </error>
11031         <error id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED">
11032           Operation not supported by the system class loader.
11033         </error>
11034       </errors>
11035     </function>
11036 
11037   </category>
11038 
11039 
11040   <category id="props" label="System Properties">
11041 
11042     <intro>
11043       These functions get and set system properties.
11044     </intro>
11045 
11046     <function id="GetSystemProperties" phase="onload" num="130">
11047       <synopsis>Get System Properties</synopsis>
11048       <description>
11049         The list of VM system property keys which may be used with
11050         <functionlink id="GetSystemProperty"/> is returned.
11051         It is strongly recommended that virtual machines provide the
11052         following property keys:
11053         <ul>
11054           <li><code>java.vm.vendor</code></li>
11055           <li><code>java.vm.version</code></li>
11056           <li><code>java.vm.name</code></li>
11057           <li><code>java.vm.info</code></li>
11058           <li><code>java.library.path</code></li>
11059           <li><code>java.class.path</code></li>
11060         </ul>
11061         Provides access to system properties defined by and used
11062         by the VM.
11063         Properties set on the command-line are included.
11064         This allows getting and setting of these properties
11065         before the VM even begins executing bytecodes.
11066         Since this is a VM view of system properties, the set of available
11067         properties will usually be different than that
11068         in <code>java.lang.System.getProperties</code>.
11069         JNI method invocation may be used to access
11070         <code>java.lang.System.getProperties</code>.
11071         <p/>
11072         The set of properties may grow during execution.
11073       </description>
11074       <origin>new</origin>
11075       <capabilities>
11076       </capabilities>
11077       <parameters>
11078         <param id="count_ptr">
11079           <outptr><jint/></outptr>
11080           <description>
11081             On return, points to the number of property keys returned.
11082           </description>
11083         </param>
11084         <param id="property_ptr">
11085           <allocallocbuf outcount="count_ptr"><char/></allocallocbuf>
11086           <description>
11087             On return, points to an array of property keys, encoded as
11088             <internallink id="mUTF">modified UTF-8</internallink> strings.
11089           </description>
11090         </param>
11091       </parameters>
11092       <errors>
11093       </errors>
11094     </function>
11095 
11096     <function id="GetSystemProperty" phase="onload" num="131">
11097       <synopsis>Get System Property</synopsis>
11098       <description>
11099         Return a VM system property value given the property key.
11100         <p/>
11101         The function <functionlink id="GetSystemProperties"/>
11102         returns the set of property keys which may be used.
11103         The properties which can be retrieved may grow during
11104         execution.
11105         <p/>
11106         Since this is a VM view of system properties, the values
11107         of properties may differ from that returned by
11108         <code>java.lang.System.getProperty(String)</code>.
11109         A typical VM might copy the values of the VM system
11110         properties into the <code>Properties</code> held by
11111         <code>java.lang.System</code> during the initialization
11112         of that class. Thereafter any changes to the VM system
11113         properties (with <functionlink id="SetSystemProperty"/>)
11114         or the <code>java.lang.System</code> system properties
11115         (with <code>java.lang.System.setProperty(String,String)</code>)
11116         would cause the values to diverge.
11117         JNI method invocation may be used to access
11118         <code>java.lang.System.getProperty(String)</code>.
11119       </description>
11120       <origin>new</origin>
11121       <capabilities>
11122       </capabilities>
11123       <parameters>
11124         <param id="property">
11125           <inbuf><char/></inbuf>
11126           <description>
11127             The key of the property to retrieve, encoded as a
11128             <internallink id="mUTF">modified UTF-8</internallink> string.
11129           </description>
11130         </param>
11131         <param id="value_ptr">
11132           <allocbuf><char/></allocbuf>
11133           <description>
11134             On return, points to the property value, encoded as a
11135             <internallink id="mUTF">modified UTF-8</internallink> string.
11136           </description>
11137         </param>
11138       </parameters>
11139       <errors>
11140         <error id="JVMTI_ERROR_NOT_AVAILABLE">
11141           This property is not available.
11142           Use <functionlink id="GetSystemProperties"/> to find available properties.
11143         </error>
11144       </errors>
11145     </function>
11146 
11147     <function id="SetSystemProperty" phase="onloadOnly" num="132">
11148       <synopsis>Set System Property</synopsis>
11149       <description>
11150         Set a VM system property value.
11151         <p/>
11152         The function <functionlink id="GetSystemProperties"/>
11153         returns the set of property keys, some of these may be settable.
11154         See <functionlink id="GetSystemProperty"/>.
11155       </description>
11156       <origin>new</origin>
11157       <capabilities>
11158       </capabilities>
11159       <parameters>
11160         <param id="property">
11161           <inbuf><char/></inbuf>
11162           <description>
11163             The key of the property, encoded as a
11164             <internallink id="mUTF">modified UTF-8</internallink> string.
11165           </description>
11166         </param>
11167         <param id="value_ptr">
11168           <inbuf>
11169             <char/>
11170             <nullok>
11171               do not set the value, but return <errorlink id="JVMTI_ERROR_NOT_AVAILABLE"/>
11172               if the property is not writeable
11173             </nullok>
11174           </inbuf>
11175           <description>
11176             The property value to set, encoded as a
11177             <internallink id="mUTF">modified UTF-8</internallink> string.
11178           </description>
11179         </param>
11180       </parameters>
11181       <errors>
11182         <error id="JVMTI_ERROR_NOT_AVAILABLE">
11183           This property is not available or is not writeable.
11184         </error>
11185       </errors>
11186     </function>
11187 
11188   </category>
11189 
11190   <category id="general" label="General">
11191 
11192     <intro>
11193     </intro>
11194 
11195     <function id="GetPhase" jkernel="yes" phase="any" num="133">
11196       <synopsis>Get Phase</synopsis>
11197       <description>
11198           Return the current phase of VM execution.
11199           The phases proceed in sequence:
11200           <constants id="jvmtiPhase" label="Phases of execution" kind="enum">
11201             <constant id="JVMTI_PHASE_ONLOAD" num="1">
11202               <code>OnLoad</code> phase: while in the
11203               <internallink id="onload"><code>Agent_OnLoad</code></internallink>
11204               or, for statically linked agents, the <internallink id="onload">
11205               <code>Agent_OnLoad_&lt;agent-lib-name&gt;
11206               </code></internallink> function.
11207             </constant>
11208             <constant id="JVMTI_PHASE_PRIMORDIAL" num="2">
11209               Primordial phase: between return from <code>Agent_OnLoad</code>
11210               or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> and the
11211               <code>VMStart</code> event.
11212             </constant>
11213             <constant id="JVMTI_PHASE_START" num="6">
11214               Start phase: when the <eventlink id="VMStart"><code>VMStart</code></eventlink> event
11215               is sent and until the <code>VMInit</code> event is sent.
11216             </constant>
11217             <constant id="JVMTI_PHASE_LIVE" num="4">
11218               Live phase: when the <eventlink id="VMInit"><code>VMInit</code></eventlink> event is sent
11219               and until the <eventlink id="VMDeath"></eventlink> event returns.
11220             </constant>
11221             <constant id="JVMTI_PHASE_DEAD" num="8">
11222               Dead phase: after the <eventlink id="VMDeath"></eventlink> event returns or after
11223               start-up failure.
11224             </constant>
11225           </constants>
11226           In the case of start-up failure the VM will proceed directly to the dead
11227           phase skipping intermediate phases and neither a <code>VMInit</code> nor
11228           <code>VMDeath</code> event will be sent.
11229           <p/>
11230           Most <jvmti/> functions operate only in the live phase.
11231           The following functions operate in either the <code>OnLoad</code> or live phases:
11232           <functionphaselist phase="onload"/>
11233           The following functions operate in only the <code>OnLoad</code> phase:
11234           <functionphaselist phase="onloadOnly"/>
11235           The following functions operate in the start or live phases:
11236           <functionphaselist phase="start"/>
11237           The following functions operate in any phase:
11238           <functionphaselist phase="any"/>
11239           JNI functions (except the Invocation API) must only be used in the start or live phases.
11240           <p/>
11241           Most <jvmti/> events are sent only in the live phase.
11242           The following events operate in others phases:
11243           <eventphaselist phase="start"/>
11244           <eventphaselist phase="any"/>
11245       </description>
11246       <origin>new</origin>
11247       <capabilities>
11248       </capabilities>
11249       <parameters>
11250         <param id="phase_ptr">
11251           <outptr><enum>jvmtiPhase</enum></outptr>
11252           <description>
11253             On return, points to the phase.
11254           </description>
11255         </param>
11256       </parameters>
11257       <errors>
11258       </errors>
11259     </function>
11260 
11261     <function id="DisposeEnvironment" jkernel="yes" phase="any" num="127">
11262       <synopsis>Dispose Environment</synopsis>
11263       <description>
11264         Shutdown a <jvmti/> connection created with JNI <code>GetEnv</code>
11265         (see <internallink id="environments"><jvmti/> Environments</internallink>).
11266         Dispose of any resources held by the environment.
11267         <issue>
11268             What resources are reclaimed? What is undone?
11269             Breakpoints,watchpoints removed?
11270         </issue>
11271         Threads suspended by this environment are not resumed by this call,
11272         this must be done explicitly by the agent.
11273         Memory allocated by this environment via calls to <jvmti/> functions
11274         is not released, this can be done explicitly by the agent
11275         by calling <functionlink id="Deallocate"/>.
11276         Raw monitors created by this environment are not destroyed,
11277         this can be done explicitly by the agent
11278         by calling <functionlink id="DestroyRawMonitor"/>.
11279         The state of threads waiting on raw monitors created by this environment
11280         are not affected.
11281         <p/>
11282         Any <functionlink id="SetNativeMethodPrefix">native method
11283         prefixes</functionlink> for this environment will be unset;
11284         the agent must remove any prefixed native methods before
11285         dispose is called.
11286         <p/>
11287         Any <internallink id="capability">capabilities</internallink>
11288         held by this environment are relinquished.
11289         <p/>
11290         Events enabled by this environment will no longer be sent, however
11291         event handlers currently running will continue to run.  Caution must
11292         be exercised in the design of event handlers whose environment may
11293         be disposed and thus become invalid during their execution.
11294         <p/>
11295         This environment may not be used after this call.
11296         This call returns to the caller.
11297       </description>
11298       <origin>new</origin>
11299       <capabilities>
11300       </capabilities>
11301       <parameters>
11302       </parameters>
11303       <errors>
11304       </errors>
11305     </function>
11306 
11307     <function id="SetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="148">
11308       <synopsis>Set Environment Local Storage</synopsis>
11309       <description>
11310         The VM stores a pointer value associated with each environment.
11311         This pointer value is called <i>environment-local storage</i>.
11312         This value is <code>NULL</code> unless set with this function.
11313         Agents can allocate memory in which they store environment specific
11314         information. By setting environment-local storage it can then be
11315         accessed with
11316         <functionlink id="GetEnvironmentLocalStorage"></functionlink>.
11317         <p/>
11318         Called by the agent to set the value of the <jvmti/>
11319         environment-local storage. <jvmti/> supplies to the agent a pointer-size
11320         environment-local storage that can be used to record per-environment
11321         information.
11322       </description>
11323       <origin>new</origin>
11324       <capabilities>
11325       </capabilities>
11326       <parameters>
11327         <param id="data">
11328           <inbuf>
11329             <void/>
11330             <nullok>value is set to <code>NULL</code></nullok>
11331           </inbuf>
11332           <description>
11333             The value to be entered into the environment-local storage.
11334           </description>
11335         </param>
11336       </parameters>
11337       <errors>
11338       </errors>
11339     </function>
11340 
11341     <function id="GetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="147">
11342       <synopsis>Get Environment Local Storage</synopsis>
11343       <description>
11344         Called by the agent to get the value of the <jvmti/> environment-local
11345         storage.
11346       </description>
11347       <origin>new</origin>
11348       <capabilities>
11349       </capabilities>
11350       <parameters>
11351         <param id="data_ptr">
11352           <agentbuf><void/></agentbuf>
11353           <description>
11354             Pointer through which the value of the environment local
11355             storage is returned.
11356             If environment-local storage has not been set with
11357             <functionlink id="SetEnvironmentLocalStorage"></functionlink> returned
11358             pointer is <code>NULL</code>.
11359           </description>
11360         </param>
11361       </parameters>
11362       <errors>
11363       </errors>
11364     </function>
11365 
11366     <function id="GetVersionNumber" jkernel="yes" phase="any" num="88">
11367       <synopsis>Get Version Number</synopsis>
11368       <description>
11369         Return the <jvmti/> version via <code>version_ptr</code>.
11370         The return value is the version identifier.
11371         The version identifier includes major, minor and micro
11372         version as well as the interface type.
11373         <constants id="jvmtiVersionInterfaceTypes" label="Version Interface Types" kind="bits">
11374           <constant id="JVMTI_VERSION_INTERFACE_JNI" num="0x00000000">
11375             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for JNI.
11376           </constant>
11377           <constant id="JVMTI_VERSION_INTERFACE_JVMTI" num="0x30000000">
11378             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for <jvmti/>.
11379           </constant>
11380         </constants>
11381         <constants id="jvmtiVersionMasks" label="Version Masks" kind="bits">
11382           <constant id="JVMTI_VERSION_MASK_INTERFACE_TYPE" num="0x70000000">
11383             Mask to extract interface type.
11384             The value of the version returned by this function masked with
11385             <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> is always
11386             <code>JVMTI_VERSION_INTERFACE_JVMTI</code>
11387             since this is a <jvmti/> function.
11388           </constant>
11389           <constant id="JVMTI_VERSION_MASK_MAJOR" num="0x0FFF0000">
11390             Mask to extract major version number.
11391           </constant>
11392           <constant id="JVMTI_VERSION_MASK_MINOR" num="0x0000FF00">
11393             Mask to extract minor version number.
11394           </constant>
11395           <constant id="JVMTI_VERSION_MASK_MICRO" num="0x000000FF">
11396             Mask to extract micro version number.
11397           </constant>
11398         </constants>
11399         <constants id="jvmtiVersionShifts" label="Version Shifts" kind="bits">
11400           <constant id="JVMTI_VERSION_SHIFT_MAJOR" num="16">
11401             Shift to extract major version number.
11402           </constant>
11403           <constant id="JVMTI_VERSION_SHIFT_MINOR" num="8">
11404             Shift to extract minor version number.
11405           </constant>
11406           <constant id="JVMTI_VERSION_SHIFT_MICRO" num="0">
11407             Shift to extract micro version number.
11408           </constant>
11409         </constants>
11410       </description>
11411       <origin>jvmdi</origin>
11412       <capabilities>
11413       </capabilities>
11414       <parameters>
11415         <param id="version_ptr">
11416           <outptr><jint/></outptr>
11417           <description>
11418             On return, points to the <jvmti/> version.
11419           </description>
11420         </param>
11421       </parameters>
11422       <errors>
11423       </errors>
11424     </function>
11425 
11426 
11427     <function id="GetErrorName" phase="any" num="128">
11428       <synopsis>Get Error Name</synopsis>
11429       <description>
11430         Return the symbolic name for an
11431           <internallink id="ErrorSection">error code</internallink>.
11432         <p/>
11433         For example
11434         <code>GetErrorName(env, JVMTI_ERROR_NONE, &amp;err_name)</code>
11435         would return in <code>err_name</code> the string
11436         <code>"JVMTI_ERROR_NONE"</code>.
11437       </description>
11438       <origin>new</origin>
11439       <capabilities>
11440       </capabilities>
11441       <parameters>
11442         <param id="error">
11443           <enum>jvmtiError</enum>
11444           <description>
11445             The error code.
11446           </description>
11447         </param>
11448         <param id="name_ptr">
11449           <allocbuf><char/></allocbuf>
11450           <description>
11451             On return, points to the error name.
11452             The name is encoded as a
11453             <internallink id="mUTF">modified UTF-8</internallink> string,
11454             but is restricted to the ASCII subset.
11455           </description>
11456         </param>
11457       </parameters>
11458       <errors>
11459       </errors>
11460     </function>
11461 
11462     <function id="SetVerboseFlag" phase="any" num="150">
11463       <synopsis>Set Verbose Flag</synopsis>
11464       <description>
11465         <constants id="jvmtiVerboseFlag" label="Verbose Flag Enumeration" kind="enum">
11466           <constant id="JVMTI_VERBOSE_OTHER" num="0">
11467             Verbose output other than the below.
11468           </constant>
11469           <constant id="JVMTI_VERBOSE_GC" num="1">
11470             Verbose garbage collector output, like that specified with <code>-verbose:gc</code>.
11471           </constant>
11472           <constant id="JVMTI_VERBOSE_CLASS" num="2">
11473             Verbose class loading output, like that specified with <code>-verbose:class</code>.
11474           </constant>
11475           <constant id="JVMTI_VERBOSE_JNI" num="4">
11476             Verbose JNI output, like that specified with <code>-verbose:jni</code>.
11477           </constant>
11478         </constants>
11479         Control verbose output.
11480         This is the output which typically is sent to <code>stderr</code>.
11481       </description>
11482       <origin>new</origin>
11483       <capabilities>
11484       </capabilities>
11485       <parameters>
11486         <param id="flag">
11487           <enum>jvmtiVerboseFlag</enum>
11488           <description>
11489             Which verbose flag to set.
11490           </description>
11491         </param>
11492         <param id="value">
11493           <jboolean/>
11494           <description>
11495             New value of the flag.
11496           </description>
11497         </param>
11498       </parameters>
11499       <errors>
11500       </errors>
11501     </function>
11502 
11503 
11504     <function id="GetJLocationFormat" phase="any" num="129">
11505       <synopsis>Get JLocation Format</synopsis>
11506       <description>
11507         Although the greatest functionality is achieved with location information
11508         referencing the virtual machine bytecode index, the definition of
11509         <code>jlocation</code> has intentionally been left unconstrained to allow VM
11510         implementations that do not have this information.
11511         <p/>
11512         This function describes the representation of <code>jlocation</code> used in this VM.
11513         If the returned format is <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>,
11514         <code>jlocation</code>s can
11515         be used as in indices into the array returned by
11516         <functionlink id="GetBytecodes"></functionlink>.
11517         <constants id="jvmtiJlocationFormat" label="JLocation Format Enumeration" kind="enum">
11518           <constant id="JVMTI_JLOCATION_JVMBCI" num="1">
11519             <code>jlocation</code> values represent virtual machine
11520             bytecode indices--that is, offsets into the
11521             virtual machine code for a method.
11522           </constant>
11523           <constant id="JVMTI_JLOCATION_MACHINEPC" num="2">
11524             <code>jlocation</code> values represent native machine
11525             program counter values.
11526           </constant>
11527           <constant id="JVMTI_JLOCATION_OTHER" num="0">
11528             <code>jlocation</code> values have some other representation.
11529           </constant>
11530         </constants>
11531       </description>
11532       <origin>new</origin>
11533       <capabilities>
11534       </capabilities>
11535       <parameters>
11536         <param id="format_ptr">
11537           <outptr><enum>jvmtiJlocationFormat</enum></outptr>
11538           <description>
11539             On return, points to the format identifier for <code>jlocation</code> values.
11540           </description>
11541         </param>
11542       </parameters>
11543       <errors>
11544       </errors>
11545     </function>
11546 
11547   </category>
11548 
11549   <category id="heap_monitoring" label="Heap Monitoring">
11550     <function id="SetHeapSamplingInterval" phase="onload" num="156" since="11">
11551       <synopsis>Set Heap Sampling Interval</synopsis>
11552       <description>
11553         Generate a <eventlink id="SampledObjectAlloc"/> event when objects are allocated.
11554         Each thread keeps a counter of bytes allocated. The event will only be generated
11555         when that counter exceeds an average of <paramlink id="sampling_interval"></paramlink>
11556         since the last sample.
11557         <p/>
11558         Setting <paramlink id="sampling_interval"></paramlink> to 0 will cause an event to be
11559         generated by each allocation supported by the system once the new interval is taken into account.
11560         <p/>
11561         Note that updating the new sampling interval might take various number of allocations
11562         to provoke internal data structure updates.  Therefore it is important to
11563         consider the sampling interval as an average. This includes the interval 0, where events
11564         might not be generated straight away for each allocation.
11565       </description>
11566       <origin>new</origin>
11567       <capabilities>
11568         <required id="can_generate_sampled_object_alloc_events"></required>
11569       </capabilities>
11570       <parameters>
11571         <param id="sampling_interval">
11572           <jint/>
11573           <description>
11574             The sampling interval in bytes. The sampler uses a statistical approach to
11575             generate an event, on average, once for every <paramlink id="sampling_interval"/> bytes of
11576             memory allocated by a given thread.
11577             <p/>
11578             Once the new sampling interval is taken into account, 0 as a sampling interval will generate
11579             a sample for every allocation.
11580             <p/>
11581             Note: The overhead of this feature is directly correlated with the sampling interval.
11582             A high sampling interval, such as 1024 bytes, will incur a high overhead.
11583             A lower interval, such as 1024KB, will have a much lower overhead.  Sampling should only
11584             be used with an understanding that it may impact performance.
11585           </description>
11586         </param>
11587       </parameters>
11588       <errors>
11589         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11590           <paramlink id="sampling_interval"></paramlink> is less than zero.
11591         </error>
11592       </errors>
11593     </function>
11594   </category>
11595 
11596 </functionsection>
11597 
11598 <errorsection label="Error Reference">
11599   <intro>
11600     Every <jvmti/> function returns a <b><code>jvmtiError</code></b> error code.
11601     <p/>
11602     It is the responsibility of the agent to call <jvmti/> functions with
11603     valid parameters and in the proper context (calling thread is attached,
11604     phase is correct, etc.).
11605     Detecting some error conditions may be difficult, inefficient, or
11606     impossible for an implementation.
11607     The errors listed in
11608     <internallink id="reqerrors">Function Specific Required Errors</internallink>
11609     must be detected by the implementation.
11610     All other errors represent the recommended response to the error
11611     condition.
11612   </intro>
11613 
11614   <errorcategory id="universal-error" label="Universal Errors">
11615     <intro>
11616       The following errors may be returned by any function
11617     </intro>
11618 
11619     <errorid id="JVMTI_ERROR_NONE" num="0">
11620       No error has occurred.  This is the error code that is returned
11621       on successful completion of the function.
11622     </errorid>
11623     <errorid id="JVMTI_ERROR_NULL_POINTER" num="100">
11624       Pointer is unexpectedly <code>NULL</code>.
11625     </errorid>
11626     <errorid id="JVMTI_ERROR_OUT_OF_MEMORY" num="110">
11627       The function attempted to allocate memory and no more memory was
11628       available for allocation.
11629     </errorid>
11630     <errorid id="JVMTI_ERROR_ACCESS_DENIED" num="111">
11631       The desired functionality has not been enabled in this virtual machine.
11632     </errorid>
11633     <errorid id="JVMTI_ERROR_UNATTACHED_THREAD" num="115">
11634       The thread being used to call this function is not attached
11635       to the virtual machine.  Calls must be made from attached threads.
11636       See <code>AttachCurrentThread</code> in the JNI invocation API.
11637     </errorid>
11638     <errorid id="JVMTI_ERROR_INVALID_ENVIRONMENT" num="116">
11639       The <jvmti/> environment provided is no longer connected or is
11640       not an environment.
11641     </errorid>
11642     <errorid id="JVMTI_ERROR_WRONG_PHASE" num="112">
11643       The desired functionality is not available in the current
11644         <functionlink id="GetPhase">phase</functionlink>.
11645       Always returned if the virtual machine has completed running.
11646     </errorid>
11647     <errorid id="JVMTI_ERROR_INTERNAL" num="113">
11648       An unexpected internal error has occurred.
11649     </errorid>
11650   </errorcategory>
11651 
11652   <errorcategory id="reqerrors" label="Function Specific Required Errors">
11653     <intro>
11654       The following errors are returned by some <jvmti/> functions and must
11655       be returned by the implementation when the condition occurs.
11656     </intro>
11657 
11658     <errorid id="JVMTI_ERROR_INVALID_PRIORITY" num="12">
11659       Invalid priority.
11660     </errorid>
11661     <errorid id="JVMTI_ERROR_THREAD_NOT_SUSPENDED" num="13">
11662       Thread was not suspended.
11663     </errorid>
11664     <errorid id="JVMTI_ERROR_THREAD_SUSPENDED" num="14">
11665       Thread already suspended.
11666     </errorid>
11667     <errorid id="JVMTI_ERROR_THREAD_NOT_ALIVE" num="15">
11668       This operation requires the thread to be alive--that is,
11669       it must be started and not yet have died.
11670     </errorid>
11671     <errorid id="JVMTI_ERROR_CLASS_NOT_PREPARED" num="22">
11672       The class has been loaded but not yet prepared.
11673     </errorid>
11674     <errorid id="JVMTI_ERROR_NO_MORE_FRAMES" num="31">
11675       There are no Java programming language or JNI stack frames at the specified depth.
11676     </errorid>
11677     <errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32">
11678       Information about the frame is not available (e.g. for native frames).
11679     </errorid>
11680     <errorid id="JVMTI_ERROR_DUPLICATE" num="40">
11681       Item already set.
11682     </errorid>
11683     <errorid id="JVMTI_ERROR_NOT_FOUND" num="41">
11684       Desired element (e.g. field or breakpoint) not found
11685     </errorid>
11686     <errorid id="JVMTI_ERROR_NOT_MONITOR_OWNER" num="51">
11687       This thread doesn't own the raw monitor.
11688     </errorid>
11689     <errorid id="JVMTI_ERROR_INTERRUPT" num="52">
11690       The call has been interrupted before completion.
11691     </errorid>
11692     <errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79">
11693       The class cannot be modified.
11694     </errorid>
11695     <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80">
11696       The module cannot be modified.
11697     </errorid>
11698     <errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98">
11699       The functionality is not available in this virtual machine.
11700     </errorid>
11701     <errorid id="JVMTI_ERROR_ABSENT_INFORMATION" num="101">
11702       The requested information is not available.
11703     </errorid>
11704     <errorid id="JVMTI_ERROR_INVALID_EVENT_TYPE" num="102">
11705       The specified event type ID is not recognized.
11706     </errorid>
11707     <errorid id="JVMTI_ERROR_NATIVE_METHOD" num="104">
11708       The requested information is not available for native method.
11709     </errorid>
11710     <errorid id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED" num="106">
11711       The class loader does not support this operation.
11712     </errorid>
11713   </errorcategory>
11714 
11715   <errorcategory id="function-specific-errors" label="Function Specific Agent Errors">
11716     <intro>
11717       The following errors are returned by some <jvmti/> functions.
11718       They are returned in the event of invalid parameters passed by the
11719       agent or usage in an invalid context.
11720       An implementation is not required to detect these errors.
11721     </intro>
11722 
11723     <errorid id="JVMTI_ERROR_INVALID_THREAD" num="10">
11724       The passed thread is not a valid thread.
11725     </errorid>
11726     <errorid id="JVMTI_ERROR_INVALID_FIELDID" num="25">
11727       Invalid field.
11728     </errorid>
11729     <errorid id="JVMTI_ERROR_INVALID_MODULE" num="26">
11730       Invalid module.
11731     </errorid>
11732     <errorid id="JVMTI_ERROR_INVALID_METHODID" num="23">
11733       Invalid method.
11734     </errorid>
11735     <errorid id="JVMTI_ERROR_INVALID_LOCATION" num="24">
11736       Invalid location.
11737     </errorid>
11738     <errorid id="JVMTI_ERROR_INVALID_OBJECT" num="20">
11739       Invalid object.
11740     </errorid>
11741     <errorid id="JVMTI_ERROR_INVALID_CLASS" num="21">
11742       Invalid class.
11743     </errorid>
11744     <errorid id="JVMTI_ERROR_TYPE_MISMATCH" num="34">
11745       The variable is not an appropriate type for the function used.
11746     </errorid>
11747     <errorid id="JVMTI_ERROR_INVALID_SLOT" num="35">
11748       Invalid slot.
11749     </errorid>
11750     <errorid id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY" num="99">
11751       The capability being used is false in this environment.
11752     </errorid>
11753     <errorid id="JVMTI_ERROR_INVALID_THREAD_GROUP" num="11">
11754       Thread group invalid.
11755     </errorid>
11756     <errorid id="JVMTI_ERROR_INVALID_MONITOR" num="50">
11757       Invalid raw monitor.
11758     </errorid>
11759     <errorid id="JVMTI_ERROR_ILLEGAL_ARGUMENT" num="103">
11760       Illegal argument.
11761     </errorid>
11762     <errorid id="JVMTI_ERROR_INVALID_TYPESTATE" num="65">
11763       The state of the thread has been modified, and is now inconsistent.
11764     </errorid>
11765     <errorid id="JVMTI_ERROR_UNSUPPORTED_VERSION" num="68">
11766       A new class file has a version number not supported by this VM.
11767     </errorid>
11768     <errorid id="JVMTI_ERROR_INVALID_CLASS_FORMAT" num="60">
11769       A new class file is malformed (the VM would return a <code>ClassFormatError</code>).
11770     </errorid>
11771     <errorid id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION" num="61">
11772       The new class file definitions would lead to a circular
11773       definition (the VM would return a <code>ClassCircularityError</code>).
11774     </errorid>
11775     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED" num="63">
11776       A new class file would require adding a method.
11777     </errorid>
11778     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED" num="64">
11779       A new class version changes a field.
11780     </errorid>
11781     <errorid id="JVMTI_ERROR_FAILS_VERIFICATION" num="62">
11782       The class bytes fail verification.
11783     </errorid>
11784     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED" num="66">
11785       A direct superclass is different for the new class
11786       version, or the set of directly implemented
11787       interfaces is different.
11788     </errorid>
11789     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED" num="67">
11790       A new class version does not declare a method
11791       declared in the old class version.
11792     </errorid>
11793     <errorid id="JVMTI_ERROR_NAMES_DONT_MATCH" num="69">
11794       The class name defined in the new class file is
11795       different from the name in the old class object.
11796     </errorid>
11797     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED" num="70">
11798       A new class version has different modifiers.
11799     </errorid>
11800     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED" num="71">
11801       A method in the new class version has different modifiers
11802       than its counterpart in the old class version.
11803     </errorid>
11804     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED" num="72">
11805       A new class version has unsupported differences in class attributes.
11806     </errorid>
11807   </errorcategory>
11808 </errorsection>
11809 
11810 <eventsection label="Events">
11811   <intro label="Handling Events" id="eventIntro">
11812     Agents can be informed of many events that occur in application
11813     programs.
11814     <p/>
11815     To handle events, designate a set of callback functions with
11816     <functionlink id="SetEventCallbacks"></functionlink>.
11817     For each event the corresponding callback function will be
11818     called.
11819     Arguments to the callback function provide additional
11820     information about the event.
11821     <p/>
11822     The callback function is usually called from within an application
11823     thread. The <jvmti/> implementation does not
11824     queue events in any way. This means
11825     that event callback functions must be written
11826     carefully. Here are some general guidelines. See
11827     the individual event descriptions for further
11828     suggestions.
11829     <p/>
11830     <ul>
11831       <li>Any exception thrown during the execution of an event callback can
11832         overwrite any current pending exception in the current application thread.
11833         Care must be taken to preserve a pending exception
11834         when an event callback makes a JNI call that might generate an exception.
11835       </li>
11836       <li>Event callback functions must be re-entrant. The <jvmti/> implementation does
11837         not queue events. If an agent needs to process events one at a time, it
11838         can use a raw monitor inside the
11839         event callback functions to serialize event processing.
11840       </li>
11841       <li>Event callback functions that execute JNI's FindClass function to load
11842         classes need to note that FindClass locates the class loader associated
11843         with the current native method. For the purposes of class loading, an
11844         event callback that includes a JNI environment as a parameter to the
11845         callback will treated as if it is a native call, where the native method
11846         is in the class of the event thread's current frame.
11847       </li>
11848     </ul>
11849     <p/>
11850     Some <jvmti/> events identify objects with JNI references.
11851     All references
11852     in <jvmti/> events are JNI local references and will become invalid
11853     after the event callback returns.
11854     Unless stated otherwise, memory referenced by pointers sent in event
11855     callbacks may not be referenced after the event callback returns.
11856     <p/>
11857     Except where stated otherwise, events are delivered on the thread
11858     that caused the event.
11859     Events are sent at the time they occur.
11860     The specification for each event includes the set of
11861     <functionlink id="GetPhase">phases</functionlink> in which it can be sent;
11862     if an event triggering activity occurs during another phase, no event
11863     is sent.
11864     <p/>
11865     A thread that generates an event does not change its execution status
11866     (for example, the event does not cause the thread to be suspended).
11867     If an agent wishes the event to result in suspension, then the agent
11868     is responsible for explicitly suspending the thread with
11869     <functionlink id="SuspendThread"></functionlink>.
11870     <p/>
11871     If an event is enabled in multiple environments, the event will be sent
11872     to each agent in the order that the environments were created.
11873   </intro>
11874 
11875   <intro label="Enabling Events" id="enablingevents">
11876     All events are initially disabled.  In order to receive any
11877     event:
11878       <ul>
11879         <li>
11880           If the event requires a capability, that capability must
11881           be added with
11882           <functionlink id="AddCapabilities"></functionlink>.
11883         </li>
11884         <li>
11885           A callback for the event must be set with
11886           <functionlink id="SetEventCallbacks"></functionlink>.
11887         </li>
11888         <li>
11889           The event must be enabled with
11890           <functionlink id="SetEventNotificationMode"></functionlink>.
11891         </li>
11892       </ul>
11893   </intro>
11894 
11895   <intro label="Multiple Co-located Events" id="eventorder">
11896     In many situations it is possible for multiple events to occur
11897     at the same location in one thread. When this happens, all the events
11898     are reported through the event callbacks in the order specified in this section.
11899     <p/>
11900     If the current location is at the entry point of a method, the
11901     <eventlink id="MethodEntry"></eventlink> event is reported before
11902     any other event at the current location in the same thread.
11903     <p/>
11904     If an exception catch has been detected at the current location,
11905     either because it is the beginning of a catch clause or a native method
11906     that cleared a pending exception has returned, the
11907     <code>exceptionCatch</code> event is reported before
11908     any other event at the current location in the same thread.
11909     <p/>
11910     If a <code>singleStep</code> event or
11911     <code>breakpoint</code> event is triggered at the
11912     current location, the event is defined to occur
11913     immediately before the code at the current location is executed.
11914     These events are reported before any events which are triggered
11915     by the execution of code at the current location in the same
11916     thread (specifically:
11917     <code>exception</code>,
11918     <code>fieldAccess</code>, and
11919     <code>fieldModification</code>).
11920     If both a step and breakpoint event are triggered for the same thread and
11921     location, the step event is reported before the breakpoint event.
11922     <p/>
11923     If the current location is the exit point of a method (that is, the last
11924     location before returning to the caller), the
11925     <eventlink id="MethodExit"></eventlink> event and
11926     the <eventlink id="FramePop"></eventlink> event (if requested)
11927     are reported after all other events at the current location in the same
11928     thread. There is no specified ordering of these two events
11929     with respect to each other.
11930     <p/>
11931     Co-located events can be triggered during the processing of some other
11932     event by the agent at the same location in the same thread.
11933     If such an event, of type <i>y</i>, is triggered during the processing of
11934     an event of type <i>x</i>, and if <i>x</i>
11935     precedes <i>y</i> in the ordering specified above, the co-located event
11936     <i>y</i> is reported for the current thread and location. If <i>x</i> does not precede
11937     <i>y</i>, <i>y</i> is not reported for the current thread and location.
11938     For example, if a breakpoint is set at the current location
11939     during the processing of <eventlink id="SingleStep"></eventlink>,
11940     that breakpoint will be reported before the thread moves off the current
11941     location.
11942     <p/>The following events are never considered to be co-located with
11943     other events.
11944     <ul>
11945       <li><eventlink id="VMStart"></eventlink></li>
11946       <li><eventlink id="VMInit"></eventlink></li>
11947       <li><eventlink id="VMDeath"></eventlink></li>
11948       <li><eventlink id="ThreadStart"></eventlink></li>
11949       <li><eventlink id="ThreadEnd"></eventlink></li>
11950       <li><eventlink id="ClassLoad"></eventlink></li>
11951       <li><eventlink id="ClassPrepare"></eventlink></li>
11952     </ul>
11953   </intro>
11954 
11955   <intro label="Event Callbacks" id="jvmtiEventCallbacks">
11956       The event callback structure below is used to specify the handler function
11957       for events.  It is set with the
11958       <functionlink id="SetEventCallbacks"></functionlink> function.
11959   </intro>
11960 
11961   <event label="Single Step"
11962          id="SingleStep" const="JVMTI_EVENT_SINGLE_STEP" filtered="thread" num="60">
11963     <description>
11964       Single step events allow the agent to trace thread execution
11965       at the finest granularity allowed by the VM. A single step event is
11966       generated whenever a thread reaches a new location.
11967       Typically, single step events represent the completion of one VM
11968       instruction as defined in <vmspec/>. However, some implementations
11969       may define locations differently. In any case the
11970       <code>method</code> and <code>location</code>
11971       parameters  uniquely identify the current location and allow
11972       the mapping to source file and line number when that information is
11973       available.
11974       <p/>
11975       No single step events are generated from within native methods.
11976     </description>
11977     <origin>jvmdi</origin>
11978     <capabilities>
11979       <required id="can_generate_single_step_events"></required>
11980     </capabilities>
11981     <parameters>
11982       <param id="jni_env">
11983         <outptr>
11984           <struct>JNIEnv</struct>
11985         </outptr>
11986           <description>
11987             The JNI environment of the event (current) thread
11988           </description>
11989       </param>
11990       <param id="thread">
11991         <jthread/>
11992           <description>
11993             Thread about to execution a new instruction
11994           </description>
11995       </param>
11996       <param id="klass">
11997         <jclass method="method"/>
11998           <description>
11999             Class of the method about to execute a new instruction
12000           </description>
12001       </param>
12002       <param id="method">
12003         <jmethodID class="klass"/>
12004           <description>
12005             Method about to execute a new instruction
12006           </description>
12007       </param>
12008       <param id="location">
12009         <jlocation/>
12010         <description>
12011           Location of the new instruction
12012         </description>
12013       </param>
12014     </parameters>
12015   </event>
12016 
12017   <event label="Breakpoint"
12018          id="Breakpoint" const="JVMTI_EVENT_BREAKPOINT" filtered="thread" num="62">
12019     <description>
12020       Breakpoint events are generated whenever a thread reaches a location
12021       designated as a breakpoint with <functionlink id="SetBreakpoint"></functionlink>.
12022       The <code>method</code> and <code>location</code>
12023       parameters uniquely identify the current location and allow
12024       the mapping to source file and line number when that information is
12025       available.
12026     </description>
12027     <origin>jvmdi</origin>
12028     <capabilities>
12029       <required id="can_generate_breakpoint_events"></required>
12030     </capabilities>
12031     <parameters>
12032       <param id="jni_env">
12033         <outptr>
12034           <struct>JNIEnv</struct>
12035         </outptr>
12036           <description>
12037             The JNI environment of the event (current) thread.
12038           </description>
12039       </param>
12040       <param id="thread">
12041         <jthread/>
12042           <description>
12043             Thread that hit the breakpoint
12044           </description>
12045       </param>
12046       <param id="klass">
12047         <jclass method="method"/>
12048           <description>
12049             Class of the method that hit the breakpoint
12050           </description>
12051       </param>
12052       <param id="method">
12053         <jmethodID class="klass"/>
12054           <description>
12055             Method that hit the breakpoint
12056           </description>
12057       </param>
12058       <param id="location">
12059         <jlocation/>
12060         <description>
12061           location of the breakpoint
12062         </description>
12063       </param>
12064     </parameters>
12065   </event>
12066 
12067   <event label="Field Access"
12068          id="FieldAccess" const="JVMTI_EVENT_FIELD_ACCESS" filtered="thread" num="63">
12069     <description>
12070       Field access events are generated whenever a thread accesses
12071       a field that was designated as a watchpoint
12072       with <functionlink id="SetFieldAccessWatch"></functionlink>.
12073       The <code>method</code> and <code>location</code>
12074       parameters uniquely identify the current location and allow
12075       the mapping to source file and line number when that information is
12076       available.
12077     </description>
12078     <origin>jvmdi</origin>
12079     <capabilities>
12080       <required id="can_generate_field_access_events"></required>
12081     </capabilities>
12082     <parameters>
12083       <param id="jni_env">
12084         <outptr>
12085           <struct>JNIEnv</struct>
12086         </outptr>
12087           <description>
12088             The JNI environment of the event (current) thread
12089           </description>
12090       </param>
12091       <param id="thread">
12092         <jthread/>
12093           <description>
12094             Thread accessing the field
12095           </description>
12096       </param>
12097       <param id="klass">
12098         <jclass method="method"/>
12099           <description>
12100             Class of the method where the access is occurring
12101           </description>
12102       </param>
12103       <param id="method">
12104         <jmethodID class="klass"/>
12105           <description>
12106             Method where the access is occurring
12107           </description>
12108       </param>
12109       <param id="location">
12110         <jlocation/>
12111         <description>
12112           Location where the access is occurring
12113         </description>
12114       </param>
12115       <param id="field_klass">
12116         <jclass field="field"/>
12117           <description>
12118             Class of the field being accessed
12119           </description>
12120       </param>
12121       <param id="object">
12122         <jobject/>
12123           <description>
12124             Object with the field being accessed if the field is an
12125             instance field; <code>NULL</code> otherwise
12126           </description>
12127       </param>
12128       <param id="field">
12129         <jfieldID class="field_klass"/>
12130           <description>
12131             Field being accessed
12132           </description>
12133       </param>
12134     </parameters>
12135   </event>
12136 
12137   <event label="Field Modification"
12138          id="FieldModification" const="JVMTI_EVENT_FIELD_MODIFICATION" filtered="thread" num="64">
12139     <description>
12140       Field modification events are generated whenever a thread modifies
12141       a field that was designated as a watchpoint
12142       with <functionlink id="SetFieldModificationWatch"></functionlink>.
12143       The <code>method</code> and <code>location</code>
12144       parameters uniquely identify the current location and allow
12145       the mapping to source file and line number when that information is
12146       available.
12147     </description>
12148     <origin>jvmdi</origin>
12149     <capabilities>
12150       <required id="can_generate_field_modification_events"></required>
12151     </capabilities>
12152     <parameters>
12153       <param id="jni_env">
12154         <outptr>
12155           <struct>JNIEnv</struct>
12156         </outptr>
12157           <description>
12158             The JNI environment of the event (current) thread
12159           </description>
12160       </param>
12161       <param id="thread">
12162         <jthread/>
12163           <description>
12164             Thread modifying the field
12165           </description>
12166       </param>
12167       <param id="klass">
12168         <jclass method="method"/>
12169           <description>
12170             Class of the method where the modification is occurring
12171           </description>
12172       </param>
12173       <param id="method">
12174         <jmethodID class="klass"/>
12175           <description>
12176             Method where the modification is occurring
12177           </description>
12178       </param>
12179       <param id="location">
12180         <jlocation/>
12181         <description>
12182           Location where the modification is occurring
12183         </description>
12184       </param>
12185       <param id="field_klass">
12186         <jclass field="field"/>
12187           <description>
12188             Class of the field being modified
12189           </description>
12190       </param>
12191       <param id="object">
12192         <jobject/>
12193           <description>
12194             Object with the field being modified if the field is an
12195             instance field; <code>NULL</code> otherwise
12196           </description>
12197       </param>
12198       <param id="field">
12199         <jfieldID class="field_klass"/>
12200           <description>
12201             Field being modified
12202           </description>
12203       </param>
12204       <param id="signature_type">
12205         <char/>
12206         <description>
12207           Signature type of the new value
12208         </description>
12209       </param>
12210       <param id="new_value">
12211         <jvalue/>
12212         <description>
12213           The new value
12214         </description>
12215       </param>
12216     </parameters>
12217   </event>
12218 
12219   <event label="Frame Pop"
12220          id="FramePop" const="JVMTI_EVENT_FRAME_POP" filtered="thread" num="61">
12221     <description>
12222       Frame pop events are generated upon exit from a single method
12223       in a single frame as specified
12224       in a call to <functionlink id="NotifyFramePop"></functionlink>.
12225       This is true whether termination is caused by
12226       executing its return instruction
12227       or by throwing an exception to its caller
12228       (see <paramlink id="was_popped_by_exception"></paramlink>).
12229       However, frame pops caused by the <functionlink id="PopFrame"/>
12230       function are not reported.
12231       <p/>
12232       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12233       identifies the executable location in the returning method,
12234       immediately prior to the return.
12235     </description>
12236     <origin>jvmdi</origin>
12237     <capabilities>
12238       <required id="can_generate_frame_pop_events"></required>
12239     </capabilities>
12240     <parameters>
12241       <param id="jni_env">
12242         <outptr>
12243           <struct>JNIEnv</struct>
12244         </outptr>
12245           <description>
12246             The JNI environment of the event (current) thread
12247           </description>
12248       </param>
12249       <param id="thread">
12250         <jthread/>
12251           <description>
12252             Thread that is popping the frame
12253           </description>
12254       </param>
12255       <param id="klass">
12256         <jclass method="method"/>
12257           <description>
12258             Class of the method being popped
12259           </description>
12260       </param>
12261       <param id="method">
12262         <jmethodID class="klass"/>
12263           <description>
12264             Method being popped
12265           </description>
12266       </param>
12267       <param id="was_popped_by_exception">
12268         <jboolean/>
12269         <description>
12270           True if frame was popped by a thrown exception.
12271           False if method exited through its return instruction.
12272         </description>
12273       </param>
12274     </parameters>
12275   </event>
12276 
12277   <event label="Method Entry"
12278          id="MethodEntry" const="JVMTI_EVENT_METHOD_ENTRY" filtered="thread" num="65">
12279     <description>
12280       Method entry events are generated upon entry of Java
12281       programming language methods (including native methods).
12282       <p/>
12283       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12284       identifies the initial executable location in
12285       the method.
12286       <p/>
12287       Enabling method
12288       entry or exit events will significantly degrade performance on many platforms and is thus
12289       not advised for performance critical usage (such as profiling).
12290       <internallink id="bci">Bytecode instrumentation</internallink> should be
12291       used in these cases.
12292     </description>
12293     <origin>jvmdi</origin>
12294     <capabilities>
12295       <required id="can_generate_method_entry_events"></required>
12296     </capabilities>
12297     <parameters>
12298       <param id="jni_env">
12299         <outptr>
12300           <struct>JNIEnv</struct>
12301         </outptr>
12302           <description>
12303             The JNI environment of the event (current) thread
12304           </description>
12305       </param>
12306       <param id="thread">
12307         <jthread/>
12308           <description>
12309             Thread entering the method
12310           </description>
12311       </param>
12312       <param id="klass">
12313         <jclass method="method"/>
12314           <description>
12315             Class of the method being entered
12316           </description>
12317       </param>
12318       <param id="method">
12319         <jmethodID class="klass"/>
12320           <description>
12321             Method being entered
12322           </description>
12323       </param>
12324     </parameters>
12325   </event>
12326 
12327   <event label="Method Exit"
12328          id="MethodExit" const="JVMTI_EVENT_METHOD_EXIT" filtered="thread" num="66">
12329     <description>
12330       Method exit events are generated upon exit from Java
12331       programming language methods (including native methods).
12332       This is true whether termination is caused by
12333       executing its return instruction
12334       or by throwing an exception to its caller
12335       (see <paramlink id="was_popped_by_exception"></paramlink>).
12336       <p/>
12337       The <code>method</code> field uniquely identifies the
12338       method being entered or exited. The <code>frame</code> field provides
12339       access to the stack frame for the method.
12340       <p/>
12341       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12342       identifies the executable location in the returning method
12343       immediately prior to the return.
12344       <p/>
12345         Enabling method
12346         entry or exit events will significantly degrade performance on many platforms and is thus
12347         not advised for performance critical usage (such as profiling).
12348         <internallink id="bci">Bytecode instrumentation</internallink> should be
12349         used in these cases.
12350     </description>
12351     <origin>jvmdi</origin>
12352     <capabilities>
12353       <required id="can_generate_method_exit_events"></required>
12354     </capabilities>
12355     <parameters>
12356       <param id="jni_env">
12357         <outptr>
12358           <struct>JNIEnv</struct>
12359         </outptr>
12360           <description>
12361             The JNI environment of the event (current) thread
12362           </description>
12363       </param>
12364       <param id="thread">
12365         <jthread/>
12366           <description>
12367             Thread exiting the method
12368           </description>
12369       </param>
12370       <param id="klass">
12371         <jclass method="method"/>
12372           <description>
12373             Class of the method being exited
12374           </description>
12375       </param>
12376       <param id="method">
12377         <jmethodID class="klass"/>
12378           <description>
12379             Method being exited
12380           </description>
12381       </param>
12382       <param id="was_popped_by_exception">
12383         <jboolean/>
12384         <description>
12385           True if frame was popped by a thrown exception.
12386           False if method exited through its return instruction.
12387         </description>
12388       </param>
12389       <param id="return_value">
12390         <jvalue/>
12391         <description>
12392           The return value of the method being exited.
12393           Undefined and should not be used if
12394           <paramlink id="was_popped_by_exception"></paramlink>
12395           is true.
12396         </description>
12397       </param>
12398     </parameters>
12399   </event>
12400 
12401   <event label="Native Method Bind" phase="any"
12402          id="NativeMethodBind" const="JVMTI_EVENT_NATIVE_METHOD_BIND" num="67">
12403     <description>
12404       A Native Method Bind event is sent when a VM binds a
12405       Java programming language native method
12406       to the address of a function that implements the native method.
12407       This will occur when the native method is called for the first time
12408       and also occurs when the JNI function <code>RegisterNatives</code> is called.
12409       This event allows the bind to be redirected to an agent-specified
12410       proxy function.
12411       This event is not sent when the native method is unbound.
12412       Typically, this proxy function will need to be specific to a
12413       particular method or, to handle the general case, automatically
12414       generated assembly code, since after instrumentation code is
12415       executed the function at the original binding
12416       address will usually be invoked.
12417       The original binding can be restored or the redirection changed
12418       by use of the JNI function <code>RegisterNatives</code>.
12419       Some events may be sent during the primordial phase, JNI and
12420       most of <jvmti/> cannot be used at this time but the method and
12421       address can be saved for use later.
12422     </description>
12423     <origin>new</origin>
12424     <capabilities>
12425       <required id="can_generate_native_method_bind_events"></required>
12426     </capabilities>
12427     <parameters>
12428       <param id="jni_env">
12429         <outptr>
12430           <struct>JNIEnv</struct>
12431         </outptr>
12432           <description>
12433             The JNI environment of the event (current) thread
12434             Will be <code>NULL</code> if sent during the primordial
12435             <functionlink id="GetPhase">phase</functionlink>.
12436           </description>
12437       </param>
12438       <param id="thread">
12439         <jthread/>
12440           <description>
12441             Thread requesting the bind
12442           </description>
12443       </param>
12444       <param id="klass">
12445         <jclass method="method"/>
12446           <description>
12447             Class of the method being bound
12448           </description>
12449       </param>
12450       <param id="method">
12451         <jmethodID class="klass"/>
12452           <description>
12453             Native method being bound
12454           </description>
12455       </param>
12456       <param id="address">
12457         <outptr><void/></outptr>
12458         <description>
12459           The address the VM is about to bind to--that is, the
12460           address of the implementation of the native method
12461         </description>
12462       </param>
12463       <param id="new_address_ptr">
12464         <agentbuf><void/></agentbuf>
12465         <description>
12466           if the referenced address is changed (that is, if
12467           <code>*new_address_ptr</code> is set), the binding
12468           will instead be made to the supplied address.
12469         </description>
12470       </param>
12471     </parameters>
12472   </event>
12473 
12474   <event label="Exception"
12475          id="Exception" const="JVMTI_EVENT_EXCEPTION" filtered="thread" num="58">
12476     <description>
12477       Exception events are generated whenever an exception is first detected
12478       in a Java programming language method.
12479       Where "exception" means any <code>java.lang.Throwable</code>.
12480       The exception may have been thrown by a Java programming language or native
12481       method, but in the case of native methods, the event is not generated
12482       until the exception is first seen by a Java programming language method. If an exception is
12483       set and cleared in a native method (and thus is never visible to Java programming language code),
12484       no exception event is generated.
12485       <p/>
12486       The <code>method</code> and <code>location</code>
12487       parameters  uniquely identify the current location
12488       (where the exception was detected) and allow
12489       the mapping to source file and line number when that information is
12490       available. The <code>exception</code> field identifies the thrown
12491       exception object. The <code>catch_method</code>
12492       and <code>catch_location</code> identify the location of the catch clause,
12493       if any, that handles the thrown exception. If there is no such catch clause,
12494       each field is set to 0. There is no guarantee that the thread will ever
12495       reach this catch clause. If there are native methods on the call stack
12496       between the throw location and the catch clause, the exception may
12497       be reset by one of those native methods.
12498       Similarly, exceptions that are reported as uncaught (<code>catch_klass</code>
12499       et al. set to 0) may in fact be caught by native code.
12500       Agents can check for these occurrences by monitoring
12501       <eventlink id="ExceptionCatch"></eventlink> events.
12502       Note that finally clauses are implemented as catch and re-throw. Therefore they
12503       will be reported in the catch location.
12504     </description>
12505     <origin>jvmdi</origin>
12506     <capabilities>
12507       <required id="can_generate_exception_events"></required>
12508     </capabilities>
12509     <parameters>
12510       <param id="jni_env">
12511         <outptr>
12512           <struct>JNIEnv</struct>
12513         </outptr>
12514           <description>
12515             The JNI environment of the event (current) thread
12516           </description>
12517       </param>
12518       <param id="thread">
12519         <jthread/>
12520           <description>
12521             Thread generating the exception
12522           </description>
12523       </param>
12524       <param id="klass">
12525         <jclass method="method"/>
12526           <description>
12527             Class generating the exception
12528           </description>
12529       </param>
12530       <param id="method">
12531         <jmethodID class="klass"/>
12532           <description>
12533             Method generating the exception
12534           </description>
12535       </param>
12536       <param id="location">
12537         <jlocation/>
12538         <description>
12539           Location where exception occurred
12540         </description>
12541       </param>
12542       <param id="exception">
12543         <jobject/>
12544           <description>
12545             The exception being thrown
12546           </description>
12547       </param>
12548       <param id="catch_klass">
12549         <jclass method="catch_method"/>
12550           <description>
12551             Class that will catch the exception, or <code>NULL</code> if no known catch
12552           </description>
12553       </param>
12554       <param id="catch_method">
12555         <jmethodID class="catch_klass"/>
12556           <description>
12557             Method that will catch the exception, or <code>NULL</code> if no known catch
12558           </description>
12559       </param>
12560       <param id="catch_location">
12561         <jlocation/>
12562         <description>
12563           location which will catch the exception or zero if no known catch
12564         </description>
12565       </param>
12566     </parameters>
12567   </event>
12568 
12569   <event label="Exception Catch"
12570          id="ExceptionCatch" const="JVMTI_EVENT_EXCEPTION_CATCH" filtered="thread" num="59">
12571     <description>
12572       Exception catch events are generated whenever a thrown exception is caught.
12573       Where "exception" means any <code>java.lang.Throwable</code>.
12574       If the exception is caught in a Java programming language method, the event is generated
12575       when the catch clause is reached. If the exception is caught in a native
12576       method, the event is generated as soon as control is returned to a Java programming language
12577       method. Exception catch events are generated for any exception for which
12578       a throw was detected in a Java programming language method.
12579       Note that finally clauses are implemented as catch and re-throw. Therefore they
12580       will generate exception catch events.
12581       <p/>
12582       The <code>method</code> and <code>location</code>
12583       parameters uniquely identify the current location
12584       and allow the mapping to source file and line number when that information is
12585       available. For exceptions caught in a Java programming language method, the
12586       <code>exception</code> object identifies the exception object. Exceptions
12587       caught in native methods are not necessarily available by the time the
12588       exception catch is reported, so the <code>exception</code> field is set
12589       to <code>NULL</code>.
12590     </description>
12591     <origin>jvmdi</origin>
12592     <capabilities>
12593       <required id="can_generate_exception_events"></required>
12594     </capabilities>
12595     <parameters>
12596       <param id="jni_env">
12597         <outptr>
12598           <struct>JNIEnv</struct>
12599         </outptr>
12600           <description>
12601             The JNI environment of the event (current) thread
12602           </description>
12603       </param>
12604       <param id="thread">
12605         <jthread/>
12606           <description>
12607             Thread catching the exception
12608           </description>
12609       </param>
12610       <param id="klass">
12611         <jclass method="method"/>
12612           <description>
12613             Class catching the exception
12614           </description>
12615       </param>
12616       <param id="method">
12617         <jmethodID class="klass"/>
12618           <description>
12619             Method catching the exception
12620           </description>
12621       </param>
12622       <param id="location">
12623         <jlocation/>
12624         <description>
12625           Location where exception is being caught
12626         </description>
12627       </param>
12628       <param id="exception">
12629         <jobject/>
12630           <description>
12631             Exception being caught
12632           </description>
12633       </param>
12634     </parameters>
12635   </event>
12636 
12637   <event label="Thread Start"
12638          id="ThreadStart" const="JVMTI_EVENT_THREAD_START" num="52" phase="start">
12639     <description>
12640       Thread start events are generated by a new thread before its initial
12641       method executes.
12642       <p/>
12643       A thread may be listed in the array returned by
12644       <functionlink id="GetAllThreads"></functionlink>
12645       before its thread start event is generated.
12646       It is possible for other events to be generated
12647       on a thread before its thread start event.
12648       <p/>
12649       The event is sent on the newly started <paramlink id="thread"></paramlink>.
12650     </description>
12651     <origin>jvmdi</origin>
12652     <capabilities>
12653     </capabilities>
12654     <parameters>
12655       <param id="jni_env">
12656         <outptr>
12657           <struct>JNIEnv</struct>
12658         </outptr>
12659           <description>
12660             The JNI environment of the event (current) thread.
12661           </description>
12662       </param>
12663       <param id="thread">
12664         <jthread/>
12665           <description>
12666             Thread starting
12667           </description>
12668       </param>
12669     </parameters>
12670   </event>
12671 
12672   <event label="Thread End"
12673          id="ThreadEnd" const="JVMTI_EVENT_THREAD_END" filtered="thread" num="53" phase="start">
12674     <description>
12675       Thread end events are generated by a terminating thread
12676       after its initial method has finished execution.
12677       <p/>
12678       A thread may be listed in the array returned by
12679       <functionlink id="GetAllThreads"></functionlink>
12680       after its thread end event is generated.
12681       No events are generated on a thread
12682       after its thread end event.
12683       <p/>
12684       The event is sent on the dying <paramlink id="thread"></paramlink>.
12685     </description>
12686     <origin>jvmdi</origin>
12687     <capabilities>
12688     </capabilities>
12689     <parameters>
12690       <param id="jni_env">
12691         <outptr>
12692           <struct>JNIEnv</struct>
12693         </outptr>
12694           <description>
12695             The JNI environment of the event (current) thread.
12696           </description>
12697       </param>
12698       <param id="thread">
12699         <jthread/>
12700           <description>
12701             Thread ending
12702           </description>
12703       </param>
12704     </parameters>
12705   </event>
12706 
12707   <event label="Class Load"
12708          id="ClassLoad" const="JVMTI_EVENT_CLASS_LOAD" filtered="thread" phase="start" num="55">
12709     <description>
12710       A class load event is generated when a class is first loaded. The order
12711       of class load events generated by a particular thread are guaranteed
12712       to match the order of class loading within that thread.
12713       Array class creation does not generate a class load event.
12714       The creation of a primitive class (for example, java.lang.Integer.TYPE)
12715       does not generate a class load event.
12716       <p/>
12717       This event is sent at an early stage in loading the class. As
12718       a result the class should be used carefully.  Note, for example,
12719       that methods and fields are not yet loaded, so queries for methods,
12720       fields, subclasses, and so on will not give correct results.
12721       See "Loading of Classes and Interfaces" in the <i>Java Language
12722       Specification</i>.  For most
12723       purposes the <eventlink id="ClassPrepare"></eventlink> event will
12724       be more useful.
12725     </description>
12726     <origin>jvmdi</origin>
12727     <capabilities>
12728     </capabilities>
12729     <parameters>
12730       <param id="jni_env">
12731         <outptr>
12732           <struct>JNIEnv</struct>
12733         </outptr>
12734           <description>
12735             The JNI environment of the event (current) thread
12736           </description>
12737       </param>
12738       <param id="thread">
12739         <jthread/>
12740           <description>
12741             Thread loading the class
12742           </description>
12743       </param>
12744       <param id="klass">
12745         <jclass/>
12746           <description>
12747             Class being loaded
12748           </description>
12749       </param>
12750     </parameters>
12751   </event>
12752 
12753   <elide>
12754   <event label="Class Unload"
12755          id="ClassUnload" const="JVMTI_EVENT_CLASS_UNLOAD" num="57">
12756     <description>
12757       A class unload event is generated when the class is about to be unloaded.
12758       Class unload events take place during garbage collection and must be
12759       handled extremely carefully. The garbage collector holds many locks
12760       and has suspended all other threads, so the event handler cannot depend
12761       on the ability to acquire any locks. The class unload event handler should
12762       do as little as possible, perhaps by queuing information to be processed
12763       later.  In particular, the <code>jclass</code> should be used only in
12764       the JNI function <code>isSameObject</code> or in the following <jvmti/> functions:
12765       <ul>
12766         <li><functionlink id="GetClassSignature"></functionlink></li>
12767         <li><functionlink id="GetSourceFileName"></functionlink></li>
12768         <li><functionlink id="IsInterface"></functionlink></li>
12769         <li><functionlink id="IsArrayClass"></functionlink></li>
12770       </ul>
12771     </description>
12772     <origin>jvmdi</origin>
12773     <capabilities>
12774     </capabilities>
12775     <parameters>
12776       <param id="jni_env">
12777         <outptr>
12778           <struct>JNIEnv</struct>
12779         </outptr>
12780           <description>
12781             The JNI environment of the event (current) thread
12782           </description>
12783       </param>
12784       <param id="thread">
12785         <jthread/>
12786           <description>
12787             Thread generating the class unload
12788           </description>
12789       </param>
12790       <param id="klass">
12791         <jclass/>
12792           <description>
12793             Class being unloaded
12794           </description>
12795       </param>
12796     </parameters>
12797   </event>
12798   </elide>
12799 
12800   <event label="Class Prepare"
12801          id="ClassPrepare" const="JVMTI_EVENT_CLASS_PREPARE" filtered="thread" phase="start" num="56">
12802     <description>
12803       A class prepare event is generated when class preparation is complete.
12804       At this point, class fields, methods, and implemented interfaces are
12805       available, and no code from the class has been executed. Since array
12806       classes never have fields or methods, class prepare events are not
12807       generated for them. Class prepare events are not generated for
12808       primitive classes (for example, <code>java.lang.Integer.TYPE</code>).
12809     </description>
12810     <origin>jvmdi</origin>
12811     <capabilities>
12812     </capabilities>
12813     <parameters>
12814       <param id="jni_env">
12815         <outptr>
12816           <struct>JNIEnv</struct>
12817         </outptr>
12818           <description>
12819             The JNI environment of the event (current) thread
12820           </description>
12821       </param>
12822       <param id="thread">
12823         <jthread/>
12824           <description>
12825             Thread generating the class prepare
12826           </description>
12827       </param>
12828       <param id="klass">
12829         <jclass/>
12830           <description>
12831             Class being prepared
12832           </description>
12833       </param>
12834     </parameters>
12835   </event>
12836 
12837   <event label="Class File Load Hook" phase="any"
12838          id="ClassFileLoadHook" const="JVMTI_EVENT_CLASS_FILE_LOAD_HOOK" num="54">
12839     <description>
12840       This event is sent when the VM obtains class file data,
12841       but before it constructs
12842       the in-memory representation for that class.
12843       This event is also sent when the class is being modified by the
12844       <functionlink id="RetransformClasses"/> function or
12845       the <functionlink id="RedefineClasses"/> function,
12846       called in any <jvmti/> environment.
12847       The agent can instrument
12848       the existing class file data sent by the VM to include profiling/debugging hooks.
12849       See the description of
12850       <internallink id="bci">bytecode instrumentation</internallink>
12851       for usage information.
12852       <p/>
12853     When the capabilities
12854     <internallink id="jvmtiCapabilities.can_generate_early_class_hook_events">
12855     <code>can_generate_early_class_hook_events</code></internallink> and
12856     <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
12857     <code>can_generate_all_class_hook_events</code></internallink>
12858     are enabled then this event may be sent in the primordial phase.
12859     Otherwise, this event may be sent before the VM is initialized (the start
12860     <functionlink id="GetPhase">phase</functionlink>).
12861     Some classes might not be compatible
12862     with the function (eg. ROMized classes or implementation defined classes) and this event will
12863     not be generated for these classes.
12864     <p/>
12865     The agent must allocate the space for the modified
12866     class file data buffer
12867     using the memory allocation function
12868     <functionlink id="Allocate"></functionlink> because the
12869     VM is responsible for freeing the new class file data buffer
12870     using <functionlink id="Deallocate"></functionlink>.
12871     <p/>
12872     If the agent wishes to modify the class file, it must set
12873     <code>new_class_data</code> to point
12874     to the newly instrumented class file data buffer and set
12875     <code>new_class_data_len</code> to the length of that
12876     buffer before returning
12877     from this call.  If no modification is desired, the agent simply
12878     does not set <code>new_class_data</code>.  If multiple agents
12879     have enabled this event the results are chained. That is, if
12880     <code>new_class_data</code> has been set, it becomes the
12881     <code>class_data</code> for the next agent.
12882     <p/>
12883     When handling a class load in the live phase, then the
12884     <functionlink id="GetNamedModule"></functionlink>
12885     function can be used to map class loader and a package name to a module.
12886     When a class is being redefined or retransformed then
12887     <code>class_being_redefined</code> is non <code>NULL</code> and so
12888     the JNI <code>GetModule</code> function can also be used
12889     to obtain the Module.
12890     <p/>
12891     The order that this event is sent to each environment differs
12892     from other events.
12893     This event is sent to environments in the following order:
12894     <ul>
12895       <li><fieldlink id="can_retransform_classes"
12896                      struct="jvmtiCapabilities">retransformation
12897                                                 incapable</fieldlink>
12898           environments, in the
12899           order in which they were created
12900       </li>
12901       <li><fieldlink id="can_retransform_classes"
12902                      struct="jvmtiCapabilities">retransformation
12903                                                 capable</fieldlink>
12904           environments, in the
12905           order in which they were created
12906       </li>
12907     </ul>
12908     When triggered by <functionlink id="RetransformClasses"/>,
12909     this event is sent only to <fieldlink id="can_retransform_classes"
12910                      struct="jvmtiCapabilities">retransformation
12911                                                 capable</fieldlink>
12912     environments.
12913   </description>
12914   <origin>jvmpi</origin>
12915     <capabilities>
12916       <capability id="can_generate_all_class_hook_events"></capability>
12917       <capability id="can_generate_early_class_hook_events"></capability>
12918     </capabilities>
12919     <parameters>
12920       <param id="jni_env">
12921         <outptr>
12922           <struct>JNIEnv</struct>
12923         </outptr>
12924           <description>
12925             The JNI environment of the event (current) thread.
12926           </description>
12927       </param>
12928       <param id="class_being_redefined">
12929         <jclass/>
12930         <description>
12931           The class being
12932           <functionlink id="RedefineClasses">redefined</functionlink> or
12933           <functionlink id="RetransformClasses">retransformed</functionlink>.
12934           <code>NULL</code> if sent by class load.
12935         </description>
12936       </param>
12937       <param id="loader">
12938         <jobject/>
12939           <description>
12940             The class loader loading the class.
12941             <code>NULL</code> if the bootstrap class loader.
12942           </description>
12943       </param>
12944       <param id="name">
12945         <vmbuf><char/></vmbuf>
12946         <description>
12947             Name of class being loaded as a VM internal qualified name
12948             (for example, "java/util/List"), encoded as a
12949             <internallink id="mUTF">modified UTF-8</internallink> string.
12950             Note: if the class is defined with a <code>NULL</code> name or
12951             without a name specified, <code>name</code> will be <code>NULL</code>.
12952         </description>
12953       </param>
12954       <param id="protection_domain">
12955         <jobject/>
12956         <description>
12957           The <code>ProtectionDomain</code> of the class.
12958         </description>
12959       </param>
12960       <param id="class_data_len">
12961         <jint/>
12962         <description>
12963           Length of current class file data buffer.
12964         </description>
12965       </param>
12966       <param id="class_data">
12967         <vmbuf><uchar/></vmbuf>
12968         <description>
12969           Pointer to the current class file data buffer.
12970         </description>
12971       </param>
12972       <param id="new_class_data_len">
12973         <outptr><jint/></outptr>
12974         <description>
12975           Pointer to the length of the new class file data buffer.
12976         </description>
12977       </param>
12978       <param id="new_class_data">
12979         <agentbuf incount="new_class_data_len"><uchar/></agentbuf>
12980         <description>
12981           Pointer to the pointer to the instrumented class file data buffer.
12982         </description>
12983       </param>
12984     </parameters>
12985   </event>
12986 
12987   <event label="VM Start Event"
12988          id="VMStart" const="JVMTI_EVENT_VM_START" num="57" phase="start">
12989     <description>
12990       The VM start event signals the start of the VM.
12991       At this time JNI is live but the VM is not yet fully initialized.
12992       Once this event is generated, the agent is free to call any JNI function.
12993       This event signals the beginning of the start phase,
12994       <jvmti/> functions permitted in the start phase may be called.
12995       <p/>
12996       The timing of this event may depend on whether the agent has added the
12997       <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
12998       <code>can_generate_early_vmstart</code></internallink> capability or not.
12999       If the capability has been added then the VM posts the event as early
13000       as possible. The VM is capable of executing bytecode but it may not have
13001       initialized to the point where it can load classes in modules other than
13002       <code>java.base</code>, or even arbitrary classes in <code>java.base</code>.
13003       Agents that do load-time instrumentation in this
13004       phase must take great care when instrumenting code that potentially
13005       executes in this phase. Extreme care should also be taken with JNI
13006       <code>FindClass</code> as it may not be possible to load classes and attempts
13007       to do so may result in unpredictable behavior, maybe even stability issues
13008       on some VM implementations.
13009       If the capability has not been added then the VM delays posting this
13010       event until it is capable of loading classes in modules other than
13011       <code>java.base</code> or the VM has completed its initialization.
13012       Agents that create more than one JVM TI environment, where the
13013       capability is added to some but not all environments, may observe the
13014       start phase beginning earlier in the JVM TI environments that possess
13015       the capability.
13016       <p/>
13017       In the case of VM start-up failure, this event will not be sent.
13018     </description>
13019     <origin>jvmdi</origin>
13020     <capabilities>
13021     </capabilities>
13022     <parameters>
13023       <param id="jni_env">
13024         <outptr>
13025           <struct>JNIEnv</struct>
13026         </outptr>
13027           <description>
13028             The JNI environment of the event (current) thread.
13029           </description>
13030       </param>
13031     </parameters>
13032   </event>
13033 
13034   <event label="VM Initialization Event"
13035          id="VMInit" const="JVMTI_EVENT_VM_INIT" num="50">
13036     <description>
13037       The VM initialization event signals the completion of VM initialization. Once
13038       this event is generated, the agent is free to call any JNI or <jvmti/>
13039       function. The VM initialization event can be preceded by or can be concurrent
13040       with other events, but
13041       the preceding events should be handled carefully, if at all, because the
13042       VM has not completed its initialization. The thread start event for the
13043       main application thread is guaranteed not to occur until after the
13044       handler for the VM initialization event returns.
13045       <p/>
13046       In the case of VM start-up failure, this event will not be sent.
13047     </description>
13048     <origin>jvmdi</origin>
13049     <capabilities>
13050     </capabilities>
13051     <parameters>
13052       <param id="jni_env">
13053         <outptr>
13054           <struct>JNIEnv</struct>
13055         </outptr>
13056           <description>
13057             The JNI environment of the event (current) thread.
13058           </description>
13059       </param>
13060       <param id="thread">
13061         <jthread/>
13062           <description>
13063             The initial thread
13064           </description>
13065       </param>
13066     </parameters>
13067   </event>
13068 
13069   <event label="VM Death Event"
13070          id="VMDeath" const="JVMTI_EVENT_VM_DEATH" num="51">
13071     <description>
13072       The VM death event notifies the agent of the termination of the VM.
13073       No events will occur after the VMDeath event.
13074       <p/>
13075       In the case of VM start-up failure, this event will not be sent.
13076       Note that <internallink id="onunload">Agent_OnUnload</internallink>
13077       will still be called in these cases.
13078     </description>
13079     <origin>jvmdi</origin>
13080     <capabilities>
13081     </capabilities>
13082     <parameters>
13083       <param id="jni_env">
13084         <outptr>
13085           <struct>JNIEnv</struct>
13086         </outptr>
13087           <description>
13088             The JNI environment of the event (current) thread
13089           </description>
13090       </param>
13091     </parameters>
13092   </event>
13093 
13094   <event label="Compiled Method Load" phase="start"
13095          id="CompiledMethodLoad" const="JVMTI_EVENT_COMPILED_METHOD_LOAD" num="68">
13096     <description>
13097       Sent when a method is compiled and loaded into memory by the VM.
13098       If it is unloaded, the <eventlink id="CompiledMethodUnload"/> event is sent.
13099       If it is moved, the <eventlink id="CompiledMethodUnload"/> event is sent,
13100       followed by a new <code>CompiledMethodLoad</code> event.
13101       Note that a single method may have multiple compiled forms, and that
13102       this event will be sent for each form.
13103       Note also that several methods may be inlined into a single
13104       address range, and that this event will be sent for each method.
13105       <p/>
13106       These events can be sent after their initial occurrence with
13107       <functionlink id="GenerateEvents"></functionlink>.
13108     </description>
13109     <origin>jvmpi</origin>
13110     <typedef id="jvmtiAddrLocationMap" label="Native address to location entry">
13111       <field id="start_address">
13112         <vmbuf><void/></vmbuf>
13113         <description>
13114           Starting native address of code corresponding to a location
13115         </description>
13116       </field>
13117       <field id="location">
13118         <jlocation/>
13119         <description>
13120           Corresponding location. See
13121           <functionlink id="GetJLocationFormat"></functionlink>
13122           for the meaning of location.
13123         </description>
13124       </field>
13125     </typedef>
13126     <capabilities>
13127       <required id="can_generate_compiled_method_load_events"></required>
13128     </capabilities>
13129     <parameters>
13130       <param id="klass">
13131         <jclass method="method"/>
13132           <description>
13133             Class of the method being compiled and loaded
13134           </description>
13135       </param>
13136       <param id="method">
13137         <jmethodID class="klass"/>
13138           <description>
13139             Method being compiled and loaded
13140           </description>
13141       </param>
13142       <param id="code_size">
13143         <jint/>
13144         <description>
13145           Size of compiled code
13146         </description>
13147       </param>
13148       <param id="code_addr">
13149         <vmbuf><void/></vmbuf>
13150         <description>
13151           Address where compiled method code is loaded
13152         </description>
13153       </param>
13154       <param id="map_length">
13155         <jint/>
13156         <description>
13157           Number of <typelink id="jvmtiAddrLocationMap"></typelink>
13158           entries in the address map.
13159           Zero if mapping information cannot be supplied.
13160         </description>
13161       </param>
13162       <param id="map">
13163         <vmbuf><struct>jvmtiAddrLocationMap</struct></vmbuf>
13164         <description>
13165           Map from native addresses to location.
13166           The native address range of each entry is from
13167           <fieldlink id="start_address" struct="jvmtiAddrLocationMap"></fieldlink>
13168           to <code>start_address-1</code> of the next entry.
13169           <code>NULL</code> if mapping information cannot be supplied.
13170         </description>
13171       </param>
13172       <param id="compile_info">
13173         <vmbuf><void/></vmbuf>
13174         <description>
13175           VM-specific compilation information.
13176           The referenced compile information is managed by the VM
13177           and must not depend on the agent for collection.
13178           A VM implementation defines the content and lifetime
13179           of the information.
13180         </description>
13181       </param>
13182     </parameters>
13183   </event>
13184 
13185   <event label="Compiled Method Unload" phase="start"
13186          id="CompiledMethodUnload" const="JVMTI_EVENT_COMPILED_METHOD_UNLOAD" num="69">
13187     <description>
13188       Sent when a compiled method is unloaded from memory.
13189       This event might not be sent on the thread which performed the unload.
13190       This event may be sent sometime after the unload occurs, but
13191       will be sent before the memory is reused
13192       by a newly generated compiled method. This event may be sent after
13193       the class is unloaded.
13194     </description>
13195     <origin>jvmpi</origin>
13196     <capabilities>
13197       <required id="can_generate_compiled_method_load_events"></required>
13198     </capabilities>
13199     <parameters>
13200       <param id="klass">
13201         <jclass method="method"/>
13202           <description>
13203             Class of the compiled method being unloaded.
13204           </description>
13205       </param>
13206       <param id="method">
13207         <jmethodID class="klass"/>
13208           <description>
13209             Compiled method being unloaded.
13210             For identification of the compiled method only -- the class
13211             may be unloaded and therefore the method should not be used
13212             as an argument to further JNI or <jvmti/> functions.
13213           </description>
13214       </param>
13215       <param id="code_addr">
13216         <vmbuf><void/></vmbuf>
13217         <description>
13218           Address where compiled method code was loaded.
13219           For identification of the compiled method only --
13220           the space may have been reclaimed.
13221         </description>
13222       </param>
13223     </parameters>
13224   </event>
13225 
13226   <event label="Dynamic Code Generated" phase="any"
13227          id="DynamicCodeGenerated" const="JVMTI_EVENT_DYNAMIC_CODE_GENERATED" num="70">
13228     <description>
13229       Sent when a component of the virtual machine is generated dynamically.
13230       This does not correspond to Java programming language code that is
13231       compiled--see <eventlink id="CompiledMethodLoad"></eventlink>.
13232       This is for native code--for example, an interpreter that is generated
13233       differently depending on command-line options.
13234       <p/>
13235       Note that this event has no controlling capability.
13236       If a VM cannot generate these events, it simply does not send any.
13237       <p/>
13238       These events can be sent after their initial occurrence with
13239       <functionlink id="GenerateEvents"></functionlink>.
13240     </description>
13241     <origin>jvmpi</origin>
13242     <capabilities>
13243     </capabilities>
13244     <parameters>
13245       <param id="name">
13246         <vmbuf><char/></vmbuf>
13247         <description>
13248           Name of the code, encoded as a
13249           <internallink id="mUTF">modified UTF-8</internallink> string.
13250           Intended for display to an end-user.
13251           The name might not be unique.
13252         </description>
13253       </param>
13254       <param id="address">
13255         <vmbuf><void/></vmbuf>
13256         <description>
13257           Native address of the code
13258         </description>
13259       </param>
13260       <param id="length">
13261         <jint/>
13262         <description>
13263           Length in bytes of the code
13264         </description>
13265       </param>
13266     </parameters>
13267   </event>
13268 
13269   <event label="Data Dump Request"
13270          id="DataDumpRequest" const="JVMTI_EVENT_DATA_DUMP_REQUEST" num="71">
13271     <description>
13272       Sent by the VM to request the agent to dump its data.  This
13273       is just a hint and the agent need not react to this event.
13274       This is useful for processing command-line signals from users.  For
13275       example, in the Java 2 SDK a CTRL-Break on Win32 and a CTRL-\ on Solaris
13276       causes the VM to send this event to the agent.
13277     </description>
13278     <origin>jvmpi</origin>
13279     <capabilities>
13280     </capabilities>
13281     <parameters>
13282     </parameters>
13283   </event>
13284 
13285   <event label="Monitor Contended Enter"
13286          id="MonitorContendedEnter" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTER" filtered="thread" num="75">
13287     <description>
13288       Sent when a thread is attempting to enter a Java programming language
13289       monitor already acquired by another thread.
13290     </description>
13291     <origin>jvmpi</origin>
13292     <capabilities>
13293       <required id="can_generate_monitor_events"></required>
13294     </capabilities>
13295     <parameters>
13296       <param id="jni_env">
13297         <outptr>
13298           <struct>JNIEnv</struct>
13299         </outptr>
13300           <description>
13301             The JNI environment of the event (current) thread
13302           </description>
13303       </param>
13304       <param id="thread">
13305         <jthread/>
13306           <description>
13307             JNI local reference to the thread
13308             attempting to enter the monitor
13309           </description>
13310       </param>
13311       <param id="object">
13312         <jobject/>
13313           <description>
13314             JNI local reference to the monitor
13315           </description>
13316       </param>
13317     </parameters>
13318   </event>
13319 
13320   <event label="Monitor Contended Entered"
13321          id="MonitorContendedEntered" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTERED" filtered="thread" num="76">
13322     <description>
13323       Sent when a thread enters a Java programming language
13324       monitor after waiting for it to be released by another thread.
13325     </description>
13326     <origin>jvmpi</origin>
13327     <capabilities>
13328       <required id="can_generate_monitor_events"></required>
13329     </capabilities>
13330     <parameters>
13331       <param id="jni_env">
13332         <outptr>
13333           <struct>JNIEnv</struct>
13334         </outptr>
13335           <description>
13336             The JNI environment of the event (current) thread
13337           </description>
13338       </param>
13339       <param id="thread">
13340         <jthread/>
13341           <description>
13342             JNI local reference to the thread entering
13343             the monitor
13344           </description>
13345       </param>
13346       <param id="object">
13347         <jobject/>
13348           <description>
13349             JNI local reference to the monitor
13350           </description>
13351       </param>
13352     </parameters>
13353   </event>
13354 
13355   <event label="Monitor Wait"
13356          id="MonitorWait" const="JVMTI_EVENT_MONITOR_WAIT" filtered="thread" num="73">
13357     <description>
13358       Sent when a thread is about to wait on an object.
13359     </description>
13360     <origin>jvmpi</origin>
13361     <capabilities>
13362       <required id="can_generate_monitor_events"></required>
13363     </capabilities>
13364     <parameters>
13365       <param id="jni_env">
13366         <outptr>
13367           <struct>JNIEnv</struct>
13368         </outptr>
13369           <description>
13370             The JNI environment of the event (current) thread
13371           </description>
13372       </param>
13373       <param id="thread">
13374         <jthread/>
13375           <description>
13376             JNI local reference to the thread about to wait
13377           </description>
13378       </param>
13379       <param id="object">
13380         <jobject/>
13381           <description>
13382             JNI local reference to the monitor
13383           </description>
13384       </param>
13385       <param id="timeout">
13386         <jlong/>
13387         <description>
13388           The number of milliseconds the thread will wait
13389         </description>
13390       </param>
13391     </parameters>
13392   </event>
13393 
13394   <event label="Monitor Waited"
13395          id="MonitorWaited" const="JVMTI_EVENT_MONITOR_WAITED" filtered="thread" num="74">
13396     <description>
13397       Sent when a thread finishes waiting on an object.
13398     </description>
13399     <origin>jvmpi</origin>
13400     <capabilities>
13401       <required id="can_generate_monitor_events"></required>
13402     </capabilities>
13403     <parameters>
13404       <param id="jni_env">
13405         <outptr>
13406           <struct>JNIEnv</struct>
13407         </outptr>
13408           <description>
13409             The JNI environment of the event (current) thread
13410           </description>
13411       </param>
13412       <param id="thread">
13413         <jthread/>
13414           <description>
13415             JNI local reference to the thread that was finished waiting
13416           </description>
13417       </param>
13418       <param id="object">
13419         <jobject/>
13420           <description>
13421             JNI local reference to the monitor.
13422           </description>
13423       </param>
13424       <param id="timed_out">
13425         <jboolean/>
13426         <description>
13427           True if the monitor timed out
13428         </description>
13429       </param>
13430     </parameters>
13431   </event>
13432 
13433   <event label="Resource Exhausted"
13434          id="ResourceExhausted" const="JVMTI_EVENT_RESOURCE_EXHAUSTED" num="80"
13435          since="1.1">
13436     <description>
13437       Sent when a VM resource needed by a running application has been exhausted.
13438       Except as required by the optional capabilities, the set of resources
13439       which report exhaustion is implementation dependent.
13440       <p/>
13441       The following bit flags define the properties of the resource exhaustion:
13442       <constants id="jvmtiResourceExhaustionFlags"
13443                  label="Resource Exhaustion Flags"
13444                  kind="bits"
13445                  since="1.1">
13446         <constant id="JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR" num="0x0001">
13447           After this event returns, the VM will throw a
13448           <code>java.lang.OutOfMemoryError</code>.
13449         </constant>
13450         <constant id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP" num="0x0002">
13451           The VM was unable to allocate memory from the <tm>Java</tm>
13452           platform <i>heap</i>.
13453           The <i>heap</i> is the runtime
13454           data area from which memory for all class instances and
13455           arrays are allocated.
13456         </constant>
13457         <constant id="JVMTI_RESOURCE_EXHAUSTED_THREADS" num="0x0004">
13458           The VM was unable to create a thread.
13459         </constant>
13460       </constants>
13461     </description>
13462     <origin>new</origin>
13463     <capabilities>
13464       <capability id="can_generate_resource_exhaustion_heap_events">
13465         Can generate events when the VM is unable to allocate memory from the
13466         <internallink id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP">heap</internallink>.
13467       </capability>
13468       <capability id="can_generate_resource_exhaustion_threads_events">
13469         Can generate events when the VM is unable to
13470         <internallink id="JVMTI_RESOURCE_EXHAUSTED_THREADS">create
13471         a thread</internallink>.
13472       </capability>
13473     </capabilities>
13474     <parameters>
13475       <param id="jni_env">
13476         <outptr>
13477           <struct>JNIEnv</struct>
13478         </outptr>
13479           <description>
13480             The JNI environment of the event (current) thread
13481           </description>
13482       </param>
13483       <param id="flags">
13484         <jint/>
13485         <description>
13486           Flags defining the properties of the of resource exhaustion
13487           as specified by the
13488           <internallink id="jvmtiResourceExhaustionFlags">Resource
13489           Exhaustion Flags</internallink>.
13490           </description>
13491         </param>
13492       <param id="reserved">
13493         <vmbuf><void/></vmbuf>
13494         <description>
13495           Reserved.
13496         </description>
13497       </param>
13498       <param id="description">
13499         <vmbuf><char/></vmbuf>
13500         <description>
13501           Description of the resource exhaustion, encoded as a
13502           <internallink id="mUTF">modified UTF-8</internallink> string.
13503         </description>
13504       </param>
13505     </parameters>
13506   </event>
13507 
13508   <event label="VM Object Allocation"
13509          id="VMObjectAlloc" const="JVMTI_EVENT_VM_OBJECT_ALLOC" num="84">
13510     <description>
13511       Sent when a method causes the virtual machine to directly allocate an
13512       Object visible to Java programming language code.
13513       Generally object allocation should be detected by instrumenting
13514       the bytecodes of allocating methods.
13515       Object allocation generated in native code by JNI function
13516       calls should be detected using
13517       <internallink id="jniIntercept">JNI function interception</internallink>.
13518       Some methods might not have associated bytecodes and are not
13519       native methods, they instead are executed directly by the
13520       VM. These methods should send this event.
13521       Virtual machines which are incapable of bytecode instrumentation
13522       for some or all of their methods can send this event.
13523 
13524       Note that the <internallink
13525       id="SampledObjectAlloc">SampledObjectAlloc</internallink>
13526       event is triggered on all Java object allocations, including those
13527       caused by bytecode method execution, JNI method execution, and
13528       directly by VM methods.
13529       <p/>
13530       Typical examples where this event might be sent:
13531       <ul>
13532         <li>Reflection -- for example, <code>java.lang.Class.newInstance()</code></li>
13533         <li>Methods not represented by bytecodes -- for example, VM intrinsics and
13534             J2ME preloaded classes</li>
13535       </ul>
13536       Cases where this event would not be generated:
13537       <ul>
13538         <li>Allocation due to bytecodes -- for example, the <code>new</code>
13539             and <code>newarray</code> VM instructions</li>
13540         <li>Allocation due to JNI function calls -- for example,
13541             <code>AllocObject</code></li>
13542         <li>Allocations during VM initialization</li>
13543         <li>VM internal objects</li>
13544       </ul>
13545     </description>
13546     <origin>new</origin>
13547     <capabilities>
13548       <required id="can_generate_vm_object_alloc_events"></required>
13549     </capabilities>
13550     <parameters>
13551       <param id="jni_env">
13552         <outptr>
13553           <struct>JNIEnv</struct>
13554         </outptr>
13555           <description>
13556             The JNI environment of the event (current) thread
13557           </description>
13558       </param>
13559       <param id="thread">
13560         <jthread/>
13561           <description>
13562             Thread allocating the object.
13563           </description>
13564       </param>
13565       <param id="object">
13566         <jobject/>
13567           <description>
13568             JNI local reference to the object that was allocated.
13569           </description>
13570       </param>
13571       <param id="object_klass">
13572         <jclass/>
13573           <description>
13574             JNI local reference to the class of the object.
13575           </description>
13576       </param>
13577       <param id="size">
13578         <jlong/>
13579         <description>
13580             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
13581         </description>
13582       </param>
13583     </parameters>
13584   </event>
13585 
13586   <event label="Sampled Object Allocation"
13587     id="SampledObjectAlloc" const="JVMTI_EVENT_SAMPLED_OBJECT_ALLOC" filtered="thread" num="86" since="11">
13588     <description>
13589       Sent when an allocated object is sampled.
13590       By default, the sampling interval is set to 512KB. The sampling is semi-random to avoid
13591       pattern-based bias and provides an approximate overall average interval over long periods of
13592       sampling.
13593       <p/>
13594       Each thread tracks how many bytes it has allocated since it sent the last event.
13595       When the number of bytes exceeds the sampling interval, it will send another event.
13596       This implies that, on average, one object will be sampled every time a thread has
13597       allocated 512KB bytes since the last sample.
13598       <p/>
13599       Note that the sampler is pseudo-random: it will not sample every 512KB precisely.
13600       The goal of this is to ensure high quality sampling even if allocation is
13601       happening in a fixed pattern (i.e., the same set of objects are being allocated
13602       every 512KB).
13603       <p/>
13604       If another sampling interval is required, the user can call
13605       <functionlink id="SetHeapSamplingInterval"></functionlink> with a strictly positive integer value,
13606       representing the new sampling interval.
13607       <p/>
13608       This event is sent once the sampled allocation has been performed.  It provides the object, stack trace
13609       of the allocation, the thread allocating, the size of allocation, and the object's class.
13610       <p/>
13611       A typical use case of this system is to determine where heap allocations originate.
13612       In conjunction with weak references and the function
13613       <functionlink id="GetStackTrace"></functionlink>, a user can track which objects were allocated from which
13614       stack trace, and which are still live during the execution of the program.
13615     </description>
13616     <origin>new</origin>
13617     <capabilities>
13618       <required id="can_generate_sampled_object_alloc_events"></required>
13619     </capabilities>
13620     <parameters>
13621       <param id="jni_env">
13622         <outptr>
13623           <struct>JNIEnv</struct>
13624         </outptr>
13625         <description>
13626           The JNI environment of the event (current) thread.
13627         </description>
13628       </param>
13629       <param id="thread">
13630         <jthread/>
13631         <description>
13632           Thread allocating the object.
13633         </description>
13634       </param>
13635       <param id="object">
13636         <jobject/>
13637         <description>
13638           JNI local reference to the object that was allocated.
13639         </description>
13640       </param>
13641       <param id="object_klass">
13642         <jclass/>
13643         <description>
13644           JNI local reference to the class of the object
13645         </description>
13646       </param>
13647       <param id="size">
13648         <jlong/>
13649         <description>
13650           Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
13651         </description>
13652       </param>
13653     </parameters>
13654   </event>
13655 
13656   <event label="Object Free"
13657         id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83">
13658     <description>
13659       An Object Free event is sent when the garbage collector frees an object.
13660       Events are only sent for tagged objects--see
13661       <internallink id="Heap">heap functions</internallink>.
13662       <p/>
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     </description>
13668     <origin>new</origin>
13669     <capabilities>
13670       <required id="can_generate_object_free_events"></required>
13671     </capabilities>
13672     <parameters>
13673       <param id="tag">
13674         <jlong/>
13675         <description>
13676           The freed object's tag
13677         </description>        
13678       </param>
13679     </parameters>
13680   </event>
13681 
13682   <event label="Garbage Collection Start"
13683          id="GarbageCollectionStart" const="JVMTI_EVENT_GARBAGE_COLLECTION_START" num="81">
13684     <description>
13685       A Garbage Collection Start event is sent when a
13686       garbage collection pause begins.
13687       Only stop-the-world collections are reported--that is, collections during
13688       which all threads cease to modify the state of the Java virtual machine.
13689       This means that some collectors will never generate these events.
13690       This event is sent while the VM is still stopped, thus
13691       the event handler must not use JNI functions and
13692       must not use <jvmti/> functions except those which
13693       specifically allow such use (see the raw monitor, memory management,
13694       and environment local storage functions).
13695       <p/>
13696       This event is always sent as a matched pair with
13697       <eventlink id="GarbageCollectionFinish"/>
13698       (assuming both events are enabled) and no garbage collection
13699       events will occur between them.
13700     </description>
13701     <origin>new</origin>
13702     <capabilities>
13703       <required id="can_generate_garbage_collection_events"></required>
13704     </capabilities>
13705     <parameters>
13706     </parameters>
13707   </event>
13708 
13709   <event label="Garbage Collection Finish"
13710          id="GarbageCollectionFinish" const="JVMTI_EVENT_GARBAGE_COLLECTION_FINISH" num="82">
13711     <description>
13712       A Garbage Collection Finish event is sent when a
13713       garbage collection pause ends.
13714       This event is sent while the VM is still stopped, thus
13715       the event handler must not use JNI functions and
13716       must not use <jvmti/> functions except those which
13717       specifically allow such use (see the raw monitor, memory management,
13718       and environment local storage functions).
13719       <p/>
13720       Some agents may need to do post garbage collection operations that
13721       require the use of the disallowed <jvmti/> or JNI functions. For these
13722       cases an agent thread can be created which waits on a raw monitor,
13723       and the handler for the Garbage Collection Finish event simply
13724       notifies the raw monitor
13725       <p/>
13726       This event is always sent as a matched pair with
13727       <eventlink id="GarbageCollectionStart"/> (assuming both events are enabled).
13728       <issue>
13729         The most important use of this event is to provide timing information,
13730         and thus additional information is not required.  However,
13731         information about the collection which is "free" should be included -
13732         what that information is needs to be determined.
13733       </issue>
13734     </description>
13735     <origin>new</origin>
13736     <capabilities>
13737       <required id="can_generate_garbage_collection_events"></required>
13738     </capabilities>
13739     <parameters>
13740     </parameters>
13741   </event>
13742 
13743   <elide>
13744   <event label="Verbose Output" phase="any"
13745          id="VerboseOutput" const="JVMTI_EVENT_VERBOSE_OUTPUT" num="85">
13746     <description>
13747       Send verbose messages as strings.
13748         <issue>
13749           This format is extremely fragile, as it can change with each
13750           platform, collector and version.  Alternatives include:
13751           <ul>
13752             <li>building off Java programming language M and M APIs</li>
13753             <li>XML</li>
13754             <li>key/value pairs</li>
13755             <li>removing it</li>
13756           </ul>
13757         </issue>
13758         <issue>
13759           Though this seemed trivial to implement.
13760           In the RI it appears this will be quite complex.
13761         </issue>
13762     </description>
13763     <origin>new</origin>
13764     <capabilities>
13765     </capabilities>
13766     <parameters>
13767       <param id="flag">
13768         <enum>jvmtiVerboseFlag</enum>
13769         <description>
13770           Which verbose output is being sent.
13771         </description>
13772       </param>
13773       <param id="message">
13774         <vmbuf><char/></vmbuf>
13775         <description>
13776           Message text, encoded as a
13777           <internallink id="mUTF">modified UTF-8</internallink> string.
13778         </description>
13779       </param>
13780     </parameters>
13781   </event>
13782   </elide>
13783 
13784 </eventsection>
13785 
13786 <datasection>
13787   <intro>
13788     <jvmti/> extends the data types defined by JNI.
13789   </intro>
13790   <basetypes id="jniTypes" label="JNI Types Used in the JVM Tool Interface">
13791     <basetype id="jboolean">
13792       <description>
13793         Holds a Java programming language <code>boolean</code>.
13794         Unsigned 8 bits.
13795       </description>
13796     </basetype>
13797     <basetype id="jchar">
13798       <description>
13799         Holds a Java programming language <code>char</code>.
13800         Unsigned 16 bits.
13801       </description>
13802     </basetype>
13803     <basetype id="jint">
13804       <description>
13805         Holds a Java programming language <code>int</code>.
13806         Signed 32 bits.
13807       </description>
13808     </basetype>
13809     <basetype id="jlong">
13810       <description>
13811         Holds a Java programming language <code>long</code>.
13812         Signed 64 bits.
13813       </description>
13814     </basetype>
13815     <basetype id="jfloat">
13816       <description>
13817         Holds a Java programming language <code>float</code>.
13818         32 bits.
13819       </description>
13820     </basetype>
13821     <basetype id="jdouble">
13822       <description>
13823         Holds a Java programming language <code>double</code>.
13824         64 bits.
13825       </description>
13826     </basetype>
13827     <basetype id="jobject">
13828       <description>
13829         Holds a Java programming language object.
13830       </description>
13831     </basetype>
13832     <basetype id="jclass">
13833       <description>
13834         Holds a Java programming language class.
13835       </description>
13836     </basetype>
13837     <basetype id="jvalue">
13838       <description>
13839         Is a union of all primitive types and <code>jobject</code>.  Thus, holds any Java
13840         programming language value.
13841       </description>
13842     </basetype>
13843     <basetype id="jfieldID">
13844       <description>
13845         Identifies a Java programming language field.
13846         <code>jfieldID</code>s returned by <jvmti/> functions and events may be
13847         safely stored.
13848       </description>
13849     </basetype>
13850     <basetype id="jmethodID">
13851       <description>
13852         Identifies a Java programming language method, initializer, or constructor.
13853         <code>jmethodID</code>s returned by <jvmti/> functions and events may be
13854         safely stored.  However, if the class is unloaded, they become invalid
13855         and must not be used.
13856       </description>
13857     </basetype>
13858     <basetype id="JNIEnv">
13859       <description>
13860         Pointer to the JNI function table.  Pointer to this (<code>JNIEnv *</code>)
13861         is a JNI environment.
13862       </description>
13863     </basetype>
13864   </basetypes>
13865 
13866   <basetypes id="jvmtiTypes" label="JVM Tool Interface Base Types">
13867     <basetype id="jvmtiEnv">
13868       <description>
13869         The <jvmti/> <internallink id="environments">environment</internallink> pointer.
13870         See the <internallink id="FunctionSection">Function Section</internallink>.
13871         <code>jvmtiEnv</code> points to the
13872         <internallink id="FunctionTable">function table</internallink> pointer.
13873       </description>
13874     </basetype>
13875     <basetype id="jthread">
13876       <definition>typedef jobject jthread;</definition>
13877       <description>
13878         Subtype of <datalink id="jobject"></datalink> that holds a thread.
13879       </description>
13880     </basetype>
13881     <basetype id="jthreadGroup">
13882       <definition>typedef jobject jthreadGroup;</definition>
13883       <description>
13884         Subtype of <datalink id="jobject"></datalink> that holds a thread group.
13885       </description>
13886     </basetype>
13887     <basetype id="jlocation">
13888       <definition>typedef jlong jlocation;</definition>
13889       <description>
13890         A 64 bit value, representing a monotonically increasing
13891         executable position within a method.
13892         <code>-1</code> indicates a native method.
13893         See <functionlink id="GetJLocationFormat"></functionlink> for the format on a
13894         given VM.
13895       </description>
13896     </basetype>
13897     <basetype id="jrawMonitorID">
13898       <definition>struct _jrawMonitorID;
13899 typedef struct _jrawMonitorID *jrawMonitorID;</definition>
13900       <description>
13901         A raw monitor.
13902       </description>
13903     </basetype>
13904     <basetype id="jvmtiError">
13905       <description>
13906         Holds an error return code.
13907         See the <internallink id="ErrorSection">Error section</internallink> for possible values.
13908         <example>
13909 typedef enum {
13910     JVMTI_ERROR_NONE = 0,
13911     JVMTI_ERROR_INVALID_THREAD = 10,
13912       ...
13913 } jvmtiError;
13914 </example>
13915       </description>
13916     </basetype>
13917     <basetype id="jvmtiEvent">
13918       <description>
13919         An identifier for an event type.
13920         See the <internallink id="EventSection">Event section</internallink> for possible values.
13921         It is guaranteed that future versions of this specification will
13922         never assign zero as an event type identifier.
13923 <example>
13924 typedef enum {
13925     JVMTI_EVENT_SINGLE_STEP = 1,
13926     JVMTI_EVENT_BREAKPOINT = 2,
13927       ...
13928 } jvmtiEvent;
13929 </example>
13930       </description>
13931     </basetype>
13932     <basetype id="jvmtiEventCallbacks" name="eventCallbacks">
13933       <description>
13934         The callbacks used for events.
13935 <example>
13936 typedef struct {
13937     jvmtiEventVMInit VMInit;
13938     jvmtiEventVMDeath VMDeath;
13939       ...
13940 } jvmtiEventCallbacks;
13941 </example>
13942         See <internallink id="jvmtiEventCallbacks">event callbacks</internallink>
13943         for the complete structure.
13944         <p/>
13945         Where, for example, the VM initialization callback is defined:
13946 <example>
13947 typedef void (JNICALL *jvmtiEventVMInit)
13948     (jvmtiEnv *jvmti_env,
13949      JNIEnv* jni_env,
13950      jthread thread);
13951 </example>
13952         See the individual events for the callback function definition.
13953       </description>
13954     </basetype>
13955     <basetype id="jniNativeInterface">
13956       <definition>typedef struct JNINativeInterface_ jniNativeInterface;</definition>
13957       <description>
13958         Typedef for the JNI function table <code>JNINativeInterface</code>
13959         defined in the
13960         <externallink id="jni/functions.html#interface-function-table">
13961           JNI Specification</externallink>.
13962         The JNI reference implementation defines this with an underscore.
13963       </description>
13964     </basetype>
13965   </basetypes>
13966 
13967 </datasection>
13968 
13969 <issuessection label="Issues">
13970   <intro id="suspendRequired" label="Resolved Issue: Suspend - Required or Automatic">
13971     JVMDI requires that the agent suspend threads before calling
13972     certain sensitive functions.  JVMPI requires garbage collection to be
13973     disabled before calling certain sensitive functions.
13974     It was suggested that rather than have this requirement, that
13975     VM place itself in a suitable state before performing an
13976     operation.  This makes considerable sense since each VM
13977     knows its requirements and can most easily arrange a
13978     safe state.
13979     <p/>
13980     The ability to externally suspend/resume threads will, of
13981     course, remain.  The ability to enable/disable garbage collection will not.
13982     <p/>
13983     This issue is resolved--suspend will not
13984     be required.  The spec has been updated to reflect this.
13985   </intro>
13986 
13987   <intro id="stackSampling" label="Resolved Issue: Call Stack Sampling">
13988     There are a variety of approaches to sampling call stacks.
13989     The biggest bifurcation is between VM controlled and agent
13990     controlled.
13991     <p/>
13992     This issue is resolved--agent controlled
13993     sampling will be the approach.
13994   </intro>
13995 
13996   <intro id="threadRepresentation" label="Resolved Issue: Thread Representation">
13997     JVMDI represents threads as jthread.  JVMPI primarily
13998     uses JNIEnv* to represent threads.
13999     <p/>
14000     The Expert Group has chosen jthread as the representation
14001     for threads in <jvmti/>.
14002     JNIEnv* is sent by
14003     events since it is needed to JNI functions.  JNIEnv, per the
14004     JNI spec, are not supposed to be used outside their thread.
14005   </intro>
14006 
14007   <intro id="design" label="Resolved Issue: Method Representation">
14008     The JNI spec allows an implementation to depend on jclass/jmethodID
14009     pairs, rather than simply a jmethodID, to reference a method.
14010     JVMDI, for consistency, choose the same representation.
14011     JVMPI, however, specifies that a jmethodID alone maps to a
14012     method.  Both of the Sun <tm>J2SE</tm> virtual machines (Classic and <tm>HotSpot</tm>) store
14013     pointers in jmethodIDs, and as a result, a jmethodID is sufficient.
14014     In fact, any JVM implementation that supports JVMPI must have
14015     such a representation.
14016     <jvmti/> will use jmethodID as a unique representation of a method
14017     (no jclass is used).
14018     There should be efficiency gains, particularly in
14019     functionality like stack dumping, to this representation.
14020     <p/>
14021     Note that fields were not used in JVMPI and that the access profile
14022     of fields differs from methods--for implementation efficiency
14023     reasons, a jclass/jfieldID pair will still be needed for field
14024     reference.
14025   </intro>
14026 
14027   <intro id="localReferenceIssue" label="Resolved Issue: Local References">
14028     Functions return local references.
14029   </intro>
14030 
14031   <intro id="frameRep" label="Resolved Issue: Representation of frames">
14032     In JVMDI, a frame ID is used to represent a frame.  Problem with this
14033     is that a VM must track when a frame becomes invalid, a far better
14034     approach, and the one used in <jvmti/>, is to reference frames by depth.
14035   </intro>
14036 
14037   <intro id="requiredCapabilities" label="Issue: Required Capabilities">
14038     Currently, having a required capabilities means that the functionality
14039     is optional.   Capabilities are useful even for required functionality
14040     since they can inform the VM is needed set-up.  Thus, there should be
14041     a set of capabilities that a conformant implementation must provide
14042     (if requested during Agent_OnLoad).
14043   </intro>
14044 
14045   <intro id="taghint" label="Proposal: add tag hint function">
14046     A hint of the percentage of objects that will be tagged would
14047     help the VM pick a good implementation.
14048   </intro>
14049 
14050   <intro id="moreMonitorQueries" label="Request: More Monitor Quires">
14051   How difficult or easy would be to extend the monitor_info category to include
14052     <pre>
14053   - current number of monitors
14054   - enumeration of monitors
14055   - enumeration of threads waiting on a given monitor
14056     </pre>
14057   The reason for my question is the fact that current get_monitor_info support
14058   requires the agent to specify a given thread to get the info which is probably
14059   OK in the profiling/debugging space, while in the monitoring space the agent
14060   could be watching the monitor list and then decide which thread to ask for
14061   the info. You might ask why is this important for monitoring .... I think it
14062   can aid in the detection/prediction of application contention caused by hot-locks.
14063   </intro>
14064 </issuessection>
14065 
14066 <changehistory id="ChangeHistory" update="09/05/07">
14067   <intro>
14068     The <jvmti/> specification is an evolving document with major, minor,
14069     and micro version numbers.
14070     A released version of the specification is uniquely identified
14071     by its major and minor version.
14072     The functions, events, and capabilities in this specification
14073     indicate a "Since" value which is the major and minor version in
14074     which it was introduced.
14075     The version of the specification implemented by the VM can
14076     be retrieved at runtime with the <functionlink id="GetVersionNumber"/>
14077     function.
14078   </intro>
14079   <change date="14 Nov 2002">
14080     Converted to XML document.
14081   </change>
14082   <change date="14 Nov 2002">
14083     Elided heap dump functions (for now) since what was there
14084     was wrong.
14085   </change>
14086   <change date="18 Nov 2002">
14087     Added detail throughout.
14088   </change>
14089   <change date="18 Nov 2002">
14090     Changed JVMTI_THREAD_STATUS_RUNNING to JVMTI_THREAD_STATUS_RUNNABLE.
14091   </change>
14092   <change date="19 Nov 2002">
14093     Added AsyncGetStackTrace.
14094   </change>
14095   <change date="19 Nov 2002">
14096     Added jframeID return to GetStackTrace.
14097   </change>
14098   <change date="19 Nov 2002">
14099     Elided GetCurrentFrame and GetCallingFrame functions (for now) since what was there
14100     since they are redundant with GetStackTrace.
14101   </change>
14102   <change date="19 Nov 2002">
14103     Elided ClearAllBreakpoints since it has always been redundant.
14104   </change>
14105   <change date="19 Nov 2002">
14106     Added GetSystemProperties.
14107   </change>
14108   <change date="19 Nov 2002">
14109     Changed the thread local storage functions to use jthread.
14110   </change>
14111   <change date="20 Nov 2002">
14112     Added GetJLocationFormat.
14113   </change>
14114   <change date="22 Nov 2002">
14115     Added events and introductory text.
14116   </change>
14117   <change date="22 Nov 2002">
14118     Cross reference type and constant definitions.
14119   </change>
14120   <change date="24 Nov 2002">
14121     Added DTD.
14122   </change>
14123   <change date="24 Nov 2002">
14124     Added capabilities function section.
14125   </change>
14126   <change date="29 Nov 2002">
14127     Assign capabilities to each function and event.
14128   </change>
14129   <change date="29 Nov 2002">
14130     Add <internallink id="jniIntercept">JNI interception functions</internallink>.
14131   </change>
14132   <change date="30 Nov 2002">
14133     Auto generate SetEventNotificationMode capabilities.
14134   </change>
14135   <change date="30 Nov 2002">
14136     Add <eventlink id="VMObjectAlloc"></eventlink> event.
14137   </change>
14138   <change date="30 Nov 2002">
14139     Add <eventlink id="DynamicCodeGenerated"></eventlink> event.
14140   </change>
14141   <change date="30 Nov 2002">
14142     Add const to declarations.
14143   </change>
14144   <change date="30 Nov 2002">
14145     Change method exit and frame pop to send on exception.
14146   </change>
14147   <change date="1 Dec 2002">
14148     Add ForceGarbageCollection.
14149   </change>
14150   <change date="2 Dec 2002">
14151     Redo Xrun section; clarify GetStackTrace and add example;
14152     Fix width problems; use "agent" consistently.
14153   </change>
14154   <change date="8 Dec 2002">
14155     Remove previous start-up intro.
14156     Add <internallink id="environments"><jvmti/> Environments</internallink>
14157     section.
14158   </change>
14159   <change date="8 Dec 2002">
14160     Add <functionlink id="DisposeEnvironment"></functionlink>.
14161   </change>
14162   <change date="9 Dec 2002">
14163     Numerous minor updates.
14164   </change>
14165   <change date="15 Dec 2002">
14166     Add heap profiling functions added:
14167     get/set annotation, iterate live objects/heap.
14168     Add heap profiling functions place holder added:
14169     heap roots.
14170     Heap profiling event added: object free.
14171     Heap profiling event redesigned: vm object allocation.
14172     Heap profiling event placeholders added: garbage collection start/finish.
14173     Native method bind event added.
14174   </change>
14175   <change date="19 Dec 2002">
14176     Revamp suspend/resume functions.
14177     Add origin information with jvmdi tag.
14178     Misc fixes.
14179   </change>
14180   <change date="24 Dec 2002">
14181     Add semantics to types.
14182   </change>
14183   <change date="27 Dec 2002">
14184     Add local reference section.
14185     Autogenerate parameter descriptions from types.
14186   </change>
14187   <change date="28 Dec 2002">
14188     Document that RunAgentThread sends threadStart.
14189   </change>
14190   <change date="29 Dec 2002">
14191     Remove redundant local ref and dealloc warning.
14192     Convert GetRawMonitorName to allocated buffer.
14193     Add GenerateEvents.
14194   </change>
14195   <change date="30 Dec 2002">
14196     Make raw monitors a type and rename to "jrawMonitorID".
14197   </change>
14198   <change date="1 Jan 2003">
14199     Include origin information.
14200     Clean-up JVMDI issue references.
14201     Remove Deallocate warnings which are now automatically generated.
14202   </change>
14203   <change date="2 Jan 2003">
14204     Fix representation issues for jthread.
14205   </change>
14206   <change date="3 Jan 2003">
14207     Make capabilities buffered out to 64 bits - and do it automatically.
14208   </change>
14209   <change date="4 Jan 2003">
14210     Make constants which are enumeration into enum types.
14211     Parameters now of enum type.
14212     Clean-up and index type section.
14213     Replace remaining datadef entities with callback.
14214   </change>
14215   <change date="7 Jan 2003">
14216     Correct GenerateEvents description.
14217     More internal semantics work.
14218   </change>
14219   <change date="9 Jan 2003">
14220     Replace previous GetSystemProperties with two functions
14221     which use allocated information instead fixed.
14222     Add SetSystemProperty.
14223     More internal semantics work.
14224   </change>
14225   <change date="12 Jan 2003">
14226     Add varargs to end of SetEventNotificationMode.
14227   </change>
14228   <change date="20 Jan 2003">
14229     Finish fixing spec to reflect that alloc sizes are jlong.
14230   </change>
14231   <change date="22 Jan 2003">
14232     Allow NULL as RunAgentThread arg.
14233   </change>
14234   <change date="22 Jan 2003">
14235     Fixed names to standardized naming convention
14236     Removed AsyncGetStackTrace.
14237   </change>
14238   <change date="29 Jan 2003">
14239     Since we are using jthread, removed GetThread.
14240   </change>
14241   <change date="31 Jan 2003">
14242     Change GetFieldName to allow NULLs like GetMethodName.
14243   </change>
14244   <change date="29 Feb 2003" version="v40">
14245       Rewrite the introductory text, adding sections on
14246       start-up, environments and bytecode instrumentation.
14247       Change the command line arguments per EG discussions.
14248       Add an introduction to the capabilities section.
14249       Add the extension mechanism category and functions.
14250       Mark for deletion, but clarified anyhow, SuspendAllThreads.
14251       Rename IterateOverLiveObjects to IterateOverReachableObjects and
14252       change the text accordingly.
14253       Clarify IterateOverHeap.
14254       Clarify CompiledMethodLoad.
14255       Discuss prerequisite state for Calling Functions.
14256       Clarify SetAllocationHooks.
14257       Added issues ("To be resolved:") through-out.
14258       And so on...
14259   </change>
14260   <change date="6 Mar 2003" version="v41">
14261       Remove struct from the call to GetOwnedMonitorInfo.
14262       Automatically generate most error documentation, remove
14263       (rather broken) hand written error doc.
14264       Better describe capability use (empty initial set).
14265       Add min value to jint params.
14266       Remove the capability can_access_thread_local_storage.
14267       Rename error JVMTI_ERROR_NOT_IMPLEMENTED to JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
14268       same for *NOT_IMPLEMENTED.
14269       Description fixes.
14270   </change>
14271   <change date="8 Mar 2003" version="v42">
14272       Rename GetClassSignature to GetClassName.
14273       Rename IterateOverClassObjects to IterateOverInstancesOfClass.
14274       Remove GetMaxStack (operand stack isn't used in <jvmti/>).
14275       Description fixes: define launch-time, remove native frame pop
14276       from PopFrame, and assorted clarifications.
14277   </change>
14278   <change date="8 Mar 2003" version="v43">
14279       Fix minor editing problem.
14280   </change>
14281   <change date="10 Mar 2003" version="v44">
14282       Add phase information.
14283       Remap (compact) event numbers.
14284   </change>
14285   <change date="11 Mar 2003" version="v45">
14286       More phase information - allow "any".
14287       Elide raw monitor queries and events.
14288       Minor description fixes.
14289   </change>
14290   <change date="12 Mar 2003" version="v46">
14291       Add GetPhase.
14292       Use "phase" through document.
14293       Elide GetRawMonitorName.
14294       Elide GetObjectMonitors.
14295   </change>
14296   <change date="12 Mar 2003" version="v47">
14297       Fixes from link, XML, and spell checking.
14298       Auto-generate the callback structure.
14299   </change>
14300   <change date="13 Mar 2003" version="v48">
14301       One character XML fix.
14302   </change>
14303   <change date="13 Mar 2003" version="v49">
14304       Change function parameter names to be consistent with
14305       event parameters (fooBarBaz becomes foo_bar_baz).
14306   </change>
14307   <change date="14 Mar 2003" version="v50">
14308       Fix broken link.  Fix thread markers.
14309   </change>
14310   <change date="14 Mar 2003" version="v51">
14311       Change constants so they are under 128 to workaround
14312       compiler problems.
14313   </change>
14314   <change date="23 Mar 2003" version="v52">
14315       Overhaul capabilities.  Separate GetStackTrace into
14316       GetStackTrace and GetStackFrames.
14317   </change>
14318   <change date="8 Apr 2003" version="v54">
14319       Use depth instead of jframeID to reference frames.
14320       Remove the now irrelevant GetCurrentFrame, GetCallerFrame and GetStackFrames.
14321       Remove frame arg from events.
14322   </change>
14323   <change date="9 Apr 2003" version="v55">
14324       Remove GetObjectWithAnnotation since tests show bufferred approach more efficient.
14325       Add missing annotation_count to GetObjectsWithAnnotations
14326   </change>
14327   <change date="10 Apr 2003" version="v56">
14328       Remove confusing parenthetical statement in GetObjectsWithAnnotations
14329   </change>
14330   <change date="13 Apr 2003" version="v58">
14331       Replace jclass/jmethodID representation of method with simply jmethodID;
14332       Pass JvmtiEnv* as first arg of every event; remove JNIEnv* where inappropriate.
14333       Replace can_access_frames with can_access_local_variables; remove from purely stack access.
14334       Use can_get_synthetic_attribute; fix description.
14335       Clarify that zero length arrays must be deallocated.
14336       Clarify RelinquishCapabilities.
14337       Generalize JVMTI_ERROR_VM_DEAD to JVMTI_ERROR_WRONG_PHASE.
14338   </change>
14339   <change date="27 Apr 2003" version="v59">
14340       Remove lingering indirect references to OBSOLETE_METHOD_ID.
14341   </change>
14342   <change date="4 May 2003" version="v60">
14343       Allow DestroyRawMonitor during OnLoad.
14344   </change>
14345   <change date="7 May 2003" version="v61">
14346       Added not monitor owner error return to DestroyRawMonitor.
14347   </change>
14348   <change date="13 May 2003" version="v62">
14349       Clarify semantics of raw monitors.
14350       Change flags on <code>GetThreadStatus</code>.
14351       <code>GetClassLoader</code> return NULL for the bootstrap class loader.
14352       Add <code>GetClassName</code> issue.
14353       Define local variable signature.
14354       Disallow zero in annotations array of <code>GetObjectsWithAnnotations</code>.
14355       Remove over specification in <code>GetObjectsWithAnnotations</code>.
14356       Elide <code>SetAllocationHooks</code>.
14357       Elide <code>SuspendAllThreads</code>.
14358   </change>
14359   <change date="14 May 2003" version="v63">
14360       Define the data type <code>jvmtiEventCallbacks</code>.
14361       Zero length allocations return NULL.
14362       Keep SetAllocationHooks in JVMDI, but remove from <jvmti/>.
14363       Add JVMTI_THREAD_STATUS_FLAG_INTERRUPTED.
14364   </change>
14365   <change date="15 May 2003" version="v64">
14366       Better wording, per review.
14367   </change>
14368   <change date="15 May 2003" version="v65">
14369       First Alpha.
14370       Make jmethodID and jfieldID unique, jclass not used.
14371   </change>
14372   <change date="27 May 2003" version="v66">
14373       Fix minor XSLT errors.
14374   </change>
14375   <change date="13 June 2003" version="v67">
14376       Undo making jfieldID unique (jmethodID still is).
14377   </change>
14378   <change date="17 June 2003" version="v68">
14379       Changes per June 11th Expert Group meeting --
14380       Overhaul Heap functionality: single callback,
14381       remove GetHeapRoots, add reachable iterators,
14382       and rename "annotation" to "tag".
14383       NULL thread parameter on most functions is current
14384       thread.
14385       Add timers.
14386       Remove ForceExit.
14387       Add GetEnvironmentLocalStorage.
14388       Add verbose flag and event.
14389       Add AddToBootstrapClassLoaderSearch.
14390       Update ClassFileLoadHook.
14391   </change>
14392   <change date="18 June 2003" version="v69">
14393       Clean up issues sections.
14394       Rename GetClassName back to GetClassSignature and
14395       fix description.
14396       Add generic signature to GetClassSignature,
14397       GetFieldSignature, GetMethodSignature, and
14398       GetLocalVariableTable.
14399       Elide EstimateCostOfCapabilities.
14400       Clarify that the system property functions operate
14401       on the VM view of system properties.
14402       Clarify Agent_OnLoad.
14403       Remove "const" from JNIEnv* in events.
14404       Add metadata accessors.
14405   </change>
14406   <change date="18 June 2003" version="v70">
14407       Add start_depth to GetStackTrace.
14408       Move system properties to a new category.
14409       Add GetObjectSize.
14410       Remove "X" from command line flags.
14411       XML, HTML, and spell check corrections.
14412   </change>
14413   <change date="19 June 2003" version="v71">
14414       Fix JVMTI_HEAP_ROOT_THREAD to be 6.
14415       Make each synopsis match the function name.
14416       Fix unclear wording.
14417   </change>
14418   <change date="26 June 2003" version="v72">
14419       SetThreadLocalStorage and SetEnvironmentLocalStorage should allow value
14420       to be set to NULL.
14421       NotifyFramePop, GetFrameLocationm and all the local variable operations
14422       needed to have their wording about frames fixed.
14423       Grammar and clarity need to be fixed throughout.
14424       Capitalization and puntuation need to be consistent.
14425       Need micro version number and masks for accessing major, minor, and micro.
14426       The error code lists should indicate which must be returned by
14427       an implementation.
14428       The command line properties should be visible in the properties functions.
14429       Disallow popping from the current thread.
14430       Allow implementations to return opaque frame error when they cannot pop.
14431       The NativeMethodBind event should be sent during any phase.
14432       The DynamicCodeGenerated event should be sent during any phase.
14433       The following functions should be allowed to operate before VMInit:
14434         Set/GetEnvironmentLocalStorage
14435         GetMethodDeclaringClass
14436         GetClassSignature
14437         GetClassModifiers
14438         IsInterface
14439         IsArrayClass
14440         GetMethodName
14441         GetMethodModifiers
14442         GetMaxLocals
14443         GetArgumentsSize
14444         GetLineNumberTable
14445         GetMethodLocation
14446         IsMethodNative
14447         IsMethodSynthetic.
14448       Other changes (to XSL):
14449       Argument description should show asterisk after not before pointers.
14450       NotifyFramePop, GetFrameLocationm and all the local variable operations
14451       should hsve the NO_MORE_FRAMES error added.
14452       Not alive threads should have a different error return than invalid thread.
14453   </change>
14454   <change date="7 July 2003" version="v73">
14455       VerboseOutput event was missing message parameter.
14456       Minor fix-ups.
14457   </change>
14458   <change date="14 July 2003" version="v74">
14459       Technical Publications Department corrections.
14460       Allow thread and environment local storage to be set to NULL.
14461   </change>
14462   <change date="23 July 2003" version="v75">
14463       Use new Agent_OnLoad rather than overloaded JVM_OnLoad.
14464       Add JNICALL to callbacks (XSL).
14465       Document JNICALL requirement for both events and callbacks (XSL).
14466       Restrict RedefineClasses to methods and attributes.
14467       Elide the VerboseOutput event.
14468       VMObjectAlloc: restrict when event is sent and remove method parameter.
14469       Finish loose ends from Tech Pubs edit.
14470   </change>
14471   <change date="24 July 2003" version="v76">
14472       Change ClassFileLoadHook event to send the class instead of a boolean of redefine.
14473   </change>
14474   <change date="24 July 2003" version="v77">
14475       XML fixes.
14476       Minor text clarifications and corrections.
14477   </change>
14478   <change date="24 July 2003" version="v78">
14479       Remove GetExceptionHandlerTable and GetThrownExceptions from <jvmti/>.
14480       Clarify that stack frames are JVM Spec frames.
14481       Split can_get_source_info into can_get_source_file_name, can_get_line_numbers,
14482       and can_get_source_debug_extension.
14483       PopFrame cannot have a native calling method.
14484       Removed incorrect statement in GetClassloaderClasses
14485       (see <vmspec chapter="4.4"/>).
14486   </change>
14487   <change date="24 July 2003" version="v79">
14488       XML and text fixes.
14489       Move stack frame description into Stack Frame category.
14490   </change>
14491   <change date="26 July 2003" version="v80">
14492       Allow NULL (means bootstrap loader) for GetClassloaderClasses.
14493       Add new heap reference kinds for references from classes.
14494       Add timer information struct and query functions.
14495       Add AvailableProcessors.
14496       Rename GetOtherThreadCpuTime to GetThreadCpuTime.
14497       Explicitly add JVMTI_ERROR_INVALID_THREAD and JVMTI_ERROR_THREAD_NOT_ALIVE
14498       to SetEventNotification mode.
14499       Add initial thread to the VM_INIT event.
14500       Remove platform assumptions from AddToBootstrapClassLoaderSearch.
14501   </change>
14502   <change date="26 July 2003" version="v81">
14503       Grammar and clarity changes per review.
14504   </change>
14505   <change date="27 July 2003" version="v82">
14506       More grammar and clarity changes per review.
14507       Add Agent_OnUnload.
14508   </change>
14509   <change date="28 July 2003" version="v83">
14510       Change return type of Agent_OnUnload to void.
14511   </change>
14512   <change date="28 July 2003" version="v84">
14513       Rename JVMTI_REFERENCE_ARRAY to JVMTI_REFERENCE_ARRAY_ELEMENT.
14514   </change>
14515   <change date="28 July 2003" version="v85">
14516       Steal java.lang.Runtime.availableProcessors() wording for
14517       AvailableProcessors().
14518       Guarantee that zero will never be an event ID.
14519       Remove some issues which are no longer issues.
14520       Per review, rename and more completely document the timer
14521       information functions.
14522   </change>
14523   <change date="29 July 2003" version="v86">
14524       Non-spec visible change to XML controlled implementation:
14525         SetThreadLocalStorage must run in VM mode.
14526   </change>
14527   <change date="5 August 2003" version="0.1.87">
14528       Add GetErrorName.
14529       Add varargs warning to jvmtiExtensionEvent.
14530       Remove "const" on the jvmtiEnv* of jvmtiExtensionEvent.
14531       Remove unused can_get_exception_info capability.
14532       Pass jvmtiEnv* and JNIEnv* to the jvmtiStartFunction.
14533       Fix jvmtiExtensionFunctionInfo.func declared type.
14534       Extension function returns error code.
14535       Use new version numbering.
14536   </change>
14537   <change date="5 August 2003" version="0.2.88">
14538       Remove the ClassUnload event.
14539   </change>
14540   <change date="8 August 2003" version="0.2.89">
14541       Heap reference iterator callbacks return an enum that
14542       allows outgoing object references to be ignored.
14543       Allow JNIEnv as a param type to extension events/functions.
14544   </change>
14545   <change date="15 August 2003" version="0.2.90">
14546       Fix a typo.
14547   </change>
14548   <change date="2 September 2003" version="0.2.91">
14549       Remove all metadata functions: GetClassMetadata,
14550       GetFieldMetadata, and GetMethodMetadata.
14551   </change>
14552   <change date="1 October 2003" version="0.2.92">
14553       Mark the functions Allocate. Deallocate, RawMonitor*,
14554       SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage
14555       as safe for use in heap callbacks and GC events.
14556   </change>
14557   <change date="24 November 2003" version="0.2.93">
14558       Add pass through opaque user data pointer to heap iterate
14559       functions and callbacks.
14560       In the CompiledMethodUnload event, send the code address.
14561       Add GarbageCollectionOccurred event.
14562       Add constant pool reference kind.
14563       Mark the functions CreateRawMonitor and DestroyRawMonitor
14564       as safe for use in heap callbacks and GC events.
14565       Clarify: VMDeath, GetCurrentThreadCpuTimerInfo,
14566       GetThreadCpuTimerInfo, IterateOverReachableObjects,
14567       IterateOverObjectsReachableFromObject, GetTime and
14568       JVMTI_ERROR_NULL_POINTER.
14569       Add missing errors to: GenerateEvents and
14570       AddToBootstrapClassLoaderSearch.
14571       Fix description of ClassFileLoadHook name parameter.
14572       In heap callbacks and GC/ObjectFree events, specify
14573       that only explicitly allowed functions can be called.
14574       Allow GetCurrentThreadCpuTimerInfo, GetCurrentThreadCpuTime,
14575       GetTimerInfo, and GetTime during callback.
14576       Allow calling SetTag/GetTag during the onload phase.
14577       SetEventNotificationMode, add: error attempted inappropriate
14578       thread level control.
14579       Remove jvmtiExceptionHandlerEntry.
14580       Fix handling of native methods on the stack --
14581       location_ptr param of GetFrameLocation, remove
14582       JVMTI_ERROR_OPAQUE_FRAME from GetFrameLocation,
14583       jvmtiFrameInfo.location, and jlocation.
14584       Remove typo (from JVMPI) implying that the MonitorWaited
14585       event is sent on sleep.
14586   </change>
14587   <change date="25 November 2003" version="0.2.94">
14588       Clarifications and typos.
14589   </change>
14590   <change date="3 December 2003" version="0.2.95">
14591       Allow NULL user_data in heap iterators.
14592   </change>
14593   <change date="28 January 2004" version="0.2.97">
14594       Add GetThreadState, deprecate GetThreadStatus.
14595   </change>
14596   <change date="29 January 2004" version="0.2.98">
14597       INVALID_SLOT and TYPE_MISMATCH errors should be optional.
14598   </change>
14599   <change date="12 February 2004" version="0.2.102">
14600       Remove MonitorContendedExit.
14601       Added JNIEnv parameter to VMObjectAlloc.
14602       Clarified definition of class_tag and referrer_index
14603       parameters to heap callbacks.
14604   </change>
14605   <change date="16 Febuary 2004" version="0.2.103">
14606       Document JAVA_TOOL_OPTIONS.
14607   </change>
14608   <change date="17 Febuary 2004" version="0.2.105">
14609       Divide start phase into primordial and start.
14610       Add VMStart event
14611       Change phase associations of functions and events.
14612   </change>
14613   <change date="18 Febuary 2004" version="0.3.6">
14614       Elide deprecated GetThreadStatus.
14615       Bump minor version, subtract 100 from micro version
14616   </change>
14617   <change date="18 Febuary 2004" version="0.3.7">
14618       Document that timer nanosecond values are unsigned.
14619       Clarify text having to do with native methods.
14620   </change>
14621   <change date="19 Febuary 2004" version="0.3.8">
14622       Fix typos.
14623       Remove elided deprecated GetThreadStatus.
14624   </change>
14625   <change date="23 Febuary 2004" version="0.3.9">
14626       Require NotifyFramePop to act on suspended threads.
14627   </change>
14628   <change date="24 Febuary 2004" version="0.3.10">
14629       Add capabilities
14630         (<internallink id="jvmtiCapabilities.can_redefine_any_class"
14631          ><code>can_redefine_any_class</code></internallink>
14632       and
14633          <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events"
14634          ><code>can_generate_all_class_hook_events</code></internallink>)
14635       and an error (<errorlink id="JVMTI_ERROR_UNMODIFIABLE_CLASS"></errorlink>)
14636       which allow some classes to be unmodifiable.
14637   </change>
14638   <change date="28 Febuary 2004" version="0.3.11">
14639       Add JVMTI_ERROR_MUST_POSSESS_CAPABILITY to SetEventNotificationMode.
14640   </change>
14641   <change date="8 March 2004" version="0.3.12">
14642       Clarified CompiledMethodUnload so that it is clear the event
14643       may be posted after the class has been unloaded.
14644   </change>
14645   <change date="5 March 2004" version="0.3.13">
14646       Change the size parameter of VMObjectAlloc to jlong to match GetObjectSize.
14647   </change>
14648   <change date="13 March 2004" version="0.3.14">
14649       Added guideline for the use of the JNI FindClass function in event
14650       callback functions.
14651   </change>
14652   <change date="15 March 2004" version="0.3.15">
14653       Add GetAllStackTraces and GetThreadListStackTraces.
14654   </change>
14655   <change date="19 March 2004" version="0.3.16">
14656       ClassLoad and ClassPrepare events can be posted during start phase.
14657   </change>
14658   <change date="25 March 2004" version="0.3.17">
14659       Add JVMTI_ERROR_NATIVE_METHOD to GetLineNumberTable, GetLocalVariableTable,
14660       GetMaxLocals, GetArgumentsSize, GetMethodLocation, GetBytecodes.
14661   </change>
14662   <change date="29 March 2004" version="0.3.18">
14663       Return the timer kind in the timer information structure.
14664   </change>
14665   <change date="31 March 2004" version="0.3.19">
14666       Spec clarifications:
14667       JVMTI_THREAD_STATE_IN_NATIVE might not include JNI or <jvmti/>.
14668       ForceGarbageCollection does not run finalizers.
14669       The context of the specification is the Java platform.
14670       Warn about early instrumentation.
14671   </change>
14672   <change date="1 April 2004" version="0.3.20">
14673       Refinements to the above clarifications and
14674       Clarify that an error returned by Agent_OnLoad terminates the VM.
14675   </change>
14676   <change date="1 April 2004" version="0.3.21">
14677       Array class creation does not generate a class load event.
14678   </change>
14679   <change date="7 April 2004" version="0.3.22">
14680       Align thread state hierarchy more closely with java.lang.Thread.State.
14681   </change>
14682   <change date="12 April 2004" version="0.3.23">
14683       Clarify the documentation of thread state.
14684   </change>
14685   <change date="19 April 2004" version="0.3.24">
14686       Remove GarbageCollectionOccurred event -- can be done by agent.
14687   </change>
14688   <change date="22 April 2004" version="0.3.25">
14689       Define "command-line option".
14690   </change>
14691   <change date="29 April 2004" version="0.3.26">
14692       Describe the intended use of bytecode instrumentation.
14693       Fix description of extension event first parameter.
14694   </change>
14695   <change date="30 April 2004" version="0.3.27">
14696       Clarification and typos.
14697   </change>
14698   <change date="18 May 2004" version="0.3.28">
14699       Remove DataDumpRequest event.
14700   </change>
14701   <change date="18 May 2004" version="0.3.29">
14702       Clarify RawMonitorWait with zero timeout.
14703       Clarify thread state after RunAgentThread.
14704   </change>
14705   <change date="24 May 2004" version="0.3.30">
14706       Clean-up: fix bad/old links, etc.
14707   </change>
14708   <change date="30 May 2004" version="0.3.31">
14709       Clarifications including:
14710       All character strings are modified UTF-8.
14711       Agent thread visibiity.
14712       Meaning of obsolete method version.
14713       Thread invoking heap callbacks,
14714   </change>
14715   <change date="1 June 2004" version="1.0.32">
14716       Bump major.minor version numbers to "1.0".
14717   </change>
14718   <change date="2 June 2004" version="1.0.33">
14719       Clarify interaction between ForceGarbageCollection
14720       and ObjectFree.
14721   </change>
14722   <change date="6 June 2004" version="1.0.34">
14723       Restrict AddToBootstrapClassLoaderSearch and
14724       SetSystemProperty to the OnLoad phase only.
14725   </change>
14726   <change date="11 June 2004" version="1.0.35">
14727       Fix typo in SetTag.
14728   </change>
14729   <change date="18 June 2004" version="1.0.36">
14730       Fix trademarks.
14731       Add missing parameter in example GetThreadState usage.
14732   </change>
14733   <change date="4 August 2004" version="1.0.37">
14734       Copyright updates.
14735   </change>
14736   <change date="5 November 2004" version="1.0.38">
14737       Add missing function table layout.
14738       Add missing description of C++ member function format of functions.
14739       Clarify that name in CFLH can be NULL.
14740       Released as part of <tm>J2SE</tm> 5.0.
14741   </change>
14742   <change date="24 April 2005" version="1.1.47">
14743       Bump major.minor version numbers to "1.1".
14744       Add ForceEarlyReturn* functions.
14745       Add GetOwnedMonitorStackDepthInfo function.
14746       Add GetCurrentThread function.
14747       Add "since" version marker.
14748       Add AddToSystemClassLoaderSearch.
14749       Allow AddToBootstrapClassLoaderSearch be used in live phase.
14750       Fix historic rubbish in the descriptions of the heap_object_callback
14751       parameter of IterateOverHeap and IterateOverInstancesOfClass functions;
14752       disallow NULL for this parameter.
14753       Clarify, correct and make consistent: wording about current thread,
14754       opaque frames and insufficient number of frames in PopFrame.
14755       Consistently use "current frame" rather than "topmost".
14756       Clarify the JVMTI_ERROR_TYPE_MISMATCH errors in GetLocal* and SetLocal*
14757       by making them compatible with those in ForceEarlyReturn*.
14758       Many other clarifications and wording clean ups.
14759   </change>
14760   <change date="25 April 2005" version="1.1.48">
14761       Add GetConstantPool.
14762       Switch references to the first edition of the VM Spec, to the seconds edition.
14763   </change>
14764   <change date="26 April 2005" version="1.1.49">
14765       Clarify minor/major version order in GetConstantPool.
14766   </change>
14767   <change date="26 April 2005" version="1.1.50">
14768       Add SetNativeMethodPrefix and SetNativeMethodPrefixes.
14769       Reassign GetOwnedMonitorStackDepthInfo to position 153.
14770       Break out Class Loader Search in its own documentation category.
14771       Deal with overly long lines in XML source.
14772   </change>
14773   <change date="29 April 2005" version="1.1.51">
14774       Allow agents be started in the live phase.
14775       Added paragraph about deploying agents.
14776   </change>
14777   <change date="30 April 2005" version="1.1.52">
14778       Add specification description to SetNativeMethodPrefix(es).
14779       Better define the conditions on GetConstantPool.
14780   </change>
14781   <change date="30 April 2005" version="1.1.53">
14782       Break out the GetClassVersionNumber function from GetConstantPool.
14783       Clean-up the references to the VM Spec.
14784   </change>
14785   <change date="1 May 2005" version="1.1.54">
14786       Allow SetNativeMethodPrefix(es) in any phase.
14787       Add clarifications about the impact of redefinition on GetConstantPool.
14788   </change>
14789   <change date="2 May 2005" version="1.1.56">
14790       Various clarifications to SetNativeMethodPrefix(es).
14791   </change>
14792   <change date="2 May 2005" version="1.1.57">
14793       Add missing performance warning to the method entry event.
14794   </change>
14795   <change date="5 May 2005" version="1.1.58">
14796       Remove internal JVMDI support.
14797   </change>
14798   <change date="8 May 2005" version="1.1.59">
14799       Add <functionlink id="RetransformClasses"/>.
14800       Revamp the bytecode instrumentation documentation.
14801       Change <functionlink id="IsMethodObsolete"/> to no longer
14802       require the can_redefine_classes capability.
14803   </change>
14804   <change date="11 May 2005" version="1.1.63">
14805       Clarifications for retransformation.
14806   </change>
14807   <change date="11 May 2005" version="1.1.64">
14808       Clarifications for retransformation, per review.
14809       Lock "retransformation (in)capable" at class load enable time.
14810   </change>
14811   <change date="4 June 2005" version="1.1.67">
14812       Add new heap functionity which supports reporting primitive values,
14813       allows setting the referrer tag, and has more powerful filtering:
14814       FollowReferences, IterateThroughHeap, and their associated
14815       callbacks, structs, enums, and constants.
14816   </change>
14817   <change date="4 June 2005" version="1.1.68">
14818       Clarification.
14819   </change>
14820   <change date="6 June 2005" version="1.1.69">
14821       FollowReferences, IterateThroughHeap: Put callbacks in a struct;
14822       Add missing error codes; reduce bits in the visit control flags.
14823   </change>
14824   <change date="14 June 2005" version="1.1.70">
14825       More on new heap functionity: spec clean-up per review.
14826   </change>
14827   <change date="15 June 2005" version="1.1.71">
14828       More on new heap functionity: Rename old heap section to Heap (1.0).
14829   </change>
14830   <change date="21 June 2005" version="1.1.72">
14831       Fix typos.
14832   </change>
14833   <change date="27 June 2005" version="1.1.73">
14834       Make referrer info structure a union.
14835   </change>
14836   <change date="9 September 2005" version="1.1.74">
14837       In new heap functions:
14838       Add missing superclass reference kind.
14839       Use a single scheme for computing field indexes.
14840       Remove outdated references to struct based referrer info.
14841   </change>
14842   <change date="12 September 2005" version="1.1.75">
14843       Don't callback during FollowReferences on frivolous java.lang.Object superclass.
14844   </change>
14845   <change date="13 September 2005" version="1.1.76">
14846       In string primitive callback, length now Unicode length.
14847       In array and string primitive callbacks, value now "const".
14848       Note possible compiler impacts on setting JNI function table.
14849   </change>
14850   <change date="13 September 2005" version="1.1.77">
14851       GetClassVersionNumbers() and GetConstantPool() should return
14852       error on array or primitive class.
14853   </change>
14854   <change date="14 September 2005" version="1.1.78">
14855       Grammar fixes.
14856   </change>
14857   <change date="26 September 2005" version="1.1.79">
14858       Add IsModifiableClass query.
14859   </change>
14860   <change date="9 February 2006" version="1.1.81">
14861       Add referrer_class_tag parameter to jvmtiHeapReferenceCallback.
14862   </change>
14863   <change date="13 February 2006" version="1.1.82">
14864       Doc fixes: update can_redefine_any_class to include retransform.
14865       Clarify that exception events cover all Throwables.
14866       In GetStackTrace, no test is done for start_depth too big if start_depth is zero,
14867       Clarify fields reported in Primitive Field Callback -- static vs instance.
14868       Repair confusing names of heap types, including callback names.
14869       Require consistent usage of stack depth in the face of thread launch methods.
14870       Note incompatibility of <jvmti/> memory management with other systems.
14871   </change>
14872   <change date="14 February 2006" version="1.1.85">
14873       Fix typos and missing renames.
14874   </change>
14875   <change date="13 March 2006" version="1.1.86">
14876       Clarify that jmethodIDs and jfieldIDs can be saved.
14877       Clarify that Iterate Over Instances Of Class includes subclasses.
14878   </change>
14879   <change date="14 March 2006" version="1.1.87">
14880       Better phrasing.
14881   </change>
14882   <change date="16 March 2006" version="1.1.88">
14883       Match the referrer_index for static fields in Object Reference Callback
14884       with the Reference Implementation (and all other known implementations);
14885       that is, make it match the definition for instance fields.
14886       In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover
14887       an invalid thread in the list; and specify that not started threads
14888       return empty stacks.
14889   </change>
14890   <change date="17 March 2006" version="1.1.89">
14891       Typo.
14892   </change>
14893   <change date="25 March 2006" version="1.1.90">
14894       Typo.
14895   </change>
14896   <change date="6 April 2006" version="1.1.91">
14897       Remove restrictions on AddToBootstrapClassLoaderSearch and
14898       AddToSystemClassLoaderSearch.
14899   </change>
14900   <change date="1 May 2006" version="1.1.93">
14901       Changed spec to return -1 for monitor stack depth for the
14902       implementation which can not determine stack depth.
14903   </change>
14904   <change date="3 May 2006" version="1.1.94">
14905       Corrections for readability and accuracy courtesy of Alan Pratt of IBM.
14906       List the object relationships reported in FollowReferences.
14907   </change>
14908   <change date="5 May 2006" version="1.1.95">
14909       Clarify the object relationships reported in FollowReferences.
14910   </change>
14911   <change date="28 June 2006" version="1.1.98">
14912       Clarify DisposeEnvironment; add warning.
14913       Fix typos in SetLocalXXX "retrieve" => "set".
14914       Clarify that native method prefixes must remain set while used.
14915       Clarify that exactly one Agent_OnXXX is called per agent.
14916       Clarify that library loading is independent from start-up.
14917       Remove ambiguous reference to Agent_OnLoad in the Agent_OnUnload spec.
14918   </change>
14919   <change date="31 July 2006" version="1.1.99">
14920       Clarify the interaction between functions and exceptions.
14921       Clarify and give examples of field indices.
14922       Remove confusing "That is" sentence from MonitorWait and MonitorWaited events.
14923       Update links to point to Java 6.
14924   </change>
14925   <change date="6 August 2006" version="1.1.102">
14926       Add ResourceExhaustedEvent.
14927   </change>
14928   <change date="11 October 2012" version="1.2.2">
14929       Fixed the "HTTP" and "Missing Anchor" errors reported by the LinkCheck tool.
14930   </change>
14931   <change date="19 June 2013" version="1.2.3">
14932       Added support for statically linked agents.
14933   </change>
14934   <change date="13 October 2016" version="9.0.0">
14935       Support for modules:
14936        - The majorversion is 9 now
14937        - The ClassFileLoadHook events are not sent during the primordial phase anymore.
14938        - Allow CompiledMethodLoad events at start phase
14939        - Add new capabilities:
14940           - can_generate_early_vmstart
14941           - can_generate_early_class_hook_events
14942        - Add new functions:
14943           - GetAllModules
14944           - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides
14945           - IsModifiableModule
14946       Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to
14947       disallow some implementation defined classes.
14948   </change>
14949   <change date="12 February 2017" version="9.0.0">
14950       Minor update for GetCurrentThread function:
14951        - The function may return NULL in the start phase if the
14952          can_generate_early_vmstart capability is enabled.
14953   </change>
14954   <change date="7 February 2018" version="11.0.0">
14955       Minor update for new class file NestHost and NestMembers attributes:
14956         - Specify that RedefineClasses and RetransformClasses are not allowed
14957           to change the class file NestHost and NestMembers attributes.
14958         - Add new error JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED
14959           that can be returned by RedefineClasses and RetransformClasses.
14960   </change>
14961   <change date="20 May 2019" version="13.0.0">
14962       Minor spec update for the capability "can_redefine_any_class".
14963       It now says:
14964        "RedefineClasses can be called on any modifiable class. See IsModifiableClass.
14965        (can_redefine_classes must also be set)"
14966   </change>
14967   <change date="5 June 2019" version="13.0.0">
14968       Minor PopFrame spec update:
14969         - The specified thread must be suspended or must be the current thread.
14970           (It was not allowed to be the current thread before.)
14971   </change>
14972 </changehistory>
14973 
14974 </specification>
14975 <!-- Keep this comment at the end of the file
14976 Local variables:
14977 mode: sgml
14978 sgml-omittag:t
14979 sgml-shorttag:t
14980 sgml-namecase-general:t
14981 sgml-general-insert-case:lower
14982 sgml-minimize-attributes:nil
14983 sgml-always-quote-attributes:t
14984 sgml-indent-step:2
14985 sgml-indent-data:t
14986 sgml-parent-document:nil
14987 sgml-exposed-tags:nil
14988 sgml-local-catalogs:nil
14989 sgml-local-ecat-files:nil
14990 End:
14991 -->