1 <?xml version="1.0" encoding="ISO-8859-1"?>
   2 <?xml-stylesheet type="text/xsl" href="jvmti.xsl"?>
   3 <!--
   4  Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
   5  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6 
   7  This code is free software; you can redistribute it and/or modify it
   8  under the terms of the GNU General Public License version 2 only, as
   9  published by the Free Software Foundation.
  10 
  11  This code is distributed in the hope that it will be useful, but WITHOUT
  12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  version 2 for more details (a copy is included in the LICENSE file that
  15  accompanied this code).
  16 
  17  You should have received a copy of the GNU General Public License version
  18  2 along with this work; if not, write to the Free Software Foundation,
  19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 
  21  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  or visit www.oracle.com if you need additional information or have any
  23  questions.
  24 -->
  25 
  26 <!DOCTYPE specification [
  27    <!ELEMENT specification (title, intro*, functionsection, errorsection, 
  28                             eventsection, datasection, issuessection, changehistory)>
  29    <!ATTLIST specification label CDATA #REQUIRED 
  30                            majorversion CDATA #REQUIRED 
  31                            minorversion CDATA #REQUIRED 
  32                            microversion CDATA #REQUIRED>
  33 
  34    <!ELEMENT title (#PCDATA|jvmti|tm)*>
  35    <!ATTLIST title subtitle CDATA #REQUIRED>
  36 
  37    <!ELEMENT intro ANY>
  38    <!ATTLIST intro id CDATA #IMPLIED
  39                    label CDATA "">
  40 
  41    <!ELEMENT functionsection (intro*, category*)>
  42    <!ATTLIST functionsection label CDATA #REQUIRED>
  43 
  44    <!ELEMENT category ((intro|typedef|uniontypedef|capabilitiestypedef)*, 
  45                           (function|callback|elide)*)>
  46    <!ATTLIST category id CDATA #REQUIRED
  47                       label CDATA #REQUIRED>
  48 
  49    <!ELEMENT function (synopsis, typedef*, description?, origin,
  50                          (capabilities|eventcapabilities), 
  51                          parameters, errors)>
  52    <!ATTLIST function id CDATA #REQUIRED
  53                       num CDATA #REQUIRED
  54                       phase (onload|onloadOnly|start|live|any) #IMPLIED
  55                       callbacksafe (safe|unsafe) #IMPLIED
  56                       impl CDATA #IMPLIED
  57                       hide CDATA #IMPLIED
  58                       jkernel (yes|no) #IMPLIED
  59                       since CDATA "1.0">
  60 
  61    <!ELEMENT callback ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
  62                         jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void),
  63                         synopsis, description?, parameters)>
  64    <!ATTLIST callback id CDATA #REQUIRED
  65                       since CDATA "1.0">
  66 
  67    <!ELEMENT synopsis (#PCDATA|jvmti)*>
  68 
  69    <!ELEMENT typedef (description?, field*)>
  70    <!ATTLIST typedef id CDATA #REQUIRED
  71                      label CDATA #REQUIRED
  72                      since CDATA "1.0">
  73 
  74    <!ELEMENT uniontypedef (description?, field*)>
  75    <!ATTLIST uniontypedef id CDATA #REQUIRED
  76                      label CDATA #REQUIRED
  77                      since CDATA "1.0">
  78 
  79    <!ELEMENT field ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
  80                      jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|allocfieldbuf|inptr|inbuf|outbuf|vmbuf|ptrtype|struct), 
  81                     description)>
  82    <!ATTLIST field id CDATA #REQUIRED>
  83 
  84    <!ELEMENT capabilitiestypedef (description?, capabilityfield*)>
  85    <!ATTLIST capabilitiestypedef id CDATA #REQUIRED
  86                      label CDATA #REQUIRED>
  87 
  88    <!ELEMENT capabilityfield (description)>
  89    <!ATTLIST capabilityfield id CDATA #REQUIRED
  90                    disp1 CDATA ""
  91                    disp2 CDATA ""
  92                    since CDATA "1.0">
  93 
  94    <!ELEMENT description ANY>
  95 
  96    <!ELEMENT capabilities (required*, capability*)>
  97 
  98    <!ELEMENT eventcapabilities EMPTY>
  99 
 100    <!ELEMENT required ANY>
 101    <!ATTLIST required id CDATA #REQUIRED>
 102 
 103    <!ELEMENT capability ANY>
 104    <!ATTLIST capability id CDATA #REQUIRED>
 105 
 106    <!ELEMENT parameters (param*)>
 107 
 108    <!ELEMENT param ((jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|jthreadGroup|jobject|
 109                      jvalue|enum|jint|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct|ptrtype|
 110                      outptr|allocbuf|allocallocbuf|inptr|inbuf|outbuf|vmbuf|agentbuf), 
 111                     description)>
 112    <!ATTLIST param id CDATA #REQUIRED>
 113 
 114    <!ELEMENT jmethodID EMPTY>
 115    <!ATTLIST jmethodID class  CDATA #IMPLIED
 116                        native CDATA #IMPLIED>
 117 
 118    <!ELEMENT jfieldID EMPTY>
 119    <!ATTLIST jfieldID class CDATA #IMPLIED>
 120 
 121    <!ELEMENT jclass EMPTY>
 122    <!ATTLIST jclass method CDATA #IMPLIED
 123                     field  CDATA #IMPLIED>
 124 
 125    <!ELEMENT jframeID EMPTY>
 126    <!ATTLIST jframeID thread CDATA #IMPLIED>
 127 
 128    <!ELEMENT jrawMonitorID EMPTY>
 129 
 130    <!ELEMENT jthread EMPTY>
 131    <!ATTLIST jthread started CDATA #IMPLIED
 132                      null CDATA #IMPLIED
 133                      frame CDATA #IMPLIED
 134                      impl CDATA #IMPLIED>
 135 
 136    <!ELEMENT varargs EMPTY>
 137 
 138    <!ELEMENT jthreadGroup EMPTY>
 139    <!ELEMENT jobject EMPTY>
 140    <!ELEMENT jvalue EMPTY>
 141    <!ELEMENT jchar EMPTY>
 142    <!ELEMENT jint EMPTY>
 143    <!ATTLIST jint min CDATA #IMPLIED>
 144    <!ELEMENT jlong EMPTY>
 145    <!ELEMENT jfloat EMPTY>
 146    <!ELEMENT jdouble EMPTY>
 147    <!ELEMENT jlocation EMPTY>
 148    <!ELEMENT jboolean EMPTY>
 149    <!ELEMENT char EMPTY>
 150    <!ELEMENT uchar EMPTY>
 151    <!ELEMENT size_t EMPTY>
 152    <!ELEMENT void EMPTY>
 153    <!ELEMENT enum (#PCDATA)*>
 154    <!ELEMENT struct (#PCDATA)*>
 155 
 156    <!ELEMENT nullok ANY>
 157 
 158    <!ELEMENT ptrtype     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 159                                    jthreadGroup|jobject|jvalue), nullok?)>
 160 
 161    <!ELEMENT outptr     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 162                                    jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble|
 163                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 164 
 165    <!ELEMENT allocbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 166                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 167                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 168    <!ATTLIST allocbuf incount CDATA #IMPLIED
 169                       outcount CDATA #IMPLIED>
 170 
 171    <!ELEMENT allocallocbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 172                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 173                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 174    <!ATTLIST allocallocbuf incount CDATA #IMPLIED
 175                       outcount CDATA #IMPLIED>
 176 
 177    <!ELEMENT inptr      (struct, nullok?)>
 178 
 179    <!ELEMENT inbuf      ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 180                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 181                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 182    <!ATTLIST inbuf    incount CDATA #IMPLIED>
 183 
 184    <!ELEMENT outbuf     ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 185                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 186                                    jlocation|jboolean|char|uchar|size_t|void|outbuf), nullok?)>
 187    <!ATTLIST outbuf   incount CDATA #IMPLIED
 188                       outcount CDATA #IMPLIED>
 189 
 190    <!ELEMENT vmbuf      ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 191                                    jthreadGroup|jobject|jvalue|enum|jchar|jint|jlong|jfloat|jdouble|
 192                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 193    <!ATTLIST vmbuf    incount CDATA #IMPLIED
 194                       outcount CDATA #IMPLIED>
 195 
 196    <!ELEMENT agentbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 197                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 198                                    jlocation|jboolean|char|uchar|size_t|void), nullok?)>
 199    <!ATTLIST agentbuf incount CDATA #IMPLIED
 200                       outcount CDATA #IMPLIED>
 201 
 202    <!ELEMENT allocfieldbuf   ((struct|jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jthread|
 203                                    jthreadGroup|jobject|jvalue|enum|jint|jlong|jfloat|jdouble|
 204                                    jlocation|jboolean|char|uchar|size_t|void))>
 205    <!ATTLIST allocfieldbuf outcount CDATA #IMPLIED>
 206 
 207    <!ELEMENT errors (error*)>
 208 
 209    <!ELEMENT error ANY>
 210    <!ATTLIST error id CDATA #REQUIRED>
 211 
 212    <!ELEMENT errorsection (intro*, errorcategory*)>
 213    <!ATTLIST errorsection label CDATA #REQUIRED>
 214 
 215    <!ELEMENT errorcategory (intro*, errorid*)>
 216    <!ATTLIST errorcategory id CDATA #REQUIRED
 217                            label CDATA #REQUIRED>
 218 
 219    <!ELEMENT errorid ANY>
 220    <!ATTLIST errorid id CDATA #REQUIRED
 221                      num CDATA #REQUIRED>
 222 
 223    <!ELEMENT datasection (intro*, basetypes*)>
 224 
 225    <!ELEMENT basetypes (intro*, basetype*)>
 226    <!ATTLIST basetypes id CDATA #REQUIRED
 227                        label CDATA #REQUIRED>
 228 
 229    <!ELEMENT basetype (definition?,description)>
 230    <!ATTLIST basetype id CDATA #REQUIRED>
 231 
 232    <!ELEMENT definition (#PCDATA|jvmti)*>
 233 
 234    <!ELEMENT eventsection (intro*, (event|elide)*)>
 235    <!ATTLIST eventsection label CDATA #REQUIRED>
 236 
 237    <!ELEMENT event (description, origin, typedef*, capabilities, parameters)>
 238    <!ATTLIST event id CDATA #REQUIRED
 239                    label CDATA #REQUIRED
 240                    const CDATA #REQUIRED
 241                    num CDATA #REQUIRED
 242                    phase (onload|start|live|any) #IMPLIED
 243                    filtered (thread|global) #IMPLIED
 244                    since CDATA "1.0">
 245 
 246    <!ELEMENT issuessection (intro*)>
 247    <!ATTLIST issuessection label CDATA #REQUIRED>
 248 
 249    <!ELEMENT changehistory (intro*, change*)>
 250    <!ATTLIST changehistory update CDATA #REQUIRED
 251                            id CDATA #REQUIRED>
 252 
 253    <!ELEMENT change ANY>
 254    <!ATTLIST change date CDATA #REQUIRED
 255                     version CDATA #IMPLIED>
 256 
 257    <!ELEMENT functionlink (#PCDATA|jvmti|code|i|b)*>
 258    <!ATTLIST functionlink id CDATA #REQUIRED>
 259 
 260    <!ELEMENT datalink (#PCDATA|jvmti|code|i|b)*>
 261    <!ATTLIST datalink id CDATA #REQUIRED>
 262 
 263    <!ELEMENT typelink (#PCDATA|jvmti|code|i|b)*>
 264    <!ATTLIST typelink id CDATA #REQUIRED>
 265 
 266    <!ELEMENT fieldlink (#PCDATA|jvmti|code|i|b)*>
 267    <!ATTLIST fieldlink id CDATA #REQUIRED
 268                        struct CDATA #REQUIRED>
 269 
 270    <!ELEMENT paramlink (#PCDATA|jvmti|code|i|b)*>
 271    <!ATTLIST paramlink id CDATA #REQUIRED>
 272 
 273    <!ELEMENT eventlink (#PCDATA|jvmti|code|i|b)*>
 274    <!ATTLIST eventlink id CDATA #REQUIRED>
 275 
 276    <!ELEMENT errorlink (#PCDATA|jvmti|code|i|b|tm)*>
 277    <!ATTLIST errorlink id CDATA #REQUIRED>
 278 
 279    <!ELEMENT externallink (#PCDATA|jvmti|code|i|b|tm)*>
 280    <!ATTLIST externallink id CDATA #REQUIRED>
 281 
 282    <!ELEMENT vmspec EMPTY>
 283    <!ATTLIST vmspec chapter CDATA #IMPLIED>
 284 
 285    <!ELEMENT internallink (#PCDATA|jvmti|code|i|b)*>
 286    <!ATTLIST internallink id CDATA #REQUIRED>
 287 
 288    <!ELEMENT functionphaselist EMPTY>
 289    <!ATTLIST functionphaselist phase (onload|onloadOnly|start|live|any) #REQUIRED>
 290 
 291    <!ELEMENT eventphaselist EMPTY>
 292    <!ATTLIST eventphaselist phase (onload|start|live|any) #REQUIRED>
 293 
 294    <!ELEMENT issue ANY>
 295    
 296    <!ELEMENT rationale ANY>
 297    
 298    <!ELEMENT todo ANY>
 299    
 300    <!ELEMENT origin (#PCDATA)*>
 301 
 302    <!ELEMENT elide (intro|function|callback|event)*>
 303    <!ATTLIST elide why CDATA #IMPLIED>
 304    
 305    <!ELEMENT constants (constant*)>
 306    <!ATTLIST constants id CDATA #REQUIRED
 307                        label CDATA #REQUIRED
 308                        kind (enum|bits|const) #REQUIRED
 309                        since CDATA "1.0">
 310 
 311    <!ELEMENT constant ANY>
 312    <!ATTLIST constant id CDATA #REQUIRED
 313                       num CDATA #REQUIRED>
 314 
 315    <!ELEMENT tm (#PCDATA)>
 316 
 317    <!ELEMENT i (#PCDATA|jvmti|tm)*>
 318 
 319    <!ELEMENT b (#PCDATA|jvmti|code)*>
 320 
 321    <!ELEMENT code (#PCDATA|space)*>
 322 
 323    <!ELEMENT pre ANY>
 324 
 325    <!ELEMENT space EMPTY>
 326 
 327    <!ELEMENT jvmti EMPTY>
 328 
 329    <!ELEMENT example (#PCDATA|i)*>
 330 
 331    <!ELEMENT br EMPTY>
 332 
 333    <!ELEMENT p EMPTY>
 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 align (left|right|center) "center">
 347 
 348    <!ELEMENT th  ANY>
 349    <!ATTLIST th align (left|right|center) "center">
 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         majorversion="9"
 359         minorversion="0"
 360         microversion="0">
 361   <title subtitle="Version">
 362     <tm>JVM</tm> Tool Interface
 363   </title>
 364   
 365   <intro id="whatIs" label="What is the JVM Tool Interface?">
 366     The <tm>JVM</tm> Tool Interface (<jvmti/>) 
 367     is a programming interface used by development and monitoring tools. 
 368     It provides both a way to inspect the state and 
 369     to control the execution of applications running in the
 370     <tm>Java</tm> virtual machine (VM).
 371     <p/>
 372     <jvmti/> is intended to provide a VM interface for the full breadth of tools
 373     that need access to VM state, including but not limited to: profiling,
 374     debugging, monitoring, thread analysis, and coverage analysis tools.
 375     <p/>
 376     <jvmti/> may not be available in all implementations of the <tm>Java</tm> virtual
 377     machine.
 378     <p/>
 379     <jvmti/> is a two-way interface. 
 380     A client of <jvmti/>, hereafter called an <i>agent</i>,
 381     can be notified of
 382     interesting occurrences through <internallink id="EventSection">events</internallink>. 
 383     <jvmti/>
 384     can query and control the application through many 
 385     <internallink id="FunctionSection">functions</internallink>, 
 386     either in response to events or 
 387     independent of them.
 388     <p/>
 389     Agents run in the same process with and communicate directly with 
 390     the virtual machine executing
 391     the application being examined.  This communication is
 392     through a native interface (<jvmti/>). The native in-process interface allows
 393     maximal control with minimal intrusion on the part of a tool. 
 394     Typically, agents are relatively compact. They can be controlled
 395     by a separate process which implements the bulk of a tool's
 396     function without interfering with the target application's normal execution.
 397   </intro>
 398 
 399   <intro id="architecture" label="Architecture">
 400     Tools can be written directly to <jvmti/> or indirectly
 401     through higher level interfaces.
 402     The Java Platform Debugger Architecture includes <jvmti/>, but also
 403     contains higher-level, out-of-process debugger interfaces. The higher-level 
 404     interfaces are more appropriate than <jvmti/> for many tools. 
 405     For more information on the Java Platform Debugger Architecture, 
 406     see the 
 407     <externallink id="docs/technotes/guides/jpda/architecture.html">Java 
 408       Platform Debugger Architecture website</externallink>. 
 409   </intro>
 410 
 411   <intro id="writingAgents" label="Writing Agents">
 412     Agents can be written in any native language that supports C
 413     language calling conventions and C or C++
 414     definitions.
 415     <p/>
 416     The function, event, data type, and constant definitions needed for
 417     using <jvmti/> are defined in the include file <code>jvmti.h</code>.
 418     To use these definitions add the <tm>J2SE</tm> include directory
 419     to your include path and add
 420     <example>
 421 #include &lt;jvmti.h&gt;
 422     </example>
 423     to your source code.
 424   </intro>
 425 
 426   <intro id="deployingAgents" label="Deploying Agents">
 427     An agent is deployed in a platform specific manner but is typically the 
 428     platform equivalent of a dynamic library. On the <tm>Windows</tm> operating 
 429     system, for example, an agent library is a "Dynamic Linked Library" (DLL). 
 430     On the <tm>Solaris</tm> Operating Environment, an agent library is a shared
 431     object (<code>.so</code> file).
 432     <p/>
 433 
 434     An agent may be started at VM startup by specifying the agent library
 435     name using a <internallink id="starting">command line option</internallink>.
 436     Some implementations may support a mechanism to <internallink id="onattach"> 
 437     start agents</internallink> in the live <functionlink id="GetPhase">phase</functionlink>.
 438     The details of how this is initiated are implementation specific.
 439   </intro>
 440 
 441     <intro id="entry point" label="Statically Linked Agents (since version 1.2.3)">
 442 
 443       A native JVMTI Agent may be <i>statically linked</i> with the VM.
 444       The manner in which the library and VM image are combined is
 445       implementation-dependent.
 446       An agent L whose image has been combined with the VM is defined as
 447       <i>statically linked</i> if and only if the agent exports a function
 448       called Agent_OnLoad_L.
 449 <p/>
 450       If a <i>statically linked</i> agent L exports a function called
 451       Agent_OnLoad_L and a function called Agent_OnLoad, the Agent_OnLoad
 452       function will be ignored.
 453       If an agent L is <i>statically linked</i>, an Agent_OnLoad_L
 454       function will be invoked with the same arguments and expected return
 455       value as specified for the Agent_OnLoad function.
 456       An agent L that is <i>statically linked</i> will prohibit an agent of
 457       the same name from being loaded dynamically.
 458 <p/>
 459       The VM will invoke the Agent_OnUnload_L function of the agent, if such
 460       a function is exported, at the same point during VM execution as it would
 461       have called the dynamic entry point Agent_OnUnLoad. A statically loaded
 462       agent cannot be unloaded. The Agent_OnUnload_L function will still be
 463       called to do any other agent shutdown related tasks. 
 464       If a <i>statically linked</i> agent L exports a function called
 465       Agent_OnUnLoad_L and a function called Agent_OnUnLoad, the Agent_OnUnLoad
 466       function will be ignored.
 467 <p/>
 468       If an agent L is <i>statically linked</i>, an Agent_OnAttach_L function
 469       will be invoked with the same arguments and expected return value as
 470       specified for the Agent_OnAttach function.
 471       If a <i>statically linked</i> agent L exports a function called
 472       Agent_OnAttach_L and a function called Agent_OnAttach, the Agent_OnAttach
 473       function will be ignored.
 474 </intro>
 475   
 476   <intro id="starting" label="Agent Command Line Options">
 477     The term "command-line option" is used below to
 478     mean options supplied in the <code>JavaVMInitArgs</code> argument
 479     to the <code>JNI_CreateJavaVM</code> function of the JNI
 480     Invocation API.
 481     <p/>
 482     One of the two following 
 483     command-line options is used on VM startup to 
 484     properly load and run agents.
 485     These arguments identify the library containing 
 486     the agent as well as an options
 487     string to be passed in at startup. 
 488     <dl>
 489       <dt><code>-agentlib:</code><i>&lt;agent-lib-name&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
 490       <dd>
 491         The name following <code>-agentlib:</code> is the name of the
 492         library to load.  Lookup of the library, both its full name and location,
 493         proceeds in a platform-specific manner.
 494         Typically, the <i>&lt;agent-lib-name&gt;</i> is expanded to an
 495         operating system specific file name.
 496         The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
 497         For example, if the option 
 498         <code>-agentlib:foo=opt1,opt2</code> is specified, the VM will attempt to 
 499         load the shared library <code>foo.dll</code> from the system <code>PATH</code>
 500         under <tm>Windows</tm> or <code>libfoo.so</code> from the 
 501         <code>LD_LIBRARY_PATH</code> under the <tm>Solaris</tm> operating
 502         environment.
 503         If the agent library is statically linked into the executable
 504         then no actual loading takes place.
 505     <p/>
 506       </dd>
 507       <dt><code>-agentpath:</code><i>&lt;path-to-agent&gt;</i><code>=</code><i>&lt;options&gt;</i></dt>
 508       <dd>
 509         The path following <code>-agentpath:</code> is the absolute path from which
 510         to load the library.
 511         No library name expansion will occur.
 512         The <i>&lt;options&gt;</i> will be passed to the agent on start-up.
 513         For example, if the option 
 514         <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code> is specified, the VM will attempt to 
 515         load the shared library <code>c:\myLibs\foo.dll</code>. If the agent
 516         library is statically linked into the executable
 517         then no actual loading takes place.
 518     <p/>
 519       </dd>
 520     </dl>
 521     For a dynamic shared library agent, the start-up routine
 522     <internallink id="onload"><code>Agent_OnLoad</code></internallink>
 523     in the library will be invoked. If the agent library is statically linked
 524     into the executable then the system will attempt to invoke the
 525     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> entry point where
 526     &lt;agent-lib-name&gt; is the basename of the 
 527     agent. In the above example <code>-agentpath:c:\myLibs\foo.dll=opt1,opt2</code>,
 528     the system will attempt to find and call the <code>Agent_OnLoad_foo</code> start-up routine.
 529     <p/>
 530     Libraries loaded with <code>-agentlib:</code> or <code>-agentpath:</code>
 531     will be searched for JNI native method implementations to facilitate the
 532     use of Java programming language code in tools, as is needed for 
 533     <internallink id="bci">bytecode instrumentation</internallink>.
 534     <p/>
 535     The agent libraries will be searched after all other libraries have been
 536     searched (agents wishing to override or intercept the native method
 537     implementations of non-agent methods can use the
 538     <eventlink id="NativeMethodBind">NativeMethodBind event</eventlink>).
 539     <p/>
 540     These switches do the above and nothing more - they do not change the 
 541     state of the VM or <jvmti/>.  No command line options are needed 
 542     to enable <jvmti/> 
 543     or aspects of <jvmti/>, this is handled programmatically
 544     by the use of 
 545     <internallink id="capability">capabilities</internallink>.
 546   </intro>
 547 
 548   <intro id="startup" label="Agent Start-Up">
 549     The VM starts each agent by invoking a start-up function.
 550     If the agent is started in the <code>OnLoad</code>
 551     <functionlink id="GetPhase">phase</functionlink> the function
 552     <internallink id="onload"><code>Agent_OnLoad</code></internallink>
 553     or <internallink id="onload"><code>Agent_OnLoad_L</code></internallink>
 554     for statically linked agents will be invoked.
 555     If the agent is started in the live
 556     <functionlink id="GetPhase">phase</functionlink> the function
 557     <internallink id="onattach"><code>Agent_OnAttach</code></internallink>
 558     or <internallink id="onattach"><code>Agent_OnAttach_L</code></internallink>
 559     for statically linked agents will be invoked.
 560     Exactly one call to a start-up function is made per agent.  
 561   </intro>
 562 
 563   <intro id="onload" label="Agent Start-Up (OnLoad phase)">
 564     If an agent is started during the <code>OnLoad</code> phase then its
 565     agent library must export a start-up function with the following prototype:
 566     <example>
 567 JNIEXPORT jint JNICALL 
 568 Agent_OnLoad(JavaVM *vm, char *options, void *reserved)</example>
 569     Or for a statically linked agent named 'L':
 570     <example>
 571 JNIEXPORT jint JNICALL 
 572 Agent_OnLoad_L(JavaVM *vm, char *options, void *reserved)</example>
 573 
 574     The VM will start the agent by calling this function.  
 575     It will be called early enough in VM initialization that:
 576     <ul>
 577       <li><functionlink id="SetSystemProperty">system properties</functionlink>
 578         may be set before they have been used in the start-up of the VM</li>
 579       <li>the full set of 
 580         <internallink id="capability">capabilities</internallink>
 581         is still available (note that capabilities that configure the VM
 582         may only be available at this time--see the 
 583         <internallink id="capability">Capability function section</internallink>)</li>
 584       <li>no bytecodes have executed</li>
 585       <li>no classes have been loaded</li>
 586       <li>no objects have been created</li>
 587     </ul>
 588     <p/>
 589     The VM will call the <code>Agent_OnLoad</code> or
 590     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> function with
 591     <i>&lt;options&gt;</i> as the second argument - 
 592     that is, using the command-line option examples,
 593     <code>"opt1,opt2"</code> will be passed to the <code>char *options</code> 
 594     argument of <code>Agent_OnLoad</code>.
 595     The <code>options</code> argument is encoded as a
 596     <internallink id="mUTF">modified UTF-8</internallink> string.
 597     If <i>=&lt;options&gt;</i> is not specified, 
 598     a zero length string is passed to <code>options</code>.
 599     The lifespan of the <code>options</code> string is the
 600     <code>Agent_OnLoad</code> or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code>
 601     call.  If needed beyond this time the string or parts of the string must
 602     be copied.
 603     The period between when <code>Agent_OnLoad</code> is called and when it
 604     returns is called the <i>OnLoad phase</i>.
 605     Since the VM is not initialized during the OnLoad 
 606     <functionlink id="GetPhase">phase</functionlink>,
 607     the set of allowed operations 
 608     inside <code>Agent_OnLoad</code> is restricted (see the function descriptions for the
 609     functionality available at this time). 
 610     The agent can safely process the options and set 
 611     event callbacks with <functionlink id="SetEventCallbacks"></functionlink>. Once  
 612     the VM initialization event is received 
 613     (that is, the <eventlink id="VMInit">VMInit</eventlink> 
 614     callback is invoked), the agent
 615     can complete its initialization.
 616     <rationale>
 617       Early startup is required so that agents can set the desired capabilities,
 618       many of which must be set before the VM is initialized.
 619       In JVMDI, the -Xdebug command-line option provided 
 620       very coarse-grain control of capabilities. 
 621       JVMPI implementations use various tricks to provide a single "JVMPI on" switch.
 622       No reasonable command-line 
 623       option could provide the fine-grain of control required to balance needed capabilities vs
 624       performance impact.  
 625       Early startup is also needed so that agents can control the execution
 626       environment - modifying the file system and system properties to install
 627       their functionality.
 628     </rationale>
 629     <p/>
 630     The return value from <code>Agent_OnLoad</code> or
 631     <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> is used to indicate an error.
 632     Any value other than zero indicates an error and causes termination of the VM.
 633   </intro>
 634   
 635   <intro id="onattach" label="Agent Start-Up (Live phase)">
 636     A VM may support a mechanism that allows agents to be started in the VM during the live 
 637     <functionlink id="GetPhase">phase</functionlink>. The details of how this is supported,
 638     are implementation specific. For example, a tool may use some platform specific mechanism, 
 639     or implementation specific API, to attach to the running VM, and request it start a given
 640     agent.
 641     <p/>
 642     If an agent is started during the live phase then its agent library
 643     must export a start-up function 
 644     with the following prototype:
 645     <example>
 646 JNIEXPORT jint JNICALL 
 647 Agent_OnAttach(JavaVM* vm, char *options, void *reserved)</example>
 648 Or for a statically linked agent named 'L':
 649     <example>
 650 JNIEXPORT jint JNICALL 
 651 Agent_OnAttach_L(JavaVM* vm, char *options, void *reserved)</example>
 652 
 653     <p/>         
 654     The VM will start the agent by calling this function.  
 655     It will be called in the context of a thread
 656     that is attached to the VM. The first argument <i>&lt;vm&gt;</i> is the Java VM.
 657     The <i>&lt;options&gt;</i> argument is the startup options provided to the agent.
 658     <i>&lt;options&gt;</i> is encoded as a <internallink id="mUTF">modified UTF-8
 659     </internallink> string.
 660     If startup options were not provided, a zero length string is passed to 
 661     <code>options</code>. The lifespan of the <code>options</code> string is the 
 662     <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name&gt;</code> call.
 663     If needed beyond this time the string or parts of the string must be copied.
 664     <p/>
 665     Note that some <internallink id="capability">capabilities</internallink> 
 666     may not be available in the live phase.
 667     <p/>
 668     The <code>Agent_OnAttach</code> or <code>Agent_OnAttach_&lt;agent-lib-name
 669     &gt;</code> function initializes the agent and returns a value
 670     to the VM to indicate if an error occurred. Any value other than zero indicates an error. 
 671     An error does not cause the VM to terminate. Instead the VM ignores the error, or takes 
 672     some implementation specific action -- for example it might print an error to standard error, 
 673     or record the error in a system log.
 674   </intro>
 675 
 676   <intro id="onunload" label="Agent Shutdown">
 677     The library may optionally export a 
 678     shutdown function with the following prototype:
 679     <example>
 680 JNIEXPORT void JNICALL 
 681 Agent_OnUnload(JavaVM *vm)</example>
 682     Or for a statically linked agent named 'L':
 683     <example>
 684 JNIEXPORT void JNICALL 
 685 Agent_OnUnload_L(JavaVM *vm)</example>
 686 
 687     This function will be called by the VM when the library is about to be unloaded.
 688     The library will be unloaded (unless it is statically linked into the
 689     executable) and this function will be called if some platform specific 
 690     mechanism causes the unload (an unload mechanism is not specified in this document)
 691     or the library is (in effect) unloaded by the termination of the VM whether through 
 692     normal termination or VM failure, including start-up failure.
 693     Uncontrolled shutdown is, of couse, an exception to this rule.
 694     Note the distinction between this function and the 
 695     <eventlink id="VMDeath">VM Death event</eventlink>: for the VM Death event
 696     to be sent, the VM must have run at least to the point of initialization and a valid 
 697     <jvmti/> environment must exist which has set a callback for VMDeath
 698     and enabled the event.
 699     None of these are required for <code>Agent_OnUnload</code> or
 700     <code>Agent_OnUnload_&lt;agent-lib-name&gt;</code> and this function
 701     is also called if the library is unloaded for other reasons.
 702     In the case that a VM Death event is sent, it will be sent before this 
 703     function is called (assuming this function is called due to VM termination).
 704     This function can be used to clean-up resources allocated by the agent.
 705   </intro>
 706 
 707   <intro id="tooloptions" label="JAVA_TOOL_OPTIONS">
 708     Since the command-line cannot always be accessed or modified, for example in embedded VMs
 709     or simply VMs launched deep within scripts, a <code>JAVA_TOOL_OPTIONS</code> variable is
 710     provided so that agents may be launched in these cases.
 711     <p/>
 712     Platforms which support environment variables or other named strings, may support the 
 713     <code>JAVA_TOOL_OPTIONS</code> variable.  This variable will be broken into options at white-space 
 714     boundaries.  White-space characters include space, tab, carriage-return, new-line, 
 715     vertical-tab, and form-feed.  Sequences of white-space characters are considered 
 716     equivalent to a single white-space character.  No white-space is included in the options 
 717     unless quoted.  Quoting is as follows:
 718     <ul>
 719         <li>All characters enclosed between a pair of single quote marks (''), except a single 
 720         quote, are quoted.</li>
 721         <li>Double quote characters have no special meaning inside a pair of single quote marks.</li>
 722         <li>All characters enclosed between a pair of double quote marks (""), except a double 
 723         quote, are quoted.</li>
 724         <li>Single quote characters have no special meaning inside a pair of double quote marks.</li>
 725         <li>A quoted part can start or end anywhere in the variable.</li>
 726         <li>White-space characters have no special meaning when quoted -- they are included in
 727         the option like any other character and do not mark white-space boundaries.</li>
 728         <li>The pair of quote marks is not included in the option.</li>
 729     </ul>
 730     <code>JNI_CreateJavaVM</code> (in the JNI Invocation API) will prepend these options to the options supplied 
 731     in its <code>JavaVMInitArgs</code> argument. Platforms may disable this feature in cases where security is 
 732     a concern; for example, the Reference Implementation disables this feature on Unix systems when 
 733     the effective user or group ID differs from the real ID.  
 734     This feature is intended to support the initialization of tools -- specifically including the 
 735     launching of native or Java programming language agents.  Multiple tools may wish to use this 
 736     feature, so the variable should not be overwritten, instead,  options should be appended to 
 737     the variable.  Note that since the variable is processed at the time of the JNI Invocation 
 738     API create VM call, options processed by a launcher (e.g., VM selection options) will not be handled.
 739   </intro>
 740 
 741   <intro id="environments" label="Environments">
 742     The <jvmti/> specification supports the use of multiple simultaneous
 743     <jvmti/> agents.
 744     Each agent has its own <jvmti/> environment.  
 745     That is, the <jvmti/> state is
 746     separate for each agent - changes to one environment do not affect the
 747     others.  The state of a <jvmti/> 
 748     environment includes:
 749     <ul>
 750       <li><functionlink id="SetEventCallbacks">the event callbacks</functionlink></li>
 751       <li><functionlink id="SetEventNotificationMode">the set of events which are enabled</functionlink></li>
 752       <li><internallink id="capability">the capabilities</internallink></li>
 753       <li><internallink id="memory">the memory allocation/deallocation hooks</internallink></li>
 754     </ul>
 755     Although their <jvmti/> state 
 756     is separate, agents inspect and modify the shared state
 757     of the VM, they also share the native environment in which they execute.
 758     As such, an agent can perturb the results of other agents or cause them
 759     to fail.  It is the responsibility of the agent writer to specify the level
 760     of compatibility with other agents.  <jvmti/> implementations are not capable
 761     of preventing destructive interactions between agents. Techniques to reduce
 762     the likelihood of these occurrences are beyond the scope of this document.
 763     <p/>
 764     An agent creates a <jvmti/> environment 
 765     by passing a <jvmti/> version 
 766     as the interface ID to the JNI Invocation API function 
 767     <externallink id="docs/technotes/guides/jni/spec/invocation.html#GetEnv">
 768       <code>GetEnv</code></externallink>.
 769     See <internallink id="jvmtiEnvAccess">Accessing <jvmti/> Functions</internallink>
 770     for more details on the creation and use of 
 771     <jvmti/> environments.
 772     Typically, <jvmti/> environments are created by calling <code>GetEnv</code> from 
 773     <internallink id="onload"><code>Agent_OnLoad</code></internallink>.
 774   </intro>
 775 
 776   <intro id="bci" label="Bytecode Instrumentation">
 777     This interface does not include some events that one might expect in an interface with
 778     profiling support.  Some examples include object allocation events and full speed
 779     method enter and exit events.  The interface instead provides support for 
 780     <i>bytecode instrumentation</i>, the ability to alter the Java virtual machine
 781     bytecode instructions which comprise the target program.  Typically, these alterations
 782     are to add "events" to the code of a method - for example, to add, at the beginning of a method,
 783     a call to <code>MyProfiler.methodEntered()</code>.  
 784     Since the changes are purely additive, they do not modify application
 785     state or behavior.
 786     Because the inserted agent code is standard bytecodes, the VM can run at full speed,
 787     optimizing not only the target program but also the instrumentation.  If the 
 788     instrumentation does not involve switching from bytecode execution, no expensive
 789     state transitions are needed.  The result is high performance events.
 790     This approach also provides complete control to the agent: instrumentation can be
 791     restricted to "interesting" portions of the code (e.g., the end user's code) and
 792     can be conditional.  Instrumentation can run entirely in Java programming language
 793     code or can call into the native agent.  Instrumentation can simply maintain
 794     counters or can statistically sample events.
 795     <p/>  
 796     Instrumentation can be inserted in one of three ways:
 797     <ul>
 798       <li>
 799         Static Instrumentation: The class file is instrumented before it
 800         is loaded into the VM - for example, by creating a duplicate directory of
 801         <code>*.class</code> files which have been modified to add the instrumentation.
 802         This method is extremely awkward and, in general, an agent cannot know 
 803         the origin of the class files which will be loaded.
 804       </li>
 805       <li>
 806         Load-Time Instrumentation: When a class file is loaded by the VM, the raw
 807         bytes of the class file are sent for instrumentation to the agent.
 808         The <eventlink id="ClassFileLoadHook"/>
 809         event, triggered by the class load,
 810         provides this functionality.  This mechanism provides efficient
 811         and complete access to one-time instrumentation.
 812       </li>
 813       <li>
 814         Dynamic Instrumentation: A class which is already loaded (and possibly
 815         even running) is modified.  This optional feature is provided by the
 816         <eventlink id="ClassFileLoadHook"/> event, triggered by calling the
 817         <functionlink id="RetransformClasses"/> function.
 818         Classes can be modified multiple times and can be returned to their
 819         original state.
 820         The mechanism allows instrumentation which changes during the 
 821         course of execution.
 822       </li>
 823     </ul>
 824     <p/>  
 825     The class modification functionality provided in this interface
 826     is intended to provide a mechanism for instrumentation
 827     (the <eventlink id="ClassFileLoadHook"/> event
 828     and the <functionlink id="RetransformClasses"/> function)
 829     and, during development, for fix-and-continue debugging
 830     (the <functionlink id="RedefineClasses"/> function).
 831     <p/>  
 832     Care must be taken to avoid perturbing dependencies, especially when 
 833     instrumenting core classes.  For example, an approach to getting notification
 834     of every object allocation is to instrument the constructor on 
 835     <code>Object</code>.  Assuming that the constructor is initially
 836     empty, the constructor could be changed to:
 837     <example>
 838       public Object() {
 839         MyProfiler.allocationTracker(this);
 840       }
 841     </example>
 842     However, if this change was made using the 
 843     <eventlink id="ClassFileLoadHook"/>
 844     event then this might impact a typical VM as follows: 
 845     the first created object will call the constructor causing a class load of
 846     <code>MyProfiler</code>; which will then cause
 847     object creation, and since <code>MyProfiler</code> isn't loaded yet,
 848     infinite recursion; resulting in a stack overflow.  A refinement of this
 849     would be to delay invoking the tracking method until a safe time.  For
 850     example, <code>trackAllocations</code> could be set in the 
 851     handler for the <code>VMInit</code> event.
 852     <example>
 853       static boolean trackAllocations = false;
 854 
 855       public Object() {
 856         if (trackAllocations) {
 857           MyProfiler.allocationTracker(this);
 858         }
 859       }
 860     </example>
 861     <p/>
 862     The <functionlink id="SetNativeMethodPrefix"/> allows native methods
 863     to be instrumented by the use of wrapper methods.
 864   </intro>
 865 
 866 <intro id="bcimodules" label="Bytecode Instrumentation of code in modules">
 867   Agents can use the functions <functionlink id="AddModuleReads"/>,
 868   <functionlink id="AddModuleExports"/>, <functionlink id="AddModuleOpens"/>,
 869   <functionlink id="AddModuleUses"/> and <functionlink id="AddModuleProvides"/>
 870   to update a module to expand the set of modules that it reads, the set of
 871   packages that it exports or opens to other modules, or the services that it
 872   uses and provides.
 873   <p/>
 874   As an aid to agents that deploy supporting classes on the search path of
 875   the bootstrap class loader, or the search path of the class loader that
 876   loads the main class, the Java virtual machine arranges for the module
 877   of classes transformed by the <eventlink id="ClassFileLoadHook"/> event to
 878   read the unnamed module of both class loaders.
 879 </intro>
 880 
 881   <intro id="mUTF" label="Modified UTF-8 String Encoding">
 882     <jvmti/> uses modified UTF-8 to encode character strings.
 883     This is the same encoding used by JNI.
 884     Modified UTF-8 differs 
 885     from standard UTF-8 in the representation of supplementary characters 
 886     and of the null character. See the
 887     <externallink id="docs/technotes/guides/jni/spec/types.html#modified_utf_8_strings">
 888       Modified UTF-8 Strings</externallink>
 889     section of the JNI specification for details.
 890   </intro>
 891 
 892   <intro id="context" label="Specification Context">
 893     Since this interface provides access to the state of applications running in the
 894     Java virtual machine; 
 895     terminology refers to the Java platform and not the native
 896     platform (unless stated otherwise).  For example:
 897     <ul>
 898       <li>"thread" means Java programming language thread.</li>
 899       <li>"stack frame" means Java virtual machine stack frame.</li>
 900       <li>"class" means Java programming language class.</li>
 901       <li>"heap" means Java virtual machine heap.</li>
 902       <li>"monitor" means Java programming language object monitor.</li>
 903     </ul>
 904     <p/>
 905     Sun, Sun Microsystems, the Sun logo, Java, and JVM
 906     are trademarks or registered trademarks of Oracle 
 907     and/or its affiliates, in the U.S. and other countries.
 908   </intro>
 909 
 910 
 911 <functionsection label="Functions">
 912   <intro id="jvmtiEnvAccess" label="Accessing Functions">
 913     Native code accesses <jvmti/> features 
 914     by calling <jvmti/> functions. 
 915     Access to <jvmti/> functions is by use of an interface pointer
 916     in the same manner as 
 917     <externallink id="docs/technotes/guides/jni/spec/design.html">Java 
 918       Native Interface (JNI) functions</externallink> are accessed.
 919     The <jvmti/> interface pointer is called the 
 920     <i>environment pointer</i>.
 921     <p/>
 922     An environment pointer is a pointer to an environment and has
 923     the type <code>jvmtiEnv*</code>.
 924     An environment has information about its <jvmti/> connection.
 925     The first value in the environment is a pointer to the function table.
 926     The function table is an array of pointers to <jvmti/> functions.
 927     Every function pointer is at a predefined offset inside the 
 928     array. 
 929     <p/>
 930     When used from the C language:
 931     double indirection is used to access the functions;
 932     the environment pointer provides context and is the first
 933     parameter of each function call; for example:
 934     <example>
 935 jvmtiEnv *jvmti;
 936 ...
 937 jvmtiError err = (*jvmti)->GetLoadedClasses(jvmti, &amp;class_count, &amp;classes);
 938     </example>
 939     <p/>
 940     When used from the C++ language:
 941     functions are accessed as member functions of <code>jvmtiEnv</code>;
 942     the environment pointer is not passed to the function call; for example:
 943     <example>
 944 jvmtiEnv *jvmti;
 945 ...
 946 jvmtiError err = jvmti->GetLoadedClasses(&amp;class_count, &amp;classes);
 947     </example>
 948     Unless otherwise stated, all examples and declarations in this 
 949     specification use the C language.
 950     <p/>
 951     A <jvmti/> environment can be obtained through the JNI Invocation API
 952     <code>GetEnv</code> function:
 953     <example>
 954 jvmtiEnv *jvmti;
 955 ...
 956 (*jvm)->GetEnv(jvm, &amp;jvmti, JVMTI_VERSION_1_0);
 957     </example>
 958     Each call to <code>GetEnv</code> 
 959     creates a new <jvmti/> connection and thus
 960     a new <jvmti/> environment. 
 961     The <code>version</code> argument of <code>GetEnv</code> must be
 962     a <jvmti/> version.
 963     The returned environment may have a different version than the
 964     requested version but the returned environment must be compatible.
 965     <code>GetEnv</code> will return <code>JNI_EVERSION</code> if a 
 966     compatible version is not available, if <jvmti/> is not supported or
 967     <jvmti/> is not supported in the current VM configuration.
 968     Other interfaces may be added for creating <jvmti/> environments
 969     in specific contexts.
 970     Each environment has its own state (for example,
 971     <functionlink id="SetEventNotificationMode">desired events</functionlink>, 
 972     <functionlink id="SetEventCallbacks">event handling functions</functionlink>, and 
 973     <functionlink id="AddCapabilities">capabilities</functionlink>). 
 974     An environment is released with 
 975     <functionlink id="DisposeEnvironment"></functionlink>. 
 976     Thus, unlike JNI which has one environment per thread, <jvmti/> environments work
 977     across threads and are created dynamically.
 978   </intro>
 979 
 980   <intro id="functionReturn" label="Function Return Values">
 981     <jvmti/> functions always return an
 982     <internallink id="ErrorSection">error code</internallink> via the
 983     <datalink id="jvmtiError"/> function return value. 
 984     Some functions can return additional
 985     values through pointers provided by the calling function. 
 986     In some cases, <jvmti/> functions allocate memory that your program must
 987     explicitly deallocate. This is indicated in the individual <jvmti/>
 988     function descriptions.  Empty lists, arrays, sequences, etc are 
 989     returned as <code>NULL</code>.
 990     <p/>
 991     In the event that the <jvmti/> function encounters
 992     an error (any return value other than <code>JVMTI_ERROR_NONE</code>) the values
 993     of memory referenced by argument pointers is undefined, but no memory
 994     will have been allocated and no global references will have been allocated.
 995     If the error occurs because of invalid input, no action will have occurred.
 996   </intro>
 997 
 998 <intro id="refs" label="Managing JNI Object References">
 999     <jvmti/> functions identify objects with JNI references 
1000     (<datalink id="jobject"/> and <datalink id="jclass"/>)
1001     and their derivatives
1002     (<datalink id="jthread"/> and <datalink id="jthreadGroup"/>).
1003     References passed to 
1004     <jvmti/> functions can be either global or local, but they must be 
1005     strong references. All references returned by <jvmti/> functions are 
1006     local references--these local references are created 
1007     during the <jvmti/> call.
1008     Local references are a resource that must be managed (see the 
1009     <externallink id="docs/technotes/guides/jni/spec/functions.html#local_references">
1010       JNI Documentation</externallink>).  
1011     When threads return from native code all local references
1012     are freed.  Note that some threads, including typical
1013     agent threads, will never return from native code.
1014     A thread is ensured the ability to create sixteen local 
1015     references without the need for any explicit management.
1016     For threads executing a limited number of <jvmti/> calls before
1017     returning from native code
1018     (for example, threads processing events), 
1019     it may be determined that no explicit management
1020     is needed.
1021     However, long running agent threads will need explicit
1022     local reference management--usually with the JNI functions
1023     <code>PushLocalFrame</code> and <code>PopLocalFrame</code>.
1024     Conversely, to preserve references beyond the
1025     return from native code, they must be converted to global references.
1026     These rules do not apply to <datalink id="jmethodID"/> and <datalink id="jfieldID"/> 
1027     as they are not <datalink id="jobject"/>s.
1028 </intro>
1029 
1030     <intro id="prereqState" label="Prerequisite State for Calling Functions">
1031       Unless the function explicitly states that the agent must bring
1032       a thread or the VM to a particular state (for example, suspended),
1033       the <jvmti/> implementation is responsible for bringing the VM to a
1034       safe and consistent state for performing the function.
1035     </intro>
1036 
1037     <intro id="functionsExceptions" label="Exceptions and Functions">
1038       <jvmti/> functions never throw exceptions; error conditions are 
1039       communicated via the 
1040       <internallink id="functionReturn">function return value</internallink>.
1041       Any existing exception state is preserved across a call to a 
1042       <jvmti/> function.
1043       See the
1044       <externallink 
1045         id="docs/technotes/guides/jni/spec/design.html#java_exceptions"
1046              >Java Exceptions</externallink>
1047       section of the JNI specification for information on handling exceptions.
1048     </intro>
1049 
1050   <category id="memory" label="Memory Management">
1051     <intro>
1052       These functions provide for the allocation and deallocation of 
1053       memory used by <jvmti/> functionality and can be used to provide
1054       working memory for agents.
1055       Memory managed by <jvmti/> is not compatible with other memory
1056       allocation libraries and mechanisms.
1057     </intro>
1058 
1059     <function id="Allocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="46">
1060       <synopsis>Allocate</synopsis>
1061       <description>
1062         Allocate an area of memory through the <jvmti/> allocator. 
1063         The allocated
1064         memory should be freed with <functionlink id="Deallocate"></functionlink>.
1065       </description>
1066       <origin>jvmdi</origin>
1067       <capabilities>
1068       </capabilities>
1069       <parameters>
1070         <param id="size">
1071           <jlong/>
1072           <description>
1073             The number of bytes to allocate.
1074             <rationale>
1075               <code>jlong</code> is used for compatibility with JVMDI.
1076             </rationale>
1077           </description>
1078         </param>
1079         <param id="mem_ptr">
1080           <allocbuf incount="size"><uchar/></allocbuf>
1081           <description>
1082             On return, a pointer to the beginning of the allocated memory.
1083             If <code>size</code> is zero, <code>NULL</code> is returned.
1084           </description>
1085         </param>
1086       </parameters>
1087       <errors>
1088         <error id="JVMTI_ERROR_OUT_OF_MEMORY">
1089           Memory request cannot be honored.
1090         </error>
1091         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
1092           <paramlink id="size"></paramlink> is less than zero.
1093         </error>
1094       </errors>
1095     </function>
1096 
1097     <function id="Deallocate" jkernel="yes" phase="any" callbacksafe="safe" impl="notrace" num="47">
1098       <synopsis>Deallocate</synopsis>
1099       <description>
1100         Deallocate <code>mem</code>  using the <jvmti/> allocator. 
1101         This function should
1102         be used to deallocate any memory allocated and returned 
1103         by a <jvmti/> function
1104         (including memory allocated with <functionlink id="Allocate"></functionlink>).
1105         All allocated memory must be deallocated
1106         or the memory cannot be reclaimed.
1107       </description>
1108       <origin>jvmdi</origin>
1109       <capabilities>
1110       </capabilities>
1111       <parameters>
1112         <param id="mem">
1113           <outbuf>
1114             <uchar/>
1115             <nullok>the call is ignored</nullok>
1116           </outbuf>
1117           <description>
1118             A pointer to the beginning of the allocated memory.
1119             Please ignore "On return, the elements are set."
1120               <todo>keep it from generating "On return, the elements are set"</todo>
1121           </description>
1122         </param>
1123       </parameters>
1124       <errors>
1125       </errors>
1126     </function>
1127   </category>
1128 
1129   <category id="threadCategory" label="Thread">
1130     <intro>
1131     </intro>
1132 
1133     <function id="GetThreadState" num="17">
1134       <synopsis>Get Thread State</synopsis>
1135       <description>
1136         Get the state of a thread.  The state of the thread is represented by the
1137         answers to the hierarchical set of questions below:
1138           <ul type="circle">
1139             <li><i>Alive?</i>
1140               <ul>
1141                 <li>Not alive.
1142                   <ul type="circle">
1143                     <li><i>Why not alive?</i>
1144                       <ul>
1145                         <li>New.</li>
1146                         <li>Terminated (<datalink 
1147                             id="JVMTI_THREAD_STATE_TERMINATED"><code>JVMTI_THREAD_STATE_TERMINATED</code></datalink>)</li>
1148                       </ul>
1149                     </li>
1150                   </ul>
1151                 </li>
1152                 <li>Alive (<datalink 
1153                     id="JVMTI_THREAD_STATE_ALIVE"><code>JVMTI_THREAD_STATE_ALIVE</code></datalink>)
1154                   <ul type="circle">
1155                     <li><i>Suspended?</i>
1156                       <ul>
1157                         <li>Suspended (<datalink 
1158                             id="JVMTI_THREAD_STATE_SUSPENDED"><code>JVMTI_THREAD_STATE_SUSPENDED</code></datalink>)</li>
1159                         <li>Not suspended</li>
1160                       </ul>
1161                     </li>
1162                     <li><i>Interrupted?</i>
1163                       <ul>
1164                         <li>Interrupted (<datalink 
1165                             id="JVMTI_THREAD_STATE_INTERRUPTED"><code>JVMTI_THREAD_STATE_INTERRUPTED</code></datalink>)</li>
1166                         <li>Not interrupted.</li>
1167                       </ul>
1168                     </li>
1169                     <li><i>In native?</i>
1170                       <ul>
1171                         <li>In native code (<datalink 
1172                             id="JVMTI_THREAD_STATE_IN_NATIVE"><code>JVMTI_THREAD_STATE_IN_NATIVE</code></datalink>)</li>
1173                         <li>In Java programming language code</li>
1174                       </ul>
1175                     </li>
1176                     <li><i>What alive state?</i>
1177                       <ul>
1178                         <li>Runnable (<datalink 
1179                             id="JVMTI_THREAD_STATE_RUNNABLE"><code>JVMTI_THREAD_STATE_RUNNABLE</code></datalink>)</li>
1180                         <li>Blocked (<datalink 
1181                             id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER"><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></datalink>)</li>
1182                         <li>Waiting (<datalink 
1183                             id="JVMTI_THREAD_STATE_WAITING"><code>JVMTI_THREAD_STATE_WAITING</code></datalink>)
1184                           <ul type="circle">
1185                             <li><i>Timed wait?</i>
1186                               <ul>
1187                                 <li>Indefinite (<datalink 
1188                                     id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY"><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></datalink></li>
1189                                 <li>Timed (<datalink 
1190                                     id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT"><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></datalink>)</li>
1191                               </ul>
1192                             </li>
1193                             <li><i>Why waiting?</i>
1194                               <ul>
1195                                 <li>Object.wait (<datalink 
1196                                     id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT"><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></datalink>)</li>
1197                                 <li>LockSupport.park (<datalink 
1198                                     id="JVMTI_THREAD_STATE_PARKED"><code>JVMTI_THREAD_STATE_PARKED</code></datalink>)</li>
1199                                 <li>Sleeping (<datalink 
1200                                     id="JVMTI_THREAD_STATE_SLEEPING"><code>JVMTI_THREAD_STATE_SLEEPING</code></datalink>)</li>
1201                               </ul>
1202                             </li>
1203                           </ul>
1204                         </li>
1205                       </ul>
1206                     </li>
1207                   </ul>
1208                 </li>
1209               </ul>
1210             </li>
1211           </ul>
1212         <p/>
1213         The answers are represented by the following bit vector. 
1214         <constants id="jvmtiThreadState" label="Thread State Flags" kind="bits">
1215           <constant id="JVMTI_THREAD_STATE_ALIVE" num="0x0001">
1216             Thread is alive. Zero if thread is new (not started) or terminated.
1217           </constant>
1218           <constant id="JVMTI_THREAD_STATE_TERMINATED" num="0x0002">
1219             Thread has completed execution.
1220           </constant>
1221           <constant id="JVMTI_THREAD_STATE_RUNNABLE" num="0x0004">
1222             Thread is runnable.
1223           </constant>
1224           <constant id="JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER" num="0x0400">
1225             Thread is waiting to enter a synchronization block/method or,
1226             after an <code>Object.wait()</code>, waiting to re-enter a 
1227             synchronization block/method.
1228           </constant>
1229           <constant id="JVMTI_THREAD_STATE_WAITING" num="0x0080">
1230             Thread is waiting.
1231           </constant>
1232           <constant id="JVMTI_THREAD_STATE_WAITING_INDEFINITELY" num="0x0010">
1233             Thread is waiting without a timeout.
1234             For example, <code>Object.wait()</code>.
1235           </constant>
1236           <constant id="JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT" num="0x0020">
1237             Thread is waiting with a maximum time to wait specified.
1238             For example, <code>Object.wait(long)</code>.
1239           </constant>
1240           <constant id="JVMTI_THREAD_STATE_SLEEPING" num="0x0040">
1241             Thread is sleeping -- <code>Thread.sleep(long)</code>.
1242           </constant>
1243           <constant id="JVMTI_THREAD_STATE_IN_OBJECT_WAIT" num="0x0100">
1244             Thread is waiting on an object monitor -- <code>Object.wait</code>.
1245           </constant>
1246           <constant id="JVMTI_THREAD_STATE_PARKED" num="0x0200">
1247             Thread is parked, for example: <code>LockSupport.park</code>,
1248             <code>LockSupport.parkUtil</code> and <code>LockSupport.parkNanos</code>.
1249           </constant>
1250           <constant id="JVMTI_THREAD_STATE_SUSPENDED" num="0x100000">
1251             Thread suspended.
1252             <code>java.lang.Thread.suspend()</code>
1253             or a <jvmti/> suspend function 
1254             (such as <functionlink id="SuspendThread"></functionlink>) 
1255             has been called on the thread. If this bit
1256             is set, the other bits refer to the thread state before suspension.
1257           </constant>
1258           <constant id="JVMTI_THREAD_STATE_INTERRUPTED" num="0x200000">
1259             Thread has been interrupted.
1260           </constant>
1261           <constant id="JVMTI_THREAD_STATE_IN_NATIVE" num="0x400000">
1262             Thread is in native code--that is, a native method is running
1263             which has not called back into the VM or Java programming
1264             language code.
1265             <p/>
1266             This flag is not set when running VM compiled Java programming
1267             language code nor is it set when running VM code or
1268             VM support code. Native VM interface functions, such as JNI and
1269             <jvmti/> functions, may be implemented as VM code.
1270           </constant>
1271           <constant id="JVMTI_THREAD_STATE_VENDOR_1" num="0x10000000">
1272             Defined by VM vendor.
1273           </constant>
1274           <constant id="JVMTI_THREAD_STATE_VENDOR_2" num="0x20000000">
1275             Defined by VM vendor.
1276           </constant>
1277           <constant id="JVMTI_THREAD_STATE_VENDOR_3" num="0x40000000">
1278             Defined by VM vendor.
1279           </constant>
1280         </constants>
1281         The following definitions are used to convert <jvmti/> thread state
1282         to <code>java.lang.Thread.State</code> style states.
1283         <constants id="jvmtiJavaLangThreadState" label="java.lang.Thread.State Conversion Masks" kind="bits">
1284           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_MASK"
1285                      num="JVMTI_THREAD_STATE_TERMINATED | JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT">
1286             Mask the state with this before comparison
1287           </constant>
1288           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_NEW"
1289                      num="0">
1290             <code>java.lang.Thread.State.NEW</code>
1291           </constant>
1292           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED"
1293                      num="JVMTI_THREAD_STATE_TERMINATED">
1294             <code>java.lang.Thread.State.TERMINATED</code>
1295           </constant>
1296           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE"
1297                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE">
1298             <code>java.lang.Thread.State.RUNNABLE</code>
1299           </constant>
1300           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED"
1301                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER">
1302             <code>java.lang.Thread.State.BLOCKED</code>
1303           </constant>
1304           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_WAITING"
1305                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY">
1306             <code>java.lang.Thread.State.WAITING</code>
1307           </constant>
1308           <constant id="JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING"
1309                      num="JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT">
1310             <code>java.lang.Thread.State.TIMED_WAITING</code>
1311           </constant>
1312         </constants>
1313         <b>Rules</b>
1314         <p/>
1315         There can be no more than one answer to a question, although there can be no
1316         answer (because the answer is unknown, does not apply, or none of the answers is 
1317         correct).  An answer is set only when the enclosing answers match.
1318         That is, no more than one of
1319           <ul type="circle">
1320               <li><code>JVMTI_THREAD_STATE_RUNNABLE</code></li>
1321               <li><code>JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER</code></li>
1322               <li><code>JVMTI_THREAD_STATE_WAITING</code></li>
1323           </ul>
1324         can be set (a <tm>J2SE</tm> compliant implementation will always set
1325         one of these if <code>JVMTI_THREAD_STATE_ALIVE</code> is set). 
1326         And if any of these are set, the enclosing answer 
1327         <code>JVMTI_THREAD_STATE_ALIVE</code> is set. 
1328         No more than one of
1329           <ul type="circle">
1330               <li><code>JVMTI_THREAD_STATE_WAITING_INDEFINITELY</code></li>
1331               <li><code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code></li>
1332           </ul>
1333         can be set (a <tm>J2SE</tm> compliant implementation will always set
1334         one of these if <code>JVMTI_THREAD_STATE_WAITING</code> is set). 
1335         And if either is set, the enclosing answers 
1336         <code>JVMTI_THREAD_STATE_ALIVE</code> and 
1337         <code>JVMTI_THREAD_STATE_WAITING</code> are set. 
1338         No more than one of
1339           <ul type="circle">
1340               <li><code>JVMTI_THREAD_STATE_IN_OBJECT_WAIT</code></li>
1341               <li><code>JVMTI_THREAD_STATE_PARKED</code></li>
1342               <li><code>JVMTI_THREAD_STATE_SLEEPING</code></li>
1343           </ul>
1344         can be set. And if any of these is set, the enclosing answers 
1345         <code>JVMTI_THREAD_STATE_ALIVE</code> and 
1346         <code>JVMTI_THREAD_STATE_WAITING</code> are set. 
1347         Also, if <code>JVMTI_THREAD_STATE_SLEEPING</code> is set,
1348         then <code>JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT</code> is set.
1349         If a state <i>A</i> is implemented using the mechanism of 
1350         state <i>B</i> then it is state <i>A</i> which 
1351         is returned by this function.
1352         For example, if <code>Thread.sleep(long)</code>
1353         is implemented using <code>Object.wait(long)</code>
1354         then it is still <code>JVMTI_THREAD_STATE_SLEEPING</code>
1355         which is returned.
1356         More than one of
1357           <ul type="circle">
1358               <li><code>JVMTI_THREAD_STATE_SUSPENDED</code></li>
1359               <li><code>JVMTI_THREAD_STATE_INTERRUPTED</code></li>
1360               <li><code>JVMTI_THREAD_STATE_IN_NATIVE</code></li>
1361           </ul>
1362         can be set, but if any is set,
1363         <code>JVMTI_THREAD_STATE_ALIVE</code> is set.
1364         <p/>
1365         And finally,
1366         <code>JVMTI_THREAD_STATE_TERMINATED</code> cannot be set unless
1367         <code>JVMTI_THREAD_STATE_ALIVE</code> is not set.  
1368         <p/>
1369         The thread state representation is designed for extension in future versions
1370         of the specification; thread state values should be used accordingly, that is
1371         they should not be used as ordinals.  
1372         Most queries can be made by testing a single bit, if use in a switch statement is desired,
1373         the state bits should be masked with the interesting bits.
1374         All bits not defined above are reserved for future use.  
1375         A VM, compliant to the current specification, must set reserved bits to zero.
1376         An agent should ignore reserved bits -- 
1377         they should not be assumed to be zero and thus should not be included in comparisons.
1378         <p/>
1379         <b>Examples</b>
1380         <p/>
1381         Note that the values below exclude reserved and vendor bits.
1382         <p/>
1383         The state of a thread blocked at a <code>synchronized</code>-statement would be:
1384         <example>
1385             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER
1386         </example>
1387         The state of a thread which hasn't started yet would be:
1388         <example>
1389             0
1390         </example>
1391         The state of a thread at a <code>Object.wait(3000)</code> would be:
1392         <example>
1393             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_WAITING + 
1394                 JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT + 
1395                 JVMTI_THREAD_STATE_MONITOR_WAITING
1396         </example>
1397         The state of a thread suspended while runnable would be:
1398         <example>
1399             JVMTI_THREAD_STATE_ALIVE + JVMTI_THREAD_STATE_RUNNABLE + JVMTI_THREAD_STATE_SUSPENDED
1400         </example>
1401         <p/>
1402         <b>Testing the State</b>
1403         <p/>
1404         In most cases, the thread state can be determined by testing the one bit corresponding
1405         to that question.  For example, the code to test if a thread is sleeping:
1406         <example>
1407         jint state;
1408         jvmtiError err;
1409 
1410         err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1411         if (err == JVMTI_ERROR_NONE) {
1412            if (state &amp; JVMTI_THREAD_STATE_SLEEPING) {  ...
1413         </example>
1414         <p/>
1415         For waiting (that is, in <code>Object.wait</code>, parked, or sleeping) it would be:
1416         <example>
1417            if (state &amp; JVMTI_THREAD_STATE_WAITING) {  ...
1418         </example>
1419         For some states, more than one bit will need to be tested as is the case
1420         when testing if a thread has not yet been started:
1421         <example>
1422            if ((state &amp; (JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_TERMINATED)) == 0)  {  ...
1423         </example>
1424         To distinguish timed from untimed <code>Object.wait</code>:
1425         <example>
1426            if (state &amp; JVMTI_THREAD_STATE_IN_OBJECT_WAIT)  {  
1427              if (state &amp; JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT)  {
1428                printf("in Object.wait(long timeout)\n");
1429              } else {
1430                printf("in Object.wait()\n");
1431              }
1432            }
1433         </example>
1434         <p/>
1435         <b>Relationship to <code>java.lang.Thread.State</code></b>
1436         <p/>
1437         The thread state represented by <code>java.lang.Thread.State</code>
1438         returned from <code>java.lang.Thread.getState()</code> is a subset of the
1439         information returned from this function.  
1440         The corresponding <code>java.lang.Thread.State</code> can be determined
1441         by using the provided conversion masks.
1442         For example, this returns the name of the <code>java.lang.Thread.State</code> thread state:
1443         <example>
1444             err = (*jvmti)-&gt;GetThreadState(jvmti, thread, &amp;state);
1445             abortOnError(err);
1446             switch (state &amp; JVMTI_JAVA_LANG_THREAD_STATE_MASK) {
1447             case JVMTI_JAVA_LANG_THREAD_STATE_NEW:
1448               return "NEW";
1449             case JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED:
1450               return "TERMINATED";
1451             case JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE:
1452               return "RUNNABLE";
1453             case JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED:
1454               return "BLOCKED";
1455             case JVMTI_JAVA_LANG_THREAD_STATE_WAITING:
1456               return "WAITING";
1457             case JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING:
1458               return "TIMED_WAITING";
1459             }
1460         </example>
1461       </description>
1462       <origin>new</origin>
1463       <capabilities>
1464       </capabilities>
1465       <parameters>
1466         <param id="thread">
1467           <jthread null="current" started="maybe" impl="noconvert"/>
1468             <description>
1469               The thread to query. 
1470             </description>
1471         </param>
1472         <param id="thread_state_ptr">
1473           <outptr><jint/></outptr>
1474           <description>
1475             On return, points to state flags,
1476             as defined by the <internallink id="jvmtiThreadState">Thread State Flags</internallink>.
1477           </description>
1478         </param>
1479       </parameters>
1480       <errors>
1481       </errors>
1482     </function>
1483 
1484     <function id="GetCurrentThread" phase="start" num="18" since="1.1">
1485       <synopsis>Get Current Thread</synopsis>
1486       <description>
1487         Get the current thread.  
1488         The current thread is the Java programming language thread which has called the function.
1489         The function may return <code>NULL</code> in the start phase if the
1490         <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
1491         <code>can_generate_early_vmstart</code></internallink> capability is enabled
1492         and the <code>java.lang.Thread</code> class has not been initialized yet.
1493         <p/>
1494         Note that most <jvmti/> functions that take a thread 
1495         as an argument will accept <code>NULL</code> to mean 
1496         the current thread.
1497       </description>
1498       <origin>new</origin>
1499       <capabilities>
1500       </capabilities>
1501       <parameters>
1502         <param id="thread_ptr">
1503           <outptr><jthread/></outptr>
1504           <description>
1505              On return, points to the current thread, or <code>NULL</code>.
1506           </description>
1507         </param>
1508       </parameters>
1509       <errors>
1510       </errors>
1511     </function>
1512 
1513     <function id="GetAllThreads" num="4">
1514       <synopsis>Get All Threads</synopsis>
1515       <description>
1516         Get all live threads.
1517         The threads are Java programming language threads;
1518         that is, threads that are attached to the VM.
1519         A thread is live if <code>java.lang.Thread.isAlive()</code> 
1520         would return <code>true</code>, that is, the thread has
1521         been started and has not yet died.
1522         The universe of threads is determined by the context of the <jvmti/>
1523         environment, which typically is all threads attached to the VM.
1524         Note that this includes <jvmti/> agent threads 
1525         (see <functionlink id="RunAgentThread"/>).
1526       </description>
1527       <origin>jvmdi</origin>
1528       <capabilities>
1529       </capabilities>
1530       <parameters>
1531         <param id="threads_count_ptr">
1532           <outptr><jint/></outptr>
1533           <description>
1534             On return, points to the number of running threads.
1535           </description>
1536         </param>
1537         <param id="threads_ptr">
1538           <allocbuf outcount="threads_count_ptr"><jthread/></allocbuf>
1539             <description>
1540               On return, points to an array of references, one
1541               for each running thread.
1542             </description>
1543         </param>
1544       </parameters>
1545       <errors>
1546       </errors>
1547     </function>
1548 
1549     <function id="SuspendThread" num="5">
1550       <synopsis>Suspend Thread</synopsis>
1551       <description>
1552         Suspend the specified thread. If the calling thread is specified, 
1553         this function will not return until some other thread calls 
1554         <functionlink id="ResumeThread"></functionlink>.
1555         If the thread is currently suspended, this function
1556         does nothing and returns an error.
1557       </description>
1558       <origin>jvmdi</origin>
1559       <capabilities>
1560         <required id="can_suspend"></required>
1561       </capabilities>
1562       <parameters>
1563         <param id="thread">
1564           <jthread null="current"/>
1565             <description>
1566               The thread to suspend. 
1567             </description>
1568         </param>
1569       </parameters>
1570       <errors>
1571         <error id="JVMTI_ERROR_THREAD_SUSPENDED">
1572           Thread already suspended.
1573         </error>
1574       </errors>
1575     </function>
1576 
1577     <elide>
1578     <function id="SuspendAllThreads" num="101">
1579       <synopsis>Suspend All Threads</synopsis>
1580       <description>
1581         <issue>
1582             There has been no explicit call for this function, and it will
1583             thus be removed if there is no interest.
1584         </issue>
1585         Suspend all live threads except:
1586         <ul>
1587           <li>already suspended threads</li>
1588           <li>those listed in <paramlink id="except_list"></paramlink></li>
1589           <li>certain system (non application) threads, as determined
1590             by the VM implementation</li>
1591         </ul>
1592         The threads are Java programming language threads;
1593         native threads which are not attached to the VM are not
1594         Java programming language threads.
1595         A thread is live if <code>java.lang.Thread.isAlive()</code> 
1596         would return <code>true</code>, that is, the thread has
1597         been started and has not yet died.
1598         The universe of threads is determined 
1599         by the context of the <jvmti/>
1600         environment, which, typically, is all threads attached to the VM,
1601         except critical VM internal threads and <jvmti/> agent threads 
1602         (see <functionlink id="RunAgentThread"/>).
1603         <p/>
1604         If the calling thread is specified, 
1605         all other threads are suspended first then the caller thread is suspended -
1606         this function will not return until some other thread calls 
1607         <functionlink id="ResumeThread"></functionlink>.
1608         <p/>
1609         The list of actually
1610         suspended threads is returned in 
1611         <paramlink id="suspended_list_ptr"></paramlink>.
1612         Suspension is as defined in <functionlink id="SuspendThread"></functionlink>.
1613         <functionlink id="ResumeThreadList"></functionlink>
1614         can be used to resume the suspended threads.
1615       </description>
1616       <origin>new</origin>
1617       <capabilities>
1618         <required id="can_suspend"></required>
1619       </capabilities>
1620       <parameters>
1621         <param id="except_count">
1622           <jint min="0"/>
1623           <description>
1624             The number of threads in the list of threads not to be suspended.
1625           </description>
1626         </param>
1627         <param id="except_list">
1628             <inbuf incount="except_count">
1629               <jthread/>
1630               <nullok>not an error if <code>except_count == 0</code></nullok>
1631             </inbuf>
1632             <description>
1633               The list of threads not to be suspended.
1634             </description>
1635         </param>
1636         <param id="suspended_count_ptr">
1637           <outptr><jint/></outptr>
1638           <description>
1639             On return, points to the number of threads suspended by this call.
1640           </description>
1641         </param>
1642         <param id="suspended_list_ptr">
1643           <allocbuf outcount="suspended_count_ptr"><jthread/></allocbuf>
1644             <description>
1645               On return, points to an array of references, one
1646               for each thread suspended.
1647             </description>
1648         </param>
1649       </parameters>
1650       <errors>
1651         <error id="JVMTI_ERROR_INVALID_THREAD">
1652           A thread in <paramlink id="except_list"></paramlink> was invalid.
1653         </error>
1654         <error id="JVMTI_ERROR_NULL_POINTER">
1655           Both <paramlink id="except_list"></paramlink> was <code>NULL</code>
1656           and <paramlink id="except_count"></paramlink> was non-zero.
1657         </error>
1658       </errors>
1659     </function>
1660     </elide>
1661 
1662     <function id="SuspendThreadList" num="92">
1663       <synopsis>Suspend Thread List</synopsis>
1664       <description>
1665         Suspend the <paramlink id="request_count"></paramlink> 
1666         threads specified in the 
1667         <paramlink id="request_list"></paramlink> array. 
1668         Threads may be resumed with
1669         <functionlink id="ResumeThreadList"></functionlink> or
1670         <functionlink id="ResumeThread"></functionlink>.
1671         If the calling thread is specified in the 
1672         <paramlink id="request_list"></paramlink> array, this function will
1673         not return until some other thread resumes it.
1674         Errors encountered in the suspension of a thread
1675         are returned in the <paramlink id="results"></paramlink>
1676         array, <b>not</b> in the return value of this function.
1677         Threads that are currently suspended do not change state.
1678       </description>
1679       <origin>jvmdi</origin>
1680       <capabilities>
1681         <required id="can_suspend"></required>
1682       </capabilities>
1683       <parameters>
1684         <param id="request_count">
1685           <jint min="0"/>
1686           <description>
1687             The number of threads to suspend.
1688           </description>
1689         </param>
1690         <param id="request_list">
1691           <inbuf incount="request_count"><jthread/></inbuf>
1692             <description>
1693               The list of threads to suspend.
1694             </description>
1695         </param>
1696         <param id="results">
1697           <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1698           <description>
1699             An agent supplied array of 
1700             <paramlink id="request_count"></paramlink> elements.
1701             On return, filled with the error code for
1702             the suspend of the corresponding thread.
1703             The error code will be 
1704             <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1705             if the thread was suspended by this call.
1706             Possible error codes are those specified
1707             for <functionlink id="SuspendThread"></functionlink>.
1708           </description>
1709         </param>
1710       </parameters>
1711       <errors>
1712       </errors>
1713     </function>
1714 
1715     <function id="ResumeThread" num="6">
1716       <synopsis>Resume Thread</synopsis>
1717       <description>
1718         Resume a suspended thread. 
1719         Any threads currently suspended through
1720         a <jvmti/> suspend function (eg.
1721         <functionlink id="SuspendThread"></functionlink>) 
1722         or <code>java.lang.Thread.suspend()</code>
1723         will resume execution;  
1724         all other threads are unaffected.
1725       </description>
1726       <origin>jvmdi</origin>
1727       <capabilities>
1728         <required id="can_suspend"></required>
1729       </capabilities>
1730       <parameters>
1731         <param id="thread">
1732           <jthread/>
1733             <description>
1734               The thread to resume.
1735             </description>
1736         </param>
1737       </parameters>
1738       <errors>
1739         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
1740           Thread was not suspended.
1741         </error>
1742         <error id="JVMTI_ERROR_INVALID_TYPESTATE">
1743           The state of the thread has been modified, and is now inconsistent. 
1744         </error>
1745       </errors>
1746     </function>
1747 
1748     <function id="ResumeThreadList" num="93">
1749       <synopsis>Resume Thread List</synopsis>
1750       <description>
1751         Resume the <paramlink id="request_count"></paramlink> 
1752         threads specified in the 
1753         <paramlink id="request_list"></paramlink> array. 
1754         Any thread suspended through
1755         a <jvmti/> suspend function (eg.
1756         <functionlink id="SuspendThreadList"></functionlink>) 
1757         or <code>java.lang.Thread.suspend()</code>
1758         will resume execution.
1759       </description>
1760       <origin>jvmdi</origin>
1761       <capabilities>
1762         <required id="can_suspend"></required>
1763       </capabilities>
1764       <parameters>
1765         <param id="request_count">
1766           <jint min="0"/>
1767           <description>
1768             The number of threads to resume.
1769           </description>
1770         </param>
1771         <param id="request_list">
1772           <inbuf incount="request_count"><jthread/></inbuf>
1773             <description>
1774               The threads to resume.
1775             </description>
1776         </param>
1777         <param id="results">
1778           <outbuf incount="request_count"><enum>jvmtiError</enum></outbuf>
1779           <description>
1780             An agent supplied array of 
1781             <paramlink id="request_count"></paramlink> elements.
1782             On return, filled with the error code for
1783             the resume of the corresponding thread.
1784             The error code will be 
1785             <errorlink id="JVMTI_ERROR_NONE"></errorlink>
1786             if the thread was suspended by this call.
1787             Possible error codes are those specified
1788             for <functionlink id="ResumeThread"></functionlink>.
1789           </description>
1790         </param>
1791       </parameters>
1792       <errors>
1793       </errors>
1794     </function>
1795 
1796     <function id="StopThread" num="7">
1797       <synopsis>Stop Thread</synopsis>
1798       <description>
1799         Send the specified asynchronous exception to the specified thread 
1800         (similar to <code>java.lang.Thread.stop</code>).
1801         Normally, this function is used to kill the specified thread with an 
1802         instance of the exception <code>ThreadDeath</code>.
1803       </description>
1804       <origin>jvmdi</origin>
1805       <capabilities>
1806         <required id="can_signal_thread"></required>
1807       </capabilities>
1808       <parameters>
1809         <param id="thread">
1810           <jthread/>
1811             <description>
1812               The thread to stop.
1813             </description>
1814         </param>
1815         <param id="exception">
1816           <jobject/>
1817             <description>
1818               The asynchronous exception object.
1819             </description>
1820         </param>
1821       </parameters>
1822       <errors>
1823       </errors>
1824     </function>
1825 
1826     <function id="InterruptThread" num="8">
1827       <synopsis>Interrupt Thread</synopsis>
1828       <description>
1829         Interrupt the specified thread
1830         (similar to <code>java.lang.Thread.interrupt</code>).
1831       </description>
1832       <origin>jvmdi</origin>
1833       <capabilities>
1834         <required id="can_signal_thread"></required>
1835       </capabilities>
1836       <parameters>
1837         <param id="thread">
1838           <jthread impl="noconvert"/>
1839             <description>
1840               The thread to interrupt.
1841             </description>
1842         </param>
1843       </parameters>
1844       <errors>
1845       </errors>
1846     </function>
1847 
1848     <function id="GetThreadInfo" num="9">
1849       <synopsis>Get Thread Info</synopsis>
1850       <typedef id="jvmtiThreadInfo" label="Thread information structure">
1851         <field id="name">
1852           <allocfieldbuf><char/></allocfieldbuf>
1853           <description>
1854             The thread name, encoded as a
1855             <internallink id="mUTF">modified UTF-8</internallink> string.
1856           </description>
1857         </field>
1858         <field id="priority">
1859           <jint/>
1860           <description>
1861             The thread priority.  See the thread priority constants:
1862             <datalink id="jvmtiThreadPriority"></datalink>.
1863           </description>
1864         </field>
1865         <field id="is_daemon">
1866           <jboolean/>
1867           <description>
1868             Is this a daemon thread?
1869           </description>
1870         </field>
1871         <field id="thread_group">
1872           <jthreadGroup/>
1873           <description>
1874             The thread group to which this thread belongs.
1875             <code>NULL</code> if the thread has died.
1876           </description>
1877         </field>
1878         <field id="context_class_loader">
1879           <jobject/>
1880             <description>
1881               The context class loader associated with this thread.
1882             </description>
1883         </field>
1884       </typedef>
1885       <description>
1886         Get thread information. The fields of the <datalink id="jvmtiThreadInfo"/> structure 
1887         are filled in with details of the specified thread.
1888       </description>
1889       <origin>jvmdi</origin>
1890       <capabilities>
1891       </capabilities>
1892       <parameters>
1893         <param id="thread">
1894           <jthread null="current" impl="noconvert" started="maybe"/>
1895             <description>
1896               The thread to query.
1897             </description>
1898         </param>
1899         <param id="info_ptr">
1900           <outptr><struct>jvmtiThreadInfo</struct></outptr>
1901           <description>
1902             On return, filled with information describing the specified thread.
1903           </description>
1904         </param>
1905       </parameters>
1906       <errors>
1907       </errors>
1908     </function>
1909 
1910     <function id="GetOwnedMonitorInfo" num="10">
1911       <synopsis>Get Owned Monitor Info</synopsis>
1912       <description>
1913         Get information about the monitors owned by the 
1914         specified thread. 
1915       </description>
1916       <origin>jvmdiClone</origin>
1917       <capabilities>
1918         <required id="can_get_owned_monitor_info"></required>
1919       </capabilities>
1920       <parameters>
1921         <param id="thread">
1922           <jthread null="current"/>
1923             <description>
1924               The thread to query.
1925             </description>
1926         </param>
1927         <param id="owned_monitor_count_ptr">
1928           <outptr><jint/></outptr>
1929           <description>
1930             The number of monitors returned.
1931           </description>
1932         </param>
1933         <param id="owned_monitors_ptr">
1934           <allocbuf outcount="owned_monitor_count_ptr"><jobject/></allocbuf>
1935             <description>
1936               The array of owned monitors.
1937             </description>
1938         </param>
1939       </parameters>
1940       <errors>
1941       </errors>
1942     </function>
1943 
1944     <function id="GetOwnedMonitorStackDepthInfo" num="153" since="1.1">
1945       <synopsis>Get Owned Monitor Stack Depth Info</synopsis>
1946       <typedef id="jvmtiMonitorStackDepthInfo" 
1947                label="Monitor stack depth information structure">
1948         <field id="monitor">
1949           <jobject/>
1950             <description>
1951               The owned monitor.
1952             </description>
1953         </field>
1954         <field id="stack_depth">
1955           <jint/>
1956           <description>
1957             The stack depth.  Corresponds to the stack depth used in the 
1958             <internallink id="stack">Stack Frame functions</internallink>.
1959             That is, zero is the current frame, one is the frame which
1960             called the current frame. And it is negative one if the 
1961             implementation cannot determine the stack depth (e.g., for 
1962             monitors acquired by JNI <code>MonitorEnter</code>).
1963           </description>
1964         </field>
1965       </typedef>
1966       <description>
1967         Get information about the monitors owned by the 
1968         specified thread and the depth of the stack frame which locked them. 
1969       </description>
1970       <origin>new</origin>
1971       <capabilities>
1972         <required id="can_get_owned_monitor_stack_depth_info"></required>
1973       </capabilities>
1974       <parameters>
1975         <param id="thread">
1976           <jthread null="current"/>
1977             <description>
1978               The thread to query.
1979             </description>
1980         </param>
1981         <param id="monitor_info_count_ptr">
1982           <outptr><jint/></outptr>
1983           <description>
1984             The number of monitors returned.
1985           </description>
1986         </param>
1987         <param id="monitor_info_ptr">
1988           <allocbuf outcount="monitor_info_count_ptr">
1989             <struct>jvmtiMonitorStackDepthInfo</struct>
1990           </allocbuf>
1991           <description>
1992             The array of owned monitor depth information.
1993           </description>
1994         </param>
1995       </parameters>
1996       <errors>
1997       </errors>
1998     </function>
1999 
2000     <function id="GetCurrentContendedMonitor" num="11">
2001       <synopsis>Get Current Contended Monitor</synopsis>
2002       <description>
2003         Get the object, if any, whose monitor the specified thread is waiting to 
2004         enter or waiting to regain through <code>java.lang.Object.wait</code>.
2005       </description>
2006       <origin>jvmdi</origin>
2007       <capabilities>
2008         <required id="can_get_current_contended_monitor"></required>
2009       </capabilities>
2010       <parameters>
2011         <param id="thread">
2012           <jthread null="current"/>
2013             <description>
2014               The thread to query.
2015             </description>
2016         </param>
2017         <param id="monitor_ptr">
2018           <outptr><jobject/></outptr>
2019             <description>
2020               On return, filled with the current contended monitor, or
2021               NULL if there is none.
2022             </description>
2023         </param>
2024       </parameters>
2025       <errors>
2026       </errors>
2027     </function>
2028 
2029     <callback id="jvmtiStartFunction">
2030       <void/>
2031       <synopsis>Agent Start Function</synopsis>
2032       <description>
2033         Agent supplied callback function.
2034         This function is the entry point for an agent thread
2035         started with
2036         <functionlink id="RunAgentThread"></functionlink>.
2037       </description>
2038       <parameters>
2039           <param id="jvmti_env">
2040             <outptr>
2041               <struct>jvmtiEnv</struct>
2042             </outptr>
2043             <description>
2044               The <jvmti/> environment.
2045             </description>
2046           </param>
2047           <param id="jni_env">
2048             <outptr>
2049               <struct>JNIEnv</struct>
2050             </outptr>
2051             <description>
2052               The JNI environment.
2053             </description>
2054           </param>
2055           <param id="arg">
2056             <outptr>
2057               <void/>
2058             </outptr>
2059               <description>
2060                 The <code>arg</code> parameter passed to 
2061                 <functionlink id="RunAgentThread"></functionlink>.
2062               </description>
2063           </param>
2064       </parameters>
2065     </callback>
2066 
2067     <function id="RunAgentThread" num="12">
2068       <synopsis>Run Agent Thread</synopsis>
2069       <description>
2070         Starts the execution of an agent thread. with the specified native function.
2071         The parameter <paramlink id="arg"></paramlink> is forwarded on to the
2072         <functionlink id="jvmtiStartFunction">start function</functionlink>
2073         (specified with <paramlink id="proc"></paramlink>) as its single argument.
2074         This function allows the creation of agent threads 
2075         for handling communication with another process or for handling events 
2076         without the need to load a special subclass of <code>java.lang.Thread</code> or 
2077         implementer of <code>java.lang.Runnable</code>. 
2078         Instead, the created thread can run entirely in native code.
2079         However, the created thread does require a newly created instance
2080         of <code>java.lang.Thread</code> (referenced by the argument <code>thread</code>) to 
2081         which it will be associated.
2082         The thread object can be created with JNI calls.
2083         <p/>
2084         The following common thread priorities are provided for your convenience:
2085         <constants id="jvmtiThreadPriority" label="Thread Priority Constants" kind="const">
2086           <constant id="JVMTI_THREAD_MIN_PRIORITY" num="1">
2087             Minimum possible thread priority
2088           </constant>
2089           <constant id="JVMTI_THREAD_NORM_PRIORITY" num="5">
2090             Normal thread priority
2091           </constant>
2092           <constant id="JVMTI_THREAD_MAX_PRIORITY" num="10">
2093             Maximum possible thread priority
2094           </constant>
2095         </constants>
2096         <p/>
2097         The new thread is started as a daemon thread with the specified
2098         <paramlink id="priority"></paramlink>.
2099         If enabled, a <eventlink id="ThreadStart"/> event will be sent.
2100         <p/>
2101         Since the thread has been started, the thread will be live when this function
2102         returns, unless the thread has died immediately.
2103         <p/>
2104         The thread group of the thread is ignored -- specifically, the thread is not
2105         added to the thread group and the thread is not seen on queries of the thread
2106         group at either the Java programming language or <jvmti/> levels.
2107         <p/>
2108         The thread is not visible to Java programming language queries but is 
2109         included in <jvmti/> queries (for example, 
2110         <functionlink id="GetAllThreads"/> and
2111         <functionlink id="GetAllStackTraces"/>).
2112         <p/>
2113         Upon execution of <code>proc</code>, the new thread will be attached to the
2114         VM -- see the JNI documentation on 
2115         <externallink id="docs/technotes/guides/jni/spec/invocation.html#attaching_to_the_vm"
2116                       >Attaching to the VM</externallink>.
2117       </description>
2118       <origin>jvmdiClone</origin>
2119       <capabilities>
2120       </capabilities>
2121       <parameters>
2122         <param id="thread">
2123           <jthread impl="noconvert" started="no"/>
2124             <description>
2125               The thread to run.
2126             </description>
2127         </param>
2128         <param id="proc">
2129           <ptrtype>
2130             <struct>jvmtiStartFunction</struct>
2131           </ptrtype>
2132           <description>
2133             The start function.
2134           </description>
2135         </param>
2136         <param id="arg">
2137           <inbuf>
2138             <void/>
2139             <nullok><code>NULL</code> is passed to the start function</nullok>
2140           </inbuf>
2141           <description>
2142             The argument to the start function.
2143           </description>
2144         </param>
2145         <param id="priority">
2146           <jint/>
2147           <description>
2148             The priority of the started thread. Any thread
2149             priority allowed by <code>java.lang.Thread.setPriority</code> can be used including
2150             those in <datalink id="jvmtiThreadPriority"></datalink>.
2151           </description>
2152         </param>
2153       </parameters>
2154       <errors>
2155         <error id="JVMTI_ERROR_INVALID_PRIORITY"> 
2156             <paramlink id="priority"/> is less than 
2157             <datalink id="JVMTI_THREAD_MIN_PRIORITY"/>
2158               or greater than
2159             <datalink id="JVMTI_THREAD_MAX_PRIORITY"/>
2160         </error>
2161       </errors>
2162     </function>
2163 
2164     <function id="SetThreadLocalStorage" jkernel="yes" impl="notrace" phase="start" num="103">
2165       <synopsis>Set Thread Local Storage</synopsis>
2166       <description>
2167         The VM stores a pointer value associated with each environment-thread
2168         pair. This pointer value is called <i>thread-local storage</i>.
2169         This value is <code>NULL</code> unless set with this function.
2170         Agents can allocate memory in which they store thread specific
2171         information. By setting thread-local storage it can then be
2172         accessed with 
2173         <functionlink id="GetThreadLocalStorage"></functionlink>.
2174         <p/>
2175         This function is called by the agent to set the value of the <jvmti/>
2176         thread-local storage. <jvmti/> supplies to the agent a pointer-size
2177         thread-local storage that can be used to record per-thread
2178         information.
2179       </description>
2180       <origin>jvmpi</origin>
2181       <capabilities>
2182       </capabilities>
2183       <parameters>
2184         <param id="thread">
2185           <jthread null="current"/>
2186             <description>
2187               Store to this thread.
2188             </description>
2189         </param>
2190         <param id="data">
2191           <inbuf> 
2192             <void/> 
2193             <nullok>value is set to <code>NULL</code></nullok> 
2194           </inbuf> 
2195           <description>
2196             The value to be entered into the thread-local storage.
2197           </description>
2198         </param>
2199       </parameters>
2200       <errors>
2201       </errors>
2202     </function>
2203 
2204     <function id="GetThreadLocalStorage" jkernel="yes" impl="innative notrace" phase="start" num="102">
2205       <synopsis>Get Thread Local Storage</synopsis>
2206       <description>
2207         Called by the agent to get the value of the <jvmti/> thread-local
2208         storage. 
2209       </description>
2210       <origin>jvmpi</origin>
2211       <capabilities>
2212       </capabilities>
2213       <parameters>
2214         <param id="thread">
2215           <jthread null="current" impl="noconvert"/>
2216             <description>
2217               Retrieve from this thread.
2218             </description>
2219         </param>
2220         <param id="data_ptr">
2221           <agentbuf><void/></agentbuf>
2222           <description>
2223             Pointer through which the value of the thread local 
2224             storage is returned.
2225             If thread-local storage has not been set with
2226             <functionlink id="SetThreadLocalStorage"></functionlink> the returned 
2227             pointer is <code>NULL</code>.
2228           </description>
2229         </param>
2230       </parameters>
2231       <errors>
2232       </errors>
2233     </function>
2234 
2235   </category>
2236 
2237   <category id="thread_groups" label="Thread Group">
2238     <intro>
2239     </intro>
2240 
2241     <function id="GetTopThreadGroups" num="13">
2242       <synopsis>Get Top Thread Groups</synopsis>
2243       <description>
2244         Return all top-level (parentless) thread groups in the VM.
2245       </description>
2246       <origin>jvmdi</origin>
2247       <capabilities>
2248       </capabilities>
2249       <parameters>
2250         <param id="group_count_ptr">
2251           <outptr><jint/></outptr>
2252           <description>
2253             On return, points to the number of top-level thread groups.
2254           </description>
2255         </param>
2256         <param id="groups_ptr">
2257           <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2258             <description>
2259               On return, refers to a pointer to the top-level thread group array.
2260             </description>
2261         </param>
2262       </parameters>
2263       <errors>
2264       </errors>
2265     </function>
2266 
2267     <function id="GetThreadGroupInfo" num="14">
2268       <synopsis>Get Thread Group Info</synopsis>
2269       <typedef id="jvmtiThreadGroupInfo" label="Thread group information structure">
2270         <field id="parent">
2271           <jthreadGroup/>
2272           <description>
2273             The parent thread group.
2274           </description>
2275         </field>
2276         <field id="name">
2277           <allocfieldbuf><char/></allocfieldbuf>
2278           <description>
2279             The thread group's name, encoded as a
2280             <internallink id="mUTF">modified UTF-8</internallink> string.
2281           </description>
2282         </field>
2283         <field id="max_priority">
2284           <jint/>
2285           <description>
2286             The maximum priority for this thread group.
2287           </description>
2288         </field>
2289         <field id="is_daemon">
2290           <jboolean/>
2291           <description>
2292             Is this a daemon thread group?
2293           </description>
2294         </field>
2295       </typedef>
2296       <description>
2297         Get information about the thread group. The fields of the 
2298         <functionlink id="jvmtiThreadGroupInfo"></functionlink> structure 
2299         are filled in with details of the specified thread group.
2300       </description>
2301       <origin>jvmdi</origin>
2302       <capabilities>
2303       </capabilities>
2304       <parameters>
2305         <param id="group">
2306           <jthreadGroup/>
2307           <description>
2308             The thread group to query.
2309           </description>
2310         </param>
2311         <param id="info_ptr">
2312           <outptr><struct>jvmtiThreadGroupInfo</struct></outptr>
2313           <description>
2314             On return, filled with information describing the specified
2315             thread group. 
2316           </description>
2317         </param>
2318       </parameters>
2319       <errors>
2320       </errors>
2321     </function>
2322 
2323     <function id="GetThreadGroupChildren" num="15">
2324       <synopsis>Get Thread Group Children</synopsis>
2325       <description>
2326         Get the live threads and active subgroups in this thread group.
2327       </description>
2328       <origin>jvmdi</origin>
2329       <capabilities>
2330       </capabilities>
2331       <parameters>
2332         <param id="group">
2333           <jthreadGroup/>
2334           <description>
2335             The group to query.
2336           </description>
2337         </param>
2338         <param id="thread_count_ptr">
2339           <outptr><jint/></outptr>
2340           <description>
2341             On return, points to the number of live threads in this thread group.
2342           </description>
2343         </param>
2344         <param id="threads_ptr">
2345           <allocbuf outcount="thread_count_ptr"><jthread/></allocbuf>
2346             <description>
2347               On return, points to an array of the live threads in this thread group.
2348             </description>
2349         </param>
2350         <param id="group_count_ptr">
2351           <outptr><jint/></outptr>
2352           <description>
2353             On return, points to the number of active child thread groups
2354           </description>
2355         </param>
2356         <param id="groups_ptr">
2357           <allocbuf outcount="group_count_ptr"><jthreadGroup/></allocbuf>
2358             <description>
2359               On return, points to an array of the active child thread groups.
2360             </description>
2361         </param>
2362       </parameters>
2363       <errors>
2364       </errors>
2365     </function>
2366   </category>
2367 
2368   <category id="stack" label="Stack Frame">
2369     <intro>
2370         These functions provide information about the stack of a thread.
2371         Stack frames are referenced by depth.
2372         The frame at depth zero is the current frame.
2373         <p/>
2374         Stack frames are as described in
2375         <vmspec chapter="3.6"/>,
2376         That is, they correspond to method 
2377         invocations (including native methods) but do not correspond to platform native or 
2378         VM internal frames.
2379         <p/>
2380         A <jvmti/> implementation may use method invocations to launch a thread and
2381         the corresponding frames may be included in the stack as presented by these functions --
2382         that is, there may be frames shown
2383         deeper than <code>main()</code> and <code>run()</code>.
2384         However this presentation must be consistent across all <jvmti/> functionality which 
2385         uses stack frames or stack depth.
2386     </intro>
2387 
2388       <typedef id="jvmtiFrameInfo" label="Stack frame information structure">
2389         <description>
2390           Information about a stack frame is returned in this structure.
2391         </description>
2392         <field id="method">
2393           <jmethodID/>
2394             <description>
2395               The method executing in this frame.
2396             </description>
2397         </field>
2398         <field id="location">
2399           <jlocation/>
2400           <description>
2401             The index of the instruction executing in this frame.
2402             <code>-1</code> if the frame is executing a native method.
2403           </description>
2404         </field>
2405       </typedef>
2406 
2407       <typedef id="jvmtiStackInfo" label="Stack information structure">
2408         <description>
2409           Information about a set of stack frames is returned in this structure.
2410         </description>
2411         <field id="thread">
2412           <jthread/>
2413           <description>
2414             On return, the thread traced.
2415           </description>
2416         </field>
2417         <field id="state">
2418           <jint/>
2419           <description>
2420             On return, the thread state. See <functionlink id="GetThreadState"></functionlink>.
2421           </description>
2422         </field>
2423         <field id="frame_buffer">
2424           <outbuf incount="max_frame_count">
2425             <struct>jvmtiFrameInfo</struct>
2426           </outbuf>
2427             <description>
2428               On return, this agent allocated buffer is filled 
2429               with stack frame information.  
2430             </description>
2431         </field>
2432         <field id="frame_count">
2433           <jint/>
2434           <description>
2435             On return, the number of records filled into 
2436             <code>frame_buffer</code>.
2437             This will be 
2438             min(<code>max_frame_count</code>, <i>stackDepth</i>).
2439           </description>
2440         </field>
2441       </typedef>
2442 
2443     <function id="GetStackTrace" num="104">
2444       <synopsis>Get Stack Trace</synopsis>
2445       <description>
2446         Get information about the stack of a thread.
2447         If <paramlink id="max_frame_count"></paramlink> is less than the depth of the stack,
2448         the <paramlink id="max_frame_count"></paramlink> topmost frames are returned, 
2449         otherwise the entire stack is returned.
2450         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2451         <p/>
2452         The following example causes up to five of the topmost frames
2453         to be returned and (if there are any frames) the currently
2454         executing method name to be printed.
2455         <example>
2456 jvmtiFrameInfo frames[5];
2457 jint count;
2458 jvmtiError err;
2459 
2460 err = (*jvmti)-&gt;GetStackTrace(jvmti, aThread, 0, 5, 
2461                                frames, &amp;count);
2462 if (err == JVMTI_ERROR_NONE &amp;&amp; count &gt;= 1) {
2463    char *methodName;
2464    err = (*jvmti)-&gt;GetMethodName(jvmti, frames[0].method, 
2465                        &amp;methodName, NULL, NULL);
2466    if (err == JVMTI_ERROR_NONE) {
2467       printf("Executing method: %s", methodName);
2468    }
2469 }
2470         </example>
2471         <todo> 
2472           check example code.
2473         </todo>
2474         <p/>
2475         The <paramlink id="thread"></paramlink> need not be suspended
2476         to call this function.  
2477         <p/>
2478         The <functionlink id="GetLineNumberTable"></functionlink>
2479         function can be used to map locations to line numbers. Note that
2480         this mapping can be done lazily.
2481       </description>
2482       <origin>jvmpi</origin>
2483       <capabilities>
2484       </capabilities>
2485       <parameters>
2486         <param id="thread">
2487           <jthread null="current"/>
2488             <description>
2489               Fetch the stack trace of this thread.
2490             </description>
2491         </param>
2492         <param id="start_depth">
2493           <jint/>
2494           <description>
2495             Begin retrieving frames at this depth.  
2496             If non-negative, count from the current frame, 
2497             the first frame retrieved is at depth <code>start_depth</code>.  
2498             For example, if zero, start from the current frame; if one, start from the
2499             caller of the current frame; if two, start from the caller of the
2500             caller of the current frame; and so on.
2501             If negative, count from below the oldest frame,
2502             the first frame retrieved is at depth <i>stackDepth</i><code> + start_depth</code>,  
2503             where <i>stackDepth</i> is the count of frames on the stack.  
2504             For example, if negative one, only the oldest frame is retrieved;
2505             if negative two, start from the frame called by the oldest frame.
2506           </description>
2507         </param>
2508         <param id="max_frame_count">
2509           <jint min="0"/>
2510           <description>
2511             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2512           </description>
2513         </param>
2514         <param id="frame_buffer">
2515           <outbuf incount="max_frame_count" outcount="count_ptr">
2516             <struct>jvmtiFrameInfo</struct>
2517           </outbuf>
2518             <description>
2519               On return, this agent allocated buffer is filled 
2520               with stack frame information.  
2521             </description>
2522         </param>
2523         <param id="count_ptr">
2524           <outptr><jint/></outptr>
2525           <description>
2526             On return, points to the number of records filled in.
2527             For non-negative <code>start_depth</code>, this will be 
2528             min(<code>max_frame_count</code>, <i>stackDepth</i><code> - start_depth</code>).
2529             For negative <code>start_depth</code>, this will be 
2530             min(<code>max_frame_count</code>, <code>-start_depth</code>).
2531           </description>
2532         </param>
2533       </parameters>
2534       <errors>
2535         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
2536           <paramlink id="start_depth"/> is positive and greater than or equal to <i>stackDepth</i>.
2537           Or <paramlink id="start_depth"/> is negative and less than <i>-stackDepth</i>.
2538         </error>
2539       </errors>
2540     </function>
2541 
2542 
2543     <function id="GetAllStackTraces" num="100">
2544       <synopsis>Get All Stack Traces</synopsis>
2545       <description>
2546         Get information about the stacks of all live threads
2547         (including <internallink id="RunAgentThread">agent threads</internallink>).
2548         If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2549         the <paramlink id="max_frame_count"/> topmost frames are returned for that thread, 
2550         otherwise the entire stack is returned.
2551         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2552         <p/>
2553         All stacks are collected simultaneously, that is, no changes will occur to the 
2554         thread state or stacks between the sampling of one thread and the next.
2555         The threads need not be suspended.
2556         
2557         <example>
2558 jvmtiStackInfo *stack_info;
2559 jint thread_count;
2560 int ti;
2561 jvmtiError err;
2562 
2563 err = (*jvmti)-&gt;GetAllStackTraces(jvmti, MAX_FRAMES, &amp;stack_info, &amp;thread_count); 
2564 if (err != JVMTI_ERROR_NONE) {
2565    ...   
2566 }
2567 for (ti = 0; ti &lt; thread_count; ++ti) {
2568    jvmtiStackInfo *infop = &amp;stack_info[ti];
2569    jthread thread = infop-&gt;thread;
2570    jint state = infop-&gt;state;
2571    jvmtiFrameInfo *frames = infop-&gt;frame_buffer;
2572    int fi;
2573 
2574    myThreadAndStatePrinter(thread, state);
2575    for (fi = 0; fi &lt; infop-&gt;frame_count; fi++) {
2576       myFramePrinter(frames[fi].method, frames[fi].location);
2577    }
2578 }
2579 /* this one Deallocate call frees all data allocated by GetAllStackTraces */
2580 err = (*jvmti)-&gt;Deallocate(jvmti, stack_info); 
2581         </example>
2582         <todo> 
2583           check example code.
2584         </todo>
2585 
2586       </description>
2587       <origin>new</origin>
2588       <capabilities>
2589       </capabilities>
2590       <parameters>
2591         <param id="max_frame_count">
2592           <jint min="0"/>
2593           <description>
2594             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2595           </description>
2596         </param>
2597         <param id="stack_info_ptr">
2598           <allocbuf>
2599             <struct>jvmtiStackInfo</struct>
2600           </allocbuf>
2601             <description>
2602               On return, this buffer is filled 
2603               with stack information for each thread.  
2604               The number of <datalink id="jvmtiStackInfo"/> records is determined 
2605               by <paramlink id="thread_count_ptr"/>.
2606               <p/>
2607               Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/> 
2608               buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2609               These buffers must not be separately deallocated.
2610             </description>
2611         </param>
2612         <param id="thread_count_ptr">
2613           <outptr><jint/></outptr>
2614           <description>
2615             The number of threads traced.
2616           </description>
2617         </param>
2618       </parameters>
2619       <errors>
2620       </errors>
2621     </function>
2622 
2623     <function id="GetThreadListStackTraces" num="101">
2624       <synopsis>Get Thread List Stack Traces</synopsis>
2625       <description>
2626         Get information about the stacks of the supplied threads.
2627         If <paramlink id="max_frame_count"/> is less than the depth of a stack,
2628         the <paramlink id="max_frame_count"/> topmost frames are returned for that thread, 
2629         otherwise the entire stack is returned.
2630         The topmost frames, those most recently invoked, are at the beginning of the returned buffer.
2631         <p/>
2632         All stacks are collected simultaneously, that is, no changes will occur to the 
2633         thread state or stacks between the sampling one thread and the next.
2634         The threads need not be suspended.
2635         <p/>
2636         If a thread has not yet started or terminates before the stack information is collected,
2637         a zero length stack (<datalink id="jvmtiStackInfo.frame_count"/> will be zero)
2638         will be returned and the thread <datalink id="jvmtiStackInfo.state"/> can be checked.
2639         <p/>
2640         See the example for the similar function
2641         <functionlink id="GetAllStackTraces"/>.
2642       </description>
2643       <origin>new</origin>
2644       <capabilities>
2645       </capabilities>
2646       <parameters>
2647         <param id="thread_count">
2648           <jint min="0"/>
2649           <description>
2650             The number of threads to trace.
2651           </description>
2652         </param>
2653         <param id="thread_list">
2654           <inbuf incount="thread_count"><jthread/></inbuf>
2655             <description>
2656               The list of threads to trace.
2657             </description>
2658         </param>
2659         <param id="max_frame_count">
2660           <jint min="0"/>
2661           <description>
2662             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve per thread.
2663           </description>
2664         </param>
2665         <param id="stack_info_ptr">
2666           <allocbuf outcount="thread_count">
2667             <struct>jvmtiStackInfo</struct>
2668           </allocbuf>
2669             <description>
2670               On return, this buffer is filled 
2671               with stack information for each thread.  
2672               The number of <datalink id="jvmtiStackInfo"/> records is determined 
2673               by <paramlink id="thread_count"/>.
2674               <p/>
2675               Note that this buffer is allocated to include the <datalink id="jvmtiFrameInfo"/> 
2676               buffers pointed to by <datalink id="jvmtiStackInfo.frame_buffer"/>.
2677               These buffers must not be separately deallocated.
2678             </description>
2679         </param>
2680       </parameters>
2681       <errors>
2682         <error id="JVMTI_ERROR_INVALID_THREAD">
2683           An element in <paramlink id="thread_list"/> is not a thread object.
2684         </error>
2685       </errors>
2686     </function>
2687 
2688     <elide>
2689     <function id="AsyncGetStackTrace" num="1000">
2690       <synopsis>Get Stack Trace--Asynchronous</synopsis>
2691       <description>
2692         Get information about the entire stack of a thread (or a sub-section of it).
2693         This is the asynchronous version of <functionlink id="GetStackTrace"></functionlink>
2694         and is reentrant and safe to call
2695         from asynchronous signal handlers.
2696         The stack trace is returned only for the calling thread.
2697         <p/>
2698         The <functionlink id="GetLineNumberTable"></functionlink>
2699         function can be used to map locations to line numbers. Note that
2700         this mapping can be done lazily.
2701       </description>
2702       <origin>jvmpi</origin>
2703       <capabilities>
2704         <required id="can_get_async_stack_trace"></required>
2705         <capability id="can_show_JVM_spec_async_frames">
2706           If <code>false</code>, 
2707           <paramlink id="use_java_stack"></paramlink> 
2708           must be <code>false</code>.
2709         </capability>
2710       </capabilities>
2711       <parameters>
2712         <param id="use_java_stack">
2713           <jboolean/>
2714           <description>
2715             Return the stack showing <vmspec/>
2716             model of the stack; 
2717             otherwise, show the internal representation of the stack with
2718             inlined and optimized methods missing.  If the virtual machine
2719             is using the <i>Java Virtual Machine Specification</i> stack model
2720             internally, this flag is ignored.
2721           </description>
2722         </param>
2723         <param id="max_count">
2724           <jint min="0"/>
2725           <description>
2726             The maximum number of <datalink id="jvmtiFrameInfo"/> records to retrieve.
2727             Retrieve this many unless the stack depth is less than <code>max_count</code>.
2728           </description>
2729         </param>
2730         <param id="frame_buffer">
2731           <outbuf incount="max_count" outcount="count_ptr">
2732             <struct>jvmtiFrameInfo</struct>
2733             <nullok>this information is not returned</nullok>
2734           </outbuf>
2735             <description>
2736               The agent passes in a buffer
2737               large enough to hold <code>max_count</code> records of 
2738               <datalink id="jvmtiFrameInfo"></datalink>.  This buffer must be
2739               pre-allocated by the agent.  
2740             </description>
2741         </param>
2742         <param id="count_ptr">
2743           <outptr><jint/></outptr>
2744           <description>
2745             On return, points to the number of records filled in..
2746           </description>
2747         </param>
2748       </parameters>
2749       <errors>
2750         <error id="JVMTI_ERROR_UNATTACHED_THREAD">
2751           The thread being used to call this function is not attached
2752           to the virtual machine.  Calls must be made from attached threads.
2753         </error>
2754       </errors>
2755     </function>
2756     </elide>
2757 
2758     <function id="GetFrameCount" num="16">
2759       <synopsis>Get Frame Count</synopsis>
2760       <description>
2761         Get the number of frames currently in the specified thread's call stack.
2762         <p/>
2763         If this function is called for a thread actively executing bytecodes (for example,
2764         not the current thread and not suspended), the information returned is transient.
2765       </description>
2766       <origin>jvmdi</origin>
2767       <capabilities>
2768       </capabilities>
2769       <parameters>
2770         <param id="thread">
2771           <jthread null="current"/>
2772             <description>
2773               The thread to query.
2774             </description>
2775         </param>
2776         <param id="count_ptr">
2777           <outptr><jint/></outptr>
2778           <description>
2779             On return, points to the number of frames in the call stack.
2780           </description>
2781         </param>
2782       </parameters>
2783       <errors>
2784       </errors>
2785     </function>
2786 
2787     <function id="PopFrame" num="80">
2788       <synopsis>Pop Frame</synopsis>
2789       <description>
2790         Pop the current frame of <code>thread</code>'s stack.
2791         Popping a frame takes you to the previous frame.  
2792         When the thread is resumed, the execution 
2793         state of the thread is reset to the state
2794         immediately before the called method was invoked.
2795         That is (using <vmspec/> terminology):
2796           <ul>
2797             <li>the current frame is discarded as the previous frame becomes the current one</li>
2798             <li>the operand stack is restored--the argument values are added back
2799               and if the invoke was not <code>invokestatic</code>, 
2800               <code>objectref</code> is added back as well</li>
2801             <li>the Java virtual machine PC is restored to the opcode
2802               of the invoke instruction</li>
2803           </ul>
2804         Note however, that any changes to the arguments, which
2805         occurred in the called method, remain; 
2806         when execution continues, the first instruction to 
2807         execute will be the invoke.  
2808         <p/>
2809         Between calling <code>PopFrame</code> and resuming the 
2810         thread the state of the stack is undefined.  
2811         To pop frames beyond the first, 
2812         these three steps must be repeated:
2813         <ul>
2814           <li>suspend the thread via an event (step, breakpoint, ...)</li>
2815           <li>call <code>PopFrame</code></li>
2816           <li>resume the thread</li>
2817         </ul>
2818         <p/>
2819         A lock acquired by calling the called method 
2820         (if it is a <code>synchronized</code>  method) 
2821         and locks acquired by entering <code>synchronized</code>
2822         blocks within the called method are released. 
2823         Note: this does not apply to native locks or 
2824         <code>java.util.concurrent.locks</code> locks.
2825         <p/>
2826         Finally blocks are not executed.
2827         <p/>
2828         Changes to global state are not addressed and thus remain changed.
2829         <p/>
2830         The specified thread must be suspended (which implies it cannot be the current thread).
2831         <p/>
2832         Both the called method and calling method must be non-native Java programming 
2833         language methods.
2834         <p/>
2835         No <jvmti/> events are generated by this function.
2836       </description>
2837       <origin>jvmdi</origin>
2838       <capabilities>
2839         <required id="can_pop_frame"></required>
2840       </capabilities>
2841       <parameters>
2842         <param id="thread">
2843           <jthread/>
2844             <description>
2845               The thread whose current frame is to be popped.
2846             </description>
2847         </param>
2848       </parameters>
2849       <errors>
2850         <error id="JVMTI_ERROR_OPAQUE_FRAME">
2851           Called or calling method is a native method.
2852           The implementation is unable to pop this frame.
2853         </error>
2854         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
2855           Thread was not suspended.
2856         </error>
2857         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
2858           There are less than two stack frames on the call stack.
2859         </error>
2860       </errors>
2861     </function>
2862 
2863     <function id="GetFrameLocation" num="19">
2864       <synopsis>Get Frame Location</synopsis>
2865       <description>
2866         <p/>
2867         For a Java programming language frame, return the location of the instruction
2868         currently executing.
2869       </description>
2870       <origin>jvmdiClone</origin>
2871       <capabilities>
2872       </capabilities>
2873       <parameters>
2874         <param id="thread">
2875           <jthread null="current" frame="frame"/>
2876           <description>
2877             The thread of the frame to query.
2878           </description>
2879         </param>
2880         <param id="depth">
2881           <jframeID thread="thread"/>
2882           <description>
2883             The depth of the frame to query.
2884           </description>
2885         </param>
2886         <param id="method_ptr">
2887           <outptr><jmethodID/></outptr>
2888             <description>
2889               On return, points to the method for the current location.
2890             </description>
2891         </param>
2892         <param id="location_ptr">
2893           <outptr><jlocation/></outptr>
2894           <description>
2895             On return, points to the index of the currently 
2896             executing instruction.
2897             Is set to <code>-1</code> if the frame is executing
2898             a native method.
2899           </description>
2900         </param>
2901       </parameters>
2902       <errors>
2903       </errors>
2904     </function>
2905 
2906     <function id="NotifyFramePop" num="20">
2907       <synopsis>Notify Frame Pop</synopsis>
2908       <description>
2909         When the frame that is currently at <paramlink id="depth"></paramlink> 
2910         is popped from the stack, generate a
2911         <eventlink id="FramePop"></eventlink> event.  See the 
2912         <eventlink id="FramePop"></eventlink> event for details.
2913         Only frames corresponding to non-native Java programming language 
2914         methods can receive notification.
2915         <p/>
2916         The specified thread must either be the current thread
2917         or the thread must be suspended.
2918       </description>
2919       <origin>jvmdi</origin>
2920       <capabilities>
2921         <required id="can_generate_frame_pop_events"></required>
2922       </capabilities>
2923       <parameters>
2924         <param id="thread">
2925           <jthread null="current" frame="depth"/>   
2926           <description>
2927             The thread of the frame for which the frame pop event will be generated.
2928           </description>
2929         </param>
2930         <param id="depth">
2931           <jframeID thread="thread"/>
2932           <description>
2933             The depth of the frame for which the frame pop event will be generated.
2934           </description>
2935         </param>
2936       </parameters>
2937       <errors>
2938         <error id="JVMTI_ERROR_OPAQUE_FRAME"> 
2939           The frame at <code>depth</code> is executing a
2940           native method.
2941         </error>
2942         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
2943           Thread was not suspended and was not the current thread.
2944         </error>
2945       </errors>
2946     </function>
2947 
2948   </category>
2949 
2950   <category id="ForceEarlyReturn" label="Force Early Return">
2951     <intro>
2952       These functions allow an agent to force a method
2953       to return at any point during its execution.
2954       The method which will return early is referred to as the <i>called method</i>.
2955       The called method is the current method
2956       (as defined by
2957       <vmspec chapter="3.6"/>) 
2958       for the specified thread at
2959       the time the function is called.
2960       <p/>
2961       The specified thread must be suspended or must be the current thread.
2962       The return occurs when execution of Java programming
2963       language code is resumed on this thread.
2964       Between calling one of these functions and resumption
2965       of thread execution, the state of the stack is undefined.  
2966       <p/>
2967       No further instructions are executed in the called method.  
2968       Specifically, finally blocks are not executed.
2969       Note: this can cause inconsistent states in the application.
2970       <p/>
2971       A lock acquired by calling the called method 
2972       (if it is a <code>synchronized</code>  method) 
2973       and locks acquired by entering <code>synchronized</code>
2974       blocks within the called method are released. 
2975       Note: this does not apply to native locks or 
2976       <code>java.util.concurrent.locks</code> locks.
2977       <p/>
2978       Events, such as <eventlink id="MethodExit"></eventlink>,
2979       are generated as they would be in a normal return.
2980       <p/>
2981       The called method must be a non-native Java programming
2982       language method.
2983       Forcing return on a thread with only one frame on the
2984       stack causes the thread to exit when resumed.
2985     </intro>
2986 
2987     <function id="ForceEarlyReturnObject" num="81" since="1.1">
2988       <synopsis>Force Early Return - Object</synopsis>
2989       <description>
2990         This function can be used to return from a method whose
2991         result type is <code>Object</code>
2992         or a subclass of <code>Object</code>. 
2993       </description>
2994       <origin>new</origin>
2995       <capabilities>
2996         <required id="can_force_early_return"></required>
2997       </capabilities>
2998       <parameters>
2999         <param id="thread">
3000           <jthread null="current"/>
3001           <description>
3002             The thread whose current frame is to return early.
3003           </description>
3004         </param>
3005         <param id="value">
3006           <jobject/>
3007           <description>
3008             The return value for the called frame. 
3009             An object or <code>NULL</code>.
3010           </description>
3011         </param>
3012       </parameters>
3013       <errors>
3014         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3015           Attempted to return early from a frame
3016           corresponding to a native method.
3017           Or the implementation is unable to provide
3018           this functionality on this frame.
3019         </error>
3020         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
3021           The result type of the called method is not 
3022           <code>Object</code> or a subclass of <code>Object</code>.
3023         </error>
3024         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
3025           The supplied <paramlink id="value"/> is not compatible with the 
3026           result type of the called method.
3027         </error>
3028         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3029           Thread was not the current thread and was not suspended.
3030         </error>
3031         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3032           There are no more frames on the call stack.
3033         </error>
3034       </errors>
3035     </function>
3036 
3037     <function id="ForceEarlyReturnInt" num="82" since="1.1">
3038       <synopsis>Force Early Return - Int</synopsis>
3039       <description>
3040         This function can be used to return from a method whose
3041         result type is <code>int</code>, <code>short</code>,
3042         <code>char</code>, <code>byte</code>, or 
3043         <code>boolean</code>. 
3044       </description>
3045       <origin>new</origin>
3046       <capabilities>
3047         <required id="can_force_early_return"></required>
3048       </capabilities>
3049       <parameters>
3050         <param id="thread">
3051           <jthread null="current"/>
3052           <description>
3053             The thread whose current frame is to return early.
3054           </description>
3055         </param>
3056         <param id="value">
3057           <jint/>
3058           <description>
3059             The return value for the called frame.
3060           </description>
3061         </param>
3062       </parameters>
3063       <errors>
3064         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3065           Attempted to return early from a frame
3066           corresponding to a native method.
3067           Or the implementation is unable to provide
3068           this functionality on this frame.
3069         </error>
3070         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
3071           The result type of the called method is not 
3072           <code>int</code>, <code>short</code>,
3073           <code>char</code>, <code>byte</code>, or 
3074           <code>boolean</code>.
3075         </error>
3076         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3077           Thread was not the current thread and was not suspended.
3078         </error>
3079         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3080           There are no frames on the call stack.
3081         </error>
3082       </errors>
3083     </function>
3084 
3085     <function id="ForceEarlyReturnLong" num="83" since="1.1">
3086       <synopsis>Force Early Return - Long</synopsis>
3087       <description>
3088         This function can be used to return from a method whose
3089         result type is <code>long</code>.
3090       </description>
3091       <origin>new</origin>
3092       <capabilities>
3093         <required id="can_force_early_return"></required>
3094       </capabilities>
3095       <parameters>
3096         <param id="thread">
3097           <jthread null="current"/>
3098           <description>
3099             The thread whose current frame is to return early.
3100           </description>
3101         </param>
3102         <param id="value">
3103           <jlong/>
3104           <description>
3105             The return value for the called frame.
3106           </description>
3107         </param>
3108       </parameters>
3109       <errors>
3110         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3111           Attempted to return early from a frame
3112           corresponding to a native method.
3113           Or the implementation is unable to provide
3114           this functionality on this frame.
3115         </error>
3116         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
3117           The result type of the called method is not <code>long</code>.
3118         </error>
3119         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3120           Thread was not the current thread and was not suspended.
3121         </error>
3122         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3123           There are no frames on the call stack.
3124         </error>
3125       </errors>
3126     </function>
3127 
3128     <function id="ForceEarlyReturnFloat" num="84" since="1.1">
3129       <synopsis>Force Early Return - Float</synopsis>
3130       <description>
3131         This function can be used to return from a method whose
3132         result type is <code>float</code>.
3133       </description>
3134       <origin>new</origin>
3135       <capabilities>
3136         <required id="can_force_early_return"></required>
3137       </capabilities>
3138       <parameters>
3139         <param id="thread">
3140           <jthread null="current"/>
3141           <description>
3142             The thread whose current frame is to return early.
3143           </description>
3144         </param>
3145         <param id="value">
3146           <jfloat/>
3147           <description>
3148             The return value for the called frame.
3149           </description>
3150         </param>
3151       </parameters>
3152       <errors>
3153         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3154           Attempted to return early from a frame
3155           corresponding to a native method.
3156           Or the implementation is unable to provide
3157           this functionality on this frame.
3158         </error>
3159         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
3160           The result type of the called method is not <code>float</code>.
3161         </error>
3162         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3163           Thread was not the current thread and was not suspended.
3164         </error>
3165         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3166           There are no frames on the call stack.
3167         </error>
3168       </errors>
3169     </function>
3170 
3171     <function id="ForceEarlyReturnDouble" num="85" since="1.1">
3172       <synopsis>Force Early Return - Double</synopsis>
3173       <description>
3174         This function can be used to return from a method whose
3175         result type is <code>double</code>.
3176       </description>
3177       <origin>new</origin>
3178       <capabilities>
3179         <required id="can_force_early_return"></required>
3180       </capabilities>
3181       <parameters>
3182         <param id="thread">
3183           <jthread null="current"/>
3184           <description>
3185             The thread whose current frame is to return early.
3186           </description>
3187         </param>
3188         <param id="value">
3189           <jdouble/>
3190           <description>
3191             The return value for the called frame.
3192           </description>
3193         </param>
3194       </parameters>
3195       <errors>
3196         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3197           Attempted to return early from a frame corresponding to a native method.
3198           Or the implementation is unable to provide this functionality on this frame.
3199         </error>
3200         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
3201           The result type of the called method is not <code>double</code>.
3202         </error>
3203         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3204           Thread was not the current thread and was not suspended.
3205         </error>
3206         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3207           There are no frames on the call stack.
3208         </error>
3209       </errors>
3210     </function>
3211 
3212     <function id="ForceEarlyReturnVoid" num="86" since="1.1">
3213       <synopsis>Force Early Return - Void</synopsis>
3214       <description>
3215         This function can be used to return from a method with no result type.
3216         That is, the called method must be declared <code>void</code>.
3217       </description>
3218       <origin>new</origin>
3219       <capabilities>
3220         <required id="can_force_early_return"></required>
3221       </capabilities>
3222       <parameters>
3223         <param id="thread">
3224           <jthread null="current"/>
3225           <description>
3226             The thread whose current frame is to return early.
3227           </description>
3228         </param>
3229       </parameters>
3230       <errors>
3231         <error id="JVMTI_ERROR_OPAQUE_FRAME">
3232           Attempted to return early from a frame
3233           corresponding to a native method.
3234           Or the implementation is unable to provide
3235           this functionality on this frame.
3236         </error>
3237         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
3238           The called method has a result type.  
3239         </error>
3240         <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
3241           Thread was not the current thread and was not suspended.
3242         </error>
3243         <error id="JVMTI_ERROR_NO_MORE_FRAMES">
3244           There are no frames on the call stack.
3245         </error>
3246       </errors>
3247     </function>
3248 
3249   </category>
3250 
3251   <category id="Heap" label="Heap">
3252     <intro>
3253       These functions are used to analyze the heap.
3254       Functionality includes the ability to view the objects in the
3255       heap and to tag these objects.
3256     </intro>
3257    
3258     <intro id="objectTags" label="Object Tags">
3259       A <i>tag</i> is a value associated with an object.
3260       Tags are explicitly set by the agent using the
3261       <functionlink id="SetTag"></functionlink> function or by
3262       callback functions such as <functionlink id="jvmtiHeapIterationCallback"/>.    
3263       <p/>
3264       Tags are local to the environment; that is, the tags of one
3265       environment are not visible in another.
3266       <p/>
3267       Tags are <code>jlong</code> values which can be used
3268       simply to mark an object or to store a pointer to more detailed
3269       information.  Objects which have not been tagged have a
3270       tag of zero.  
3271       Setting a tag to zero makes the object untagged.
3272     </intro>
3273    
3274     <intro id="heapCallbacks" label="Heap Callback Functions">
3275         Heap functions which iterate through the heap and recursively
3276         follow object references use agent supplied callback functions
3277         to deliver the information.
3278         <p/>
3279         These heap callback functions must adhere to the following restrictions --
3280         These callbacks must not use JNI functions.
3281         These callbacks must not use <jvmti/> functions except 
3282         <i>callback safe</i> functions which
3283         specifically allow such use (see the raw monitor, memory management,
3284         and environment local storage functions).
3285         <p/>
3286         An implementation may invoke a callback on an internal thread or
3287         the thread which called the iteration function.
3288         Heap callbacks are single threaded -- no more than one callback will
3289         be invoked at a time.
3290         <p/>
3291         The Heap Filter Flags can be used to prevent reporting
3292         based on the tag status of an object or its class.  
3293         If no flags are set (the <code>jint</code> is zero), objects
3294         will not be filtered out.
3295 
3296         <constants id="jvmtiHeapFilter" label="Heap Filter Flags" kind="bits">
3297           <constant id="JVMTI_HEAP_FILTER_TAGGED" num="0x4">
3298             Filter out tagged objects. Objects which are tagged are not included.
3299           </constant>
3300           <constant id="JVMTI_HEAP_FILTER_UNTAGGED" num="0x8">
3301             Filter out untagged objects. Objects which are not tagged are not included.
3302           </constant>
3303           <constant id="JVMTI_HEAP_FILTER_CLASS_TAGGED" num="0x10">
3304             Filter out objects with tagged classes. Objects whose class is tagged are not included.
3305           </constant>
3306           <constant id="JVMTI_HEAP_FILTER_CLASS_UNTAGGED" num="0x20">
3307             Filter out objects with untagged classes. Objects whose class is not tagged are not included.
3308           </constant>
3309         </constants>
3310 
3311         <p/>
3312         The Heap Visit Control Flags are returned by the heap callbacks
3313         and can be used to abort the iteration.  For the 
3314         <functionlink id="jvmtiHeapReferenceCallback">Heap 
3315         Reference Callback</functionlink>, it can also be used 
3316         to prune the graph of traversed references
3317         (<code>JVMTI_VISIT_OBJECTS</code> is not set).
3318 
3319         <constants id="jvmtiHeapVisitControl" 
3320                    label="Heap Visit Control Flags" 
3321                    kind="bits" 
3322                    since="1.1">
3323           <constant id="JVMTI_VISIT_OBJECTS" num="0x100">
3324             If we are visiting an object and if this callback
3325             was initiated by <functionlink id="FollowReferences"/>, 
3326             traverse the references of this object.
3327             Otherwise ignored.
3328           </constant>       
3329           <constant id="JVMTI_VISIT_ABORT" num="0x8000">
3330             Abort the iteration.  Ignore all other bits.
3331           </constant>
3332         </constants>
3333 
3334         <p/>
3335         The Heap Reference Enumeration is provided by the 
3336         <functionlink id="jvmtiHeapReferenceCallback">Heap 
3337         Reference Callback</functionlink> and 
3338         <functionlink id="jvmtiPrimitiveFieldCallback">Primitive Field 
3339         Callback</functionlink> to 
3340         describe the kind of reference
3341         being reported.
3342 
3343         <constants id="jvmtiHeapReferenceKind" 
3344                    label="Heap Reference Enumeration" 
3345                    kind="enum" 
3346                    since="1.1">
3347           <constant id="JVMTI_HEAP_REFERENCE_CLASS" num="1">
3348             Reference from an object to its class.
3349           </constant>       
3350           <constant id="JVMTI_HEAP_REFERENCE_FIELD" num="2">
3351             Reference from an object to the value of one of its instance fields.
3352           </constant>
3353           <constant id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT" num="3">
3354             Reference from an array to one of its elements.
3355           </constant>
3356           <constant id="JVMTI_HEAP_REFERENCE_CLASS_LOADER" num="4">
3357             Reference from a class to its class loader.
3358           </constant>
3359           <constant id="JVMTI_HEAP_REFERENCE_SIGNERS" num="5">
3360             Reference from a class to its signers array.
3361           </constant>
3362           <constant id="JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN" num="6">
3363             Reference from a class to its protection domain.
3364           </constant>       
3365           <constant id="JVMTI_HEAP_REFERENCE_INTERFACE" num="7">
3366             Reference from a class to one of its interfaces. 
3367             Note: interfaces are defined via a constant pool reference,
3368             so the referenced interfaces may also be reported with a 
3369             <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3370           </constant>
3371           <constant id="JVMTI_HEAP_REFERENCE_STATIC_FIELD" num="8">
3372             Reference from a class to the value of one of its static fields.
3373           </constant>
3374           <constant id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL" num="9">
3375             Reference from a class to a resolved entry in the constant pool.
3376           </constant>
3377           <constant id="JVMTI_HEAP_REFERENCE_SUPERCLASS" num="10">
3378             Reference from a class to its superclass. 
3379             A callback is not sent if the superclass is <code>java.lang.Object</code>.
3380             Note: loaded classes define superclasses via a constant pool
3381             reference, so the referenced superclass may also be reported with 
3382             a <code>JVMTI_HEAP_REFERENCE_CONSTANT_POOL</code> reference kind.
3383           </constant>
3384           <constant id="JVMTI_HEAP_REFERENCE_JNI_GLOBAL" num="21">
3385             Heap root reference: JNI global reference.
3386           </constant>
3387           <constant id="JVMTI_HEAP_REFERENCE_SYSTEM_CLASS" num="22">
3388             Heap root reference: System class.
3389           </constant>
3390           <constant id="JVMTI_HEAP_REFERENCE_MONITOR" num="23">
3391             Heap root reference: monitor.
3392           </constant>
3393           <constant id="JVMTI_HEAP_REFERENCE_STACK_LOCAL" num="24">
3394             Heap root reference: local variable on the stack.
3395           </constant>
3396           <constant id="JVMTI_HEAP_REFERENCE_JNI_LOCAL" num="25">
3397             Heap root reference: JNI local reference.
3398           </constant>
3399           <constant id="JVMTI_HEAP_REFERENCE_THREAD" num="26">
3400             Heap root reference: Thread.
3401           </constant>
3402           <constant id="JVMTI_HEAP_REFERENCE_OTHER" num="27">
3403             Heap root reference: other heap root reference.
3404           </constant>
3405         </constants>
3406 
3407         <p/>
3408         Definitions for the single character type descriptors of
3409         primitive types.
3410 
3411         <constants id="jvmtiPrimitiveType" 
3412                    label="Primitive Type Enumeration" 
3413                    kind="enum" 
3414                    since="1.1">
3415           <constant id="JVMTI_PRIMITIVE_TYPE_BOOLEAN" num="90">
3416             'Z' - Java programming language <code>boolean</code> - JNI <code>jboolean</code>
3417           </constant>       
3418           <constant id="JVMTI_PRIMITIVE_TYPE_BYTE" num="66">
3419             'B' - Java programming language <code>byte</code> - JNI <code>jbyte</code>
3420           </constant>       
3421           <constant id="JVMTI_PRIMITIVE_TYPE_CHAR" num="67">
3422             'C' - Java programming language <code>char</code> - JNI <code>jchar</code>
3423           </constant>       
3424           <constant id="JVMTI_PRIMITIVE_TYPE_SHORT" num="83">
3425             'S' - Java programming language <code>short</code> - JNI <code>jshort</code>
3426           </constant>       
3427           <constant id="JVMTI_PRIMITIVE_TYPE_INT" num="73">
3428             'I' - Java programming language <code>int</code> - JNI <code>jint</code>
3429           </constant>       
3430           <constant id="JVMTI_PRIMITIVE_TYPE_LONG" num="74">
3431             'J' - Java programming language <code>long</code> - JNI <code>jlong</code>
3432           </constant>       
3433           <constant id="JVMTI_PRIMITIVE_TYPE_FLOAT" num="70">
3434             'F' - Java programming language <code>float</code> - JNI <code>jfloat</code>
3435           </constant>       
3436           <constant id="JVMTI_PRIMITIVE_TYPE_DOUBLE" num="68">
3437             'D' - Java programming language <code>double</code> - JNI <code>jdouble</code>
3438           </constant>       
3439         </constants>
3440     </intro>
3441 
3442       <typedef id="jvmtiHeapReferenceInfoField" 
3443                label="Reference information structure for Field references" 
3444                since="1.1">
3445         <description>
3446           Reference information returned for 
3447           <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> and 
3448           <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3449         </description>
3450         <field id="index">
3451           <jint/>
3452           <description>       
3453             For <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>, the 
3454             referrer object is not a class or an inteface.  
3455             In this case, <code>index</code> is the index of the field 
3456             in the class of the referrer object.  
3457             This class is referred to below as <i>C</i>.
3458             <p/>
3459             For <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
3460             the referrer object is a class (referred to below as <i>C</i>)
3461             or an interface (referred to below as <i>I</i>).
3462             In this case, <code>index</code> is the index of the field in 
3463             that class or interface.
3464             <p/>
3465             If the referrer object is not an interface, then the field 
3466             indices are determined as follows: 
3467             <ul>
3468               <li>make a list of all the fields in <i>C</i> and its
3469                   superclasses, starting with all the fields in 
3470                   <code>java.lang.Object</code> and ending with all the
3471                   fields in <i>C</i>.</li>
3472               <li>Within this list, put 
3473                   the fields for a given class in the order returned by
3474                   <functionlink id="GetClassFields"/>.</li>
3475               <li>Assign the fields in this list indices 
3476                   <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i> 
3477                   is the count of the fields in all the interfaces
3478                   implemented by <i>C</i>. 
3479                   Note that <i>C</i> implements all interfaces 
3480                   directly implemented by its superclasses; as well
3481                   as all superinterfaces of these interfaces.</li>
3482             </ul>
3483             If the referrer object is an interface, then the field 
3484             indices are determined as follows:
3485             <ul>
3486               <li>make a list of the fields directly declared in 
3487                   <i>I</i>.</li>
3488               <li>Within this list, put 
3489                   the fields in the order returned by
3490                   <functionlink id="GetClassFields"/>.</li>
3491               <li>Assign the fields in this list indices 
3492                   <i>n</i>, <i>n</i>+1, ..., in order, where <i>n</i> 
3493                   is the count of the fields in all the superinterfaces
3494                   of <i>I</i>.</li>
3495             </ul>
3496             All fields are included in this computation, regardless of
3497             field modifier (static, public, private, etc).
3498             <p/>
3499             For example, given the following classes and interfaces:
3500             <example>
3501 interface I0 {
3502     int p = 0;
3503 }
3504 
3505 interface I1 extends I0 {
3506     int x = 1;
3507 }
3508 
3509 interface I2 extends I0 {
3510     int y = 2;
3511 }
3512 
3513 class C1 implements I1 {
3514     public static int a = 3;
3515     private int b = 4;
3516 }
3517 
3518 class C2 extends C1 implements I2 {
3519     static int q = 5;
3520     final int r = 6;
3521 }
3522             </example>
3523             Assume that <functionlink id="GetClassFields"/> called on
3524             <code>C1</code> returns the fields of <code>C1</code> in the
3525             order: a, b; and that the fields of <code>C2</code> are 
3526             returned in the order: q, r.
3527             An instance of class <code>C1</code> will have the
3528             following field indices:
3529             <dl><dd><table>
3530               <tr>
3531                 <td>
3532                   a
3533                 </td>
3534                 <td>
3535                   2
3536                 </td>
3537                 <td align="left">
3538                   The count of the fields in the interfaces
3539                   implemented by <code>C1</code> is two (<i>n</i>=2):
3540                   <code>p</code> of <code>I0</code>
3541                   and <code>x</code> of <code>I1</code>.
3542                 </td>
3543               </tr>
3544               <tr>
3545                 <td>
3546                   b
3547                 </td>
3548                 <td>
3549                   3
3550                 </td>
3551                 <td align="left">
3552                   the subsequent index.
3553                 </td>
3554               </tr>
3555             </table></dd></dl>
3556             The class <code>C1</code> will have the same field indices.
3557             <p/>
3558             An instance of class <code>C2</code> will have the
3559             following field indices:
3560             <dl><dd><table>
3561               <tr>
3562                 <td>
3563                   a
3564                 </td>
3565                 <td>
3566                   3
3567                 </td>
3568                 <td align="left">
3569                   The count of the fields in the interfaces
3570                   implemented by <code>C2</code> is three (<i>n</i>=3):
3571                   <code>p</code> of <code>I0</code>,
3572                   <code>x</code> of <code>I1</code> and <code>y</code> of <code>I2</code> 
3573                   (an interface of <code>C2</code>).  Note that the field <code>p</code>
3574                   of <code>I0</code> is only included once.
3575                 </td>
3576               </tr>
3577               <tr>
3578                 <td>
3579                   b
3580                 </td>
3581                 <td>
3582                   4
3583                 </td>
3584                 <td align="left">
3585                   the subsequent index to "a".
3586                 </td>
3587               </tr>
3588               <tr>
3589                 <td>
3590                   q
3591                 </td>
3592                 <td>
3593                   5
3594                 </td>
3595                 <td align="left">
3596                   the subsequent index to "b".
3597                 </td>
3598               </tr>
3599               <tr>
3600                 <td>
3601                   r
3602                 </td>
3603                 <td>
3604                   6
3605                 </td>
3606                 <td align="left">
3607                   the subsequent index to "q".
3608                 </td>
3609               </tr>
3610             </table></dd></dl>
3611             The class <code>C2</code> will have the same field indices.
3612             Note that a field may have a different index depending on the
3613             object that is viewing it -- for example field "a" above.
3614             Note also: not all field indices may be visible from the 
3615             callbacks, but all indices are shown for illustrative purposes.
3616             <p/>
3617             The interface <code>I1</code> will have the
3618             following field indices:
3619             <dl><dd><table>
3620               <tr>
3621                 <td>
3622                   x
3623                 </td>
3624                 <td>
3625                   1
3626                 </td>
3627                 <td align="left">
3628                   The count of the fields in the superinterfaces
3629                   of <code>I1</code> is one (<i>n</i>=1):
3630                   <code>p</code> of <code>I0</code>.
3631                 </td>
3632               </tr>
3633             </table></dd></dl>
3634           </description>      
3635         </field>
3636       </typedef>
3637 
3638       <typedef id="jvmtiHeapReferenceInfoArray" 
3639                label="Reference information structure for Array references" 
3640                since="1.1">
3641         <description>
3642           Reference information returned for 
3643          <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3644         </description>
3645         <field id="index">
3646           <jint/>
3647           <description>       
3648             The array index.
3649           </description>
3650         </field>
3651       </typedef>
3652 
3653       <typedef id="jvmtiHeapReferenceInfoConstantPool" 
3654                label="Reference information structure for Constant Pool references" 
3655                since="1.1">
3656         <description>
3657           Reference information returned for 
3658           <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3659         </description>
3660         <field id="index">
3661           <jint/>
3662           <description>       
3663             The index into the constant pool of the class. See the description in 
3664       <vmspec chapter="4.4"/>.
3665           </description>
3666         </field>
3667       </typedef>
3668 
3669       <typedef id="jvmtiHeapReferenceInfoStackLocal" 
3670                label="Reference information structure for Local Variable references" 
3671                since="1.1">
3672         <description>
3673           Reference information returned for 
3674           <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3675         </description>
3676         <field id="thread_tag">
3677           <jlong/>
3678           <description>
3679             The tag of the thread corresponding to this stack, zero if not tagged.
3680           </description>
3681         </field>
3682         <field id="thread_id">
3683           <jlong/>
3684           <description>
3685             The unique thread ID of the thread corresponding to this stack.
3686           </description>
3687         </field>
3688         <field id="depth">
3689           <jint/>
3690           <description>
3691             The depth of the frame. 
3692           </description>
3693         </field>
3694         <field id="method">
3695           <jmethodID/>
3696           <description>
3697             The method executing in this frame.
3698           </description>
3699         </field>
3700         <field id="location">
3701           <jlocation/>
3702           <description>
3703             The currently executing location in this frame.
3704           </description>
3705         </field>
3706         <field id="slot">
3707           <jint/>
3708           <description>
3709             The slot number of the local variable.
3710           </description>
3711         </field>
3712       </typedef>
3713 
3714       <typedef id="jvmtiHeapReferenceInfoJniLocal" 
3715                label="Reference information structure for JNI local references" 
3716                since="1.1">
3717         <description>
3718           Reference information returned for 
3719           <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3720         </description>
3721         <field id="thread_tag">
3722           <jlong/>
3723           <description>
3724             The tag of the thread corresponding to this stack, zero if not tagged.
3725           </description>
3726         </field>
3727         <field id="thread_id">
3728           <jlong/>
3729           <description>
3730             The unique thread ID of the thread corresponding to this stack.
3731           </description>
3732         </field>
3733         <field id="depth">
3734           <jint/>
3735           <description>
3736             The depth of the frame. 
3737           </description>
3738         </field>
3739         <field id="method">
3740           <jmethodID/>
3741           <description>
3742             The method executing in this frame.
3743           </description>
3744         </field>
3745       </typedef>
3746 
3747       <typedef id="jvmtiHeapReferenceInfoReserved" 
3748                label="Reference information structure for Other references" 
3749                since="1.1">
3750         <description>
3751           Reference information returned for other references.
3752         </description>
3753         <field id="reserved1">
3754           <jlong/>
3755           <description>
3756             reserved for future use.
3757           </description>
3758         </field>
3759         <field id="reserved2">
3760           <jlong/>
3761           <description>
3762             reserved for future use.
3763           </description>
3764         </field>
3765         <field id="reserved3">
3766           <jlong/>
3767           <description>
3768             reserved for future use.
3769           </description>
3770         </field>
3771         <field id="reserved4">
3772           <jlong/>
3773           <description>
3774             reserved for future use.
3775           </description>
3776         </field>
3777         <field id="reserved5">
3778           <jlong/>
3779           <description>
3780             reserved for future use.
3781           </description>
3782         </field>
3783         <field id="reserved6">
3784           <jlong/>
3785           <description>
3786             reserved for future use.
3787           </description>
3788         </field>
3789         <field id="reserved7">
3790           <jlong/>
3791           <description>
3792             reserved for future use.
3793           </description>
3794         </field>
3795         <field id="reserved8">
3796           <jlong/>
3797           <description>
3798             reserved for future use.
3799           </description>
3800         </field>
3801       </typedef>
3802 
3803       <uniontypedef id="jvmtiHeapReferenceInfo" 
3804                label="Reference information structure" 
3805                since="1.1">
3806         <description>
3807           The information returned about referrers.
3808           Represented as a union of the various kinds of reference information.
3809         </description>
3810         <field id="field">
3811           <struct>jvmtiHeapReferenceInfoField</struct>
3812           <description>       
3813             The referrer information for 
3814             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> 
3815             and <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/> references.
3816           </description>
3817         </field>
3818         <field id="array">
3819           <struct>jvmtiHeapReferenceInfoArray</struct>
3820           <description>       
3821             The referrer information for 
3822             For <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/> references.
3823           </description>
3824         </field>
3825         <field id="constant_pool">
3826           <struct>jvmtiHeapReferenceInfoConstantPool</struct>
3827           <description>       
3828             The referrer information for 
3829             For <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/> references.
3830           </description>
3831         </field>
3832         <field id="stack_local">
3833           <struct>jvmtiHeapReferenceInfoStackLocal</struct>
3834           <description>       
3835             The referrer information for 
3836             For <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/> references.
3837           </description>
3838         </field>
3839         <field id="jni_local">
3840           <struct>jvmtiHeapReferenceInfoJniLocal</struct>
3841           <description>       
3842             The referrer information for 
3843             For <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/> references.
3844           </description>
3845         </field>
3846         <field id="other">
3847           <struct>jvmtiHeapReferenceInfoReserved</struct>
3848           <description>       
3849             reserved for future use.
3850           </description>
3851         </field>
3852       </uniontypedef>
3853 
3854       <typedef id="jvmtiHeapCallbacks" 
3855                label="Heap callback function structure" 
3856                since="1.1">
3857         <field id="heap_iteration_callback">
3858           <ptrtype>
3859             <struct>jvmtiHeapIterationCallback</struct>
3860           </ptrtype>
3861           <description>
3862             The callback to be called to describe an
3863             object in the heap. Used by the 
3864             <functionlink id="IterateThroughHeap"/> function, ignored by the
3865             <functionlink id="FollowReferences"/> function.
3866           </description>
3867         </field>            
3868         <field id="heap_reference_callback">
3869           <ptrtype>
3870             <struct>jvmtiHeapReferenceCallback</struct>
3871           </ptrtype>
3872           <description>
3873             The callback to be called to describe an
3874             object reference.  Used by the 
3875             <functionlink id="FollowReferences"/> function, ignored by the
3876             <functionlink id="IterateThroughHeap"/> function.
3877           </description>
3878         </field>            
3879         <field id="primitive_field_callback">
3880           <ptrtype>
3881             <struct>jvmtiPrimitiveFieldCallback</struct>
3882           </ptrtype>
3883           <description>
3884             The callback to be called to describe a
3885             primitive field.
3886           </description>
3887         </field>            
3888         <field id="array_primitive_value_callback">
3889           <ptrtype>
3890             <struct>jvmtiArrayPrimitiveValueCallback</struct>
3891           </ptrtype>
3892           <description>
3893             The callback to be called to describe an
3894             array of primitive values.
3895           </description>
3896         </field>            
3897         <field id="string_primitive_value_callback">
3898           <ptrtype>
3899             <struct>jvmtiStringPrimitiveValueCallback</struct>
3900           </ptrtype>
3901           <description>
3902             The callback to be called to describe a String value.
3903           </description>
3904         </field>            
3905         <field id="reserved5">
3906           <ptrtype>
3907             <struct>jvmtiReservedCallback</struct>
3908           </ptrtype>
3909           <description>
3910             Reserved for future use..
3911           </description>
3912         </field>            
3913         <field id="reserved6">
3914           <ptrtype>
3915             <struct>jvmtiReservedCallback</struct>
3916           </ptrtype>
3917           <description>
3918             Reserved for future use..
3919           </description>
3920         </field>            
3921         <field id="reserved7">
3922           <ptrtype>
3923             <struct>jvmtiReservedCallback</struct>
3924           </ptrtype>
3925           <description>
3926             Reserved for future use..
3927           </description>
3928         </field>            
3929         <field id="reserved8">
3930           <ptrtype>
3931             <struct>jvmtiReservedCallback</struct>
3932           </ptrtype>
3933           <description>
3934             Reserved for future use..
3935           </description>
3936         </field>            
3937         <field id="reserved9">
3938           <ptrtype>
3939             <struct>jvmtiReservedCallback</struct>
3940           </ptrtype>
3941           <description>
3942             Reserved for future use..
3943           </description>
3944         </field>            
3945         <field id="reserved10">
3946           <ptrtype>
3947             <struct>jvmtiReservedCallback</struct>
3948           </ptrtype>
3949           <description>
3950             Reserved for future use..
3951           </description>
3952         </field>            
3953         <field id="reserved11">
3954           <ptrtype>
3955             <struct>jvmtiReservedCallback</struct>
3956           </ptrtype>
3957           <description>
3958             Reserved for future use..
3959           </description>
3960         </field>            
3961         <field id="reserved12">
3962           <ptrtype>
3963             <struct>jvmtiReservedCallback</struct>
3964           </ptrtype>
3965           <description>
3966             Reserved for future use..
3967           </description>
3968         </field>            
3969         <field id="reserved13">
3970           <ptrtype>
3971             <struct>jvmtiReservedCallback</struct>
3972           </ptrtype>
3973           <description>
3974             Reserved for future use..
3975           </description>
3976         </field>            
3977         <field id="reserved14">
3978           <ptrtype>
3979             <struct>jvmtiReservedCallback</struct>
3980           </ptrtype>
3981           <description>
3982             Reserved for future use..
3983           </description>
3984         </field>            
3985         <field id="reserved15">
3986           <ptrtype>
3987             <struct>jvmtiReservedCallback</struct>
3988           </ptrtype>
3989           <description>
3990             Reserved for future use..
3991           </description>
3992         </field>            
3993       </typedef>
3994 
3995 
3996     <intro>
3997       <rationale>
3998         The heap dumping functionality (below) uses a callback
3999         for each object.  While it would seem that a buffered approach
4000         would provide better throughput, tests do
4001         not show this to be the case--possibly due to locality of
4002         memory reference or array access overhead.
4003       </rationale>
4004 
4005       <issue>
4006         Still under investigation as to if java.lang.ref references
4007         are reported as a different type of reference.
4008       </issue>
4009 
4010       <issue>
4011         Should or can an indication of the cost or relative cost of
4012         these operations be included?
4013       </issue>
4014 
4015     </intro>
4016 
4017     <callback id="jvmtiHeapIterationCallback" since="1.1">
4018       <jint/>
4019       <synopsis>Heap Iteration Callback</synopsis>
4020       <description>
4021         Agent supplied callback function.
4022         Describes (but does not pass in) an object in the heap.
4023         <p/>
4024         This function should return a bit vector of the desired
4025         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4026         This will determine if the entire iteration should be aborted
4027         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4028         <p/>
4029         See the <internallink id="heapCallbacks">heap callback
4030         function restrictions</internallink>.
4031       </description>
4032       <parameters>
4033         <param id="class_tag">
4034           <jlong/>
4035           <description>
4036             The tag of the class of object (zero if the class is not tagged). 
4037             If the object represents a runtime class, 
4038             the <code>class_tag</code> is the tag 
4039             associated with <code>java.lang.Class</code> 
4040             (zero if <code>java.lang.Class</code> is not tagged).
4041           </description>
4042         </param>
4043         <param id="size">
4044           <jlong/>
4045           <description>
4046             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
4047           </description>
4048         </param>
4049         <param id="tag_ptr">
4050           <outptr><jlong/></outptr>
4051           <description>
4052             The object tag value, or zero if the object is not tagged.
4053             To set the tag value to be associated with the object
4054             the agent sets the <code>jlong</code> pointed to by the parameter. 
4055           </description>
4056         </param>
4057         <param id="length">
4058           <jint/>
4059           <description>
4060             If this object is an array, the length of the array. Otherwise negative one (-1).
4061           </description>
4062         </param>
4063         <param id="user_data">
4064           <outptr><void/></outptr>
4065           <description>
4066             The user supplied data that was passed into the iteration function. 
4067           </description>
4068         </param>
4069       </parameters>
4070     </callback>  
4071 
4072     <callback id="jvmtiHeapReferenceCallback" since="1.1">
4073       <jint/>
4074       <synopsis>Heap Reference Callback</synopsis>
4075       <description>
4076         Agent supplied callback function.       
4077         Describes a reference from an object or the VM (the referrer) to another object
4078         (the referree) or a heap root to a referree.
4079         <p/>
4080         This function should return a bit vector of the desired
4081         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4082         This will determine if the objects referenced by the referree
4083         should be visited or if the entire iteration should be aborted.
4084         <p/>
4085         See the <internallink id="heapCallbacks">heap callback
4086         function restrictions</internallink>.
4087       </description>
4088       <parameters>
4089         <param id="reference_kind">
4090           <enum>jvmtiHeapReferenceKind</enum>
4091           <description>
4092             The kind of reference.
4093           </description>
4094         </param>
4095         <param id="reference_info">
4096           <inptr>
4097             <struct>jvmtiHeapReferenceInfo</struct>
4098           </inptr>
4099           <description>
4100             Details about the reference. 
4101             Set when the <datalink id="jvmtiHeapReferenceCallback.reference_kind">reference_kind</datalink> is
4102             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>,
4103             <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
4104             <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/>,
4105             <datalink id="JVMTI_HEAP_REFERENCE_CONSTANT_POOL"/>, 
4106             <datalink id="JVMTI_HEAP_REFERENCE_STACK_LOCAL"/>,
4107             or <datalink id="JVMTI_HEAP_REFERENCE_JNI_LOCAL"/>.
4108             Otherwise <code>NULL</code>.
4109           </description>
4110         </param>
4111         <param id="class_tag">
4112           <jlong/>
4113           <description>
4114             The tag of the class of referree object (zero if the class is not tagged). 
4115             If the referree object represents a runtime class, 
4116             the <code>class_tag</code> is the tag 
4117             associated with <code>java.lang.Class</code>
4118             (zero if <code>java.lang.Class</code> is not tagged).
4119           </description>
4120         </param>
4121         <param id="referrer_class_tag">
4122           <jlong/>
4123           <description>
4124             The tag of the class of the referrer object (zero if the class is not tagged
4125             or the referree is a heap root). If the referrer object represents a runtime
4126             class, the <code>referrer_class_tag</code> is the tag associated with
4127             the <code>java.lang.Class</code>
4128             (zero if <code>java.lang.Class</code> is not tagged).
4129           </description>
4130         </param>
4131         <param id="size">
4132           <jlong/>
4133           <description>
4134             Size of the referree object (in bytes). 
4135             See <functionlink id="GetObjectSize"/>.
4136           </description>
4137         </param>
4138         <param id="tag_ptr">
4139           <outptr><jlong/></outptr>
4140           <description>
4141             Points to the referree object tag value, or zero if the object is not 
4142             tagged.
4143             To set the tag value to be associated with the object
4144             the agent sets the <code>jlong</code> pointed to by the parameter.
4145           </description>
4146         </param>
4147         <param id="referrer_tag_ptr">
4148           <outptr><jlong/></outptr>
4149           <description>
4150             Points to the tag of the referrer object, or 
4151             points to the zero if the referrer
4152             object is not tagged. 
4153             <code>NULL</code> if the referrer in not an object (that is,
4154             this callback is reporting a heap root).
4155             To set the tag value to be associated with the referrer object
4156             the agent sets the <code>jlong</code> pointed to by the parameter.
4157             If this callback is reporting a reference from an object to itself, 
4158             <code>referrer_tag_ptr == tag_ptr</code>.
4159           </description>
4160         </param>
4161         <param id="length">
4162           <jint/>
4163           <description>
4164             If this object is an array, the length of the array. Otherwise negative one (-1).
4165           </description>
4166         </param>
4167         <param id="user_data">
4168           <outptr><void/></outptr>
4169           <description>
4170             The user supplied data that was passed into the iteration function. 
4171           </description>
4172         </param>
4173       </parameters>
4174     </callback>
4175 
4176     <callback id="jvmtiPrimitiveFieldCallback" since="1.1">
4177       <jint/>
4178       <synopsis>Primitive Field Callback</synopsis>
4179       <description>
4180         Agent supplied callback function which  
4181         describes a primitive field of an object (<i>the object</i>).
4182         A primitive field is a field whose type is a primitive type.
4183         This callback will describe a static field if the object is a class,
4184         and otherwise will describe an instance field.
4185         <p/>
4186         This function should return a bit vector of the desired
4187         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4188         This will determine if the entire iteration should be aborted
4189         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4190         <p/>
4191         See the <internallink id="heapCallbacks">heap callback
4192         function restrictions</internallink>.
4193       </description>
4194       <parameters>
4195         <param id="kind">
4196           <enum>jvmtiHeapReferenceKind</enum>
4197           <description>
4198             The kind of field -- instance or static (<datalink id="JVMTI_HEAP_REFERENCE_FIELD"/> or 
4199             <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>).
4200           </description>
4201         </param>
4202         <param id="info">
4203           <inptr>
4204             <struct>jvmtiHeapReferenceInfo</struct>
4205           </inptr>
4206           <description>
4207             Which field (the field index).
4208           </description>
4209         </param>
4210         <param id="object_class_tag">
4211           <jlong/>
4212           <description>
4213             The tag of the class of the object (zero if the class is not tagged). 
4214             If the object represents a runtime class, the 
4215             <code>object_class_tag</code> is the tag 
4216             associated with <code>java.lang.Class</code> 
4217             (zero if <code>java.lang.Class</code> is not tagged).
4218           </description>
4219         </param>
4220         <param id="object_tag_ptr">
4221           <outptr><jlong/></outptr>
4222           <description>
4223             Points to the tag of the object, or zero if the object is not 
4224             tagged.
4225             To set the tag value to be associated with the object
4226             the agent sets the <code>jlong</code> pointed to by the parameter.
4227           </description>
4228         </param>
4229         <param id="value">
4230           <jvalue/>
4231           <description>
4232             The value of the field.
4233           </description>
4234         </param>
4235         <param id="value_type">
4236           <enum>jvmtiPrimitiveType</enum>
4237           <description>
4238             The type of the field.
4239           </description>
4240         </param>
4241         <param id="user_data">
4242           <outptr><void/></outptr>
4243           <description>
4244             The user supplied data that was passed into the iteration function. 
4245           </description>
4246         </param>
4247       </parameters>
4248     </callback>
4249 
4250     <callback id="jvmtiArrayPrimitiveValueCallback" since="1.1">
4251       <jint/>
4252       <synopsis>Array Primitive Value Callback</synopsis>
4253       <description>
4254         Agent supplied callback function.       
4255         Describes the values in an array of a primitive type.
4256         <p/>
4257         This function should return a bit vector of the desired
4258         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4259         This will determine if the entire iteration should be aborted
4260         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4261         <p/>
4262         See the <internallink id="heapCallbacks">heap callback
4263         function restrictions</internallink>.
4264       </description>
4265       <parameters>
4266         <param id="class_tag">
4267           <jlong/>
4268           <description>
4269             The tag of the class of the array object (zero if the class is not tagged). 
4270           </description>
4271         </param>
4272         <param id="size">
4273           <jlong/>
4274           <description>
4275             Size of the array (in bytes). 
4276             See <functionlink id="GetObjectSize"/>.
4277           </description>
4278         </param>
4279         <param id="tag_ptr">
4280           <outptr><jlong/></outptr>
4281           <description>
4282             Points to the tag of the array object, or zero if the object is not 
4283             tagged.
4284             To set the tag value to be associated with the object
4285             the agent sets the <code>jlong</code> pointed to by the parameter.
4286           </description>
4287         </param>
4288         <param id="element_count">
4289           <jint/>
4290           <description>
4291             The length of the primitive array.
4292           </description>
4293         </param>
4294         <param id="element_type">
4295           <enum>jvmtiPrimitiveType</enum>
4296           <description>
4297             The type of the elements of the array.
4298           </description>
4299         </param>
4300         <param id="elements">
4301           <vmbuf><void/></vmbuf>
4302           <description>
4303             The elements of the array in a packed array of <code>element_count</code>
4304             items of <code>element_type</code> size each.
4305           </description>
4306         </param>
4307         <param id="user_data">
4308           <outptr><void/></outptr>
4309           <description>
4310             The user supplied data that was passed into the iteration function. 
4311           </description>
4312         </param>
4313       </parameters>
4314     </callback>
4315 
4316     <callback id="jvmtiStringPrimitiveValueCallback" since="1.1">
4317       <jint/>
4318       <synopsis>String Primitive Value Callback</synopsis>
4319       <description>
4320         Agent supplied callback function.       
4321         Describes the value of a java.lang.String.
4322         <p/>
4323         This function should return a bit vector of the desired
4324         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
4325         This will determine if the entire iteration should be aborted
4326         (the <code>JVMTI_VISIT_OBJECTS</code> flag is ignored).
4327         <p/>
4328         See the <internallink id="heapCallbacks">heap callback
4329         function restrictions</internallink>.
4330       </description>
4331       <parameters>
4332         <param id="class_tag">
4333           <jlong/>
4334           <description>
4335             The tag of the class of the String class (zero if the class is not tagged). 
4336             <issue>Is this needed?</issue>
4337           </description>
4338         </param>
4339         <param id="size">
4340           <jlong/>
4341           <description>
4342             Size of the string (in bytes). 
4343             See <functionlink id="GetObjectSize"/>.
4344           </description>
4345         </param>
4346         <param id="tag_ptr">
4347           <outptr><jlong/></outptr>
4348           <description>
4349             Points to the tag of the String object, or zero if the object is not 
4350             tagged.
4351             To set the tag value to be associated with the object
4352             the agent sets the <code>jlong</code> pointed to by the parameter.
4353           </description>
4354         </param>
4355         <param id="value">
4356           <vmbuf><jchar/></vmbuf>
4357           <description>
4358             The value of the String, encoded as a Unicode string.
4359           </description>
4360         </param>
4361         <param id="value_length">
4362           <jint/>
4363           <description>
4364             The length of the string. 
4365             The length is equal to the number of 16-bit Unicode 
4366             characters in the string.
4367           </description>
4368         </param>
4369         <param id="user_data">
4370           <outptr><void/></outptr>
4371           <description>
4372             The user supplied data that was passed into the iteration function. 
4373           </description>
4374         </param>
4375       </parameters>
4376     </callback>
4377 
4378 
4379     <callback id="jvmtiReservedCallback" since="1.1">
4380       <jint/>
4381       <synopsis>reserved for future use Callback</synopsis>
4382       <description>
4383         Placeholder -- reserved for future use.
4384       </description>
4385       <parameters>
4386       </parameters>
4387     </callback>
4388 
4389     <function id="FollowReferences" num="115" since="1.1">
4390       <synopsis>Follow References</synopsis>
4391       <description>       
4392         This function initiates a traversal over the objects that are 
4393         directly and indirectly reachable from the specified object or,
4394         if <code>initial_object</code> is not specified, all objects 
4395         reachable from the heap roots.
4396         The heap root are the set of system classes, 
4397         JNI globals, references from thread stacks, and other objects used as roots 
4398         for the purposes of garbage collection. 
4399         <p/>
4400         This function operates by traversing the reference graph.
4401         Let <i>A</i>, <i>B</i>, ... represent objects.
4402         When a reference from <i>A</i> to <i>B</i> is traversed,
4403         when a reference from a heap root to <i>B</i> is traversed, 
4404         or when <i>B</i> is specified as the <paramlink id="initial_object"/>, 
4405         then <i>B</i> is said to be <i>visited</i>.
4406         A reference from <i>A</i> to <i>B</i> is not traversed until <i>A</i> 
4407         is visited.
4408         References are reported in the same order that the references are traversed.
4409         Object references are reported by invoking the agent supplied  
4410         callback function <functionlink id="jvmtiHeapReferenceCallback"/>.
4411         In a reference from <i>A</i> to <i>B</i>, <i>A</i> is known 
4412         as the <i>referrer</i> and <i>B</i> as the <i>referree</i>.
4413         The callback is invoked exactly once for each reference from a referrer;
4414         this is true even if there are reference cycles or multiple paths to
4415         the referrer.
4416         There may be more than one reference between a referrer and a referree,
4417         each reference is reported.
4418         These references may be distinguished by examining the
4419         <datalink 
4420          id="jvmtiHeapReferenceCallback.reference_kind"><code>reference_kind</code></datalink>
4421          and
4422         <datalink 
4423          id="jvmtiHeapReferenceCallback.reference_info"><code>reference_info</code></datalink>
4424         parameters of the <functionlink id="jvmtiHeapReferenceCallback"/> callback.
4425         <p/>
4426         This function reports a Java programming language view of object references,
4427         not a virtual machine implementation view. The following object references
4428         are reported when they are non-null:
4429         <ul>
4430           <li>Instance objects report references to each non-primitive instance fields
4431               (including inherited fields).</li>
4432           <li>Instance objects report a reference to the object type (class).</li>
4433           <li>Classes report a reference to the superclass and directly
4434               implemented/extended interfaces.</li>
4435           <li>Classes report a reference to the class loader, protection domain,
4436               signers, and resolved entries in the constant pool.</li>
4437           <li>Classes report a reference to each directly declared non-primitive
4438               static field.</li>
4439           <li>Arrays report a reference to the array type (class) and each
4440               array element.</li>
4441           <li>Primitive arrays report a reference to the array type.</li>
4442         </ul>
4443         <p/>
4444         This function can also be used to examine primitive (non-object) values.
4445         The primitive value of an array or String
4446         is reported after the object has been visited;
4447         it is reported by invoking the agent supplied callback function
4448         <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4449         <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4450         A primitive field
4451         is reported after the object with that field is visited;
4452         it is reported by invoking the agent supplied callback function
4453         <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4454         <p/>
4455         Whether a callback is provided or is <code>NULL</code> only determines
4456         whether the callback will be invoked, it does not influence
4457         which objects are visited nor does it influence whether other callbacks
4458         will be invoked.
4459         However, the 
4460         <datalink id="jvmtiHeapVisitControl">visit control flags</datalink>
4461         returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4462         do determine if the objects referenced by the 
4463         current object as visited.
4464         The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4465         and <paramlink id="klass"/> provided as parameters to this function
4466         do not control which objects are visited but they do control which
4467         objects and primitive values are reported by the callbacks.
4468         For example, if the only callback that was set is
4469         <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4470         is set to the array of bytes class, then only arrays of byte will be
4471         reported.  
4472         The table below summarizes this:
4473         <p/>
4474         <table>
4475           <tr>
4476             <th/>
4477             <th>
4478               Controls objects visited
4479             </th>
4480             <th>
4481               Controls objects reported
4482             </th>
4483             <th>
4484               Controls primitives reported
4485             </th>
4486           </tr>
4487           <tr>
4488             <th align="left">
4489               the
4490               <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4491               returned by <functionlink id="jvmtiHeapReferenceCallback"/>
4492             </th>
4493             <td>
4494               <b>Yes</b>
4495             </td>
4496             <td>
4497               <b>Yes</b>, since visits are controlled
4498             </td>
4499             <td>
4500               <b>Yes</b>, since visits are controlled
4501             </td>
4502           </tr>
4503           <tr>
4504             <th align="left">
4505               <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4506               in <paramlink id="callbacks"/> set
4507             </th>
4508             <td>
4509               No
4510             </td>
4511             <td>
4512               <b>Yes</b>
4513             </td>
4514             <td>
4515               No
4516             </td>
4517           </tr>
4518           <tr>
4519             <th align="left">
4520               <paramlink id="heap_filter"/>
4521             </th>
4522             <td>
4523               No
4524             </td>
4525             <td>
4526               <b>Yes</b>
4527             </td>
4528             <td>
4529               <b>Yes</b>
4530             </td>
4531           </tr>
4532           <tr>
4533             <th align="left">
4534               <paramlink id="klass"/>
4535             </th>
4536             <td>
4537               No
4538             </td>
4539             <td>
4540               <b>Yes</b>
4541             </td>
4542             <td>
4543               <b>Yes</b>
4544             </td>
4545           </tr>
4546         </table>
4547         <p/>
4548         During the execution of this function the state of the heap
4549         does not change: no objects are allocated, no objects are
4550         garbage collected, and the state of objects (including 
4551         held values) does not change. 
4552         As a result, threads executing Java 
4553         programming language code, threads attempting to resume the
4554         execution of Java programming language code, and threads 
4555         attempting to execute JNI functions are typically stalled.
4556       </description>
4557       <origin>new</origin>
4558       <capabilities>
4559         <required id="can_tag_objects"></required>
4560       </capabilities>
4561       <parameters>             
4562         <param id="heap_filter">
4563           <jint/>
4564           <description>
4565             This bit vector of 
4566             <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4567             restricts the objects for which the callback function is called.
4568             This applies to both the object and primitive callbacks.
4569           </description>
4570         </param>
4571         <param id="klass">
4572           <ptrtype>
4573             <jclass/>
4574             <nullok>callbacks are not limited to instances of a particular
4575                     class</nullok>
4576           </ptrtype>
4577           <description>
4578             Callbacks are only reported when the object is an instance of 
4579             this class.
4580             Objects which are instances of a subclass of <code>klass</code>
4581             are not reported.
4582             If <code>klass</code> is an interface, no objects are reported.
4583             This applies to both the object and primitive callbacks.
4584           </description>
4585         </param>
4586         <param id="initial_object">
4587           <ptrtype>
4588             <jobject/>
4589             <nullok>references are followed from the heap roots</nullok>
4590           </ptrtype>
4591           <description>
4592             The object to follow
4593           </description>
4594         </param>
4595         <param id="callbacks">
4596           <inptr>
4597             <struct>jvmtiHeapCallbacks</struct>
4598           </inptr>
4599           <description>
4600             Structure defining the set of callback functions.
4601           </description>
4602         </param>                  
4603         <param id="user_data">
4604           <inbuf>
4605             <void/>
4606             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4607           </inbuf>
4608           <description>
4609             User supplied data to be passed to the callback. 
4610           </description>
4611         </param>
4612       </parameters>
4613       <errors>
4614         <error id="JVMTI_ERROR_INVALID_CLASS">
4615           <paramlink id="klass"/> is not a valid class.
4616         </error>
4617         <error id="JVMTI_ERROR_INVALID_OBJECT">
4618           <paramlink id="initial_object"/> is not a valid object.
4619         </error>
4620       </errors>
4621     </function>
4622 
4623 
4624     <function id="IterateThroughHeap" num="116" since="1.1">
4625       <synopsis>Iterate Through Heap</synopsis>
4626       <description>        
4627         Initiate an iteration over all objects in the heap. 
4628         This includes both reachable and 
4629         unreachable objects. Objects are visited in no particular order.
4630         <p/>
4631         Heap objects are reported by invoking the agent supplied 
4632         callback function <functionlink id="jvmtiHeapIterationCallback"/>.
4633         References between objects are not reported.
4634         If only reachable objects are desired, or if object reference information
4635         is needed, use <functionlink id="FollowReferences"/>.
4636         <p/>
4637         This function can also be used to examine primitive (non-object) values.
4638         The primitive value of an array or String
4639         is reported after the object has been visited;
4640         it is reported by invoking the agent supplied callback function
4641         <functionlink id="jvmtiArrayPrimitiveValueCallback"/> or
4642         <functionlink id="jvmtiStringPrimitiveValueCallback"/>.
4643         A primitive field
4644         is reported after the object with that field is visited;
4645         it is reported by invoking the agent supplied 
4646         callback function
4647         <functionlink id="jvmtiPrimitiveFieldCallback"/>.
4648         <p/>
4649         Unless the iteration is aborted by the
4650         <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4651         returned by a callback, all objects in the heap are visited.
4652         Whether a callback is provided or is <code>NULL</code> only determines
4653         whether the callback will be invoked, it does not influence
4654         which objects are visited nor does it influence whether other callbacks
4655         will be invoked.
4656         The <datalink id="jvmtiHeapFilter">heap filter flags</datalink>
4657         and <paramlink id="klass"/> provided as parameters to this function
4658         do not control which objects are visited but they do control which
4659         objects and primitive values are reported by the callbacks.
4660         For example, if the only callback that was set is
4661         <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
4662         is set to the array of bytes class, then only arrays of byte will be
4663         reported. The table below summarizes this (contrast this with 
4664         <functionlink id="FollowReferences"/>):
4665         <p/>
4666         <table>
4667           <tr>
4668             <th/>
4669             <th>
4670               Controls objects visited
4671             </th>
4672             <th>
4673               Controls objects reported
4674             </th>
4675             <th>
4676               Controls primitives reported
4677             </th>
4678           </tr>
4679           <tr>
4680             <th align="left">
4681               the
4682               <datalink id="jvmtiHeapVisitControl">Heap Visit Control Flags</datalink>
4683               returned by <functionlink id="jvmtiHeapIterationCallback"/>
4684             </th>
4685             <td>
4686               No<br/>(unless they abort the iteration)
4687             </td>
4688             <td>
4689               No<br/>(unless they abort the iteration)
4690             </td>
4691             <td>
4692               No<br/>(unless they abort the iteration)
4693             </td>
4694           </tr>
4695           <tr>
4696             <th align="left">
4697               <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
4698               in <paramlink id="callbacks"/> set
4699             </th>
4700             <td>
4701               No
4702             </td>
4703             <td>
4704               <b>Yes</b>
4705             </td>
4706             <td>
4707               No
4708             </td>
4709           </tr>
4710           <tr>
4711             <th align="left">
4712               <paramlink id="heap_filter"/>
4713             </th>
4714             <td>
4715               No
4716             </td>
4717             <td>
4718               <b>Yes</b>
4719             </td>
4720             <td>
4721               <b>Yes</b>
4722             </td>
4723           </tr>
4724           <tr>
4725             <th align="left">
4726               <paramlink id="klass"/>
4727             </th>
4728             <td>
4729               No
4730             </td>
4731             <td>
4732               <b>Yes</b>
4733             </td>
4734             <td>
4735               <b>Yes</b>
4736             </td>
4737           </tr>
4738         </table>
4739         <p/>
4740         During the execution of this function the state of the heap
4741         does not change: no objects are allocated, no objects are
4742         garbage collected, and the state of objects (including 
4743         held values) does not change. 
4744         As a result, threads executing Java 
4745         programming language code, threads attempting to resume the
4746         execution of Java programming language code, and threads 
4747         attempting to execute JNI functions are typically stalled.
4748       </description>
4749       <origin>new</origin>
4750       <capabilities>
4751         <required id="can_tag_objects"></required>
4752       </capabilities>
4753       <parameters>
4754         <param id="heap_filter">
4755           <jint/>
4756           <description>
4757             This bit vector of 
4758             <datalink id="jvmtiHeapFilter">heap filter flags</datalink>.
4759             restricts the objects for which the callback function is called.
4760             This applies to both the object and primitive callbacks.
4761           </description>
4762         </param>
4763         <param id="klass">
4764           <ptrtype>
4765             <jclass/>
4766             <nullok>callbacks are not limited to instances of a particular class</nullok>
4767           </ptrtype>
4768           <description>
4769             Callbacks are only reported when the object is an instance of 
4770             this class.
4771             Objects which are instances of a subclass of <code>klass</code>
4772             are not reported.
4773             If <code>klass</code> is an interface, no objects are reported.
4774             This applies to both the object and primitive callbacks.
4775           </description>
4776         </param>
4777         <param id="callbacks">
4778           <inptr>
4779             <struct>jvmtiHeapCallbacks</struct>
4780           </inptr>
4781           <description>
4782             Structure defining the set callback functions.
4783           </description>
4784         </param>                  
4785         <param id="user_data">
4786           <inbuf>
4787             <void/>
4788             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
4789           </inbuf>
4790           <description>
4791             User supplied data to be passed to the callback. 
4792           </description>
4793         </param>
4794       </parameters>
4795       <errors>
4796         <error id="JVMTI_ERROR_INVALID_CLASS">
4797           <paramlink id="klass"/> is not a valid class.
4798         </error>
4799       </errors>
4800     </function>
4801 
4802     <function id="GetTag" phase="start" num="106">
4803       <synopsis>Get Tag</synopsis>
4804       <description>
4805         Retrieve the tag associated with an object.
4806         The tag is a long value typically used to store a 
4807         unique identifier or pointer to object information.
4808         The tag is set with
4809         <functionlink id="SetTag"></functionlink>.
4810         Objects for which no tags have been set return a
4811         tag value of zero.
4812       </description>
4813       <origin>new</origin>
4814       <capabilities>
4815         <required id="can_tag_objects"></required>
4816       </capabilities>
4817       <parameters>
4818         <param id="object">
4819           <jobject/>
4820             <description>
4821               The object whose tag is to be retrieved.
4822             </description>
4823         </param>
4824         <param id="tag_ptr">
4825           <outptr><jlong/></outptr>
4826           <description>
4827             On return, the referenced long is set to the value 
4828             of the tag.
4829           </description>
4830         </param>
4831       </parameters>
4832       <errors>
4833       </errors>
4834     </function>
4835 
4836     <function id="SetTag" phase="start" num="107">
4837       <synopsis>Set Tag</synopsis>
4838       <description>
4839         Set the tag associated with an object.
4840         The tag is a long value typically used to store a 
4841         unique identifier or pointer to object information.
4842         The tag is visible with
4843         <functionlink id="GetTag"></functionlink>.
4844       </description>
4845       <origin>new</origin>
4846       <capabilities>
4847         <required id="can_tag_objects"></required>
4848       </capabilities>
4849       <parameters>
4850         <param id="object">
4851           <jobject/>
4852             <description>
4853               The object whose tag is to be set.
4854             </description>
4855         </param>
4856         <param id="tag">
4857           <jlong/>
4858           <description>
4859             The new value of the tag.
4860           </description>
4861         </param>
4862       </parameters>
4863       <errors>
4864       </errors>
4865     </function>
4866 
4867     <function id="GetObjectsWithTags" num="114">
4868       <synopsis>Get Objects With Tags</synopsis>
4869       <description>
4870         Return objects in the heap with the specified tags.
4871         The format is parallel arrays of objects and tags.
4872       </description>
4873       <origin>new</origin>
4874       <capabilities>
4875         <required id="can_tag_objects"></required>
4876       </capabilities>
4877       <parameters>
4878         <param id="tag_count">
4879           <jint min="0"/>
4880             <description>
4881               Number of tags to scan for.
4882             </description>
4883         </param>
4884         <param id="tags">
4885           <inbuf incount="tag_count">
4886             <jlong/>
4887           </inbuf>
4888             <description>
4889               Scan for objects with these tags.
4890               Zero is not permitted in this array.
4891             </description>
4892         </param>
4893         <param id="count_ptr">
4894           <outptr>
4895             <jint/>
4896           </outptr>
4897             <description>
4898               Return the number of objects with any of the tags 
4899               in <paramlink id="tags"/>.
4900             </description>
4901         </param>
4902         <param id="object_result_ptr">
4903           <allocbuf outcount="count_ptr">
4904             <jobject/>
4905             <nullok>this information is not returned</nullok>
4906           </allocbuf>
4907             <description>
4908               Returns the array of objects with any of the tags 
4909               in <paramlink id="tags"/>.
4910             </description>
4911         </param>
4912         <param id="tag_result_ptr">
4913           <allocbuf outcount="count_ptr">
4914             <jlong/>
4915             <nullok>this information is not returned</nullok>
4916           </allocbuf>
4917             <description>
4918               For each object in <paramlink id="object_result_ptr"/>,
4919               return the tag at the corresponding index.
4920             </description>
4921         </param>
4922       </parameters>
4923       <errors>
4924         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
4925           Zero is present in <paramlink id="tags"></paramlink>.
4926         </error>
4927       </errors>
4928     </function>
4929 
4930     <function id="ForceGarbageCollection" num="108">
4931       <synopsis>Force Garbage Collection</synopsis>
4932       <description>
4933         Force the VM to perform a garbage collection.
4934         The garbage collection is as complete as possible.
4935         This function does not cause finalizers to be run.
4936         This function does not return until the garbage collection
4937         is finished.
4938         <p/>
4939         Although garbage collection is as complete 
4940         as possible there is no guarantee that all 
4941         <eventlink id="ObjectFree"/>
4942         events will have been 
4943         sent by the time that this function 
4944         returns. In particular, an object may be 
4945         prevented from being freed because it 
4946         is awaiting finalization.
4947       </description>
4948       <origin>new</origin>
4949       <capabilities>
4950       </capabilities>
4951       <parameters>
4952       </parameters>
4953       <errors>
4954       </errors>
4955     </function>
4956 
4957 
4958   </category>
4959 
4960   <category id="Heap_1_0" label="Heap (1.0)">
4961     <intro>
4962       <b>
4963         These functions and data types were introduced in the original 
4964         <jvmti/> version 1.0 and have been superseded by more
4965       </b>
4966       <internallink id="Heap"><b>powerful and flexible versions</b></internallink>
4967       <b>
4968         which:
4969       </b>
4970       <ul>
4971         <li>
4972           <b>
4973             Allow access to primitive values (the value of Strings, arrays, 
4974             and primitive fields)
4975           </b>
4976         </li>
4977         <li>
4978           <b>
4979             Allow the tag of the referrer to be set, thus enabling more
4980             efficient localized reference graph building
4981           </b>
4982         </li>
4983         <li>
4984           <b>
4985             Provide more extensive filtering abilities
4986           </b>
4987         </li>
4988         <li>
4989           <b>
4990             Are extensible, allowing their abilities to grow in future versions of <jvmti/>
4991           </b>
4992         </li>
4993       </ul>
4994       <p/>
4995       <b>Please use the </b>
4996       <internallink id="Heap"><b>current Heap functions</b></internallink>.
4997         <p/>
4998         <constants id="jvmtiHeapObjectFilter" label="Heap Object Filter Enumeration" kind="enum">
4999           <constant id="JVMTI_HEAP_OBJECT_TAGGED" num="1">
5000             Tagged objects only.
5001           </constant>
5002           <constant id="JVMTI_HEAP_OBJECT_UNTAGGED" num="2">
5003             Untagged objects only.
5004           </constant>
5005           <constant id="JVMTI_HEAP_OBJECT_EITHER" num="3">
5006             Either tagged or untagged objects.
5007           </constant>
5008         </constants>
5009 
5010         <constants id="jvmtiHeapRootKind" label="Heap Root Kind Enumeration" kind="enum">
5011           <constant id="JVMTI_HEAP_ROOT_JNI_GLOBAL" num="1">
5012             JNI global reference.
5013           </constant>
5014           <constant id="JVMTI_HEAP_ROOT_SYSTEM_CLASS" num="2">
5015             System class.
5016           </constant>
5017           <constant id="JVMTI_HEAP_ROOT_MONITOR" num="3">
5018             Monitor.
5019           </constant>
5020           <constant id="JVMTI_HEAP_ROOT_STACK_LOCAL" num="4">
5021             Stack local.
5022           </constant>
5023           <constant id="JVMTI_HEAP_ROOT_JNI_LOCAL" num="5">
5024             JNI local reference.
5025           </constant>
5026           <constant id="JVMTI_HEAP_ROOT_THREAD" num="6">
5027             Thread.
5028           </constant>
5029           <constant id="JVMTI_HEAP_ROOT_OTHER" num="7">
5030             Other.
5031           </constant>
5032         </constants>
5033 
5034         <constants id="jvmtiObjectReferenceKind" label="Object Reference Enumeration" kind="enum">
5035           <constant id="JVMTI_REFERENCE_CLASS" num="1">
5036             Reference from an object to its class.
5037           </constant>       
5038           <constant id="JVMTI_REFERENCE_FIELD" num="2">
5039             Reference from an object to the value of one of its instance fields.
5040             For references of this kind the <code>referrer_index</code>
5041             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5042             jvmtiObjectReferenceCallback</internallink> is the index of the
5043             the instance field. The index is based on the order of all the 
5044             object's fields. This includes all fields of the directly declared
5045             static and instance fields in the class, and includes all fields (both
5046             public and private) fields declared in superclasses and superinterfaces.
5047             The index is thus calculated by summing the index of the field in the directly
5048             declared class (see <functionlink id="GetClassFields"/>), with the total
5049             number of fields (both public and private) declared in all superclasses
5050             and superinterfaces. The index starts at zero.
5051           </constant>
5052           <constant id="JVMTI_REFERENCE_ARRAY_ELEMENT" num="3">
5053             Reference from an array to one of its elements.
5054             For references of this kind the <code>referrer_index</code>
5055             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5056             jvmtiObjectReferenceCallback</internallink> is the array index.
5057           </constant>
5058           <constant id="JVMTI_REFERENCE_CLASS_LOADER" num="4">
5059             Reference from a class to its class loader.
5060           </constant>
5061           <constant id="JVMTI_REFERENCE_SIGNERS" num="5">
5062             Reference from a class to its signers array.
5063           </constant>
5064           <constant id="JVMTI_REFERENCE_PROTECTION_DOMAIN" num="6">
5065             Reference from a class to its protection domain.
5066           </constant>       
5067           <constant id="JVMTI_REFERENCE_INTERFACE" num="7">
5068             Reference from a class to one of its interfaces.
5069           </constant>
5070           <constant id="JVMTI_REFERENCE_STATIC_FIELD" num="8">
5071             Reference from a class to the value of one of its static fields.
5072             For references of this kind the <code>referrer_index</code>
5073             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5074             jvmtiObjectReferenceCallback</internallink> is the index of the
5075             the static field. The index is based on the order of all the 
5076             object's fields. This includes all fields of the directly declared
5077             static and instance fields in the class, and includes all fields (both
5078             public and private) fields declared in superclasses and superinterfaces.
5079             The index is thus calculated by summing the index of the field in the directly
5080             declared class (see <functionlink id="GetClassFields"/>), with the total
5081             number of fields (both public and private) declared in all superclasses
5082             and superinterfaces. The index starts at zero.
5083             Note: this definition differs from that in the <jvmti/> 1.0 Specification.
5084             <rationale>No known implementations used the 1.0 definition.</rationale>
5085           </constant>
5086           <constant id="JVMTI_REFERENCE_CONSTANT_POOL" num="9">
5087             Reference from a class to a resolved entry in the constant pool.
5088             For references of this kind the <code>referrer_index</code>
5089             parameter to the <internallink id="jvmtiObjectReferenceCallback">
5090             jvmtiObjectReferenceCallback</internallink> is the index into
5091             constant pool table of the class, starting at 1. See
5092             <vmspec chapter="4.4"/>.
5093           </constant>
5094         </constants>
5095 
5096         <constants id="jvmtiIterationControl" label="Iteration Control Enumeration" kind="enum">
5097           <constant id="JVMTI_ITERATION_CONTINUE" num="1">
5098             Continue the iteration.  
5099             If this is a reference iteration, follow the references of this object.
5100           </constant>       
5101           <constant id="JVMTI_ITERATION_IGNORE" num="2">
5102             Continue the iteration.  
5103             If this is a reference iteration, ignore the references of this object.
5104           </constant>
5105           <constant id="JVMTI_ITERATION_ABORT" num="0">
5106             Abort the iteration.
5107           </constant>
5108         </constants>
5109     </intro>
5110 
5111     <callback id="jvmtiHeapObjectCallback">
5112       <enum>jvmtiIterationControl</enum>
5113       <synopsis>Heap Object Callback</synopsis>
5114       <description>
5115         Agent supplied callback function.
5116         Describes (but does not pass in) an object in the heap.
5117         <p/>
5118         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5119         or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5120         <p/>
5121         See the <internallink id="heapCallbacks">heap callback
5122         function restrictions</internallink>.
5123       </description>
5124       <parameters>
5125         <param id="class_tag">
5126           <jlong/>
5127           <description>
5128             The tag of the class of object (zero if the class is not tagged). 
5129             If the object represents a runtime class, 
5130             the <code>class_tag</code> is the tag 
5131             associated with <code>java.lang.Class</code>
5132             (zero if <code>java.lang.Class</code> is not tagged).
5133           </description>
5134         </param>
5135         <param id="size">
5136           <jlong/>
5137           <description>
5138             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5139           </description>
5140         </param>
5141         <param id="tag_ptr">
5142           <outptr><jlong/></outptr>
5143           <description>
5144             The object tag value, or zero if the object is not tagged.
5145             To set the tag value to be associated with the object
5146             the agent sets the <code>jlong</code> pointed to by the parameter. 
5147           </description>
5148         </param>
5149         <param id="user_data">
5150           <outptr><void/></outptr>
5151           <description>
5152             The user supplied data that was passed into the iteration function. 
5153           </description>
5154         </param>
5155       </parameters>
5156     </callback>  
5157 
5158     <callback id="jvmtiHeapRootCallback">
5159       <enum>jvmtiIterationControl</enum>
5160       <synopsis>Heap Root Object Callback</synopsis>
5161       <description>
5162         Agent supplied callback function.
5163         Describes (but does not pass in) an object that is a root for the purposes
5164         of garbage collection.
5165         <p/>
5166         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5167         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing 
5168         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5169         <p/>
5170         See the <internallink id="heapCallbacks">heap callback
5171         function restrictions</internallink>.
5172       </description>
5173       <parameters>
5174         <param id="root_kind">
5175           <enum>jvmtiHeapRootKind</enum>
5176           <description>
5177             The kind of heap root.
5178           </description>
5179         </param>
5180         <param id="class_tag">
5181           <jlong/>
5182           <description>
5183             The tag of the class of object (zero if the class is not tagged). 
5184             If the object represents a runtime class, the <code>class_tag</code> is the tag 
5185             associated with <code>java.lang.Class</code> 
5186             (zero if <code>java.lang.Class</code> is not tagged).
5187           </description>
5188         </param>
5189         <param id="size">
5190           <jlong/>
5191           <description>
5192             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5193           </description>
5194         </param>
5195         <param id="tag_ptr">
5196           <outptr><jlong/></outptr>
5197           <description>
5198             The object tag value, or zero if the object is not tagged.
5199             To set the tag value to be associated with the object
5200             the agent sets the <code>jlong</code> pointed to by the parameter.
5201           </description>
5202         </param>
5203         <param id="user_data">
5204           <outptr><void/></outptr>
5205           <description>
5206             The user supplied data that was passed into the iteration function. 
5207           </description>
5208         </param>
5209       </parameters>
5210     </callback> 
5211 
5212     <callback id="jvmtiStackReferenceCallback">
5213       <enum>jvmtiIterationControl</enum>
5214       <synopsis>Stack Reference Object Callback</synopsis>
5215       <description>
5216         Agent supplied callback function.
5217         Describes (but does not pass in) an object on the stack that is a root for 
5218         the purposes of garbage collection.
5219         <p/>
5220         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5221         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing 
5222         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5223         <p/>
5224         See the <internallink id="heapCallbacks">heap callback
5225         function restrictions</internallink>.
5226       </description>
5227       <parameters>
5228         <param id="root_kind">
5229           <enum>jvmtiHeapRootKind</enum>
5230           <description>
5231             The kind of root (either <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5232             <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>).
5233           </description>
5234         </param>
5235         <param id="class_tag">
5236           <jlong/>
5237           <description>
5238            The tag of the class of object (zero if the class is not tagged). 
5239            If the object represents a runtime class, the  <code>class_tag</code> is the tag 
5240            associated with <code>java.lang.Class</code> 
5241            (zero if <code>java.lang.Class</code> is not tagged).
5242           </description>
5243         </param>
5244         <param id="size">
5245           <jlong/>
5246           <description>
5247             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
5248           </description>
5249         </param>
5250         <param id="tag_ptr">
5251           <outptr><jlong/></outptr>
5252           <description>
5253             The object tag value, or zero if the object is not tagged.
5254             To set the tag value to be associated with the object
5255             the agent sets the <code>jlong</code> pointed to by the parameter.
5256           </description>
5257         </param>
5258         <param id="thread_tag">
5259           <jlong/>
5260           <description>
5261             The tag of the thread corresponding to this stack, zero if not tagged.
5262           </description>
5263         </param>
5264         <param id="depth">
5265           <jint/>
5266           <description>
5267             The depth of the frame. 
5268           </description>
5269         </param>
5270         <param id="method">
5271           <jmethodID/>
5272           <description>
5273             The method executing in this frame.
5274           </description>
5275         </param>
5276         <param id="slot">
5277           <jint/>
5278           <description>
5279             The slot number.
5280           </description>
5281         </param>
5282         <param id="user_data">
5283           <outptr><void/></outptr>
5284           <description>
5285             The user supplied data that was passed into the iteration function. 
5286           </description>
5287         </param>
5288       </parameters>
5289     </callback>
5290 
5291     <callback id="jvmtiObjectReferenceCallback">
5292       <enum>jvmtiIterationControl</enum>
5293       <synopsis>Object Reference Callback</synopsis>
5294       <description>
5295         Agent supplied callback function.       
5296         Describes a reference from an object (the referrer) to another object
5297         (the referree).
5298         <p/>
5299         Return value should be <code>JVMTI_ITERATION_CONTINUE</code> to continue iteration,
5300         <code>JVMTI_ITERATION_IGNORE</code> to continue iteration without pursuing 
5301         references from referree object or <code>JVMTI_ITERATION_ABORT</code> to stop iteration.
5302         <p/>
5303         See the <internallink id="heapCallbacks">heap callback
5304         function restrictions</internallink>.
5305       </description>
5306       <parameters>
5307         <param id="reference_kind">
5308           <enum>jvmtiObjectReferenceKind</enum>
5309           <description>
5310             The type of reference.
5311           </description>
5312         </param>
5313         <param id="class_tag">
5314           <jlong/>
5315           <description>
5316             The tag of the class of referree object (zero if the class is not tagged). 
5317             If the referree object represents a runtime class,
5318             the  <code>class_tag</code> is the tag 
5319             associated with <code>java.lang.Class</code> 
5320             (zero if <code>java.lang.Class</code> is not tagged).
5321           </description>
5322         </param>
5323         <param id="size">
5324           <jlong/>
5325           <description>
5326             Size of the referree object (in bytes). 
5327             See <functionlink id="GetObjectSize"/>.
5328           </description>
5329         </param>
5330         <param id="tag_ptr">
5331           <outptr><jlong/></outptr>
5332           <description>
5333             The referree object tag value, or zero if the object is not 
5334             tagged.
5335             To set the tag value to be associated with the object
5336             the agent sets the <code>jlong</code> pointed to by the parameter.
5337           </description>
5338         </param>
5339         <param id="referrer_tag">
5340           <jlong/>
5341           <description>
5342             The tag of the referrer object, or zero if the referrer
5343             object is not tagged.
5344           </description>
5345         </param>
5346         <param id="referrer_index">
5347           <jint/>
5348           <description>       
5349             For references of type <code>JVMTI_REFERENCE_FIELD</code> or
5350             <code>JVMTI_REFERENCE_STATIC_FIELD</code> the index
5351             of the field in the referrer object. The index is based on the 
5352             order of all the object's fields - see <internallink 
5353             id="JVMTI_REFERENCE_FIELD">JVMTI_REFERENCE_FIELD</internallink>
5354             or <internallink
5355             id="JVMTI_REFERENCE_STATIC_FIELD">JVMTI_REFERENCE_STATIC_FIELD
5356             </internallink> for further description.
5357             <p/>
5358             For references of type <code>JVMTI_REFERENCE_ARRAY_ELEMENT</code>
5359             the array index - see <internallink id="JVMTI_REFERENCE_ARRAY_ELEMENT">
5360             JVMTI_REFERENCE_ARRAY_ELEMENT</internallink> for further description.
5361             <p/>
5362             For references of type <code>JVMTI_REFERENCE_CONSTANT_POOL</code>
5363             the index into the constant pool of the class - see
5364             <internallink id="JVMTI_REFERENCE_CONSTANT_POOL">
5365             JVMTI_REFERENCE_CONSTANT_POOL</internallink> for further 
5366             description.
5367             <p/>
5368             For references of other kinds the <code>referrer_index</code> is
5369             <code>-1</code>.
5370           </description>
5371         </param>
5372         <param id="user_data">
5373           <outptr><void/></outptr>
5374           <description>
5375             The user supplied data that was passed into the iteration function. 
5376           </description>
5377         </param>
5378       </parameters>
5379     </callback>
5380 
5381     <function id="IterateOverObjectsReachableFromObject" num="109">
5382       <synopsis>Iterate Over Objects Reachable From Object</synopsis>
5383       <description>       
5384         This function iterates over all objects that are directly
5385         and indirectly reachable from the specified object.
5386         For each object <i>A</i> (known
5387         as the referrer) with a reference to object <i>B</i> the specified 
5388         callback function is called to describe the object reference.
5389         The callback is called exactly once for each reference from a referrer;
5390         this is true even if there are reference cycles or multiple paths to
5391         the referrer.
5392         There may be more than one reference between a referrer and a referree,
5393         These may be distinguished by the 
5394         <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5395         <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5396         The callback for an object will always occur after the callback for
5397         its referrer.
5398         <p/>
5399         See <functionlink id="FollowReferences"/> for the object
5400         references which are reported.
5401         <p/>
5402         During the execution of this function the state of the heap
5403         does not change: no objects are allocated, no objects are
5404         garbage collected, and the state of objects (including 
5405         held values) does not change. 
5406         As a result, threads executing Java 
5407         programming language code, threads attempting to resume the
5408         execution of Java programming language code, and threads 
5409         attempting to execute JNI functions are typically stalled.
5410       </description>
5411       <origin>new</origin>
5412       <capabilities>
5413         <required id="can_tag_objects"></required>
5414       </capabilities>
5415       <parameters>             
5416         <param id="object">
5417           <jobject/>
5418             <description>
5419               The object
5420             </description>
5421         </param>
5422         <param id="object_reference_callback">
5423           <ptrtype>
5424             <struct>jvmtiObjectReferenceCallback</struct>
5425           </ptrtype>
5426             <description>
5427               The callback to be called to describe each
5428               object reference.
5429             </description>
5430         </param>            
5431         <param id="user_data">
5432           <inbuf>
5433             <void/>
5434             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5435           </inbuf>
5436           <description>
5437             User supplied data to be passed to the callback. 
5438           </description>
5439         </param>
5440       </parameters>
5441       <errors>
5442       </errors>
5443     </function>
5444 
5445     <function id="IterateOverReachableObjects" num="110">
5446       <synopsis>Iterate Over Reachable Objects</synopsis>
5447       <description>
5448         This function iterates over the root objects and all objects that
5449         are directly and indirectly reachable from the root objects.
5450         The root objects comprise the set of system classes, 
5451         JNI globals, references from thread stacks, and other objects used as roots 
5452         for the purposes of garbage collection. 
5453         <p/>
5454         For each root the <paramlink id="heap_root_callback"></paramlink>
5455         or <paramlink id="stack_ref_callback"></paramlink> callback is called.
5456         An object can be a root object for more than one reason and in that case
5457         the appropriate callback is called for each reason.
5458         <p/>
5459         For each object reference the <paramlink id="object_ref_callback"></paramlink>
5460         callback function is called to describe the object reference.
5461         The callback is called exactly once for each reference from a referrer;
5462         this is true even if there are reference cycles or multiple paths to
5463         the referrer.
5464         There may be more than one reference between a referrer and a referree,
5465         These may be distinguished by the 
5466         <datalink id="jvmtiObjectReferenceCallback.reference_kind"></datalink> and
5467         <datalink id="jvmtiObjectReferenceCallback.referrer_index"></datalink>.
5468         The callback for an object will always occur after the callback for
5469         its referrer.
5470         <p/>
5471         See <functionlink id="FollowReferences"/> for the object
5472         references which are reported.
5473         <p/>
5474         Roots are always reported to the profiler before any object references
5475         are reported. In other words, the <paramlink id="object_ref_callback"></paramlink> 
5476         callback will not be called until the appropriate callback has been called
5477         for all roots. If the <paramlink id="object_ref_callback"></paramlink> callback is 
5478         specified as <code>NULL</code> then this function returns after
5479         reporting the root objects to the profiler.
5480         <p/>
5481         During the execution of this function the state of the heap
5482         does not change: no objects are allocated, no objects are
5483         garbage collected, and the state of objects (including 
5484         held values) does not change. 
5485         As a result, threads executing Java 
5486         programming language code, threads attempting to resume the
5487         execution of Java programming language code, and threads 
5488         attempting to execute JNI functions are typically stalled.
5489       </description>
5490       <origin>new</origin>
5491       <capabilities>
5492         <required id="can_tag_objects"></required>
5493       </capabilities>
5494       <parameters>        
5495         <param id="heap_root_callback">
5496           <ptrtype>
5497             <struct>jvmtiHeapRootCallback</struct>
5498             <nullok>do not report heap roots</nullok>
5499           </ptrtype>
5500             <description>
5501               The callback function to be called for each heap root of type
5502               <code>JVMTI_HEAP_ROOT_JNI_GLOBAL</code>,
5503               <code>JVMTI_HEAP_ROOT_SYSTEM_CLASS</code>,
5504               <code>JVMTI_HEAP_ROOT_MONITOR</code>,
5505               <code>JVMTI_HEAP_ROOT_THREAD</code>, or 
5506               <code>JVMTI_HEAP_ROOT_OTHER</code>.
5507             </description>
5508         </param>
5509         <param id="stack_ref_callback">
5510           <ptrtype>
5511             <struct>jvmtiStackReferenceCallback</struct>
5512             <nullok>do not report stack references</nullok>
5513           </ptrtype>
5514             <description>
5515               The callback function to be called for each heap root of
5516               <code>JVMTI_HEAP_ROOT_STACK_LOCAL</code> or
5517               <code>JVMTI_HEAP_ROOT_JNI_LOCAL</code>.
5518             </description>
5519         </param>
5520         <param id="object_ref_callback">
5521           <ptrtype>
5522             <struct>jvmtiObjectReferenceCallback</struct>
5523             <nullok>do not follow references from the root objects</nullok>
5524           </ptrtype>
5525             <description>
5526               The callback function to be called for each object reference.
5527             </description>
5528         </param>
5529         <param id="user_data">
5530           <inbuf>
5531             <void/>
5532             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5533           </inbuf>
5534           <description>
5535             User supplied data to be passed to the callback. 
5536           </description>
5537         </param>
5538       </parameters>
5539       <errors>
5540       </errors>
5541     </function>
5542 
5543     <function id="IterateOverHeap" num="111">
5544       <synopsis>Iterate Over Heap</synopsis>
5545       <description>        
5546         Iterate over all objects in the heap. This includes both reachable and 
5547         unreachable objects.
5548         <p/>
5549         The <paramlink id="object_filter"></paramlink> parameter indicates the
5550         objects for which the callback function is called. If this parameter
5551         is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be 
5552         called for every object that is tagged. If the parameter is 
5553         <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5554         for objects that are not tagged. If the parameter
5555         is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5556         called for every object in the heap, irrespective of whether it is
5557         tagged or not.
5558         <p/>
5559         During the execution of this function the state of the heap
5560         does not change: no objects are allocated, no objects are
5561         garbage collected, and the state of objects (including 
5562         held values) does not change. 
5563         As a result, threads executing Java 
5564         programming language code, threads attempting to resume the
5565         execution of Java programming language code, and threads 
5566         attempting to execute JNI functions are typically stalled.
5567       </description>
5568       <origin>new</origin>
5569       <capabilities>
5570         <required id="can_tag_objects"></required>
5571       </capabilities>
5572       <parameters>
5573         <param id="object_filter">
5574           <enum>jvmtiHeapObjectFilter</enum>
5575           <description>
5576             Indicates the objects for which the callback function is called.
5577           </description>
5578         </param>
5579         <param id="heap_object_callback">
5580           <ptrtype>
5581             <struct>jvmtiHeapObjectCallback</struct>
5582           </ptrtype>
5583             <description>
5584               The iterator function to be called for each
5585               object matching the <paramlink id="object_filter"/>.
5586             </description>
5587         </param>
5588         <param id="user_data">
5589           <inbuf>
5590             <void/>
5591             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5592           </inbuf>
5593           <description>
5594             User supplied data to be passed to the callback. 
5595           </description>
5596         </param>
5597       </parameters>
5598       <errors>
5599       </errors>
5600     </function>
5601 
5602     <function id="IterateOverInstancesOfClass" num="112">
5603       <synopsis>Iterate Over Instances Of Class</synopsis>
5604       <description>
5605         Iterate over all objects in the heap that are instances of the specified class. 
5606         This includes direct instances of the specified class and 
5607         instances of all subclasses of the specified class.
5608         This includes both reachable and unreachable objects.
5609         <p/>
5610         The <paramlink id="object_filter"></paramlink> parameter indicates the
5611         objects for which the callback function is called. If this parameter
5612         is <code>JVMTI_HEAP_OBJECT_TAGGED</code> then the callback will only be 
5613         called for every object that is tagged. If the parameter is 
5614         <code>JVMTI_HEAP_OBJECT_UNTAGGED</code> then the callback will only be
5615         called for objects that are not tagged. If the parameter
5616         is <code>JVMTI_HEAP_OBJECT_EITHER</code> then the callback will be
5617         called for every object in the heap, irrespective of whether it is
5618         tagged or not.
5619         <p/>
5620         During the execution of this function the state of the heap
5621         does not change: no objects are allocated, no objects are
5622         garbage collected, and the state of objects (including 
5623         held values) does not change. 
5624         As a result, threads executing Java 
5625         programming language code, threads attempting to resume the
5626         execution of Java programming language code, and threads 
5627         attempting to execute JNI functions are typically stalled.
5628       </description>
5629       <origin>new</origin>
5630       <capabilities>
5631         <required id="can_tag_objects"></required>
5632       </capabilities>
5633       <parameters>
5634         <param id="klass">
5635           <jclass/>
5636             <description>
5637               Iterate over objects of this class only.
5638             </description>
5639         </param>
5640         <param id="object_filter">
5641           <enum>jvmtiHeapObjectFilter</enum>
5642           <description>
5643             Indicates the objects for which the callback function is called.
5644           </description>
5645         </param>
5646         <param id="heap_object_callback">
5647           <ptrtype>
5648             <struct>jvmtiHeapObjectCallback</struct>
5649           </ptrtype>
5650             <description>
5651               The iterator function to be called for each
5652               <paramlink id="klass"/> instance matching 
5653               the <paramlink id="object_filter"/>.
5654             </description>
5655         </param>
5656         <param id="user_data">
5657           <inbuf>
5658             <void/>
5659             <nullok><code>NULL</code> is passed as the user supplied data</nullok>
5660           </inbuf>
5661           <description>
5662             User supplied data to be passed to the callback. 
5663           </description>
5664         </param>
5665       </parameters>
5666       <errors>
5667       </errors>
5668     </function>
5669 
5670   </category>
5671 
5672   <category id="local" label="Local Variable">
5673 
5674     <intro>
5675       These functions are used to retrieve or set the value of a local variable. 
5676       The variable is identified by the depth of the frame containing its
5677       value and the variable's slot number within that frame. 
5678       The mapping of variables to 
5679       slot numbers can be obtained with the function 
5680       <functionlink id="GetLocalVariableTable"></functionlink>.
5681     </intro>
5682 
5683     <function id="GetLocalObject" num="21">
5684       <synopsis>Get Local Variable - Object</synopsis>
5685       <description>
5686         This function can be used to retrieve the value of a local 
5687         variable whose type is <code>Object</code> or a subclass of <code>Object</code>. 
5688       </description>
5689       <origin>jvmdi</origin>
5690       <capabilities>
5691         <required id="can_access_local_variables"></required>
5692       </capabilities>
5693       <parameters>
5694         <param id="thread">
5695           <jthread null="current" frame="frame"/>
5696           <description>
5697             The thread of the frame containing the variable's value.
5698           </description>
5699         </param>
5700         <param id="depth">
5701           <jframeID thread="thread"/>
5702           <description>
5703             The depth of the frame containing the variable's value.
5704           </description>
5705         </param>
5706         <param id="slot">
5707           <jint/>
5708           <description>
5709             The variable's slot number.
5710           </description>
5711         </param>
5712         <param id="value_ptr">
5713           <outptr><jobject/></outptr>
5714             <description>
5715               On return, points to the variable's value. 
5716             </description>
5717         </param>
5718       </parameters>
5719       <errors>
5720         <error id="JVMTI_ERROR_INVALID_SLOT">
5721           Invalid <code>slot</code>.
5722         </error>
5723         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
5724           The variable type is not
5725           <code>Object</code> or a subclass of <code>Object</code>.
5726         </error>
5727         <error id="JVMTI_ERROR_OPAQUE_FRAME"> 
5728           Not a visible frame
5729         </error>
5730       </errors>
5731     </function>
5732 
5733     <function id="GetLocalInstance" num="155" since="1.2">
5734       <synopsis>Get Local Instance</synopsis>
5735       <description>
5736         This function can be used to retrieve the value of the local object
5737         variable at slot 0 (the "<code>this</code>" object) from non-static
5738         frames.  This function can retrieve the "<code>this</code>" object from
5739         native method frames, whereas <code>GetLocalObject()</code> would 
5740         return <code>JVMTI_ERROR_OPAQUE_FRAME</code> in those cases.
5741       </description>
5742       <origin>new</origin>
5743       <capabilities>
5744         <required id="can_access_local_variables"></required>
5745       </capabilities>
5746       <parameters>
5747         <param id="thread">
5748           <jthread null="current" frame="frame"/>
5749           <description>
5750             The thread of the frame containing the variable's value.
5751           </description>
5752         </param>
5753         <param id="depth">
5754           <jframeID thread="thread"/>
5755           <description>
5756             The depth of the frame containing the variable's value.
5757           </description>
5758         </param>
5759         <param id="value_ptr">
5760           <outptr><jobject/></outptr>
5761             <description>
5762               On return, points to the variable's value. 
5763             </description>
5764         </param>
5765       </parameters>
5766       <errors>
5767         <error id="JVMTI_ERROR_INVALID_SLOT">
5768           If the specified frame is a static method frame.
5769         </error>
5770       </errors>
5771     </function>
5772     <function id="GetLocalInt" num="22">
5773       <synopsis>Get Local Variable - Int</synopsis>
5774       <description>
5775         This function can be used to retrieve the value of a local 
5776         variable whose type is <code>int</code>,
5777         <code>short</code>, <code>char</code>, <code>byte</code>, or 
5778         <code>boolean</code>. 
5779       </description>
5780       <origin>jvmdi</origin>
5781       <capabilities>
5782         <required id="can_access_local_variables"></required>
5783       </capabilities>
5784       <parameters>
5785         <param id="thread">
5786           <jthread null="current" frame="frame"/>
5787           <description>
5788             The thread of the frame containing the variable's value.
5789           </description>
5790         </param>
5791         <param id="depth">
5792           <jframeID thread="thread"/>
5793           <description>
5794             The depth of the frame containing the variable's value.
5795           </description>
5796         </param>
5797         <param id="slot">
5798           <jint/>
5799           <description>
5800             The variable's slot number.
5801           </description>
5802         </param>
5803         <param id="value_ptr">
5804           <outptr><jint/></outptr>
5805           <description>
5806             On return, points to the variable's value. 
5807           </description>
5808         </param>
5809       </parameters>
5810       <errors>
5811         <error id="JVMTI_ERROR_INVALID_SLOT">
5812           Invalid <code>slot</code>.
5813         </error>
5814         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
5815           The variable type is not 
5816           <code>int</code>, <code>short</code>,
5817           <code>char</code>, <code>byte</code>, or 
5818           <code>boolean</code>.
5819         </error>
5820         <error id="JVMTI_ERROR_OPAQUE_FRAME"> 
5821           Not a visible frame
5822         </error>
5823       </errors>
5824     </function>
5825 
5826     <function id="GetLocalLong" num="23">
5827       <synopsis>Get Local Variable - Long</synopsis>
5828       <description>
5829         This function can be used to retrieve the value of a local 
5830         variable whose type is <code>long</code>. 
5831       </description>
5832       <origin>jvmdi</origin>
5833       <capabilities>
5834         <required id="can_access_local_variables"></required>
5835       </capabilities>
5836       <parameters>
5837         <param id="thread">
5838           <jthread null="current" frame="frame"/>
5839           <description>
5840             The thread of the frame containing the variable's value.
5841           </description>
5842         </param>
5843         <param id="depth">
5844           <jframeID thread="thread"/>
5845           <description>
5846             The depth of the frame containing the variable's value.
5847           </description>
5848         </param>
5849         <param id="slot">
5850           <jint/>
5851           <description>
5852             The variable's slot number.
5853           </description>
5854         </param>
5855         <param id="value_ptr">
5856           <outptr><jlong/></outptr>
5857           <description>
5858             On return, points to the variable's value. 
5859           </description>
5860         </param>
5861       </parameters>
5862       <errors>
5863         <error id="JVMTI_ERROR_INVALID_SLOT">
5864           Invalid <code>slot</code>.
5865         </error>
5866         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
5867           The variable type is not <code>long</code>.
5868         </error>
5869         <error id="JVMTI_ERROR_OPAQUE_FRAME"> 
5870           Not a visible frame
5871         </error>
5872       </errors>
5873     </function>
5874 
5875     <function id="GetLocalFloat" num="24">
5876       <synopsis>Get Local Variable - Float</synopsis>
5877       <description>
5878         This function can be used to retrieve the value of a local 
5879         variable whose type is <code>float</code>. 
5880       </description>
5881       <origin>jvmdi</origin>
5882       <capabilities>
5883         <required id="can_access_local_variables"></required>
5884       </capabilities>
5885       <parameters>
5886         <param id="thread">
5887           <jthread null="current" frame="frame"/>
5888           <description>
5889             The thread of the frame containing the variable's value.
5890           </description>
5891         </param>
5892         <param id="depth">
5893           <jframeID thread="thread"/>
5894           <description>
5895             The depth of the frame containing the variable's value.
5896           </description>
5897         </param>
5898         <param id="slot">
5899           <jint/>
5900           <description>
5901             The variable's slot number.
5902           </description>
5903         </param>
5904         <param id="value_ptr">
5905           <outptr><jfloat/></outptr>
5906           <description>
5907             On return, points to the variable's value. 
5908           </description>
5909         </param>
5910       </parameters>
5911       <errors>
5912         <error id="JVMTI_ERROR_INVALID_SLOT">
5913           Invalid <code>slot</code>.
5914         </error>
5915         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
5916           The variable type is not <code>float</code>.
5917         </error>
5918         <error id="JVMTI_ERROR_OPAQUE_FRAME"> 
5919           Not a visible frame
5920         </error>
5921       </errors>
5922     </function>
5923 
5924     <function id="GetLocalDouble" num="25">
5925       <synopsis>Get Local Variable - Double</synopsis>
5926       <description>
5927         This function can be used to retrieve the value of a local 
5928         variable whose type is <code>long</code>. 
5929       </description>
5930       <origin>jvmdi</origin>
5931       <capabilities>
5932         <required id="can_access_local_variables"></required>
5933       </capabilities>
5934       <parameters>
5935         <param id="thread">
5936           <jthread null="current" frame="frame"/>
5937           <description>
5938             The thread of the frame containing the variable's value.
5939           </description>
5940         </param>
5941         <param id="depth">
5942           <jframeID thread="thread"/>
5943           <description>
5944             The depth of the frame containing the variable's value.
5945           </description>
5946         </param>
5947         <param id="slot">
5948           <jint/>
5949           <description>
5950             The variable's slot number.
5951           </description>
5952         </param>
5953         <param id="value_ptr">
5954           <outptr><jdouble/></outptr>
5955           <description>
5956             On return, points to the variable's value. 
5957           </description>
5958         </param>
5959       </parameters>
5960       <errors>
5961         <error id="JVMTI_ERROR_INVALID_SLOT">
5962           Invalid <code>slot</code>.
5963         </error>
5964         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
5965           The variable type is not <code>double</code>.
5966         </error>
5967         <error id="JVMTI_ERROR_OPAQUE_FRAME"> 
5968           Not a visible frame
5969         </error>
5970       </errors>
5971     </function>
5972 
5973     <function id="SetLocalObject" num="26">
5974       <synopsis>Set Local Variable - Object</synopsis>
5975       <description>
5976         This function can be used to set the value of a local 
5977         variable whose type is <code>Object</code> or a subclass of <code>Object</code>. 
5978       </description>
5979       <origin>jvmdi</origin>
5980       <capabilities>
5981         <required id="can_access_local_variables"></required>
5982       </capabilities>
5983       <parameters>
5984         <param id="thread">
5985           <jthread null="current" frame="frame"/>
5986           <description>
5987             The thread of the frame containing the variable's value.
5988           </description>
5989         </param>
5990         <param id="depth">
5991           <jframeID thread="thread"/>
5992           <description>
5993             The depth of the frame containing the variable's value.
5994           </description>
5995         </param>
5996         <param id="slot">
5997           <jint/>
5998           <description>
5999             The variable's slot number.
6000           </description>
6001         </param>
6002         <param id="value">
6003           <jobject/>
6004             <description>
6005               The new value for the variable.
6006             </description>
6007         </param>
6008       </parameters>
6009       <errors>
6010         <error id="JVMTI_ERROR_INVALID_SLOT">
6011           Invalid <code>slot</code>.
6012         </error>
6013         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6014           The variable type is not
6015           <code>Object</code> or a subclass of <code>Object</code>.
6016         </error>
6017         <error id="JVMTI_ERROR_TYPE_MISMATCH">
6018           The supplied <paramlink id="value"/> is not compatible 
6019           with the variable type.
6020         </error>
6021         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6022           Not a visible frame
6023         </error>
6024       </errors>
6025     </function>
6026 
6027     <function id="SetLocalInt" num="27">
6028       <synopsis>Set Local Variable - Int</synopsis>
6029       <description>
6030         This function can be used to set the value of a local 
6031         variable whose type is <code>int</code>,
6032         <code>short</code>, <code>char</code>, <code>byte</code>, or 
6033         <code>boolean</code>. 
6034       </description>
6035       <origin>jvmdi</origin>
6036       <capabilities>
6037         <required id="can_access_local_variables"></required>
6038       </capabilities>
6039       <parameters>
6040         <param id="thread">
6041           <jthread null="current" frame="frame"/>
6042           <description>
6043             The thread of the frame containing the variable's value.
6044           </description>
6045         </param>
6046         <param id="depth">
6047           <jframeID thread="thread"/>
6048           <description>
6049             The depth of the frame containing the variable's value.
6050           </description>
6051         </param>
6052         <param id="slot">
6053           <jint/>
6054           <description>
6055             The variable's slot number.
6056           </description>
6057         </param>
6058         <param id="value">
6059           <jint/>
6060           <description>
6061             The new value for the variable.
6062           </description>
6063         </param>
6064       </parameters>
6065       <errors>
6066         <error id="JVMTI_ERROR_INVALID_SLOT">
6067           Invalid <code>slot</code>.
6068         </error>
6069         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
6070           The variable type is not 
6071           <code>int</code>, <code>short</code>,
6072           <code>char</code>, <code>byte</code>, or 
6073           <code>boolean</code>.
6074         </error>
6075         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6076           Not a visible frame
6077         </error>
6078       </errors>
6079     </function>
6080 
6081     <function id="SetLocalLong" num="28">
6082       <synopsis>Set Local Variable - Long</synopsis>
6083       <description>
6084         This function can be used to set the value of a local 
6085         variable whose type is <code>long</code>. 
6086       </description>
6087       <origin>jvmdi</origin>
6088       <capabilities>
6089         <required id="can_access_local_variables"></required>
6090       </capabilities>
6091       <parameters>
6092         <param id="thread">
6093           <jthread null="current" frame="frame"/>
6094           <description>
6095             The thread of the frame containing the variable's value.
6096           </description>
6097         </param>
6098         <param id="depth">
6099           <jframeID thread="thread"/>
6100           <description>
6101             The depth of the frame containing the variable's value.
6102           </description>
6103         </param>
6104         <param id="slot">
6105           <jint/>
6106           <description>
6107             The variable's slot number.
6108           </description>
6109         </param>
6110         <param id="value">
6111           <jlong/>
6112           <description>
6113             The new value for the variable.
6114           </description>
6115         </param>
6116       </parameters>
6117       <errors>
6118         <error id="JVMTI_ERROR_INVALID_SLOT">
6119           Invalid <code>slot</code>.
6120         </error>
6121         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
6122           The variable type is not <code>long</code>.
6123         </error>
6124         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6125           Not a visible frame
6126         </error>
6127       </errors>
6128     </function>
6129 
6130     <function id="SetLocalFloat" num="29">
6131       <synopsis>Set Local Variable - Float</synopsis>
6132       <description>
6133         This function can be used to set the value of a local 
6134         variable whose type is <code>float</code>. 
6135       </description>
6136       <origin>jvmdi</origin>
6137       <capabilities>
6138         <required id="can_access_local_variables"></required>
6139       </capabilities>
6140       <parameters>
6141         <param id="thread">
6142           <jthread null="current" frame="frame"/>
6143           <description>
6144             The thread of the frame containing the variable's value.
6145           </description>
6146         </param>
6147         <param id="depth">
6148           <jframeID thread="thread"/>
6149           <description>
6150             The depth of the frame containing the variable's value.
6151           </description>
6152         </param>
6153         <param id="slot">
6154           <jint/>
6155           <description>
6156             The variable's slot number.
6157           </description>
6158         </param>
6159         <param id="value">
6160           <jfloat/>
6161           <description>
6162             The new value for the variable.
6163           </description>
6164         </param>
6165       </parameters>
6166       <errors>
6167         <error id="JVMTI_ERROR_INVALID_SLOT">
6168           Invalid <code>slot</code>.
6169         </error>
6170         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
6171           The variable type is not <code>float</code>.
6172         </error>
6173         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6174           Not a visible frame
6175         </error>
6176       </errors>
6177     </function>
6178 
6179     <function id="SetLocalDouble" num="30">
6180       <synopsis>Set Local Variable - Double</synopsis>
6181       <description>
6182         This function can be used to set the value of a local 
6183         variable whose type is <code>double</code>. 
6184       </description>
6185       <origin>jvmdi</origin>
6186       <capabilities>
6187         <required id="can_access_local_variables"></required>
6188       </capabilities>
6189       <parameters>
6190         <param id="thread">
6191           <jthread null="current" frame="frame"/>
6192           <description>
6193             The thread of the frame containing the variable's value.
6194           </description>
6195         </param>
6196         <param id="depth">
6197           <jframeID thread="thread"/>
6198           <description>
6199             The depth of the frame containing the variable's value.
6200           </description>
6201         </param>
6202         <param id="slot">
6203           <jint/>
6204           <description>
6205             The variable's slot number.
6206           </description>
6207         </param>
6208         <param id="value">
6209           <jdouble/>
6210           <description>
6211             The new value for the variable.
6212           </description>
6213         </param>
6214       </parameters>
6215       <errors>
6216         <error id="JVMTI_ERROR_INVALID_SLOT">
6217           Invalid <code>slot</code>.
6218         </error>
6219         <error id="JVMTI_ERROR_TYPE_MISMATCH"> 
6220           The variable type is not <code>double</code>.
6221         </error>
6222         <error id="JVMTI_ERROR_OPAQUE_FRAME">
6223           Not a visible frame
6224         </error>
6225       </errors>
6226     </function>
6227   </category>
6228 
6229   <category id="breakpointCategory" label="Breakpoint">
6230 
6231     <intro>
6232     </intro>
6233 
6234     <function id="SetBreakpoint" num="38">
6235       <synopsis>Set Breakpoint</synopsis>
6236       <description>
6237         Set a breakpoint at the instruction indicated by
6238         <code>method</code> and <code>location</code>.
6239         An instruction can only have one breakpoint.
6240         <p/>
6241         Whenever the designated instruction is about to be executed, a
6242         <eventlink id="Breakpoint"></eventlink> event is generated.
6243       </description>
6244       <origin>jvmdi</origin>
6245       <capabilities>
6246         <required id="can_generate_breakpoint_events"></required>
6247       </capabilities>
6248       <parameters>
6249         <param id="klass">
6250           <jclass method="method"/>
6251             <description>
6252               The class in which to set the breakpoint
6253             </description>
6254         </param>
6255         <param id="method">
6256           <jmethodID class="klass"/>
6257             <description>
6258               The method in which to set the breakpoint
6259             </description>
6260         </param>
6261         <param id="location">
6262           <jlocation/>
6263           <description>
6264             the index of the instruction at which to set the breakpoint
6265 
6266           </description>
6267         </param>
6268       </parameters>
6269       <errors>
6270         <error id="JVMTI_ERROR_DUPLICATE"> 
6271           The designated bytecode already has a breakpoint.
6272         </error>
6273       </errors>
6274     </function>
6275 
6276     <function id="ClearBreakpoint" num="39">
6277       <synopsis>Clear Breakpoint</synopsis>
6278       <description>
6279         Clear the breakpoint at the bytecode indicated by
6280         <code>method</code> and <code>location</code>.
6281       </description>
6282       <origin>jvmdi</origin>
6283       <capabilities>
6284         <required id="can_generate_breakpoint_events"></required>
6285       </capabilities>
6286       <parameters>
6287         <param id="klass">
6288           <jclass method="method"/>
6289             <description>
6290               The class in which to clear the breakpoint
6291             </description>
6292         </param>
6293         <param id="method">
6294           <jmethodID class="klass"/>
6295             <description>
6296               The method in which to clear the breakpoint
6297             </description>
6298         </param>
6299         <param id="location">
6300           <jlocation/>
6301           <description>
6302             the index of the instruction at which to clear the breakpoint
6303           </description>
6304         </param>
6305       </parameters>
6306       <errors>
6307         <error id="JVMTI_ERROR_NOT_FOUND"> 
6308           There's no breakpoint at the designated bytecode.
6309         </error>
6310       </errors>
6311     </function>
6312 
6313   </category>
6314 
6315   <category id="fieldWatch" label="Watched Field">
6316 
6317     <intro>
6318     </intro>
6319 
6320     <function id="SetFieldAccessWatch" num="41">
6321       <synopsis>Set Field Access Watch</synopsis>
6322       <description>
6323         Generate a <eventlink id="FieldAccess"></eventlink> event
6324         when the field specified
6325         by <code>klass</code> and
6326         <code>field</code> is about to be accessed.
6327         An event will be generated for each access of the field
6328         until it is canceled with 
6329         <functionlink id="ClearFieldAccessWatch"></functionlink>.
6330         Field accesses from Java programming language code or from JNI code are watched,
6331         fields modified by other means are not watched.
6332         Note that <jvmti/> users should be aware that their own field accesses
6333         will trigger the watch.
6334         A field can only have one field access watch set.
6335         Modification of a field is not considered an access--use 
6336         <functionlink id="SetFieldModificationWatch"></functionlink>
6337         to monitor modifications.
6338       </description>
6339       <origin>jvmdi</origin>
6340       <capabilities>
6341         <required id="can_generate_field_access_events"></required>
6342       </capabilities>
6343       <parameters>
6344         <param id="klass">
6345           <jclass field="field"/>
6346             <description>
6347               The class containing the field to watch
6348             </description>
6349         </param>
6350         <param id="field">
6351           <jfieldID class="klass"/>
6352             <description>
6353               The field to watch
6354 
6355             </description>
6356         </param>
6357       </parameters>
6358       <errors>
6359         <error id="JVMTI_ERROR_DUPLICATE"> 
6360           The designated field is already being watched for accesses.
6361         </error>
6362       </errors>
6363     </function>
6364 
6365     <function id="ClearFieldAccessWatch" num="42">
6366       <synopsis>Clear Field Access Watch</synopsis>
6367       <description>
6368         Cancel a field access watch previously set by 
6369         <functionlink id="SetFieldAccessWatch"></functionlink>, on the 
6370         field specified
6371         by <code>klass</code> and
6372         <code>field</code>.
6373       </description>
6374       <origin>jvmdi</origin>
6375       <capabilities>
6376         <required id="can_generate_field_access_events"></required>
6377       </capabilities>
6378       <parameters>
6379         <param id="klass">
6380           <jclass field="field"/>
6381             <description>
6382               The class containing the field to watch
6383             </description>
6384         </param>
6385         <param id="field">
6386           <jfieldID class="klass"/>
6387             <description>
6388               The field to watch
6389 
6390             </description>
6391         </param>
6392       </parameters>
6393       <errors>
6394         <error id="JVMTI_ERROR_NOT_FOUND"> 
6395           The designated field is not being watched for accesses.
6396         </error>
6397       </errors>
6398     </function>
6399 
6400     <function id="SetFieldModificationWatch" num="43">
6401       <synopsis>Set Field Modification Watch</synopsis>
6402       <description>
6403         Generate a <eventlink id="FieldModification"></eventlink> event
6404         when the field specified
6405         by <code>klass</code> and
6406         <code>field</code> is about to be modified.
6407         An event will be generated for each modification of the field
6408         until it is canceled with 
6409         <functionlink id="ClearFieldModificationWatch"></functionlink>.
6410         Field modifications from Java programming language code or from JNI code are watched,
6411         fields modified by other means are not watched.
6412         Note that <jvmti/> users should be aware that their own field modifications
6413         will trigger the watch.
6414         A field can only have one field modification watch set.
6415       </description>
6416       <origin>jvmdi</origin>
6417       <capabilities>
6418         <required id="can_generate_field_modification_events"></required>
6419       </capabilities>
6420       <parameters>
6421         <param id="klass">
6422           <jclass field="field"/>
6423             <description>
6424               The class containing the field to watch
6425             </description>
6426         </param>
6427         <param id="field">
6428           <jfieldID class="klass"/>
6429             <description>
6430               The field to watch
6431 
6432             </description>
6433         </param>
6434       </parameters>
6435       <errors>
6436         <error id="JVMTI_ERROR_DUPLICATE"> 
6437           The designated field is already being watched for modifications.
6438         </error>
6439       </errors>
6440     </function>
6441 
6442     <function id="ClearFieldModificationWatch" num="44">
6443       <synopsis>Clear Field Modification Watch</synopsis>
6444       <description>
6445 
6446         Cancel a field modification watch previously set by 
6447         <functionlink id="SetFieldModificationWatch"></functionlink>, on the 
6448         field specified
6449         by <code>klass</code> and
6450         <code>field</code>.
6451       </description>
6452       <origin>jvmdi</origin>
6453       <capabilities>
6454         <required id="can_generate_field_modification_events"></required>
6455       </capabilities>
6456       <parameters>
6457         <param id="klass">
6458           <jclass field="field"/>
6459             <description>
6460               The class containing the field to watch
6461             </description>
6462         </param>
6463         <param id="field">
6464           <jfieldID class="klass"/>
6465             <description>
6466               The field to watch
6467 
6468             </description>
6469         </param>
6470       </parameters>
6471       <errors>
6472         <error id="JVMTI_ERROR_NOT_FOUND"> 
6473           The designated field is not being watched for modifications.
6474         </error>
6475       </errors>
6476     </function>
6477   </category>
6478 
6479   <category id="module" label="Module">
6480 
6481     <intro>
6482     </intro>
6483 
6484     <function id="GetAllModules" num="3" since="9">
6485       <synopsis>Get All Modules</synopsis>
6486       <description>
6487         Return an array of all modules loaded in the virtual machine.
6488         The array includes the unnamed module for each class loader.
6489         The number of modules in the array is returned via
6490         <code>module_count_ptr</code>, and the array itself via
6491         <code>modules_ptr</code>.
6492         <p/>
6493       </description>
6494       <origin>new</origin>
6495       <capabilities>
6496       </capabilities>
6497       <parameters>
6498         <param id="module_count_ptr">
6499           <outptr><jint/></outptr>
6500           <description>
6501             On return, points to the number of returned modules.
6502           </description>
6503         </param>
6504         <param id="modules_ptr">
6505           <allocbuf outcount="module_count_ptr"><jobject/></allocbuf>
6506             <description>
6507               On return, points to an array of references, one
6508               for each module.
6509             </description>
6510         </param>
6511       </parameters>
6512       <errors>
6513       </errors>
6514     </function>
6515 
6516     <function id="GetNamedModule" num="40" since="9">
6517       <synopsis>Get Named Module</synopsis>
6518       <description>
6519         Return the <code>java.lang.Module</code> object for a named
6520         module defined to a class loader that contains a given package.
6521         The module is returned via <code>module_ptr</code>.
6522         <p/>
6523         If a named module is defined to the class loader and it
6524         contains the package then that named module is returned,
6525         otherwise <code>NULL</code> is returned.
6526         <p/>
6527       </description>
6528       <origin>new</origin>
6529       <capabilities>
6530       </capabilities>
6531       <parameters>
6532         <param id="class_loader">
6533           <ptrtype>
6534             <jobject/>
6535             <nullok>the bootstrap loader is assumed</nullok>
6536           </ptrtype>
6537           <description>
6538             A class loader.
6539             If the <code>class_loader</code> is not <code>NULL</code>
6540             or a subclass of <code>java.lang.ClassLoader</code>
6541             this function returns
6542             <errorlink id="JVMTI_ERROR_ILLEGAL_ARGUMENT"></errorlink>.
6543           </description>
6544         </param>
6545         <param id="package_name">
6546           <inbuf><char/></inbuf>
6547           <description>
6548             The name of the package, encoded as a
6549             <internallink id="mUTF">modified UTF-8</internallink> string.
6550             The package name is in internal form (JVMS 4.2.1);
6551             identifiers are separated by forward slashes rather than periods.
6552           </description>
6553         </param>
6554         <param id="module_ptr">
6555           <outptr><jobject/></outptr>
6556           <description>
6557             On return, points to a <code>java.lang.Module</code> object
6558             or points to <code>NULL</code>.
6559           </description>
6560         </param>
6561       </parameters>
6562       <errors>
6563         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6564           If class loader is not <code>NULL</code> and is not a class loader object.
6565         </error>
6566       </errors>
6567     </function>
6568 
6569     <function id="AddModuleReads" num="94" since="9">
6570       <synopsis>Add Module Reads</synopsis>
6571       <description>
6572          Update a module to read another module. This function is a no-op
6573          when <paramlink id="module"></paramlink> is an unnamed module.
6574          This function facilitates the instrumentation of code
6575          in named modules where that instrumentation requires
6576          expanding the set of modules that a module reads.
6577       </description>
6578       <origin>new</origin>
6579       <capabilities>
6580       </capabilities>
6581       <parameters>
6582         <param id="module">
6583           <ptrtype><jobject/></ptrtype>
6584           <description>
6585             The module to update.
6586           </description>
6587         </param>
6588         <param id="to_module">
6589           <ptrtype><jobject/></ptrtype>
6590           <description>
6591             The additional module to read.
6592           </description>
6593         </param>
6594       </parameters>
6595       <errors>
6596         <error id="JVMTI_ERROR_INVALID_MODULE">
6597           If <paramlink id="module"></paramlink> is not a module object.
6598         </error>
6599         <error id="JVMTI_ERROR_INVALID_MODULE">
6600           If <paramlink id="to_module"></paramlink> is not a module object.
6601         </error>
6602         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6603           if the module cannot be modified.
6604           See <functionlink id="IsModifiableModule"/>.
6605         </error>
6606       </errors>
6607     </function>
6608 
6609     <function id="AddModuleExports" num="95" since="9">
6610       <synopsis>Add Module Exports</synopsis>
6611       <description>
6612          Update a module to export a package to another module.
6613          This function is a no-op when <paramlink id="module"></paramlink>
6614          is an unnamed module or an open module.
6615          This function facilitates the instrumentation of code
6616          in named modules where that instrumentation requires
6617          expanding the set of packages that a module exports.
6618       </description>
6619       <origin>new</origin>
6620       <capabilities>
6621       </capabilities>
6622       <parameters>
6623         <param id="module">
6624           <ptrtype><jobject/></ptrtype>
6625           <description>
6626             The module to update.
6627           </description>
6628         </param>
6629         <param id="pkg_name">
6630           <inbuf><char/></inbuf>
6631           <description>
6632             The exported package name.
6633           </description>
6634         </param>
6635         <param id="to_module">
6636           <ptrtype><jobject/></ptrtype>
6637           <description>
6638             The module the package is exported to.
6639             If the <code>to_module</code> is not a subclass of
6640             <code>java.lang.Module</code> this function returns
6641             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6642           </description>
6643         </param>
6644       </parameters>
6645       <errors>
6646         <error id="JVMTI_ERROR_INVALID_MODULE">
6647           If <paramlink id="module"></paramlink> is not a module object.
6648         </error>
6649         <error id="JVMTI_ERROR_INVALID_MODULE">
6650           If <paramlink id="to_modules"></paramlink> is not a module object.
6651         </error>
6652         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6653           If the package <paramlink id="pkg_name"></paramlink>
6654           does not belong to the module.
6655         </error>
6656         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6657           if the module cannot be modified.
6658           See <functionlink id="IsModifiableModule"/>.
6659         </error>
6660       </errors>
6661     </function>
6662 
6663     <function id="AddModuleOpens" num="96" since="9">
6664       <synopsis>Add Module Opens</synopsis>
6665       <description>
6666          Update a module to open a package to another module.
6667          This function is a no-op when <paramlink id="module"></paramlink>
6668          is an unnamed module or an open module.
6669          This function facilitates the instrumentation of code
6670          in modules where that instrumentation requires
6671          expanding the set of packages that a module opens to
6672          other modules.
6673       </description>
6674       <origin>new</origin>
6675       <capabilities>
6676       </capabilities>
6677       <parameters>
6678         <param id="module">
6679           <ptrtype><jobject/></ptrtype>
6680           <description>
6681             The module to update.
6682           </description>
6683         </param>
6684         <param id="pkg_name">
6685           <inbuf><char/></inbuf>
6686           <description>
6687             The package name of the package to open.
6688           </description>
6689         </param>
6690         <param id="to_module">
6691           <ptrtype><jobject/></ptrtype>
6692           <description>
6693             The module with the package to open.
6694             If the <code>to_module</code> is not a subclass of
6695             <code>java.lang.Module</code> this function returns
6696             <errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
6697           </description>
6698         </param>
6699       </parameters>
6700       <errors>
6701         <error id="JVMTI_ERROR_INVALID_MODULE">
6702           If <paramlink id="module"></paramlink> is not a module object.
6703         </error>
6704         <error id="JVMTI_ERROR_INVALID_MODULE">
6705           If <paramlink id="to_modules"></paramlink> is not a module object.
6706         </error>
6707         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
6708           If the package <paramlink id="pkg_name"></paramlink>
6709           does not belong to the module.
6710         </error>
6711         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6712           if the module cannot be modified.
6713           See <functionlink id="IsModifiableModule"/>.
6714         </error>
6715       </errors>
6716     </function>
6717 
6718     <function id="AddModuleUses" num="97" since="9">
6719       <synopsis>Add Module Uses</synopsis>
6720       <description>
6721          Updates a module to add a service to the set of services that
6722          a module uses. This function is a no-op when the module
6723          is an unnamed module.
6724          This function facilitates the instrumentation of code
6725          in named modules where that instrumentation requires
6726          expanding the set of services that a module is using.
6727       </description>
6728       <origin>new</origin>
6729       <capabilities>
6730       </capabilities>
6731       <parameters>
6732         <param id="module">
6733           <ptrtype><jobject/></ptrtype>
6734           <description>
6735             The module to update.
6736           </description>
6737         </param>
6738         <param id="service">
6739           <ptrtype><jclass/></ptrtype>
6740           <description>
6741             The service to use.
6742           </description>
6743         </param>
6744       </parameters>
6745       <errors>
6746         <error id="JVMTI_ERROR_INVALID_MODULE">
6747           If <paramlink id="module"></paramlink> is not a module object.
6748         </error>
6749         <error id="JVMTI_ERROR_INVALID_CLASS">
6750           If <paramlink id="service"></paramlink> is not a class object.
6751         </error>
6752         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6753           if the module cannot be modified.
6754           See <functionlink id="IsModifiableModule"/>.
6755         </error>
6756       </errors>
6757     </function>
6758 
6759     <function id="AddModuleProvides" num="98" since="9">
6760       <synopsis>Add Module Provides</synopsis>
6761       <description>
6762          Updates a module to add a service to the set of services that
6763          a module provides. This function is a no-op when the module
6764          is an unnamed module.
6765          This function facilitates the instrumentation of code
6766          in named modules where that instrumentation requires
6767          changes to the services that are provided.
6768       </description>
6769       <origin>new</origin>
6770       <capabilities>
6771       </capabilities>
6772       <parameters>
6773         <param id="module">
6774           <ptrtype><jobject/></ptrtype>
6775           <description>
6776             The module to update.
6777           </description>
6778         </param>
6779         <param id="service">
6780           <ptrtype><jclass/></ptrtype>
6781           <description>
6782             The service to provide.
6783           </description>
6784         </param>
6785         <param id="impl_class">
6786           <ptrtype><jclass/></ptrtype>
6787           <description>
6788             The implementation class for the provided service.
6789           </description>
6790         </param>
6791       </parameters>
6792       <errors>
6793         <error id="JVMTI_ERROR_INVALID_MODULE">
6794           If <paramlink id="module"></paramlink> is not a module object.
6795         </error>
6796         <error id="JVMTI_ERROR_INVALID_CLASS">
6797           If <paramlink id="service"></paramlink> is not a class object.
6798         </error>
6799         <error id="JVMTI_ERROR_INVALID_CLASS">
6800           If <paramlink id="impl_class"></paramlink> is not a class object.
6801         </error>
6802         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
6803           if the module cannot be modified.
6804           See <functionlink id="IsModifiableModule"/>.
6805         </error>
6806       </errors>
6807     </function>
6808 
6809     <function id="IsModifiableModule" num="99" since="9">
6810       <synopsis>Is Modifiable Module</synopsis>
6811       <description>
6812         Determines whether a module is modifiable.
6813         If a module is modifiable then this module can be updated with
6814         <functionlink id="AddModuleReads"/>, <functionlink id="AddModuleExports"/>,
6815         <functionlink id="AddModuleOpens"/>, <functionlink id="AddModuleUses"/>,
6816         and <functionlink id="AddModuleProvides"/>. If a module is not modifiable
6817         then the module can not be updated with these functions.
6818       </description>
6819       <origin>new</origin>
6820       <capabilities>
6821       </capabilities>
6822       <parameters>
6823         <param id="module">
6824           <ptrtype><jobject/></ptrtype>
6825           <description>
6826             The module to query.
6827           </description>
6828         </param>
6829         <param id="is_modifiable_module_ptr">
6830           <outptr><jboolean/></outptr>
6831           <description>
6832             On return, points to the boolean result of this function.
6833           </description>
6834         </param>
6835       </parameters>
6836       <errors>
6837         <error id="JVMTI_ERROR_INVALID_MODULE">
6838           If <paramlink id="module"></paramlink> is not a module object.
6839         </error>
6840       </errors>
6841     </function>
6842 
6843   </category>
6844 
6845   <category id="class" label="Class">
6846 
6847     <intro>
6848     </intro>
6849 
6850     <function id="GetLoadedClasses" jkernel="yes" num="78">
6851       <synopsis>Get Loaded Classes</synopsis>
6852       <description>
6853         Return an array of all classes loaded in the virtual machine.
6854         The number of classes in the array is returned via
6855         <code>class_count_ptr</code>, and the array itself via
6856         <code>classes_ptr</code>.
6857         <p/>
6858         Array classes of all types (including arrays of primitive types) are 
6859         included in the returned list. Primitive classes (for example, 
6860         <code>java.lang.Integer.TYPE</code>) are <i>not</i> included in this list. 
6861       </description>
6862       <origin>jvmdi</origin>
6863       <capabilities>
6864       </capabilities>
6865       <parameters>
6866         <param id="class_count_ptr">
6867           <outptr><jint/></outptr>
6868           <description>
6869             On return, points to the number of classes.
6870           </description>
6871         </param>
6872         <param id="classes_ptr">
6873           <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
6874             <description>
6875               On return, points to an array of references, one
6876               for each class.
6877             </description>
6878         </param>
6879       </parameters>
6880       <errors>
6881       </errors>
6882     </function>
6883 
6884     <function id="GetClassLoaderClasses" jkernel="yes" num="79">
6885       <synopsis>Get Classloader Classes</synopsis>
6886       <description>
6887         Returns an array of those classes for which this class loader has
6888         been recorded as an initiating loader. Each 
6889         class in the returned array was created by this class loader, 
6890         either by defining it directly or by delegation to another class loader.
6891         See <vmspec chapter="5.3"/>.
6892         <p/>
6893         The number of classes in the array is returned via
6894         <code>class_count_ptr</code>, and the array itself via
6895         <code>classes_ptr</code>.
6896       </description>
6897       <origin>jvmdi</origin>
6898       <capabilities>
6899       </capabilities>
6900       <parameters>
6901         <param id="initiating_loader">
6902           <ptrtype>
6903             <jobject/>
6904             <nullok>the classes initiated by the bootstrap loader will be returned</nullok>
6905           </ptrtype>
6906             <description>
6907               An initiating class loader.
6908             </description>
6909         </param>
6910         <param id="class_count_ptr">
6911           <outptr><jint/></outptr>
6912           <description>
6913             On return, points to the number of classes.
6914           </description>
6915         </param>
6916         <param id="classes_ptr">
6917           <allocbuf outcount="class_count_ptr"><jclass/></allocbuf>
6918             <description>
6919               On return, points to an array of references, one
6920               for each class.
6921             </description>
6922         </param>
6923       </parameters>
6924       <errors>
6925       </errors>
6926     </function>
6927 
6928     <function id="GetClassSignature" phase="start" num="48">
6929       <synopsis>Get Class Signature</synopsis>
6930       <description>
6931         For the class indicated by <code>klass</code>, return the 
6932         <externallink id="docs/technotes/guides/jni/spec/types.html#type_signatures">JNI 
6933             type signature</externallink> 
6934         and the generic signature of the class.
6935         For example, <code>java.util.List</code> is <code>"Ljava/util/List;"</code>
6936         and <code>int[]</code> is <code>"[I"</code>
6937         The returned name for primitive classes
6938         is the type signature character of the corresponding primitive type. 
6939         For example, <code>java.lang.Integer.TYPE</code> is <code>"I"</code>.
6940       </description>
6941       <origin>jvmdiClone</origin>
6942       <capabilities>
6943       </capabilities>
6944       <parameters>
6945         <param id="klass">
6946           <jclass/>
6947             <description>
6948               The class to query.
6949             </description>
6950         </param>
6951         <param id="signature_ptr">
6952           <allocbuf>
6953             <char/>           
6954             <nullok>the signature is not returned</nullok>
6955           </allocbuf>
6956           <description>
6957             On return, points to the JNI type signature of the class, encoded as a
6958             <internallink id="mUTF">modified UTF-8</internallink> string.
6959           </description>
6960         </param>
6961         <param id="generic_ptr">
6962           <allocbuf>
6963             <char/>           
6964             <nullok>the generic signature is not returned</nullok>
6965           </allocbuf>
6966           <description>
6967             On return, points to the generic signature of the class, encoded as a
6968             <internallink id="mUTF">modified UTF-8</internallink> string.
6969             If there is no generic signature attribute for the class, then,
6970             on return, points to <code>NULL</code>. 
6971           </description>
6972         </param>
6973       </parameters>
6974       <errors>
6975       </errors>
6976     </function>
6977 
6978     <function id="GetClassStatus" phase="start" num="49">
6979       <synopsis>Get Class Status</synopsis>
6980       <description>
6981         Get the status of the class. Zero or more of the following bits can be 
6982         set.
6983         <constants id="jvmtiClassStatus" label="Class Status Flags" kind="bits">
6984           <constant id="JVMTI_CLASS_STATUS_VERIFIED" num="1">
6985             Class bytecodes have been verified
6986           </constant>
6987           <constant id="JVMTI_CLASS_STATUS_PREPARED" num="2">
6988             Class preparation is complete
6989           </constant>
6990           <constant id="JVMTI_CLASS_STATUS_INITIALIZED" num="4">
6991             Class initialization is complete. Static initializer has been run.
6992           </constant>
6993           <constant id="JVMTI_CLASS_STATUS_ERROR" num="8">
6994             Error during initialization makes class unusable
6995           </constant>
6996           <constant id="JVMTI_CLASS_STATUS_ARRAY" num="16">
6997             Class is an array.  If set, all other bits are zero.
6998           </constant>
6999           <constant id="JVMTI_CLASS_STATUS_PRIMITIVE" num="32">
7000             Class is a primitive class (for example, <code>java.lang.Integer.TYPE</code>).  
7001             If set, all other bits are zero.
7002           </constant>
7003         </constants>
7004       </description>
7005       <origin>jvmdi</origin>
7006       <capabilities>
7007       </capabilities>
7008       <parameters>
7009         <param id="klass">
7010           <jclass/>
7011             <description>
7012               The class to query.
7013             </description>
7014         </param>
7015         <param id="status_ptr">
7016           <outptr><jint/></outptr>
7017           <description>
7018             On return, points to the current state of this class as one or 
7019             more of the <internallink id="jvmtiClassStatus">class status flags</internallink>.
7020           </description>
7021         </param>
7022       </parameters>
7023       <errors>
7024       </errors>
7025     </function>
7026 
7027     <function id="GetSourceFileName" phase="start" num="50">
7028       <synopsis>Get Source File Name</synopsis>
7029       <description>
7030         For the class indicated by <code>klass</code>, return the source file
7031         name via <code>source_name_ptr</code>. The returned string 
7032         is a file name only and never contains a directory name. 
7033         <p/>
7034         For primitive classes (for example, <code>java.lang.Integer.TYPE</code>) 
7035         and for arrays this function returns 
7036         <errorlink id="JVMTI_ERROR_ABSENT_INFORMATION"></errorlink>.
7037       </description>
7038       <origin>jvmdi</origin>
7039       <capabilities>
7040         <required id="can_get_source_file_name"></required>
7041       </capabilities>
7042       <parameters>
7043         <param id="klass">
7044           <jclass/>
7045             <description>
7046               The class to query.
7047             </description>
7048         </param>
7049         <param id="source_name_ptr">
7050           <allocbuf><char/></allocbuf>
7051           <description>
7052             On return, points to the class's source file name, encoded as a
7053             <internallink id="mUTF">modified UTF-8</internallink> string.
7054           </description>
7055         </param>
7056       </parameters>
7057       <errors>
7058         <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 
7059           Class information does not include a source file name. This includes
7060           cases where the class is an array class or primitive class.
7061         </error>
7062       </errors>
7063     </function>
7064 
7065     <function id="GetClassModifiers" phase="start" num="51">
7066       <synopsis>Get Class Modifiers</synopsis>
7067       <description>
7068         For the class indicated by <code>klass</code>, return the access
7069         flags
7070         via <code>modifiers_ptr</code>.
7071         Access flags are defined in <vmspec chapter="4"/>.
7072         <p/>
7073         If the class is an array class, then its public, private, and protected 
7074         modifiers are the same as those of its component type. For arrays of 
7075         primitives, this component type is represented by one of the primitive 
7076         classes (for example, <code>java.lang.Integer.TYPE</code>). 
7077         <p/>
7078         If the class is a primitive class, its public modifier is always true, 
7079         and its protected and private modifiers are always false. 
7080         <p/>
7081         If the class is an array class or a primitive class then its final 
7082         modifier is always true and its interface modifier is always false. 
7083         The values of its other modifiers are not determined by this specification. 
7084 
7085       </description>
7086       <origin>jvmdi</origin>
7087       <capabilities>
7088       </capabilities>
7089       <parameters>
7090         <param id="klass">
7091           <jclass/>
7092             <description>
7093               The class to query.
7094             </description>
7095         </param>
7096         <param id="modifiers_ptr">
7097           <outptr><jint/></outptr>
7098           <description>
7099             On return, points to the current access flags of this class.
7100 
7101           </description>
7102         </param>
7103       </parameters>
7104       <errors>
7105       </errors>
7106     </function>
7107 
7108     <function id="GetClassMethods" phase="start" num="52">
7109       <synopsis>Get Class Methods</synopsis>
7110       <description>
7111         For the class indicated by <code>klass</code>, return a count of
7112         methods via <code>method_count_ptr</code> and a list of
7113         method IDs via <code>methods_ptr</code>. The method list contains 
7114         constructors and static initializers as well as true methods.
7115         Only directly declared methods are returned (not inherited methods).
7116         An empty method list is returned for array classes and primitive classes
7117         (for example, <code>java.lang.Integer.TYPE</code>).
7118       </description>
7119       <origin>jvmdi</origin>
7120       <capabilities>
7121         <capability id="can_maintain_original_method_order"/>
7122       </capabilities>
7123       <parameters>
7124         <param id="klass">
7125           <jclass/>
7126             <description>
7127               The class to query.
7128             </description>
7129         </param>
7130         <param id="method_count_ptr">
7131           <outptr><jint/></outptr>
7132           <description>
7133             On return, points to the number of methods declared in this class.
7134           </description>
7135         </param>
7136         <param id="methods_ptr">
7137           <allocbuf outcount="method_count_ptr"><jmethodID class="klass"/></allocbuf>
7138             <description>
7139               On return, points to the method ID array.
7140             </description>
7141         </param>
7142       </parameters>
7143       <errors>
7144         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED">
7145           <paramlink id="klass"></paramlink> is not prepared.
7146         </error>
7147       </errors>
7148     </function>
7149 
7150     <function id="GetClassFields" phase="start" num="53">
7151       <synopsis>Get Class Fields</synopsis>
7152       <description>
7153         For the class indicated by <code>klass</code>, return a count of fields
7154         via <code>field_count_ptr</code> and a list of field IDs via
7155         <code>fields_ptr</code>.
7156         Only directly declared fields are returned (not inherited fields).
7157         Fields are returned in the order they occur in the class file.
7158         An empty field list is returned for array classes and primitive classes
7159         (for example, <code>java.lang.Integer.TYPE</code>).
7160         Use JNI to determine the length of an array.
7161       </description>
7162       <origin>jvmdi</origin>
7163       <capabilities>
7164       </capabilities>
7165       <parameters>
7166         <param id="klass">
7167           <jclass/>
7168             <description>
7169               The class to query.
7170             </description>
7171         </param>
7172         <param id="field_count_ptr">
7173           <outptr><jint/></outptr>
7174           <description>
7175             On return, points to the number of fields declared in this class.
7176           </description>
7177         </param>
7178         <param id="fields_ptr">
7179           <allocbuf outcount="field_count_ptr"><jfieldID/></allocbuf>
7180             <description>
7181               On return, points to the field ID array.
7182             </description>
7183         </param>
7184       </parameters>
7185       <errors>
7186         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED"> 
7187           <paramlink id="klass"></paramlink> is not prepared.
7188         </error>
7189       </errors>
7190     </function>
7191 
7192     <function id="GetImplementedInterfaces" phase="start" num="54">
7193       <synopsis>Get Implemented Interfaces</synopsis>
7194       <description>
7195         Return the direct super-interfaces of this class. For a class, this 
7196         function returns the interfaces declared in its <code>implements</code>
7197         clause. For an interface, this function returns the interfaces declared in
7198         its <code>extends</code> clause.
7199         An empty interface list is returned for array classes and primitive classes
7200         (for example, <code>java.lang.Integer.TYPE</code>).
7201       </description>
7202       <origin>jvmdi</origin>
7203       <capabilities>
7204       </capabilities>
7205       <parameters>
7206         <param id="klass">
7207           <jclass/>
7208             <description>
7209               The class to query.
7210             </description>
7211         </param>
7212         <param id="interface_count_ptr">
7213           <outptr><jint/></outptr>
7214           <description>
7215             On return, points to the number of interfaces.
7216           </description>
7217         </param>
7218         <param id="interfaces_ptr">
7219           <allocbuf outcount="interface_count_ptr"><jclass/></allocbuf>
7220             <description>
7221               On return, points to the interface array.
7222             </description>
7223         </param>
7224       </parameters>
7225       <errors>
7226         <error id="JVMTI_ERROR_CLASS_NOT_PREPARED"> 
7227           <paramlink id="klass"></paramlink> is not prepared.
7228         </error>
7229       </errors>
7230     </function>
7231 
7232     <function id="GetClassVersionNumbers" phase="start" num="145" since="1.1">
7233       <synopsis>Get Class Version Numbers</synopsis>
7234       <description>
7235         For the class indicated by <code>klass</code>, 
7236         return the minor and major version numbers,
7237         as defined in
7238         <vmspec chapter="4"/>. 
7239       </description>
7240       <origin>new</origin>
7241       <capabilities>
7242       </capabilities>
7243       <parameters>
7244         <param id="klass">
7245           <jclass/>
7246             <description>
7247               The class to query.
7248             </description>
7249         </param>
7250         <param id="minor_version_ptr">
7251           <outptr><jint/></outptr>
7252           <description>
7253             On return, points to the value of the
7254             <code>minor_version</code> item of the 
7255             Class File Format.
7256             Note: to be consistent with the Class File Format,
7257             the minor version number is the first parameter.
7258           </description>
7259         </param>
7260         <param id="major_version_ptr">
7261           <outptr><jint/></outptr>
7262           <description>
7263             On return, points to the value of the
7264             <code>major_version</code> item of the 
7265             Class File Format.
7266           </description>
7267         </param>
7268       </parameters>
7269       <errors>
7270         <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 
7271           The class is a primitive or array class.
7272         </error>
7273       </errors>
7274     </function>
7275 
7276     <function id="GetConstantPool" phase="start" num="146" since="1.1">
7277       <synopsis>Get Constant Pool</synopsis>
7278       <description>
7279         For the class indicated by <code>klass</code>, 
7280         return the raw bytes of the constant pool in the format of the
7281         <code>constant_pool</code> item of 
7282         <vmspec chapter="4"/>.
7283         The format of the constant pool may differ between versions
7284         of the Class File Format, so, the 
7285         <functionlink id="GetClassVersionNumbers">minor and major 
7286         class version numbers</functionlink> should be checked for
7287         compatibility.
7288         <p/>
7289         The returned constant pool might not have the same layout or
7290         contents as the constant pool in the defining class file.
7291         The constant pool returned by GetConstantPool() may have
7292         more or fewer entries than the defining constant pool.
7293         Entries may be in a different order.
7294         The constant pool returned by GetConstantPool() will match the
7295         constant pool used by 
7296         <functionlink id="GetBytecodes">GetBytecodes()</functionlink>.
7297         That is, the bytecodes returned by GetBytecodes() will have
7298         constant pool indices which refer to constant pool entries returned
7299         by GetConstantPool().
7300         Note that since <functionlink id="RetransformClasses"/> 
7301         and <functionlink id="RedefineClasses"/> can change 
7302         the constant pool, the constant pool returned by this function
7303         can change accordingly.  Thus, the correspondence between 
7304         GetConstantPool() and GetBytecodes() does not hold if there
7305         is an intervening class retransformation or redefinition. 
7306         The value of a constant pool entry used by a given bytecode will
7307         match that of the defining class file (even if the indices don't match).
7308         Constant pool entries which are not used directly or indirectly by
7309         bytecodes (for example,  UTF-8 strings associated with annotations) are
7310         not  required to exist in the returned constant pool.
7311       </description>
7312       <origin>new</origin>
7313       <capabilities>
7314         <required id="can_get_constant_pool"></required>
7315       </capabilities>
7316       <parameters>
7317         <param id="klass">
7318           <jclass/>
7319             <description>
7320               The class to query.
7321             </description>
7322         </param>
7323         <param id="constant_pool_count_ptr">
7324           <outptr><jint/></outptr>
7325           <description>
7326             On return, points to the number of entries
7327             in the constant pool table plus one.
7328             This corresponds to the <code>constant_pool_count</code>
7329             item of the Class File Format.
7330           </description>
7331         </param>
7332         <param id="constant_pool_byte_count_ptr">
7333           <outptr><jint/></outptr>
7334           <description>
7335             On return, points to the number of bytes
7336             in the returned raw constant pool.
7337           </description>
7338         </param>
7339         <param id="constant_pool_bytes_ptr">
7340           <allocbuf outcount="constant_pool_byte_count_ptr"><uchar/></allocbuf>
7341             <description>
7342               On return, points to the raw constant pool, that is the bytes
7343               defined by the <code>constant_pool</code> item of the 
7344               Class File Format
7345             </description>
7346         </param>
7347       </parameters>
7348       <errors>
7349         <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 
7350           The class is a primitive or array class.
7351         </error>
7352       </errors>
7353     </function>
7354 
7355     <function id="IsInterface" phase="start" num="55">
7356       <synopsis>Is Interface</synopsis>
7357       <description>
7358         Determines whether a class object reference represents an interface.
7359         The <code>jboolean</code> result is
7360         <code>JNI_TRUE</code> if the "class" is actually an interface,
7361         <code>JNI_FALSE</code> otherwise. 
7362       </description>
7363       <origin>jvmdi</origin>
7364       <capabilities>
7365       </capabilities>
7366       <parameters>
7367         <param id="klass">
7368           <jclass/>
7369             <description>
7370               The class to query.
7371             </description>
7372         </param>
7373         <param id="is_interface_ptr">
7374           <outptr><jboolean/></outptr>
7375           <description>
7376             On return, points to the boolean result of this function.
7377 
7378           </description>
7379         </param>
7380       </parameters>
7381       <errors>
7382       </errors>
7383     </function>
7384 
7385     <function id="IsArrayClass" phase="start" num="56">
7386       <synopsis>Is Array Class</synopsis>
7387       <description>
7388         Determines whether a class object reference represents an array.
7389         The <code>jboolean</code> result is
7390         <code>JNI_TRUE</code> if the class is an array,
7391         <code>JNI_FALSE</code> otherwise. 
7392       </description>
7393       <origin>jvmdi</origin>
7394       <capabilities>
7395       </capabilities>
7396       <parameters>
7397         <param id="klass">
7398           <jclass/>
7399             <description>
7400               The class to query.
7401             </description>
7402         </param>
7403         <param id="is_array_class_ptr">
7404           <outptr><jboolean/></outptr>
7405           <description>
7406             On return, points to the boolean result of this function.
7407 
7408           </description>
7409         </param>
7410       </parameters>
7411       <errors>
7412       </errors>
7413     </function>
7414 
7415     <function id="IsModifiableClass" jkernel="yes" phase="start" num="45" since="1.1">
7416       <synopsis>Is Modifiable Class</synopsis>
7417       <description>
7418         Determines whether a class is modifiable.
7419         If a class is modifiable (<paramlink id="is_modifiable_class_ptr"/>
7420         returns <code>JNI_TRUE</code>) the class can be
7421         redefined with <functionlink id="RedefineClasses"/> (assuming 
7422         the agent possesses the
7423         <fieldlink id="can_redefine_classes" struct="jvmtiCapabilities"/>
7424         capability) or
7425         retransformed with <functionlink id="RetransformClasses"/> (assuming 
7426         the agent possesses the
7427         <fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
7428         capability).
7429         If a class is not modifiable (<paramlink id="is_modifiable_class_ptr"/>
7430         returns <code>JNI_FALSE</code>) the class can be neither
7431         redefined nor retransformed.
7432         <p/>
7433         Primitive classes (for example, <code>java.lang.Integer.TYPE</code>),
7434         array classes, and some implementation defined classes are never modifiable. 
7435         <p/>
7436       </description>
7437       <origin>new</origin>
7438       <capabilities>
7439         <capability id="can_redefine_any_class">
7440           If possessed then all classes (except primitive, array, and some implementation defined
7441           classes) are modifiable (redefine or retransform).
7442         </capability>
7443         <capability id="can_retransform_any_class">
7444           If possessed then all classes (except primitive, array, and some implementation defined
7445           classes) are modifiable with <functionlink id="RetransformClasses"/>.
7446         </capability>
7447         <capability id="can_redefine_classes">
7448           No effect on the result of the function.
7449           But must additionally be possessed to modify the class with
7450           <functionlink id="RedefineClasses"/>.
7451         </capability>
7452         <capability id="can_retransform_classes">
7453           No effect on the result of the function.
7454           But must additionally be possessed to modify the class with
7455           <functionlink id="RetransformClasses"/>.
7456         </capability>
7457       </capabilities>
7458       <parameters>
7459         <param id="klass">
7460           <jclass/>
7461             <description>
7462               The class to query.
7463             </description>
7464         </param>
7465         <param id="is_modifiable_class_ptr">
7466           <outptr><jboolean/></outptr>
7467           <description>
7468             On return, points to the boolean result of this function.
7469           </description>
7470         </param>
7471       </parameters>
7472       <errors>
7473       </errors>
7474     </function>
7475 
7476     <function id="GetClassLoader" phase="start" num="57">
7477       <synopsis>Get Class Loader</synopsis>
7478       <description>
7479         For the class indicated by <code>klass</code>, return via
7480         <code>classloader_ptr</code> a reference to the class loader for the
7481         class.
7482       </description>
7483       <origin>jvmdi</origin>
7484       <capabilities>
7485       </capabilities>
7486       <parameters>
7487         <param id="klass">
7488           <jclass/>
7489             <description>
7490               The class to query.
7491             </description>
7492         </param>
7493         <param id="classloader_ptr">
7494           <outptr><jobject/></outptr>
7495             <description>
7496               On return, points to the class loader that loaded
7497               this class.
7498               If the class was not created by a class loader
7499               or if the class loader is the bootstrap class loader,
7500               points to <code>NULL</code>.
7501             </description>
7502         </param>
7503       </parameters>
7504       <errors>
7505       </errors>
7506 
7507     </function>
7508 
7509     <function id="GetSourceDebugExtension" phase="start" num="90">
7510       <synopsis>Get Source Debug Extension</synopsis>
7511       <description>
7512         For the class indicated by <code>klass</code>, return the debug 
7513         extension via <code>source_debug_extension_ptr</code>.
7514         The returned string 
7515         contains exactly the debug extension information present in the
7516         class file of <code>klass</code>. 
7517       </description>
7518       <origin>jvmdi</origin>
7519       <capabilities>
7520         <required id="can_get_source_debug_extension"></required>
7521       </capabilities>
7522       <parameters>
7523         <param id="klass">
7524           <jclass/>
7525             <description>
7526               The class to query.
7527             </description>
7528         </param>
7529         <param id="source_debug_extension_ptr">
7530           <allocbuf><char/></allocbuf>
7531           <description>
7532             On return, points to the class's debug extension, encoded as a
7533             <internallink id="mUTF">modified UTF-8</internallink> string.
7534           </description>
7535         </param>
7536       </parameters>
7537       <errors>
7538         <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 
7539           Class information does not include a debug extension.
7540         </error>
7541       </errors>
7542     </function>
7543 
7544     <function id="RetransformClasses" jkernel="yes" num="152" since="1.1">
7545       <synopsis>Retransform Classes</synopsis>
7546       <description>
7547         This function facilitates the 
7548         <internallink id="bci">bytecode instrumentation</internallink>
7549         of already loaded classes.
7550         To replace the class definition without reference to the existing
7551         bytecodes, as one might do when recompiling from source for 
7552         fix-and-continue debugging, <functionlink id="RedefineClasses"/>
7553         function should be used instead.
7554         <p/>
7555         When classes are initially loaded or when they are 
7556         <functionlink id="RedefineClasses">redefined</functionlink>,
7557         the initial class file bytes can be transformed with the
7558         <eventlink id="ClassFileLoadHook"/> event.
7559         This function reruns the transformation process
7560         (whether or not a transformation has previously occurred).
7561         This retransformation follows these steps:
7562         <ul>
7563           <li>starting from the initial class file bytes 
7564           </li>
7565           <li>for each <fieldlink id="can_retransform_classes"
7566                      struct="jvmtiCapabilities">retransformation
7567                                                 incapable</fieldlink>
7568             agent which received a
7569             <code>ClassFileLoadHook</code> event during the previous
7570             load or redefine, the bytes it returned 
7571             (via the <code>new_class_data</code> parameter)
7572             are reused as the output of the transformation; 
7573             note that this is equivalent to reapplying
7574             the previous transformation, unaltered. except that
7575             the <code>ClassFileLoadHook</code> event
7576             is <b>not</b> sent to these agents
7577           </li>
7578           <li>for each <fieldlink id="can_retransform_classes"
7579                      struct="jvmtiCapabilities">retransformation
7580                                                 capable</fieldlink>
7581             agent, the <code>ClassFileLoadHook</code> event is sent,
7582             allowing a new transformation to be applied
7583           </li>
7584           <li>the transformed class file bytes are installed as the new
7585             definition of the class
7586           </li>
7587         </ul>
7588         See the <eventlink id="ClassFileLoadHook"/> event for more details.
7589         <p/>
7590         The initial class file bytes represent the bytes passed to 
7591         <code>ClassLoader.defineClass</code>
7592         or <code>RedefineClasses</code> (before any transformations
7593         were applied), however they may not exactly match them.
7594         The constant pool may differ in ways described in
7595         <functionlink id="GetConstantPool"/>.
7596         Constant pool indices in the bytecodes of methods will correspond.
7597         Some attributes may not be present.
7598         Where order is not meaningful, for example the order of methods,
7599         order may not be preserved.
7600         <p/>
7601         Retransformation can cause new versions of methods to be installed.
7602         Old method versions may become 
7603         <internallink id="obsoleteMethods">obsolete</internallink>
7604         The new method version will be used on new invokes.  
7605         If a method has active stack frames, those active frames continue to
7606         run the bytecodes of the original method version. 
7607         <p/>
7608         This function does not cause any initialization except that which 
7609         would occur under the customary JVM semantics.
7610         In other words, retransforming a class does not cause its initializers to be
7611         run. The values of static fields will remain as they were
7612         prior to the call.
7613         <p/>
7614         Threads need not be suspended.
7615         <p/>
7616         All breakpoints in the class are cleared.
7617         <p/>
7618         All attributes are updated.
7619         <p/>
7620         Instances of the retransformed class are not affected -- fields retain their
7621         previous values.  
7622         <functionlink id="GetTag">Tags</functionlink> on the instances are
7623         also unaffected.
7624         <p/>
7625         In response to this call, no events other than the
7626         <eventlink id="ClassFileLoadHook"/> event
7627         will be sent.
7628         <p/>
7629         The retransformation may change method bodies, the constant pool and attributes.
7630         The retransformation must not add, remove or rename fields or methods, change the 
7631         signatures of methods, change modifiers, or change inheritance.  
7632         These restrictions may be lifted in future versions.
7633         See the error return description below for information on error codes
7634         returned if an unsupported retransformation is attempted.
7635         The class file bytes are not verified or installed until they have passed
7636         through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7637         returned error code reflects the result of the transformations.
7638         If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7639         none of the classes to be retransformed will have a new definition installed.
7640         When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7641         all of the classes to be retransformed will have their new definitions installed.        
7642       </description>
7643       <origin>new</origin>
7644       <capabilities>
7645         <required id="can_retransform_classes"></required>
7646         <capability id="can_retransform_any_class"></capability>
7647       </capabilities>
7648       <parameters>
7649         <param id="class_count">
7650           <jint min="0"/>
7651           <description>
7652             The number of classes to be retransformed.
7653           </description>
7654         </param>
7655         <param id="classes">
7656           <inbuf incount="class_count"><jclass/></inbuf>
7657           <description>
7658             The array of classes to be retransformed.
7659           </description>
7660         </param>
7661       </parameters>
7662       <errors>
7663         <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7664           One of the <paramlink id="classes"/> cannot be modified. 
7665           See <functionlink id="IsModifiableClass"/>.
7666         </error>
7667         <error id="JVMTI_ERROR_INVALID_CLASS">
7668           One of the <paramlink id="classes"/> is not a valid class.
7669         </error>
7670         <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7671           A retransformed class file has a version number not supported by this VM.
7672         </error>
7673         <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7674           A retransformed class file is malformed (The VM would return a <code>ClassFormatError</code>).
7675         </error>
7676         <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7677           The retransformed class file definitions would lead to a circular definition 
7678           (the VM would return a <code>ClassCircularityError</code>).
7679         </error>
7680         <error id="JVMTI_ERROR_FAILS_VERIFICATION">
7681           The retransformed class file bytes fail verification.
7682         </error>
7683         <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7684           The class name defined in a retransformed class file is
7685           different from the name in the old class object.
7686         </error>
7687         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7688           A retransformed class file would require adding a method.
7689         </error>
7690         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7691           A retransformed class file changes a field.
7692         </error>
7693         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7694           A direct superclass is different for a retransformed class file,
7695           or the set of directly implemented
7696           interfaces is different.
7697         </error>
7698         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7699           A retransformed class file does not declare a method
7700           declared in the old class version.
7701         </error>
7702         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7703           A retransformed class file has different class modifiers.
7704         </error>
7705         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7706           A method in the retransformed class file has different modifiers
7707           than its counterpart in the old class version.
7708         </error>
7709       </errors>
7710     </function>
7711 
7712     <function id="RedefineClasses" jkernel="yes" num="87">
7713       <synopsis>Redefine Classes</synopsis>
7714       <typedef id="jvmtiClassDefinition" label="Class redefinition description">
7715         <field id="klass">
7716           <jclass/>
7717             <description>
7718               Class object for this class
7719             </description>
7720         </field>
7721         <field id="class_byte_count">
7722           <jint/>
7723           <description>
7724             Number of bytes defining class (below)
7725           </description>
7726         </field>
7727         <field id="class_bytes">
7728           <inbuf incount="class_byte_count"><uchar/></inbuf>
7729           <description>
7730             Bytes defining class (in <vmspec chapter="4"/>)
7731           </description>
7732         </field>
7733       </typedef>
7734       <description>
7735         All classes given are redefined according to the definitions
7736         supplied.
7737         This function is used to replace the definition of a class
7738         with a new definition, as might be needed in fix-and-continue
7739         debugging.
7740         Where the existing class file bytes are to be transformed, for 
7741         example in
7742         <internallink id="bci">bytecode instrumentation</internallink>,
7743         <functionlink id="RetransformClasses"/> should be used.
7744         <p/>
7745         Redefinition can cause new versions of methods to be installed.
7746         Old method versions may become 
7747         <internallink id="obsoleteMethods">obsolete</internallink>
7748         The new method version will be used on new invokes.  
7749         If a method has active stack frames, those active frames continue to
7750         run the bytecodes of the original method version. 
7751         If resetting of stack frames is desired, use 
7752         <functionlink id="PopFrame"></functionlink>
7753         to pop frames with obsolete method versions.
7754         <p/>
7755         This function does not cause any initialization except that which 
7756         would occur under the customary JVM semantics.
7757         In other words, redefining a class does not cause its initializers to be
7758         run. The values of static fields will remain as they were
7759         prior to the call.
7760         <p/>
7761         Threads need not be suspended.
7762         <p/>
7763         All breakpoints in the class are cleared.
7764         <p/>
7765         All attributes are updated.
7766         <p/>
7767         Instances of the redefined class are not affected -- fields retain their
7768         previous values.  
7769         <functionlink id="GetTag">Tags</functionlink> on the instances are
7770         also unaffected.
7771         <p/>
7772         In response to this call, the <jvmti/> event
7773         <eventlink id="ClassFileLoadHook">Class File Load Hook</eventlink>
7774         will be sent (if enabled), but no other <jvmti/> events will be sent.
7775         <p/>
7776         The redefinition may change method bodies, the constant pool and attributes.
7777         The redefinition must not add, remove or rename fields or methods, change the 
7778         signatures of methods, change modifiers, or change inheritance.  
7779         These restrictions may be lifted in future versions.
7780         See the error return description below for information on error codes
7781         returned if an unsupported redefinition is attempted.
7782         The class file bytes are not verified or installed until they have passed
7783         through the chain of <eventlink id="ClassFileLoadHook"/> events, thus the
7784         returned error code reflects the result of the transformations applied
7785         to the bytes passed into <paramlink id="class_definitions"/>.
7786         If any error code is returned other than <code>JVMTI_ERROR_NONE</code>,
7787         none of the classes to be redefined will have a new definition installed.
7788         When this function returns (with the error code of <code>JVMTI_ERROR_NONE</code>)
7789         all of the classes to be redefined will have their new definitions installed.        
7790       </description>
7791       <origin>jvmdi</origin>
7792       <capabilities>
7793         <required id="can_redefine_classes"></required>
7794         <capability id="can_redefine_any_class"></capability>
7795       </capabilities>
7796       <parameters>
7797         <param id="class_count">
7798           <jint min="0"/>
7799           <description>
7800             The number of classes specified in <code>class_definitions</code>
7801           </description>
7802         </param>
7803         <param id="class_definitions">
7804           <inbuf incount="class_count"><struct>jvmtiClassDefinition</struct></inbuf>
7805           <description>
7806             The array of new class definitions
7807           </description>
7808         </param>
7809       </parameters>
7810       <errors>
7811         <error id="JVMTI_ERROR_NULL_POINTER">
7812           One of <code>class_bytes</code> is <code>NULL</code>.
7813         </error>
7814         <error id="JVMTI_ERROR_UNMODIFIABLE_CLASS">
7815           An element of <code>class_definitions</code> cannot be modified.
7816           See <functionlink id="IsModifiableClass"/>.
7817         </error>
7818         <error id="JVMTI_ERROR_INVALID_CLASS">
7819           An element of <code>class_definitions</code> is not a valid class.
7820         </error>
7821         <error id="JVMTI_ERROR_UNSUPPORTED_VERSION">
7822           A new class file has a version number not supported by this VM.
7823         </error>
7824         <error id="JVMTI_ERROR_INVALID_CLASS_FORMAT">
7825           A new class file is malformed (The VM would return a <code>ClassFormatError</code>).
7826         </error>
7827         <error id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION">
7828           The new class file definitions would lead to a circular definition 
7829           (the VM would return a <code>ClassCircularityError</code>).
7830         </error>
7831         <error id="JVMTI_ERROR_FAILS_VERIFICATION">
7832           The class bytes fail verification.
7833         </error>
7834         <error id="JVMTI_ERROR_NAMES_DONT_MATCH">
7835           The class name defined in a new class file is
7836           different from the name in the old class object.
7837         </error>
7838         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED">
7839           A new class file would require adding a method.
7840         </error>
7841         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED">
7842           A new class version changes a field.
7843         </error>
7844         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED">
7845           A direct superclass is different for a new class
7846           version, or the set of directly implemented
7847           interfaces is different.
7848         </error>
7849         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED">
7850           A new class version does not declare a method
7851           declared in the old class version.
7852         </error>
7853         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED">
7854           A new class version has different modifiers.
7855         </error>
7856         <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED">
7857           A method in the new class version has different modifiers
7858           than its counterpart in the old class version.
7859         </error>
7860         <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
7861           A module cannot be modified.
7862           See <functionlink id="IsModifiableModule"/>.
7863         </error>
7864       </errors>
7865     </function>
7866 
7867   </category>
7868 
7869   <category id="object" label="Object">
7870 
7871     <function id="GetObjectSize" jkernel="yes" phase="start" num="154">
7872       <synopsis>Get Object Size</synopsis>
7873       <description>
7874         For the object indicated by <code>object</code>,
7875         return via <code>size_ptr</code> the size of the object.
7876         This size is an implementation-specific approximation of
7877         the amount of storage consumed by this object. 
7878         It may include some or all of the object's overhead, and thus
7879         is useful for comparison within an implementation but not
7880         between implementations.
7881         The estimate may change during a single invocation of the JVM.
7882       </description>
7883       <origin>new</origin>
7884       <capabilities>
7885       </capabilities>
7886       <parameters>
7887         <param id="object">
7888           <jobject/>
7889             <description>
7890               The object to query.
7891             </description>
7892         </param>
7893         <param id="size_ptr">
7894           <outptr><jlong/></outptr>
7895           <description>
7896             On return, points to the object's size in bytes.
7897           </description>
7898         </param>
7899       </parameters>
7900       <errors>
7901       </errors>
7902     </function>
7903 
7904     <function id="GetObjectHashCode" phase="start" num="58">
7905       <synopsis>Get Object Hash Code</synopsis>
7906       <description>
7907         For the object indicated by <code>object</code>,
7908         return via <code>hash_code_ptr</code> a hash code.
7909         This hash code could be used to maintain a hash table of object references,
7910         however, on some implementations this can cause significant performance 
7911         impacts--in most cases 
7912         <internallink id="Heap">tags</internallink> 
7913         will be a more efficient means of associating information with objects.
7914         This function guarantees 
7915         the same hash code value for a particular object throughout its life
7916       </description>
7917       <origin>jvmdi</origin>
7918       <capabilities>
7919       </capabilities>
7920       <parameters>
7921         <param id="object">
7922           <jobject/>
7923             <description>
7924               The object to query.
7925             </description>
7926         </param>
7927         <param id="hash_code_ptr">
7928           <outptr><jint/></outptr>
7929           <description>
7930             On return, points to the object's hash code.
7931           </description>
7932         </param>
7933       </parameters>
7934       <errors>
7935       </errors>
7936     </function>
7937 
7938     <function id="GetObjectMonitorUsage" num="59">
7939       <synopsis>Get Object Monitor Usage</synopsis>
7940       <typedef id="jvmtiMonitorUsage" label="Object monitor usage information">
7941         <field id="owner">
7942           <jthread/>
7943             <description>
7944               The thread owning this monitor, or <code>NULL</code> if unused
7945             </description>
7946         </field>
7947         <field id="entry_count">
7948           <jint/>
7949           <description>
7950             The number of times the owning thread has entered the monitor
7951           </description>
7952         </field>
7953         <field id="waiter_count">
7954           <jint/>
7955           <description>
7956             The number of threads waiting to own this monitor
7957           </description>
7958         </field>
7959         <field id="waiters">
7960           <allocfieldbuf><jthread/></allocfieldbuf>
7961             <description>
7962               The <code>waiter_count</code> waiting threads
7963             </description>
7964         </field>
7965         <field id="notify_waiter_count">
7966           <jint/>
7967           <description>
7968             The number of threads waiting to be notified by this monitor
7969           </description>
7970         </field>
7971         <field id="notify_waiters">
7972           <allocfieldbuf><jthread/></allocfieldbuf>
7973             <description>
7974               The <code>notify_waiter_count</code> threads waiting to be notified
7975             </description>
7976         </field>
7977       </typedef>
7978       <description>
7979         Get information about the object's monitor.
7980         The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure 
7981         are filled in with information about usage of the monitor.
7982           <todo>
7983             Decide and then clarify suspend requirements.
7984           </todo>
7985       </description>
7986       <origin>jvmdi</origin>
7987       <capabilities>
7988         <required id="can_get_monitor_info"></required>
7989       </capabilities>
7990       <parameters>
7991         <param id="object">
7992           <jobject/>
7993             <description>
7994               The object to query.
7995             </description>
7996         </param>
7997         <param id="info_ptr">
7998           <outptr><struct>jvmtiMonitorUsage</struct></outptr>
7999           <description>
8000             On return, filled with monitor information for the 
8001             specified object.
8002           </description>
8003         </param>
8004       </parameters>
8005       <errors>
8006       </errors>
8007     </function>
8008 
8009     <elide>
8010     <function id="GetObjectMonitors" num="116">
8011       <synopsis>Get Object Monitors</synopsis>
8012       <description>
8013         Return the list of object monitors.
8014         <p/>
8015         Note: details about each monitor can be examined with 
8016         <functionlink id="GetObjectMonitorUsage"></functionlink>.
8017       </description>
8018       <origin>new</origin>
8019       <capabilities>
8020         <required id="can_get_monitor_info"></required>
8021       </capabilities>
8022       <parameters>
8023         <param id="monitorCnt">
8024           <outptr><jint/></outptr>
8025           <description>
8026             On return, pointer to the number 
8027             of monitors returned in <code>monitors_ptr</code>.
8028           </description>
8029         </param>
8030         <param id="monitors_ptr">
8031           <allocbuf outcount="monitorCnt"><jobject/></allocbuf>
8032             <description>
8033               On return, pointer to the monitor list.
8034             </description>
8035         </param>
8036       </parameters>
8037       <errors>
8038       </errors>
8039     </function>
8040     </elide>
8041 
8042   </category>
8043 
8044   <category id="fieldCategory" label="Field">
8045 
8046     <intro>
8047     </intro>
8048 
8049     <function id="GetFieldName" phase="start" num="60">
8050       <synopsis>Get Field Name (and Signature)</synopsis>
8051       <description>
8052         For the field indicated by <paramlink id="klass"/> and <paramlink id="field"/>,
8053         return the field name via <paramlink id="name_ptr"/> and field signature via
8054         <paramlink id="signature_ptr"/>.
8055         <p/>
8056         Field signatures are defined in the
8057         <externallink id="docs/technotes/guides/jni/spec/jniTOC.html">JNI Specification</externallink>
8058         and are referred to as <code>field descriptors</code> in
8059         <vmspec chapter="4.3.2"/>.
8060       </description>
8061       <origin>jvmdiClone</origin>
8062       <capabilities>
8063       </capabilities>
8064       <parameters>
8065         <param id="klass">
8066           <jclass field="field"/>
8067             <description>
8068               The class of the field to query.
8069             </description>
8070         </param>
8071         <param id="field">
8072           <jfieldID class="klass"/>
8073             <description>
8074               The field to query.
8075             </description>
8076         </param>
8077         <param id="name_ptr">
8078           <allocbuf>
8079             <char/>
8080             <nullok>the name is not returned</nullok>
8081           </allocbuf>
8082           <description>
8083             On return, points to the field name, encoded as a
8084             <internallink id="mUTF">modified UTF-8</internallink> string.
8085           </description>
8086         </param>
8087         <param id="signature_ptr">
8088           <allocbuf>
8089             <char/>
8090             <nullok>the signature is not returned</nullok>
8091           </allocbuf>
8092           <description>
8093             On return, points to the field signature, encoded as a
8094             <internallink id="mUTF">modified UTF-8</internallink> string.
8095           </description>
8096         </param>
8097         <param id="generic_ptr">
8098           <allocbuf>
8099             <char/>           
8100             <nullok>the generic signature is not returned</nullok>
8101           </allocbuf>
8102           <description>
8103             On return, points to the generic signature of the field, encoded as a
8104             <internallink id="mUTF">modified UTF-8</internallink> string.
8105             If there is no generic signature attribute for the field, then,
8106             on return, points to <code>NULL</code>. 
8107           </description>
8108         </param>
8109       </parameters>
8110       <errors>
8111       </errors>
8112     </function>
8113 
8114     <function id="GetFieldDeclaringClass" phase="start" num="61">
8115       <synopsis>Get Field Declaring Class</synopsis>
8116       <description>
8117         For the field indicated by <code>klass</code> and <code>field</code>
8118         return the class that defined it via <code>declaring_class_ptr</code>.
8119         The declaring class will either be <code>klass</code>, a superclass, or
8120         an implemented interface.
8121       </description>
8122       <origin>jvmdi</origin>
8123       <capabilities>
8124       </capabilities>
8125       <parameters>
8126         <param id="klass">
8127           <jclass field="field"/>
8128             <description>
8129               The class to query.
8130             </description>
8131         </param>
8132         <param id="field">
8133           <jfieldID class="klass"/>
8134             <description>
8135               The field to query.
8136             </description>
8137         </param>
8138         <param id="declaring_class_ptr">
8139           <outptr><jclass/></outptr>
8140             <description>
8141               On return, points to the declaring class
8142             </description>
8143         </param>
8144       </parameters>
8145       <errors>
8146       </errors>
8147     </function>
8148 
8149     <function id="GetFieldModifiers" phase="start" num="62">
8150       <synopsis>Get Field Modifiers</synopsis>
8151       <description>
8152         For the field indicated by <code>klass</code> and <code>field</code>
8153         return the access flags via <code>modifiers_ptr</code>.
8154         Access flags are defined in <vmspec chapter="4"/>.
8155       </description>
8156       <origin>jvmdi</origin>
8157       <capabilities>
8158       </capabilities>
8159       <parameters>
8160         <param id="klass">
8161           <jclass field="field"/>
8162             <description>
8163               The class to query.
8164             </description>
8165         </param>
8166         <param id="field">
8167           <jfieldID class="klass"/>
8168             <description>
8169               The field to query.
8170             </description>
8171         </param>
8172         <param id="modifiers_ptr">
8173           <outptr><jint/></outptr>
8174           <description>
8175             On return, points to the access flags.
8176           </description>
8177         </param>
8178       </parameters>
8179       <errors>
8180       </errors>
8181     </function>
8182 
8183     <function id="IsFieldSynthetic" phase="start" num="63">
8184       <synopsis>Is Field Synthetic</synopsis>
8185       <description>
8186         For the field indicated by <code>klass</code> and <code>field</code>, return a
8187         value indicating whether the field is synthetic via <code>is_synthetic_ptr</code>.
8188         Synthetic fields are generated by the compiler but not present in the 
8189         original source code.
8190       </description>
8191       <origin>jvmdi</origin>
8192       <capabilities>
8193         <required id="can_get_synthetic_attribute"></required>
8194       </capabilities>
8195       <parameters>
8196         <param id="klass">
8197           <jclass field="field"/>
8198             <description>
8199               The class of the field to query.
8200             </description>
8201         </param>
8202         <param id="field">
8203           <jfieldID class="klass"/>
8204             <description>
8205               The field to query.
8206             </description>
8207         </param>
8208         <param id="is_synthetic_ptr">
8209           <outptr><jboolean/></outptr>
8210           <description>
8211             On return, points to the boolean result of this function.
8212           </description>
8213         </param>
8214       </parameters>
8215       <errors>
8216       </errors>
8217     </function>
8218 
8219   </category>
8220 
8221   <category id="method" label="Method">
8222 
8223     <intro>
8224       These functions provide information about a method (represented as a
8225       <typelink id="jmethodID"/>) and set how methods are processed.
8226     </intro>
8227 
8228     <intro id="obsoleteMethods" label="Obsolete Methods">
8229       The functions <functionlink id="RetransformClasses"/> and
8230       <functionlink id="RedefineClasses"/> can cause new versions
8231       of methods to be installed.
8232       An original version of a method is considered equivalent
8233       to the new version if:
8234       <ul>
8235         <li>their bytecodes are the same except for indices into the
8236           constant pool and </li>
8237         <li>the referenced constants are equal.</li>
8238       </ul>
8239       An original method version which is not equivalent to the
8240       new method version is called obsolete and is assigned a new method ID;
8241       the original method ID now refers to the new method version.
8242       A method ID can be tested for obsolescence with 
8243       <functionlink id="IsMethodObsolete"/>.
8244     </intro>
8245 
8246     <function id="GetMethodName" phase="start" num="64">
8247       <synopsis>Get Method Name (and Signature)</synopsis>
8248       <description>
8249         For the method indicated by <code>method</code>,
8250         return the method name via <code>name_ptr</code> and method signature via
8251         <code>signature_ptr</code>.
8252         <p/>
8253         Method signatures are defined in the
8254         <externallink id="docs/technotes/guides/jni/spec/jniTOC.html">JNI Specification</externallink>
8255         and are referred to as <code>method descriptors</code> in 
8256         <vmspec chapter="4.3.3"/>.
8257         Note this is different
8258         than method signatures as defined in the <i>Java Language Specification</i>.
8259       </description>
8260       <origin>jvmdiClone</origin>
8261       <capabilities>
8262       </capabilities>
8263       <parameters>
8264         <param id="method">
8265           <jmethodID/>
8266             <description>
8267               The method to query.
8268             </description>
8269         </param>
8270         <param id="name_ptr">
8271           <allocbuf>
8272             <char/>
8273             <nullok>the name is not returned</nullok>
8274           </allocbuf>
8275           <description>
8276             On return, points to the method name, encoded as a
8277             <internallink id="mUTF">modified UTF-8</internallink> string.
8278           </description>
8279         </param>
8280         <param id="signature_ptr">
8281           <allocbuf>
8282             <char/>
8283             <nullok>the signature is not returned</nullok>
8284           </allocbuf>
8285           <description>
8286             On return, points to the method signature, encoded as a
8287             <internallink id="mUTF">modified UTF-8</internallink> string.
8288           </description>
8289         </param>
8290         <param id="generic_ptr">
8291           <allocbuf>
8292             <char/>           
8293             <nullok>the generic signature is not returned</nullok>
8294           </allocbuf>
8295           <description>
8296             On return, points to the generic signature of the method, encoded as a
8297             <internallink id="mUTF">modified UTF-8</internallink> string.
8298             If there is no generic signature attribute for the method, then,
8299             on return, points to <code>NULL</code>. 
8300           </description>
8301         </param>
8302       </parameters>
8303       <errors>
8304       </errors>
8305     </function>
8306 
8307     <function id="GetMethodDeclaringClass" phase="start" num="65">
8308       <synopsis>Get Method Declaring Class</synopsis>
8309       <description>
8310         For the method indicated by <code>method</code>,
8311         return the class that defined it via <code>declaring_class_ptr</code>.
8312       </description>
8313       <origin>jvmdi</origin>
8314       <capabilities>
8315       </capabilities>
8316       <parameters>
8317         <param id="klass">
8318           <jclass method="method"/>
8319             <description>
8320               The class to query.
8321             </description>
8322         </param>
8323         <param id="method">
8324           <jmethodID class="klass"/>
8325             <description>
8326               The method to query.
8327             </description>
8328         </param>
8329         <param id="declaring_class_ptr">
8330           <outptr><jclass/></outptr>
8331             <description>
8332               On return, points to the declaring class
8333             </description>
8334         </param>
8335       </parameters>
8336       <errors>
8337       </errors>
8338     </function>
8339 
8340     <function id="GetMethodModifiers" phase="start" num="66">
8341       <synopsis>Get Method Modifiers</synopsis>
8342       <description>
8343         For the method indicated by <code>method</code>,
8344         return the access flags via <code>modifiers_ptr</code>.
8345         Access flags are defined in <vmspec chapter="4"/>.
8346       </description>
8347       <origin>jvmdi</origin>
8348       <capabilities>
8349       </capabilities>
8350       <parameters>
8351         <param id="klass">
8352           <jclass method="method"/>
8353             <description>
8354               The class to query.
8355             </description>
8356         </param>
8357         <param id="method">
8358           <jmethodID class="klass"/>
8359             <description>
8360               The method to query.
8361             </description>
8362         </param>
8363         <param id="modifiers_ptr">
8364           <outptr><jint/></outptr>
8365           <description>
8366             On return, points to the access flags.
8367           </description>
8368         </param>
8369       </parameters>
8370       <errors>
8371       </errors>
8372     </function>
8373 
8374     <function id="GetMaxLocals" phase="start" num="68">
8375       <synopsis>Get Max Locals</synopsis>
8376       <description>
8377           For the method indicated by <code>method</code>,
8378           return the number of local variable slots used by the method,
8379           including the local variables used to pass parameters to the
8380           method on its invocation. 
8381           <p/>
8382           See <code>max_locals</code> in <vmspec chapter="4.7.3"/>.
8383       </description>
8384       <origin>jvmdi</origin>
8385       <capabilities>
8386       </capabilities>
8387       <parameters>
8388         <param id="klass">
8389           <jclass method="method"/>
8390             <description>
8391               The class to query.
8392             </description>
8393         </param>
8394         <param id="method">
8395           <jmethodID class="klass" native="error"/>
8396             <description>
8397               The method to query.
8398             </description>
8399         </param>
8400         <param id="max_ptr">
8401           <outptr><jint/></outptr>
8402           <description>
8403             On return, points to the maximum number of local slots
8404           </description>
8405         </param>
8406       </parameters>
8407       <errors>
8408       </errors>
8409     </function>
8410 
8411     <function id="GetArgumentsSize" phase="start" num="69">
8412       <synopsis>Get Arguments Size</synopsis>
8413       <description>
8414         For the method indicated by <code>method</code>,
8415         return via <code>max_ptr</code> the number of local variable slots used
8416         by the method's arguments.
8417         Note that two-word arguments use two slots.
8418       </description>
8419       <origin>jvmdi</origin>
8420       <capabilities>
8421       </capabilities>
8422       <parameters>
8423         <param id="klass">
8424           <jclass method="method"/>
8425             <description>
8426               The class to query.
8427             </description>
8428         </param>
8429         <param id="method">
8430           <jmethodID class="klass" native="error"/>
8431             <description>
8432               The method to query.
8433             </description>
8434         </param>
8435         <param id="size_ptr">
8436           <outptr><jint/></outptr>
8437           <description>
8438             On return, points to the number of argument slots
8439           </description>
8440         </param>
8441       </parameters>
8442       <errors>
8443       </errors>
8444     </function>
8445 
8446     <function id="GetLineNumberTable" phase="start" num="70">
8447       <synopsis>Get Line Number Table</synopsis>
8448       <typedef id="jvmtiLineNumberEntry" label="Line number table entry">
8449         <field id="start_location">
8450           <jlocation/>
8451           <description>
8452             the <datalink id="jlocation"></datalink> where the line begins
8453           </description>
8454         </field>
8455         <field id="line_number">
8456           <jint/>
8457           <description>
8458             the line number
8459           </description>
8460         </field>
8461       </typedef>
8462       <description>
8463         For the method indicated by <code>method</code>,
8464         return a table of source line number entries. The size of the table is
8465         returned via <code>entry_count_ptr</code> and the table itself is
8466         returned via <code>table_ptr</code>. 
8467       </description>
8468       <origin>jvmdi</origin>
8469       <capabilities>
8470         <required id="can_get_line_numbers"></required>
8471       </capabilities>
8472       <parameters>
8473         <param id="klass">
8474           <jclass method="method"/>
8475             <description>
8476               The class to query.
8477             </description>
8478         </param>
8479         <param id="method">
8480           <jmethodID class="klass" native="error"/>
8481             <description>
8482               The method to query.
8483             </description>
8484         </param>
8485         <param id="entry_count_ptr">
8486           <outptr><jint/></outptr>
8487           <description>
8488             On return, points to the number of entries in the table
8489           </description>
8490         </param>
8491         <param id="table_ptr">
8492           <allocbuf outcount="entry_count_ptr"><struct>jvmtiLineNumberEntry</struct></allocbuf>
8493           <description>
8494             On return, points to the line number table pointer.
8495           </description>
8496         </param>
8497       </parameters>
8498       <errors>
8499         <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 
8500           Class information does not include line numbers.
8501         </error>
8502       </errors>
8503     </function>
8504 
8505     <function id="GetMethodLocation" phase="start" num="71">
8506       <synopsis>Get Method Location</synopsis>
8507       <description>
8508         For the method indicated by <code>method</code>,
8509         return the beginning and ending addresses through
8510         <code>start_location_ptr</code> and <code>end_location_ptr</code>. In a
8511         conventional byte code indexing scheme, 
8512         <code>start_location_ptr</code> will always point to zero
8513         and <code>end_location_ptr</code> 
8514         will always point to the byte code count minus one. 
8515       </description>
8516       <origin>jvmdi</origin>
8517       <capabilities>
8518       </capabilities>
8519       <parameters>
8520         <param id="klass">
8521           <jclass method="method"/>
8522             <description>
8523               The class to query.
8524             </description>
8525         </param>
8526         <param id="method">
8527           <jmethodID class="klass" native="error"/>
8528             <description>
8529               The method to query.
8530             </description>
8531         </param>
8532         <param id="start_location_ptr">
8533           <outptr><jlocation/></outptr>
8534           <description>
8535             On return, points to the first location, or 
8536             <code>-1</code> if location information is not available.
8537             If the information is available and 
8538             <functionlink id="GetJLocationFormat"></functionlink>
8539             returns <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>
8540             then this will always be zero.
8541           </description>
8542         </param>
8543         <param id="end_location_ptr">
8544           <outptr><jlocation/></outptr>
8545           <description>
8546             On return, points to the last location,
8547             or <code>-1</code> if location information is not available.
8548           </description>
8549         </param>
8550       </parameters>
8551       <errors>
8552         <error id="JVMTI_ERROR_ABSENT_INFORMATION"> 
8553           Class information does not include method sizes.
8554         </error>
8555       </errors>
8556     </function>
8557 
8558     <function id="GetLocalVariableTable" num="72">
8559       <synopsis>Get Local Variable Table</synopsis>
8560       <typedef id="jvmtiLocalVariableEntry" label="Local variable table entry">
8561         <field id="start_location">
8562           <jlocation/>
8563           <description>
8564             The code array index where the local variable is first valid
8565             (that is, where it must have a value).
8566           </description>
8567         </field>
8568         <field id="length">
8569           <jint/>
8570           <description>
8571             The length of the valid section for this local variable.
8572             The last code array index where the local variable is valid 
8573             is <code>start_location + length</code>.
8574           </description>
8575         </field>
8576         <field id="name">
8577           <allocfieldbuf><char/></allocfieldbuf>
8578           <description>
8579             The local variable name, encoded as a
8580             <internallink id="mUTF">modified UTF-8</internallink> string.
8581           </description>
8582         </field>
8583         <field id="signature">
8584           <allocfieldbuf><char/></allocfieldbuf>
8585           <description>
8586             The local variable's type signature, encoded as a
8587             <internallink id="mUTF">modified UTF-8</internallink> string.
8588             The signature format is the same as that defined in
8589             <vmspec chapter="4.3.2"/>.
8590           </description>
8591         </field>
8592         <field id="generic_signature">
8593           <allocfieldbuf><char/></allocfieldbuf>
8594           <description>
8595             The local variable's generic signature, encoded as a
8596             <internallink id="mUTF">modified UTF-8</internallink> string.
8597             The value of this field will be <code>NULL</code> for any local 
8598             variable which does not have a generic type.
8599           </description>
8600         </field>
8601         <field id="slot">
8602           <jint/>
8603           <description>
8604             The local variable's slot.  See <internallink id="local">Local Variables</internallink>.
8605           </description>
8606         </field>
8607       </typedef>
8608       <description>
8609         Return local variable information.
8610       </description>
8611       <origin>jvmdiClone</origin>
8612       <capabilities>
8613         <required id="can_access_local_variables"></required>
8614       </capabilities>
8615       <parameters>
8616         <param id="method">
8617           <jmethodID native="error"/>
8618             <description>
8619               The method to query.
8620             </description>
8621         </param>
8622         <param id="entry_count_ptr">
8623           <outptr><jint/></outptr>
8624           <description>
8625             On return, points to the number of entries in the table
8626           </description>
8627         </param>
8628         <param id="table_ptr">
8629           <allocbuf outcount="entry_count_ptr"><struct>jvmtiLocalVariableEntry</struct></allocbuf>
8630           <description>
8631             On return, points to an array of local variable table entries.
8632           </description>
8633         </param>
8634       </parameters>
8635       <errors>
8636         <error id="JVMTI_ERROR_ABSENT_INFORMATION">
8637           Class information does not include local variable
8638           information.
8639         </error>
8640       </errors>
8641     </function>
8642 
8643     <function id="GetBytecodes" phase="start" num="75">
8644       <synopsis>Get Bytecodes</synopsis>
8645       <description>
8646         For the method indicated by <code>method</code>,
8647         return the byte codes that implement the method. The number of
8648         bytecodes is returned via <code>bytecode_count_ptr</code>. The byte codes
8649         themselves are returned via <code>bytecodes_ptr</code>.
8650       </description>
8651       <origin>jvmdi</origin>
8652       <capabilities>
8653         <required id="can_get_bytecodes"></required>
8654       </capabilities>
8655       <parameters>
8656         <param id="klass">
8657           <jclass method="method"/>
8658             <description>
8659               The class to query.
8660             </description>
8661         </param>
8662         <param id="method">
8663           <jmethodID class="klass" native="error"/>
8664             <description>
8665               The method to query.
8666             </description>
8667         </param>
8668         <param id="bytecode_count_ptr">
8669           <outptr><jint/></outptr>
8670           <description>
8671             On return, points to the length of the byte code array
8672           </description>
8673         </param>
8674         <param id="bytecodes_ptr">
8675           <allocbuf outcount="bytecode_count_ptr"><uchar/></allocbuf>
8676           <description>
8677             On return, points to the pointer to the byte code array
8678           </description>
8679         </param>
8680       </parameters>
8681       <errors>
8682       </errors>
8683     </function>
8684 
8685     <function id="IsMethodNative" phase="start" num="76">
8686       <synopsis>Is Method Native</synopsis>
8687       <description>
8688         For the method indicated by <code>method</code>, return a
8689         value indicating whether the method is native via <code>is_native_ptr</code>
8690       </description>
8691       <origin>jvmdi</origin>
8692       <capabilities>
8693       </capabilities>
8694       <parameters>
8695         <param id="klass">
8696           <jclass method="method"/>
8697             <description>
8698               The class to query.
8699             </description>
8700         </param>
8701         <param id="method">
8702           <jmethodID class="klass"/>
8703             <description>
8704               The method to query.
8705             </description>
8706         </param>
8707         <param id="is_native_ptr">
8708           <outptr><jboolean/></outptr>
8709           <description>
8710             On return, points to the boolean result of this function.
8711           </description>
8712         </param>
8713       </parameters>
8714       <errors>
8715       </errors>
8716     </function>
8717 
8718     <function id="IsMethodSynthetic" phase="start" num="77">
8719       <synopsis>Is Method Synthetic</synopsis>
8720       <description>
8721         For the method indicated by <code>method</code>, return a
8722         value indicating whether the method is synthetic via <code>is_synthetic_ptr</code>.
8723         Synthetic methods are generated by the compiler but not present in the 
8724         original source code.
8725       </description>
8726       <origin>jvmdi</origin>
8727       <capabilities>
8728         <required id="can_get_synthetic_attribute"></required>
8729       </capabilities>
8730       <parameters>
8731         <param id="klass">
8732           <jclass method="method"/>
8733             <description>
8734               The class to query.
8735             </description>
8736         </param>
8737         <param id="method">
8738           <jmethodID class="klass"/>
8739             <description>
8740               The method to query.
8741             </description>
8742         </param>
8743         <param id="is_synthetic_ptr">
8744           <outptr><jboolean/></outptr>
8745           <description>
8746             On return, points to the boolean result of this function.
8747           </description>
8748         </param>
8749       </parameters>
8750       <errors>
8751       </errors>
8752     </function>
8753 
8754     <function id="IsMethodObsolete" phase="start" num="91">
8755       <synopsis>Is Method Obsolete</synopsis>
8756       <description>
8757         Determine if a method ID refers to an
8758         <internallink id="obsoleteMethods">obsolete</internallink>
8759         method version.
8760       </description>
8761       <origin>jvmdi</origin>
8762       <capabilities>
8763       </capabilities>
8764       <parameters>
8765         <param id="klass">
8766           <jclass method="method"/>
8767             <description>
8768               The class to query.
8769             </description>
8770         </param>
8771         <param id="method">
8772           <jmethodID class="klass"/>
8773             <description>
8774               The method ID to query.
8775             </description>
8776         </param>
8777         <param id="is_obsolete_ptr">
8778           <outptr><jboolean/></outptr>
8779           <description>
8780             On return, points to the boolean result of this function.
8781           </description>
8782         </param>
8783       </parameters>
8784       <errors>
8785       </errors>
8786     </function>
8787 
8788     <function id="SetNativeMethodPrefix" jkernel="yes" phase="any" num="73" since="1.1">
8789       <synopsis>Set Native Method Prefix</synopsis>
8790       <description>
8791         This function modifies the failure handling of
8792         native method resolution by allowing retry
8793         with a prefix applied to the name.
8794         When used with the 
8795         <eventlink id="ClassFileLoadHook">ClassFileLoadHook
8796         event</eventlink>, it enables native methods to be
8797         <internallink id="bci">instrumented</internallink>.
8798         <p/>
8799         Since native methods cannot be directly instrumented
8800         (they have no bytecodes), they must be wrapped with
8801         a non-native method which can be instrumented.
8802         For example, if we had:
8803         <example>
8804 native boolean foo(int x);</example>
8805         <p/>
8806         We could transform the class file (with the 
8807         ClassFileLoadHook event) so that this becomes:
8808         <example>
8809 boolean foo(int x) {
8810   <i>... record entry to foo ...</i>
8811   return wrapped_foo(x);
8812 }
8813 
8814 native boolean wrapped_foo(int x);</example>
8815         <p/>
8816         Where foo becomes a wrapper for the actual native method
8817         with the appended prefix "wrapped_".  Note that
8818         "wrapped_" would be a poor choice of prefix since it
8819         might conceivably form the name of an existing method
8820         thus something like "$$$MyAgentWrapped$$$_" would be
8821         better but would make these examples less readable.
8822         <p/>
8823         The wrapper will allow data to be collected on the native
8824         method call, but now the problem becomes linking up the  
8825         wrapped method with the native implementation.  
8826         That is, the method <code>wrapped_foo</code> needs to be 
8827         resolved to the native implementation of <code>foo</code>,
8828         which might be:
8829         <example>
8830 Java_somePackage_someClass_foo(JNIEnv* env, jint x)</example>
8831         <p/>
8832         This function allows the prefix to be specified and the
8833         proper resolution to occur.  
8834         Specifically, when the standard resolution fails, the
8835         resolution is retried taking the prefix into consideration.
8836         There are two ways that resolution occurs, explicit
8837         resolution with the JNI function <code>RegisterNatives</code>
8838         and the normal automatic resolution.  For 
8839         <code>RegisterNatives</code>, the VM will attempt this 
8840         association:
8841         <example>
8842 method(foo) -> nativeImplementation(foo)</example>
8843         <p/>
8844         When this fails, the resolution will be retried with
8845         the specified prefix prepended to the method name, 
8846         yielding the correct resolution:
8847         <example>
8848 method(wrapped_foo) -> nativeImplementation(foo)</example>
8849         <p/>
8850         For automatic resolution, the VM will attempt:
8851         <example>
8852 method(wrapped_foo) -> nativeImplementation(wrapped_foo)</example>
8853         <p/>
8854         When this fails, the resolution will be retried with
8855         the specified prefix deleted from the implementation name, 
8856         yielding the correct resolution:
8857         <example>
8858 method(wrapped_foo) -> nativeImplementation(foo)</example>
8859         <p/>
8860         Note that since the prefix is only used when standard
8861         resolution fails, native methods can be wrapped selectively.
8862         <p/>
8863         Since each <jvmti/> environment is independent and
8864         can do its own transformation of the bytecodes, more 
8865         than one layer of wrappers may be applied. Thus each
8866         environment needs its own prefix.  Since transformations
8867         are applied in order, the prefixes, if applied, will
8868         be applied in the same order.
8869         The order of transformation application is described in
8870         the <eventlink id="ClassFileLoadHook"/> event.
8871         Thus if three environments applied
8872         wrappers, <code>foo</code> might become 
8873         <code>$env3_$env2_$env1_foo</code>.  But if, say,
8874         the second environment did not apply a wrapper to
8875         <code>foo</code> it would be just 
8876         <code>$env3_$env1_foo</code>.  To be able to 
8877         efficiently determine the sequence of prefixes,
8878         an intermediate prefix is only applied if its non-native
8879         wrapper exists.  Thus, in the last example, even though 
8880         <code>$env1_foo</code> is not a native method, the
8881         <code>$env1_</code> prefix is applied since 
8882         <code>$env1_foo</code> exists.
8883         <p/>
8884         Since the prefixes are used at resolution time
8885         and since resolution may be arbitrarily delayed, a
8886         native method prefix must remain set as long as there 
8887         are corresponding prefixed native methods.
8888       </description>
8889       <origin>new</origin>
8890       <capabilities>
8891         <required id="can_set_native_method_prefix"></required>
8892       </capabilities>
8893       <parameters>
8894         <param id="prefix">
8895           <inbuf>
8896             <char/>
8897             <nullok>
8898               any existing prefix in this environment is cancelled
8899             </nullok>
8900           </inbuf>
8901           <description>
8902             The prefix to apply, encoded as a
8903             <internallink id="mUTF">modified UTF-8</internallink> string.
8904           </description>
8905         </param>
8906       </parameters>
8907       <errors>
8908       </errors>
8909     </function>
8910 
8911     <function id="SetNativeMethodPrefixes" jkernel="yes" phase="any" num="74" since="1.1">
8912       <synopsis>Set Native Method Prefixes</synopsis>
8913       <description>
8914          For a normal agent, <functionlink id="SetNativeMethodPrefix"/>
8915          will provide all needed native method prefixing.
8916          For a meta-agent that performs multiple independent class
8917          file transformations (for example as a proxy for another
8918          layer of agents) this function allows each transformation
8919          to have its own prefix.  
8920          The prefixes are applied in the order supplied and are
8921          processed in the same manor as described for the
8922          application of prefixes from multiple <jvmti/> environments
8923          in <functionlink id="SetNativeMethodPrefix"/>.
8924          <p/>
8925          Any previous prefixes are replaced.  Thus, calling this
8926          function with a <paramlink id="prefix_count"/> of <code>0</code>
8927          disables prefixing in this environment.
8928          <p/>
8929          <functionlink id="SetNativeMethodPrefix"/> and this function
8930          are the two ways to set the prefixes.  
8931          Calling <code>SetNativeMethodPrefix</code> with 
8932          a prefix is the same as calling this function with 
8933          <paramlink id="prefix_count"/> of <code>1</code>. 
8934          Calling <code>SetNativeMethodPrefix</code> with 
8935          <code>NULL</code> is the same as calling this function with 
8936          <paramlink id="prefix_count"/> of <code>0</code>. 
8937       </description>
8938       <origin>new</origin>
8939       <capabilities>
8940         <required id="can_set_native_method_prefix"></required>
8941       </capabilities>
8942       <parameters>
8943         <param id="prefix_count">
8944           <jint min="0"/>
8945             <description>
8946               The number of prefixes to apply.
8947             </description>
8948         </param>
8949         <param id="prefixes">
8950           <agentbuf>
8951             <char/>
8952           </agentbuf>
8953           <description>
8954             The prefixes to apply for this environment, each encoded as a
8955             <internallink id="mUTF">modified UTF-8</internallink> string.
8956           </description>
8957         </param>
8958       </parameters>
8959       <errors>
8960       </errors>
8961     </function>
8962 
8963   </category>
8964 
8965   <category id="RawMonitors" label="Raw Monitor">
8966 
8967     <function id="CreateRawMonitor" phase="onload" callbacksafe="safe" num="31">
8968       <synopsis>Create Raw Monitor</synopsis>
8969       <description>
8970         Create a raw monitor.
8971       </description>
8972       <origin>jvmdi</origin>
8973       <capabilities>
8974       </capabilities>
8975       <parameters>
8976         <param id="name">
8977           <inbuf><char/></inbuf>
8978           <description>
8979             A name to identify the monitor, encoded as a
8980             <internallink id="mUTF">modified UTF-8</internallink> string.
8981           </description>
8982         </param>
8983         <param id="monitor_ptr">
8984           <outptr><jrawMonitorID/></outptr>
8985           <description>
8986             On return, points to the created monitor.
8987           </description>
8988         </param>
8989       </parameters>
8990       <errors>
8991       </errors>
8992     </function>
8993 
8994     <function id="DestroyRawMonitor" phase="onload" callbacksafe="safe" num="32">
8995       <synopsis>Destroy Raw Monitor</synopsis>
8996       <description>
8997         Destroy the raw monitor.
8998         If the monitor being destroyed has been entered by this thread, it will be
8999         exited before it is destroyed.
9000         If the monitor being destroyed has been entered by another thread,
9001         an error will be returned and the monitor will not be destroyed.
9002       </description>
9003       <origin>jvmdi</origin>
9004       <capabilities>
9005       </capabilities>
9006       <parameters>
9007         <param id="monitor">
9008           <jrawMonitorID/>
9009           <description>
9010             The monitor
9011           </description>
9012         </param>
9013       </parameters>
9014       <errors>
9015         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 
9016           Not monitor owner
9017         </error>        
9018       </errors>
9019     </function>
9020 
9021     <function id="RawMonitorEnter" phase="any" callbacksafe="safe" impl="innative notrace" num="33">
9022       <synopsis>Raw Monitor Enter</synopsis>
9023       <description>
9024         Gain exclusive ownership of a raw monitor.  
9025         The same thread may enter a monitor more then once.
9026         The thread must
9027         <functionlink id="RawMonitorExit">exit</functionlink>
9028         the monitor the same number of times as it is entered.
9029         If a monitor is entered during <code>OnLoad</code> (before attached threads exist)
9030         and has not exited when attached threads come into existence, the enter
9031         is considered to have occurred on the main thread.
9032       </description>
9033       <origin>jvmdi</origin>
9034       <capabilities>
9035       </capabilities>
9036       <parameters>
9037         <param id="monitor">
9038           <jrawMonitorID/>
9039           <description>
9040             The monitor
9041           </description>
9042         </param>
9043       </parameters>
9044       <errors>
9045       </errors>
9046     </function>
9047 
9048     <function id="RawMonitorExit" phase="any" callbacksafe="safe" impl="innative notrace" num="34">
9049       <synopsis>Raw Monitor Exit</synopsis>
9050       <description>
9051         Release exclusive ownership of a raw monitor.
9052       </description>
9053       <origin>jvmdi</origin>
9054       <capabilities>
9055       </capabilities>
9056       <parameters>
9057         <param id="monitor">
9058           <jrawMonitorID/>
9059           <description>
9060             The monitor
9061           </description>
9062         </param>
9063       </parameters>
9064       <errors>
9065         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 
9066           Not monitor owner
9067         </error>
9068       </errors>
9069     </function>
9070 
9071     <function id="RawMonitorWait" phase="any" callbacksafe="safe" impl="innative notrace" num="35">
9072       <synopsis>Raw Monitor Wait</synopsis>
9073       <description>
9074         Wait for notification of the raw monitor.
9075         <p/>
9076         Causes the current thread to wait until either another thread calls 
9077         <functionlink id="RawMonitorNotify"/> or 
9078         <functionlink id="RawMonitorNotifyAll"/> 
9079         for the specified raw monitor, or the specified
9080         <paramlink id="millis">timeout</paramlink>
9081         has elapsed.
9082       </description>
9083       <origin>jvmdi</origin>
9084       <capabilities>
9085       </capabilities>
9086       <parameters>
9087         <param id="monitor">
9088           <jrawMonitorID/>
9089           <description>
9090             The monitor
9091           </description>
9092         </param>
9093         <param id="millis">
9094           <jlong/>
9095           <description>
9096             The timeout, in milliseconds.  If the timeout is
9097             zero, then real time is not taken into consideration
9098             and the thread simply waits until notified.
9099           </description>
9100         </param>
9101       </parameters>
9102       <errors>
9103         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 
9104           Not monitor owner
9105         </error>
9106         <error id="JVMTI_ERROR_INTERRUPT"> 
9107           Wait was interrupted, try again
9108         </error>
9109       </errors>
9110     </function>
9111 
9112     <function id="RawMonitorNotify" phase="any" callbacksafe="safe" impl="notrace" num="36">
9113       <synopsis>Raw Monitor Notify</synopsis>
9114       <description>
9115         Notify a single thread waiting on the raw monitor.
9116       </description>
9117       <origin>jvmdi</origin>
9118       <capabilities>
9119       </capabilities>
9120       <parameters>
9121         <param id="monitor">
9122           <jrawMonitorID/>
9123           <description>
9124             The monitor
9125           </description>
9126         </param>
9127       </parameters>
9128       <errors>
9129         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER">
9130           Not monitor owner
9131         </error>
9132       </errors>
9133     </function>
9134 
9135     <function id="RawMonitorNotifyAll" phase="any" callbacksafe="safe" impl="notrace" num="37">
9136       <synopsis>Raw Monitor Notify All</synopsis>
9137       <description>
9138         Notify all threads waiting on the raw monitor.
9139       </description>
9140       <origin>jvmdi</origin>
9141       <capabilities>
9142       </capabilities>
9143       <parameters>
9144         <param id="monitor">
9145           <jrawMonitorID/>
9146           <description>
9147             The monitor
9148           </description>
9149         </param>
9150       </parameters>
9151       <errors>
9152         <error id="JVMTI_ERROR_NOT_MONITOR_OWNER"> 
9153           Not monitor owner
9154         </error>
9155       </errors>
9156     </function>
9157 
9158    <elide>
9159     <function id="GetRawMonitorUse" num="118">
9160       <synopsis>Get Raw Monitor Use</synopsis>
9161       <description>
9162         The fields of the <functionlink id="jvmtiMonitorUsage"></functionlink> structure 
9163         are filled in with information about usage of the raw monitor.
9164       </description>
9165       <origin>new</origin>
9166       <capabilities>
9167         <required id="can_get_raw_monitor_usage"></required>
9168       </capabilities>
9169       <parameters>
9170         <param id="monitor">
9171           <jrawMonitorID/>
9172           <description>
9173             the raw monitor to query.
9174           </description>
9175         </param>
9176         <param id="info_ptr">
9177           <outptr><struct>jvmtiMonitorUsage</struct></outptr>
9178           <description>
9179             On return, filled with monitor information for the 
9180             specified raw monitor.
9181           </description>
9182         </param>
9183       </parameters>
9184       <errors>
9185       </errors>
9186     </function>
9187 
9188     <function id="GetRawMonitors" num="119">
9189       <synopsis>Get Raw Monitors</synopsis>
9190       <description>
9191         Return the list of raw monitors.
9192         <p/>
9193         Note: details about each monitor can be examined with 
9194         <functionlink id="GetRawMonitorUse"></functionlink>.
9195       </description>
9196       <origin>new</origin>
9197       <capabilities>
9198         <required id="can_get_raw_monitor_usage"></required>
9199       </capabilities>
9200       <parameters>
9201         <param id="monitorCnt">
9202           <outptr><jint/></outptr>
9203           <description>
9204             On return, pointer to the number 
9205             of monitors returned in <code>monitors_ptr</code>.
9206           </description>
9207         </param>
9208         <param id="monitors_ptr">
9209           <allocbuf outcount="monitorCnt"><jrawMonitorID/></allocbuf>
9210           <description>
9211             On return, pointer to the monitor list.
9212           </description>
9213         </param>
9214       </parameters>
9215       <errors>
9216       </errors>
9217     </function>
9218     </elide>
9219   </category>
9220 
9221   <category id="jniIntercept" label="JNI Function Interception">
9222 
9223     <intro>
9224       Provides the ability to intercept and resend 
9225       Java Native Interface (JNI) function calls
9226       by manipulating the JNI function table.
9227       See <externallink id="docs/technotes/guides/jni/spec/functions.html">JNI
9228         Functions</externallink> in the <i>Java Native Interface Specification</i>.
9229       <p/>
9230       The following example illustrates intercepting the 
9231       <code>NewGlobalRef</code> JNI call in order to count reference
9232       creation.
9233       <example>
9234 JNIEnv original_jni_Functions;
9235 JNIEnv redirected_jni_Functions;
9236 int my_global_ref_count = 0;
9237 
9238 jobject
9239 MyNewGlobalRef(JNIEnv *jni_env, jobject lobj) {
9240    ++my_global_ref_count;
9241    return originalJNIFunctions-&gt;NewGlobalRef(env, lobj);
9242 }
9243 
9244 void
9245 myInit() {
9246    jvmtiError err;
9247 
9248    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;original_jni_Functions);
9249    if (err != JVMTI_ERROR_NONE) {
9250       die();
9251    }
9252    err = (*jvmti_env)-&gt;GetJNIFunctionTable(jvmti_env, &amp;redirected_jni_Functions);
9253    if (err != JVMTI_ERROR_NONE) {
9254       die();
9255    }
9256    redirectedJNIFunctions-&gt;NewGlobalRef = MyNewGlobalRef;
9257       err = (*jvmti_env)-&gt;SetJNIFunctionTable(jvmti_env, redirected_jni_Functions);
9258    if (err != JVMTI_ERROR_NONE) {
9259       die();
9260    }
9261 }
9262       </example>
9263       Sometime after <code>myInit</code> is called the user's JNI
9264       code is executed which makes the call to create a new global
9265       reference.  Instead of going to the normal JNI implementation
9266       the call goes to <code>myNewGlobalRef</code>.  Note that a
9267       copy of the original function table is kept so that the normal
9268       JNI function can be called after the data is collected.
9269       Note also that any JNI functions which are not overwritten
9270       will behave normally.
9271       <todo>
9272         check that the example compiles and executes.
9273       </todo>
9274     </intro>
9275     
9276     <function id="SetJNIFunctionTable" phase="start" num="120">
9277       <synopsis>Set JNI Function Table</synopsis>
9278       <description>
9279         Set the JNI function table 
9280         in all current and future JNI environments.
9281         As a result, all future JNI calls are directed to the specified functions.
9282         Use <functionlink id="GetJNIFunctionTable"></functionlink> to get the
9283         function table to pass to this function.
9284         For this function to take effect the the updated table entries must be 
9285         used by the JNI clients.
9286         Since the table is defined <code>const</code> some compilers may optimize
9287         away the access to the table, thus preventing this function from taking 
9288         effect.
9289         The table is copied--changes to the local copy of the
9290         table have no effect.
9291         This function affects only the function table, all other aspects of the environment are
9292         unaffected.
9293         See the examples <internallink id="jniIntercept">above</internallink>.
9294       </description>
9295       <origin>new</origin>
9296       <capabilities>
9297       </capabilities>
9298       <parameters>
9299         <param id="function_table">
9300           <inptr>
9301             <struct>jniNativeInterface</struct>
9302           </inptr>
9303           <description>
9304             Points to the new JNI function table.
9305           </description>
9306         </param>
9307       </parameters>
9308       <errors>
9309       </errors>
9310     </function>
9311     
9312     <function id="GetJNIFunctionTable" phase="start" num="121">
9313       <synopsis>Get JNI Function Table</synopsis>
9314       <description>
9315         Get the JNI function table.
9316         The JNI function table is copied into allocated memory.
9317         If <functionlink id="SetJNIFunctionTable"></functionlink> 
9318         has been called, the modified (not the original) function
9319         table is returned.
9320         Only the function table is copied, no other aspects of the environment 
9321         are copied.
9322         See the examples <internallink id="jniIntercept">above</internallink>.
9323       </description>
9324       <origin>new</origin>
9325       <capabilities>
9326       </capabilities>
9327       <parameters>
9328         <param id="function_table">
9329           <allocbuf>
9330             <struct>jniNativeInterface</struct>
9331           </allocbuf>
9332           <description>
9333             On return, <code>*function_table</code> 
9334             points a newly allocated copy of the JNI function table.
9335           </description>
9336         </param>
9337       </parameters>
9338       <errors>
9339       </errors>
9340     </function>
9341 
9342   </category>
9343 
9344   <category id="eventManagement" label="Event Management">
9345 
9346     <function id="SetEventCallbacks" jkernel="yes" phase="onload" num="122">
9347       <synopsis>Set Event Callbacks</synopsis>
9348       <description>
9349         Set the functions to be called for each event.
9350         The callbacks are specified by supplying a replacement function table.
9351         The function table is copied--changes to the local copy of the
9352         table have no effect.
9353         This is an atomic action, all callbacks are set at once.
9354         No events are sent before this function is called.
9355         When an entry is <code>NULL</code> or when the event is beyond 
9356         <paramlink id="size_of_callbacks"></paramlink> no event is sent.
9357         Details on events are 
9358         described <internallink id="EventSection">later</internallink> in this document.
9359         An event must be enabled and have a callback in order to be
9360         sent--the order in which this function and 
9361         <functionlink id="SetEventNotificationMode"></functionlink> 
9362         are called does not affect the result.
9363       </description>
9364       <origin>new</origin>
9365       <capabilities>
9366       </capabilities>
9367       <parameters>
9368         <param id="callbacks">
9369           <inptr>
9370             <struct>jvmtiEventCallbacks</struct>
9371             <nullok>remove the existing callbacks</nullok>
9372           </inptr>
9373           <description>
9374             The new event callbacks.
9375           </description>
9376         </param>
9377         <param id="size_of_callbacks">
9378           <jint min="0"/>
9379           <description>
9380             <code>sizeof(jvmtiEventCallbacks)</code>--for version
9381             compatibility.
9382           </description>
9383         </param>
9384       </parameters>
9385       <errors>
9386       </errors>
9387     </function>
9388 
9389     <function id="SetEventNotificationMode" jkernel="yes" phase="onload" num="2">
9390       <synopsis>Set Event Notification Mode</synopsis>
9391       <description>
9392         Control the generation of events. 
9393         <constants id="jvmtiEventMode" label="Event Enable/Disable" kind="enum">
9394           <constant id="JVMTI_ENABLE" num="1">
9395             If <paramlink id="mode"></paramlink> is <code>JVMTI_ENABLE</code>, 
9396             the event <paramlink id="event_type"></paramlink> will be enabled
9397           </constant>
9398           <constant id="JVMTI_DISABLE" num="0">
9399             If <paramlink id="mode"></paramlink> is <code>JVMTI_DISABLE</code>, 
9400             the event <paramlink id="event_type"></paramlink> will be disabled
9401           </constant>
9402         </constants>
9403         If <code>thread</code> is <code>NULL</code>,
9404         the event is enabled or disabled globally; otherwise, it is 
9405         enabled or disabled for a particular thread. 
9406         An event is generated for 
9407         a particular thread if it is enabled either at the thread or global
9408         levels. 
9409         <p/>
9410         See <internallink id="EventIndex">below</internallink> for information on specific events.
9411         <p/>
9412         The following events cannot be controlled at the thread
9413         level through this function. 
9414         <ul>
9415           <li><eventlink id="VMInit"></eventlink></li>
9416           <li><eventlink id="VMStart"></eventlink></li>
9417           <li><eventlink id="VMDeath"></eventlink></li>
9418           <li><eventlink id="ThreadStart"></eventlink></li>
9419           <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9420           <li><eventlink id="CompiledMethodUnload"></eventlink></li>
9421           <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9422           <li><eventlink id="DataDumpRequest"></eventlink></li>
9423         </ul>
9424         <p/>
9425         Initially, no events are enabled at either the thread level 
9426         or the global level.
9427         <p/>
9428         Any needed capabilities (see Event Enabling Capabilities below) must be possessed
9429         before calling this function.
9430         <p/>
9431         Details on events are 
9432         described <internallink id="EventSection">below</internallink>.
9433       </description>
9434       <origin>jvmdiClone</origin>
9435       <eventcapabilities></eventcapabilities>
9436       <parameters>
9437         <param id="mode">
9438           <enum>jvmtiEventMode</enum>
9439           <description>
9440             <code>JVMTI_ENABLE</code> or <code>JVMTI_DISABLE</code>
9441           </description>
9442         </param>
9443         <param id="event_type">
9444           <enum>jvmtiEvent</enum>
9445           <description>
9446             the event to control
9447           </description>
9448         </param>
9449         <param id="event_thread">
9450           <ptrtype>
9451             <jthread impl="noconvert"/>
9452             <nullok>event is controlled at the global level</nullok>
9453           </ptrtype>
9454             <description>
9455               The thread to control
9456             </description>
9457         </param>
9458         <param id="...">
9459           <varargs/>
9460             <description>
9461               for future expansion
9462             </description>
9463         </param>
9464       </parameters>
9465       <errors>
9466         <error id="JVMTI_ERROR_INVALID_THREAD">
9467           <paramlink id="event_thread"/> is non-<code>NULL</code> and is not a valid thread.
9468         </error>
9469         <error id="JVMTI_ERROR_THREAD_NOT_ALIVE">
9470           <paramlink id="event_thread"/> is non-<code>NULL</code> and is not live (has not been started or is now dead).
9471         </error>
9472         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
9473           thread level control was attempted on events which do not 
9474           permit thread level control.
9475         </error>
9476         <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY"> 
9477           The Required Event Enabling Capability is not possessed.
9478         </error>
9479       </errors>
9480     </function>
9481 
9482     <function id="GenerateEvents" num="123">
9483       <synopsis>Generate Events</synopsis>
9484       <description>
9485         Generate events to represent the current state of the VM.  
9486         For example, if <paramlink id="event_type"/> is 
9487         <code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code>,
9488         a <eventlink id="CompiledMethodLoad"></eventlink> event will be
9489         sent for each currently compiled method.
9490         Methods that were loaded and now have been unloaded are not sent.
9491         The history of what events have previously been sent does not 
9492         effect what events are sent by this function--for example, 
9493         all currently compiled methods
9494         will be sent each time this function is called.
9495         <p/>
9496         This function is useful when
9497         events may have been missed due to the agent attaching after program
9498         execution begins; this function generates the missed events.
9499         <p/>
9500         Attempts to execute Java programming language code or
9501         JNI functions may be paused until this function returns -
9502         so neither should be called from the thread sending the event.
9503         This function returns only after the missed events have been 
9504         sent, processed and have returned.
9505         The event may be sent on a different thread than the thread
9506         on which the event occurred.
9507         The callback for the event must be set with 
9508         <functionlink id="SetEventCallbacks"></functionlink> 
9509         and the event must be enabled with
9510         <functionlink id="SetEventNotificationMode"></functionlink> 
9511         or the events will not occur.
9512         If the VM no longer has the information to generate some or
9513         all of the requested events, the events are simply not sent -
9514         no error is returned.
9515         <p/>
9516         Only the following events are supported:
9517         <ul>
9518           <li><eventlink id="CompiledMethodLoad"></eventlink></li>
9519           <li><eventlink id="DynamicCodeGenerated"></eventlink></li>
9520         </ul>
9521       </description>
9522       <origin>new</origin>
9523       <capabilities>
9524         <capability id="can_generate_compiled_method_load_events"></capability>
9525       </capabilities>
9526       <parameters>
9527         <param id="event_type">
9528           <enum>jvmtiEvent</enum>
9529           <description>
9530             The type of event to generate.  Must be one of these:
9531             <ul>
9532               <li><eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink></li>
9533               <li><eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink></li>
9534             </ul>
9535           </description>
9536         </param>
9537       </parameters>
9538       <errors>
9539         <error id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY"> 
9540           <paramlink id="event_type"/> is 
9541           <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9542           and <fieldlink id="can_generate_compiled_method_load_events" struct="jvmtiCapabilities"></fieldlink>
9543           is <code>false</code>.
9544         </error>
9545         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 
9546           <paramlink id="event_type"/> is other than
9547           <eventlink id="CompiledMethodLoad"><code>JVMTI_EVENT_COMPILED_METHOD_LOAD</code></eventlink>
9548           or <eventlink id="DynamicCodeGenerated"><code>JVMTI_EVENT_DYNAMIC_CODE_GENERATED</code></eventlink>.
9549         </error>
9550       </errors>
9551     </function>
9552 
9553   </category>
9554 
9555     <category id="extension" label="Extension Mechanism">
9556 
9557       <intro>
9558         These functions
9559         allow a <jvmti/> implementation to provide functions and events
9560         beyond those defined in this specification.
9561         <p/>
9562         Both extension functions and extension events have parameters
9563         each of which has a 'type' and 'kind' chosen from the following tables:
9564 
9565         <constants id="jvmtiParamTypes" label="Extension Function/Event Parameter Types" kind="enum">
9566           <constant id="JVMTI_TYPE_JBYTE" num="101">
9567             Java programming language primitive type - <code>byte</code>. 
9568             JNI type <code>jbyte</code>.
9569           </constant>
9570           <constant id="JVMTI_TYPE_JCHAR" num="102">
9571             Java programming language primitive type - <code>char</code>. 
9572             JNI type <code>jchar</code>.
9573           </constant>
9574           <constant id="JVMTI_TYPE_JSHORT" num="103">
9575             Java programming language primitive type - <code>short</code>. 
9576             JNI type <code>jshort</code>.
9577           </constant>
9578           <constant id="JVMTI_TYPE_JINT" num="104">
9579             Java programming language primitive type - <code>int</code>. 
9580             JNI type <datalink id="jint"></datalink>.
9581           </constant>
9582           <constant id="JVMTI_TYPE_JLONG" num="105">
9583             Java programming language primitive type - <code>long</code>. 
9584             JNI type <datalink id="jlong"></datalink>.
9585           </constant>
9586           <constant id="JVMTI_TYPE_JFLOAT" num="106">
9587             Java programming language primitive type - <code>float</code>. 
9588             JNI type <datalink id="jfloat"></datalink>.
9589           </constant>
9590           <constant id="JVMTI_TYPE_JDOUBLE" num="107">
9591             Java programming language primitive type - <code>double</code>. 
9592             JNI type <datalink id="jdouble"></datalink>.
9593           </constant>
9594           <constant id="JVMTI_TYPE_JBOOLEAN" num="108">
9595             Java programming language primitive type - <code>boolean</code>. 
9596             JNI type <datalink id="jboolean"></datalink>.
9597           </constant>
9598           <constant id="JVMTI_TYPE_JOBJECT" num="109">
9599             Java programming language object type - <code>java.lang.Object</code>. 
9600             JNI type <datalink id="jobject"></datalink>.
9601             Returned values are JNI local references and must be managed.
9602           </constant>
9603           <constant id="JVMTI_TYPE_JTHREAD" num="110">
9604             Java programming language object type - <code>java.lang.Thread</code>. 
9605             <jvmti/> type <datalink id="jthread"></datalink>.
9606             Returned values are JNI local references and must be managed.
9607           </constant>
9608           <constant id="JVMTI_TYPE_JCLASS" num="111">
9609             Java programming language object type - <code>java.lang.Class</code>. 
9610             JNI type <datalink id="jclass"></datalink>.
9611             Returned values are JNI local references and must be managed.
9612           </constant>
9613           <constant id="JVMTI_TYPE_JVALUE" num="112">
9614             Union of all Java programming language primitive and object types - 
9615             JNI type <datalink id="jvalue"></datalink>.
9616             Returned values which represent object types are JNI local references and must be managed.
9617           </constant>
9618           <constant id="JVMTI_TYPE_JFIELDID" num="113">
9619             Java programming language field identifier - 
9620             JNI type <datalink id="jfieldID"></datalink>.
9621           </constant>
9622           <constant id="JVMTI_TYPE_JMETHODID" num="114">
9623             Java programming language method identifier - 
9624             JNI type <datalink id="jmethodID"></datalink>.
9625           </constant>
9626           <constant id="JVMTI_TYPE_CCHAR" num="115">
9627             C programming language type - <code>char</code>.
9628           </constant>
9629           <constant id="JVMTI_TYPE_CVOID" num="116">
9630             C programming language type - <code>void</code>.
9631           </constant>
9632           <constant id="JVMTI_TYPE_JNIENV" num="117">
9633             JNI environment - <code>JNIEnv</code>.
9634             Should be used with the correct <datalink id="jvmtiParamKind"/> to make it a pointer type.
9635           </constant>
9636         </constants>
9637 
9638         <constants id="jvmtiParamKind" label="Extension Function/Event Parameter Kinds" kind="enum">
9639           <constant id="JVMTI_KIND_IN" num="91">
9640             Ingoing argument - <code>foo</code>.
9641           </constant>
9642           <constant id="JVMTI_KIND_IN_PTR" num="92">
9643             Ingoing pointer argument - <code>const foo*</code>.
9644           </constant>
9645           <constant id="JVMTI_KIND_IN_BUF" num="93">
9646             Ingoing array argument - <code>const foo*</code>.
9647           </constant>
9648           <constant id="JVMTI_KIND_ALLOC_BUF" num="94">
9649             Outgoing allocated array argument -  <code>foo**</code>.
9650             Free with <code>Deallocate</code>.
9651           </constant>
9652           <constant id="JVMTI_KIND_ALLOC_ALLOC_BUF" num="95">
9653             Outgoing allocated array of allocated arrays argument - <code>foo***</code>.
9654             Free with <code>Deallocate</code>.
9655           </constant>
9656           <constant id="JVMTI_KIND_OUT" num="96">
9657             Outgoing argument - <code>foo*</code>.
9658           </constant>
9659           <constant id="JVMTI_KIND_OUT_BUF" num="97">
9660             Outgoing array argument (pre-allocated by agent) - <code>foo*</code>.
9661             Do not <code>Deallocate</code>.
9662           </constant>
9663         </constants>
9664 
9665       </intro>
9666 
9667       <typedef id="jvmtiParamInfo" label="Extension Function/Event Parameter Info">
9668         <field id="name">
9669           <allocfieldbuf><char/></allocfieldbuf>
9670             <description>
9671               The parameter name, encoded as a
9672               <internallink id="mUTF">modified UTF-8</internallink> string
9673             </description>
9674         </field>
9675         <field id="kind">
9676           <enum>jvmtiParamKind</enum>
9677           <description>
9678             The kind of the parameter - type modifiers
9679           </description>
9680         </field>
9681         <field id="base_type">
9682           <enum>jvmtiParamTypes</enum>
9683           <description>
9684             The base type of the parameter -  modified by <code>kind</code>
9685           </description>
9686         </field>
9687         <field id="null_ok">
9688           <jboolean/>
9689             <description>
9690               Is a <code>NULL</code> argument permitted? Applies only to pointer and object types.
9691             </description>
9692         </field>
9693       </typedef>
9694 
9695       <callback id="jvmtiExtensionFunction">
9696         <enum>jvmtiError</enum>
9697           <synopsis>Extension Function</synopsis>
9698         <description>
9699           This is the implementation-specific extension function.
9700         </description>
9701         <parameters>
9702           <param id="jvmti_env">
9703             <outptr>
9704               <struct>jvmtiEnv</struct>
9705             </outptr>
9706             <description>
9707               The <jvmti/> environment is the only fixed parameter for extension functions.
9708             </description>
9709           </param>
9710           <param id="...">
9711             <varargs/>
9712               <description>
9713                 The extension function-specific parameters
9714               </description>
9715           </param>
9716         </parameters>
9717       </callback>
9718 
9719       <function id="GetExtensionFunctions" phase="onload" num="124">
9720         <synopsis>Get Extension Functions</synopsis>
9721 
9722         <typedef id="jvmtiExtensionFunctionInfo" label="Extension Function Info">
9723           <field id="func">
9724             <ptrtype>
9725               <struct>jvmtiExtensionFunction</struct>
9726             </ptrtype>
9727             <description>
9728               The actual function to call
9729             </description>
9730           </field>
9731           <field id="id">
9732             <allocfieldbuf><char/></allocfieldbuf>
9733               <description>
9734                 The identifier for the extension function, encoded as a
9735                 <internallink id="mUTF">modified UTF-8</internallink> string.
9736                 Uses package name conventions.
9737                 For example, <code>com.sun.hotspot.bar</code>
9738               </description>
9739           </field>
9740           <field id="short_description">
9741             <allocfieldbuf><char/></allocfieldbuf>
9742               <description>
9743                 A one sentence description of the function, encoded as a
9744                 <internallink id="mUTF">modified UTF-8</internallink> string.
9745               </description>
9746           </field>
9747           <field id="param_count">
9748             <jint/>
9749               <description>
9750                 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
9751               </description>
9752           </field>
9753           <field id="params">
9754             <allocfieldbuf outcount="param_count">
9755               <struct>jvmtiParamInfo</struct>
9756             </allocfieldbuf>
9757             <description>
9758               Array of 
9759               <fieldlink id="param_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
9760               parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
9761             </description>
9762           </field>
9763           <field id="error_count">
9764             <jint/>
9765               <description>
9766                 The number of possible error returns (excluding universal errors)
9767               </description>
9768           </field>
9769           <field id="errors">
9770             <allocfieldbuf outcount="error_count">
9771               <enum>jvmtiError</enum>
9772             </allocfieldbuf>
9773             <description>
9774               Array of <fieldlink id="error_count" struct="jvmtiExtensionFunctionInfo"></fieldlink>
9775               possible errors
9776             </description>
9777           </field>
9778         </typedef>
9779 
9780         <description>
9781           Returns the set of extension functions.
9782         </description>
9783         <origin>new</origin>
9784         <capabilities>
9785         </capabilities>
9786         <parameters>
9787           <param id="extension_count_ptr">
9788             <outptr><jint/></outptr>
9789               <description>
9790                 On return, points to the number of extension functions
9791               </description>
9792           </param>
9793           <param id="extensions">
9794             <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionFunctionInfo</struct></allocbuf>
9795             <description>
9796               Returns an array of extension function info, one per function
9797             </description>
9798           </param>
9799         </parameters>
9800         <errors>
9801         </errors>
9802       </function>
9803 
9804       <function id="GetExtensionEvents" phase="onload" num="125">
9805         <synopsis>Get Extension Events</synopsis>
9806 
9807         <typedef id="jvmtiExtensionEventInfo" label="Extension Event Info">
9808           <field id="extension_event_index">
9809             <jint/>
9810             <description>
9811               The identifying index of the event
9812             </description>
9813           </field>
9814           <field id="id">
9815             <allocfieldbuf><char/></allocfieldbuf>
9816               <description>
9817                 The identifier for the extension event, encoded as a
9818                 <internallink id="mUTF">modified UTF-8</internallink> string.
9819                 Uses package name conventions.
9820                 For example, <code>com.sun.hotspot.bar</code>
9821               </description>
9822           </field>
9823           <field id="short_description">
9824             <allocfieldbuf><char/></allocfieldbuf>
9825               <description>
9826                 A one sentence description of the event, encoded as a
9827                 <internallink id="mUTF">modified UTF-8</internallink> string.
9828               </description>
9829           </field>
9830           <field id="param_count">
9831             <jint/>
9832               <description>
9833                 The number of parameters excluding <code>jvmtiEnv *jvmti_env</code>
9834               </description>
9835           </field>
9836           <field id="params">
9837             <allocfieldbuf outcount="param_count">
9838               <struct>jvmtiParamInfo</struct>
9839             </allocfieldbuf>
9840             <description>
9841               Array of 
9842               <fieldlink id="param_count" struct="jvmtiExtensionEventInfo"></fieldlink>
9843               parameters (<code>jvmtiEnv *jvmti_env</code> excluded)
9844             </description>
9845           </field>
9846         </typedef>
9847 
9848         <description>
9849           Returns the set of extension events.
9850         </description>
9851         <origin>new</origin>
9852         <capabilities>
9853         </capabilities>
9854         <parameters>
9855           <param id="extension_count_ptr">
9856             <outptr><jint/></outptr>
9857               <description>
9858                 On return, points to the number of extension events
9859               </description>
9860           </param>
9861           <param id="extensions">
9862             <allocbuf outcount="extension_count_ptr"><struct>jvmtiExtensionEventInfo</struct></allocbuf>
9863             <description>
9864               Returns an array of extension event info, one per event
9865             </description>
9866           </param>
9867         </parameters>
9868         <errors>
9869         </errors>
9870       </function>
9871 
9872       <callback id="jvmtiExtensionEvent">
9873         <void/>
9874           <synopsis>Extension Event</synopsis>
9875         <description>
9876           This is the implementation-specific event.
9877           The event handler is set with 
9878           <functionlink id="SetExtensionEventCallback"/>.
9879           <p/>
9880           Event handlers for extension events must be declared varargs to match this definition.
9881           Failure to do so could result in calling convention mismatch and undefined behavior
9882           on some platforms.
9883           <p/>
9884           For example, if the <code>jvmtiParamInfo</code>
9885           returned by <functionlink id="GetExtensionEvents"/> indicates that
9886           there is a <code>jint</code> parameter, the event handler should be
9887           declared:
9888 <example>
9889     void JNICALL myHandler(jvmtiEnv* jvmti_env, jint myInt, ...)
9890 </example>
9891           Note the terminal "<code>...</code>" which indicates varargs.
9892         </description>
9893         <parameters>
9894           <param id="jvmti_env">
9895             <outptr>
9896               <struct>jvmtiEnv</struct>
9897             </outptr>
9898             <description>
9899               The <jvmti/> environment is the only fixed parameter for extension events.
9900             </description>
9901           </param>
9902           <param id="...">
9903             <varargs/>
9904               <description>
9905                 The extension event-specific parameters
9906               </description>
9907           </param>
9908         </parameters>
9909       </callback>
9910 
9911       <function id="SetExtensionEventCallback" phase="onload" num="126">
9912         <synopsis>Set Extension Event Callback</synopsis>
9913 
9914         <description>
9915           Sets the callback function for an extension event and
9916           enables the event. Or, if the callback is <code>NULL</code>, disables
9917           the event.  Note that unlike standard events, setting
9918           the callback and enabling the event are a single operation.
9919         </description>
9920         <origin>new</origin>
9921         <capabilities>
9922         </capabilities>
9923         <parameters>
9924           <param id="extension_event_index">
9925             <jint/>
9926               <description>
9927                 Identifies which callback to set.
9928                 This index is the 
9929                 <fieldlink id="extension_event_index" struct="jvmtiExtensionEventInfo"></fieldlink>
9930                 field of 
9931                 <datalink id="jvmtiExtensionEventInfo"/>.
9932               </description>
9933           </param>
9934           <param id="callback">
9935             <ptrtype>
9936               <struct>jvmtiExtensionEvent</struct>
9937               <nullok>disable the event</nullok>
9938             </ptrtype>
9939             <description>
9940               If <code>callback</code> is non-<code>NULL</code>, 
9941               set <code>callback</code> to be the event callback function
9942               and enable the event.
9943             </description>
9944           </param>
9945         </parameters>
9946         <errors>
9947         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> 
9948             <paramlink id="extension_event_index"/> is not an
9949             <fieldlink id="extension_event_index" 
9950                        struct="jvmtiExtensionEventInfo"/>
9951             returned by 
9952             <functionlink id="GetExtensionEvents"/>
9953         </error>
9954         </errors>
9955       </function>
9956 
9957     </category>
9958 
9959   <category id="capability" label="Capability">
9960 
9961     <intro>
9962       The capabilities functions allow you to change the
9963       functionality available to <jvmti/>--that is, 
9964       which <jvmti/> 
9965       functions can be called, what events can be generated,
9966       and what functionality these events and functions can
9967       provide.
9968       <p/>
9969         The "Capabilities" section of each function and event describe which 
9970         capabilities, if any, they are associated with. "Required Functionality"
9971         means it is available for use and no capabilities must be added to use it.
9972         "Optional Functionality" means the agent must possess the capability
9973         before it can be used.  
9974         To possess a capability, the agent must
9975         <functionlink id="AddCapabilities">add the capability</functionlink>.
9976         "Optional Features" describe capabilities which,
9977         if added, extend the feature set.
9978         <p/>
9979         The potentially available capabilities of each <jvmti/> implementation are different.  
9980         Depending on the implementation, a capability:
9981         <ul>
9982           <li>may never be added</li>
9983           <li>may be added in either the <code>OnLoad</code> or live phase in any environment</li>
9984           <li>may be added only during the <code>OnLoad</code> phase</li>
9985           <li>may be possessed by only one environment at a time</li>
9986           <li>may be possessed by only one environment at a time, 
9987               and only during the <code>OnLoad</code> phase</li>
9988           <li>and so on ...</li>
9989         </ul>
9990       Frequently, the addition of a capability may incur a cost in execution speed, start up
9991       time, and/or memory footprint.  Note that the overhead of using a capability
9992       is completely different than the overhead of possessing a capability.
9993       Take single stepping as an example. When single stepping is on (that
9994       is, when the event is enabled and thus actively sending events) 
9995       the overhead of sending and processing an event 
9996       on each instruction is huge in any implementation. 
9997       However, the overhead of possessing the capability may be small or large, 
9998       depending on the implementation.  Also, when and if a capability is potentially
9999       available depends on the implementation.  Some examples:
10000       <ul>
10001         <li>One VM might perform all execution by compiling bytecodes into 
10002           native code and be unable to generate single step instructions.
10003           In this implementation the capability can not be added.</li>
10004         <li>Another VM may be able to switch execution to a single stepping
10005           interpreter at any time.  In this implementation, having the capability has no 
10006           overhead and could be added at any time.</li>
10007         <li>Yet another VM might be able to choose a bytecode compiling or single stepping capable interpreted
10008           execution engine at start up, but be unable to switch between them.
10009           In this implementation the capability would need to be added 
10010           during the <code>OnLoad</code> phase (before bytecode
10011           execution begins) and would have a large impact on execution speed 
10012           even if single stepping was never used.</li>
10013         <li>Still another VM might be able to add an "is single stepping on" check
10014           into compiled bytecodes or a generated interpreter.  Again in this implementation
10015           the capability would need to be added during the <code>OnLoad</code> phase but the overhead (a test
10016           and branch on each instruction) would be considerably less.</li>
10017       </ul>
10018       <p/>
10019       Each <jvmti/> <internallink id="environments">environment</internallink>
10020       has its own set of capabilities.  
10021       Initially, that set is empty.
10022       Any desired capability must be added.
10023       If possible, capabilities should be added during the <code>OnLoad</code> phase.  For most 
10024       virtual machines certain capabilities require special set up for 
10025       the virtual machine and this set up must happen
10026       during the <code>OnLoad</code> phase, before the virtual machine begins execution. 
10027       Once a capability is added, it can
10028       only be removed if explicitly relinquished by the environment.
10029       <p/>
10030       The agent can, 
10031       <functionlink id="GetPotentialCapabilities">determine what
10032         capabilities this VM can potentially provide</functionlink>,
10033       <functionlink id="AddCapabilities">add the capabilities
10034         to be used</functionlink>,
10035       <functionlink id="RelinquishCapabilities">release capabilities
10036         which are no longer needed</functionlink>, and
10037       <functionlink id="GetCapabilities">examine the currently available 
10038         capabilities</functionlink>.
10039     </intro>
10040 
10041     <intro id="capabilityExamples" label="Capability Examples">
10042       For example, a freshly started agent (in the <code>OnLoad</code> function)
10043       wants to enable all possible capabilities.  
10044       Note that, in general, this is not advisable as the agent may suffer
10045       a performance penalty for functionality it is not using.
10046       The code might look like this in C:
10047       <example>
10048         jvmtiCapabilities capa;
10049         jvmtiError err;
10050 
10051         err = (*jvmti)-&gt;GetPotentialCapabilities(jvmti, &amp;capa);
10052         if (err == JVMTI_ERROR_NONE) {
10053            err = (*jvmti)-&gt;AddCapabilities(jvmti, &amp;capa);
10054       </example>
10055       For example, if an  agent wants to check if it can get
10056       the bytecodes of a method (that is, it wants to check 
10057       if it previously added this capability and has not 
10058       relinquished it), the code might 
10059       look like this in C:
10060       <example>
10061         jvmtiCapabilities capa;
10062         jvmtiError err;
10063 
10064         err = (*jvmti)-&gt;GetCapabilities(jvmti, &amp;capa);
10065         if (err == JVMTI_ERROR_NONE) {
10066            if (capa.can_get_bytecodes) { ... } } 
10067       </example>
10068     </intro>
10069 
10070     <capabilitiestypedef id="jvmtiCapabilities" label="The Capabilities Structure">
10071       <description>
10072         The functions in this category use this capabilities structure 
10073         which contains boolean flags corresponding to each capability:
10074       </description>
10075       <capabilityfield id="can_tag_objects">
10076         <description>
10077           Can set and get tags, as described in the
10078           <internallink id="Heap">Heap category</internallink>.
10079         </description>
10080       </capabilityfield>
10081       <capabilityfield id="can_generate_field_modification_events">
10082         <description>
10083           Can set watchpoints on field modification -
10084           <functionlink id="SetFieldModificationWatch"></functionlink>
10085         </description>
10086       </capabilityfield>
10087       <capabilityfield id="can_generate_field_access_events">
10088         <description>
10089           Can set watchpoints on field access -
10090           <functionlink id="SetFieldAccessWatch"></functionlink>
10091         </description>
10092       </capabilityfield>
10093       <capabilityfield id="can_get_bytecodes">
10094         <description>
10095           Can get bytecodes of a method <functionlink id="GetBytecodes"></functionlink>
10096         </description>
10097       </capabilityfield>
10098       <capabilityfield id="can_get_synthetic_attribute">
10099         <description>
10100           Can test if a field or method is synthetic - 
10101           <functionlink id="IsFieldSynthetic"></functionlink> and
10102           <functionlink id="IsMethodSynthetic"></functionlink>
10103         </description>
10104       </capabilityfield>
10105       <capabilityfield id="can_get_owned_monitor_info">
10106         <description>
10107           Can get information about ownership of monitors - 
10108           <functionlink id="GetOwnedMonitorInfo"></functionlink>
10109         </description>
10110       </capabilityfield>
10111       <capabilityfield id="can_get_current_contended_monitor">
10112         <description>
10113           Can <functionlink id="GetCurrentContendedMonitor"></functionlink>
10114         </description>
10115       </capabilityfield>
10116       <capabilityfield id="can_get_monitor_info">
10117       <description>
10118         Can <functionlink id="GetObjectMonitorUsage"></functionlink>
10119       </description>
10120       </capabilityfield>
10121       <capabilityfield id="can_pop_frame">
10122         <description>
10123           Can pop frames off the stack - <functionlink id="PopFrame"></functionlink>
10124         </description>
10125       </capabilityfield>
10126       <capabilityfield id="can_redefine_classes">
10127         <description>
10128           Can redefine classes with <functionlink id="RedefineClasses"/>.
10129         </description>
10130       </capabilityfield>
10131       <capabilityfield id="can_signal_thread">
10132         <description>
10133           Can send stop or interrupt to threads
10134         </description>
10135       </capabilityfield>
10136       <capabilityfield id="can_get_source_file_name">
10137         <description>
10138           Can get the source file name of a class
10139         </description>
10140       </capabilityfield>
10141       <capabilityfield id="can_get_line_numbers">
10142         <description>
10143           Can get the line number table of a method
10144         </description>
10145       </capabilityfield>
10146       <capabilityfield id="can_get_source_debug_extension">
10147         <description>
10148           Can get the source debug extension of a class
10149         </description>
10150       </capabilityfield>
10151       <capabilityfield id="can_access_local_variables">
10152         <description>
10153           Can set and get local variables
10154         </description>
10155       </capabilityfield>
10156       <capabilityfield id="can_maintain_original_method_order">
10157         <description>
10158           Can return methods in the order they occur in the class file
10159         </description>
10160       </capabilityfield>
10161       <capabilityfield id="can_generate_single_step_events">
10162         <description>
10163           Can get <eventlink id="SingleStep">single step</eventlink> events
10164         </description>
10165       </capabilityfield>
10166       <capabilityfield id="can_generate_exception_events">
10167         <description>
10168           Can get <eventlink id="Exception">exception thrown</eventlink> and 
10169             <eventlink id="ExceptionCatch">exception catch</eventlink> events
10170         </description>
10171       </capabilityfield>
10172       <capabilityfield id="can_generate_frame_pop_events">
10173         <description>
10174           Can <functionlink id="NotifyFramePop">set</functionlink> and thus get 
10175             <eventlink id="FramePop"></eventlink> events
10176         </description>
10177       </capabilityfield>
10178       <capabilityfield id="can_generate_breakpoint_events">
10179         <description>
10180           Can <functionlink id="SetBreakpoint">set</functionlink> and thus get 
10181             <eventlink id="Breakpoint"></eventlink> events
10182         </description>
10183       </capabilityfield>
10184       <capabilityfield id="can_suspend">
10185         <description>
10186           Can suspend and resume threads
10187         </description>
10188       </capabilityfield>
10189       <capabilityfield id="can_redefine_any_class">
10190         <description>
10191           Can modify (retransform or redefine) any modifiable class.
10192           See <functionlink id="IsModifiableClass"/>.
10193         </description>
10194       </capabilityfield>
10195       <capabilityfield id="can_get_current_thread_cpu_time">
10196         <description>
10197           Can <functionlink id="GetCurrentThreadCpuTime">get</functionlink>
10198           current thread CPU time
10199         </description>
10200       </capabilityfield>
10201       <capabilityfield id="can_get_thread_cpu_time">
10202         <description>
10203           Can <functionlink id="GetThreadCpuTime">get</functionlink>
10204           thread CPU time
10205         </description>
10206       </capabilityfield>
10207       <capabilityfield id="can_generate_method_entry_events" 
10208                        disp1="can_generate" disp2="_method_entry_events" 
10209                        >
10210         <description>
10211           Can generate method entry events on entering a method
10212         </description>
10213       </capabilityfield>
10214       <capabilityfield id="can_generate_method_exit_events" 
10215                        disp1="can_generate" disp2="_method_exit_events" 
10216                        >
10217         <description>
10218           Can generate method exit events on leaving a method
10219         </description>
10220       </capabilityfield>
10221       <capabilityfield id="can_generate_all_class_hook_events" 
10222                        disp1="can_generate" disp2="_all_class_hook_events" 
10223                        >
10224         <description>
10225           Can generate ClassFileLoadHook events for every loaded class.
10226         </description>
10227       </capabilityfield>
10228       <capabilityfield id="can_generate_compiled_method_load_events" 
10229                        disp1="can_generate" disp2="_compiled_method_load_events" 
10230                        >
10231         <description>
10232           Can generate events when a method is compiled or unloaded
10233         </description>
10234       </capabilityfield>
10235       <capabilityfield id="can_generate_monitor_events" 
10236                        disp1="can_generate" disp2="_monitor_events" 
10237                        >
10238         <description>
10239           Can generate events on monitor activity
10240         </description>
10241       </capabilityfield>
10242       <capabilityfield id="can_generate_vm_object_alloc_events" 
10243                        disp1="can_generate" disp2="_vm_object_alloc_events" 
10244                        >
10245         <description>
10246           Can generate events on VM allocation of an object
10247         </description>
10248       </capabilityfield>
10249       <capabilityfield id="can_generate_native_method_bind_events" 
10250                        disp1="can_generate" disp2="_native_method_bind_events" 
10251                        >
10252         <description>
10253           Can generate events when a native method is bound to its
10254           implementation
10255         </description>
10256       </capabilityfield>
10257       <capabilityfield id="can_generate_garbage_collection_events" 
10258                        disp1="can_generate" disp2="_garbage_collection_events" 
10259                        >
10260         <description>
10261           Can generate events when garbage collection begins or ends
10262         </description>
10263       </capabilityfield>
10264       <capabilityfield id="can_generate_object_free_events" 
10265                        disp1="can_generate" disp2="_object_free_events" 
10266                        >
10267         <description>
10268           Can generate events when the garbage collector frees an object
10269         </description>
10270       </capabilityfield>
10271       <capabilityfield id="can_force_early_return" since="1.1">
10272         <description>
10273           Can return early from a method, as described in the
10274           <internallink id="ForceEarlyReturn">Force Early Return category</internallink>.
10275         </description>
10276       </capabilityfield>
10277       <capabilityfield id="can_get_owned_monitor_stack_depth_info" since="1.1">
10278         <description>
10279           Can get information about owned monitors with stack depth -
10280           <functionlink id="GetOwnedMonitorStackDepthInfo"></functionlink>
10281         </description>
10282       </capabilityfield>
10283       <capabilityfield id="can_get_constant_pool" since="1.1">
10284         <description>
10285           Can get the constant pool of a class -
10286           <functionlink id="GetConstantPool"></functionlink>
10287         </description>
10288       </capabilityfield>
10289       <capabilityfield id="can_set_native_method_prefix" since="1.1">
10290         <description>
10291           Can set prefix to be applied when native method cannot be resolved -
10292           <functionlink id="SetNativeMethodPrefix"/> and
10293           <functionlink id="SetNativeMethodPrefixes"/>
10294         </description>
10295       </capabilityfield>
10296       <capabilityfield id="can_retransform_classes" since="1.1">
10297         <description>
10298           Can retransform classes with <functionlink id="RetransformClasses"/>.
10299           In addition to the restrictions imposed by the specific 
10300           implementation on this capability (see the
10301           <internallink id="capability">Capability</internallink> section),
10302           this capability must be set before the 
10303           <eventlink id="ClassFileLoadHook"/> event is enabled for the
10304           first time in this environment.
10305           An environment that possesses this capability at the time that 
10306           <code>ClassFileLoadHook</code> is enabled for the first time is
10307           said to be <i>retransformation capable</i>.
10308           An environment that does not possess this capability at the time that 
10309           <code>ClassFileLoadHook</code> is enabled for the first time is
10310           said to be <i>retransformation incapable</i>.
10311         </description>
10312       </capabilityfield>
10313       <capabilityfield id="can_retransform_any_class" since="1.1">
10314         <description>
10315           <functionlink id="RetransformClasses"/> can be called on any modifiable class.
10316           See <functionlink id="IsModifiableClass"/>.
10317           (<fieldlink id="can_retransform_classes" struct="jvmtiCapabilities"/>
10318           must also be set)
10319         </description>
10320       </capabilityfield>
10321       <capabilityfield id="can_generate_resource_exhaustion_heap_events" since="1.1">
10322         <description>
10323           Can generate events when the VM is unable to allocate memory from 
10324           the <tm>Java</tm> platform heap.
10325           See <eventlink id="ResourceExhausted"/>.
10326         </description>
10327       </capabilityfield>
10328       <capabilityfield id="can_generate_resource_exhaustion_threads_events" since="1.1">
10329         <description>
10330           Can generate events when the VM is unable to create a thread.
10331           See <eventlink id="ResourceExhausted"/>.
10332         </description>
10333       </capabilityfield>
10334       <capabilityfield id="can_generate_early_vmstart" since="9">
10335         <description>
10336           Can generate the <code>VMStart</code> event early.
10337           See <eventlink id="VMStart"/>.
10338         </description>
10339       </capabilityfield>
10340       <capabilityfield id="can_generate_early_class_hook_events" since="9">
10341         <description>
10342           Can generate the <eventlink id="ClassFileLoadHook"/> events
10343           in the primordial phase. If this capability and
10344           <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
10345           <code>can_generate_all_class_hook_events</code></internallink>
10346           are enabled then the <eventlink id="ClassFileLoadHook"/> events
10347           can be posted for classes loaded in the primordial phase.
10348           See <eventlink id="ClassFileLoadHook"/>.
10349         </description>
10350       </capabilityfield>
10351     </capabilitiestypedef>
10352 
10353     <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140">
10354       <synopsis>Get Potential Capabilities</synopsis>
10355       <description>
10356         Returns via <paramlink id="capabilities_ptr"></paramlink> the <jvmti/> 
10357         features that can potentially be possessed by this environment
10358         at this time.
10359         The returned capabilities differ from the complete set of capabilities
10360         implemented by the VM in two cases: another environment possesses 
10361         capabilities that can only be possessed by one environment, or the
10362         current <functionlink id="GetPhase">phase</functionlink> is live,
10363         and certain capabilities can only be added during the <code>OnLoad</code> phase.
10364         The <functionlink id="AddCapabilities"></functionlink> function
10365         may be used to set any or all or these capabilities.
10366         Currently possessed capabilities are included.
10367         <p/>
10368         Typically this function is used in the <code>OnLoad</code> function.
10369         Some virtual machines may allow a limited set of capabilities to be
10370         added in the live phase.
10371         In this case, the set of potentially available capabilities
10372         will likely differ from the <code>OnLoad</code> phase set.
10373         <p/>
10374         See the
10375         <internallink id="capabilityExamples">Capability Examples</internallink>.
10376       </description>
10377       <origin>new</origin>
10378       <capabilities>
10379       </capabilities>
10380       <parameters>
10381         <param id="capabilities_ptr">
10382           <outptr><struct>jvmtiCapabilities</struct></outptr>
10383           <description>
10384             On return, points to the <jvmti/> capabilities that may be added.
10385           </description>
10386         </param>
10387       </parameters>
10388       <errors>
10389       </errors>
10390     </function>
10391 
10392     <elide>
10393     <function id="EstimateCostOfCapabilities" phase="onload" num="141">
10394       <synopsis>Estimate Cost Of Capabilities</synopsis>
10395       <description>
10396         <issue>There is strong opposition to this function.  The concern is
10397           that it would be difficult or impossible to provide meaningful
10398           numbers, as the amount of impact is conditional on many factors
10399           that a single number could not represent.  There is doubt that
10400           conditional implementations would be used or are even a good idea.
10401           The thought is that release documentation for the implementation
10402           would be the best means of exposing this information.
10403           Unless new arguments are presented, I intend to remove this 
10404           function in the next revision.
10405         </issue>
10406         <p/>
10407         Return via the <paramlink id="time_impact_ptr"></paramlink> and
10408         <paramlink id="space_impact_ptr"></paramlink> an estimate of the impact
10409         of adding the capabilities pointed to by
10410         <paramlink id="capabilities_ptr"></paramlink>.
10411         The returned estimates are in percentage of additional overhead, thus
10412         a time impact of 100 mean the application might run
10413         at half the speed.  
10414         The estimates are very rough approximations and are not guaranteed.
10415         Note also, that the estimates are of the impact of having the
10416         capability available--when and if it is used the impact may be
10417         much greater.
10418         Estimates can be for a single capability or for a set of 
10419         capabilities.  Note that the costs are not necessarily additive,
10420         adding support for one capability might make another available 
10421         for free or conversely having two capabilities at once may 
10422         have multiplicative impact.
10423         Estimates are relative to the current set of capabilities -
10424         that is, how much more impact given the currently possessed capabilities.
10425         <p/>
10426         Typically this function is used in the OnLoad function,
10427         some virtual machines may allow a limited set of capabilities to be
10428         added in the live phase.
10429         In this case, the set of potentially available capabilities
10430         will likely differ from the OnLoad phase set.
10431         <p/>
10432         See the
10433         <internallink id="capabilityExamples">Capability Examples</internallink>.
10434       </description>
10435       <origin>new</origin>
10436       <capabilities>
10437       </capabilities>
10438       <parameters>
10439         <param id="capabilities_ptr">
10440           <inptr><struct>jvmtiCapabilities</struct></inptr>
10441           <description>
10442             points to the <jvmti/> capabilities to evaluate.
10443           </description>
10444         </param>
10445         <param id="time_impact_ptr">
10446           <outptr><jint/></outptr>
10447           <description>
10448             On return, points to the estimated percentage increase in
10449             run time if this capability was added.
10450           </description>
10451         </param>
10452         <param id="space_impact_ptr">
10453           <outptr><jint/></outptr>
10454           <description>
10455             On return, points to the estimated percentage increase in
10456             memory space used if this capability was added.
10457           </description>
10458         </param>
10459       </parameters>
10460       <errors>
10461         <error id="JVMTI_ERROR_NOT_AVAILABLE"> 
10462           The desired capabilities are not even potentially available.
10463         </error>
10464       </errors>
10465     </function>
10466     </elide>
10467 
10468     <function id="AddCapabilities" jkernel="yes" phase="onload" num="142">
10469       <synopsis>Add Capabilities</synopsis>
10470       <description>
10471         Set new capabilities by adding the capabilities 
10472         whose values are set to one (<code>1</code>) in
10473         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10474         All previous capabilities are retained.
10475         Typically this function is used in the <code>OnLoad</code> function.
10476         Some virtual machines may allow a limited set of capabilities to be
10477         added in the live phase.
10478         <p/>
10479         See the
10480         <internallink id="capabilityExamples">Capability Examples</internallink>.
10481       </description>
10482       <origin>new</origin>
10483       <capabilities>
10484       </capabilities>
10485       <parameters>
10486         <param id="capabilities_ptr">
10487           <inptr><struct>jvmtiCapabilities</struct></inptr>
10488           <description>
10489             Points to the <jvmti/> capabilities to add.
10490           </description>
10491         </param>
10492       </parameters>
10493       <errors>
10494         <error id="JVMTI_ERROR_NOT_AVAILABLE"> 
10495           The desired capabilities are not even potentially available.
10496         </error>
10497       </errors>
10498     </function>
10499 
10500 
10501     <function id="RelinquishCapabilities" phase="onload" num="143">
10502       <synopsis>Relinquish Capabilities</synopsis>
10503       <description>
10504         Relinquish the capabilities
10505         whose values are set to one (<code>1</code>) in
10506         <code>*</code><paramlink id="capabilities_ptr"></paramlink>.
10507         Some implementations may allow only one environment to have a capability
10508         (see the <internallink id="capability">capability introduction</internallink>).
10509         This function releases capabilities
10510         so that they may be used by other agents.
10511         All other capabilities are retained.
10512         The capability will no longer be present in <functionlink id="GetCapabilities"></functionlink>.
10513         Attempting to relinquish a capability that the agent does not possess is not an error.
10514           <issue>
10515             It is possible for the agent to be actively using capabilities
10516             which are being relinquished.  For example, a thread is currently
10517             suspended and can_suspend is being relinquished or an event is currently
10518             enabled and can_generate_whatever is being relinquished.
10519             There are three possible ways we could spec this:
10520             <ul>
10521               <li>relinquish automatically releases them</li>
10522               <li>relinquish checks and returns some error code if held</li>
10523               <li>it is the agent's responsibility and it is not checked</li>
10524             </ul>
10525             One of these should be chosen.
10526           </issue>
10527       </description>
10528       <origin>new</origin>
10529       <capabilities>
10530       </capabilities>
10531       <parameters>
10532         <param id="capabilities_ptr">
10533           <inptr><struct>jvmtiCapabilities</struct></inptr>
10534           <description>
10535             Points to the <jvmti/> capabilities to relinquish.
10536           </description>
10537         </param>
10538       </parameters>
10539       <errors>
10540       </errors>
10541     </function>
10542 
10543 
10544 
10545     <function id="GetCapabilities" jkernel="yes" phase="any" num="89">
10546       <synopsis>Get Capabilities</synopsis>
10547         <description>
10548           Returns via <paramlink id="capabilities_ptr"></paramlink> the optional <jvmti/> 
10549           features which this environment currently possesses.
10550           Each possessed capability is indicated by a one (<code>1</code>) in the
10551           corresponding field of the <internallink id="jvmtiCapabilities">capabilities
10552           structure</internallink>.
10553           An environment does not possess a capability unless it has been successfully added with
10554           <functionlink id="AddCapabilities"/>.
10555           An environment only loses possession of a capability if it has been relinquished with
10556           <functionlink id="RelinquishCapabilities"/>. Thus, this function returns the net result
10557           of the <code>AddCapabilities</code> and <code>RelinquishCapabilities</code> calls which
10558           have been made.
10559           <p/>
10560           See the
10561           <internallink id="capabilityExamples">Capability Examples</internallink>.
10562         </description>
10563       <origin>jvmdiClone</origin>
10564       <capabilities>
10565       </capabilities>
10566       <parameters>
10567         <param id="capabilities_ptr">
10568           <outptr><struct>jvmtiCapabilities</struct></outptr>
10569           <description>
10570             On return, points to the <jvmti/> capabilities.
10571           </description>
10572         </param>
10573       </parameters>
10574       <errors>
10575       </errors>
10576     </function>
10577 
10578   </category>
10579   
10580   
10581   <category id="timers" label="Timers">
10582 
10583       <intro>
10584         These functions provide timing information.
10585         The resolution at which the time is updated is not specified. 
10586         They provides nanosecond precision, but not necessarily nanosecond accuracy. 
10587         Details about the timers, such as their maximum values, can be accessed with
10588         the timer information functions.  
10589       </intro>
10590 
10591       <typedef id="jvmtiTimerInfo" label="Timer Info">
10592         <description>
10593           The information function for each timer returns this data structure.
10594         </description>
10595         <field id="max_value">
10596           <jlong/>
10597             <description>
10598               The maximum value the timer can reach.
10599               After this value is reached the timer wraps back to zero.
10600               This is an unsigned value.  If tested or printed as a jlong (signed value)
10601               it may appear to be a negative number.
10602             </description>
10603         </field>
10604         <field id="may_skip_forward">
10605           <jboolean/>
10606           <description>
10607             If true, the timer can be externally adjusted and as a result skip forward.
10608             If false, the timer value will never increase faster than real time.
10609           </description>
10610         </field>
10611         <field id="may_skip_backward">
10612           <jboolean/>
10613           <description>
10614             If true, the timer can be externally adjusted and as a result skip backward.
10615             If false, the timer value will be monotonically increasing.
10616           </description>
10617         </field>
10618         <field id="kind">
10619           <enum>jvmtiTimerKind</enum>
10620           <description>
10621             The kind of timer.
10622             On a platform that does not distinguish between user and system time, <datalink 
10623                  id="JVMTI_TIMER_TOTAL_CPU"><code>JVMTI_TIMER_TOTAL_CPU</code></datalink>
10624             is returned.
10625           </description>
10626         </field>
10627         <field id="reserved1">
10628           <jlong/>
10629             <description>
10630               Reserved for future use.
10631             </description>
10632         </field>
10633         <field id="reserved2">
10634           <jlong/>
10635             <description>
10636               Reserved for future use.
10637             </description>
10638         </field>
10639       </typedef>
10640 
10641       <intro>
10642         Where the timer kind is --
10643 
10644         <constants id="jvmtiTimerKind" label="Timer Kinds" kind="enum">
10645           <constant id="JVMTI_TIMER_USER_CPU" num="30">
10646             CPU time that a thread is in user mode.
10647           </constant>
10648           <constant id="JVMTI_TIMER_TOTAL_CPU" num="31">
10649             CPU time that a thread is in user or system mode.
10650           </constant>
10651           <constant id="JVMTI_TIMER_ELAPSED" num="32">
10652             Elapsed time.
10653           </constant>
10654         </constants>
10655       </intro>
10656 
10657     <function id="GetCurrentThreadCpuTimerInfo" callbacksafe="safe"  impl="innative notrace" phase="start" num="134">
10658       <synopsis>Get Current Thread CPU Timer Information</synopsis>
10659       <description>
10660         Get information about the 
10661         <functionlink id="GetCurrentThreadCpuTime"/> timer. 
10662         The fields of the <datalink id="jvmtiTimerInfo"/> structure 
10663         are filled in with details about the timer.
10664         This information is specific to the platform and the implementation of
10665         <functionlink id="GetCurrentThreadCpuTime"/> and thus 
10666         does not vary by thread nor does it vary
10667         during a particular invocation of the VM.
10668         <p/>
10669         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10670         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10671         returned by <code>GetCurrentThreadCpuTimerInfo</code>
10672         and <functionlink id="GetThreadCpuTimerInfo"/>
10673         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10674       </description>
10675       <origin>new</origin>
10676       <capabilities>
10677         <required id="can_get_current_thread_cpu_time">
10678             Can get current thread CPU time.
10679         </required>
10680       </capabilities>
10681       <parameters>
10682         <param id="info_ptr">
10683           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10684           <description>
10685             On return, filled with information describing the time
10686             returned by <functionlink id="GetCurrentThreadCpuTime"/>.
10687           </description>
10688         </param>
10689       </parameters>
10690       <errors>
10691       </errors>
10692     </function>
10693 
10694     <function id="GetCurrentThreadCpuTime" callbacksafe="safe" impl="innative notrace" phase="start" num="135">
10695       <synopsis>Get Current Thread CPU Time</synopsis>
10696       <description>
10697             Return the CPU time utilized by the current thread.  
10698             <p/>
10699             Note that the <functionlink id="GetThreadCpuTime"/>
10700             function provides CPU time for any thread, including
10701             the current thread. <code>GetCurrentThreadCpuTime</code> 
10702             exists to support platforms which cannot
10703             supply CPU time for threads other than the current 
10704             thread or which have more accurate information for
10705             the current thread (see 
10706             <functionlink id="GetCurrentThreadCpuTimerInfo"/> vs
10707             <functionlink id="GetThreadCpuTimerInfo"/>).
10708             On many platforms this call will be equivalent to:
10709 <example>
10710   GetThreadCpuTime(env, NULL, nanos_ptr)
10711 </example>
10712       </description>
10713       <origin>new</origin>
10714       <capabilities>
10715         <required id="can_get_current_thread_cpu_time">
10716             Can get current thread CPU time.
10717             <p/>
10718             If this capability is enabled after threads have started, 
10719             the implementation may choose any time up
10720             to and including the time that the capability is enabled 
10721             as the point where CPU time collection starts.
10722             <p/>
10723             This capability must be potentially available on any 
10724             platform where 
10725             <internallink id="jvmtiCapabilities.can_get_thread_cpu_time"><code>can_get_thread_cpu_time</code></internallink>
10726             is potentially available.
10727         </required>
10728       </capabilities>
10729       <parameters>
10730         <param id="nanos_ptr">
10731           <outptr><jlong/></outptr>
10732           <description>
10733             On return, points to the CPU time used by this thread
10734             in nanoseconds.  
10735             This is an unsigned value.  If tested or printed as a jlong (signed value)
10736             it may appear to be a negative number.
10737           </description>
10738         </param>
10739       </parameters>
10740       <errors>
10741       </errors>
10742     </function>
10743 
10744     <function id="GetThreadCpuTimerInfo" num="136">
10745       <synopsis>Get Thread CPU Timer Information</synopsis>
10746       <description>
10747         Get information about the 
10748         <functionlink id="GetThreadCpuTime"/> timer. 
10749         The fields of the <datalink id="jvmtiTimerInfo"/> structure 
10750         are filled in with details about the timer.
10751         This information is specific to the platform and the implementation of
10752         <functionlink id="GetThreadCpuTime"/> and thus 
10753         does not vary by thread nor does it vary
10754         during a particular invocation of the VM.
10755         <p/>
10756         Note that the implementations of <functionlink id="GetCurrentThreadCpuTime"/>
10757         and <functionlink id="GetThreadCpuTime"/> may differ, and thus the values
10758         returned by <functionlink id="GetCurrentThreadCpuTimerInfo"/>
10759         and <code>GetThreadCpuTimerInfo</code>
10760         may differ -- see <functionlink id="GetCurrentThreadCpuTime"/> for more information.
10761       </description>
10762       <origin>new</origin>
10763       <capabilities>
10764         <required id="can_get_thread_cpu_time">
10765             Can get thread CPU time.
10766         </required>
10767       </capabilities>
10768       <parameters>
10769         <param id="info_ptr">
10770           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10771           <description>
10772             On return, filled with information describing the time
10773             returned by <functionlink id="GetThreadCpuTime"/>.
10774           </description>
10775         </param>
10776       </parameters>
10777       <errors>
10778       </errors>
10779     </function>
10780 
10781     <function id="GetThreadCpuTime" num="137">
10782       <synopsis>Get Thread CPU Time</synopsis>
10783       <description>
10784           Return the CPU time utilized by the specified thread. 
10785           <p/>
10786           Get information about this timer with
10787           <functionlink id="GetThreadCpuTimerInfo"/>. 
10788       </description>
10789       <origin>new</origin>
10790       <capabilities>
10791         <required id="can_get_thread_cpu_time">
10792             Can get thread CPU time.
10793             <p/>
10794             If this capability is enabled after threads have started, 
10795             the implementation may choose any time up
10796             to and including the time that the capability is enabled 
10797             as the point where CPU time collection starts.
10798         </required>
10799       </capabilities>
10800       <parameters>
10801         <param id="thread">
10802           <jthread null="current"/>
10803             <description>
10804               The thread to query.
10805             </description>
10806         </param>
10807         <param id="nanos_ptr">
10808           <outptr><jlong/></outptr>
10809           <description>
10810             On return, points to the CPU time used by the specified thread
10811             in nanoseconds.  
10812             This is an unsigned value.  If tested or printed as a jlong (signed value)
10813             it may appear to be a negative number.
10814           </description>
10815         </param>
10816       </parameters>
10817       <errors>
10818       </errors>
10819     </function>
10820 
10821     <function id="GetTimerInfo" phase="any" callbacksafe="safe" num="138">
10822       <synopsis>Get Timer Information</synopsis>
10823       <description>
10824         Get information about the 
10825         <functionlink id="GetTime"/> timer. 
10826         The fields of the <datalink id="jvmtiTimerInfo"/> structure 
10827         are filled in with details about the timer.
10828         This information will not change during a particular invocation of the VM.
10829       </description>
10830       <origin>new</origin>
10831       <capabilities>
10832       </capabilities>
10833       <parameters>
10834         <param id="info_ptr">
10835           <outptr><struct>jvmtiTimerInfo</struct></outptr>
10836           <description>
10837             On return, filled with information describing the time
10838             returned by <functionlink id="GetTime"/>.
10839           </description>
10840         </param>
10841       </parameters>
10842       <errors>
10843       </errors>
10844     </function>
10845 
10846     <function id="GetTime" phase="any" callbacksafe="safe" num="139">
10847       <synopsis>Get Time</synopsis>
10848       <description>
10849           Return the current value of the system timer, in nanoseconds. 
10850           <p/>
10851           The value returned represents nanoseconds since some fixed but
10852           arbitrary time (perhaps in the future, so values may be
10853           negative).  This function provides nanosecond precision, but not
10854           necessarily nanosecond accuracy. No guarantees are made about
10855           how frequently values change.
10856           <p/>
10857           Get information about this timer with
10858           <functionlink id="GetTimerInfo"/>. 
10859       </description>
10860       <origin>new</origin>
10861       <capabilities>
10862       </capabilities>
10863       <parameters>
10864         <param id="nanos_ptr">
10865           <outptr><jlong/></outptr>
10866           <description>
10867             On return, points to the time in nanoseconds.  
10868             This is an unsigned value.  If tested or printed as a jlong (signed value)
10869             it may appear to be a negative number.
10870           </description>
10871         </param>
10872       </parameters>
10873       <errors>
10874       </errors>
10875     </function>
10876 
10877     <function id="GetAvailableProcessors" phase="any" num="144">
10878       <synopsis>Get Available Processors</synopsis>
10879       <description>
10880           Returns the number of processors available to the Java virtual machine.
10881           <p/>
10882           This value may change during a particular invocation of the virtual machine. 
10883           Applications that are sensitive to the number of available processors should
10884           therefore occasionally poll this property.
10885       </description>
10886       <origin>new</origin>
10887       <capabilities>
10888       </capabilities>
10889       <parameters>
10890         <param id="processor_count_ptr">
10891           <outptr><jint/></outptr>
10892           <description>
10893             On return, points to the maximum number of processors available to the
10894             virtual machine; never smaller than one.  
10895           </description>
10896         </param>
10897       </parameters>
10898       <errors>
10899       </errors>
10900     </function>
10901 
10902   </category>
10903 
10904 
10905   <category id="classLoaderSearch" label="Class Loader Search">
10906 
10907     <intro>
10908       These functions allow the agent to add to the locations that a class loader searches for a class.
10909       This is useful for installing instrumentation under the correct class loader.
10910     </intro>
10911 
10912     <function id="AddToBootstrapClassLoaderSearch" jkernel="yes" phase="onload" num="149">
10913       <synopsis>Add To Bootstrap Class Loader Search</synopsis>
10914       <description>
10915           This function can be used to cause instrumentation classes to be defined by the 
10916           bootstrap class loader. See <vmspec chapter="5.3.1"/>.
10917           After the bootstrap
10918           class loader unsuccessfully searches for a class, the specified platform-dependent 
10919           search path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in 
10920           the <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, 
10921           the segments will be searched in the order that this function was called.
10922           <p/>
10923           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent 
10924           search path segment to be searched after the bootstrap class loader unsuccessfully searches
10925           for a class. The segment is typically a directory or JAR file.
10926           <p/>      
10927           In the live phase the <paramlink id="segment"/> may be used to specify any platform-dependent
10928           path to a <externallink id="docs/technotes/guides/jar/jar.html">
10929           JAR file</externallink>. The agent should take care that the JAR file does not
10930           contain any classes or resources other than those to be defined by the bootstrap
10931           class loader for the purposes of instrumentation.
10932           <p/>
10933           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
10934           reference that the Java virtual machine has previously unsuccessfully attempted
10935           to resolve always fails with the same error that was thrown as a result of the
10936           initial resolution attempt. Consequently, if the JAR file contains an entry
10937           that corresponds to a class for which the Java virtual machine has
10938           unsuccessfully attempted to resolve a reference, then subsequent attempts to
10939           resolve that reference will fail with the same error as the initial attempt.
10940       </description>
10941       <origin>new</origin>
10942       <capabilities>
10943       </capabilities>
10944       <parameters>
10945         <param id="segment">
10946           <inbuf><char/></inbuf>
10947           <description>
10948             The platform-dependent search path segment, encoded as a
10949             <internallink id="mUTF">modified UTF-8</internallink> string.
10950           </description>
10951         </param>
10952       </parameters>
10953       <errors>
10954         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">   
10955           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
10956            existing JAR file is an invalid path.
10957         </error>
10958       </errors>
10959     </function>
10960 
10961     <function id="AddToSystemClassLoaderSearch" jkernel="yes" phase="onload" num="151" since="1.1">
10962       <synopsis>Add To System Class Loader Search</synopsis>
10963       <description>
10964           This function can be used to cause instrumentation classes to be
10965           defined by the system class loader. See <vmspec chapter="5.3.2"/>.
10966           After the class loader unsuccessfully searches for a class, the specified platform-dependent search 
10967           path <paramlink id="segment"/> will be searched as well. Only one segment may be specified in the 
10968           <paramlink id="segment"/>. This function may be called multiple times to add multiple segments, the 
10969           segments will be searched in the order that this function was called.
10970           <p/>
10971           In the <code>OnLoad</code> phase the function may be used to specify any platform-dependent 
10972           search path segment to be searched after the system class loader unsuccessfully searches
10973           for a class. The segment is typically a directory or JAR file.
10974           <p/>      
10975           In the live phase the <paramlink id="segment"/> is a platform-dependent path to a
10976           <externallink id="docs/technotes/guides/jar/jar.html">JAR file</externallink> to be
10977           searched after the system class loader unsuccessfully searches for a class. The agent should
10978           take care that the JAR file does not contain any classes or resources other than those to be
10979           defined by the system class loader for the purposes of instrumentation.
10980           <p/>
10981           In the live phase the system class loader supports adding a JAR file to be searched if
10982           the system class loader implements a method name <code>appendToClassPathForInstrumentation</code> 
10983           which takes a single parameter of type <code>java.lang.String</code>. The method is not required 
10984           to have <code>public</code> access. 
10985           <p/>
10986           <vmspec/> specifies that a subsequent attempt to resolve a symbolic
10987           reference that the Java virtual machine has previously unsuccessfully attempted
10988           to resolve always fails with the same error that was thrown as a result of the
10989           initial resolution attempt. Consequently, if the JAR file contains an entry
10990           that corresponds to a class for which the Java virtual machine has
10991           unsuccessfully attempted to resolve a reference, then subsequent attempts to
10992           resolve that reference will fail with the same error as the initial attempt.
10993       </description>
10994       <origin>new</origin>
10995       <capabilities>
10996       </capabilities>
10997       <parameters>
10998         <param id="segment">
10999           <inbuf><char/></inbuf>
11000           <description>
11001             The platform-dependent search path segment, encoded as a
11002             <internallink id="mUTF">modified UTF-8</internallink> string.
11003           </description>
11004         </param>
11005       </parameters>
11006       <errors>
11007         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
11008           <paramlink id="segment"/> is an invalid path. In the live phase, anything other than an
11009            existing JAR file is an invalid path.
11010         </error>
11011         <error id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED">
11012           Operation not supported by the system class loader.
11013         </error>                                                                                         
11014       </errors>
11015     </function>
11016 
11017   </category>
11018 
11019 
11020   <category id="props" label="System Properties">
11021 
11022     <intro>
11023       These functions get and set system properties.
11024     </intro>
11025 
11026     <function id="GetSystemProperties" phase="onload" num="130">
11027       <synopsis>Get System Properties</synopsis>
11028       <description>
11029         The list of VM system property keys which may be used with 
11030         <functionlink id="GetSystemProperty"/> is returned.
11031         It is strongly recommended that virtual machines provide the
11032         following property keys:
11033         <ul>
11034           <li><code>java.vm.vendor</code></li>
11035           <li><code>java.vm.version</code></li>
11036           <li><code>java.vm.name</code></li>
11037           <li><code>java.vm.info</code></li>
11038           <li><code>java.library.path</code></li>
11039           <li><code>java.class.path</code></li>
11040         </ul>
11041         Provides access to system properties defined by and used
11042         by the VM.
11043         Properties set on the command-line are included.
11044         This allows getting and setting of these properties 
11045         before the VM even begins executing bytecodes.
11046         Since this is a VM view of system properties, the set of available 
11047         properties will usually be different than that
11048         in <code>java.lang.System.getProperties</code>.
11049         JNI method invocation may be used to access 
11050         <code>java.lang.System.getProperties</code>.
11051         <p/>
11052         The set of properties may grow during execution.          
11053       </description>
11054       <origin>new</origin>
11055       <capabilities>
11056       </capabilities>
11057       <parameters>
11058         <param id="count_ptr">
11059           <outptr><jint/></outptr>
11060           <description>
11061             On return, points to the number of property keys returned.
11062           </description>
11063         </param>
11064         <param id="property_ptr">
11065           <allocallocbuf outcount="count_ptr"><char/></allocallocbuf>
11066           <description>
11067             On return, points to an array of property keys, encoded as 
11068             <internallink id="mUTF">modified UTF-8</internallink> strings.
11069           </description>
11070         </param>
11071       </parameters>
11072       <errors>
11073       </errors>
11074     </function>
11075 
11076     <function id="GetSystemProperty" phase="onload" num="131">
11077       <synopsis>Get System Property</synopsis>
11078       <description>
11079         Return a VM system property value given the property key.  
11080         <p/>
11081         The function <functionlink id="GetSystemProperties"/>
11082         returns the set of property keys which may be used.
11083         The properties which can be retrieved may grow during
11084         execution.
11085         <p/>
11086         Since this is a VM view of system properties, the values 
11087         of properties may differ from that returned by 
11088         <code>java.lang.System.getProperty(String)</code>.
11089         A typical VM might copy the values of the VM system 
11090         properties into the <code>Properties</code> held by
11091         <code>java.lang.System</code> during the initialization
11092         of that class. Thereafter any changes to the VM system
11093         properties (with <functionlink id="SetSystemProperty"/>) 
11094         or the <code>java.lang.System</code> system properties
11095         (with <code>java.lang.System.setProperty(String,String)</code>)
11096         would cause the values to diverge.
11097         JNI method invocation may be used to access 
11098         <code>java.lang.System.getProperty(String)</code>.
11099       </description>
11100       <origin>new</origin>
11101       <capabilities>
11102       </capabilities>
11103       <parameters>
11104         <param id="property">
11105           <inbuf><char/></inbuf>
11106           <description>
11107             The key of the property to retrieve, encoded as a
11108             <internallink id="mUTF">modified UTF-8</internallink> string.
11109           </description>
11110         </param>
11111         <param id="value_ptr">
11112           <allocbuf><char/></allocbuf>
11113           <description>
11114             On return, points to the property value, encoded as a
11115             <internallink id="mUTF">modified UTF-8</internallink> string.
11116           </description>
11117         </param>
11118       </parameters>
11119       <errors>
11120         <error id="JVMTI_ERROR_NOT_AVAILABLE"> 
11121           This property is not available.
11122           Use <functionlink id="GetSystemProperties"/> to find available properties.
11123         </error>
11124       </errors>
11125     </function>
11126 
11127     <function id="SetSystemProperty" phase="onloadOnly" num="132">
11128       <synopsis>Set System Property</synopsis>
11129       <description>
11130         Set a VM system property value.  
11131         <p/>
11132         The function <functionlink id="GetSystemProperties"/>
11133         returns the set of property keys, some of these may be settable.
11134         See <functionlink id="GetSystemProperty"/>.
11135       </description>
11136       <origin>new</origin>
11137       <capabilities>
11138       </capabilities>
11139       <parameters>
11140         <param id="property">
11141           <inbuf><char/></inbuf>
11142           <description>
11143             The key of the property, encoded as a
11144             <internallink id="mUTF">modified UTF-8</internallink> string.
11145           </description>
11146         </param>
11147         <param id="value_ptr">
11148           <inbuf>
11149             <char/>
11150             <nullok>
11151               do not set the value, but return <errorlink id="JVMTI_ERROR_NOT_AVAILABLE"/>
11152               if the property is not writeable
11153             </nullok>
11154           </inbuf>
11155           <description>
11156             The property value to set, encoded as a
11157             <internallink id="mUTF">modified UTF-8</internallink> string.
11158           </description>
11159         </param>
11160       </parameters>
11161       <errors>
11162         <error id="JVMTI_ERROR_NOT_AVAILABLE"> 
11163           This property is not available or is not writeable.
11164         </error>
11165       </errors>
11166     </function>
11167 
11168   </category>
11169 
11170   <category id="general" label="General">
11171 
11172     <intro>
11173     </intro>
11174 
11175     <function id="GetPhase" jkernel="yes" phase="any" num="133">
11176       <synopsis>Get Phase</synopsis>
11177       <description>
11178           Return the current phase of VM execution.  
11179           The phases proceed in sequence:
11180           <constants id="jvmtiPhase" label="Phases of execution" kind="enum">
11181             <constant id="JVMTI_PHASE_ONLOAD" num="1">
11182               <code>OnLoad</code> phase: while in the
11183               <internallink id="onload"><code>Agent_OnLoad</code></internallink>
11184               or, for statically linked agents, the <internallink id="onload">
11185               <code>Agent_OnLoad_&lt;agent-lib-name&gt;
11186               </code></internallink> function.
11187             </constant>
11188             <constant id="JVMTI_PHASE_PRIMORDIAL" num="2">
11189               Primordial phase: between return from <code>Agent_OnLoad</code>
11190               or <code>Agent_OnLoad_&lt;agent-lib-name&gt;</code> and the
11191               <code>VMStart</code> event.
11192             </constant>
11193             <constant id="JVMTI_PHASE_START" num="6">
11194               Start phase: when the <eventlink id="VMStart"><code>VMStart</code></eventlink> event 
11195               is sent and until the <code>VMInit</code> event is sent.
11196             </constant>
11197             <constant id="JVMTI_PHASE_LIVE" num="4">
11198               Live phase: when the <eventlink id="VMInit"><code>VMInit</code></eventlink> event is sent
11199               and until the <eventlink id="VMDeath"></eventlink> event returns.
11200             </constant>
11201             <constant id="JVMTI_PHASE_DEAD" num="8">
11202               Dead phase: after the <eventlink id="VMDeath"></eventlink> event returns or after
11203               start-up failure.
11204             </constant>
11205           </constants>
11206           In the case of start-up failure the VM will proceed directly to the dead
11207           phase skipping intermediate phases and neither a <code>VMInit</code> nor
11208           <code>VMDeath</code> event will be sent.
11209           <p/>
11210           Most <jvmti/> functions operate only in the live phase.
11211           The following functions operate in either the <code>OnLoad</code> or live phases:
11212           <functionphaselist phase="onload"/>
11213           The following functions operate in only the <code>OnLoad</code> phase:
11214           <functionphaselist phase="onloadOnly"/>
11215           The following functions operate in the start or live phases:
11216           <functionphaselist phase="start"/>
11217           The following functions operate in any phase:
11218           <functionphaselist phase="any"/>
11219           JNI functions (except the Invocation API) must only be used in the start or live phases.
11220           <p/>
11221           Most <jvmti/> events are sent only in the live phase.
11222           The following events operate in others phases:
11223           <eventphaselist phase="start"/>          
11224           <eventphaselist phase="any"/>          
11225       </description>
11226       <origin>new</origin>
11227       <capabilities>
11228       </capabilities>
11229       <parameters>
11230         <param id="phase_ptr">
11231           <outptr><enum>jvmtiPhase</enum></outptr>
11232           <description>
11233             On return, points to the phase.
11234           </description>
11235         </param>
11236       </parameters>
11237       <errors>
11238       </errors>
11239     </function>
11240 
11241     <function id="DisposeEnvironment" jkernel="yes" phase="any" num="127">
11242       <synopsis>Dispose Environment</synopsis>
11243       <description>
11244         Shutdown a <jvmti/> connection created with JNI <code>GetEnv</code>
11245         (see <internallink id="environments"><jvmti/> Environments</internallink>).
11246         Dispose of any resources held by the environment.  
11247         <issue>
11248             What resources are reclaimed? What is undone?
11249             Breakpoints,watchpoints removed?
11250         </issue>
11251         Threads suspended by this environment are not resumed by this call,
11252         this must be done explicitly by the agent.
11253         Memory allocated by this environment via calls to <jvmti/> functions
11254         is not released, this can be done explicitly by the agent
11255         by calling <functionlink id="Deallocate"/>.
11256         Raw monitors created by this environment are not destroyed, 
11257         this can be done explicitly by the agent
11258         by calling <functionlink id="DestroyRawMonitor"/>.
11259         The state of threads waiting on raw monitors created by this environment
11260         are not affected.
11261         <p/>
11262         Any <functionlink id="SetNativeMethodPrefix">native method
11263         prefixes</functionlink> for this environment will be unset;
11264         the agent must remove any prefixed native methods before
11265         dispose is called.
11266         <p/>
11267         Any <internallink id="capability">capabilities</internallink>
11268         held by this environment are relinquished.
11269         <p/>
11270         Events enabled by this environment will no longer be sent, however
11271         event handlers currently running will continue to run.  Caution must
11272         be exercised in the design of event handlers whose environment may
11273         be disposed and thus become invalid during their execution.
11274         <p/>
11275         This environment may not be used after this call.
11276         This call returns to the caller.
11277       </description>
11278       <origin>new</origin>
11279       <capabilities>
11280       </capabilities>
11281       <parameters>
11282       </parameters>
11283       <errors>
11284       </errors>
11285     </function>
11286 
11287     <function id="SetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="148">
11288       <synopsis>Set Environment Local Storage</synopsis>
11289       <description>
11290         The VM stores a pointer value associated with each environment.
11291         This pointer value is called <i>environment-local storage</i>.
11292         This value is <code>NULL</code> unless set with this function.
11293         Agents can allocate memory in which they store environment specific
11294         information. By setting environment-local storage it can then be
11295         accessed with 
11296         <functionlink id="GetEnvironmentLocalStorage"></functionlink>.
11297         <p/>
11298         Called by the agent to set the value of the <jvmti/>
11299         environment-local storage. <jvmti/> supplies to the agent a pointer-size
11300         environment-local storage that can be used to record per-environment
11301         information.
11302       </description>
11303       <origin>new</origin>
11304       <capabilities>
11305       </capabilities>
11306       <parameters>
11307         <param id="data">
11308           <inbuf> 
11309             <void/> 
11310             <nullok>value is set to <code>NULL</code></nullok> 
11311           </inbuf> 
11312           <description>
11313             The value to be entered into the environment-local storage.
11314           </description>
11315         </param>
11316       </parameters>
11317       <errors>
11318       </errors>
11319     </function>
11320 
11321     <function id="GetEnvironmentLocalStorage" jkernel="yes" phase="any" callbacksafe="safe" impl="innative notrace" num="147">
11322       <synopsis>Get Environment Local Storage</synopsis>
11323       <description>
11324         Called by the agent to get the value of the <jvmti/> environment-local
11325         storage. 
11326       </description>
11327       <origin>new</origin>
11328       <capabilities>
11329       </capabilities>
11330       <parameters>
11331         <param id="data_ptr">
11332           <agentbuf><void/></agentbuf>
11333           <description>
11334             Pointer through which the value of the environment local 
11335             storage is returned.
11336             If environment-local storage has not been set with
11337             <functionlink id="SetEnvironmentLocalStorage"></functionlink> returned 
11338             pointer is <code>NULL</code>.
11339           </description>
11340         </param>
11341       </parameters>
11342       <errors>
11343       </errors>
11344     </function>
11345 
11346     <function id="GetVersionNumber" jkernel="yes" phase="any" num="88">
11347       <synopsis>Get Version Number</synopsis>
11348       <description>
11349         Return the <jvmti/> version via <code>version_ptr</code>.
11350         The return value is the version identifier. 
11351         The version identifier includes major, minor and micro
11352         version as well as the interface type.
11353         <constants id="jvmtiVersionInterfaceTypes" label="Version Interface Types" kind="bits">
11354           <constant id="JVMTI_VERSION_INTERFACE_JNI" num="0x00000000">
11355             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for JNI.
11356           </constant>
11357           <constant id="JVMTI_VERSION_INTERFACE_JVMTI" num="0x30000000">
11358             Value of <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> for <jvmti/>.
11359           </constant>
11360         </constants>
11361         <constants id="jvmtiVersionMasks" label="Version Masks" kind="bits">
11362           <constant id="JVMTI_VERSION_MASK_INTERFACE_TYPE" num="0x70000000">
11363             Mask to extract interface type.  
11364             The value of the version returned by this function masked with
11365             <code>JVMTI_VERSION_MASK_INTERFACE_TYPE</code> is always
11366             <code>JVMTI_VERSION_INTERFACE_JVMTI</code> 
11367             since this is a <jvmti/> function.
11368           </constant>
11369           <constant id="JVMTI_VERSION_MASK_MAJOR" num="0x0FFF0000">
11370             Mask to extract major version number.
11371           </constant>
11372           <constant id="JVMTI_VERSION_MASK_MINOR" num="0x0000FF00">
11373             Mask to extract minor version number.
11374           </constant>
11375           <constant id="JVMTI_VERSION_MASK_MICRO" num="0x000000FF">
11376             Mask to extract micro version number.
11377           </constant>
11378         </constants>
11379         <constants id="jvmtiVersionShifts" label="Version Shifts" kind="bits">
11380           <constant id="JVMTI_VERSION_SHIFT_MAJOR" num="16">
11381             Shift to extract major version number.
11382           </constant>
11383           <constant id="JVMTI_VERSION_SHIFT_MINOR" num="8">
11384             Shift to extract minor version number.
11385           </constant>
11386           <constant id="JVMTI_VERSION_SHIFT_MICRO" num="0">
11387             Shift to extract micro version number.
11388           </constant>
11389         </constants>
11390       </description>
11391       <origin>jvmdi</origin>
11392       <capabilities>
11393       </capabilities>
11394       <parameters>
11395         <param id="version_ptr">
11396           <outptr><jint/></outptr>
11397           <description>
11398             On return, points to the <jvmti/> version.
11399           </description>
11400         </param>
11401       </parameters>
11402       <errors>
11403       </errors>
11404     </function>
11405 
11406 
11407     <function id="GetErrorName" phase="any" num="128">
11408       <synopsis>Get Error Name</synopsis>
11409       <description>
11410         Return the symbolic name for an 
11411           <internallink id="ErrorSection">error code</internallink>.  
11412         <p/>
11413         For example 
11414         <code>GetErrorName(env, JVMTI_ERROR_NONE, &amp;err_name)</code> 
11415         would return in <code>err_name</code> the string
11416         <code>"JVMTI_ERROR_NONE"</code>.
11417       </description>
11418       <origin>new</origin>
11419       <capabilities>
11420       </capabilities>
11421       <parameters>
11422         <param id="error">
11423           <enum>jvmtiError</enum>
11424           <description>
11425             The error code.
11426           </description>
11427         </param>
11428         <param id="name_ptr">
11429           <allocbuf><char/></allocbuf>
11430           <description>
11431             On return, points to the error name.
11432             The name is encoded as a
11433             <internallink id="mUTF">modified UTF-8</internallink> string,
11434             but is restricted to the ASCII subset.
11435           </description>
11436         </param>
11437       </parameters>
11438       <errors>
11439       </errors>
11440     </function>
11441 
11442     <function id="SetVerboseFlag" phase="any" num="150">
11443       <synopsis>Set Verbose Flag</synopsis>
11444       <description>
11445         <constants id="jvmtiVerboseFlag" label="Verbose Flag Enumeration" kind="enum">
11446           <constant id="JVMTI_VERBOSE_OTHER" num="0">
11447             Verbose output other than the below.
11448           </constant>
11449           <constant id="JVMTI_VERBOSE_GC" num="1">
11450             Verbose garbage collector output, like that specified with <code>-verbose:gc</code>.
11451           </constant>
11452           <constant id="JVMTI_VERBOSE_CLASS" num="2">
11453             Verbose class loading output, like that specified with <code>-verbose:class</code>.
11454           </constant>
11455           <constant id="JVMTI_VERBOSE_JNI" num="4">
11456             Verbose JNI output, like that specified with <code>-verbose:jni</code>.
11457           </constant>
11458         </constants>
11459         Control verbose output.
11460         This is the output which typically is sent to <code>stderr</code>. 
11461       </description>
11462       <origin>new</origin>
11463       <capabilities>
11464       </capabilities>
11465       <parameters>
11466         <param id="flag">
11467           <enum>jvmtiVerboseFlag</enum>
11468           <description>
11469             Which verbose flag to set.
11470           </description>
11471         </param>
11472         <param id="value">
11473           <jboolean/>
11474           <description>
11475             New value of the flag.
11476           </description>
11477         </param>
11478       </parameters>
11479       <errors>
11480       </errors>
11481     </function>
11482 
11483 
11484     <function id="GetJLocationFormat" phase="any" num="129">
11485       <synopsis>Get JLocation Format</synopsis>
11486       <description>
11487         Although the greatest functionality is achieved with location information
11488         referencing the virtual machine bytecode index, the definition of
11489         <code>jlocation</code> has intentionally been left unconstrained to allow VM 
11490         implementations that do not have this information.
11491         <p/>
11492         This function describes the representation of <code>jlocation</code> used in this VM.
11493         If the returned format is <datalink id="JVMTI_JLOCATION_JVMBCI"></datalink>, 
11494         <code>jlocation</code>s can
11495         be used as in indices into the array returned by
11496         <functionlink id="GetBytecodes"></functionlink>.  
11497         <constants id="jvmtiJlocationFormat" label="JLocation Format Enumeration" kind="enum">
11498           <constant id="JVMTI_JLOCATION_JVMBCI" num="1">
11499             <code>jlocation</code> values represent virtual machine 
11500             bytecode indices--that is, offsets into the 
11501             virtual machine code for a method.
11502           </constant>
11503           <constant id="JVMTI_JLOCATION_MACHINEPC" num="2">
11504             <code>jlocation</code> values represent native machine
11505             program counter values.
11506           </constant>
11507           <constant id="JVMTI_JLOCATION_OTHER" num="0">
11508             <code>jlocation</code> values have some other representation.
11509           </constant>
11510         </constants>
11511       </description>
11512       <origin>new</origin>
11513       <capabilities>
11514       </capabilities>
11515       <parameters>
11516         <param id="format_ptr">
11517           <outptr><enum>jvmtiJlocationFormat</enum></outptr>
11518           <description>
11519             On return, points to the format identifier for <code>jlocation</code> values.
11520           </description>
11521         </param>
11522       </parameters>
11523       <errors>
11524       </errors>
11525     </function>
11526 
11527   </category>
11528 
11529 </functionsection>
11530 
11531 <errorsection label="Error Reference">
11532   <intro>
11533     Every <jvmti/> function returns a <b><code>jvmtiError</code></b> error code.
11534     <p/>
11535     It is the responsibility of the agent to call <jvmti/> functions with 
11536     valid parameters and in the proper context (calling thread is attached,
11537     phase is correct, etc.).  
11538     Detecting some error conditions may be difficult, inefficient, or 
11539     impossible for an implementation.
11540     The errors listed in 
11541     <internallink id="reqerrors">Function Specific Required Errors</internallink>
11542     must be detected by the implementation.
11543     All other errors represent the recommended response to the error
11544     condition. 
11545   </intro>
11546 
11547   <errorcategory id="universal-error" label="Universal Errors">
11548     <intro>
11549       The following errors may be returned by any function
11550     </intro>
11551 
11552     <errorid id="JVMTI_ERROR_NONE" num="0">
11553       No error has occurred.  This is the error code that is returned
11554       on successful completion of the function.
11555     </errorid>
11556     <errorid id="JVMTI_ERROR_NULL_POINTER" num="100">
11557       Pointer is unexpectedly <code>NULL</code>.
11558     </errorid>
11559     <errorid id="JVMTI_ERROR_OUT_OF_MEMORY" num="110">
11560       The function attempted to allocate memory and no more memory was 
11561       available for allocation.
11562     </errorid>
11563     <errorid id="JVMTI_ERROR_ACCESS_DENIED" num="111">
11564       The desired functionality has not been enabled in this virtual machine.
11565     </errorid>
11566     <errorid id="JVMTI_ERROR_UNATTACHED_THREAD" num="115">
11567       The thread being used to call this function is not attached
11568       to the virtual machine.  Calls must be made from attached threads.
11569       See <code>AttachCurrentThread</code> in the JNI invocation API.
11570     </errorid>
11571     <errorid id="JVMTI_ERROR_INVALID_ENVIRONMENT" num="116">
11572       The <jvmti/> environment provided is no longer connected or is
11573       not an environment.
11574     </errorid>
11575     <errorid id="JVMTI_ERROR_WRONG_PHASE" num="112">
11576       The desired functionality is not available in the current
11577         <functionlink id="GetPhase">phase</functionlink>.
11578       Always returned if the virtual machine has completed running.
11579     </errorid>
11580     <errorid id="JVMTI_ERROR_INTERNAL" num="113">
11581       An unexpected internal error has occurred.
11582     </errorid>
11583   </errorcategory>
11584 
11585   <errorcategory id="reqerrors" label="Function Specific Required Errors">
11586     <intro>
11587       The following errors are returned by some <jvmti/> functions and must
11588       be returned by the implementation when the condition occurs.
11589     </intro>
11590 
11591     <errorid id="JVMTI_ERROR_INVALID_PRIORITY" num="12">
11592       Invalid priority.
11593     </errorid>
11594     <errorid id="JVMTI_ERROR_THREAD_NOT_SUSPENDED" num="13">
11595       Thread was not suspended.
11596     </errorid>
11597     <errorid id="JVMTI_ERROR_THREAD_SUSPENDED" num="14">
11598       Thread already suspended.
11599     </errorid>
11600     <errorid id="JVMTI_ERROR_THREAD_NOT_ALIVE" num="15">
11601       This operation requires the thread to be alive--that is,
11602       it must be started and not yet have died.
11603     </errorid>
11604     <errorid id="JVMTI_ERROR_CLASS_NOT_PREPARED" num="22">
11605       The class has been loaded but not yet prepared.
11606     </errorid>
11607     <errorid id="JVMTI_ERROR_NO_MORE_FRAMES" num="31">
11608       There are no Java programming language or JNI stack frames at the specified depth.
11609     </errorid>
11610     <errorid id="JVMTI_ERROR_OPAQUE_FRAME" num="32">
11611       Information about the frame is not available (e.g. for native frames).
11612     </errorid>
11613     <errorid id="JVMTI_ERROR_DUPLICATE" num="40">
11614       Item already set.
11615     </errorid>
11616     <errorid id="JVMTI_ERROR_NOT_FOUND" num="41">
11617       Desired element (e.g. field or breakpoint) not found
11618     </errorid>
11619     <errorid id="JVMTI_ERROR_NOT_MONITOR_OWNER" num="51">
11620       This thread doesn't own the raw monitor.
11621     </errorid>
11622     <errorid id="JVMTI_ERROR_INTERRUPT" num="52">
11623       The call has been interrupted before completion.
11624     </errorid>
11625     <errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79">
11626       The class cannot be modified.
11627     </errorid>
11628     <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80">
11629       The module cannot be modified.
11630     </errorid>
11631     <errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98">
11632       The functionality is not available in this virtual machine.
11633     </errorid>
11634     <errorid id="JVMTI_ERROR_ABSENT_INFORMATION" num="101">
11635       The requested information is not available.
11636     </errorid>
11637     <errorid id="JVMTI_ERROR_INVALID_EVENT_TYPE" num="102">
11638       The specified event type ID is not recognized.
11639     </errorid>
11640     <errorid id="JVMTI_ERROR_NATIVE_METHOD" num="104">
11641       The requested information is not available for native method.
11642     </errorid>
11643     <errorid id="JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED" num="106">
11644       The class loader does not support this operation.
11645     </errorid>
11646   </errorcategory>
11647 
11648   <errorcategory id="function-specific-errors" label="Function Specific Agent Errors">
11649     <intro>
11650       The following errors are returned by some <jvmti/> functions.
11651       They are returned in the event of invalid parameters passed by the
11652       agent or usage in an invalid context.  
11653       An implementation is not required to detect these errors.
11654     </intro>
11655 
11656     <errorid id="JVMTI_ERROR_INVALID_THREAD" num="10">
11657       The passed thread is not a valid thread.
11658     </errorid>
11659     <errorid id="JVMTI_ERROR_INVALID_FIELDID" num="25">
11660       Invalid field.
11661     </errorid>
11662     <errorid id="JVMTI_ERROR_INVALID_MODULE" num="26">
11663       Invalid module.
11664     </errorid>
11665     <errorid id="JVMTI_ERROR_INVALID_METHODID" num="23">
11666       Invalid method.
11667     </errorid>
11668     <errorid id="JVMTI_ERROR_INVALID_LOCATION" num="24">
11669       Invalid location.
11670     </errorid>
11671     <errorid id="JVMTI_ERROR_INVALID_OBJECT" num="20">
11672       Invalid object.
11673     </errorid>
11674     <errorid id="JVMTI_ERROR_INVALID_CLASS" num="21">
11675       Invalid class.
11676     </errorid>
11677     <errorid id="JVMTI_ERROR_TYPE_MISMATCH" num="34">
11678       The variable is not an appropriate type for the function used.
11679     </errorid>
11680     <errorid id="JVMTI_ERROR_INVALID_SLOT" num="35">
11681       Invalid slot.
11682     </errorid>
11683     <errorid id="JVMTI_ERROR_MUST_POSSESS_CAPABILITY" num="99">
11684       The capability being used is false in this environment.
11685     </errorid>
11686     <errorid id="JVMTI_ERROR_INVALID_THREAD_GROUP" num="11">
11687       Thread group invalid.
11688     </errorid>
11689     <errorid id="JVMTI_ERROR_INVALID_MONITOR" num="50">
11690       Invalid raw monitor.
11691     </errorid>
11692     <errorid id="JVMTI_ERROR_ILLEGAL_ARGUMENT" num="103">
11693       Illegal argument.
11694     </errorid>
11695     <errorid id="JVMTI_ERROR_INVALID_TYPESTATE" num="65">
11696       The state of the thread has been modified, and is now inconsistent.
11697     </errorid>
11698     <errorid id="JVMTI_ERROR_UNSUPPORTED_VERSION" num="68">
11699       A new class file has a version number not supported by this VM.
11700     </errorid>
11701     <errorid id="JVMTI_ERROR_INVALID_CLASS_FORMAT" num="60">
11702       A new class file is malformed (the VM would return a <code>ClassFormatError</code>).
11703     </errorid>
11704     <errorid id="JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION" num="61">
11705       The new class file definitions would lead to a circular
11706       definition (the VM would return a <code>ClassCircularityError</code>).
11707     </errorid>
11708     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED" num="63">
11709       A new class file would require adding a method.
11710     </errorid>
11711     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED" num="64">
11712       A new class version changes a field.
11713     </errorid>
11714     <errorid id="JVMTI_ERROR_FAILS_VERIFICATION" num="62">
11715       The class bytes fail verification.
11716     </errorid>
11717     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED" num="66">
11718       A direct superclass is different for the new class
11719       version, or the set of directly implemented
11720       interfaces is different.
11721     </errorid>
11722     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED" num="67">
11723       A new class version does not declare a method
11724       declared in the old class version.
11725     </errorid>
11726     <errorid id="JVMTI_ERROR_NAMES_DONT_MATCH" num="69">
11727       The class name defined in the new class file is 
11728       different from the name in the old class object.
11729     </errorid>
11730     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED" num="70">
11731       A new class version has different modifiers.
11732     </errorid>
11733     <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED" num="71">
11734       A method in the new class version has different modifiers
11735       than its counterpart in the old class version.
11736     </errorid>
11737   </errorcategory>
11738 </errorsection>
11739 
11740 <eventsection label="Events">
11741   <intro label="Handling Events" id="eventIntro">
11742     Agents can be informed of many events that occur in application
11743     programs.
11744     <p/>
11745     To handle events, designate a set of callback functions with
11746     <functionlink id="SetEventCallbacks"></functionlink>. 
11747     For each event the corresponding callback function will be 
11748     called.
11749     Arguments to the callback function provide additional
11750     information about the event. 
11751     <p/>
11752     The callback function is usually called from within an application 
11753     thread. The <jvmti/> implementation does not 
11754     queue events in any way. This means
11755     that event callback functions must be written 
11756     carefully. Here are some general guidelines. See 
11757     the individual event descriptions for further
11758     suggestions.
11759     <p/>
11760     <ul>
11761       <li>Any exception thrown during the execution of an event callback can 
11762         overwrite any current pending exception in the current application thread.
11763         Care must be taken to preserve a pending exception
11764         when an event callback makes a JNI call that might generate an exception.
11765       </li>
11766       <li>Event callback functions must be re-entrant. The <jvmti/> implementation does
11767         not queue events. If an agent needs to process events one at a time, it 
11768         can use a raw monitor inside the 
11769         event callback functions to serialize event processing.
11770       </li>
11771       <li>Event callback functions that execute JNI's FindClass function to load
11772         classes need to note that FindClass locates the class loader associated 
11773         with the current native method. For the purposes of class loading, an
11774         event callback that includes a JNI environment as a parameter to the
11775         callback will treated as if it is a native call, where the native method
11776         is in the class of the event thread's current frame.
11777       </li>
11778     </ul>
11779     <p/>
11780     Some <jvmti/> events identify objects with JNI references. 
11781     All references 
11782     in <jvmti/> events are JNI local references and will become invalid
11783     after the event callback returns.
11784     Unless stated otherwise, memory referenced by pointers sent in event
11785     callbacks may not be referenced after the event callback returns.
11786     <p/>
11787     Except where stated otherwise, events are delivered on the thread
11788     that caused the event.
11789     Events are sent at the time they occur.
11790     The specification for each event includes the set of
11791     <functionlink id="GetPhase">phases</functionlink> in which it can be sent;
11792     if an event triggering activity occurs during another phase, no event 
11793     is sent. 
11794     <p/>
11795     A thread that generates an event does not change its execution status
11796     (for example, the event does not cause the thread to be suspended).
11797     If an agent wishes the event to result in suspension, then the agent
11798     is responsible for explicitly suspending the thread with 
11799     <functionlink id="SuspendThread"></functionlink>.
11800     <p/>
11801     If an event is enabled in multiple environments, the event will be sent
11802     to each agent in the order that the environments were created.
11803   </intro>
11804 
11805   <intro label="Enabling Events" id="enablingevents">
11806     All events are initially disabled.  In order to receive any
11807     event:
11808       <ul>
11809         <li>
11810           If the event requires a capability, that capability must
11811           be added with 
11812           <functionlink id="AddCapabilities"></functionlink>.
11813         </li>
11814         <li>
11815           A callback for the event must be set with 
11816           <functionlink id="SetEventCallbacks"></functionlink>.
11817         </li>
11818         <li>
11819           The event must be enabled with
11820           <functionlink id="SetEventNotificationMode"></functionlink>. 
11821         </li>
11822       </ul>
11823   </intro>
11824 
11825   <intro label="Multiple Co-located Events" id="eventorder">
11826     In many situations it is possible for multiple events to occur 
11827     at the same location in one thread. When this happens, all the events 
11828     are reported through the event callbacks in the order specified in this section.
11829     <p/>
11830     If the current location is at the entry point of a method, the 
11831     <eventlink id="MethodEntry"></eventlink> event is reported before
11832     any other event at the current location in the same thread.
11833     <p/>
11834     If an exception catch has been detected at the current location,
11835     either because it is the beginning of a catch clause or a native method
11836     that cleared a pending exception has returned, the
11837     <code>exceptionCatch</code> event is reported before
11838     any other event at the current location in the same thread.
11839     <p/>
11840     If a <code>singleStep</code> event or 
11841     <code>breakpoint</code> event is triggered at the 
11842     current location, the event is defined to occur 
11843     immediately before the code at the current location is executed. 
11844     These events are reported before any events which are triggered 
11845     by the execution of code at the current location in the same 
11846     thread (specifically: 
11847     <code>exception</code>,
11848     <code>fieldAccess</code>, and
11849     <code>fieldModification</code>).
11850     If both a step and breakpoint event are triggered for the same thread and 
11851     location, the step event is reported before the breakpoint event.
11852     <p/>
11853     If the current location is the exit point of a method (that is, the last
11854     location before returning to the caller), the 
11855     <eventlink id="MethodExit"></eventlink> event and 
11856     the <eventlink id="FramePop"></eventlink> event (if requested)
11857     are reported after all other events at the current location in the same
11858     thread. There is no specified ordering of these two events 
11859     with respect to each other.
11860     <p/>
11861     Co-located events can be triggered during the processing of some other
11862     event by the agent at the same location in the same thread.
11863     If such an event, of type <i>y</i>, is triggered during the processing of 
11864     an event of type <i>x</i>, and if <i>x</i> 
11865     precedes <i>y</i> in the ordering specified above, the co-located event 
11866     <i>y</i> is reported for the current thread and location. If <i>x</i> does not precede
11867     <i>y</i>, <i>y</i> is not reported for the current thread and location.
11868     For example, if a breakpoint is set at the current location 
11869     during the processing of <eventlink id="SingleStep"></eventlink>,
11870     that breakpoint will be reported before the thread moves off the current 
11871     location.
11872     <p/>The following events are never considered to be co-located with 
11873     other events.
11874     <ul>
11875       <li><eventlink id="VMStart"></eventlink></li>
11876       <li><eventlink id="VMInit"></eventlink></li>
11877       <li><eventlink id="VMDeath"></eventlink></li>
11878       <li><eventlink id="ThreadStart"></eventlink></li>
11879       <li><eventlink id="ThreadEnd"></eventlink></li>
11880       <li><eventlink id="ClassLoad"></eventlink></li>
11881       <li><eventlink id="ClassPrepare"></eventlink></li>
11882     </ul>
11883   </intro>
11884 
11885   <intro label="Event Callbacks" id="jvmtiEventCallbacks">
11886       The event callback structure below is used to specify the handler function
11887       for events.  It is set with the
11888       <functionlink id="SetEventCallbacks"></functionlink> function. 
11889   </intro>
11890 
11891   <event label="Single Step"
11892          id="SingleStep" const="JVMTI_EVENT_SINGLE_STEP" filtered="thread" num="60">
11893     <description>
11894       Single step events allow the agent to trace thread execution
11895       at the finest granularity allowed by the VM. A single step event is
11896       generated whenever a thread reaches a new location. 
11897       Typically, single step events represent the completion of one VM 
11898       instruction as defined in <vmspec/>. However, some implementations 
11899       may define locations differently. In any case the 
11900       <code>method</code> and <code>location</code>
11901       parameters  uniquely identify the current location and allow
11902       the mapping to source file and line number when that information is 
11903       available.
11904       <p/>
11905       No single step events are generated from within native methods.
11906     </description>
11907     <origin>jvmdi</origin>
11908     <capabilities>
11909       <required id="can_generate_single_step_events"></required>
11910     </capabilities>
11911     <parameters> 
11912       <param id="jni_env">
11913         <outptr>
11914           <struct>JNIEnv</struct>
11915         </outptr>
11916           <description>
11917             The JNI environment of the event (current) thread
11918           </description>
11919       </param>
11920       <param id="thread">
11921         <jthread/>
11922           <description>
11923             Thread about to execution a new instruction
11924           </description>
11925       </param>
11926       <param id="klass">
11927         <jclass method="method"/>
11928           <description>
11929             Class of the method about to execute a new instruction
11930           </description>
11931       </param>
11932       <param id="method">
11933         <jmethodID class="klass"/>
11934           <description>
11935             Method about to execute a new instruction
11936           </description>
11937       </param>
11938       <param id="location">
11939         <jlocation/>
11940         <description>
11941           Location of the new instruction
11942         </description>
11943       </param>
11944     </parameters>
11945   </event>
11946 
11947   <event label="Breakpoint"
11948          id="Breakpoint" const="JVMTI_EVENT_BREAKPOINT" filtered="thread" num="62">
11949     <description>
11950       Breakpoint events are generated whenever a thread reaches a location
11951       designated as a breakpoint with <functionlink id="SetBreakpoint"></functionlink>.
11952       The <code>method</code> and <code>location</code>
11953       parameters uniquely identify the current location and allow
11954       the mapping to source file and line number when that information is 
11955       available.
11956     </description>
11957     <origin>jvmdi</origin>
11958     <capabilities>
11959       <required id="can_generate_breakpoint_events"></required>
11960     </capabilities>
11961     <parameters> 
11962       <param id="jni_env">
11963         <outptr>
11964           <struct>JNIEnv</struct>
11965         </outptr>
11966           <description>
11967             The JNI environment of the event (current) thread.
11968           </description>
11969       </param>
11970       <param id="thread">
11971         <jthread/>
11972           <description>
11973             Thread that hit the breakpoint
11974           </description>
11975       </param>
11976       <param id="klass">
11977         <jclass method="method"/>
11978           <description>
11979             Class of the method that hit the breakpoint
11980           </description>
11981       </param>
11982       <param id="method">
11983         <jmethodID class="klass"/>
11984           <description>
11985             Method that hit the breakpoint
11986           </description>
11987       </param>
11988       <param id="location">
11989         <jlocation/>
11990         <description>
11991           location of the breakpoint
11992         </description>
11993       </param>
11994     </parameters>
11995   </event>
11996 
11997   <event label="Field Access"
11998          id="FieldAccess" const="JVMTI_EVENT_FIELD_ACCESS" filtered="thread" num="63">
11999     <description>
12000       Field access events are generated whenever a thread accesses
12001       a field that was designated as a watchpoint 
12002       with <functionlink id="SetFieldAccessWatch"></functionlink>.
12003       The <code>method</code> and <code>location</code> 
12004       parameters uniquely identify the current location and allow
12005       the mapping to source file and line number when that information is 
12006       available. 
12007     </description>
12008     <origin>jvmdi</origin>
12009     <capabilities>
12010       <required id="can_generate_field_access_events"></required>
12011     </capabilities>
12012     <parameters> 
12013       <param id="jni_env">
12014         <outptr>
12015           <struct>JNIEnv</struct>
12016         </outptr>
12017           <description>
12018             The JNI environment of the event (current) thread
12019           </description>
12020       </param>
12021       <param id="thread">
12022         <jthread/>
12023           <description>
12024             Thread accessing the field
12025           </description>
12026       </param>
12027       <param id="klass">
12028         <jclass method="method"/>
12029           <description>
12030             Class of the method where the access is occurring
12031           </description>
12032       </param>
12033       <param id="method">
12034         <jmethodID class="klass"/>
12035           <description>
12036             Method where the access is occurring
12037           </description>
12038       </param>
12039       <param id="location">
12040         <jlocation/>
12041         <description>
12042           Location where the access is occurring
12043         </description>
12044       </param>
12045       <param id="field_klass">
12046         <jclass field="field"/>
12047           <description>
12048             Class of the field being accessed
12049           </description>
12050       </param>
12051       <param id="object">
12052         <jobject/>
12053           <description>
12054             Object with the field being accessed if the field is an
12055             instance field; <code>NULL</code> otherwise
12056           </description>
12057       </param>
12058       <param id="field">
12059         <jfieldID class="field_klass"/>
12060           <description>
12061             Field being accessed
12062           </description>
12063       </param>
12064     </parameters>
12065   </event>
12066 
12067   <event label="Field Modification"
12068          id="FieldModification" const="JVMTI_EVENT_FIELD_MODIFICATION" filtered="thread" num="64">
12069     <description>
12070       Field modification events are generated whenever a thread modifies
12071       a field that was designated as a watchpoint 
12072       with <functionlink id="SetFieldModificationWatch"></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_modification_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 modifying the field
12095           </description>
12096       </param>
12097       <param id="klass">
12098         <jclass method="method"/>
12099           <description>
12100             Class of the method where the modification is occurring
12101           </description>
12102       </param>
12103       <param id="method">
12104         <jmethodID class="klass"/>
12105           <description>
12106             Method where the modification is occurring
12107           </description>
12108       </param>
12109       <param id="location">
12110         <jlocation/>
12111         <description>
12112           Location where the modification is occurring
12113         </description>
12114       </param>
12115       <param id="field_klass">
12116         <jclass field="field"/>
12117           <description>
12118             Class of the field being modified
12119           </description>
12120       </param>
12121       <param id="object">
12122         <jobject/>
12123           <description>
12124             Object with the field being modified 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 modified
12132           </description>
12133       </param>
12134       <param id="signature_type">
12135         <char/>
12136         <description>
12137           Signature type of the new value
12138         </description>
12139       </param>
12140       <param id="new_value">
12141         <jvalue/>
12142         <description>
12143           The new value
12144         </description>
12145       </param>
12146     </parameters>
12147   </event>
12148 
12149   <event label="Frame Pop"
12150          id="FramePop" const="JVMTI_EVENT_FRAME_POP" filtered="thread" num="61">
12151     <description>
12152       Frame pop events are generated upon exit from a single method 
12153       in a single frame as specified
12154       in a call to <functionlink id="NotifyFramePop"></functionlink>.
12155       This is true whether termination is caused by
12156       executing its return instruction
12157       or by throwing an exception to its caller 
12158       (see <paramlink id="was_popped_by_exception"></paramlink>).
12159       However, frame pops caused by the <functionlink id="PopFrame"/> 
12160       function are not reported.
12161       <p/>
12162       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12163       identifies the executable location in the returning method, 
12164       immediately prior to the return. 
12165     </description>
12166     <origin>jvmdi</origin>
12167     <capabilities>
12168       <required id="can_generate_frame_pop_events"></required>
12169     </capabilities>
12170     <parameters> 
12171       <param id="jni_env">
12172         <outptr>
12173           <struct>JNIEnv</struct>
12174         </outptr>
12175           <description>
12176             The JNI environment of the event (current) thread
12177           </description>
12178       </param>
12179       <param id="thread">
12180         <jthread/>
12181           <description>
12182             Thread that is popping the frame
12183           </description>
12184       </param>
12185       <param id="klass">
12186         <jclass method="method"/>
12187           <description>
12188             Class of the method being popped
12189           </description>
12190       </param>
12191       <param id="method">
12192         <jmethodID class="klass"/>
12193           <description>
12194             Method being popped
12195           </description>
12196       </param>
12197       <param id="was_popped_by_exception">
12198         <jboolean/>
12199         <description>
12200           True if frame was popped by a thrown exception.
12201           False if method exited through its return instruction.
12202         </description>
12203       </param>
12204     </parameters>
12205   </event>
12206 
12207   <event label="Method Entry"
12208          id="MethodEntry" const="JVMTI_EVENT_METHOD_ENTRY" filtered="thread" num="65">
12209     <description>
12210       Method entry events are generated upon entry of Java 
12211       programming language methods (including native methods).
12212       <p/>
12213       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12214       identifies the initial executable location in
12215       the method. 
12216       <p/>
12217       Enabling method
12218       entry or exit events will significantly degrade performance on many platforms and is thus
12219       not advised for performance critical usage (such as profiling).
12220       <internallink id="bci">Bytecode instrumentation</internallink> should be 
12221       used in these cases.
12222     </description>
12223     <origin>jvmdi</origin>
12224     <capabilities>
12225       <required id="can_generate_method_entry_events"></required>
12226     </capabilities>
12227     <parameters> 
12228       <param id="jni_env">
12229         <outptr>
12230           <struct>JNIEnv</struct>
12231         </outptr>
12232           <description>
12233             The JNI environment of the event (current) thread
12234           </description>
12235       </param>
12236       <param id="thread">
12237         <jthread/>
12238           <description>
12239             Thread entering the method
12240           </description>
12241       </param>
12242       <param id="klass">
12243         <jclass method="method"/>
12244           <description>
12245             Class of the method being entered
12246           </description>
12247       </param>
12248       <param id="method">
12249         <jmethodID class="klass"/>
12250           <description>
12251             Method being entered
12252           </description>
12253       </param>
12254     </parameters>
12255   </event>
12256 
12257   <event label="Method Exit"
12258          id="MethodExit" const="JVMTI_EVENT_METHOD_EXIT" filtered="thread" num="66">
12259     <description>
12260       Method exit events are generated upon exit from Java 
12261       programming language methods (including native methods).
12262       This is true whether termination is caused by
12263       executing its return instruction
12264       or by throwing an exception to its caller 
12265       (see <paramlink id="was_popped_by_exception"></paramlink>).
12266       <p/>
12267       The <code>method</code> field uniquely identifies the
12268       method being entered or exited. The <code>frame</code> field provides 
12269       access to the stack frame for the method.
12270       <p/>
12271       The location reported by <functionlink id="GetFrameLocation"></functionlink>
12272       identifies the executable location in the returning method 
12273       immediately prior to the return. 
12274       <p/>
12275         Enabling method
12276         entry or exit events will significantly degrade performance on many platforms and is thus
12277         not advised for performance critical usage (such as profiling).
12278         <internallink id="bci">Bytecode instrumentation</internallink> should be 
12279         used in these cases.
12280     </description>
12281     <origin>jvmdi</origin>
12282     <capabilities>
12283       <required id="can_generate_method_exit_events"></required>
12284     </capabilities>
12285     <parameters>
12286       <param id="jni_env">
12287         <outptr>
12288           <struct>JNIEnv</struct>
12289         </outptr>
12290           <description>
12291             The JNI environment of the event (current) thread
12292           </description>
12293       </param>
12294       <param id="thread">
12295         <jthread/>
12296           <description>
12297             Thread exiting the method
12298           </description>
12299       </param>
12300       <param id="klass">
12301         <jclass method="method"/>
12302           <description>
12303             Class of the method being exited
12304           </description>
12305       </param>
12306       <param id="method">
12307         <jmethodID class="klass"/>
12308           <description>
12309             Method being exited
12310           </description>
12311       </param>
12312       <param id="was_popped_by_exception">
12313         <jboolean/>
12314         <description>
12315           True if frame was popped by a thrown exception.
12316           False if method exited through its return instruction.
12317         </description>
12318       </param>
12319       <param id="return_value">
12320         <jvalue/>
12321         <description>
12322           The return value of the method being exited.
12323           Undefined and should not be used if 
12324           <paramlink id="was_popped_by_exception"></paramlink>
12325           is true.
12326         </description>
12327       </param>
12328     </parameters>
12329   </event>
12330 
12331   <event label="Native Method Bind" phase="any"
12332          id="NativeMethodBind" const="JVMTI_EVENT_NATIVE_METHOD_BIND" num="67">
12333     <description>
12334       A Native Method Bind event is sent when a VM binds a 
12335       Java programming language native method
12336       to the address of a function that implements the native method. 
12337       This will occur when the native method is called for the first time
12338       and also occurs when the JNI function <code>RegisterNatives</code> is called.
12339       This event allows the bind to be redirected to an agent-specified
12340       proxy function. 
12341       This event is not sent when the native method is unbound.
12342       Typically, this proxy function will need to be specific to a 
12343       particular method or, to handle the general case, automatically
12344       generated assembly code, since after instrumentation code is 
12345       executed the function at the original binding 
12346       address will usually be invoked.
12347       The original binding can be restored or the redirection changed
12348       by use of the JNI function <code>RegisterNatives</code>.
12349       Some events may be sent during the primordial phase, JNI and
12350       most of <jvmti/> cannot be used at this time but the method and
12351       address can be saved for use later.
12352     </description>
12353     <origin>new</origin>
12354     <capabilities>
12355       <required id="can_generate_native_method_bind_events"></required>
12356     </capabilities>
12357     <parameters>
12358       <param id="jni_env">
12359         <outptr>
12360           <struct>JNIEnv</struct>
12361         </outptr>
12362           <description>
12363             The JNI environment of the event (current) thread
12364             Will be <code>NULL</code> if sent during the primordial 
12365             <functionlink id="GetPhase">phase</functionlink>.
12366           </description>
12367       </param>
12368       <param id="thread">
12369         <jthread/>
12370           <description>
12371             Thread requesting the bind
12372           </description>
12373       </param>
12374       <param id="klass">
12375         <jclass method="method"/>
12376           <description>
12377             Class of the method being bound
12378           </description>
12379       </param>
12380       <param id="method">
12381         <jmethodID class="klass"/>
12382           <description>
12383             Native method being bound
12384           </description>
12385       </param>
12386       <param id="address">
12387         <outptr><void/></outptr>
12388         <description>
12389           The address the VM is about to bind to--that is, the
12390           address of the implementation of the native method
12391         </description>
12392       </param>
12393       <param id="new_address_ptr">
12394         <agentbuf><void/></agentbuf>
12395         <description>
12396           if the referenced address is changed (that is, if
12397           <code>*new_address_ptr</code> is set), the binding
12398           will instead be made to the supplied address.
12399         </description>
12400       </param>
12401     </parameters>
12402   </event>
12403 
12404   <event label="Exception"
12405          id="Exception" const="JVMTI_EVENT_EXCEPTION" filtered="thread" num="58">
12406     <description>
12407       Exception events are generated whenever an exception is first detected
12408       in a Java programming language method. 
12409       Where "exception" means any <code>java.lang.Throwable</code>.
12410       The exception may have been thrown by a Java programming language or native
12411       method, but in the case of native methods, the event is not generated
12412       until the exception is first seen by a Java programming language method. If an exception is
12413       set and cleared in a native method (and thus is never visible to Java programming language code),
12414       no exception event is generated.
12415       <p/>
12416       The <code>method</code> and <code>location</code>
12417       parameters  uniquely identify the current location 
12418       (where the exception was detected) and allow
12419       the mapping to source file and line number when that information is 
12420       available. The <code>exception</code> field identifies the thrown
12421       exception object. The <code>catch_method</code>
12422       and <code>catch_location</code> identify the location of the catch clause,
12423       if any, that handles the thrown exception. If there is no such catch clause,
12424       each field is set to 0. There is no guarantee that the thread will ever
12425       reach this catch clause. If there are native methods on the call stack
12426       between the throw location and the catch clause, the exception may 
12427       be reset by one of those native methods.
12428       Similarly, exceptions that are reported as uncaught (<code>catch_klass</code>
12429       et al. set to 0) may in fact be caught by native code.
12430       Agents can check for these occurrences by monitoring 
12431       <eventlink id="ExceptionCatch"></eventlink> events.
12432       Note that finally clauses are implemented as catch and re-throw. Therefore they
12433       will be reported in the catch location.
12434     </description>
12435     <origin>jvmdi</origin>
12436     <capabilities>
12437       <required id="can_generate_exception_events"></required>
12438     </capabilities>
12439     <parameters> 
12440       <param id="jni_env">
12441         <outptr>
12442           <struct>JNIEnv</struct>
12443         </outptr>
12444           <description>
12445             The JNI environment of the event (current) thread
12446           </description>
12447       </param>
12448       <param id="thread">
12449         <jthread/>
12450           <description>
12451             Thread generating the exception
12452           </description>
12453       </param>
12454       <param id="klass">
12455         <jclass method="method"/>
12456           <description>
12457             Class generating the exception
12458           </description>
12459       </param>
12460       <param id="method">
12461         <jmethodID class="klass"/>
12462           <description>
12463             Method generating the exception
12464           </description>
12465       </param>
12466       <param id="location">
12467         <jlocation/>
12468         <description>
12469           Location where exception occurred
12470         </description>
12471       </param>
12472       <param id="exception">
12473         <jobject/>
12474           <description>
12475             The exception being thrown
12476           </description>
12477       </param>
12478       <param id="catch_klass">
12479         <jclass method="catch_method"/>
12480           <description>
12481             Class that will catch the exception, or <code>NULL</code> if no known catch
12482           </description>
12483       </param>
12484       <param id="catch_method">
12485         <jmethodID class="catch_klass"/>
12486           <description>
12487             Method that will catch the exception, or <code>NULL</code> if no known catch
12488           </description>
12489       </param>
12490       <param id="catch_location">
12491         <jlocation/>
12492         <description>
12493           location which will catch the exception or zero if no known catch
12494         </description>
12495       </param>
12496     </parameters>
12497   </event>
12498 
12499   <event label="Exception Catch"
12500          id="ExceptionCatch" const="JVMTI_EVENT_EXCEPTION_CATCH" filtered="thread" num="59">
12501     <description>
12502       Exception catch events are generated whenever a thrown exception is caught.
12503       Where "exception" means any <code>java.lang.Throwable</code>.
12504       If the exception is caught in a Java programming language method, the event is generated
12505       when the catch clause is reached. If the exception is caught in a native
12506       method, the event is generated as soon as control is returned to a Java programming language 
12507       method. Exception catch events are generated for any exception for which
12508       a throw was detected in a Java programming language method.
12509       Note that finally clauses are implemented as catch and re-throw. Therefore they
12510       will generate exception catch events.
12511       <p/>
12512       The <code>method</code> and <code>location</code>
12513       parameters uniquely identify the current location 
12514       and allow the mapping to source file and line number when that information is 
12515       available. For exceptions caught in a Java programming language method, the 
12516       <code>exception</code> object identifies the exception object. Exceptions
12517       caught in native methods are not necessarily available by the time the 
12518       exception catch is reported, so the <code>exception</code> field is set
12519       to <code>NULL</code>.
12520     </description>
12521     <origin>jvmdi</origin>
12522     <capabilities>
12523       <required id="can_generate_exception_events"></required>
12524     </capabilities>
12525     <parameters> 
12526       <param id="jni_env">
12527         <outptr>
12528           <struct>JNIEnv</struct>
12529         </outptr>
12530           <description>
12531             The JNI environment of the event (current) thread
12532           </description>
12533       </param>
12534       <param id="thread">
12535         <jthread/>
12536           <description>
12537             Thread catching the exception
12538           </description>
12539       </param>
12540       <param id="klass">
12541         <jclass method="method"/>
12542           <description>
12543             Class catching the exception
12544           </description>
12545       </param>
12546       <param id="method">
12547         <jmethodID class="klass"/>
12548           <description>
12549             Method catching the exception
12550           </description>
12551       </param>
12552       <param id="location">
12553         <jlocation/>
12554         <description>
12555           Location where exception is being caught
12556         </description>
12557       </param>
12558       <param id="exception">
12559         <jobject/>
12560           <description>
12561             Exception being caught
12562           </description>
12563       </param>
12564     </parameters>
12565   </event>
12566 
12567   <event label="Thread Start"
12568          id="ThreadStart" const="JVMTI_EVENT_THREAD_START" num="52" phase="start">
12569     <description>
12570       Thread start events are generated by a new thread before its initial
12571       method executes. 
12572       <p/>
12573       A thread may be listed in the array returned by
12574       <functionlink id="GetAllThreads"></functionlink>
12575       before its thread start event is generated. 
12576       It is possible for other events to be generated
12577       on a thread before its thread start event.
12578       <p/>
12579       The event is sent on the newly started <paramlink id="thread"></paramlink>.
12580     </description>
12581     <origin>jvmdi</origin>
12582     <capabilities>
12583     </capabilities>
12584     <parameters> 
12585       <param id="jni_env">
12586         <outptr>
12587           <struct>JNIEnv</struct>
12588         </outptr>
12589           <description>
12590             The JNI environment of the event (current) thread.
12591           </description>
12592       </param>
12593       <param id="thread">
12594         <jthread/>
12595           <description>
12596             Thread starting
12597           </description>
12598       </param>
12599     </parameters>
12600   </event>
12601 
12602   <event label="Thread End"
12603          id="ThreadEnd" const="JVMTI_EVENT_THREAD_END" filtered="thread" num="53" phase="start"> 
12604     <description>
12605       Thread end events are generated by a terminating thread
12606       after its initial method has finished execution. 
12607       <p/>
12608       A thread may be listed in the array returned by
12609       <functionlink id="GetAllThreads"></functionlink>
12610       after its thread end event is generated. 
12611       No events are generated on a thread
12612       after its thread end event.
12613       <p/>
12614       The event is sent on the dying <paramlink id="thread"></paramlink>.
12615     </description>
12616     <origin>jvmdi</origin>
12617     <capabilities>
12618     </capabilities>
12619     <parameters> 
12620       <param id="jni_env">
12621         <outptr>
12622           <struct>JNIEnv</struct>
12623         </outptr>
12624           <description>
12625             The JNI environment of the event (current) thread.
12626           </description>
12627       </param>
12628       <param id="thread">
12629         <jthread/>
12630           <description>
12631             Thread ending
12632           </description>
12633       </param>
12634     </parameters>
12635   </event>
12636 
12637   <event label="Class Load"
12638          id="ClassLoad" const="JVMTI_EVENT_CLASS_LOAD" filtered="thread" phase="start" num="55">
12639     <description>
12640       A class load event is generated when a class is first loaded. The order
12641       of class load events generated by a particular thread are guaranteed
12642       to match the order of class loading within that thread. 
12643       Array class creation does not generate a class load event.
12644       The creation of a primitive class (for example, java.lang.Integer.TYPE) 
12645       does not generate a class load event.
12646       <p/>
12647       This event is sent at an early stage in loading the class. As
12648       a result the class should be used carefully.  Note, for example,
12649       that methods and fields are not yet loaded, so queries for methods,
12650       fields, subclasses, and so on will not give correct results. 
12651       See "Loading of Classes and Interfaces" in the <i>Java Language
12652       Specification</i>.  For most
12653       purposes the <eventlink id="ClassPrepare"></eventlink> event will
12654       be more useful.
12655     </description>
12656     <origin>jvmdi</origin>
12657     <capabilities>
12658     </capabilities>
12659     <parameters> 
12660       <param id="jni_env">
12661         <outptr>
12662           <struct>JNIEnv</struct>
12663         </outptr>
12664           <description>
12665             The JNI environment of the event (current) thread
12666           </description>
12667       </param>
12668       <param id="thread">
12669         <jthread/>
12670           <description>
12671             Thread loading the class
12672           </description>
12673       </param>
12674       <param id="klass">
12675         <jclass/>
12676           <description>
12677             Class being loaded
12678           </description>
12679       </param>
12680     </parameters>
12681   </event>
12682 
12683   <elide>
12684   <event label="Class Unload"
12685          id="ClassUnload" const="JVMTI_EVENT_CLASS_UNLOAD" num="57">
12686     <description>
12687       A class unload event is generated when the class is about to be unloaded.
12688       Class unload events take place during garbage collection and must be 
12689       handled extremely carefully. The garbage collector holds many locks
12690       and has suspended all other threads, so the event handler cannot depend
12691       on the ability to acquire any locks. The class unload event handler should
12692       do as little as possible, perhaps by queuing information to be processed
12693       later.  In particular, the <code>jclass</code> should be used only in
12694       the JNI function <code>isSameObject</code> or in the following <jvmti/> functions:
12695       <ul>
12696         <li><functionlink id="GetClassSignature"></functionlink></li>
12697         <li><functionlink id="GetSourceFileName"></functionlink></li>
12698         <li><functionlink id="IsInterface"></functionlink></li>
12699         <li><functionlink id="IsArrayClass"></functionlink></li>
12700       </ul>
12701     </description>
12702     <origin>jvmdi</origin>
12703     <capabilities>
12704     </capabilities>
12705     <parameters> 
12706       <param id="jni_env">
12707         <outptr>
12708           <struct>JNIEnv</struct>
12709         </outptr>
12710           <description>
12711             The JNI environment of the event (current) thread
12712           </description>
12713       </param>
12714       <param id="thread">
12715         <jthread/>
12716           <description>
12717             Thread generating the class unload
12718           </description>
12719       </param>
12720       <param id="klass">
12721         <jclass/>
12722           <description>
12723             Class being unloaded
12724           </description>
12725       </param>
12726     </parameters>
12727   </event>
12728   </elide>
12729 
12730   <event label="Class Prepare"
12731          id="ClassPrepare" const="JVMTI_EVENT_CLASS_PREPARE" filtered="thread" phase="start" num="56">
12732     <description>
12733       A class prepare event is generated when class preparation is complete.
12734       At this point, class fields, methods, and implemented interfaces are 
12735       available, and no code from the class has been executed. Since array 
12736       classes never have fields or methods, class prepare events are not 
12737       generated for them. Class prepare events are not generated for 
12738       primitive classes (for example, <code>java.lang.Integer.TYPE</code>). 
12739     </description>
12740     <origin>jvmdi</origin>
12741     <capabilities>
12742     </capabilities>
12743     <parameters> 
12744       <param id="jni_env">
12745         <outptr>
12746           <struct>JNIEnv</struct>
12747         </outptr>
12748           <description>
12749             The JNI environment of the event (current) thread
12750           </description>
12751       </param>
12752       <param id="thread">
12753         <jthread/>
12754           <description>
12755             Thread generating the class prepare
12756           </description>
12757       </param>
12758       <param id="klass">
12759         <jclass/>
12760           <description>
12761             Class being prepared
12762           </description>
12763       </param>
12764     </parameters>
12765   </event>
12766 
12767   <event label="Class File Load Hook" phase="any"
12768          id="ClassFileLoadHook" const="JVMTI_EVENT_CLASS_FILE_LOAD_HOOK" num="54">
12769     <description>
12770       This event is sent when the VM obtains class file data,
12771       but before it constructs
12772       the in-memory representation for that class. 
12773       This event is also sent when the class is being modified by the 
12774       <functionlink id="RetransformClasses"/> function or
12775       the <functionlink id="RedefineClasses"/> function,
12776       called in any <jvmti/> environment.
12777       The agent can instrument
12778       the existing class file data sent by the VM to include profiling/debugging hooks.
12779       See the description of 
12780       <internallink id="bci">bytecode instrumentation</internallink>
12781       for usage information.
12782       <p/>
12783     When the capabilities
12784     <internallink id="jvmtiCapabilities.can_generate_early_class_hook_events">
12785     <code>can_generate_early_class_hook_events</code></internallink> and
12786     <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events">
12787     <code>can_generate_all_class_hook_events</code></internallink>
12788     are enabled then this event may be sent in the primordial phase.
12789     Otherwise, this event may be sent before the VM is initialized (the start 
12790     <functionlink id="GetPhase">phase</functionlink>).
12791     Some classes might not be compatible
12792     with the function (eg. ROMized classes or implementation defined classes) and this event will
12793     not be generated for these classes.
12794     <p/>
12795     The agent must allocate the space for the modified 
12796     class file data buffer
12797     using the memory allocation function 
12798     <functionlink id="Allocate"></functionlink> because the
12799     VM is responsible for freeing the new class file data buffer
12800     using <functionlink id="Deallocate"></functionlink>.
12801     <p/>
12802     If the agent wishes to modify the class file, it must set 
12803     <code>new_class_data</code> to point
12804     to the newly instrumented class file data buffer and set
12805     <code>new_class_data_len</code> to the length of that 
12806     buffer before returning
12807     from this call.  If no modification is desired, the agent simply
12808     does not set <code>new_class_data</code>.  If multiple agents
12809     have enabled this event the results are chained. That is, if
12810     <code>new_class_data</code> has been set, it becomes the 
12811     <code>class_data</code> for the next agent.
12812     <p/>
12813     When handling a class load in the live phase, then the
12814     <functionlink id="GetNamedModule"></functionlink>
12815     function can be used to map class loader and a package name to a module.
12816     When a class is being redefined or retransformed then
12817     <code>class_being_redefined</code> is non <code>NULL</code> and so
12818     the JNI <code>GetModule</code> function can also be used
12819     to obtain the Module.
12820     <p/>
12821     The order that this event is sent to each environment differs
12822     from other events.
12823     This event is sent to environments in the following order:
12824     <ul>
12825       <li><fieldlink id="can_retransform_classes"
12826                      struct="jvmtiCapabilities">retransformation
12827                                                 incapable</fieldlink>
12828           environments, in the 
12829           order in which they were created
12830       </li>
12831       <li><fieldlink id="can_retransform_classes"
12832                      struct="jvmtiCapabilities">retransformation
12833                                                 capable</fieldlink>
12834           environments, in the 
12835           order in which they were created
12836       </li>
12837     </ul>
12838     When triggered by <functionlink id="RetransformClasses"/>,
12839     this event is sent only to <fieldlink id="can_retransform_classes"
12840                      struct="jvmtiCapabilities">retransformation
12841                                                 capable</fieldlink>
12842     environments.
12843   </description>
12844   <origin>jvmpi</origin>
12845     <capabilities>
12846       <capability id="can_generate_all_class_hook_events"></capability>
12847       <capability id="can_generate_early_class_hook_events"></capability>
12848     </capabilities>
12849     <parameters>
12850       <param id="jni_env">
12851         <outptr>
12852           <struct>JNIEnv</struct>
12853         </outptr>
12854           <description>
12855             The JNI environment of the event (current) thread.
12856           </description>
12857       </param>
12858       <param id="class_being_redefined">
12859         <jclass/>
12860         <description>
12861           The class being
12862           <functionlink id="RedefineClasses">redefined</functionlink> or
12863           <functionlink id="RetransformClasses">retransformed</functionlink>.
12864           <code>NULL</code> if sent by class load.
12865         </description>
12866       </param>
12867       <param id="loader">
12868         <jobject/>
12869           <description>
12870             The class loader loading the class.  
12871             <code>NULL</code> if the bootstrap class loader.
12872           </description>
12873       </param>
12874       <param id="name">
12875         <vmbuf><char/></vmbuf>
12876         <description>
12877             Name of class being loaded as a VM internal qualified name
12878             (for example, "java/util/List"), encoded as a
12879             <internallink id="mUTF">modified UTF-8</internallink> string.
12880             Note: if the class is defined with a <code>NULL</code> name or
12881             without a name specified, <code>name</code> will be <code>NULL</code>.
12882         </description>
12883       </param>
12884       <param id="protection_domain">
12885         <jobject/>
12886         <description>
12887           The <code>ProtectionDomain</code> of the class.
12888         </description>
12889       </param>
12890       <param id="class_data_len">
12891         <jint/>
12892         <description>
12893           Length of current class file data buffer.
12894         </description>
12895       </param>
12896       <param id="class_data">
12897         <vmbuf><uchar/></vmbuf>
12898         <description>
12899           Pointer to the current class file data buffer.
12900         </description>
12901       </param>
12902       <param id="new_class_data_len">
12903         <outptr><jint/></outptr>
12904         <description>
12905           Pointer to the length of the new class file data buffer.
12906         </description>
12907       </param>
12908       <param id="new_class_data">
12909         <agentbuf incount="new_class_data_len"><uchar/></agentbuf>
12910         <description>
12911           Pointer to the pointer to the instrumented class file data buffer.
12912         </description>
12913       </param>
12914     </parameters>
12915   </event>
12916 
12917   <event label="VM Start Event"
12918          id="VMStart" const="JVMTI_EVENT_VM_START" num="57" phase="start">
12919     <description>
12920       The VM start event signals the start of the VM.
12921       At this time JNI is live but the VM is not yet fully initialized.
12922       Once this event is generated, the agent is free to call any JNI function.
12923       This event signals the beginning of the start phase,
12924       <jvmti/> functions permitted in the start phase may be called.
12925       <p/>
12926       The timing of this event may depend on whether the agent has added the
12927       <internallink id="jvmtiCapabilities.can_generate_early_vmstart">
12928       <code>can_generate_early_vmstart</code></internallink> capability or not.
12929       If the capability has been added then the VM posts the event as early
12930       as possible. The VM is capable of executing bytecode but it may not have
12931       initialized to the point where it can load classes in modules other than
12932       <code>java.base</code>, or even arbitrary classes in <code>java.base</code>.
12933       Agents that do load-time instrumentation in this
12934       phase must take great care when instrumenting code that potentially
12935       executes in this phase. Extreme care should also be taken with JNI
12936       <code>FindClass</code> as it may not be possible to load classes and attempts
12937       to do so may result in unpredictable behavior, maybe even stability issues
12938       on some VM implementations.
12939       If the capability has not been added then the VM delays posting this
12940       event until it is capable of loading classes in modules other than
12941       <code>java.base</code> or the VM has completed its initialization.
12942       Agents that create more than one JVM TI environment, where the
12943       capability is added to some but not all environments, may observe the
12944       start phase beginning earlier in the JVM TI environments that possess
12945       the capabilty.
12946       <p/>
12947       In the case of VM start-up failure, this event will not be sent.
12948     </description>
12949     <origin>jvmdi</origin>
12950     <capabilities>
12951     </capabilities>
12952     <parameters>
12953       <param id="jni_env">
12954         <outptr>
12955           <struct>JNIEnv</struct>
12956         </outptr>
12957           <description>
12958             The JNI environment of the event (current) thread.
12959           </description>
12960       </param>
12961     </parameters>
12962   </event>
12963 
12964   <event label="VM Initialization Event"
12965          id="VMInit" const="JVMTI_EVENT_VM_INIT" num="50">
12966     <description>
12967       The VM initialization event signals the completion of VM initialization. Once
12968       this event is generated, the agent is free to call any JNI or <jvmti/>
12969       function. The VM initialization event can be preceded by or can be concurrent
12970       with other events, but
12971       the preceding events should be handled carefully, if at all, because the
12972       VM has not completed its initialization. The thread start event for the
12973       main application thread is guaranteed not to occur until after the 
12974       handler for the VM initialization event returns.
12975       <p/>
12976       In the case of VM start-up failure, this event will not be sent.
12977     </description>
12978     <origin>jvmdi</origin>
12979     <capabilities>
12980     </capabilities>
12981     <parameters>
12982       <param id="jni_env">
12983         <outptr>
12984           <struct>JNIEnv</struct>
12985         </outptr>
12986           <description>
12987             The JNI environment of the event (current) thread.
12988           </description>
12989       </param>
12990       <param id="thread">
12991         <jthread/>
12992           <description>
12993             The initial thread
12994           </description>
12995       </param>
12996     </parameters>
12997   </event>
12998 
12999   <event label="VM Death Event"
13000          id="VMDeath" const="JVMTI_EVENT_VM_DEATH" num="51">
13001     <description>
13002       The VM death event notifies the agent of the termination of the VM. 
13003       No events will occur after the VMDeath event.
13004       <p/>
13005       In the case of VM start-up failure, this event will not be sent.
13006       Note that <internallink id="onunload">Agent_OnUnload</internallink>
13007       will still be called in these cases.
13008     </description>
13009     <origin>jvmdi</origin>
13010     <capabilities>
13011     </capabilities>
13012     <parameters>
13013       <param id="jni_env">
13014         <outptr>
13015           <struct>JNIEnv</struct>
13016         </outptr>
13017           <description>
13018             The JNI environment of the event (current) thread
13019           </description>
13020       </param>
13021     </parameters>
13022   </event>
13023 
13024   <event label="Compiled Method Load" phase="start"
13025          id="CompiledMethodLoad" const="JVMTI_EVENT_COMPILED_METHOD_LOAD" num="68">
13026     <description>
13027       Sent when a method is compiled and loaded into memory by the VM.
13028       If it is unloaded, the <eventlink id="CompiledMethodUnload"/> event is sent.
13029       If it is moved, the <eventlink id="CompiledMethodUnload"/> event is sent,
13030       followed by a new <code>CompiledMethodLoad</code> event.
13031       Note that a single method may have multiple compiled forms, and that
13032       this event will be sent for each form.
13033       Note also that several methods may be inlined into a single 
13034       address range, and that this event will be sent for each method.
13035       <p/>
13036       These events can be sent after their initial occurrence with
13037       <functionlink id="GenerateEvents"></functionlink>.
13038     </description>
13039     <origin>jvmpi</origin>
13040     <typedef id="jvmtiAddrLocationMap" label="Native address to location entry">
13041       <field id="start_address">
13042         <vmbuf><void/></vmbuf>
13043         <description>
13044           Starting native address of code corresponding to a location
13045         </description>
13046       </field>
13047       <field id="location">
13048         <jlocation/>
13049         <description>
13050           Corresponding location. See 
13051           <functionlink id="GetJLocationFormat"></functionlink>
13052           for the meaning of location.
13053         </description>
13054       </field>
13055     </typedef>
13056     <capabilities>
13057       <required id="can_generate_compiled_method_load_events"></required>
13058     </capabilities>
13059     <parameters>
13060       <param id="klass">
13061         <jclass method="method"/>
13062           <description>
13063             Class of the method being compiled and loaded
13064           </description>
13065       </param>
13066       <param id="method">
13067         <jmethodID class="klass"/>
13068           <description>
13069             Method being compiled and loaded
13070           </description>
13071       </param>
13072       <param id="code_size">
13073         <jint/>
13074         <description>
13075           Size of compiled code
13076         </description>
13077       </param>
13078       <param id="code_addr">
13079         <vmbuf><void/></vmbuf>
13080         <description>
13081           Address where compiled method code is loaded
13082         </description>
13083       </param>
13084       <param id="map_length">
13085         <jint/>
13086         <description>
13087           Number of <typelink id="jvmtiAddrLocationMap"></typelink>
13088           entries in the address map.
13089           Zero if mapping information cannot be supplied.
13090         </description>
13091       </param>
13092       <param id="map">
13093         <vmbuf><struct>jvmtiAddrLocationMap</struct></vmbuf>
13094         <description>
13095           Map from native addresses to location.
13096           The native address range of each entry is from 
13097           <fieldlink id="start_address" struct="jvmtiAddrLocationMap"></fieldlink>
13098           to <code>start_address-1</code> of the next entry.
13099           <code>NULL</code> if mapping information cannot be supplied.
13100         </description>
13101       </param>
13102       <param id="compile_info">
13103         <vmbuf><void/></vmbuf>
13104         <description>
13105           VM-specific compilation information.  
13106           The referenced compile information is managed by the VM
13107           and must not depend on the agent for collection.
13108           A VM implementation defines the content and lifetime 
13109           of the information.
13110         </description>
13111       </param>
13112     </parameters>
13113   </event>
13114 
13115   <event label="Compiled Method Unload" phase="start"
13116          id="CompiledMethodUnload" const="JVMTI_EVENT_COMPILED_METHOD_UNLOAD" num="69">
13117     <description>
13118       Sent when a compiled method is unloaded from memory.
13119       This event might not be sent on the thread which performed the unload.
13120       This event may be sent sometime after the unload occurs, but 
13121       will be sent before the memory is reused
13122       by a newly generated compiled method. This event may be sent after 
13123       the class is unloaded.
13124     </description>
13125     <origin>jvmpi</origin>
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 compiled method being unloaded.
13134           </description>
13135       </param>
13136       <param id="method">
13137         <jmethodID class="klass"/>
13138           <description>
13139             Compiled method being unloaded.
13140             For identification of the compiled method only -- the class 
13141             may be unloaded and therefore the method should not be used
13142             as an argument to further JNI or <jvmti/> functions.
13143           </description>
13144       </param>
13145       <param id="code_addr">
13146         <vmbuf><void/></vmbuf>
13147         <description>
13148           Address where compiled method code was loaded.
13149           For identification of the compiled method only -- 
13150           the space may have been reclaimed.
13151         </description>
13152       </param>
13153     </parameters>
13154   </event>
13155 
13156   <event label="Dynamic Code Generated" phase="any"
13157          id="DynamicCodeGenerated" const="JVMTI_EVENT_DYNAMIC_CODE_GENERATED" num="70">
13158     <description>
13159       Sent when a component of the virtual machine is generated dynamically.
13160       This does not correspond to Java programming language code that is
13161       compiled--see <eventlink id="CompiledMethodLoad"></eventlink>.
13162       This is for native code--for example, an interpreter that is generated
13163       differently depending on command-line options.
13164       <p/>
13165       Note that this event has no controlling capability.
13166       If a VM cannot generate these events, it simply does not send any.
13167       <p/>
13168       These events can be sent after their initial occurrence with
13169       <functionlink id="GenerateEvents"></functionlink>.
13170     </description>
13171     <origin>jvmpi</origin>
13172     <capabilities>
13173     </capabilities>
13174     <parameters>
13175       <param id="name">
13176         <vmbuf><char/></vmbuf>
13177         <description>
13178           Name of the code, encoded as a
13179           <internallink id="mUTF">modified UTF-8</internallink> string.
13180           Intended for display to an end-user.
13181           The name might not be unique.
13182         </description>
13183       </param>
13184       <param id="address">
13185         <vmbuf><void/></vmbuf>
13186         <description>
13187           Native address of the code
13188         </description>
13189       </param>
13190       <param id="length">
13191         <jint/>
13192         <description>
13193           Length in bytes of the code
13194         </description>
13195       </param>
13196     </parameters>
13197   </event>
13198 
13199   <event label="Data Dump Request"
13200          id="DataDumpRequest" const="JVMTI_EVENT_DATA_DUMP_REQUEST" num="71">
13201     <description>
13202       Sent by the VM to request the agent to dump its data.  This
13203       is just a hint and the agent need not react to this event.
13204       This is useful for processing command-line signals from users.  For
13205       example, in the Java 2 SDK a CTRL-Break on Win32 and a CTRL-\ on Solaris
13206       causes the VM to send this event to the agent.
13207     </description>
13208     <origin>jvmpi</origin>
13209     <capabilities>
13210     </capabilities>
13211     <parameters>
13212     </parameters>
13213   </event>
13214 
13215   <event label="Monitor Contended Enter"
13216          id="MonitorContendedEnter" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTER" filtered="thread" num="75">
13217     <description>
13218       Sent when a thread is attempting to enter a Java programming language
13219       monitor already acquired by another thread.
13220     </description>
13221     <origin>jvmpi</origin>
13222     <capabilities>
13223       <required id="can_generate_monitor_events"></required>
13224     </capabilities>
13225     <parameters>
13226       <param id="jni_env">
13227         <outptr>
13228           <struct>JNIEnv</struct>
13229         </outptr>
13230           <description>
13231             The JNI environment of the event (current) thread
13232           </description>
13233       </param>
13234       <param id="thread">
13235         <jthread/>
13236           <description>
13237             JNI local reference to the thread 
13238             attempting to enter the monitor
13239           </description>
13240       </param>
13241       <param id="object">
13242         <jobject/>
13243           <description>
13244             JNI local reference to the monitor
13245           </description>
13246       </param>
13247     </parameters>
13248   </event>
13249 
13250   <event label="Monitor Contended Entered"
13251          id="MonitorContendedEntered" const="JVMTI_EVENT_MONITOR_CONTENDED_ENTERED" filtered="thread" num="76">
13252     <description>
13253       Sent when a thread enters a Java programming language
13254       monitor after waiting for it to be released by another thread.
13255     </description>
13256     <origin>jvmpi</origin>
13257     <capabilities>
13258       <required id="can_generate_monitor_events"></required>
13259     </capabilities>
13260     <parameters>
13261       <param id="jni_env">
13262         <outptr>
13263           <struct>JNIEnv</struct>
13264         </outptr>
13265           <description>
13266             The JNI environment of the event (current) thread
13267           </description>
13268       </param>
13269       <param id="thread">
13270         <jthread/>
13271           <description>
13272             JNI local reference to the thread entering
13273             the monitor
13274           </description>
13275       </param>
13276       <param id="object">
13277         <jobject/>
13278           <description>
13279             JNI local reference to the monitor
13280           </description>
13281       </param>
13282     </parameters>
13283   </event>
13284 
13285   <event label="Monitor Wait"
13286          id="MonitorWait" const="JVMTI_EVENT_MONITOR_WAIT" filtered="thread" num="73">
13287     <description>
13288       Sent when a thread is about to wait on an object.
13289     </description>
13290     <origin>jvmpi</origin>
13291     <capabilities>
13292       <required id="can_generate_monitor_events"></required>
13293     </capabilities>
13294     <parameters>
13295       <param id="jni_env">
13296         <outptr>
13297           <struct>JNIEnv</struct>
13298         </outptr>
13299           <description>
13300             The JNI environment of the event (current) thread
13301           </description>
13302       </param>
13303       <param id="thread">
13304         <jthread/>
13305           <description>
13306             JNI local reference to the thread about to wait
13307           </description>
13308       </param>
13309       <param id="object">
13310         <jobject/>
13311           <description>
13312             JNI local reference to the monitor
13313           </description>
13314       </param>
13315       <param id="timeout">
13316         <jlong/>
13317         <description>
13318           The number of milliseconds the thread will wait
13319         </description>
13320       </param>
13321     </parameters>
13322   </event>
13323 
13324   <event label="Monitor Waited"
13325          id="MonitorWaited" const="JVMTI_EVENT_MONITOR_WAITED" filtered="thread" num="74">
13326     <description>
13327       Sent when a thread finishes waiting on an object.
13328     </description>
13329     <origin>jvmpi</origin>
13330     <capabilities>
13331       <required id="can_generate_monitor_events"></required>
13332     </capabilities>
13333     <parameters>
13334       <param id="jni_env">
13335         <outptr>
13336           <struct>JNIEnv</struct>
13337         </outptr>
13338           <description>
13339             The JNI environment of the event (current) thread
13340           </description>
13341       </param>
13342       <param id="thread">
13343         <jthread/>
13344           <description>
13345             JNI local reference to the thread that was finished waiting
13346           </description>
13347       </param>
13348       <param id="object">
13349         <jobject/>
13350           <description>
13351             JNI local reference to the monitor.
13352           </description>
13353       </param>
13354       <param id="timed_out">
13355         <jboolean/>
13356         <description>
13357           True if the monitor timed out
13358         </description>
13359       </param>
13360     </parameters>
13361   </event>
13362 
13363   <event label="Resource Exhausted"
13364          id="ResourceExhausted" const="JVMTI_EVENT_RESOURCE_EXHAUSTED" num="80"
13365          since="1.1">
13366     <description>
13367       Sent when a VM resource needed by a running application has been exhausted.
13368       Except as required by the optional capabilities, the set of resources 
13369       which report exhaustion is implementation dependent.
13370       <p/>
13371       The following bit flags define the properties of the resource exhaustion:
13372       <constants id="jvmtiResourceExhaustionFlags" 
13373                  label="Resource Exhaustion Flags" 
13374                  kind="bits" 
13375                  since="1.1">
13376         <constant id="JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR" num="0x0001">
13377           After this event returns, the VM will throw a
13378           <code>java.lang.OutOfMemoryError</code>.
13379         </constant>         
13380         <constant id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP" num="0x0002">
13381           The VM was unable to allocate memory from the <tm>Java</tm> 
13382           platform <i>heap</i>.
13383           The <i>heap</i> is the runtime
13384           data area from which memory for all class instances and
13385           arrays are allocated.
13386         </constant>         
13387         <constant id="JVMTI_RESOURCE_EXHAUSTED_THREADS" num="0x0004">
13388           The VM was unable to create a thread.
13389         </constant>         
13390       </constants>
13391     </description>
13392     <origin>new</origin>
13393     <capabilities>
13394       <capability id="can_generate_resource_exhaustion_heap_events">
13395         Can generate events when the VM is unable to allocate memory from the
13396         <internallink id="JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP">heap</internallink>.
13397       </capability>
13398       <capability id="can_generate_resource_exhaustion_threads_events">
13399         Can generate events when the VM is unable to 
13400         <internallink id="JVMTI_RESOURCE_EXHAUSTED_THREADS">create
13401         a thread</internallink>.
13402       </capability>
13403     </capabilities>
13404     <parameters>
13405       <param id="jni_env">
13406         <outptr>
13407           <struct>JNIEnv</struct>
13408         </outptr>
13409           <description>
13410             The JNI environment of the event (current) thread
13411           </description>
13412       </param>
13413       <param id="flags">
13414         <jint/>
13415         <description>
13416           Flags defining the properties of the of resource exhaustion
13417           as specified by the 
13418           <internallink id="jvmtiResourceExhaustionFlags">Resource 
13419           Exhaustion Flags</internallink>.
13420           </description>
13421         </param>
13422       <param id="reserved">
13423         <vmbuf><void/></vmbuf>
13424         <description>
13425           Reserved.
13426         </description>
13427       </param>
13428       <param id="description">
13429         <vmbuf><char/></vmbuf>
13430         <description>
13431           Description of the resource exhaustion, encoded as a
13432           <internallink id="mUTF">modified UTF-8</internallink> string.
13433         </description>
13434       </param>
13435     </parameters>
13436   </event>
13437 
13438   <event label="VM Object Allocation"
13439          id="VMObjectAlloc" const="JVMTI_EVENT_VM_OBJECT_ALLOC" num="84">
13440     <description>
13441       Sent when a method causes the virtual machine to allocate an 
13442       Object visible to Java programming language code and the
13443       allocation is not detectable by other intrumentation mechanisms.
13444       Generally object allocation should be detected by instrumenting
13445       the bytecodes of allocating methods.
13446       Object allocation generated in native code by JNI function
13447       calls should be detected using 
13448       <internallink id="jniIntercept">JNI function interception</internallink>.
13449       Some methods might not have associated bytecodes and are not 
13450       native methods, they instead are executed directly by the 
13451       VM. These methods should send this event.
13452       Virtual machines which are incapable of bytecode instrumentation
13453       for some or all of their methods can send this event.
13454       <p/>
13455       Typical examples where this event might be sent:
13456       <ul>
13457         <li>Reflection -- for example, <code>java.lang.Class.newInstance()</code></li>
13458         <li>Methods not represented by bytecodes -- for example, VM intrinsics and
13459             J2ME preloaded classes</li>
13460       </ul>
13461       Cases where this event would not be generated:
13462       <ul>
13463         <li>Allocation due to bytecodes -- for example, the <code>new</code>
13464             and <code>newarray</code> VM instructions</li>
13465         <li>Allocation due to JNI function calls -- for example,
13466             <code>AllocObject</code></li>
13467         <li>Allocations during VM initialization</li>
13468         <li>VM internal objects</li>
13469       </ul>
13470     </description>
13471     <origin>new</origin>
13472     <capabilities>
13473       <required id="can_generate_vm_object_alloc_events"></required>
13474     </capabilities>
13475     <parameters>
13476       <param id="jni_env">
13477         <outptr>
13478           <struct>JNIEnv</struct>
13479         </outptr>
13480           <description>
13481             The JNI environment of the event (current) thread
13482           </description>
13483       </param>
13484       <param id="thread">
13485         <jthread/>
13486           <description>
13487             Thread allocating the object.
13488           </description>
13489       </param>
13490       <param id="object">
13491         <jobject/>
13492           <description>
13493             JNI local reference to the object that was allocated
13494           </description>
13495       </param>
13496       <param id="object_klass">
13497         <jclass/>
13498           <description>
13499             JNI local reference to the class of the object
13500           </description>
13501       </param>
13502       <param id="size">
13503         <jlong/>
13504         <description>
13505             Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
13506         </description>
13507       </param>
13508     </parameters>
13509   </event>
13510 
13511   <event label="Object Free"
13512          id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83">
13513     <description>
13514       An Object Free event is sent when the garbage collector frees an object.
13515       Events are only sent for tagged objects--see
13516       <internallink id="Heap">heap functions</internallink>.
13517       <p/>
13518       The event handler must not use JNI functions and
13519       must not use <jvmti/> functions except those which
13520       specifically allow such use (see the raw monitor, memory management,
13521       and environment local storage functions).
13522     </description>
13523     <origin>new</origin>
13524     <capabilities>
13525       <required id="can_generate_object_free_events"></required>
13526     </capabilities>
13527     <parameters>
13528       <param id="tag">
13529         <jlong/>
13530         <description>
13531           The freed object's tag
13532         </description>
13533       </param>
13534     </parameters>
13535   </event>
13536 
13537   <event label="Garbage Collection Start"
13538          id="GarbageCollectionStart" const="JVMTI_EVENT_GARBAGE_COLLECTION_START" num="81">
13539     <description>
13540       A Garbage Collection Start event is sent when a 
13541       garbage collection pause begins.
13542       Only stop-the-world collections are reported--that is, collections during
13543       which all threads cease to modify the state of the Java virtual machine.
13544       This means that some collectors will never generate these events.
13545       This event is sent while the VM is still stopped, thus
13546       the event handler must not use JNI functions and
13547       must not use <jvmti/> functions except those which
13548       specifically allow such use (see the raw monitor, memory management,
13549       and environment local storage functions).
13550       <p/>
13551       This event is always sent as a matched pair with 
13552       <eventlink id="GarbageCollectionFinish"/> 
13553       (assuming both events are enabled) and no garbage collection
13554       events will occur between them.
13555     </description>
13556     <origin>new</origin>
13557     <capabilities>
13558       <required id="can_generate_garbage_collection_events"></required>
13559     </capabilities>
13560     <parameters>
13561     </parameters>
13562   </event>
13563 
13564   <event label="Garbage Collection Finish"
13565          id="GarbageCollectionFinish" const="JVMTI_EVENT_GARBAGE_COLLECTION_FINISH" num="82">
13566     <description>
13567       A Garbage Collection Finish event is sent when a
13568       garbage collection pause ends.
13569       This event is sent while the VM is still stopped, thus
13570       the event handler must not use JNI functions and
13571       must not use <jvmti/> functions except those which
13572       specifically allow such use (see the raw monitor, memory management,
13573       and environment local storage functions).
13574       <p/>
13575       Some agents may need to do post garbage collection operations that
13576       require the use of the disallowed <jvmti/> or JNI functions. For these
13577       cases an agent thread can be created which waits on a raw monitor,
13578       and the handler for the Garbage Collection Finish event simply
13579       notifies the raw monitor
13580       <p/>
13581       This event is always sent as a matched pair with 
13582       <eventlink id="GarbageCollectionStart"/> (assuming both events are enabled).
13583       <issue>
13584         The most important use of this event is to provide timing information,
13585         and thus additional information is not required.  However,  
13586         information about the collection which is "free" should be included -
13587         what that information is needs to be determined.
13588       </issue>
13589     </description>
13590     <origin>new</origin>
13591     <capabilities>
13592       <required id="can_generate_garbage_collection_events"></required>
13593     </capabilities>
13594     <parameters>
13595     </parameters>
13596   </event>
13597 
13598   <elide>
13599   <event label="Verbose Output" phase="any"
13600          id="VerboseOutput" const="JVMTI_EVENT_VERBOSE_OUTPUT" num="85">
13601     <description>
13602       Send verbose messages as strings.
13603         <issue>
13604           This format is extremely fragile, as it can change with each
13605           platform, collector and version.  Alternatives include:
13606           <ul>
13607             <li>building off Java programming language M and M APIs</li>
13608             <li>XML</li>
13609             <li>key/value pairs</li>
13610             <li>removing it</li>
13611           </ul>
13612         </issue>
13613         <issue>
13614           Though this seemed trivial to implement.  
13615           In the RI it appears this will be quite complex.
13616         </issue>
13617     </description>
13618     <origin>new</origin>
13619     <capabilities>
13620     </capabilities>
13621     <parameters>
13622       <param id="flag">
13623         <enum>jvmtiVerboseFlag</enum>
13624         <description>
13625           Which verbose output is being sent.
13626         </description>
13627       </param>
13628       <param id="message">
13629         <vmbuf><char/></vmbuf>
13630         <description>
13631           Message text, encoded as a
13632           <internallink id="mUTF">modified UTF-8</internallink> string.
13633         </description>
13634       </param>
13635     </parameters>
13636   </event>
13637   </elide>
13638 
13639 </eventsection>
13640 
13641 <datasection>
13642   <intro>
13643     <jvmti/> extends the data types defined by JNI.
13644   </intro>
13645   <basetypes id="jniTypes" label="JNI Types Used in the JVM Tool Interface">
13646     <basetype id="jboolean">
13647       <description>
13648         Holds a Java programming language <code>boolean</code>.
13649         Unsigned 8 bits.
13650       </description>
13651     </basetype>
13652     <basetype id="jchar">
13653       <description>
13654         Holds a Java programming language <code>char</code>.
13655         Unsigned 16 bits.
13656       </description>
13657     </basetype>
13658     <basetype id="jint">
13659       <description>
13660         Holds a Java programming language <code>int</code>. 
13661         Signed 32 bits.
13662       </description>
13663     </basetype>
13664     <basetype id="jlong">
13665       <description>
13666         Holds a Java programming language <code>long</code>. 
13667         Signed 64 bits.
13668       </description>
13669     </basetype>
13670     <basetype id="jfloat">
13671       <description>
13672         Holds a Java programming language <code>float</code>. 
13673         32 bits.
13674       </description>
13675     </basetype>
13676     <basetype id="jdouble">
13677       <description>
13678         Holds a Java programming language <code>double</code>. 
13679         64 bits.
13680       </description>
13681     </basetype>
13682     <basetype id="jobject">
13683       <description>
13684         Holds a Java programming language object. 
13685       </description>
13686     </basetype>
13687     <basetype id="jclass">
13688       <description>
13689         Holds a Java programming language class. 
13690       </description>
13691     </basetype>
13692     <basetype id="jvalue">
13693       <description>
13694         Is a union of all primitive types and <code>jobject</code>.  Thus, holds any Java 
13695         programming language value. 
13696       </description>
13697     </basetype>
13698     <basetype id="jfieldID">
13699       <description>
13700         Identifies a Java programming language field. 
13701         <code>jfieldID</code>s returned by <jvmti/> functions and events may be
13702         safely stored.
13703       </description>
13704     </basetype>
13705     <basetype id="jmethodID">
13706       <description>
13707         Identifies a Java programming language method, initializer, or constructor. 
13708         <code>jmethodID</code>s returned by <jvmti/> functions and events may be
13709         safely stored.  However, if the class is unloaded, they become invalid
13710         and must not be used.
13711       </description>
13712     </basetype>
13713     <basetype id="JNIEnv">
13714       <description>
13715         Pointer to the JNI function table.  Pointer to this (<code>JNIEnv *</code>)
13716         is a JNI environment. 
13717       </description>
13718     </basetype>
13719   </basetypes>
13720 
13721   <basetypes id="jvmtiTypes" label="JVM Tool Interface Base Types">
13722     <basetype id="jvmtiEnv">
13723       <description>
13724         The <jvmti/> <internallink id="environments">environment</internallink> pointer. 
13725         See the <internallink id="FunctionSection">Function Section</internallink>.
13726         <code>jvmtiEnv</code> points to the 
13727         <internallink id="FunctionTable">function table</internallink> pointer.
13728       </description>
13729     </basetype>
13730     <basetype id="jthread">
13731       <definition>typedef jobject jthread;</definition>
13732       <description>
13733         Subtype of <datalink id="jobject"></datalink> that holds a thread.
13734       </description>
13735     </basetype>
13736     <basetype id="jthreadGroup">
13737       <definition>typedef jobject jthreadGroup;</definition>
13738       <description>
13739         Subtype of <datalink id="jobject"></datalink> that holds a thread group.
13740       </description>
13741     </basetype>
13742     <basetype id="jlocation">
13743       <definition>typedef jlong jlocation;</definition>
13744       <description>
13745         A 64 bit value, representing a monotonically increasing 
13746         executable position within a method. 
13747         <code>-1</code> indicates a native method.
13748         See <functionlink id="GetJLocationFormat"></functionlink> for the format on a
13749         given VM.
13750       </description>
13751     </basetype>
13752     <basetype id="jrawMonitorID">
13753       <definition>struct _jrawMonitorID;
13754 typedef struct _jrawMonitorID *jrawMonitorID;</definition>
13755       <description>
13756         A raw monitor.
13757       </description>
13758     </basetype>
13759     <basetype id="jvmtiError">
13760       <description>
13761         Holds an error return code.
13762         See the <internallink id="ErrorSection">Error section</internallink> for possible values.
13763         <example>
13764 typedef enum { 
13765     JVMTI_ERROR_NONE = 0,  
13766     JVMTI_ERROR_INVALID_THREAD = 10,
13767       ... 
13768 } jvmtiError;
13769 </example>
13770       </description>
13771     </basetype>
13772     <basetype id="jvmtiEvent">
13773       <description>
13774         An identifier for an event type.
13775         See the <internallink id="EventSection">Event section</internallink> for possible values.
13776         It is guaranteed that future versions of this specification will 
13777         never assign zero as an event type identifier.
13778 <example>
13779 typedef enum { 
13780     JVMTI_EVENT_SINGLE_STEP = 1, 
13781     JVMTI_EVENT_BREAKPOINT = 2, 
13782       ... 
13783 } jvmtiEvent;
13784 </example>
13785       </description>
13786     </basetype>
13787     <basetype id="jvmtiEventCallbacks">
13788       <description>
13789         The callbacks used for events.
13790 <example>
13791 typedef struct {
13792     jvmtiEventVMInit VMInit;
13793     jvmtiEventVMDeath VMDeath;
13794       ... 
13795 } jvmtiEventCallbacks;
13796 </example>
13797         See <internallink id="jvmtiEventCallbacks">event callbacks</internallink> 
13798         for the complete structure.
13799         <p/>
13800         Where, for example, the VM initialization callback is defined:
13801 <example>
13802 typedef void (JNICALL *jvmtiEventVMInit)
13803     (jvmtiEnv *jvmti_env, 
13804      JNIEnv* jni_env,
13805      jthread thread);
13806 </example>
13807         See the individual events for the callback function definition.
13808       </description>
13809     </basetype>
13810     <basetype id="jniNativeInterface">
13811       <definition>typedef struct JNINativeInterface_ jniNativeInterface;</definition>
13812       <description>
13813         Typedef for the JNI function table <code>JNINativeInterface</code>
13814         defined in the 
13815         <externallink id="docs/technotes/guides/jni/spec/functions.html#interface_function_table">
13816           JNI Specification</externallink>.
13817         The JNI reference implementation defines this with an underscore.
13818       </description>
13819     </basetype>
13820   </basetypes>
13821 
13822 </datasection>
13823 
13824 <issuessection label="Issues">
13825   <intro id="suspendRequired" label="Resolved Issue: Suspend - Required or Automatic">
13826     JVMDI requires that the agent suspend threads before calling
13827     certain sensitive functions.  JVMPI requires garbage collection to be 
13828     disabled before calling certain sensitive functions. 
13829     It was suggested that rather than have this requirement, that
13830     VM place itself in a suitable state before performing an
13831     operation.  This makes considerable sense since each VM
13832     knows its requirements and can most easily arrange a
13833     safe state.  
13834     <p/>
13835     The ability to externally suspend/resume threads will, of
13836     course, remain.  The ability to enable/disable garbage collection will not.
13837     <p/>
13838     This issue is resolved--suspend will not
13839     be required.  The spec has been updated to reflect this.
13840   </intro>
13841   
13842   <intro id="stackSampling" label="Resolved Issue: Call Stack Sampling">
13843     There are a variety of approaches to sampling call stacks.
13844     The biggest bifurcation is between VM controlled and agent
13845     controlled.  
13846     <p/>
13847     This issue is resolved--agent controlled
13848     sampling will be the approach.
13849   </intro>
13850   
13851   <intro id="threadRepresentation" label="Resolved Issue: Thread Representation">
13852     JVMDI represents threads as jthread.  JVMPI primarily
13853     uses JNIEnv* to represent threads.  
13854     <p/>
13855     The Expert Group has chosen jthread as the representation
13856     for threads in <jvmti/>.
13857     JNIEnv* is sent by
13858     events since it is needed to JNI functions.  JNIEnv, per the
13859     JNI spec, are not supposed to be used outside their thread.
13860   </intro>
13861 
13862   <intro id="design" label="Resolved Issue: Method Representation">
13863     The JNI spec allows an implementation to depend on jclass/jmethodID
13864     pairs, rather than simply a jmethodID, to reference a method.  
13865     JVMDI, for consistency, choose the same representation.  
13866     JVMPI, however, specifies that a jmethodID alone maps to a
13867     method.  Both of the Sun <tm>J2SE</tm> virtual machines (Classic and <tm>HotSpot</tm>) store
13868     pointers in jmethodIDs, and as a result, a jmethodID is sufficient.
13869     In fact, any JVM implementation that supports JVMPI must have
13870     such a representation.  
13871     <jvmti/> will use jmethodID as a unique representation of a method
13872     (no jclass is used).
13873     There should be efficiency gains, particularly in 
13874     functionality like stack dumping, to this representation.
13875     <p/>
13876     Note that fields were not used in JVMPI and that the access profile
13877     of fields differs from methods--for implementation efficiency 
13878     reasons, a jclass/jfieldID pair will still be needed for field 
13879     reference.
13880   </intro>
13881 
13882   <intro id="localReferenceIssue" label="Resolved Issue: Local References">
13883     Functions return local references. 
13884   </intro>
13885 
13886   <intro id="frameRep" label="Resolved Issue: Representation of frames">
13887     In JVMDI, a frame ID is used to represent a frame.  Problem with this
13888     is that a VM must track when a frame becomes invalid, a far better
13889     approach, and the one used in <jvmti/>, is to reference frames by depth.
13890   </intro>
13891 
13892   <intro id="requiredCapabilities" label="Issue: Required Capabilities">
13893     Currently, having a required capabilities means that the functionality
13894     is optional.   Capabilities are useful even for required functionality
13895     since they can inform the VM is needed set-up.  Thus, there should be
13896     a set of capabilities that a conformant implementation must provide
13897     (if requested during Agent_OnLoad).
13898   </intro>
13899 
13900   <intro id="taghint" label="Proposal: add tag hint function">
13901     A hint of the percentage of objects that will be tagged would 
13902     help the VM pick a good implementation.
13903   </intro>
13904 
13905   <intro id="moreMonitorQueries" label="Request: More Monitor Quires">
13906   How difficult or easy would be to extend the monitor_info category to include 
13907     <pre>
13908   - current number of monitors 
13909   - enumeration of monitors 
13910   - enumeration of threads waiting on a given monitor 
13911     </pre>
13912   The reason for my question is the fact that current get_monitor_info support 
13913   requires the agent to specify a given thread to get the info which is probably 
13914   OK in the profiling/debugging space, while in the monitoring space the agent 
13915   could be watching the monitor list and then decide which thread to ask for 
13916   the info. You might ask why is this important for monitoring .... I think it 
13917   can aid in the detection/prediction of application contention caused by hot-locks.
13918   </intro>
13919 </issuessection>
13920 
13921 <changehistory id="ChangeHistory" update="09/05/07">
13922   <intro>
13923     The <jvmti/> specification is an evolving document with major, minor, 
13924     and micro version numbers.
13925     A released version of the specification is uniquely identified
13926     by its major and minor version.
13927     The functions, events, and capabilities in this specification 
13928     indicate a "Since" value which is the major and minor version in
13929     which it was introduced.
13930     The version of the specification implemented by the VM can 
13931     be retrieved at runtime with the <functionlink id="GetVersionNumber"/> 
13932     function.
13933   </intro>
13934   <change date="14 Nov 2002">
13935     Converted to XML document.
13936   </change>
13937   <change date="14 Nov 2002">
13938     Elided heap dump functions (for now) since what was there
13939     was wrong.
13940   </change>
13941   <change date="18 Nov 2002">
13942     Added detail throughout.
13943   </change>
13944   <change date="18 Nov 2002">
13945     Changed JVMTI_THREAD_STATUS_RUNNING to JVMTI_THREAD_STATUS_RUNNABLE.
13946   </change>
13947   <change date="19 Nov 2002">
13948     Added AsyncGetStackTrace.
13949   </change>
13950   <change date="19 Nov 2002">
13951     Added jframeID return to GetStackTrace.
13952   </change>
13953   <change date="19 Nov 2002">
13954     Elided GetCurrentFrame and GetCallingFrame functions (for now) since what was there
13955     since they are redundant with GetStackTrace.
13956   </change>
13957   <change date="19 Nov 2002">
13958     Elided ClearAllBreakpoints since it has always been redundant.
13959   </change>
13960   <change date="19 Nov 2002">
13961     Added GetSystemProperties.
13962   </change>
13963   <change date="19 Nov 2002">
13964     Changed the thread local storage functions to use jthread.
13965   </change>
13966   <change date="20 Nov 2002">
13967     Added GetJLocationFormat.
13968   </change>
13969   <change date="22 Nov 2002">
13970     Added events and introductory text.
13971   </change>
13972   <change date="22 Nov 2002">
13973     Cross reference type and constant definitions.
13974   </change>
13975   <change date="24 Nov 2002">
13976     Added DTD.
13977   </change>
13978   <change date="24 Nov 2002">
13979     Added capabilities function section.
13980   </change>
13981   <change date="29 Nov 2002">
13982     Assign capabilities to each function and event.
13983   </change>
13984   <change date="29 Nov 2002">
13985     Add <internallink id="jniIntercept">JNI interception functions</internallink>.
13986   </change>
13987   <change date="30 Nov 2002">
13988     Auto generate SetEventNotificationMode capabilities.
13989   </change>
13990   <change date="30 Nov 2002">
13991     Add <eventlink id="VMObjectAlloc"></eventlink> event.
13992   </change>
13993   <change date="30 Nov 2002">
13994     Add <eventlink id="DynamicCodeGenerated"></eventlink> event.
13995   </change>
13996   <change date="30 Nov 2002">
13997     Add const to declarations.
13998   </change>
13999   <change date="30 Nov 2002">
14000     Change method exit and frame pop to send on exception.
14001   </change>
14002   <change date="1 Dec 2002">
14003     Add ForceGarbageCollection.
14004   </change>
14005   <change date="2 Dec 2002">
14006     Redo Xrun section; clarify GetStackTrace and add example;
14007     Fix width problems; use "agent" consistently.
14008   </change>
14009   <change date="8 Dec 2002">
14010     Remove previous start-up intro.
14011     Add <internallink id="environments"><jvmti/> Environments</internallink>
14012     section.
14013   </change>
14014   <change date="8 Dec 2002">
14015     Add <functionlink id="DisposeEnvironment"></functionlink>.
14016   </change>
14017   <change date="9 Dec 2002">
14018     Numerous minor updates.
14019   </change>
14020   <change date="15 Dec 2002">
14021     Add heap profiling functions added:
14022     get/set annotation, iterate live objects/heap.
14023     Add heap profiling functions place holder added:
14024     heap roots.
14025     Heap profiling event added: object free. 
14026     Heap profiling event redesigned: vm object allocation. 
14027     Heap profiling event placeholders added: garbage collection start/finish. 
14028     Native method bind event added.
14029   </change>
14030   <change date="19 Dec 2002">
14031     Revamp suspend/resume functions.
14032     Add origin information with jvmdi tag.
14033     Misc fixes.
14034   </change>
14035   <change date="24 Dec 2002">
14036     Add semantics to types.
14037   </change>
14038   <change date="27 Dec 2002">
14039     Add local reference section.
14040     Autogenerate parameter descriptions from types.
14041   </change>
14042   <change date="28 Dec 2002">
14043     Document that RunAgentThread sends threadStart.
14044   </change>
14045   <change date="29 Dec 2002">
14046     Remove redundant local ref and dealloc warning.
14047     Convert GetRawMonitorName to allocated buffer.
14048     Add GenerateEvents.
14049   </change>
14050   <change date="30 Dec 2002">
14051     Make raw monitors a type and rename to "jrawMonitorID".
14052   </change>
14053   <change date="1 Jan 2003">
14054     Include origin information.
14055     Clean-up JVMDI issue references.
14056     Remove Deallocate warnings which are now automatically generated.
14057   </change>
14058   <change date="2 Jan 2003">
14059     Fix representation issues for jthread.
14060   </change>
14061   <change date="3 Jan 2003">
14062     Make capabilities buffered out to 64 bits - and do it automatically.
14063   </change>
14064   <change date="4 Jan 2003">
14065     Make constants which are enumeration into enum types.
14066     Parameters now of enum type.
14067     Clean-up and index type section.
14068     Replace remaining datadef entities with callback.
14069   </change>
14070   <change date="7 Jan 2003">
14071     Correct GenerateEvents description.
14072     More internal semantics work.
14073   </change>
14074   <change date="9 Jan 2003">
14075     Replace previous GetSystemProperties with two functions
14076     which use allocated information instead fixed.
14077     Add SetSystemProperty.
14078     More internal semantics work.
14079   </change>
14080   <change date="12 Jan 2003">
14081     Add varargs to end of SetEventNotificationMode.
14082   </change>
14083   <change date="20 Jan 2003">
14084     Finish fixing spec to reflect that alloc sizes are jlong.
14085   </change>
14086   <change date="22 Jan 2003">
14087     Allow NULL as RunAgentThread arg.
14088   </change>
14089   <change date="22 Jan 2003">
14090     Fixed names to standardized naming convention
14091     Removed AsyncGetStackTrace.
14092   </change>
14093   <change date="29 Jan 2003">
14094     Since we are using jthread, removed GetThread.
14095   </change>
14096   <change date="31 Jan 2003">
14097     Change GetFieldName to allow NULLs like GetMethodName.
14098   </change>
14099   <change date="29 Feb 2003" version="v40">
14100       Rewrite the introductory text, adding sections on
14101       start-up, environments and bytecode instrumentation.
14102       Change the command line arguments per EG discussions.
14103       Add an introduction to the capabilities section.
14104       Add the extension mechanism category and functions.
14105       Mark for deletion, but clarified anyhow, SuspendAllThreads.
14106       Rename IterateOverLiveObjects to IterateOverReachableObjects and
14107       change the text accordingly.
14108       Clarify IterateOverHeap.
14109       Clarify CompiledMethodLoad.
14110       Discuss prerequisite state for Calling Functions.
14111       Clarify SetAllocationHooks.
14112       Added issues ("To be resolved:") through-out.
14113       And so on...
14114   </change>
14115   <change date="6 Mar 2003" version="v41">
14116       Remove struct from the call to GetOwnedMonitorInfo.
14117       Automatically generate most error documentation, remove
14118       (rather broken) hand written error doc.
14119       Better describe capability use (empty initial set).
14120       Add min value to jint params.
14121       Remove the capability can_access_thread_local_storage.
14122       Rename error JVMTI_ERROR_NOT_IMPLEMENTED to JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
14123       same for *NOT_IMPLEMENTED.
14124       Description fixes.
14125   </change>
14126   <change date="8 Mar 2003" version="v42">
14127       Rename GetClassSignature to GetClassName.
14128       Rename IterateOverClassObjects to IterateOverInstancesOfClass.
14129       Remove GetMaxStack (operand stack isn't used in <jvmti/>).
14130       Description fixes: define launch-time, remove native frame pop
14131       from PopFrame, and assorted clarifications.
14132   </change>
14133   <change date="8 Mar 2003" version="v43">
14134       Fix minor editing problem.
14135   </change>
14136   <change date="10 Mar 2003" version="v44">
14137       Add phase information.
14138       Remap (compact) event numbers.
14139   </change>
14140   <change date="11 Mar 2003" version="v45">
14141       More phase information - allow "any".
14142       Elide raw monitor queries and events.
14143       Minor description fixes.
14144   </change>
14145   <change date="12 Mar 2003" version="v46">
14146       Add GetPhase.
14147       Use "phase" through document.
14148       Elide GetRawMonitorName.
14149       Elide GetObjectMonitors.
14150   </change>
14151   <change date="12 Mar 2003" version="v47">
14152       Fixes from link, XML, and spell checking.
14153       Auto-generate the callback structure.
14154   </change>
14155   <change date="13 Mar 2003" version="v48">
14156       One character XML fix.
14157   </change>
14158   <change date="13 Mar 2003" version="v49">
14159       Change function parameter names to be consistent with 
14160       event parameters (fooBarBaz becomes foo_bar_baz).
14161   </change>
14162   <change date="14 Mar 2003" version="v50">
14163       Fix broken link.  Fix thread markers.
14164   </change>
14165   <change date="14 Mar 2003" version="v51">
14166       Change constants so they are under 128 to workaround
14167       compiler problems.
14168   </change>
14169   <change date="23 Mar 2003" version="v52">
14170       Overhaul capabilities.  Separate GetStackTrace into
14171       GetStackTrace and GetStackFrames.
14172   </change>
14173   <change date="8 Apr 2003" version="v54">
14174       Use depth instead of jframeID to reference frames.
14175       Remove the now irrelevant GetCurrentFrame, GetCallerFrame and GetStackFrames.
14176       Remove frame arg from events.
14177   </change>
14178   <change date="9 Apr 2003" version="v55">
14179       Remove GetObjectWithAnnotation since tests show bufferred approach more efficient.
14180       Add missing annotation_count to GetObjectsWithAnnotations
14181   </change>
14182   <change date="10 Apr 2003" version="v56">
14183       Remove confusing parenthetical statement in GetObjectsWithAnnotations
14184   </change>
14185   <change date="13 Apr 2003" version="v58">
14186       Replace jclass/jmethodID representation of method with simply jmethodID;
14187       Pass JvmtiEnv* as first arg of every event; remove JNIEnv* where inappropriate.
14188       Replace can_access_frames with can_access_local_variables; remove from purely stack access.
14189       Use can_get_synthetic_attribute; fix description.
14190       Clarify that zero length arrays must be deallocated.
14191       Clarify RelinquishCapabilities.
14192       Generalize JVMTI_ERROR_VM_DEAD to JVMTI_ERROR_WRONG_PHASE.
14193   </change>
14194   <change date="27 Apr 2003" version="v59">
14195       Remove lingering indirect references to OBSOLETE_METHOD_ID.
14196   </change>
14197   <change date="4 May 2003" version="v60">
14198       Allow DestroyRawMonitor during OnLoad.
14199   </change>
14200   <change date="7 May 2003" version="v61">
14201       Added not monitor owner error return to DestroyRawMonitor.
14202   </change>
14203   <change date="13 May 2003" version="v62">
14204       Clarify semantics of raw monitors.
14205       Change flags on <code>GetThreadStatus</code>.
14206       <code>GetClassLoader</code> return NULL for the bootstrap class loader.
14207       Add <code>GetClassName</code> issue.
14208       Define local variable signature.
14209       Disallow zero in annotations array of <code>GetObjectsWithAnnotations</code>.
14210       Remove over specification in <code>GetObjectsWithAnnotations</code>.
14211       Elide <code>SetAllocationHooks</code>.
14212       Elide <code>SuspendAllThreads</code>.
14213   </change>
14214   <change date="14 May 2003" version="v63">
14215       Define the data type <code>jvmtiEventCallbacks</code>.
14216       Zero length allocations return NULL.  
14217       Keep SetAllocationHooks in JVMDI, but remove from <jvmti/>.  
14218       Add JVMTI_THREAD_STATUS_FLAG_INTERRUPTED.
14219   </change>
14220   <change date="15 May 2003" version="v64">
14221       Better wording, per review.
14222   </change>
14223   <change date="15 May 2003" version="v65">
14224       First Alpha.
14225       Make jmethodID and jfieldID unique, jclass not used.
14226   </change>
14227   <change date="27 May 2003" version="v66">
14228       Fix minor XSLT errors.
14229   </change>
14230   <change date="13 June 2003" version="v67">
14231       Undo making jfieldID unique (jmethodID still is).
14232   </change>
14233   <change date="17 June 2003" version="v68">
14234       Changes per June 11th Expert Group meeting --
14235       Overhaul Heap functionality: single callback, 
14236       remove GetHeapRoots, add reachable iterators,
14237       and rename "annotation" to "tag".
14238       NULL thread parameter on most functions is current
14239       thread.
14240       Add timers.
14241       Remove ForceExit.
14242       Add GetEnvironmentLocalStorage.
14243       Add verbose flag and event.
14244       Add AddToBootstrapClassLoaderSearch.
14245       Update ClassFileLoadHook.
14246   </change>
14247   <change date="18 June 2003" version="v69">
14248       Clean up issues sections.
14249       Rename GetClassName back to GetClassSignature and
14250       fix description.
14251       Add generic signature to GetClassSignature, 
14252       GetFieldSignature, GetMethodSignature, and 
14253       GetLocalVariableTable.
14254       Elide EstimateCostOfCapabilities.
14255       Clarify that the system property functions operate
14256       on the VM view of system properties.
14257       Clarify Agent_OnLoad.
14258       Remove "const" from JNIEnv* in events.
14259       Add metadata accessors.
14260   </change>
14261   <change date="18 June 2003" version="v70">
14262       Add start_depth to GetStackTrace.
14263       Move system properties to a new category.
14264       Add GetObjectSize.
14265       Remove "X" from command line flags.
14266       XML, HTML, and spell check corrections.
14267   </change>
14268   <change date="19 June 2003" version="v71">
14269       Fix JVMTI_HEAP_ROOT_THREAD to be 6.
14270       Make each synopsis match the function name.
14271       Fix unclear wording.
14272   </change>
14273   <change date="26 June 2003" version="v72">
14274       SetThreadLocalStorage and SetEnvironmentLocalStorage should allow value
14275       to be set to NULL.
14276       NotifyFramePop, GetFrameLocationm and all the local variable operations
14277       needed to have their wording about frames fixed.
14278       Grammar and clarity need to be fixed throughout.
14279       Capitalization and puntuation need to be consistent.
14280       Need micro version number and masks for accessing major, minor, and micro.
14281       The error code lists should indicate which must be returned by
14282       an implementation.
14283       The command line properties should be visible in the properties functions.
14284       Disallow popping from the current thread.
14285       Allow implementations to return opaque frame error when they cannot pop.
14286       The NativeMethodBind event should be sent during any phase.
14287       The DynamicCodeGenerated event should be sent during any phase.
14288       The following functions should be allowed to operate before VMInit:
14289         Set/GetEnvironmentLocalStorage
14290         GetMethodDeclaringClass
14291         GetClassSignature
14292         GetClassModifiers
14293         IsInterface
14294         IsArrayClass
14295         GetMethodName
14296         GetMethodModifiers
14297         GetMaxLocals
14298         GetArgumentsSize
14299         GetLineNumberTable
14300         GetMethodLocation
14301         IsMethodNative
14302         IsMethodSynthetic.
14303       Other changes (to XSL):
14304       Argument description should show asterisk after not before pointers.
14305       NotifyFramePop, GetFrameLocationm and all the local variable operations
14306       should hsve the NO_MORE_FRAMES error added.
14307       Not alive threads should have a different error return than invalid thread.
14308   </change>
14309   <change date="7 July 2003" version="v73">
14310       VerboseOutput event was missing message parameter.
14311       Minor fix-ups.
14312   </change>
14313   <change date="14 July 2003" version="v74">
14314       Technical Publications Department corrections.
14315       Allow thread and environment local storage to be set to NULL.
14316   </change>
14317   <change date="23 July 2003" version="v75">
14318       Use new Agent_OnLoad rather than overloaded JVM_OnLoad.
14319       Add JNICALL to callbacks (XSL).
14320       Document JNICALL requirement for both events and callbacks (XSL).
14321       Restrict RedefineClasses to methods and attributes.
14322       Elide the VerboseOutput event.
14323       VMObjectAlloc: restrict when event is sent and remove method parameter.
14324       Finish loose ends from Tech Pubs edit.
14325   </change>
14326   <change date="24 July 2003" version="v76">
14327       Change ClassFileLoadHook event to send the class instead of a boolean of redefine.
14328   </change>
14329   <change date="24 July 2003" version="v77">
14330       XML fixes.
14331       Minor text clarifications and corrections.
14332   </change>
14333   <change date="24 July 2003" version="v78">
14334       Remove GetExceptionHandlerTable and GetThrownExceptions from <jvmti/>.
14335       Clarify that stack frames are JVM Spec frames.
14336       Split can_get_source_info into can_get_source_file_name, can_get_line_numbers,
14337       and can_get_source_debug_extension.
14338       PopFrame cannot have a native calling method.
14339       Removed incorrect statement in GetClassloaderClasses 
14340       (see <vmspec chapter="4.4"/>).
14341   </change>
14342   <change date="24 July 2003" version="v79">
14343       XML and text fixes.
14344       Move stack frame description into Stack Frame category.
14345   </change>
14346   <change date="26 July 2003" version="v80">
14347       Allow NULL (means bootstrap loader) for GetClassloaderClasses.
14348       Add new heap reference kinds for references from classes.
14349       Add timer information struct and query functions.
14350       Add AvailableProcessors.
14351       Rename GetOtherThreadCpuTime to GetThreadCpuTime.
14352       Explicitly add JVMTI_ERROR_INVALID_THREAD and JVMTI_ERROR_THREAD_NOT_ALIVE
14353       to SetEventNotification mode.
14354       Add initial thread to the VM_INIT event.
14355       Remove platform assumptions from AddToBootstrapClassLoaderSearch.
14356   </change>
14357   <change date="26 July 2003" version="v81">
14358       Grammar and clarity changes per review.
14359   </change>
14360   <change date="27 July 2003" version="v82">
14361       More grammar and clarity changes per review.
14362       Add Agent_OnUnload.
14363   </change>
14364   <change date="28 July 2003" version="v83">
14365       Change return type of Agent_OnUnload to void.
14366   </change>
14367   <change date="28 July 2003" version="v84">
14368       Rename JVMTI_REFERENCE_ARRAY to JVMTI_REFERENCE_ARRAY_ELEMENT.
14369   </change>
14370   <change date="28 July 2003" version="v85">
14371       Steal java.lang.Runtime.availableProcessors() wording for 
14372       AvailableProcessors().
14373       Guarantee that zero will never be an event ID.
14374       Remove some issues which are no longer issues.
14375       Per review, rename and more completely document the timer
14376       information functions.
14377   </change>
14378   <change date="29 July 2003" version="v86">
14379       Non-spec visible change to XML controlled implementation:
14380         SetThreadLocalStorage must run in VM mode.
14381   </change>
14382   <change date="5 August 2003" version="0.1.87">
14383       Add GetErrorName.
14384       Add varargs warning to jvmtiExtensionEvent.
14385       Remove "const" on the jvmtiEnv* of jvmtiExtensionEvent.
14386       Remove unused can_get_exception_info capability.
14387       Pass jvmtiEnv* and JNIEnv* to the jvmtiStartFunction.
14388       Fix jvmtiExtensionFunctionInfo.func declared type.
14389       Extension function returns error code.
14390       Use new version numbering.
14391   </change>
14392   <change date="5 August 2003" version="0.2.88">
14393       Remove the ClassUnload event.
14394   </change>
14395   <change date="8 August 2003" version="0.2.89">
14396       Heap reference iterator callbacks return an enum that 
14397       allows outgoing object references to be ignored.
14398       Allow JNIEnv as a param type to extension events/functions.
14399   </change>
14400   <change date="15 August 2003" version="0.2.90">
14401       Fix a typo.
14402   </change>
14403   <change date="2 September 2003" version="0.2.91">
14404       Remove all metadata functions: GetClassMetadata, 
14405       GetFieldMetadata, and GetMethodMetadata.
14406   </change>
14407   <change date="1 October 2003" version="0.2.92">
14408       Mark the functions Allocate. Deallocate, RawMonitor*, 
14409       SetEnvironmentLocalStorage, and GetEnvironmentLocalStorage 
14410       as safe for use in heap callbacks and GC events.
14411   </change>
14412   <change date="24 November 2003" version="0.2.93">
14413       Add pass through opaque user data pointer to heap iterate 
14414       functions and callbacks.
14415       In the CompiledMethodUnload event, send the code address.
14416       Add GarbageCollectionOccurred event.
14417       Add constant pool reference kind.
14418       Mark the functions CreateRawMonitor and DestroyRawMonitor
14419       as safe for use in heap callbacks and GC events.
14420       Clarify: VMDeath, GetCurrentThreadCpuTimerInfo, 
14421       GetThreadCpuTimerInfo, IterateOverReachableObjects,
14422       IterateOverObjectsReachableFromObject, GetTime and
14423       JVMTI_ERROR_NULL_POINTER.
14424       Add missing errors to: GenerateEvents and
14425       AddToBootstrapClassLoaderSearch.
14426       Fix description of ClassFileLoadHook name parameter.
14427       In heap callbacks and GC/ObjectFree events, specify
14428       that only explicitly allowed functions can be called.
14429       Allow GetCurrentThreadCpuTimerInfo, GetCurrentThreadCpuTime,
14430       GetTimerInfo, and GetTime during callback.
14431       Allow calling SetTag/GetTag during the onload phase.
14432       SetEventNotificationMode, add: error attempted inappropriate
14433       thread level control.
14434       Remove jvmtiExceptionHandlerEntry.
14435       Fix handling of native methods on the stack -- 
14436       location_ptr param of GetFrameLocation, remove 
14437       JVMTI_ERROR_OPAQUE_FRAME from GetFrameLocation,
14438       jvmtiFrameInfo.location, and jlocation.
14439       Remove typo (from JVMPI) implying that the MonitorWaited
14440       event is sent on sleep.
14441   </change>
14442   <change date="25 November 2003" version="0.2.94">
14443       Clarifications and typos.
14444   </change>
14445   <change date="3 December 2003" version="0.2.95">
14446       Allow NULL user_data in heap iterators.
14447   </change>
14448   <change date="28 January 2004" version="0.2.97">
14449       Add GetThreadState, deprecate GetThreadStatus.
14450   </change>
14451   <change date="29 January 2004" version="0.2.98">
14452       INVALID_SLOT and TYPE_MISMATCH errors should be optional.
14453   </change>
14454   <change date="12 February 2004" version="0.2.102">
14455       Remove MonitorContendedExit.
14456       Added JNIEnv parameter to VMObjectAlloc.
14457       Clarified definition of class_tag and referrer_index 
14458       parameters to heap callbacks.
14459   </change>
14460   <change date="16 Febuary 2004" version="0.2.103">
14461       Document JAVA_TOOL_OPTIONS.
14462   </change>
14463   <change date="17 Febuary 2004" version="0.2.105">
14464       Divide start phase into primordial and start.
14465       Add VMStart event
14466       Change phase associations of functions and events.
14467   </change>
14468   <change date="18 Febuary 2004" version="0.3.6">
14469       Elide deprecated GetThreadStatus.
14470       Bump minor version, subtract 100 from micro version
14471   </change>
14472   <change date="18 Febuary 2004" version="0.3.7">
14473       Document that timer nanosecond values are unsigned.
14474       Clarify text having to do with native methods.
14475   </change>
14476   <change date="19 Febuary 2004" version="0.3.8">
14477       Fix typos.
14478       Remove elided deprecated GetThreadStatus.
14479   </change>
14480   <change date="23 Febuary 2004" version="0.3.9">
14481       Require NotifyFramePop to act on suspended threads.
14482   </change>
14483   <change date="24 Febuary 2004" version="0.3.10">
14484       Add capabilities 
14485         (<internallink id="jvmtiCapabilities.can_redefine_any_class"
14486          ><code>can_redefine_any_class</code></internallink>
14487       and 
14488          <internallink id="jvmtiCapabilities.can_generate_all_class_hook_events"
14489          ><code>can_generate_all_class_hook_events</code></internallink>) 
14490       and an error (<errorlink id="JVMTI_ERROR_UNMODIFIABLE_CLASS"></errorlink>) 
14491       which allow some classes to be unmodifiable.
14492   </change>
14493   <change date="28 Febuary 2004" version="0.3.11">
14494       Add JVMTI_ERROR_MUST_POSSESS_CAPABILITY to SetEventNotificationMode.
14495   </change>
14496   <change date="8 March 2004" version="0.3.12">
14497       Clarified CompiledMethodUnload so that it is clear the event
14498       may be posted after the class has been unloaded.
14499   </change>
14500   <change date="5 March 2004" version="0.3.13">
14501       Change the size parameter of VMObjectAlloc to jlong to match GetObjectSize.
14502   </change>
14503   <change date="13 March 2004" version="0.3.14">
14504       Added guideline for the use of the JNI FindClass function in event
14505       callback functions.
14506   </change>
14507   <change date="15 March 2004" version="0.3.15">
14508       Add GetAllStackTraces and GetThreadListStackTraces.
14509   </change>
14510   <change date="19 March 2004" version="0.3.16">
14511       ClassLoad and ClassPrepare events can be posted during start phase.
14512   </change>
14513   <change date="25 March 2004" version="0.3.17">
14514       Add JVMTI_ERROR_NATIVE_METHOD to GetLineNumberTable, GetLocalVariableTable,
14515       GetMaxLocals, GetArgumentsSize, GetMethodLocation, GetBytecodes.
14516   </change>
14517   <change date="29 March 2004" version="0.3.18">
14518       Return the timer kind in the timer information structure.
14519   </change>
14520   <change date="31 March 2004" version="0.3.19">
14521       Spec clarifications:
14522       JVMTI_THREAD_STATE_IN_NATIVE might not include JNI or <jvmti/>.
14523       ForceGarbageCollection does not run finalizers.
14524       The context of the specification is the Java platform.
14525       Warn about early instrumentation.
14526   </change>
14527   <change date="1 April 2004" version="0.3.20">
14528       Refinements to the above clarifications and
14529       Clarify that an error returned by Agent_OnLoad terminates the VM.
14530   </change>
14531   <change date="1 April 2004" version="0.3.21">
14532       Array class creation does not generate a class load event.
14533   </change>
14534   <change date="7 April 2004" version="0.3.22">
14535       Align thread state hierarchy more closely with java.lang.Thread.State.
14536   </change>
14537   <change date="12 April 2004" version="0.3.23">
14538       Clarify the documentation of thread state.
14539   </change>
14540   <change date="19 April 2004" version="0.3.24">
14541       Remove GarbageCollectionOccurred event -- can be done by agent.
14542   </change>
14543   <change date="22 April 2004" version="0.3.25">
14544       Define "command-line option".
14545   </change>
14546   <change date="29 April 2004" version="0.3.26">
14547       Describe the intended use of bytecode instrumentation.
14548       Fix description of extension event first parameter.
14549   </change>
14550   <change date="30 April 2004" version="0.3.27">
14551       Clarification and typos.
14552   </change>
14553   <change date="18 May 2004" version="0.3.28">
14554       Remove DataDumpRequest event.
14555   </change>
14556   <change date="18 May 2004" version="0.3.29">
14557       Clarify RawMonitorWait with zero timeout.
14558       Clarify thread state after RunAgentThread.
14559   </change>
14560   <change date="24 May 2004" version="0.3.30">
14561       Clean-up: fix bad/old links, etc.
14562   </change>
14563   <change date="30 May 2004" version="0.3.31">
14564       Clarifications including:
14565       All character strings are modified UTF-8.
14566       Agent thread visibiity.
14567       Meaning of obsolete method version.
14568       Thread invoking heap callbacks,
14569   </change>
14570   <change date="1 June 2004" version="1.0.32">
14571       Bump major.minor version numbers to "1.0".
14572   </change>
14573   <change date="2 June 2004" version="1.0.33">
14574       Clarify interaction between ForceGarbageCollection 
14575       and ObjectFree.
14576   </change>
14577   <change date="6 June 2004" version="1.0.34">
14578       Restrict AddToBootstrapClassLoaderSearch and 
14579       SetSystemProperty to the OnLoad phase only.
14580   </change>
14581   <change date="11 June 2004" version="1.0.35">
14582       Fix typo in SetTag.
14583   </change>
14584   <change date="18 June 2004" version="1.0.36">
14585       Fix trademarks.
14586       Add missing parameter in example GetThreadState usage.
14587   </change>
14588   <change date="4 August 2004" version="1.0.37">
14589       Copyright updates.
14590   </change>
14591   <change date="5 November 2004" version="1.0.38">
14592       Add missing function table layout.
14593       Add missing description of C++ member function format of functions.
14594       Clarify that name in CFLH can be NULL.
14595       Released as part of <tm>J2SE</tm> 5.0.
14596   </change>
14597   <change date="24 April 2005" version="1.1.47">
14598       Bump major.minor version numbers to "1.1".
14599       Add ForceEarlyReturn* functions.
14600       Add GetOwnedMonitorStackDepthInfo function.
14601       Add GetCurrentThread function.
14602       Add "since" version marker.
14603       Add AddToSystemClassLoaderSearch.
14604       Allow AddToBootstrapClassLoaderSearch be used in live phase.
14605       Fix historic rubbish in the descriptions of the heap_object_callback 
14606       parameter of IterateOverHeap and IterateOverInstancesOfClass functions; 
14607       disallow NULL for this parameter.
14608       Clarify, correct and make consistent: wording about current thread,
14609       opaque frames and insufficient number of frames in PopFrame.
14610       Consistently use "current frame" rather than "topmost".
14611       Clarify the JVMTI_ERROR_TYPE_MISMATCH errors in GetLocal* and SetLocal*
14612       by making them compatible with those in ForceEarlyReturn*.
14613       Many other clarifications and wording clean ups.
14614   </change>
14615   <change date="25 April 2005" version="1.1.48">
14616       Add GetConstantPool.
14617       Switch references to the first edition of the VM Spec, to the seconds edition.
14618   </change>
14619   <change date="26 April 2005" version="1.1.49">
14620       Clarify minor/major version order in GetConstantPool.
14621   </change>
14622   <change date="26 April 2005" version="1.1.50">
14623       Add SetNativeMethodPrefix and SetNativeMethodPrefixes.
14624       Reassign GetOwnedMonitorStackDepthInfo to position 153.
14625       Break out Class Loader Search in its own documentation category.
14626       Deal with overly long lines in XML source.
14627   </change>
14628   <change date="29 April 2005" version="1.1.51">
14629       Allow agents be started in the live phase.
14630       Added paragraph about deploying agents.  
14631   </change>
14632   <change date="30 April 2005" version="1.1.52">
14633       Add specification description to SetNativeMethodPrefix(es).
14634       Better define the conditions on GetConstantPool.  
14635   </change>
14636   <change date="30 April 2005" version="1.1.53">
14637       Break out the GetClassVersionNumber function from GetConstantPool.
14638       Clean-up the references to the VM Spec.  
14639   </change>
14640   <change date="1 May 2005" version="1.1.54">
14641       Allow SetNativeMethodPrefix(es) in any phase.
14642       Add clarifications about the impact of redefinition on GetConstantPool.  
14643   </change>
14644   <change date="2 May 2005" version="1.1.56">
14645       Various clarifications to SetNativeMethodPrefix(es).
14646   </change>
14647   <change date="2 May 2005" version="1.1.57">
14648       Add missing performance warning to the method entry event.
14649   </change>
14650   <change date="5 May 2005" version="1.1.58">
14651       Remove internal JVMDI support.
14652   </change>
14653   <change date="8 May 2005" version="1.1.59">
14654       Add <functionlink id="RetransformClasses"/>.
14655       Revamp the bytecode instrumentation documentation.
14656       Change <functionlink id="IsMethodObsolete"/> to no longer 
14657       require the can_redefine_classes capability.
14658   </change>
14659   <change date="11 May 2005" version="1.1.63">
14660       Clarifications for retransformation.
14661   </change>
14662   <change date="11 May 2005" version="1.1.64">
14663       Clarifications for retransformation, per review.
14664       Lock "retransformation (in)capable" at class load enable time.
14665   </change>
14666   <change date="4 June 2005" version="1.1.67">
14667       Add new heap functionity which supports reporting primitive values,
14668       allows setting the referrer tag, and has more powerful filtering:
14669       FollowReferences, IterateThroughHeap, and their associated 
14670       callbacks, structs, enums, and constants.
14671   </change>
14672   <change date="4 June 2005" version="1.1.68">
14673       Clarification.
14674   </change>
14675   <change date="6 June 2005" version="1.1.69">
14676       FollowReferences, IterateThroughHeap: Put callbacks in a struct;
14677       Add missing error codes; reduce bits in the visit control flags.
14678   </change>
14679   <change date="14 June 2005" version="1.1.70">
14680       More on new heap functionity: spec clean-up per review.
14681   </change>
14682   <change date="15 June 2005" version="1.1.71">
14683       More on new heap functionity: Rename old heap section to Heap (1.0).
14684   </change>
14685   <change date="21 June 2005" version="1.1.72">
14686       Fix typos.
14687   </change>
14688   <change date="27 June 2005" version="1.1.73">
14689       Make referrer info structure a union.
14690   </change>
14691   <change date="9 September 2005" version="1.1.74">
14692       In new heap functions:
14693       Add missing superclass reference kind.
14694       Use a single scheme for computing field indexes.
14695       Remove outdated references to struct based referrer info.
14696   </change>
14697   <change date="12 September 2005" version="1.1.75">
14698       Don't callback during FollowReferences on frivolous java.lang.Object superclass.
14699   </change>
14700   <change date="13 September 2005" version="1.1.76">
14701       In string primitive callback, length now Unicode length.
14702       In array and string primitive callbacks, value now "const".
14703       Note possible compiler impacts on setting JNI function table.
14704   </change>
14705   <change date="13 September 2005" version="1.1.77">
14706       GetClassVersionNumbers() and GetConstantPool() should return
14707       error on array or primitive class.
14708   </change>
14709   <change date="14 September 2005" version="1.1.78">
14710       Grammar fixes.
14711   </change>
14712   <change date="26 September 2005" version="1.1.79">
14713       Add IsModifiableClass query.
14714   </change>
14715   <change date="9 February 2006" version="1.1.81">
14716       Add referrer_class_tag parameter to jvmtiHeapReferenceCallback.
14717   </change>
14718   <change date="13 February 2006" version="1.1.82">
14719       Doc fixes: update can_redefine_any_class to include retransform.
14720       Clarify that exception events cover all Throwables.
14721       In GetStackTrace, no test is done for start_depth too big if start_depth is zero,
14722       Clarify fields reported in Primitive Field Callback -- static vs instance.
14723       Repair confusing names of heap types, including callback names.
14724       Require consistent usage of stack depth in the face of thread launch methods.
14725       Note incompatibility of <jvmti/> memory management with other systems.
14726   </change>
14727   <change date="14 February 2006" version="1.1.85">
14728       Fix typos and missing renames.
14729   </change>
14730   <change date="13 March 2006" version="1.1.86">
14731       Clarify that jmethodIDs and jfieldIDs can be saved.
14732       Clarify that Iterate Over Instances Of Class includes subclasses.
14733   </change>
14734   <change date="14 March 2006" version="1.1.87">
14735       Better phrasing.
14736   </change>
14737   <change date="16 March 2006" version="1.1.88">
14738       Match the referrer_index for static fields in Object Reference Callback 
14739       with the Reference Implementation (and all other known implementations);
14740       that is, make it match the definition for instance fields.
14741       In GetThreadListStackTraces, add JVMTI_ERROR_INVALID_THREAD to cover 
14742       an invalid thread in the list; and specify that not started threads
14743       return empty stacks.
14744   </change>
14745   <change date="17 March 2006" version="1.1.89">
14746       Typo.
14747   </change>
14748   <change date="25 March 2006" version="1.1.90">
14749       Typo.
14750   </change>
14751   <change date="6 April 2006" version="1.1.91">
14752       Remove restrictions on AddToBootstrapClassLoaderSearch and
14753       AddToSystemClassLoaderSearch.
14754   </change>
14755   <change date="1 May 2006" version="1.1.93">
14756       Changed spec to return -1 for monitor stack depth for the
14757       implementation which can not determine stack depth. 
14758   </change>
14759   <change date="3 May 2006" version="1.1.94">
14760       Corrections for readability and accuracy courtesy of Alan Pratt of IBM. 
14761       List the object relationships reported in FollowReferences.
14762   </change>
14763   <change date="5 May 2006" version="1.1.95">
14764       Clarify the object relationships reported in FollowReferences.
14765   </change>
14766   <change date="28 June 2006" version="1.1.98">
14767       Clarify DisposeEnvironment; add warning.
14768       Fix typos in SetLocalXXX "retrieve" => "set".
14769       Clarify that native method prefixes must remain set while used.
14770       Clarify that exactly one Agent_OnXXX is called per agent.
14771       Clarify that library loading is independent from start-up.
14772       Remove ambiguous reference to Agent_OnLoad in the Agent_OnUnload spec.
14773   </change>
14774   <change date="31 July 2006" version="1.1.99">
14775       Clarify the interaction between functions and exceptions.
14776       Clarify and give examples of field indices.
14777       Remove confusing "That is" sentence from MonitorWait and MonitorWaited events.
14778       Update links to point to Java 6.
14779   </change>
14780   <change date="6 August 2006" version="1.1.102">
14781       Add ResourceExhaustedEvent.
14782   </change>
14783   <change date="11 October 2012" version="1.2.2">
14784       Fixed the "HTTP" and "Missing Anchor" errors reported by the LinkCheck tool.
14785   </change>
14786   <change date="19 June 2013" version="1.2.3">
14787       Added support for statically linked agents.
14788   </change>
14789   <change date="13 October 2016" version="9.0.0">
14790       Support for modules:
14791        - The majorversion is 9 now
14792        - The ClassFileLoadHook events are not sent during the primordial phase anymore.
14793        - Allow CompiledMethodLoad events at start phase
14794        - Add new capabilities:
14795           - can_generate_early_vmstart
14796           - can_generate_early_class_hook_events
14797        - Add new functions:
14798           - GetAllModules
14799           - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides
14800           - IsModifiableModule
14801       Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to
14802       disallow some implementation defined classes.
14803   </change>
14804   <change date="12 February 2017" version="9.0.0">
14805       Minor update for GetCurrentThread function:
14806        - The function may return NULL in the start phase if the
14807          can_generate_early_vmstart capability is enabled.
14808   </change>
14809 </changehistory>
14810 
14811 </specification>
14812 <!-- Keep this comment at the end of the file
14813 Local variables:
14814 mode: sgml
14815 sgml-omittag:t
14816 sgml-shorttag:t
14817 sgml-namecase-general:t
14818 sgml-general-insert-case:lower
14819 sgml-minimize-attributes:nil
14820 sgml-always-quote-attributes:t
14821 sgml-indent-step:2
14822 sgml-indent-data:t
14823 sgml-parent-document:nil
14824 sgml-exposed-tags:nil
14825 sgml-local-catalogs:nil
14826 sgml-local-ecat-files:nil
14827 End:
14828 -->